summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2010-05-05 16:04:45 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-05 11:16:16 -0700
commit9ec38fcb983c4c11b7b2cebbc6dc4361ffdc58e2 (patch)
treeb752a6dd345edccc6620f4e4a671ca380b554381
parentf7461bdc19bb04af2bd14b2936a485bbcfd9fb02 (diff)
downloadkernel-common-9ec38fcb983c4c11b7b2cebbc6dc4361ffdc58e2.tar.gz
kernel-common-9ec38fcb983c4c11b7b2cebbc6dc4361ffdc58e2.tar.bz2
kernel-common-9ec38fcb983c4c11b7b2cebbc6dc4361ffdc58e2.zip
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 <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> (cherry picked from commit 0d945bd9351199744c1e89d57a70615b6ee9f394)
-rw-r--r--arch/x86/kvm/svm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 9b99342d75fd..a2f839cbad01 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1829,8 +1829,13 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm)
svm->vmcb->control.intercept_cr_write &= ~INTERCEPT_CR8_MASK;
}
- /* We don't want a nested guest to be more powerful than the guest,
- so all intercepts are ORed */
+ /* 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 |=
nested_vmcb->control.intercept_cr_read;
svm->vmcb->control.intercept_cr_write |=