summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2011-04-18 11:42:52 +0200
committerAvi Kivity <avi@redhat.com>2011-05-11 07:57:10 -0400
commit977b2d03e42e9ea9355d4baddb464810579719bd (patch)
tree2385608edeb1be8c4f1903b5cc02dc8093a0ca86 /arch/x86
parent0521e4c0bc73aa86152ee4e4bd03724c8a9e1d6b (diff)
downloadlinux-977b2d03e42e9ea9355d4baddb464810579719bd.tar.bz2
KVM: SVM: Fix nested sel_cr0 intercept path with decode-assists
This patch fixes a bug in the nested-svm path when decode-assists is available on the machine. After a selective-cr0 intercept is detected the rip is advanced unconditionally. This causes the l1-guest to continue running with an l2-rip. This bug was with the sel_cr0 unit-test on decode-assists capable hardware. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/svm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index a6bf2ad7429c..de4bba99160d 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -2799,6 +2799,9 @@ static int cr_interception(struct vcpu_svm *svm)
case 0:
if (!check_selective_cr0_intercepted(svm, val))
err = kvm_set_cr0(&svm->vcpu, val);
+ else
+ return 1;
+
break;
case 3:
err = kvm_set_cr3(&svm->vcpu, val);