]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: SVM: check for progress after IRET interception
authorAvi Kivity <avi@redhat.com>
Thu, 3 Feb 2011 13:29:52 +0000 (15:29 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 9 May 2011 22:06:50 +0000 (15:06 -0700)
commit5ea2c1536c7e93485849c3eb05a022ea26144c6a
treee583a88c0666d3392f0285b115da440bd63a1d07
parentfcd9079e754fa9050ed50ef2ba294ccf5825b837
KVM: SVM: check for progress after IRET interception

commit bd3d1ec3d26b61120bb4f60b18ee99aa81839e6b upstream.

When we enable an NMI window, we ask for an IRET intercept, since
the IRET re-enables NMIs.  However, the IRET intercept happens before
the instruction executes, while the NMI window architecturally opens
afterwards.

To compensate for this mismatch, we only open the NMI window in the
following exit, assuming that the IRET has by then executed; however,
this assumption is not always correct; we may exit due to a host interrupt
or page fault, without having executed the instruction.

Fix by checking for forward progress by recording and comparing the IRET's
rip.  This is somewhat of a hack, since an unchaging rip does not mean that
no forward progress has been made, but is the simplest fix for now.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/svm.c