Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement dr_insert_cbr_instrumentation on ARM & AArch64 #2297

Open
fhahn opened this issue Mar 16, 2017 · 4 comments
Open

Implement dr_insert_cbr_instrumentation on ARM & AArch64 #2297

fhahn opened this issue Mar 16, 2017 · 4 comments

Comments

@fhahn
Copy link
Contributor

fhahn commented Mar 16, 2017

dr_insert_cbr_instrumentation and dr_insert_cbr_instrumentation_ex are not yet implemented on ARM & AArch64.

@fhahn
Copy link
Contributor Author

fhahn commented Mar 16, 2017

xref #1569

@AssadHashmi AssadHashmi self-assigned this May 9, 2018
@AssadHashmi
Copy link
Contributor

AssadHashmi commented May 9, 2018

Hello @derekbruening @fhahn @egrimley I have a requirement to get api/samples/cbrtrace.c working for AArch64.

My approach to implementing dr_insert_cbr_instrumentation_help() is to figure out the X86 version and port to AArch64. Do you think this is the best way of tackling the issue?

There may (probably will?) be differences in the way the clean call is used by dr_insert_cbr_instrumentation_help() on AArch64 AIUI the layouts differ.

@derekbruening
Copy link
Contributor

The x86 version is so complex b/c it's trying to take advantage of the clean call state save to avoid spilling anything extra, yet not affect the stored state, while not changing the clean call insertion code and instead examining it afterward: rather messy. One could imagine ways to make it simpler and less fragile, but at a performance cost with extra loads and stores; or even simpler, with a layered callee who computes the branch direction from the dr_mcontex_t, but again at a performance cost.

One thing you won't have to deal with on AArch64 is the flags being clobbered (by POPF on x86 to clear the direction flag for the ABI).

@AssadHashmi
Copy link
Contributor

Ah ok! Thanks Derek.

jiegec added a commit to jiegec/dynamorio that referenced this issue Sep 25, 2024
Implement cbr instrumentation for AARCH64, supporting
cbz/cbnz/tbz/tbnz/bcond opcodes.

Issue: DynamoRIO#2297
jiegec added a commit to jiegec/dynamorio that referenced this issue Sep 26, 2024
Document newly added instruction creation macros for EOR, CSINC and
UBFM.  Refactor XINST_CREATE_slr_s to use the new macro to create ubfm
instruction.

Fixes DynamoRIO#2297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants