Skip to content

Commit

Permalink
KVM: SVM: Fix nested sel_cr0 intercept path with decode-assists
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel authored and Avi Kivity committed May 11, 2011
1 parent 0521e4c commit 977b2d0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 977b2d0

Please sign in to comment.