mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/emul: Adjust handling of CR8_LEGACY
The APM description of the AltMovCR8 feature bit is:
"LOCK MOV CR0 means MOV CR8"
Adjust the decode logic to behave like this.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
master commit: 7d48ef45b6
master date: 2026-07-10 19:35:49 +0100
This commit is contained in:
1 parent
76bc053ba1
commit
739dd1b824
1 file changed
+3
-3
@@ -780,12 +780,12 @@ decode_twobyte(struct x86_emulate_state *s,
|
||||
break;
|
||||
|
||||
case 0x20: case 0x22: /* mov to/from cr */
|
||||
if ( s->lock_prefix && vcpu_has_cr8_legacy() )
|
||||
if ( s->lock_prefix && vcpu_has_cr8_legacy() && s->modrm_reg == 0 )
|
||||
{
|
||||
s->modrm_reg += 8;
|
||||
s->modrm_reg = 8;
|
||||
s->lock_prefix = false;
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 0x21: case 0x23: /* mov to/from dr */
|
||||
ASSERT(s->ea.type == OP_REG); /* Early operand adjustment ensures this. */
|
||||
generate_exception_if(s->lock_prefix, X86_EXC_UD);
|
||||
|
||||