]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
KVM: emulate: fix CMPXCHG8B on 32-bit hosts
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 12 Feb 2015 16:04:47 +0000 (17:04 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 23 Feb 2015 21:28:48 +0000 (22:28 +0100)
commit4ff6f8e61eb7f96d3ca535c6d240f863ccd6fb7d
treebfd41b00d5b6ae5797edb03d8d0459832d049cd0
parent21bc8dc5b729dbeecb43adff23b74b51321e1897
KVM: emulate: fix CMPXCHG8B on 32-bit hosts

This has been broken for a long time: it broke first in 2.6.35, then was
almost fixed in 2.6.36 but this one-liner slipped through the cracks.
The bug shows up as an infinite loop in Windows 7 (and newer) boot on
32-bit hosts without EPT.

Windows uses CMPXCHG8B to write to page tables, which causes a
page fault if running without EPT; the emulator is then called from
kvm_mmu_page_fault.  The loop then happens if the higher 4 bytes are
not 0; the common case for this is that the NX bit (bit 63) is 1.

Fixes: 6550e1f165f384f3a46b60a1be9aba4bc3c2adad
Fixes: 16518d5ada690643453eb0aef3cc7841d3623c2d
Cc: stable@vger.kernel.org # 2.6.35+
Reported-by: Erik Rull <erik.rull@rdsoftware.de>
Tested-by: Erik Rull <erik.rull@rdsoftware.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c