[patch 11/62] KVM: VMX: Add ept_sync_context in flush_tlb

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Wednesday, July 30, 2008 - 4:58 pm

2.6.26 -stable review patch.  If anyone has any objections, please let
us know.

------------------
From: Sheng Yang <sheng.yang@intel.com>

Original-Commit-Hash: 73f785350b92e1a3af945340f7d10f3978193cba

Fix a potention issue caused by kvm_mmu_slot_remove_write_access(). The
old behavior don't sync EPT TLB with modified EPT entry, which result
in inconsistent content of EPT TLB and EPT table.

Signed-off-by: Sheng Yang <sheng.yang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 arch/x86/kvm/vmx.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -88,6 +88,7 @@ static inline struct vcpu_vmx *to_vmx(st
 }
 
 static int init_rmode(struct kvm *kvm);
+static u64 construct_eptp(unsigned long root_hpa);
 
 static DEFINE_PER_CPU(struct vmcs *, vmxarea);
 static DEFINE_PER_CPU(struct vmcs *, current_vmcs);
@@ -1389,6 +1390,8 @@ static void exit_lmode(struct kvm_vcpu *
 static void vmx_flush_tlb(struct kvm_vcpu *vcpu)
 {
 	vpid_sync_vcpu_all(to_vmx(vcpu));
+	if (vm_need_ept())
+		ept_sync_context(construct_eptp(vcpu->arch.mmu.root_hpa));
 }
 
 static void vmx_decache_cr4_guest_bits(struct kvm_vcpu *vcpu)

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/62] 2.6.26-stable review, Greg KH, (Wed Jul 30, 4:49 pm)
[patch 03/62] ipv6: use timer pending, Greg KH, (Wed Jul 30, 4:57 pm)
[patch 05/62] hdlcdrv: Fix CRC calculation., Greg KH, (Wed Jul 30, 4:57 pm)
[patch 11/62] KVM: VMX: Add ept_sync_context in flush_tlb, Greg KH, (Wed Jul 30, 4:58 pm)
[patch 23/62] proc: fix /proc/*/pagemap, Greg KH, (Wed Jul 30, 4:58 pm)
[patch 53/62] UML - Fix boot crash, Greg KH, (Wed Jul 30, 4:59 pm)