浏览代码

KVM: disable writeback for 0x0f 0x01 instructions.

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>
Aurelien Jarno 18 年之前
父节点
当前提交
d37c855719
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/kvm/x86_emulate.c

+ 2 - 0
drivers/kvm/x86_emulate.c

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