Skip to content

Commit

Permalink
KVM: disable writeback for 0x0f 0x01 instructions.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aurelien Jarno authored and Avi Kivity committed Jul 25, 2007
1 parent 4c981b4 commit d37c855
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/kvm/x86_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,8 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
twobyte_insn:
switch (b) {
case 0x01: /* lgdt, lidt, lmsw */
/* Disable writeback. */
no_wb = 1;
switch (modrm_reg) {
u16 size;
unsigned long address;
Expand Down

0 comments on commit d37c855

Please sign in to comment.