Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Issues
  • #4560
Closed
Open
Issue created Nov 24, 2020 by Derek Bruening@derekbrueningContributor

aarch64 XZR considered GPR but WZR is not and is not handled in multiple API routines

Working on #1698 I'm hitting problems trying to use XZR. It looks like reg_is_gpr() says the DR_REG_XZR is in fact a GPR, while DR_REG_WZR is not: looks like a bug. The DR_REG_START_* defines have neither as a GPR.

Plus we have failure to handle XZR in several register routines:

    <Application /home/derek/dr/build/suite/tests/bin/client.ldstex (68163) DynamoRIO usage error : reg_64_to_32: passed non-64-bit reg>
<Usage error: reg_64_to_32: passed non-64-bit reg (/home/derek/dr/src/core/ir/opnd_shared.c, line 2220)

#4  0x00000000710c3ea0 in external_error (file=0x713d6ab0 "/home/derek/dr/src/core/ir/opnd_shared.c", line=2220, 
    msg=0x713d7a20 "reg_64_to_32: passed non-64-bit reg") at /home/derek/dr/src/core/utils.c:201
#5  0x00000000712283a4 in reg_64_to_32 (reg=34) at /home/derek/dr/src/core/ir/opnd_shared.c:2219
#6  0x0000000071228518 in reg_resize_to_opsz (reg=34, sz=6 '\006') at /home/derek/dr/src/core/ir/opnd_shared.c:2329
#7  0x0000000071234e14 in instr_create_save_to_tls (dcontext=0xfffd74004080, reg=34, offs=168) at /home/derek/dr/src/core/ir/instr_shared.c:3538
#8  0x0000000071314b84 in mangle_exclusive_monitor_op (dcontext=0xfffd74004080, ilist=0xfffd7402dbe0, instr=0xfffd7402f608, next_instr=0xfffd7402fda0)
    at /home/derek/dr/src/core/arch/aarchxx/mangle.c:3383
#9  0x00000000713066a8 in d_r_mangle (dcontext=0xfffd74004080, ilist=0xfffd7402dbe0, flags=0xfffd7402ae08, mangle_calls=true, record_translation=false)

At first I thought it would be simpler to consider the zero regs as GPR's, which simplifies reg_get_size(), reg_resize_to_opsz(), etc. to not need special-case handling. OTOH drreg doesn't want to try to hand out xzr as a scratch register: so keeping them non-GPR is probably best. So the action items are to fix reg_is_gpr() to not include ZXR, and to add special handling to the reg size routines..

Assignee
Assign to
Time tracking