Skip to content

Commit fb197c5

Browse files
cyrevoltpalmer-dabbelt
authored andcommitted
riscv/purgatory: align riscv_kernel_entry
When alignment handling is delegated to the kernel, everything must be word-aligned in purgatory, since the trap handler is then set to the kexec one. Without the alignment, hitting the exception would ultimately crash. On other occasions, the kernel's handler would take care of exceptions. This has been tested on a JH7110 SoC with oreboot and its SBI delegating unaligned access exceptions and the kernel configured to handle them. Fixes: 736e30a ("RISC-V: Add purgatory") Signed-off-by: Daniel Maslowski <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent b75a22e commit fb197c5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/riscv/purgatory/entry.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Author: Li Zhengyu ([email protected])
88
*
99
*/
10+
#include <asm/asm.h>
1011
#include <linux/linkage.h>
1112

1213
.text
@@ -34,6 +35,7 @@ SYM_CODE_END(purgatory_start)
3435

3536
.data
3637

38+
.align LGREG
3739
SYM_DATA(riscv_kernel_entry, .quad 0)
3840

3941
.end

0 commit comments

Comments
 (0)