KVM: MMU: Don't treat a global pte as such if cr4.pge is cleared

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, January 2, 2009 - 2:04 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=25e234...
Commit:     25e2343246fe135fce672f41abe61e9d2c38caac
Parent:     fe634fd46ff643d98fdbcd153847e08c3c076e6e
Author:     Avi Kivity <avi@redhat.com>
AuthorDate: Sun Dec 21 18:31:10 2008 +0200
Committer:  Avi Kivity <avi@redhat.com>
CommitDate: Wed Dec 31 16:55:48 2008 +0200

    KVM: MMU: Don't treat a global pte as such if cr4.pge is cleared
    
    The pte.g bit is meaningless if global pages are disabled; deferring
    mmu page synchronization on these ptes will lead to the guest using stale
    shadow ptes.
    
    Fixes Vista x86 smp bootloader failure.
    
    Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch/x86/kvm/mmu.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 641c078..d50ebac 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1669,6 +1669,8 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
 	u64 mt_mask = shadow_mt_mask;
 	struct kvm_mmu_page *sp = page_header(__pa(shadow_pte));
 
+	if (!(vcpu->arch.cr4 & X86_CR4_PGE))
+		global = 0;
 	if (!global && sp->global) {
 		sp->global = 0;
 		if (sp->unsync) {
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
KVM: MMU: Don't treat a global pte as such if cr4.pge is c ..., Linux Kernel Mailing ..., (Fri Jan 2, 2:04 pm)