diff mbox series

[v3] riscv/purgatory: align riscv_kernel_entry

Message ID 20240719170437.247457-1-cyrevolt@gmail.com (mailing list archive)
State Accepted
Commit fb197c5d2fd24b9af3d4697d0cf778645846d6d5
Headers show
Series [v3] riscv/purgatory: align riscv_kernel_entry | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-1-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-1-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-1-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-1-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-1-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-1-test-6 warning .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-1-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-1-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-1-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-1-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-1-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-1-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

Daniel Maslowski July 19, 2024, 5:04 p.m. UTC
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: 736e30af583fb ("RISC-V: Add purgatory")
Signed-off-by: Daniel Maslowski <cyrevolt@gmail.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
---
 arch/riscv/purgatory/entry.S | 2 ++
 1 file changed, 2 insertions(+)

Comments

patchwork-bot+linux-riscv@kernel.org Aug. 1, 2024, 4:40 p.m. UTC | #1
Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Fri, 19 Jul 2024 19:04:37 +0200 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [v3] riscv/purgatory: align riscv_kernel_entry
    https://git.kernel.org/riscv/c/fb197c5d2fd2

You are awesome, thank you!
diff mbox series

Patch

diff --git a/arch/riscv/purgatory/entry.S b/arch/riscv/purgatory/entry.S
index 5bcf3af903da..0e6ca6d5ae4b 100644
--- a/arch/riscv/purgatory/entry.S
+++ b/arch/riscv/purgatory/entry.S
@@ -7,6 +7,7 @@ 
  * Author: Li Zhengyu (lizhengyu3@huawei.com)
  *
  */
+#include <asm/asm.h>
 #include <linux/linkage.h>
 
 .text
@@ -34,6 +35,7 @@  SYM_CODE_END(purgatory_start)
 
 .data
 
+.align LGREG
 SYM_DATA(riscv_kernel_entry, .quad 0)
 
 .end