Skip to content

Commit 0d998cf

Browse files
Avenger-285714vijay-suman
authored andcommitted
riscv: KGDB: Remove ".option norvc/.option rvc" for kgdb_compiled_break
[ Upstream commit 550c2aa787d1b06efcb11de1877354502a1237f2 ] [ Quoting Samuel Holland: ] This is a separate issue, but using ".option rvc" here is a bug. It will unconditionally enable the C extension for the rest of the file, even if the kernel is being built with CONFIG_RISCV_ISA_C=n. [ Quoting Palmer Dabbelt: ] We're just looking at the address of kgdb_compiled_break, so it's fine if it ends up as a c.ebreak. [ Quoting Alexandre Ghiti: ] .option norvc is used to prevent the assembler from using compressed instructions, but it's generally used when we need to ensure the size of the instructions that are used, which is not the case here as noted by Palmer since we only care about the address. So yes it will work fine with C enabled :) So let's just remove them all. Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/all/mhng-69513841-5068-441d-be8f-2aeebdc56a08@palmer-ri-x1c9a/ Link: https://lore.kernel.org/all/[email protected]/ Fixes: fe89bd2 ("riscv: Add KGDB support") Cc: Samuel Holland <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Alexandre Ghiti <[email protected]> Signed-off-by: WangYuli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 6bc390b02d4b700b3c3fa0264dc34fab5d4ace6d) Signed-off-by: Vijayendra Suman <[email protected]>
1 parent 61a5e4b commit 0d998cf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/riscv/kernel/kgdb.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,7 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc)
276276
noinline void arch_kgdb_breakpoint(void)
277277
{
278278
asm(".global kgdb_compiled_break\n"
279-
".option norvc\n"
280-
"kgdb_compiled_break: ebreak\n"
281-
".option rvc\n");
279+
"kgdb_compiled_break: ebreak\n");
282280
}
283281

284282
void kgdb_arch_handle_qxfer_pkt(char *remcom_in_buffer,

0 commit comments

Comments
 (0)