Bug 494252 - s390x: incorrect disassembly for LOCHI and friends
Summary: s390x: incorrect disassembly for LOCHI and friends
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Andreas Arnez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-07 17:20 UTC by Florian Krohm
Modified: 2024-10-09 15:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
patch to fix disassembly for LOCHI and friends (3.49 KB, patch)
2024-10-07 17:20 UTC, Florian Krohm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Krohm 2024-10-07 17:20:58 UTC
Created attachment 174510 [details]
patch to fix disassembly for LOCHI and friends

Instruction        Current disasm           objdump -d
lochi  %r3,7,0      lochi  %r0,3,0,.+0       lochi    %r3,7,0
lochi  %r3,7,1      lochi  %r1,3,0,.+2       lochio   %r3,7
lochi  %r3,7,2      lochi  %r2,3,0,.+4       lochih   %r3,7
lochi  %r3,7,3      lochi  %r3,3,0,.+6       lochinle %r3,7
lochi  %r3,7,4      lochi  %r4,3,0,.+8       lochil   %r3,7
lochi  %r3,7,5      lochi  %r5,3,0,.+10      lochinhe %r3,7
lochi  %r3,7,6      lochi  %r6,3,0,.+12      lochilh  %r3,7
lochi  %r3,7,7      lochi  %r7,3,0,.+14      lochine  %r3,7
lochi  %r3,7,8      lochi  %r8,3,0,.+16      lochie   %r3,7
lochi  %r3,7,9      lochi  %r9,3,0,.+18      lochinlh %r3,7
lochi  %r3,7,10     lochi  %r10,3,0,.+20     lochihe  %r3,7
lochi  %r3,7,11     lochi  %r11,3,0,.+22     lochinl  %r3,7
lochi  %r3,7,12     lochi  %r12,3,0,.+24     lochile  %r3,7
lochi  %r3,7,13     lochi  %r13,3,0,.+26     lochinh  %r3,7
lochi  %r3,7,14     lochi  %r14,3,0,.+28     lochino  %r3,7
lochi  %r3,7,15     lochi  %r15,3,0,.+30     lochi    %r3,7,15

The disassembly is totally bogus. And likewise for LOCGHI and LOCHHI.
It looks to me as if s390_format_RIE_RUPIX was copied'n pasted from s390_format_RIS_RUPI but not adjusted.
Attached patch fixes the disassembly to match what objdump -d produces.
Comment 1 Andreas Arnez 2024-10-08 14:21:22 UTC
(In reply to Florian Krohm from comment #0)
> It looks to me as if s390_format_RIE_RUPIX was copied'n pasted from
> s390_format_RIS_RUPI but not adjusted.
Right, that seems likely. This was introduced as part of several large patches for z13 support.

> Attached patch fixes the disassembly to match what objdump -d produces.
Thanks! The patch looks good to me.
Comment 2 Andreas Arnez 2024-10-09 15:12:54 UTC
Pushed the patch as commit 61edfcd3c7b49033ec3e8df6470fad4c59cf0151.