-
Notifications
You must be signed in to change notification settings - Fork 565
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
check all "unpredictable" conditions and "reserved (0)" bits when decoding #1685
Comments
There are many examples of different decoders doing different things in this area. Here is one example:
v8 and v7 manuals say:
Manual also says the bottom half should be 0x0a00 (though the values are in Clear those bits and everyone agrees:
I do not see where this #2 is coming from? But why would capstone and llvm have the exact same behavior there? Similarly:
|
I'm using this issue to document some of the corner cases. One is a SIMD consecutive register list exceeding the max register. E.g.:
We used to consider it invalid (a rare case of our decoder being stricter than capstone):
I recently had to add a missing check for >32 total regs and decided to not mark it invalid. But a little inconsistent of us to consider ok if start at 0 and ask for >32 but mark as invalid if do same but start at > 0. I ran:
in suite/tests/bin/common.allasm_arm and no SIGILL, so I'm going to remove the existing invalid marking for >s31. |
Listing a number of other issues beyond the OP_rfe and SIMD lists above:
|
More:
|
xref "unp" == DECODE_UNPREDICTABLE which we are ignoring today |
Summarizing what apparently isn't clear up above: the plan is to stick with the current approach, which uses sub-tables to enforce a required "0" bit, uses the stored opcode mask to enforce a required "1" or a reserved "(1)" bit, and does not enforce a reserved "(0)" bit. This issue covers possibly adding a second mask for "(0)" but it is low priority as we have yet to see one that raises SIGILL. |
It is not clear to me what the plan is here. If the decoder sees an instruction that is formally UNPREDICTABLE, but likely to read and write certain registers, then it has to decode it in a way that will allow it to be correctly mangled. So how does it do that? |
I don't understand the question. These encodings have clear operands and are straightforward to decode and mangle. |
Today our decoder does not care much about "unpredictable" conditions (typically pc or lr used as certain operands, but widely varying) and "reserved (0)" bits when decoding. Both would require adding extra info to our decode tables, for questionable benefit. Often the processor will execute "unpredictable" instructions just fine, and as far as DR is concerned we'd rather wait for a fault. However, to make a nice standalone decoder we might want to consider adding all this info. Some of this is a gray area and varies across processor versions, so we'd also want to be much more rigorous about which processor supports which instruction variant. Definitely low priority for DR itself.
The text was updated successfully, but these errors were encountered: