KVM: disable writeback for 0x0f 0x01 instructions.
authorAurelien Jarno <aurelien@aurel32.net>
Wed, 25 Jul 2007 08:19:54 +0000 (10:19 +0200)
committerAvi Kivity <avi@qumranet.com>
Wed, 25 Jul 2007 11:31:27 +0000 (14:31 +0300)
0x0f 0x01 instructions (ie lgdt, lidt, smsw, lmsw and invlpg) does
not use writeback. This patch set no_wb=1 when emulating those
instructions.

This fixes a regression booting the FreeBSD kernel on AMD.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/x86_emulate.c

index 1b800fc00342c55dbdb47c21935345330b49c4ef..1f979cb0df314f82cab71e88f2c7892922454860 100644 (file)
@@ -1178,6 +1178,8 @@ pop_instruction:
 twobyte_insn:
        switch (b) {
        case 0x01: /* lgdt, lidt, lmsw */
+               /* Disable writeback. */
+               no_wb = 1;
                switch (modrm_reg) {
                        u16 size;
                        unsigned long address;