riscv: fix misalgned trap vector base address
authorChen Lu <181250012@smail.nju.edu.cn>
Mon, 18 Oct 2021 05:22:38 +0000 (13:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Nov 2021 18:48:25 +0000 (19:48 +0100)
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>
arch/riscv/kernel/head.S

index 7e849797c9c38ddc81311787dcf5188ba9de7a02..1a819c18bedecc43fa49affaea174ddf4e9b1de2 100644 (file)
@@ -175,6 +175,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