|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] x86/emul: Adjust handling of CR8_LEGACY
commit 7d48ef45b6df0cf8985b84305e02b7440de8f50f
Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Mar 24 23:25:59 2025 +0000
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Jul 10 19:35:49 2026 +0100
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@xxxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
---
xen/arch/x86/x86_emulate/decode.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/x86_emulate/decode.c
b/xen/arch/x86/x86_emulate/decode.c
index 2c13356c4d..57f6baffb0 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -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);
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |