DynamoRIO / DynamoRIO/dynamorio

OP_mrs writes only some flags depending on immed arg

Open
#1,817 0 comments 0 reactions 1 assignee Claimed by @derekbruening View on GitHub
Component-API OpSys-ARM
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

For the original #1551 I had a note about this but we never fixed it.

OP_mrs takes an immed that decides whether to write NZCVQ and whether to
write GE.

Can it be fit under existing predication mechanism?
Except we only have DR_PRED_COMPLEX for x86, and adding DR_PRED_COMPLEX for
ARM would push us into another bit in the field.
And what if the instr also has a regular predicate?
Do we support 2 predicates at once?
No, b/c we packed the flag bits, right?
I guess _COMPLEX could cover 2 at once on decode, but on encode may have trouble.

Although, since the variance here is based on an immed, maybe we can look
at the immed val: statically known. We won't be able to ask about flags w/
just opcode anymore but I think that's rare -- or we could go and decode
the 1st src, just for OP_mrs.

Impl:
- List in table as maximal set, so instr_get_opcode_eflags can just return
that (and document it)
- decode_eflags_usage() and decode_opcode() do special-case decoding of
1st immed for OP_mrs
- Full decode examines 1st immed

Related: OP_msr_priv and OP_msr_priv don't ever access cpsr, just spsr or banked Rm_mode or ELR_hyp, so they are incorrect in the table.

Related: OP_mrs is not listed as reading the flags

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.