From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
LKML <linux-kernel@vger.kernel.org>, KVM <kvm@vger.kernel.org>
Subject: [PATCH 3/4] KVM: MMU: move reserved bits check to FNAME(update_pte)
Date: Mon, 20 Sep 2010 22:20:42 +0800 [thread overview]
Message-ID: <4C976DBA.4080909@cn.fujitsu.com> (raw)
In-Reply-To: <4C976D48.6020400@cn.fujitsu.com>
Move reserved bits check then invlpg path can use it
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
arch/x86/kvm/mmu.c | 3 ---
arch/x86/kvm/paging_tmpl.h | 4 ++++
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 0ccb67f..9d7da39 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3003,9 +3003,6 @@ static void mmu_pte_write_new_pte(struct kvm_vcpu *vcpu,
return;
}
- if (is_rsvd_bits_set(&vcpu->arch.mmu, *(u64 *)new, PT_PAGE_TABLE_LEVEL))
- return;
-
++vcpu->kvm->stat.mmu_pte_updated;
if (!sp->role.cr4_pae)
paging32_update_pte(vcpu, sp, spte, new);
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index ab9a594..e540118 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -311,6 +311,10 @@ static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
u64 new_spte;
gpte = *(const pt_element_t *)pte;
+
+ if (is_rsvd_bits_set(&vcpu->arch.mmu, gpte, PT_PAGE_TABLE_LEVEL))
+ return;
+
if (~gpte & (PT_PRESENT_MASK | PT_ACCESSED_MASK)) {
if (!is_present_gpte(gpte)) {
if (sp->unsync)
--
1.7.0.4
next prev parent reply other threads:[~2010-09-20 14:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-20 14:18 [PATCH 1/4] KVM: MMU: rename 'sp->root_count' to 'sp->active_count' Xiao Guangrong
2010-09-20 14:19 ` [PATCH 2/4] KVM: MMU: support unsync sp out of the protection of 'mmu_lock' Xiao Guangrong
2010-09-20 15:19 ` Avi Kivity
2010-09-23 3:05 ` Xiao Guangrong
2010-09-26 13:02 ` Avi Kivity
2010-09-20 14:20 ` Xiao Guangrong [this message]
2010-09-20 14:21 ` [PATCH 4/4] KVM: MMU: Don't touch unsync sp in kvm_mmu_pte_write() Xiao Guangrong
2010-09-20 15:24 ` Avi Kivity
2010-09-23 2:59 ` Xiao Guangrong
2010-09-26 13:09 ` Avi Kivity
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=4C976DBA.4080909@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 \
/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