From: Qi Feng <qi.feng@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: mark.rutland@arm.com, andre.przywara@arm.com, wei.chen@arm.com,
jaxson.han@arm.com, nd <nd@arm.com>
Subject: Re: [boot-wrapper PATCH] Allow --enable-psci to choose between smc and hvc
Date: Mon, 12 Jul 2021 18:11:46 +0800 [thread overview]
Message-ID: <c56bbb46-7dfb-ee07-70db-de0f2eb27996@arm.com> (raw)
In-Reply-To: <20210618032245.194448-1-qi.feng@arm.com>
Any comments for this patch?
On 6/18/21 11:22 AM, Qi Feng wrote:
> According to Armv8-R AArch64 manual [1], Armv8-R AArch64 does not
> support smc:
>
> - Pseudocode for AArch64.CheckForSMCUndefOrTrap has this snippet:
>
> if !HaveEL(EL3) || PSTATE.EL == EL0 then
> UNDEFINED;
>
> And Armv8-R AArch64 does not have EL3.
>
> - In the document of HCR_EL2 TSC bit:
> If EL3 is not implemented and HCR_EL2.NV is 0, it is IMPLEMENTATION
> DEFINED whether this bit is:
> - RES0.
> - Implemented with the functionality as described in HCR_EL2.TSC.
>
> So hvc is needed in this situation. And due to the lack of libfdt, the
> psci method cannot be modified at runtime.
>
> To use smc, use --enable-psci or --enable-psci=smc.
> To use hvc, use --enable-psci=hvc.
>
> [1]: https://developer.arm.com/documentation/ddi0600/latest/
>
> Signed-off-by: Qi Feng <qi.feng@arm.com>
> ---
> Makefile.am | 2 +-
> configure.ac | 14 +++++++++-----
> 2 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index ef6b793..a9ddd16 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -47,7 +47,7 @@ BOOTMETHOD := psci.o
> OFILES += psci.o
> PSCI_NODE := psci { \
> compatible = \"arm,psci\"; \
> - method = \"smc\"; \
> + method = \"$(PSCI_METHOD)\"; \
> cpu_on = <$(PSCI_CPU_ON)>; \
> cpu_off = <$(PSCI_CPU_OFF)>; \
> };
> diff --git a/configure.ac b/configure.ac
> index 6914eb4..9aab4a1 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -83,13 +83,17 @@ AS_IF([test "x$X_IMAGE" != "x"],
> # Allow a user to pass --enable-psci
> AC_ARG_ENABLE([psci],
> AS_HELP_STRING([--enable-psci], [enable the psci boot method]),
> - [USE_PSCI=$enableval])
> -AM_CONDITIONAL([PSCI], [test "x$USE_PSCI" = "xyes"])
> -AS_IF([test "x$USE_PSCI" = "xyes"], [], [USE_PSCI=no])
> -
> -AS_IF([test "x$USE_PSCI" != "xyes" -a "x$KERNEL_ES" = "x32"],
> + [case "${enableval}" in
> + yes|smc) USE_PSCI=smc ;;
> + hvc) USE_PSCI=hvc ;;
> + *) 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"])
> +
> +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])
>
> # Allow a user to pass --with-initrd
> AC_ARG_WITH([initrd],
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2021-07-12 10:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-18 3:22 [boot-wrapper PATCH] Allow --enable-psci to choose between smc and hvc Qi Feng
2021-07-12 10:11 ` Qi Feng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c56bbb46-7dfb-ee07-70db-de0f2eb27996@arm.com \
--to=qi.feng@arm.com \
--cc=andre.przywara@arm.com \
--cc=jaxson.han@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=nd@arm.com \
--cc=wei.chen@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).