dynamorio icon indicating copy to clipboard operation
dynamorio copied to clipboard

consider cpuid features when deciding invalid instrs

Open derekbruening opened this issue 10 years ago • 2 comments

From [email protected] 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

derekbruening avatar Nov 28 '14 00:11 derekbruening

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.

fhahn avatar Apr 25 '18 15:04 fhahn

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.

derekbruening avatar Nov 09 '23 23:11 derekbruening