DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.57k stars 551 forks source link

i#6744: Use xrstors32 and xsaves32 for invariant checker test on x86-32. #6747

Closed ivankyluk closed 3 months ago

ivankyluk commented 3 months ago

tool.drcachesim.invariant_checker_test fails on x86-32 with the following error:

1/371 Test https://github.com/DynamoRIO/dynamorio/issues/11: tool.drcachesim.invariant_checker_test ...........................***Failed 0.04 sec

Recording |Too many read records| in T1 @ ref # 16 (6 instrs since timestamp 0) Recording |Too many read records| in T1 @ ref # 17 (6 instrs since timestamp 0) Recording |Too many read records| in T1 @ ref # 18 (6 instrs since timestamp 0) Recording |Too many read records| in T1 @ ref # 19 (6 instrs since timestamp 0) Recording |Too many write records| in T1 @ ref # 21 (7 instrs since timestamp 0) Recording |Too many write records| in T1 @ ref # 22 (7 instrs since timestamp 0) Recording |Too many write records| in T1 @ ref # 23 (7 instrs since timestamp 0) Recording |Too many write records| in T1 @ ref # 24 (7 instrs since timestamp 0) Unexpected error: Too many read records at ref: 16 Unexpected error: Too many read records at ref: 17 Unexpected error: Too many read records at ref: 18 Unexpected error: Too many read records at ref: 19 Unexpected error: Too many write records at ref: 21 Unexpected error: Too many write records at ref: 22 Unexpected error: Too many write records at ref: 23 Unexpected error: Too many write records at ref: 24

OP_xsaves64 and OP_xrstors32 are marked as o64 (X86_INVALID) in core/ir/x86/decode_table.c.

instr_is_xsave() and instr_is_xrstor() return false on x86-32, hence not skipping the number of read/write record check in the invariant check on x86_32.

Use xrstors32 and xsaves32 instead for the test on x86_32.

Fixes #6744