* Re: [PATCH v2] riscv/purgatory: align riscv_kernel_entry
2024-07-16 20:40 [PATCH v2] riscv/purgatory: align riscv_kernel_entry Daniel Maslowski
@ 2024-07-16 20:53 ` Jessica Clarke
2024-07-16 21:22 ` Andreas Schwab
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Jessica Clarke @ 2024-07-16 20:53 UTC (permalink / raw)
To: Daniel Maslowski
Cc: linux-riscv, Björn Töpel, Clément Léger,
Daniel Maslowski
On 16 Jul 2024, at 21:40, Daniel Maslowski <cyrevolt@googlemail.com> 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.
>
> Fixes: 736e30af583fb6e0e2b8211b894ff99dea0f1ee7
> Signed-off-by: Daniel Maslowski <cyrevolt@gmail.com>
> ---
> arch/riscv/purgatory/entry.S | 2 ++
> 1 file changed, 2 insertions(+)
>
> 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)
It’s a bit weird to use LGREG for a .quad. The file is RV64-only
already, anyway.
Jess
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v2] riscv/purgatory: align riscv_kernel_entry
2024-07-16 20:40 [PATCH v2] riscv/purgatory: align riscv_kernel_entry Daniel Maslowski
2024-07-16 20:53 ` Jessica Clarke
@ 2024-07-16 21:22 ` Andreas Schwab
2024-07-16 21:34 ` Conor Dooley
2024-07-18 15:16 ` Matthias Brugger
2024-07-18 17:10 ` Alexandre Ghiti
3 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2024-07-16 21:22 UTC (permalink / raw)
To: Daniel Maslowski
Cc: linux-riscv, Björn Töpel, Clément Léger,
Daniel Maslowski
On Jul 16 2024, Daniel Maslowski wrote:
> This has been tested on a JH7110 SoC with oreboot and its SBI delegating
coreboot?
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] riscv/purgatory: align riscv_kernel_entry
2024-07-16 21:22 ` Andreas Schwab
@ 2024-07-16 21:34 ` Conor Dooley
2024-07-22 7:51 ` Geert Uytterhoeven
0 siblings, 1 reply; 7+ messages in thread
From: Conor Dooley @ 2024-07-16 21:34 UTC (permalink / raw)
To: Andreas Schwab
Cc: Daniel Maslowski, linux-riscv, Björn Töpel,
Clément Léger, Daniel Maslowski
[-- Attachment #1.1: Type: text/plain, Size: 285 bytes --]
On Tue, Jul 16, 2024 at 11:22:01PM +0200, Andreas Schwab wrote:
> On Jul 16 2024, Daniel Maslowski wrote:
>
> > 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
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] riscv/purgatory: align riscv_kernel_entry
2024-07-16 21:34 ` Conor Dooley
@ 2024-07-22 7:51 ` Geert Uytterhoeven
0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2024-07-22 7:51 UTC (permalink / raw)
To: Conor Dooley
Cc: Andreas Schwab, Daniel Maslowski, linux-riscv,
Björn Töpel, Clément Léger, Daniel Maslowski
Hi Conor,
On Tue, Jul 16, 2024 at 11:38 PM Conor Dooley <conor@kernel.org> wrote:
> On Tue, Jul 16, 2024 at 11:22:01PM +0200, Andreas Schwab wrote:
> > On Jul 16 2024, Daniel Maslowski wrote:
> >
> > > 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...
> https://github.com/oreboot/oreboot
Given it's mainly written in Rust, perhaps it should have been called
roreboot? Or roarboot? ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] riscv/purgatory: align riscv_kernel_entry
2024-07-16 20:40 [PATCH v2] riscv/purgatory: align riscv_kernel_entry Daniel Maslowski
2024-07-16 20:53 ` Jessica Clarke
2024-07-16 21:22 ` Andreas Schwab
@ 2024-07-18 15:16 ` Matthias Brugger
2024-07-18 17:10 ` Alexandre Ghiti
3 siblings, 0 replies; 7+ messages in thread
From: Matthias Brugger @ 2024-07-18 15:16 UTC (permalink / raw)
To: Daniel Maslowski
Cc: linux-riscv, Björn Töpel, Clément Léger,
Daniel Maslowski
On Tue, Jul 16, 2024 at 10:40:47PM +0200, Daniel Maslowski 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.
>
> Fixes: 736e30af583fb6e0e2b8211b894ff99dea0f1ee7
Should be:
Fixes: 736e30af583fb ("RISC-V: Add purgatory")
Regards,
Matthias
> Signed-off-by: Daniel Maslowski <cyrevolt@gmail.com>
> ---
> arch/riscv/purgatory/entry.S | 2 ++
> 1 file changed, 2 insertions(+)
>
> 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
> --
> 2.45.2
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v2] riscv/purgatory: align riscv_kernel_entry
2024-07-16 20:40 [PATCH v2] riscv/purgatory: align riscv_kernel_entry Daniel Maslowski
` (2 preceding siblings ...)
2024-07-18 15:16 ` Matthias Brugger
@ 2024-07-18 17:10 ` Alexandre Ghiti
3 siblings, 0 replies; 7+ messages in thread
From: Alexandre Ghiti @ 2024-07-18 17:10 UTC (permalink / raw)
To: Daniel Maslowski, linux-riscv
Cc: Björn Töpel, Clément Léger, Daniel Maslowski
Hi Daniel,
On 16/07/2024 22:40, Daniel Maslowski 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.
>
> Fixes: 736e30af583fb6e0e2b8211b894ff99dea0f1ee7
> Signed-off-by: Daniel Maslowski <cyrevolt@gmail.com>
> ---
> arch/riscv/purgatory/entry.S | 2 ++
> 1 file changed, 2 insertions(+)
>
> 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
With the Fixes tag fixed like Matthias suggested, you can add:
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Thanks,
Alex
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 7+ messages in thread