Skip to contentSkip to conversation

KVM 29: Page fault in kernel mode while booting GNU/kFreeBSD

DISCUSSION Aurelien Jarno 2 participants 13 messages Jul 14, 2007 – Jul 25, 2007 9 messages not in the archive KVM

lore
Share & tools
lore
#0 lore raw

Hi,

I have just updated my system from kvm 28 to kvm 29, and a GNU/kFreeBSD amd64 system fails to boot with the following error:

Fatal trap 12 with interrupts disabled

Fatal trap 12: page fault while in kernel mode

  fault virtual address   = 0x7aa93e0
  fault code              = supervisor read, page not present
  instruction pointer     = 0x8:0xffffffff80598b36
  stack pointer           = 0x10:0xffffffff87c556b0
  frame pointer           = 0x10:0xffffff0007aa9260
  code segment            = base 0x00, lmit 0xfffff, type 0x1b
                          = DPL 0, pres 1, long 1, def32 0, gran 1
  processor eflags        = resume, IOPL = 0
  current process         = 1 (init)
  trap number             = 12

panic: page fault

This is on an machine with an Athlon64 X2 CPU.

As it was running fine with kvm 28, I tried to mix kvm 28 and kvm 29. It fails when using modules from kvm 29, whatever the version of the userland part. This looks like a problem in the kernel modules.

Please also note that GNU/kFreeBSD i386 is working fine with kvm 29 on the same machine.

Please tell me what I can do to help debugging this problem. Alternatively I have uploaded an image to reproduce the problem here:
http://temp.aurel32.net/kfreebsd-amd64.img.gz

Thanks,
Aurelien

Signature · 10 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 28 lines · Aurelien Jarno

Hi,

I have just updated my system from kvm 28 to kvm 29, and a GNU/kFreeBSD amd64 system fails to boot with the following error:

Fatal trap 12 with interrupts disabled

Fatal trap 12: page fault while in kernel mode

  fault virtual address   = 0x7aa93e0
  fault code              = supervisor read, page not present
  instruction pointer     = 0x8:0xffffffff80598b36
  stack pointer           = 0x10:0xffffffff87c556b0
  frame pointer           = 0x10:0xffffff0007aa9260
  code segment            = base 0x00, lmit 0xfffff, type 0x1b
                          = DPL 0, pres 1, long 1, def32 0, gran 1
  processor eflags        = resume, IOPL = 0
  current process         = 1 (init)
  trap number             = 12

panic: page fault

This is on an machine with an Athlon64 X2 CPU.

As it was running fine with kvm 28, I tried to mix kvm 28 and kvm 29. It fails when using modules from kvm 29, whatever the version of the userland part. This looks like a problem in the kernel modules.

Quoted 8 lines

Please also note that GNU/kFreeBSD i386 is working fine with kvm 29 on the same machine.

Please tell me what I can do to help debugging this problem. Alternatively I have uploaded an image to reproduce the problem here:
http://temp.aurel32.net/kfreebsd-amd64.img.gz

Can you bisect kvm to find the offending commit? Basically, you do a

git clone git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git
cd kvm
git bisect start drivers/kvm/
bit bisect bad kvm-29
git bisect good kvm-28

git will check out a test candidate; go to your kvm userspace directory and do

make -C kernel sync LINUX=/path/to/the/kvm/git/directory make -C kernel
sudo make -C kernel install

reload the module, test, and issue 'git bisect good' or 'git bisect bad' according to the result. As there are only 25 commits you should be done in 5 cycles.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

A message that is not in the archive (sent off-list or not yet received): 4699BD63.8010904-atKUWr5tajBWk0Htik3J/[email protected]

#4 lore raw
Quoted 11 lines · Avi Kivity

Can you bisect kvm to find the offending commit? Basically, you do a

git clone git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git
cd kvm
git bisect start drivers/kvm/
bit bisect bad kvm-29
git bisect good kvm-28

git will check out a test candidate; go to your kvm userspace directory and do

Quoted 8 lines

make -C kernel sync LINUX=/path/to/the/kvm/git/directory make -C kernel
sudo make -C kernel install

reload the module, test, and issue 'git bisect good' or 'git bisect bad' according to the result. As there are only 25 commits you should be done in 5 cycles.

And the result is:

commit ba9c20c048726037664d303362b688759fdf6e9d

Author: Luca Tettamanti <[email protected]>
Date:   Tue Jun 19 22:41:20 2007 +0200

KVM: Fix x86 emulator writeback

When the old value and new one are the same the emulator skips the write; this is undesirable when the destination is a MMIO area and the write shall be performed regardless of the previous value. This optimization breaks e.g. a Linux guest APIC compiled without X86_GOOD_APIC.

Remove the check and perform the writeback stage in the emulation unless it's explicitly disabled (currently push and some 2 bytes instructions may disable the writeback).

I have tried to revert this patch directly into kvm-29, and it also fixes the problem.

Signature · 10 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 38 lines · Aurelien Jarno
Quoted 8 lines · Avi Kivity

Can you bisect kvm to find the offending commit? Basically, you do a

git clone git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git
cd kvm
git bisect start drivers/kvm/
bit bisect bad kvm-29
git bisect good kvm-28

Quoted 9 lines

git will check out a test candidate; go to your kvm userspace directory and do

make -C kernel sync LINUX=/path/to/the/kvm/git/directory make -C kernel
sudo make -C kernel install

reload the module, test, and issue 'git bisect good' or 'git bisect bad' according to the result. As there are only 25 commits you should be done in 5 cycles.

And the result is:

commit ba9c20c048726037664d303362b688759fdf6e9d

Author: Luca Tettamanti <[email protected]>
Date:   Tue Jun 19 22:41:20 2007 +0200

KVM: Fix x86 emulator writeback

When the old value and new one are the same the emulator skips the write; this is undesirable when the destination is a MMIO area and the write shall be performed regardless of the previous value. This optimization breaks e.g. a Linux guest APIC compiled without X86_GOOD_APIC.

Remove the check and perform the writeback stage in the emulation unless it's explicitly disabled (currently push and some 2 bytes instructions may disable the writeback).

Quoted 8 lines

I have tried to revert this patch directly into kvm-29, and it also fixes the problem.

From a cursory inspection, looks like the cmov instructions were broken by the patch. Can you try the attached patch on top of kvm-29?

Signature · 1 line
error compiling committee.c: too many arguments to function
drivers/kvm/x86_emulate.c +11 -11
index f60012d..7974012 100644
@@ -1225,40 +1225,40 @@ twobyte_insn:
 		break;
 	case 0x40 ... 0x4f:	/* cmov */
 		dst.val = dst.orig_val = src.val;
-		d &= ~Mov;	/* default to no move */
+		no_wb = 1;	/* default to no move */
 		/*
 		 * First, assume we're decoding an even cmov opcode
 		 * (lsb == 0).
 		 */
 		switch ((b & 15) >> 1) {
 		case 0:	/* cmovo */
-			d |= (_eflags & EFLG_OF) ? Mov : 0;
+			no_wb &= (_eflags & EFLG_OF) ? 0 : 1;
 			break;
 		case 1:	/* cmovb/cmovc/cmovnae */
-			d |= (_eflags & EFLG_CF) ? Mov : 0;
+			no_wb &= (_eflags & EFLG_CF) ? 0 : 1;
 			break;
 		case 2:	/* cmovz/cmove */
-			d |= (_eflags & EFLG_ZF) ? Mov : 0;
+			no_wb &= (_eflags & EFLG_ZF) ? 0 : 1;
 			break;
 		case 3:	/* cmovbe/cmovna */
-			d |= (_eflags & (EFLG_CF | EFLG_ZF)) ? Mov : 0;
+			no_wb &= (_eflags & (EFLG_CF | EFLG_ZF)) ? 0 : 1;
 			break;
 		case 4:	/* cmovs */
-			d |= (_eflags & EFLG_SF) ? Mov : 0;
+			no_wb &= (_eflags & EFLG_SF) ? 0 : 1;
 			break;
 		case 5:	/* cmovp/cmovpe */
-			d |= (_eflags & EFLG_PF) ? Mov : 0;
+			no_wb &= (_eflags & EFLG_PF) ? 0 : 1;
 			break;
 		case 7:	/* cmovle/cmovng */
-			d |= (_eflags & EFLG_ZF) ? Mov : 0;
+			no_wb &= (_eflags & EFLG_ZF) ? 0 : 1;
 			/* fall through */
 		case 6:	/* cmovl/cmovnge */
-			d |= (!(_eflags & EFLG_SF) !=
-			      !(_eflags & EFLG_OF)) ? Mov : 0;
+			no_wb &= (!(_eflags & EFLG_SF) !=
+			      !(_eflags & EFLG_OF)) ? 0 : 1;
 			break;
 		}
 		/* Odd cmov opcodes (lsb == 1) have inverted sense. */
-		d ^= (b & 1) ? Mov : 0;
+		no_wb ^= (b & 1) ? 1 : 0;
 		break;
 	case 0xb0 ... 0xb1:	/* cmpxchg */
 		/*

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

A message that is not in the archive (sent off-list or not yet received): 469A1373.5090904-atKUWr5tajBWk0Htik3J/[email protected]

#8 lore raw
Quoted 47 lines · Avi Kivity
Quoted 46 lines · Aurelien Jarno
Quoted 11 lines · Avi Kivity

Can you bisect kvm to find the offending commit? Basically, you do a

git clone git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git
cd kvm
git bisect start drivers/kvm/
bit bisect bad kvm-29
git bisect good kvm-28

git will check out a test candidate; go to your kvm userspace directory and do

Quoted 9 lines

make -C kernel sync LINUX=/path/to/the/kvm/git/directory make -C kernel
sudo make -C kernel install

reload the module, test, and issue 'git bisect good' or 'git bisect bad' according to the result. As there are only 25 commits you should be done in 5 cycles.

And the result is:

commit ba9c20c048726037664d303362b688759fdf6e9d

Author: Luca Tettamanti <[email protected]>
Date:   Tue Jun 19 22:41:20 2007 +0200

KVM: Fix x86 emulator writeback

When the old value and new one are the same the emulator skips the write; this is undesirable when the destination is a MMIO area and the write shall be performed regardless of the previous value. This optimization breaks e.g. a Linux guest APIC compiled without X86_GOOD_APIC.

Remove the check and perform the writeback stage in the emulation unless
it's explicitly disabled (currently push and some 2 bytes instructions may disable the writeback).

Quoted 8 lines
Quoted 4 lines

I have tried to revert this patch directly into kvm-29, and it also fixes the problem.

From a cursory inspection, looks like the cmov instructions were broken by the patch. Can you try the attached patch on top of kvm-29?

Unfortunately this does not fix the problem.

Signature · 10 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
#9 lore raw
In reply to a message not in the archive
Quoted 22 lines · Aurelien Jarno

Hi,

I have just updated my system from kvm 28 to kvm 29, and a GNU/kFreeBSD amd64 system fails to boot with the following error:

Fatal trap 12 with interrupts disabled

Fatal trap 12: page fault while in kernel mode

  fault virtual address   = 0x7aa93e0
  fault code              = supervisor read, page not present
  instruction pointer     = 0x8:0xffffffff80598b36
  stack pointer           = 0x10:0xffffffff87c556b0
  frame pointer           = 0x10:0xffffff0007aa9260
  code segment            = base 0x00, lmit 0xfffff, type 0x1b
                          = DPL 0, pres 1, long 1, def32 0, gran 1
  processor eflags        = resume, IOPL = 0
  current process         = 1 (init)
  trap number             = 12

panic: page fault

Quoted 9 lines

This is on an machine with an Athlon64 X2 CPU.

As it was running fine with kvm 28, I tried to mix kvm 28 and kvm 29. It fails when using modules from kvm 29, whatever the version of the userland part. This looks like a problem in the kernel modules.

Please also note that GNU/kFreeBSD i386 is working fine with kvm 29 on the same machine.

I have just seen the same failure on an i386 guest. It seems the failure happens very rarely, but it happens.

Signature · 10 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
#10 lore raw
In reply to a message not in the archive
Quoted 28 lines · Aurelien Jarno

Hi,

I have just updated my system from kvm 28 to kvm 29, and a GNU/kFreeBSD amd64 system fails to boot with the following error:

Fatal trap 12 with interrupts disabled

Fatal trap 12: page fault while in kernel mode

  fault virtual address   = 0x7aa93e0
  fault code              = supervisor read, page not present
  instruction pointer     = 0x8:0xffffffff80598b36
  stack pointer           = 0x10:0xffffffff87c556b0
  frame pointer           = 0x10:0xffffff0007aa9260
  code segment            = base 0x00, lmit 0xfffff, type 0x1b
                          = DPL 0, pres 1, long 1, def32 0, gran 1
  processor eflags        = resume, IOPL = 0
  current process         = 1 (init)
  trap number             = 12

panic: page fault

This is on an machine with an Athlon64 X2 CPU.

As it was running fine with kvm 28, I tried to mix kvm 28 and kvm 29. It fails when using modules from kvm 29, whatever the version of the userland part. This looks like a problem in the kernel modules.

Quoted 6 lines

Please also note that GNU/kFreeBSD i386 is working fine with kvm 29 on the same machine.

Please tell me what I can do to help debugging this problem. Alternatively I have uploaded an image to reproduce the problem here:
http://temp.aurel32.net/kfreebsd-amd64.img.g

I've downloaded the image and booted it three times using kvm HEAD. Each time I got to the login prompt.

Is this always reproducible? Can you check with kvm HEAD (not that I think of anything that could have fixed this).

Signature · 7 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

A message that is not in the archive (sent off-list or not yet received): 46A05B23.50409-atKUWr5tajBWk0Htik3J/[email protected]

#12 lore raw
Quoted 5 lines · Avi Kivity
Quoted 4 lines

Please tell me what I can do to help debugging this problem. Alternatively I have uploaded an image to reproduce the problem here:
http://temp.aurel32.net/kfreebsd-amd64.img.g

Quoted 7 lines

I've downloaded the image and booted it three times using kvm HEAD. Each time I got to the login prompt.

Is this always reproducible? Can you check with kvm HEAD (not that I think of anything that could have fixed this).

Sorry, that was on Intel. It reproduces easily on AMD.

Signature · 7 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

A message that is not in the archive (sent off-list or not yet received): 46A05CF3.1070900-atKUWr5tajBWk0Htik3J/[email protected]

#14 lore raw
Quoted 9 lines · Avi Kivity
Quoted 8 lines · Avi Kivity
Quoted 4 lines

Please tell me what I can do to help debugging this problem. Alternatively I have uploaded an image to reproduce the problem here:
http://temp.aurel32.net/kfreebsd-amd64.img.g

I've downloaded the image and booted it three times using kvm HEAD. Each time I got to the login prompt.

Quoted 7 lines
Quoted 4 lines

Is this always reproducible? Can you check with kvm HEAD (not that I think of anything that could have fixed this).

Sorry, that was on Intel. It reproduces easily on AMD.

Yep, I have just been able to test it on a Core 2 CPU, and everything works nicely.

Signature · 9 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
#15 lore raw
In reply to a message not in the archive
Quoted 9 lines · Avi Kivity
Quoted 8 lines · Avi Kivity
Quoted 4 lines

Please tell me what I can do to help debugging this problem. Alternatively I have uploaded an image to reproduce the problem here:
http://temp.aurel32.net/kfreebsd-amd64.img.g

I've downloaded the image and booted it three times using kvm HEAD. Each time I got to the login prompt.

Quoted 6 lines
Quoted 4 lines

Is this always reproducible? Can you check with kvm HEAD (not that I think of anything that could have fixed this).

Sorry, that was on Intel. It reproduces easily on AMD.

By comparing the cases were the old and the new condition are different, I have found that the problem occurs for the lmsw and smsw instructions.

The patch below is very ugly, but it workarounds the problem.

drivers/kvm/x86_emulate.c +2 -0
index 21ce977..6c1523f 100644
@@ -1206,11 +1206,13 @@ twobyte_insn:
 				goto cannot_emulate;
 			*(u16 *)&_regs[modrm_rm]
 				= realmode_get_cr(ctxt->vcpu, 0);
+			no_wb = 1;
 			break;
 		case 6: /* lmsw */
 			if (modrm_mod != 3)
 				goto cannot_emulate;
 			realmode_lmsw(ctxt->vcpu, (u16)modrm_val, &_eflags);
+			no_wb = 1;
 			break;
 		case 7: /* invlpg*/
 
Signature · 10 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#17 lore raw
Quoted 17 lines · Aurelien Jarno
Quoted 15 lines · Avi Kivity
Quoted 13 lines · Avi Kivity
Quoted 5 lines

Please tell me what I can do to help debugging this problem. Alternatively I have uploaded an image to reproduce the problem here:
http://temp.aurel32.net/kfreebsd-amd64.img.g

I've downloaded the image and booted it three times using kvm HEAD. Each time I got to the login prompt.

Is this always reproducible? Can you check with kvm HEAD (not that I think of anything that could have fixed this).

Quoted 6 lines
Quoted 2 lines

Sorry, that was on Intel. It reproduces easily on AMD.

By comparing the cases were the old and the new condition are different, I have found that the problem occurs for the lmsw and smsw instructions.

Ah, I was looking at amd-specific instructions (vmx decodes lmsw) but missed these two. Good work.

Quoted 2 lines

The patch below is very ugly, but it workarounds the problem.

It's not ugly, it just lives in an ugly function. But it does lack a changelog and a signoff.

As to the ugliness, prehaps no_wb should be part of the opcode descriptor bitmask (opcode_table and friend).

Quoted 19 lines
drivers/kvm/x86_emulate.c +2 -0
index 21ce977..6c1523f 100644
@@ -1206,11 +1206,13 @@ twobyte_insn:
 				goto cannot_emulate;
 			*(u16 *)&_regs[modrm_rm]
 				= realmode_get_cr(ctxt->vcpu, 0);
+			no_wb = 1;
 			break;
 		case 6: /* lmsw */
 			if (modrm_mod != 3)
 				goto cannot_emulate;
 			realmode_lmsw(ctxt->vcpu, (u16)modrm_val, &_eflags);
+			no_wb = 1;
 			break;
 		case 7: /* invlpg*/
 
Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

A message that is not in the archive (sent off-list or not yet received): 46A6C00C.8030609-atKUWr5tajBWk0Htik3J/[email protected]

#19 lore raw
Quoted 25 lines · Avi Kivity
Quoted 17 lines · Aurelien Jarno
Quoted 15 lines · Avi Kivity
Quoted 13 lines · Avi Kivity
Quoted 5 lines

Please tell me what I can do to help debugging this problem. Alternatively I have uploaded an image to reproduce the problem here:
http://temp.aurel32.net/kfreebsd-amd64.img.g

I've downloaded the image and booted it three times using kvm HEAD. Each time I got to the login prompt.

Is this always reproducible? Can you check with kvm HEAD (not that I think of anything that could have fixed this).

Quoted 6 lines
Quoted 2 lines

Sorry, that was on Intel. It reproduces easily on AMD.

By comparing the cases were the old and the new condition are different, I have found that the problem occurs for the lmsw and smsw instructions.

Quoted 9 lines

Ah, I was looking at amd-specific instructions (vmx decodes lmsw) but missed these two. Good work.

Quoted 2 lines

The patch below is very ugly, but it workarounds the problem.

It's not ugly, it just lives in an ugly function. But it does lack a changelog and a signoff.

After a short discussion on IRC, it seems that all 0x02 0x01 instructions do not use the writeback. Please find an updated and signedoff patch below.

KVM: disable writeback for 0x02 0x01 instructions.

0x02 0x01 instructions (ie lgdt, lidt, smsw, lmsw and invlpg) does not use writeback. This patch set no_wb=1 when emulating those instructions.

drivers/kvm/x86_emulate.c +2 -0
index 21ce977..cbbb9c5 100644
@@ -1183,6 +1183,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;
Signature · 10 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#21 lore raw
Quoted 4 lines · Aurelien Jarno

After a short discussion on IRC, it seems that all 0x02 0x01 instructions do not use the writeback. Please find an updated and signedoff patch below.

Quoted 8 lines

KVM: disable writeback for 0x02 0x01 instructions.

0x02 0x01 instructions (ie lgdt, lidt, smsw, lmsw and invlpg) does not use writeback. This patch set no_wb=1 when emulating those instructions.

It's in, thanks.

Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/