From: Joerg Roedel Date: Wed, 5 May 2010 14:04:45 +0000 (+0200) Subject: KVM: SVM: Don't allow nested guest to VMMCALL into host X-Git-Tag: v2.6.34.1~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=87557bf5f6a941708534ae8f5f83cd68988d5063;p=karo-tx-linux.git KVM: SVM: Don't allow nested guest to VMMCALL into host This patch disables the possibility for a l2-guest to do a VMMCALL directly into the host. This would happen if the l1-hypervisor doesn't intercept VMMCALL and the l2-guest executes this instruction. Signed-off-by: Joerg Roedel Signed-off-by: Avi Kivity Signed-off-by: Greg Kroah-Hartman (Cherry-picked from commit 0d945bd9351199744c1e89d57a70615b6ee9f394) --- diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index f615af452565..1185b556653b 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1854,6 +1854,9 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm) svm->vmcb->control.intercept_cr_write &= ~INTERCEPT_CR8_MASK; } + /* We don't want to see VMMCALLs from a nested guest */ + svm->vmcb->control.intercept &= ~(1ULL << INTERCEPT_VMMCALL); + /* We don't want a nested guest to be more powerful than the guest, so all intercepts are ORed */ svm->vmcb->control.intercept_cr_read |=