Skip to content

Commit 5cd900b

Browse files
clementlegerpalmer-dabbelt
authored andcommitted
riscv: use local label names instead of global ones in assembly
Local labels should be prefix by '.L' or they'll be exported in the symbol table. Additionally, this messes up the backtrace by displaying an incorrect symbol: ... [ 12.751810] [<ffffffff80441628>] _copy_from_user+0x28/0xc2 [ 12.752035] [<ffffffff800152ca>] handle_misaligned_load+0x1ca/0x2fc [ 12.752310] [<ffffffff80a033e8>] do_trap_load_misaligned+0x24/0xee [ 12.752596] [<ffffffff80a0dcae>] _new_vmalloc_restore_context_a0+0xc2/0xce After: ... [ 10.243916] [<ffffffff804415e4>] _copy_from_user+0x28/0xc2 [ 10.244026] [<ffffffff800152ca>] handle_misaligned_load+0x1ca/0x2fc [ 10.244150] [<ffffffff80a033a0>] do_trap_load_misaligned+0x24/0xee [ 10.244268] [<ffffffff80a0dc66>] handle_exception+0x146/0x152 Signed-off-by: Clément Léger <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Fixes: 503638e ("riscv: Stop emitting preventive sfence.vma for new vmalloc mappings") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 40e6073 commit 5cd900b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

arch/riscv/kernel/entry.S

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@
2323
REG_S a0, TASK_TI_A0(tp)
2424
csrr a0, CSR_CAUSE
2525
/* Exclude IRQs */
26-
blt a0, zero, _new_vmalloc_restore_context_a0
26+
blt a0, zero, .Lnew_vmalloc_restore_context_a0
2727

2828
REG_S a1, TASK_TI_A1(tp)
2929
/* Only check new_vmalloc if we are in page/protection fault */
3030
li a1, EXC_LOAD_PAGE_FAULT
31-
beq a0, a1, _new_vmalloc_kernel_address
31+
beq a0, a1, .Lnew_vmalloc_kernel_address
3232
li a1, EXC_STORE_PAGE_FAULT
33-
beq a0, a1, _new_vmalloc_kernel_address
33+
beq a0, a1, .Lnew_vmalloc_kernel_address
3434
li a1, EXC_INST_PAGE_FAULT
35-
bne a0, a1, _new_vmalloc_restore_context_a1
35+
bne a0, a1, .Lnew_vmalloc_restore_context_a1
3636

37-
_new_vmalloc_kernel_address:
37+
.Lnew_vmalloc_kernel_address:
3838
/* Is it a kernel address? */
3939
csrr a0, CSR_TVAL
40-
bge a0, zero, _new_vmalloc_restore_context_a1
40+
bge a0, zero, .Lnew_vmalloc_restore_context_a1
4141

4242
/* Check if a new vmalloc mapping appeared that could explain the trap */
4343
REG_S a2, TASK_TI_A2(tp)
@@ -69,7 +69,7 @@ _new_vmalloc_kernel_address:
6969
/* Check the value of new_vmalloc for this cpu */
7070
REG_L a2, 0(a0)
7171
and a2, a2, a1
72-
beq a2, zero, _new_vmalloc_restore_context
72+
beq a2, zero, .Lnew_vmalloc_restore_context
7373

7474
/* Atomically reset the current cpu bit in new_vmalloc */
7575
amoxor.d a0, a1, (a0)
@@ -83,11 +83,11 @@ _new_vmalloc_kernel_address:
8383
csrw CSR_SCRATCH, x0
8484
sret
8585

86-
_new_vmalloc_restore_context:
86+
.Lnew_vmalloc_restore_context:
8787
REG_L a2, TASK_TI_A2(tp)
88-
_new_vmalloc_restore_context_a1:
88+
.Lnew_vmalloc_restore_context_a1:
8989
REG_L a1, TASK_TI_A1(tp)
90-
_new_vmalloc_restore_context_a0:
90+
.Lnew_vmalloc_restore_context_a0:
9191
REG_L a0, TASK_TI_A0(tp)
9292
.endm
9393

0 commit comments

Comments
 (0)