public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: "Yang, Sheng" <sheng.yang@intel.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: MMU: Fix overflow of SHADOW_PT_INDEX with EPT in 32pae
Date: Mon, 01 Sep 2008 12:40:04 +0300	[thread overview]
Message-ID: <48BBB874.5040604@qumranet.com> (raw)
In-Reply-To: <200809011732.55508.sheng.yang@intel.com>

Yang, Sheng wrote:
> From: Sheng Yang <sheng.yang@intel.com>
> Date: Mon, 1 Sep 2008 17:28:59 +0800
> Subject: [PATCH] KVM: MMU: Fix overflow of SHADOW_PT_INDEX with EPT in 32pae
>
> EPT is 4 level by default in 32pae (48bits), but virtual address only
> got 32 bits. This result in SHADOW_PT_INDEX() overflow when try to
> fetch level 4 index.
>
> Fix it by extend virtual address to 64bits in any condition.
>
>   

Good catch.

> Signed-off-by: Sheng Yang <sheng.yang@intel.com>
> ---
>  arch/x86/kvm/mmu.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index f33c594..8ca9aad 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -943,6 +943,7 @@ static int walk_shadow(struct kvm_shadow_walk *walker,
>  	int level;
>  	int r;
>  	u64 *sptep;
> +	u64 ext_addr = addr;
>   

addr isn't really a gva_t; it is a pga_t when using direct mappings.

So how about changing walk_shadow() and its callbacks to use u64 instead 
of gva_t instead?


-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2008-09-01  9:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01  9:32 [PATCH] KVM: MMU: Fix overflow of SHADOW_PT_INDEX with EPT in 32pae Yang, Sheng
2008-09-01  9:40 ` Avi Kivity [this message]
2008-09-01 10:31   ` Sheng Yang

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=48BBB874.5040604@qumranet.com \
    --to=avi@qumranet.com \
    --cc=kvm@vger.kernel.org \
    --cc=sheng.yang@intel.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