From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Avi Kivity <avi@redhat.com>, Sheng Yang <sheng@linux.intel.com>,
KVM list <kvm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] KVM MMU: check reserved bits only when CR4.PSE=1 or CR4.PAE=1
Date: Thu, 18 Mar 2010 19:30:15 +0800 [thread overview]
Message-ID: <4BA20EC7.5070508@cn.fujitsu.com> (raw)
In-Reply-To: <20100318024948.GB23995@amt.cnet>
Hi Marcelo,
Thanks for your review.
Marcelo Tosatti wrote:
> On Wed, Mar 17, 2010 at 11:43:06AM +0800, Xiao Guangrong wrote:
>> - The RSV bit is possibility set in error code when #PF occurred
>> only if CR4.PSE=1 or CR4.PAE=1
>>
>> - context->rsvd_bits_mask[1][0] is always 0
>>
>> Changlog:
>> Move this operation to reset_rsvds_bits_mask() address Avi Kivity's suggestion
>>
>> Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
>> ---
>> arch/x86/kvm/mmu.c | 12 +++++++++---
>> 1 files changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
>> index b137515..c49f8ec 100644
>> --- a/arch/x86/kvm/mmu.c
>> +++ b/arch/x86/kvm/mmu.c
>> @@ -2288,18 +2288,26 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level)
>>
>> if (!is_nx(vcpu))
>> exb_bit_rsvd = rsvd_bits(63, 63);
>> +
>> + context->rsvd_bits_mask[1][0] = 0;
>
> So if the guest enables PAT at PTE level you completly disable reserved
> bit checking? You should only disable checking for [1][1] if !PSE.
Sorry, i make a mistake here because i see the current code is redundant:
context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0];
in every case.
This code is imported by commit fd2e987d, i think this is Avi Kivity's typo :-)
i think the correct way is:
ontext->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[0][0];
I'll send a new version patch to fix it if you not object.
Xiao
prev parent reply other threads:[~2010-03-18 11:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-17 3:43 [PATCH v2] KVM MMU: check reserved bits only when CR4.PSE=1 or CR4.PAE=1 Xiao Guangrong
2010-03-18 2:49 ` Marcelo Tosatti
2010-03-18 11:30 ` Xiao Guangrong [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=4BA20EC7.5070508@cn.fujitsu.com \
--to=xiaoguangrong@cn.fujitsu.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=sheng@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.