|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen stable-4.22] x86emul: Fix AAM emulation AH output
commit a067d640ab221dc98277540f52e55688b6d8e1e2
Author: Teddy Astie <teddy.astie@xxxxxxxxxx>
AuthorDate: Wed Sep 30 13:01:43 2026 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Sep 30 13:01:43 2026 +0200
x86emul: Fix AAM emulation AH output
AAM is defined in APM as
AH = (AL/10d)
AL = (AL mod 10d)
However, due to the order of operations, we're incorrectly computing it as
AL = (AL mod 10d)
AH = (AL/10d) = ((originalAL mod 10d)/10d) = 0
Fix it by reordering the operations to match what's defined in APM
and avoid the unexpected dependency between the 2 operations.
Fixes: 8993572b9c16 ("x86emul: fold/eliminate some local variables")
Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxx>
master commit: 4c1aba82cff95ab11f7fe4af8965a06703537288
master date: 2026-09-25 14:44:27 +0100
---
xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c
b/xen/arch/x86/x86_emulate/x86_emulate.c
index bc51283854..e108151154 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2461,8 +2461,8 @@ x86_emulate(
else
{
generate_exception_if(!n, X86_EXC_DE);
- _regs.al = _regs.al % n;
_regs.ah = _regs.al / n;
+ _regs.al = _regs.al % n;
}
_regs.eflags &= ~(X86_EFLAGS_SF | X86_EFLAGS_ZF | X86_EFLAGS_PF);
_regs.eflags |= !_regs.al ? X86_EFLAGS_ZF : 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |