[PATCH v4 3/7] arm64/Kconfig: add LSUI Kconfig

Yeoreum Yun posted 7 patches 2 months, 2 weeks ago
There is a newer version of this series
[PATCH v4 3/7] arm64/Kconfig: add LSUI Kconfig
Posted by Yeoreum Yun 2 months, 2 weeks ago
Since Armv9.6, FEAT_LSUI supplies the load/store instructions for
previleged level to access to access user memory without clearing
PSTATE.PAN bit.
It's enough to add CONFIG_AS_HAS_LSUI only because the code for LUSI uses
indiviual `.arch_extension` entries.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
---
 arch/arm64/Kconfig | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 393d71124f5d..c0beb44ed5b8 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2238,6 +2238,15 @@ config ARM64_GCS
 
 endmenu # "v9.4 architectural features"
 
+config AS_HAS_LSUI
+	def_bool $(as-instr,.arch_extension lsui)
+	help
+	 Unprivileged Load Store is an extension to introduce unprivileged
+	 variants of load and store instructions so that clearing PSTATE.PAN
+	 is never required in privileged mode.
+	 This feature is available with clang version 20 and later and not yet
+	 supported by gcc.
+
 config ARM64_SVE
 	bool "ARM Scalable Vector Extension support"
 	default y
-- 
LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}
Re: [PATCH v4 3/7] arm64/Kconfig: add LSUI Kconfig
Posted by Mark Rutland 2 months, 2 weeks ago
On Mon, Jul 21, 2025 at 09:36:14AM +0100, Yeoreum Yun wrote:
> Since Armv9.6, FEAT_LSUI supplies the load/store instructions for
> previleged level to access to access user memory without clearing
> PSTATE.PAN bit.
> It's enough to add CONFIG_AS_HAS_LSUI only because the code for LUSI uses

Nit: s/LUSI/LSUI/

> indiviual `.arch_extension` entries.

Nit: s/indiviual/individual/

> 
> Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
> ---
>  arch/arm64/Kconfig | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 393d71124f5d..c0beb44ed5b8 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -2238,6 +2238,15 @@ config ARM64_GCS
>  
>  endmenu # "v9.4 architectural features"
>  
> +config AS_HAS_LSUI
> +	def_bool $(as-instr,.arch_extension lsui)
> +	help
> +	 Unprivileged Load Store is an extension to introduce unprivileged
> +	 variants of load and store instructions so that clearing PSTATE.PAN
> +	 is never required in privileged mode.
> +	 This feature is available with clang version 20 and later and not yet
> +	 supported by gcc.

I don't think we need to describe the feature in detail for the AS_HAS_*
config symbol; I think all we need to say is:

	Supported by LLVM 20 and later, not yet supported by GNU AS.

Otherwise this looks fine.

Mark.

> +
>  config ARM64_SVE
>  	bool "ARM Scalable Vector Extension support"
>  	default y
> -- 
> LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}
> 
>
Re: [PATCH v4 3/7] arm64/Kconfig: add LSUI Kconfig
Posted by Yeoreum Yun 2 months, 2 weeks ago
Hi Mark,

> On Mon, Jul 21, 2025 at 09:36:14AM +0100, Yeoreum Yun wrote:
> > Since Armv9.6, FEAT_LSUI supplies the load/store instructions for
> > previleged level to access to access user memory without clearing
> > PSTATE.PAN bit.
> > It's enough to add CONFIG_AS_HAS_LSUI only because the code for LUSI uses
>
> Nit: s/LUSI/LSUI/
>
> > indiviual `.arch_extension` entries.
>
> Nit: s/indiviual/individual/

Sorry. I'll change it...


> > Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
> > ---
> >  arch/arm64/Kconfig | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index 393d71124f5d..c0beb44ed5b8 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -2238,6 +2238,15 @@ config ARM64_GCS
> >
> >  endmenu # "v9.4 architectural features"
> >
> > +config AS_HAS_LSUI
> > +	def_bool $(as-instr,.arch_extension lsui)
> > +	help
> > +	 Unprivileged Load Store is an extension to introduce unprivileged
> > +	 variants of load and store instructions so that clearing PSTATE.PAN
> > +	 is never required in privileged mode.
> > +	 This feature is available with clang version 20 and later and not yet
> > +	 supported by gcc.
>
> I don't think we need to describe the feature in detail for the AS_HAS_*
> config symbol; I think all we need to say is:
>
> 	Supported by LLVM 20 and later, not yet supported by GNU AS.
>

Okay. I'll change it.

> Otherwise this looks fine.

Thanks!

[...]

--
Sincerely,
Yeoreum Yun