riscv/purgatory: align riscv_kernel_entry
PATCH v2 1/1 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.
--- arch/riscv/purgatory/entry.S | 2 ++ 1 file changed, 2 insertions(+)
arch/riscv/purgatory/entry.S +2 -0
@@ -7,6 +7,7 @@ * Author: Li Zhengyu ([email protected]) * */ +#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
Signature · 7 lines
2.45.2 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 31 lines · Daniel Maslowski
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 736e30af583fb6e0e2b8211b894ff99dea0f1ee7Signed-off-by Daniel Maslowski <[email protected]>---
arch/riscv/purgatory/entry.S| 2 ++1 file changed, 2 insertions(+)arch/riscv/purgatory/entry.S +1
-0@@ -7,6 +7,7 @@ * Author: Li Zhengyu ([email protected]) * */ +#include <asm/asm.h> #include <linux/linkage.h>.text
arch/riscv/purgatory/entry.S +0
-0@@ -34,6 +35,7 @@ SYM_CODE_END(purgatory_start).data
Quoted 2 lines
+.align LGREG
SYM_DATA(riscv_kernel_entry, .quad 0)
It’s a bit weird to use LGREG for a .quad. The file is RV64-only already, anyway.
Jess
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 1 line · Daniel Maslowski
This has been tested on a JH7110 SoC with oreboot and its SBI delegating
coreboot?
Signature · 8 lines
Andreas Schwab, [email protected] GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 5 lines · Andreas Schwab
Quoted 1 line · Daniel Maslowski
This has been tested on a JH7110 SoC with oreboot and its SBI delegating
coreboot?
oreboot is coreboot without the c :)
https://github.com/oreboot/oreboot
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 9 lines · Daniel Maslowski
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 736e30af583fb6e0e2b8211b894ff99dea0f1ee7
Should be:
Regards,
Matthias
Quoted 33 lines
Signed-off-by Daniel Maslowski <[email protected]>--- arch/riscv/purgatory/entry.S | 2 ++ 1 file changed, 2 insertions(+)arch/riscv/purgatory/entry.S +2
-0@@ -7,6 +7,7 @@ * Author: Li Zhengyu ([email protected]) * */ +#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) .endSignature · 7 lines
2.45.2 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Hi Daniel,
Quoted 27 lines · Daniel Maslowski
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 736e30af583fb6e0e2b8211b894ff99dea0f1ee7Signed-off-by Daniel Maslowski <[email protected]>--- arch/riscv/purgatory/entry.S | 2 ++ 1 file changed, 2 insertions(+)arch/riscv/purgatory/entry.S +1
-0@@ -7,6 +7,7 @@ * Author: Li Zhengyu ([email protected]) * */ +#include <asm/asm.h> #include <linux/linkage.h> .text
arch/riscv/purgatory/entry.S SYM_CODE_END(purgatory_start) · line 41
Quoted 7 lines
arch/riscv/purgatory/entry.S +1
-0@@ -34,6 +35,7 @@ SYM_CODE_END(purgatory_start) .data +.align LGREG SYM_DATA(riscv_kernel_entry, .quad 0) .end
With the Fixes tag fixed like Matthias suggested, you can add:
Thanks,
Alex
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Hi Conor,
Quoted 8 lines · Conor Dooley
Quoted 5 lines · Andreas Schwab
Quoted 1 line · Daniel Maslowski
This has been tested on a JH7110 SoC with oreboot and its SBI delegating
coreboot?
oreboot is coreboot without the c :)
At first I thought this was just a joke about a typo...
Quoted 1 line
Given it's mainly written in Rust, perhaps it should have been called roreboot? Or roarboot? ;-)
Gr{oetje,eeting}s,
Geert
Signature · 10 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv