[PATCH v2 5/6] aarch64: Support PSCI for Armv8-R AArch64

Mark Rutland mark.rutland at arm.com
Tue Jul 30 05:55:47 PDT 2024


On Tue, Jul 30, 2024 at 12:31:14PM +0100, Luca Fancellu wrote:
> Hi Mark,
> 
> >> -
> >> -AS_IF([test "x$USE_PSCI" != "xyes" -a "x$KERNEL_ES" = "x32"],
> >> + [case "${enableval}" in
> >> + yes|smc) USE_PSCI=smc ;;
> >> + hvc) USE_PSCI=hvc ;;
> >> + no) ;;
> >> + *) AC_MSG_ERROR([Bad value "${enableval}" for --enable-psci. Use "smc" or "hvc"]) ;;
> >> + esac])
> >> +AM_CONDITIONAL([PSCI], [test "x$USE_PSCI" = "xyes" -o "x$USE_PSCI" = "xsmc" -o "x$USE_PSCI" = "xhvc"])
> >> +AM_CONDITIONAL([PSCI_HVC], [test "x$USE_PSCI" = "xhvc"])
> >> +
> >> +AS_IF([test "x$USE_PSCI" = "xno" -a "x$KERNEL_ES" = "x32"],
> >> [AC_MSG_ERROR([With an AArch32 kernel, boot method must be PSCI.])]
> >> )
> >> +AC_SUBST([PSCI_METHOD], [$USE_PSCI])
> >
> > As of this patch, if I build with --enable-psci=hvc, and boot on
> > ARMv8-A, it'll fail at boot time, since the boot-wrapper won't fix up
> > the SPSR (and will enter the kernel at EL2), and HVC will go to that
> > kernel.
> >
> > I think that we either need to add support for dropping to EL1 in
> > ARMv8-A, or we should have an option to build for ARMv8-R specifically,
> > where we can automatically fix up the PSCI conduit.
> 
> True, maybe the best option is to have a flag to build for armv8r?

I think so.

> Would --armv8r64 be ok?
> 
> The behaviour would be:
>  --armv8r64 without XEN -> starting at EL2 only, setting conduit to hvc, psci_vector to VBAR_EL2, drop to EL1 and start kernel
>  --armv8r64 with XEN -> starting at EL2 only, psci not supported, keep xen at EL2

That sounds good. If you can sort out the logic for that, we can change
the option name later if we want.

That will have to interact with --enable-aarch32-bw and
--enable-aarch32-kernel, so maybe it's worth having a single option to
select the boot-wrapper architecture, e.g. --bw-arch=${PARAM} that
takes:

* "aarch64-a"	// default today
* "aarch32-a"	// replaces --aarch32-bw
* "aarch64-r"	// For armv8r64

Note I've used "aarch64" since we already have ARMv9-A bits.

Mark.

> 
> Cheers,
> Luca
> 



More information about the linux-arm-kernel mailing list