[PATCH 2/6] arm64/Kconfig: add LSUI Kconfig

Yeoreum Yun posted 6 patches 4 months ago
There is a newer version of this series
[PATCH 2/6] arm64/Kconfig: add LSUI Kconfig
Posted by Yeoreum Yun 4 months 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 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 55fc331af337..20f360eef2ac 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2237,6 +2237,13 @@ config ARM64_GCS
 
 endmenu # "v9.4 architectural features"
 
+menu "v9.6 architectural features"
+
+config AS_HAS_LSUI
+	def_bool $(as-instr,.arch_extension lsui)
+
+endmenu # "v9.6 architectural features"
+
 config ARM64_SVE
 	bool "ARM Scalable Vector Extension support"
 	default y
@@ -2498,4 +2505,3 @@ endmenu # "CPU Power Management"
 source "drivers/acpi/Kconfig"
 
 source "arch/arm64/kvm/Kconfig"
-
-- 
LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}
Re: [PATCH 2/6] arm64/Kconfig: add LSUI Kconfig
Posted by Marc Zyngier 4 months ago
On Wed, 11 Jun 2025 11:49:12 +0100,
Yeoreum Yun <yeoreum.yun@arm.com> 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
> indiviual `.arch_extension` entries.
> 
> Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
> ---
>  arch/arm64/Kconfig | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 55fc331af337..20f360eef2ac 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -2237,6 +2237,13 @@ config ARM64_GCS
>  
>  endmenu # "v9.4 architectural features"
>  
> +menu "v9.6 architectural features"
> +
> +config AS_HAS_LSUI
> +	def_bool $(as-instr,.arch_extension lsui)
> +
> +endmenu # "v9.6 architectural features"
> +
>  config ARM64_SVE
>  	bool "ARM Scalable Vector Extension support"
>  	default y
> @@ -2498,4 +2505,3 @@ endmenu # "CPU Power Management"
>  source "drivers/acpi/Kconfig"
>  
>  source "arch/arm64/kvm/Kconfig"
> -

Can you please document what toolchain versions have support for this?

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.
Re: [PATCH 2/6] arm64/Kconfig: add LSUI Kconfig
Posted by Yeoreum Yun 4 months ago
Hi Marc,

> On Wed, 11 Jun 2025 11:49:12 +0100,
> Yeoreum Yun <yeoreum.yun@arm.com> 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
> > indiviual `.arch_extension` entries.
> >
> > Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
> > ---
> >  arch/arm64/Kconfig | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index 55fc331af337..20f360eef2ac 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -2237,6 +2237,13 @@ config ARM64_GCS
> >
> >  endmenu # "v9.4 architectural features"
> >
> > +menu "v9.6 architectural features"
> > +
> > +config AS_HAS_LSUI
> > +	def_bool $(as-instr,.arch_extension lsui)
> > +
> > +endmenu # "v9.6 architectural features"
> > +
> >  config ARM64_SVE
> >  	bool "ARM Scalable Vector Extension support"
> >  	default y
> > @@ -2498,4 +2505,3 @@ endmenu # "CPU Power Management"
> >  source "drivers/acpi/Kconfig"
> >
> >  source "arch/arm64/kvm/Kconfig"
> > -
>
> Can you please document what toolchain versions have support for this?
>
> Thanks,

Okay. But here with comment or Is any other suggested place for this?

Thanks.

--
Sincerely,
Yeoreum Yun
Re: [PATCH 2/6] arm64/Kconfig: add LSUI Kconfig
Posted by Marc Zyngier 4 months ago
On Wed, 11 Jun 2025 18:54:50 +0100,
Yeoreum Yun <yeoreum.yun@arm.com> wrote:
> 
> Hi Marc,
> 
> > On Wed, 11 Jun 2025 11:49:12 +0100,
> > Yeoreum Yun <yeoreum.yun@arm.com> 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
> > > indiviual `.arch_extension` entries.
> > >
> > > Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
> > > ---
> > >  arch/arm64/Kconfig | 8 +++++++-
> > >  1 file changed, 7 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > > index 55fc331af337..20f360eef2ac 100644
> > > --- a/arch/arm64/Kconfig
> > > +++ b/arch/arm64/Kconfig
> > > @@ -2237,6 +2237,13 @@ config ARM64_GCS
> > >
> > >  endmenu # "v9.4 architectural features"
> > >
> > > +menu "v9.6 architectural features"
> > > +
> > > +config AS_HAS_LSUI
> > > +	def_bool $(as-instr,.arch_extension lsui)
> > > +
> > > +endmenu # "v9.6 architectural features"
> > > +
> > >  config ARM64_SVE
> > >  	bool "ARM Scalable Vector Extension support"
> > >  	default y
> > > @@ -2498,4 +2505,3 @@ endmenu # "CPU Power Management"
> > >  source "drivers/acpi/Kconfig"
> > >
> > >  source "arch/arm64/kvm/Kconfig"
> > > -
> >
> > Can you please document what toolchain versions have support for this?
> >
> > Thanks,
> 
> Okay. But here with comment or Is any other suggested place for
> this?

The help section in the Kconfig option you are introducing would be a
good start.

Thanks,

	M.

-- 
Jazz isn't dead. It just smells funny.
Re: [PATCH 2/6] arm64/Kconfig: add LSUI Kconfig
Posted by Mark Brown 4 months ago
On Wed, Jun 11, 2025 at 11:49:12AM +0100, Yeoreum Yun wrote:

> +menu "v9.6 architectural features"
> +
> +config AS_HAS_LSUI
> +	def_bool $(as-instr,.arch_extension lsui)
> +
> +endmenu # "v9.6 architectural features"
> +

This is adding a menu with no user selectable options, does that not
result in a confusing user experience?  We do often add toolchain
feature checks inside the menus but that's usually associated with
hiding a user selectable option, if there isn't one (or any other option
for that arch version yet) we should probably put the check elsewhere.
Re: [PATCH 2/6] arm64/Kconfig: add LSUI Kconfig
Posted by Yeoreum Yun 4 months ago
Hi Mark,

> On Wed, Jun 11, 2025 at 11:49:12AM +0100, Yeoreum Yun wrote:
>
> > +menu "v9.6 architectural features"
> > +
> > +config AS_HAS_LSUI
> > +	def_bool $(as-instr,.arch_extension lsui)
> > +
> > +endmenu # "v9.6 architectural features"
> > +
>
> This is adding a menu with no user selectable options, does that not
> result in a confusing user experience?We do often add toolchain
> feature checks inside the menus but that's usually associated with
> hiding a user selectable option, if there isn't one (or any other option
> for that arch version yet) we should probably put the check elsewhere.

Well even the v9.4 menu can be printed a menu with no user selcatable
optoins when UPROBE is enabled (ARM64_GCS depend on !UPROBE).
But without any selectable options adding the menu seems weird as you said.

Like AS_HAS_MOPS, let me define AS_HAS_LSUI without menu.
I'll remove the menu entry.

Thanks.

--
Sincerely,
Yeoreum Yun