]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: x86 emulator: disable writeback on lmsw
authorAvi Kivity <avi@qumranet.com>
Wed, 30 Apr 2008 13:13:36 +0000 (16:13 +0300)
committerAvi Kivity <avi@qumranet.com>
Sun, 4 May 2008 11:44:45 +0000 (14:44 +0300)
The recent changes allowing memory operands with lmsw and smsw left
lmsw with writeback enabled.  Since lmsw has no oridinary destination
operand, the dst pointer was not initialized, resulting in an oops.

Close the hole by disabling writeback for lmsw.

Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/x86_emulate.c

index 2ca08386f9937ea43c4d126ca011af96c10abde9..f2a696d6a24383b893504be0eb7a2a904d7abab3 100644 (file)
@@ -1761,6 +1761,7 @@ twobyte_insn:
                case 6: /* lmsw */
                        realmode_lmsw(ctxt->vcpu, (u16)c->src.val,
                                      &ctxt->eflags);
+                       c->dst.type = OP_NONE;
                        break;
                case 7: /* invlpg*/
                        emulate_invlpg(ctxt->vcpu, memop);