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

On Mon, Sep 01, 2008 at 12:40:04PM +0300, Avi Kivity wrote:
> 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?

Yeah, that's better, would update the patch soon. :)

--
regards
Yang, Sheng
>
>
> -- 
> error compiling committee.c: too many arguments to function
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2008-09-01 10:31 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
2008-09-01 10:31   ` Sheng Yang [this message]

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=20080901103105.GA10443@yukikaze \
    --to=yasker@gmail.com \
    --cc=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