Skip to content

Commit 60c2ea7

Browse files
samzeteringomolnar
authored andcommitted
x86/tools: objdump_reformat.awk: Ensure regex matches fwait
If there is "wait" mnemonic in the line being parsed, it is incorrectly handled by the script, and an extra line of "fwait" in objdump_reformat's output is inserted. As insn_decoder_test relies upon the formatted output, the test fails. This is reproducible when disassembling with llvm-objdump: Pre-processed lines: ffffffff81033e72: 9b wait ffffffff81033e73: 48 c7 c7 89 50 42 82 movq After objdump_reformat.awk: ffffffff81033e72: 9b fwait ffffffff81033e72: wait ffffffff81033e73: 48 c7 c7 89 50 42 82 movq The regex match now accepts spaces or tabs, along with the "fwait" instruction. Signed-off-by: Samuel Zeter <samuelzeter@gmail.com> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Tested-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Kees Cook <keescook@chromium.org> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Link: https://lore.kernel.org/r/20231129-objdump-reformat-llvm-v3-1-0d855e79314d@kernel.org Closes: ClangBuiltLinux#1364
1 parent 2cc14f5 commit 60c2ea7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/x86/tools/objdump_reformat.awk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ BEGIN {
1212
prev_hex = ""
1313
prev_mnemonic = ""
1414
bad_expr = "(\\(bad\\)|^rex|^.byte|^rep(z|nz)$|^lock$|^es$|^cs$|^ss$|^ds$|^fs$|^gs$|^data(16|32)$|^addr(16|32|64))"
15-
fwait_expr = "^9b "
15+
fwait_expr = "^9b[ \t]*fwait"
1616
fwait_str="9b\tfwait"
1717
}
1818

0 commit comments

Comments
 (0)