DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.63k stars 557 forks source link

consider cpuid features when deciding invalid instrs #431

Open derekbruening opened 9 years ago

derekbruening commented 9 years ago

From bruen...@google.com on April 11, 2011 10:37:32

currently the DR encoder will not consider a new opcode as invalid when running on an older processor that does not have that feature. this isn't a serious problem for DR itself since the right thing will happen when treating an invalid instr as valid: it's the other way around that causes often-fatal problems. but for DR as a disassembly library and for precision it would be nice to consider the cpuid features of the current processor. the feature set to assume may have to become a global setting when decoding statically.

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=431

fhahn commented 6 years ago

We could provide an API for clients to check if a given ISA version supports a given encoding. For example, half precision floating point arithmetic was only added in Armv8.2 and those instructions are not supported by earlier architecture versions.

I am not entirely sure how such an API should look like so it is flexible enough for a wide range of clients but can also be implemented efficiently.

derekbruening commented 11 months ago

Trying to clarify the opening comment above: for standalone decoding, we want a default of allowing all instructions, but with options to specify the feature set or query whether an instruction lies in it.

Xref #5725 where inconsistent defaults are leading to flaky tests.