DynamoRIO / DynamoRIO/dynamorio

Multi-phase drreg use hides app value from later phases

Open
#5,121 6 comments 0 reactions 1 assignee Claimed by @abhinav92003 View on GitHub
Component-Extension
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

Today, DR supports multi-phase use for drreg, which means that clients can use drreg to get scratch regs in insertion phase and other phases as well.

#3823 added support to avoid spill slot conflicts in multi-phase use. However, different phases can still get the same scratch reg. In such "nested" spill regions, `drreg_get_app_value` won't work as expected in later phases, as it will give the value of the reg in the earlier phase, not the app value. This should be fixed, and documented until then.

Another related note:
Drreg support in non-insertion phases is bare bones -- e.g. it does not automatically restore app value before app read, or re-spill app value after app writes. This is usually fine because non-insertion phase is pretty limited. Today, we do that to expand scatter/gather instructions in app2app phase. But we should document this restriction about non-insertion phase use.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.