[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AGHI instruction sets wrong condition code
From: |
Thomas Huth |
Subject: |
AGHI instruction sets wrong condition code |
Date: |
Wed, 1 Feb 2023 13:37:24 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 |
Hi Richard,
while looking at an issue that Michael reported in IRC today
(https://bugs.debian.org/987110) I noticed that the AGHI instructions
behaves differently in TCG compared to a KVM guest:
With the KVM guest:
(gdb) p/x $r14
$1 = 0x3ffffffaa48
(gdb) p/x $pswm
$2 = 0x705000180000000
(gdb) x/1i $pc
=> 0x3fff7f99d6e <dl_main+22>: aghi %r14,-32
(gdb) stepi
0x000003fff7f99d72 1357 in rtld.c
(gdb) p/x $r14
$3 = 0x3ffffffaa28
(gdb) p/x $pswm
$4 = 0x705200180000000
With the TCG guest:
(gdb) p/x $r14
$1 = 0x3ffffffaa48
(gdb) p/x $pswm
$2 = 0x705000180000000
(gdb) x/1i $pc
=> 0x3fff7f99d6e <dl_main+22>: aghi %r14,-32
(gdb) stepi
0x000003fff7f99d72 1357 in rtld.c
(gdb) p/x $r14
$3 = 0x3ffffffaa28
(gdb) p/x $pswm
$4 = 0x705000180000000
As you can see, the PSW mask is different after the AGHI instruction, real
hardware sets CC to 2, while TCG keeps it a 0.
I stared at the translate.c and cc_helper.c code for a while, but I can't
quite figure it out ... if you've got some spare minutes, could you maybe
have a look at this, too?
Thanks,
Thomas
PS: I guess it's not the bug causing the issue reported by Michael, since
there is no instruction looking at the CC right after that AGHI
- AGHI instruction sets wrong condition code,
Thomas Huth <=