From: Avi Kivity Date: Sun, 5 Aug 2007 07:16:11 +0000 (+0300) Subject: KVM: x86 emulator: fix debug reg mov instructions X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bac27d35cbbf7c641efcc75b5330df8717d6db65;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git KVM: x86 emulator: fix debug reg mov instructions More fallout from the writeback fixes: debug register transfer instructions do their own writeback and thus need to disable the general writeback mechanism. This fixes oopses and some guest failures on AMD machines (the Intel variant decodes the instruction in hardware and thus does not need emulation). Cc: Alistair John Strachan Signed-off-by: Avi Kivity Signed-off-by: Linus Torvalds --- diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c index 1f979cb0df3..4b8a0cc9665 100644 --- a/drivers/kvm/x86_emulate.c +++ b/drivers/kvm/x86_emulate.c @@ -1217,11 +1217,13 @@ twobyte_insn: } break; case 0x21: /* mov from dr to reg */ + no_wb = 1; if (modrm_mod != 3) goto cannot_emulate; rc = emulator_get_dr(ctxt, modrm_reg, &_regs[modrm_rm]); break; case 0x23: /* mov from reg to dr */ + no_wb = 1; if (modrm_mod != 3) goto cannot_emulate; rc = emulator_set_dr(ctxt, modrm_reg, _regs[modrm_rm]);