Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [boot-wrapper v4 0/4] Add Armv8-R AArch64 support
       [not found] <20241017095520.939464-1-luca.fancellu@arm.com>
@ 2024-11-26 11:54 ` Mark Rutland
       [not found] ` <20241017095520.939464-5-luca.fancellu@arm.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Rutland @ 2024-11-26 11:54 UTC (permalink / raw)
  To: Luca Fancellu; +Cc: andre.przywara, linux-arm-kernel

Hi Luca,

Sorry for the long delay on this; I've picked up patches 1-3 and pushed
those out, but I have some concerns with the Xen support in patch 4
(which I'll comment on there).

Mark.

On Thu, Oct 17, 2024 at 10:55:16AM +0100, Luca Fancellu wrote:
> Currently, we cannot boot Linux with boot-wrapper on Armv8-R AArch64:
> 1. The Armv8-R AArch64 profile does not support the EL3.
> 2. The Armv8-R AArch64 EL2 only supports a PMSA, which Linux does not
> support. So it's necessary to drop into EL1 before entering the kernel.
> 3. There is no EL2 booting code for Armv8-R AArch64 and no
> configuration for dropping to EL1 in boot-wrapper.
> 
> These patches enable boot-wrapper booting Linux with Armv8-R AArch64.
> 
> This work took inspiration from a serie already present upstream [1].
> 
> [1] https://patchwork.kernel.org/project/linux-arm-kernel/cover/20210525062509.201464-1-jaxson.han@arm.com/
> 
> Changes from v3:
> - rebase on current master
> - detailed changes on each patch
> Changes from v2:
>  - Now this work is based on this serie:
>    https://patchwork.kernel.org/project/linux-arm-kernel/cover/20240729161501.1806271-1-mark.rutland@arm.com/
>    Given the major rework, dropped every R-by.
> Changes from v1:
>  - Dropped patch 4 regarding GIC changes, it's not needed anymore.
> 
> Luca Fancellu (4):
>   Introduce --with-bw-arch for boot-wrapper compile arch
>   aarch64: Enable Armv8-R EL2 boot
>   aarch64: Implement PSCI for Armv8-R
>   aarch64: Start Xen on Armv8-R at EL2
> 
>  Makefile.am                    |  7 ++-
>  arch/aarch64/boot.S            |  5 ++
>  arch/aarch64/include/asm/cpu.h | 24 ++++++++++
>  arch/aarch64/init.c            | 83 ++++++++++++++++++++++++++++++++--
>  configure.ac                   | 20 ++++++--
>  5 files changed, 130 insertions(+), 9 deletions(-)
> 
> -- 
> 2.34.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [boot-wrapper v4 4/4] aarch64: Start Xen on Armv8-R at EL2
       [not found] ` <20241017095520.939464-5-luca.fancellu@arm.com>
@ 2024-11-26 11:58   ` Mark Rutland
  2024-11-26 14:40     ` Luca Fancellu
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Rutland @ 2024-11-26 11:58 UTC (permalink / raw)
  To: Luca Fancellu; +Cc: andre.przywara, linux-arm-kernel

On Thu, Oct 17, 2024 at 10:55:20AM +0100, Luca Fancellu wrote:
> When bootwrapper is compiled with Xen support and it is started
> at EL2 on Armv8-R AArch64, keep the current EL and jump to the
> Xen image using the SPSR_KERNEL as spsr_el2 value.

What's the plan for booting Xen? i.e. is that using spin-table or PSCI?

I'm hesitant to expose PSCI booting to EL2 on ARMv8-R, because PSCI
doesn't really support ARMv8-R (the spec says nothing about it, and all
we're doing is providing the illusion of ARMv8-A to Linux), and Xen
would have to override the vectors anyway, so it doesn't really make
sense.

Given the latter part I'm assuming you only care about spin-table for
Xen, which is less concerning. I think we should make that more explicit
in the config options and forbid the combination of ARMv8-R + PSCI +
Xen.

Mark.

> 
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> ---
> v4 changes:
>  - no changes
> ---
>  Makefile.am         | 1 +
>  arch/aarch64/boot.S | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index aecda694fd6c..a8d5c1b96822 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -127,6 +127,7 @@ XEN_CHOSEN	:= xen,xen-bootargs = \"$(XEN_CMDLINE)\";		\
>  			compatible = \"xen,linux-zimage\", \"xen,multiboot-module\"; \
>  			reg = <0x0 $(DOM0_OFFSET) 0x0 $(KERNEL_SIZE)>;	\
>  		   };
> +DEFINES		+= -DXEN
>  endif
>  
>  if INITRD
> diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S
> index 565397823cb4..3fcc63bf2437 100644
> --- a/arch/aarch64/boot.S
> +++ b/arch/aarch64/boot.S
> @@ -100,7 +100,7 @@ ASM_FUNC(jump_kernel)
>  	mov	x1, x21
>  	mov	x2, x22
>  	mov	x3, x23
> -#if defined(BOOTWRAPPER_64R)
> +#if defined(BOOTWRAPPER_64R) && !defined(XEN)
>  	// On Armv8-R Linux needs to be booted at EL1
>  	mov	x4, #SPSR_KERNEL_EL1
>  #else
> -- 
> 2.34.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [boot-wrapper v4 4/4] aarch64: Start Xen on Armv8-R at EL2
  2024-11-26 11:58   ` [boot-wrapper v4 4/4] aarch64: Start Xen on Armv8-R at EL2 Mark Rutland
@ 2024-11-26 14:40     ` Luca Fancellu
  0 siblings, 0 replies; 3+ messages in thread
From: Luca Fancellu @ 2024-11-26 14:40 UTC (permalink / raw)
  To: Mark Rutland; +Cc: Andre Przywara, linux-arm-kernel@lists.infradead.org

Hi Mark,

> On 26 Nov 2024, at 11:58, Mark Rutland <mark.rutland@arm.com> wrote:
> 
> On Thu, Oct 17, 2024 at 10:55:20AM +0100, Luca Fancellu wrote:
>> When bootwrapper is compiled with Xen support and it is started
>> at EL2 on Armv8-R AArch64, keep the current EL and jump to the
>> Xen image using the SPSR_KERNEL as spsr_el2 value.
> 
> What's the plan for booting Xen? i.e. is that using spin-table or PSCI?
> 
> I'm hesitant to expose PSCI booting to EL2 on ARMv8-R, because PSCI
> doesn't really support ARMv8-R (the spec says nothing about it, and all
> we're doing is providing the illusion of ARMv8-A to Linux), and Xen
> would have to override the vectors anyway, so it doesn't really make
> sense.
> 
> Given the latter part I'm assuming you only care about spin-table for
> Xen, which is less concerning. I think we should make that more explicit
> in the config options and forbid the combination of ARMv8-R + PSCI +
> Xen.

Yes, I only care about spin-table at the moment, would this diff on top of this
patch be ok for you in order to enforce that?

diff --git a/configure.ac b/configure.ac
index a433c89bd2ae..a16bc25508f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,6 +115,11 @@ AS_IF([test "x$USE_PSCI" != "xyes" -a "x$KERNEL_ES" = "x32"],
        [AC_MSG_ERROR([With an AArch32 kernel, boot method must be PSCI.])]
 )
 
+# Don't allow PSCI + Xen + aarch64-r
+AS_IF([test "x$USE_PSCI" = "xyes" -a "x$USE_ARCH" = "xaarch64-r" -a "x$X_IMAGE" != "x"],
+       [AC_MSG_ERROR([With aarch64-r and Xen, PSCI must be disabled.])]
+)
+
 # Allow a user to pass --with-initrd
 AC_ARG_WITH([initrd],
        AS_HELP_STRING([--with-initrd], [embed an initrd in the kernel image]),

Cheers,
Luca

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-26 14:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20241017095520.939464-1-luca.fancellu@arm.com>
2024-11-26 11:54 ` [boot-wrapper v4 0/4] Add Armv8-R AArch64 support Mark Rutland
     [not found] ` <20241017095520.939464-5-luca.fancellu@arm.com>
2024-11-26 11:58   ` [boot-wrapper v4 4/4] aarch64: Start Xen on Armv8-R at EL2 Mark Rutland
2024-11-26 14:40     ` Luca Fancellu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox