]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
RISC-V: fix funct4 definition for c.jalr in parse_asm.h
authorHeiko Stuebner <heiko.stuebner@vrull.eu>
Fri, 23 Dec 2022 22:13:21 +0000 (23:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:21:50 +0000 (13:21 +0100)
[ Upstream commit a3775634f6da23f5511d0282d7e792cf606e5f3b ]

The opcode definition for c.jalr is
    c.jalr c_rs1_n0  1..0=2 15..13=4 12=1 6..2=0

This means funct4 consisting of bit [15:12] is 1001b, so the value is 0x9.

Fixes: edde5584c7ab ("riscv: Add SW single-step support for KDB")
Reported-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
Link: https://lore.kernel.org/r/20221223221332.4127602-2-heiko@sntech.de
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/include/asm/parse_asm.h

index 3cd00332d70f5ac2c0e17aea7383186f83ce78c6..ad254da85e6153b8709023caf103bd6bb8930d2d 100644 (file)
 #define FUNCT3_C_J             0xa000
 #define FUNCT3_C_JAL           0x2000
 #define FUNCT4_C_JR            0x8000
-#define FUNCT4_C_JALR          0xf000
+#define FUNCT4_C_JALR          0x9000
 
 #define FUNCT12_SRET           0x10200000