public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Nadav Amit <namit@cs.technion.ac.il>
Cc: gleb@kernel.org, pbonzini@redhat.com, tglx@linutronix.de,
	mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: Fix page-tables reserved bits
Date: Wed, 16 Apr 2014 16:03:29 -0300	[thread overview]
Message-ID: <20140416190329.GB8773@amt.cnet> (raw)
In-Reply-To: <1396582264-9864-1-git-send-email-namit@cs.technion.ac.il>

On Fri, Apr 04, 2014 at 06:31:04AM +0300, Nadav Amit wrote:
> KVM does not handle the reserved bits of x86 page tables correctly:
> In PAE, bits 5:8 are reserved in the PDPTE.
> In IA-32e, bit 8 is not reserved.
> 
> Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
> ---
>  arch/x86/kvm/mmu.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index f5704d9..3993976 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -3538,7 +3538,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu,
>  	case PT32E_ROOT_LEVEL:
>  		context->rsvd_bits_mask[0][2] =
>  			rsvd_bits(maxphyaddr, 63) |
> -			rsvd_bits(7, 8) | rsvd_bits(1, 2);	/* PDPTE */
> +			rsvd_bits(5, 8) | rsvd_bits(1, 2);	/* PDPTE */
>  		context->rsvd_bits_mask[0][1] = exb_bit_rsvd |
>  			rsvd_bits(maxphyaddr, 62);	/* PDE */
>  		context->rsvd_bits_mask[0][0] = exb_bit_rsvd |
> @@ -3550,9 +3550,9 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu,
>  		break;
>  	case PT64_ROOT_LEVEL:
>  		context->rsvd_bits_mask[0][3] = exb_bit_rsvd |
> -			rsvd_bits(maxphyaddr, 51) | rsvd_bits(7, 8);
> +			rsvd_bits(maxphyaddr, 51) | rsvd_bits(7, 7);
>  		context->rsvd_bits_mask[0][2] = exb_bit_rsvd |
> -			rsvd_bits(maxphyaddr, 51) | rsvd_bits(7, 8);
> +			rsvd_bits(maxphyaddr, 51) | rsvd_bits(7, 7);

Bit 7 is not reserved either, for the PDPTE (its PageSize bit).


  reply	other threads:[~2014-04-16 19:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04  3:31 [PATCH] KVM: x86: Fix page-tables reserved bits Nadav Amit
2014-04-16 19:03 ` Marcelo Tosatti [this message]
2014-04-16 21:17   ` H. Peter Anvin
2014-04-16 22:04     ` Marcelo Tosatti
2014-04-28 10:41       ` Paolo Bonzini
2014-04-28 12:20         ` Nadav Amit

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=20140416190329.GB8773@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=gleb@kernel.org \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namit@cs.technion.ac.il \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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