]> git.karo-electronics.de Git - karo-tx-linux.git/commit
KVM: SVM: Restore correct registers after sel_cr0 intercept emulation
authorJoerg Roedel <joerg.roedel@amd.com>
Thu, 2 Sep 2010 15:29:46 +0000 (17:29 +0200)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:52:24 +0000 (10:52 +0200)
commitcda0008299a06f0d7218c6037c3c02d7a865e954
tree43ce57af80bf3b963f04a057864ce766dbf263a6
parentf87f928882d080eaec8b0d76aecff003d664697d
KVM: SVM: Restore correct registers after sel_cr0 intercept emulation

This patch implements restoring of the correct rip, rsp, and
rax after the svm emulation in KVM injected a selective_cr0
write intercept into the guest hypervisor. The problem was
that the vmexit is emulated in the instruction emulation
which later commits the registers right after the write-cr0
instruction. So the l1 guest will continue to run with the
l2 rip, rsp and rax resulting in unpredictable behavior.

This patch is not the final word, it is just an easy patch
to fix the issue. The real fix will be done when the
instruction emulator is made aware of nested virtualization.
Until this is done this patch fixes the issue and provides
an easy way to fix this in -stable too.

Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/svm.c