Closed ghost closed 3 years ago
In arch/x86/tools/Makefile, there's an invocation of $(OBJDUMP)
that uses -v
. It can be changed to --version
for now.
Also, is there a config to enable posttest
? Maybe it's new in 5.9, but I've never heard of it before.
x86 decoder sanity test https://cateee.net/lkddb/web-lkddb/X86_DECODER_SELFTEST.html, has been there for a while
Having patched that Makefile the output now exhibits
HOSTCC arch/x86/tools/insn_decoder_test HOSTCC arch/x86/tools/insn_sanity TEST posttest TEST posttest arch/x86/tools/insn_sanity: Success: decoded and checked 1000000 random instructions with 0 errors (seed:0x151b2cfb)
@n8v8R were you planning on sending a patch? If not, I can do so tomorrow.
There are multiple issues here.
obviously, --version
parameter should be used for compatibility between the two
LLVM objdump version is not detected anyway, because the checkobjdump.awk
script uses a regexp which doesn't match its output. So the script needs to be changed. In addition, LLVM objdump versions 9 to 12 do not correctly recognize/disassemble the 0x40 0x42
bytes, which is a REX prefix appearing twice for some reason (more info here: https://wiki.osdev.org/X86-64_Instruction_Encoding#REX_prefix and http://staffwww.fullcoll.edu/aclifton/cs241/lecture-instruction-format.html). Could be a codegen issue with clang, though.
The LLVM objdump output needs to be reformatted to match what the insn_decoder_test
expects. So the objdump_reformat.awk
script needs to be changed too.
Reproducible via CONFIG_X86_DECODER_SELFTEST=y
on top of defconfig, then building bzImage
.
https://reviews.llvm.org/D101483
Let's use additional issues to follow up on anything else. It makes it easier to track where we are when there are multiple things going wrong.
-v
support: https://reviews.llvm.org/rGdde24a87c55f82d8c7b3bf3eafb10f2b9b2b9a01
closing, let's track @ihalip 's sugguestions in #1362 .
compiling kernel 5.9.-rc1 with LLVM-10 produces