KVM: x86 emulator: fix debug reg mov instructions
authorAvi Kivity <avi@qumranet.com>
Sun, 5 Aug 2007 07:16:11 +0000 (10:16 +0300)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 7 Aug 2007 00:54:41 +0000 (17:54 -0700)
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 <alistair@devzero.co.uk>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/kvm/x86_emulate.c

index 1f979cb0df314f82cab71e88f2c7892922454860..4b8a0cc9665eda6662c5248782ec846e1e6367e7 100644 (file)
@@ -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]);