mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nadav Amit <nadav.amit@gmail.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	Gleb Natapov <gleb@kernel.org>,
	Nadav Amit <namit@cs.technion.ac.il>
Subject: Re: [PATCH 3/4] KVM: x86: allow 256 logical x2APICs again
Date: Thu, 27 Nov 2014 21:53:09 +0200	[thread overview]
Message-ID: <22F11C34-E2E4-459B-882B-A944AD0853FD@gmail.com> (raw)
In-Reply-To: <1417114994-25235-4-git-send-email-rkrcmar@redhat.com>

Radim Krčmář <rkrcmar@redhat.com> wrote:

> While fixing an x2apic bug,
> 17d68b7 KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376)
> we've made only one cluster available.  This means that the amount of
> logically addressible x2APICs was reduced to 16 and VCPUs kept
> overwriting themselves in that region, so even the first cluster wasn't
> set up correctly.
> 
> This patch extends x2APIC support back to the logical_map's limit, and
> keeps the CVE fixed as messages for non-present APICs are dropped.
> 
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
> arch/x86/kvm/lapic.c | 11 ++++++-----
> arch/x86/kvm/lapic.h |  2 --
> 2 files changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index 049d30f..f6e3369 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -132,8 +132,6 @@ static inline int kvm_apic_id(struct kvm_lapic *apic)
> 	return (kvm_apic_get_reg(apic, APIC_ID) >> 24) & 0xff;
> }
> 
> -#define KVM_X2APIC_CID_BITS 0
> -
> static void recalculate_apic_map(struct kvm *kvm)
> {
> 	struct kvm_apic_map *new, *old = NULL;
> @@ -163,8 +161,7 @@ static void recalculate_apic_map(struct kvm *kvm)
> 		if (apic_x2apic_mode(apic)) {
> 			new->ldr_bits = 32;
> 			new->cid_shift = 16;
> -			new->cid_mask = (1 << KVM_X2APIC_CID_BITS) - 1;
> -			new->lid_mask = 0xffff;
> +			new->cid_mask = new->lid_mask = 0xffff;
You set cid_mask to 0xffff, while there are only 16 clusters. I think it is
risky (if you twist my hand would come with a scenario). Yet, why not to set
cid_mask to (ARRAY_SIZE(map->logical_map) - 1) ?


Nadav

  reply	other threads:[~2014-11-27 19:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-27 19:03 [PATCH 0/4] KVM: x86: APIC fixes Radim Krčmář
2014-11-27 19:03 ` [PATCH 1/4] KVM: x86: deliver phys lowest-prio Radim Krčmář
2014-11-27 19:03 ` [PATCH 2/4] KVM: x86: fix APIC physical destination wrapping Radim Krčmář
2014-11-27 19:03 ` [PATCH 3/4] KVM: x86: allow 256 logical x2APICs again Radim Krčmář
2014-11-27 19:53   ` Nadav Amit [this message]
2014-11-27 20:16     ` Radim Krčmář
2014-11-27 20:39       ` Nadav Amit
2014-11-27 21:03         ` Radim Krčmář
2014-11-27 19:03 ` [PATCH 4/4] KVM: x86: don't retry hopeless APIC delivery Radim Krčmář
2014-11-27 22:30 ` [PATCH 5/4] KVM: x86: check bounds of APIC maps Radim Krčmář
2014-12-01 16:22 ` [PATCH 0/4] KVM: x86: APIC fixes Paolo Bonzini
2014-12-01 17:55   ` Radim Krčmář
2014-12-01 17:56     ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22F11C34-E2E4-459B-882B-A944AD0853FD@gmail.com \
    --to=nadav.amit@gmail.com \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namit@cs.technion.ac.il \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®