x86/tools: objdump_reformat.awk: Ensure regex matches fwait
authorSamuel Zeter <samuelzeter@gmail.com>
Wed, 29 Nov 2023 22:17:41 +0000 (15:17 -0700)
committerIngo Molnar <mingo@kernel.org>
Thu, 30 Nov 2023 08:38:09 +0000 (09:38 +0100)
commit60c2ea7c89e375804171552d8ea53d9084ec3269
treec751bb833d66fb6a9d823975f3b43b338e04c651
parent2cc14f52aeb78ce3f29677c2de1f06c0e91471ab
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: https://github.com/ClangBuiltLinux/linux/issues/1364
arch/x86/tools/objdump_reformat.awk