linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] arm64: Add the arm64.no32bit_el0 command line option
@ 2024-02-07 10:58 Andrea della Porta
  2024-03-05 10:56 ` Andrea della Porta
  0 siblings, 1 reply; 3+ messages in thread
From: Andrea della Porta @ 2024-02-07 10:58 UTC (permalink / raw)
  To: Jonathan Corbet, Catalin Marinas, Will Deacon, linux-doc,
	linux-kernel, linux-arm-kernel
  Cc: Andrea della Porta

Introducing the field 'el0' to the idreg-override for register
ID_AA64PFR0_EL1. This field is also aliased to the new kernel
command line option 'arm64.no32bit_el0' as a more recognizable
and mnemonic name to disable the execution of 32 bit userspace
applications (i.e. avoid Aarch32 execution state in EL0) from
kernel command line.

Changes in V2:
- fixed the order of appearance of arm64.no32bit_el0 entry in
  kernel-parameters.txt documentation.

Link: https://lore.kernel.org/r/ZVTleETzfFUchs77@apocalypse
Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
---
 Documentation/admin-guide/kernel-parameters.txt | 3 +++
 arch/arm64/kernel/idreg-override.c              | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 65731b060e3f..fa7cdf2f4f3a 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -415,6 +415,9 @@
 	arcrimi=	[HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards
 			Format: <io>,<irq>,<nodeID>
 
+	arm64.no32bit_el0 [ARM64] Unconditionally disable the execution of
+			32 bit applications
+
 	arm64.nobti	[ARM64] Unconditionally disable Branch Target
 			Identification support
 
diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c
index e30fd9e32ef3..642cda19e42d 100644
--- a/arch/arm64/kernel/idreg-override.c
+++ b/arch/arm64/kernel/idreg-override.c
@@ -86,6 +86,7 @@ static const struct ftr_set_desc pfr0 __prel64_initconst = {
 	.override	= &id_aa64pfr0_override,
 	.fields		= {
 	        FIELD("sve", ID_AA64PFR0_EL1_SVE_SHIFT, pfr0_sve_filter),
+		FIELD("el0", ID_AA64PFR0_EL1_EL0_SHIFT, NULL),
 		{}
 	},
 };
@@ -197,6 +198,7 @@ static const struct {
 	{ "arm64.nomops",		"id_aa64isar2.mops=0" },
 	{ "arm64.nomte",		"id_aa64pfr1.mte=0" },
 	{ "nokaslr",			"arm64_sw.nokaslr=1" },
+	{ "arm64.no32bit_el0",		"id_aa64pfr0.el0=1" },
 };
 
 static int __init parse_hexdigit(const char *p, u64 *v)
-- 
2.41.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] arm64: Add the arm64.no32bit_el0 command line option
  2024-02-07 10:58 [PATCH v2] arm64: Add the arm64.no32bit_el0 command line option Andrea della Porta
@ 2024-03-05 10:56 ` Andrea della Porta
  2024-04-12 13:59   ` Will Deacon
  0 siblings, 1 reply; 3+ messages in thread
From: Andrea della Porta @ 2024-03-05 10:56 UTC (permalink / raw)
  To: Andrea della Porta
  Cc: Jonathan Corbet, Catalin Marinas, Will Deacon, linux-doc,
	linux-kernel, linux-arm-kernel

On 11:58 Wed 07 Feb     , Andrea della Porta wrote:
> Introducing the field 'el0' to the idreg-override for register
> ID_AA64PFR0_EL1. This field is also aliased to the new kernel
> command line option 'arm64.no32bit_el0' as a more recognizable
> and mnemonic name to disable the execution of 32 bit userspace
> applications (i.e. avoid Aarch32 execution state in EL0) from
> kernel command line.
> 
> Changes in V2:
> - fixed the order of appearance of arm64.no32bit_el0 entry in
>   kernel-parameters.txt documentation.
> 
> Link: https://lore.kernel.org/r/ZVTleETzfFUchs77@apocalypse
> Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
> ---
>  Documentation/admin-guide/kernel-parameters.txt | 3 +++
>  arch/arm64/kernel/idreg-override.c              | 2 ++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 65731b060e3f..fa7cdf2f4f3a 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -415,6 +415,9 @@
>  	arcrimi=	[HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards
>  			Format: <io>,<irq>,<nodeID>
>  
> +	arm64.no32bit_el0 [ARM64] Unconditionally disable the execution of
> +			32 bit applications
> +
>  	arm64.nobti	[ARM64] Unconditionally disable Branch Target
>  			Identification support
>  
> diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c
> index e30fd9e32ef3..642cda19e42d 100644
> --- a/arch/arm64/kernel/idreg-override.c
> +++ b/arch/arm64/kernel/idreg-override.c
> @@ -86,6 +86,7 @@ static const struct ftr_set_desc pfr0 __prel64_initconst = {
>  	.override	= &id_aa64pfr0_override,
>  	.fields		= {
>  	        FIELD("sve", ID_AA64PFR0_EL1_SVE_SHIFT, pfr0_sve_filter),
> +		FIELD("el0", ID_AA64PFR0_EL1_EL0_SHIFT, NULL),
>  		{}
>  	},
>  };
> @@ -197,6 +198,7 @@ static const struct {
>  	{ "arm64.nomops",		"id_aa64isar2.mops=0" },
>  	{ "arm64.nomte",		"id_aa64pfr1.mte=0" },
>  	{ "nokaslr",			"arm64_sw.nokaslr=1" },
> +	{ "arm64.no32bit_el0",		"id_aa64pfr0.el0=1" },
>  };
>  
>  static int __init parse_hexdigit(const char *p, u64 *v)
> -- 
> 2.41.0
> 

A gentle ping about this patch... any thoughts about it?

Many thanks,
Andrea

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] arm64: Add the arm64.no32bit_el0 command line option
  2024-03-05 10:56 ` Andrea della Porta
@ 2024-04-12 13:59   ` Will Deacon
  0 siblings, 0 replies; 3+ messages in thread
From: Will Deacon @ 2024-04-12 13:59 UTC (permalink / raw)
  To: Andrea della Porta, Jonathan Corbet, Catalin Marinas, linux-doc,
	linux-kernel, linux-arm-kernel

On Tue, Mar 05, 2024 at 11:56:05AM +0100, Andrea della Porta wrote:
> On 11:58 Wed 07 Feb     , Andrea della Porta wrote:
> > Introducing the field 'el0' to the idreg-override for register
> > ID_AA64PFR0_EL1. This field is also aliased to the new kernel
> > command line option 'arm64.no32bit_el0' as a more recognizable
> > and mnemonic name to disable the execution of 32 bit userspace
> > applications (i.e. avoid Aarch32 execution state in EL0) from
> > kernel command line.
> > 
> > Changes in V2:
> > - fixed the order of appearance of arm64.no32bit_el0 entry in
> >   kernel-parameters.txt documentation.
> > 
> > Link: https://lore.kernel.org/r/ZVTleETzfFUchs77@apocalypse
> > Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
> > ---
> >  Documentation/admin-guide/kernel-parameters.txt | 3 +++
> >  arch/arm64/kernel/idreg-override.c              | 2 ++
> >  2 files changed, 5 insertions(+)
> > 
> > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> > index 65731b060e3f..fa7cdf2f4f3a 100644
> > --- a/Documentation/admin-guide/kernel-parameters.txt
> > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > @@ -415,6 +415,9 @@
> >  	arcrimi=	[HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards
> >  			Format: <io>,<irq>,<nodeID>
> >  
> > +	arm64.no32bit_el0 [ARM64] Unconditionally disable the execution of
> > +			32 bit applications
> > +
> >  	arm64.nobti	[ARM64] Unconditionally disable Branch Target
> >  			Identification support
> >  
> > diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c
> > index e30fd9e32ef3..642cda19e42d 100644
> > --- a/arch/arm64/kernel/idreg-override.c
> > +++ b/arch/arm64/kernel/idreg-override.c
> > @@ -86,6 +86,7 @@ static const struct ftr_set_desc pfr0 __prel64_initconst = {
> >  	.override	= &id_aa64pfr0_override,
> >  	.fields		= {
> >  	        FIELD("sve", ID_AA64PFR0_EL1_SVE_SHIFT, pfr0_sve_filter),
> > +		FIELD("el0", ID_AA64PFR0_EL1_EL0_SHIFT, NULL),
> >  		{}
> >  	},
> >  };
> > @@ -197,6 +198,7 @@ static const struct {
> >  	{ "arm64.nomops",		"id_aa64isar2.mops=0" },
> >  	{ "arm64.nomte",		"id_aa64pfr1.mte=0" },
> >  	{ "nokaslr",			"arm64_sw.nokaslr=1" },
> > +	{ "arm64.no32bit_el0",		"id_aa64pfr0.el0=1" },
> >  };
> >  
> >  static int __init parse_hexdigit(const char *p, u64 *v)
> > -- 
> > 2.41.0
> > 
> 
> A gentle ping about this patch... any thoughts about it?

It looks reasonable to me, but arch/arm64/kernel/idreg-override.c no
longer exists upstream, so you need to rebase.

Thanks,

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-04-12 14:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 10:58 [PATCH v2] arm64: Add the arm64.no32bit_el0 command line option Andrea della Porta
2024-03-05 10:56 ` Andrea della Porta
2024-04-12 13:59   ` Will Deacon

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).