lmsw sets lower 16 bits of cr0, not just lower 4
PATCH 1/1 lmsw sets lower 16 bits of cr0, not just lower 4
According to my Intel manual, although lmsw only causes an exit when trying to set the bottom 4 bits, it is supposed to set the bottom 16 bits of cr0.
drivers/kvm/kvm_main.c +1 -1
@@ -526,7 +526,7 @@ EXPORT_SYMBOL_GPL(set_cr0);void lmsw (struct kvm_vcpu *vcpu,unsigned long msw) { -set_cr0 (vcpu, (vcpu->cr0 & ~0x0ful ) | (msw &0x0f )); +set_cr0 (vcpu, (vcpu->cr0 & ~0xffffUL ) | (msw &0xffff )); }EXPORT_SYMBOL_GPL (lmsw);
-------------------------------------------------------------------------
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/
Quoted 5 lines · Rusty Russell
According to my Intel manual, although lmsw only causes an exit when trying to set the bottom 4 bits, it is supposed to set the bottom 16 bits of cr0.
Well, _my_ Intel manual (2A) says:
Quoted 9 lines
Loads the source operand into the machine status word, bits 0 through 15 of register CR0. The
source operand can be a 16-bit general-purpose register or a memory location. Only the low-
order 4 bits of the source operand (which contains the PE, MP, EM, and TS flags) are loaded
into CR0. The PG, CD, NW, AM, WP, NE, and ET flags of CR0 are not affected. The operand-
size attribute has no effect on this instruction.
Signature · 8 lines
error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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/
Quoted 15 lines · Avi Kivity
Quoted 5 lines · Rusty Russell
According to my Intel manual, although lmsw only causes an exit when trying to set the bottom 4 bits, it is supposed to set the bottom 16 bits of cr0.
Well, _my_ Intel manual (2A) says:
Quoted 6 lines
Loads the source operand into the machine status word, bits 0 through 15 of register CR0. The
source operand can be a 16-bit general-purpose register or a memory location. Only the low-
order 4 bits of the source operand (which contains the PE, MP, EM, and TS flags) are loaded
Damn, I should have kept reading.
Sorry for the noise!
Rusty.
-------------------------------------------------------------------------
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/