DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.64k stars 560 forks source link

Provide support in drreg to spill something other than GPRs, cross-app instructions. #3844

Open hgreving2304 opened 5 years ago

hgreving2304 commented 5 years ago

Specifically currently hitting this issue is #2985. The case needs some capability to spill - in this case - xmm and a mask register value, cross-app instruction (hence mcontext can not be used). This issue covers providing a method to spill into the TLS data that drreg already has, managed by drmgr.

Interface TBD:

Specifically allow for reserving xmm and mask registers? Also needs an unreserve method.: drreg_reserve_xmm_register() + drreg_reserve_mask_register()?

_Instructing drreg to spill arbitrary number of bytes from opnd_t, or opnd_size_in_bytes() of opndt? Also needs a restore method.: drreg_reserve_spill_bytes()?

Other ideas?

Case #2985 needs this cross-app, hence no automatic management is needed. Should new API be written to provide automatic spill/restore management when called from insertion phase?

abhinav92003 commented 3 years ago

FYI, we're hitting this issue today in the scatter/gather test app: https://github.com/DynamoRIO/dynamorio/blob/cf9d6a95262015581a5184e75ce599cc66ac4df4/clients/drcachesim/tests/allasm_scattergather.asm#L34

We'd definitely also hit this when running a real application that has scatter/gather instrs. Friendly ping on this (sorry for the nagging!); Other blocking support for scatter/gather will probably be done by this/next week.