summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Lu <181250012@smail.nju.edu.cn>2021-10-18 13:22:38 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-02 19:51:01 +0100
commit7567abe63797aba9b2b7e16c543ec6af987f9baa (patch)
tree34d065adb35622fb91038ff2732bb956c363355e
parent20bd764387aca98bdbc62c1bac4e618fa6c22e70 (diff)
riscv: fix misalgned trap vector base address
commit 64a19591a2938b170aa736443d5d3bf4c51e1388 upstream. The trap vector marked by label .Lsecondary_park must align on a 4-byte boundary, as the {m,s}tvec is defined to require 4-byte alignment. Signed-off-by: Chen Lu <181250012@smail.nju.edu.cn> Reviewed-by: Anup Patel <anup.patel@wdc.com> Fixes: e011995e826f ("RISC-V: Move relocate and few other functions out of __init") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/riscv/kernel/head.S1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index fce5184b22c3..52c5ff9804c5 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -193,6 +193,7 @@ setup_trap_vector:
csrw CSR_SCRATCH, zero
ret
+.align 2
.Lsecondary_park:
/* We lack SMP support or have too many harts, so park this hart */
wfi