KVM: SVM: Handle nested selective_cr0 intercept correctly
authorJoerg Roedel <joerg.roedel@amd.com>
Wed, 24 Feb 2010 17:59:18 +0000 (18:59 +0100)
committerAvi Kivity <avi@redhat.com>
Sun, 25 Apr 2010 10:53:23 +0000 (13:53 +0300)
commit7f5d8b5600b5294137886b46bf00ef811d0fdf32
tree8eb3d48b169c0c642014eeff3255f785cfa300ab
parentb44ea385d8cb187e04ec8d901d4c320c8b07c40b
KVM: SVM: Handle nested selective_cr0 intercept correctly

If we have the following situation with nested svm:

1. Host KVM intercepts cr0 writes
2. Guest hypervisor intercepts only selective cr0 writes

Then we get an cr0 write intercept which is handled on the
host. But that intercepts may actually be a selective cr0
intercept for the guest. This patch checks for this
condition and injects a selective cr0 intercept if needed.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/svm.c