aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@rivosinc.com>2023-02-21 16:53:58 -0800
committerPalmer Dabbelt <palmer@rivosinc.com>2023-02-21 17:21:51 -0800
commitb19aa282c50344bbac8e50592b21bac624c51d5d (patch)
treef9a60e4f136450a521d25ce02be92dd7fdf5c653 /scripts
parentriscv: alternative: proceed one more instruction for auipc/jalr pair (diff)
parentscripts/decodecode: Add support for RISC-V (diff)
downloadwireguard-linux-b19aa282c50344bbac8e50592b21bac624c51d5d.tar.xz
wireguard-linux-b19aa282c50344bbac8e50592b21bac624c51d5d.zip
Merge patch series "riscv: Dump faulting instructions in oops handler"
Björn Töpel <bjorn@kernel.org> says: From: Björn Töpel <bjorn@rivosinc.com> RISC-V does not dump faulting instructions in the oops handler. This series adds "Code:" dumps to the oops output together with scripts/decodecode support. * b4-shazam-merge: scripts/decodecode: Add support for RISC-V riscv: Add instruction dump to RISC-V splats Link: https://lore.kernel.org/r/20230119074738.708301-1-bjorn@kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/decodecode12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/decodecode b/scripts/decodecode
index b28fd2686561..8fe71c292381 100755
--- a/scripts/decodecode
+++ b/scripts/decodecode
@@ -93,6 +93,11 @@ disas() {
${CROSS_COMPILE}strip $t.o
fi
+ if [ "$ARCH" = "riscv" ]; then
+ OBJDUMPFLAGS="-M no-aliases --section=.text -D"
+ ${CROSS_COMPILE}strip $t.o
+ fi
+
if [ $pc_sub -ne 0 ]; then
if [ $PC ]; then
adj_vma=$(( $PC - $pc_sub ))
@@ -126,8 +131,13 @@ get_substr_opcode_bytes_num()
do
substr+="$opc"
+ opcode="$substr"
+ if [ "$ARCH" = "riscv" ]; then
+ opcode=$(echo $opcode | tr ' ' '\n' | tac | tr -d '\n')
+ fi
+
# return if opcode bytes do not match @opline anymore
- if ! echo $opline | grep -q "$substr";
+ if ! echo $opline | grep -q "$opcode";
then
break
fi