Explorar o código

KVM: x86 emulator: disable writeback on lmsw

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>
Avi Kivity %!s(int64=17) %!d(string=hai) anos
pai
achega
dc7457ea52
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      arch/x86/kvm/x86_emulate.c

+ 1 - 0
arch/x86/kvm/x86_emulate.c

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