KVM: SVM: fix guest global tlb flushes with NPT
PATCH 1/1 KVM: SVM: fix guest global tlb flushes with NPT
From: Joerg Roedel <[email protected]>
Accesses to CR4 are intercepted even with Nested Paging enabled. But the code does not check if the guest wants to do a global TLB flush. So this flush gets lost. This patch adds the check and the flush to svm_set_cr4.
Signed-off-by Joerg Roedel <[email protected]>
--- arch/x86/kvm/svm.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
arch/x86/kvm/svm.c +4 -0
@@ -860,6 +860,10 @@ set:static void svm_set_cr4 (struct kvm_vcpu *vcpu,unsigned long cr4) {unsigned long host_cr4_mce =read_cr4 () &X86_CR4_MCE ; +unsigned long old_cr4 =to_svm (vcpu)->vmcb->save.cr4; + +if (npt_enabled && ((old_cr4 ^ cr4) &X86_CR4_PGE )) +force_new_asid (vcpu); vcpu->arch.cr4 = cr4;if (!npt_enabled)
Signature · 1 line
1.5.6.4
Quoted 7 lines · Joerg Rodel
From: Joerg Roedel <[email protected]>
Accesses to CR4 are intercepted even with Nested Paging enabled. But the code does not check if the guest wants to do a global TLB flush. So this flush gets lost. This patch adds the check and the flush to
svm_set_cr4.
Applied, thanks. I presume this does not fix the "random npt faults" we worked around earlier?
Signature · 1 line
error compiling committee.c: too many arguments to function