kvm: qemu: avoid tpr patching when rsp == 0
commit3f86e60b3a03a713b54983c3b63ee2f36a7a9d41
authorMarcelo Tosatti <mtosatti@redhat.com>
Sun, 20 Jul 2008 17:52:43 +0000 (20 14:52 -0300)
committerAvi Kivity <avi@qumranet.com>
Mon, 21 Jul 2008 13:23:51 +0000 (21 16:23 +0300)
tree79c9d44cc334d0292252e6d79ed0b6f5a0458864
parent9d6b6952eded782be77120683e6779540bd31f12
kvm: qemu: avoid tpr patching when rsp == 0

Early Windows 2003 SMP initialization contains a

  mov imm32, r/m32

instruction that is patched by tpr optimization. Problem is rsp, used by
the patched instruction, is zero, so the guest gets a double fault and
dies.

Avoid any patching at all if rsp is zero.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
qemu/kvm-tpr-opt.c