linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64
@ 2024-05-30  1:53 Liu Wei
  2024-05-30 13:06 ` Prarit Bhargava
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Liu Wei @ 2024-05-30  1:53 UTC (permalink / raw)
  To: catalin.marinas, will
  Cc: prarit, linux-arm-kernel, linux-kernel, liuwei09.cestc.cn,
	Liu Wei

Consistency with x86 and loongarch, don't enable ACPI SPCR console
by default on arm64

Signed-off-by: Liu Wei <liuwei09@cestc.cn>
---
 arch/arm64/kernel/acpi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index dba8fcec7f33..1deda3e5a0d2 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -227,7 +227,8 @@ void __init acpi_boot_table_init(void)
 		if (earlycon_acpi_spcr_enable)
 			early_init_dt_scan_chosen_stdout();
 	} else {
-		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
+		/* Do not enable ACPI SPCR console by default */
+		acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
 		if (IS_ENABLED(CONFIG_ACPI_BGRT))
 			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
 	}
-- 
2.42.1




_______________________________________________
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] 21+ messages in thread

* Re: [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64
  2024-05-30  1:53 [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64 Liu Wei
@ 2024-05-30 13:06 ` Prarit Bhargava
  2024-06-18 15:29   ` Will Deacon
  2024-05-31  1:52 ` Liu Wei
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Prarit Bhargava @ 2024-05-30 13:06 UTC (permalink / raw)
  To: Liu Wei, catalin.marinas, will
  Cc: linux-arm-kernel, linux-kernel, liuwei09.cestc.cn

On 5/29/24 21:53, Liu Wei wrote:
> Consistency with x86 and loongarch, don't enable ACPI SPCR console
> by default on arm64
> 
> Signed-off-by: Liu Wei <liuwei09@cestc.cn>
> ---
>   arch/arm64/kernel/acpi.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index dba8fcec7f33..1deda3e5a0d2 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -227,7 +227,8 @@ void __init acpi_boot_table_init(void)
>   		if (earlycon_acpi_spcr_enable)
>   			early_init_dt_scan_chosen_stdout();
>   	} else {
> -		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
> +		/* Do not enable ACPI SPCR console by default */
> +		acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
>   		if (IS_ENABLED(CONFIG_ACPI_BGRT))
>   			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
>   	}

It's been a while, and the status of arm hardware may have changed. 
IIRC the choice to force enable this is that most arm hardware is 
headless and this was a _required_ option for booting.

I'm not sure if that's still the case as it's been a long time.

Can anyone from the ARM community provide an approval here?

P.


_______________________________________________
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] 21+ messages in thread

* Re: [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64
  2024-05-30  1:53 [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64 Liu Wei
  2024-05-30 13:06 ` Prarit Bhargava
@ 2024-05-31  1:52 ` Liu Wei
  2024-06-21  4:47 ` [PATCH v2] ACPI: Add config to disable " Liu Wei
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 21+ messages in thread
From: Liu Wei @ 2024-05-31  1:52 UTC (permalink / raw)
  To: prarit, Liu Wei, catalin.marinas, will; +Cc: linux-arm-kernel, linux-kernel

From: Prarit Bhargava <prarit@redhat.com>

On 5/29/24 21:53, Liu Wei wrote:
> > Consistency with x86 and loongarch, don't enable ACPI SPCR console
> > by default on arm64
> > 
> > Signed-off-by: Liu Wei <liuwei09@cestc.cn>
> > ---
> >   arch/arm64/kernel/acpi.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> > index dba8fcec7f33..1deda3e5a0d2 100644
> > --- a/arch/arm64/kernel/acpi.c
> > +++ b/arch/arm64/kernel/acpi.c
> > @@ -227,7 +227,8 @@ void __init acpi_boot_table_init(void)
> >   		if (earlycon_acpi_spcr_enable)
> >   			early_init_dt_scan_chosen_stdout();
> >   	} else {
> > -		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
> > +		/* Do not enable ACPI SPCR console by default */
> > +		acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
> >   		if (IS_ENABLED(CONFIG_ACPI_BGRT))
> >   			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
> >   	}
> 
> It's been a while, and the status of arm hardware may have changed. 
> IIRC the choice to force enable this is that most arm hardware is 
> headless and this was a _required_ option for booting.
> 
> I'm not sure if that's still the case as it's been a long time.
> 
> Can anyone from the ARM community provide an approval here?
> 
> P.

Though most ARM devices are headless, with the increasing number of ARM servers
or desktops, if the SPCR table from ACPI is still used as the default console 
on ARM, the console behavior on ARM architecture will differ from other 
architecture servers.

A similar effect can be achieved by adding console=tty0 in kernel cmdline, but 
I think it is important to ensure consistency among different architecture 
strategies as much as possible.

Thanks for your patient explanation.




_______________________________________________
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] 21+ messages in thread

* Re: [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64
  2024-05-30 13:06 ` Prarit Bhargava
@ 2024-06-18 15:29   ` Will Deacon
  2024-06-18 16:40     ` Sudeep Holla
  0 siblings, 1 reply; 21+ messages in thread
From: Will Deacon @ 2024-06-18 15:29 UTC (permalink / raw)
  To: Prarit Bhargava, sudeep.holla, lpieralisi, guohanjun
  Cc: Liu Wei, catalin.marinas, linux-arm-kernel, linux-kernel,
	liuwei09.cestc.cn, rafael

On Thu, May 30, 2024 at 09:06:17AM -0400, Prarit Bhargava wrote:
> On 5/29/24 21:53, Liu Wei wrote:
> > Consistency with x86 and loongarch, don't enable ACPI SPCR console
> > by default on arm64
> > 
> > Signed-off-by: Liu Wei <liuwei09@cestc.cn>
> > ---
> >   arch/arm64/kernel/acpi.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> > index dba8fcec7f33..1deda3e5a0d2 100644
> > --- a/arch/arm64/kernel/acpi.c
> > +++ b/arch/arm64/kernel/acpi.c
> > @@ -227,7 +227,8 @@ void __init acpi_boot_table_init(void)
> >   		if (earlycon_acpi_spcr_enable)
> >   			early_init_dt_scan_chosen_stdout();
> >   	} else {
> > -		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
> > +		/* Do not enable ACPI SPCR console by default */
> > +		acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
> >   		if (IS_ENABLED(CONFIG_ACPI_BGRT))
> >   			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
> >   	}
> 
> It's been a while, and the status of arm hardware may have changed. IIRC the
> choice to force enable this is that most arm hardware is headless and this
> was a _required_ option for booting.
> 
> I'm not sure if that's still the case as it's been a long time.
> 
> Can anyone from the ARM community provide an approval here?

I don't have a strong opinion either way, but adding the Arm ACPI folks
in case they care.

Having said that, if the only rationale for this patch is consistency
with other architectures, then I think I'd lean towards leaving the
behaviour as-is so we don't give users a nasty surprise on their next
kernel upgrade.

Will


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

* Re: [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64
  2024-06-18 15:29   ` Will Deacon
@ 2024-06-18 16:40     ` Sudeep Holla
  2024-06-20 12:04       ` Prarit Bhargava
  0 siblings, 1 reply; 21+ messages in thread
From: Sudeep Holla @ 2024-06-18 16:40 UTC (permalink / raw)
  To: Will Deacon
  Cc: Prarit Bhargava, lpieralisi, Sudeep Holla, guohanjun, Liu Wei,
	catalin.marinas, linux-arm-kernel, linux-kernel,
	liuwei09.cestc.cn, rafael

On Tue, Jun 18, 2024 at 04:29:24PM +0100, Will Deacon wrote:
> On Thu, May 30, 2024 at 09:06:17AM -0400, Prarit Bhargava wrote:
> > On 5/29/24 21:53, Liu Wei wrote:
> > > Consistency with x86 and loongarch, don't enable ACPI SPCR console
> > > by default on arm64
> > >
> > > Signed-off-by: Liu Wei <liuwei09@cestc.cn>
> > > ---
> > >   arch/arm64/kernel/acpi.c | 3 ++-
> > >   1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> > > index dba8fcec7f33..1deda3e5a0d2 100644
> > > --- a/arch/arm64/kernel/acpi.c
> > > +++ b/arch/arm64/kernel/acpi.c
> > > @@ -227,7 +227,8 @@ void __init acpi_boot_table_init(void)
> > >   		if (earlycon_acpi_spcr_enable)
> > >   			early_init_dt_scan_chosen_stdout();
> > >   	} else {
> > > -		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
> > > +		/* Do not enable ACPI SPCR console by default */
> > > +		acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
> > >   		if (IS_ENABLED(CONFIG_ACPI_BGRT))
> > >   			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
> > >   	}
> >
> > It's been a while, and the status of arm hardware may have changed. IIRC the
> > choice to force enable this is that most arm hardware is headless and this
> > was a _required_ option for booting.
> >
> > I'm not sure if that's still the case as it's been a long time.
> >
> > Can anyone from the ARM community provide an approval here?
>
> I don't have a strong opinion either way, but adding the Arm ACPI folks
> in case they care.
>
> Having said that, if the only rationale for this patch is consistency
> with other architectures, then I think I'd lean towards leaving the
> behaviour as-is so we don't give users a nasty surprise on their next
> kernel upgrade.
>

+1, I am concerned about breaking existing behaviour on the platforms
in the wild. Also many platforms running ACPI would have already used
console cmdline parameter if SPCR is not their choice for the console.
So I don't see the need to align with other arch default behaviour here,
we can revisit if someone shouts with a real reason as why cmdline option
is not viable.

--
Regards,
Sudeep


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

* Re: [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64
  2024-06-18 16:40     ` Sudeep Holla
@ 2024-06-20 12:04       ` Prarit Bhargava
  2024-06-21  4:37         ` Liu Wei
  0 siblings, 1 reply; 21+ messages in thread
From: Prarit Bhargava @ 2024-06-20 12:04 UTC (permalink / raw)
  To: Liu Wei, sudeep.holla, Will Deacon
  Cc: catalin.marinas, guohanjun, linux-arm-kernel, linux-kernel,
	lpieralisi, rafael

On 6/18/24 23:43, Liu Wei wrote:
> From: Sudeep Holla <sudeep.holla@arm.com>
> 
> On Tue, Jun 18, 2024 at 04:29:24PM +0100, Will Deacon wrote:
>>> On Thu, May 30, 2024 at 09:06:17AM -0400, Prarit Bhargava wrote:
>>>> On 5/29/24 21:53, Liu Wei wrote:
>>>>> Consistency with x86 and loongarch, don't enable ACPI SPCR console
>>>>> by default on arm64
>>>>>
>>>>> Signed-off-by: Liu Wei <liuwei09@cestc.cn>
>>>>> ---
>>>>>    arch/arm64/kernel/acpi.c | 3 ++-
>>>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
>>>>> index dba8fcec7f33..1deda3e5a0d2 100644
>>>>> --- a/arch/arm64/kernel/acpi.c
>>>>> +++ b/arch/arm64/kernel/acpi.c
>>>>> @@ -227,7 +227,8 @@ void __init acpi_boot_table_init(void)
>>>>>    		if (earlycon_acpi_spcr_enable)
>>>>>    			early_init_dt_scan_chosen_stdout();
>>>>>    	} else {
>>>>> -		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
>>>>> +		/* Do not enable ACPI SPCR console by default */
>>>>> +		acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
>>>>>    		if (IS_ENABLED(CONFIG_ACPI_BGRT))
>>>>>    			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
>>>>>    	}
>>>>
>>>> It's been a while, and the status of arm hardware may have changed. IIRC the
>>>> choice to force enable this is that most arm hardware is headless and this
>>>> was a _required_ option for booting.
>>>>
>>>> I'm not sure if that's still the case as it's been a long time.
>>>>
>>>> Can anyone from the ARM community provide an approval here?
>>>
>>> I don't have a strong opinion either way, but adding the Arm ACPI folks
>>> in case they care.
>>>
>>> Having said that, if the only rationale for this patch is consistency
>>> with other architectures, then I think I'd lean towards leaving the
>>> behaviour as-is so we don't give users a nasty surprise on their next
>>> kernel upgrade.
>>>
>>
>> +1, I am concerned about breaking existing behaviour on the platforms
>> in the wild. Also many platforms running ACPI would have already used
>> console cmdline parameter if SPCR is not their choice for the console.
>> So I don't see the need to align with other arch default behaviour here,
>> we can revisit if someone shouts with a real reason as why cmdline option
>> is not viable.
> 
> For varying privacy and security reasons, sometimes we would like to
> completely silence the serial console output, and only enable it through
> cmdline when needed.
> 

FWIW, I understand that concern but the feedback you're receiving is 
that there are many existing systems that depend on this behavior. 
Breaking users for your concerns is not a good idea.

Perhaps a solution is to add yet-another-config-option, or add a kernel 
parameter to disable the SPCR console on ARM?

Something like "acpi=nospcr"?

P.

> On ARM, it is difficult because SPCR is enabled by default.
> 
> Thanks for your patience,
> Liu Wei
> 
>>
>> --
>> Regards,
>> Sudeep
> 
> 
> 
> 



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

* Re: [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64
  2024-06-20 12:04       ` Prarit Bhargava
@ 2024-06-21  4:37         ` Liu Wei
  0 siblings, 0 replies; 21+ messages in thread
From: Liu Wei @ 2024-06-21  4:37 UTC (permalink / raw)
  To: prarit, Liu Wei, sudeep.holla, Will Deacon
  Cc: catalin.marinas, guohanjun, linux-arm-kernel, linux-kernel,
	lpieralisi, rafael

From: Prarit Bhargava <prarit@redhat.com>

> On 6/18/24 23:43, Liu Wei wrote:
> > From: Sudeep Holla <sudeep.holla@arm.com>
> > 
> > On Tue, Jun 18, 2024 at 04:29:24PM +0100, Will Deacon wrote:
> >>> On Thu, May 30, 2024 at 09:06:17AM -0400, Prarit Bhargava wrote:
> >>>> On 5/29/24 21:53, Liu Wei wrote:
> >>>>> Consistency with x86 and loongarch, don't enable ACPI SPCR console
> >>>>> by default on arm64
> >>>>>
> >>>>> Signed-off-by: Liu Wei <liuwei09@cestc.cn>
> >>>>> ---
> >>>>>    arch/arm64/kernel/acpi.c | 3 ++-
> >>>>>    1 file changed, 2 insertions(+), 1 deletion(-)
> >>>>>
> >>>>> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> >>>>> index dba8fcec7f33..1deda3e5a0d2 100644
> >>>>> --- a/arch/arm64/kernel/acpi.c
> >>>>> +++ b/arch/arm64/kernel/acpi.c
> >>>>> @@ -227,7 +227,8 @@ void __init acpi_boot_table_init(void)
> >>>>>    		if (earlycon_acpi_spcr_enable)
> >>>>>    			early_init_dt_scan_chosen_stdout();
> >>>>>    	} else {
> >>>>> -		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
> >>>>> +		/* Do not enable ACPI SPCR console by default */
> >>>>> +		acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
> >>>>>    		if (IS_ENABLED(CONFIG_ACPI_BGRT))
> >>>>>    			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
> >>>>>    	}
> >>>>
> >>>> It's been a while, and the status of arm hardware may have changed. IIRC the
> >>>> choice to force enable this is that most arm hardware is headless and this
> >>>> was a _required_ option for booting.
> >>>>
> >>>> I'm not sure if that's still the case as it's been a long time.
> >>>>
> >>>> Can anyone from the ARM community provide an approval here?
> >>>
> >>> I don't have a strong opinion either way, but adding the Arm ACPI folks
> >>> in case they care.
> >>>
> >>> Having said that, if the only rationale for this patch is consistency
> >>> with other architectures, then I think I'd lean towards leaving the
> >>> behaviour as-is so we don't give users a nasty surprise on their next
> >>> kernel upgrade.
> >>>
> >>
> >> +1, I am concerned about breaking existing behaviour on the platforms
> >> in the wild. Also many platforms running ACPI would have already used
> >> console cmdline parameter if SPCR is not their choice for the console.
> >> So I don't see the need to align with other arch default behaviour here,
> >> we can revisit if someone shouts with a real reason as why cmdline option
> >> is not viable.
> > 
> > For varying privacy and security reasons, sometimes we would like to
> > completely silence the serial console output, and only enable it through
> > cmdline when needed.
> > 
> 
> FWIW, I understand that concern but the feedback you're receiving is 
> that there are many existing systems that depend on this behavior. 
> Breaking users for your concerns is not a good idea.
> 
> Perhaps a solution is to add yet-another-config-option, or add a kernel 
> parameter to disable the SPCR console on ARM?
> 
> Something like "acpi=nospcr"?

Thank you for your suggestion, I will send the new version later.

Best wishes,
Liu wei
> 
> P.
> 
> > On ARM, it is difficult because SPCR is enabled by default.
> > 
> > Thanks for your patience,
> > Liu Wei
> > 
> >>
> >> --
> >> Regards,
> >> Sudeep
> > 




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

* [PATCH v2] ACPI: Add config to disable ACPI SPCR console by default on arm64
  2024-05-30  1:53 [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64 Liu Wei
  2024-05-30 13:06 ` Prarit Bhargava
  2024-05-31  1:52 ` Liu Wei
@ 2024-06-21  4:47 ` Liu Wei
  2024-06-21 11:26   ` Prarit Bhargava
  2024-06-22  9:35 ` [PATCH V3] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console " Liu Wei
  2024-06-25  3:05 ` [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64 Liu Wei
  4 siblings, 1 reply; 21+ messages in thread
From: Liu Wei @ 2024-06-21  4:47 UTC (permalink / raw)
  To: prarit
  Cc: catalin.marinas, guohanjun, linux-arm-kernel, linux-kernel,
	liuwei09, lpieralisi, rafael, sudeep.holla, will

For varying privacy and security reasons, sometimes we would like to
completely silence the serial console output, and only enable it through
cmdline when needed.

But there are many existing systems that depend on this console,
so add CONFIG_ARM_DISABLE_ACPI_SPCR_CONSOLE for this situation.

Signed-off-by: Liu Wei <liuwei09@cestc.cn>
Suggested-by: Prarit Bhargava <prarit@redhat.com>
---

v2: Add a config option suggested by Prarit
---
 arch/arm64/kernel/acpi.c   | 12 ++++++++++++
 drivers/acpi/arm64/Kconfig | 11 +++++++++++
 2 files changed, 23 insertions(+)

diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index dba8fcec7f33..3365fabb5cf8 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -227,7 +227,19 @@ void __init acpi_boot_table_init(void)
 		if (earlycon_acpi_spcr_enable)
 			early_init_dt_scan_chosen_stdout();
 	} else {
+		/*
+		 * For varying privacy and security reasons, sometimes need
+		 * to completely silence the serial console output, and only 
+		 * enable it by cmdline when needed.
+		 * But there are many existing systems that depend on this
+		 * behavior, so use CONFIG_ARM_DISABLE_ACPI_SPCR_CONSOLE.
+		 */
+#ifdef CONFIG_ARM_DISABLE_ACPI_SPCR_CONSOLE
+		acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
+#else
 		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
+#endif
+
 		if (IS_ENABLED(CONFIG_ACPI_BGRT))
 			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
 	}
diff --git a/drivers/acpi/arm64/Kconfig b/drivers/acpi/arm64/Kconfig
index b3ed6212244c..7e4d860d7089 100644
--- a/drivers/acpi/arm64/Kconfig
+++ b/drivers/acpi/arm64/Kconfig
@@ -21,3 +21,14 @@ config ACPI_AGDI
 
 config ACPI_APMT
 	bool
+
+config ARM_DISABLE_ACPI_SPCR_CONSOLE
+	bool "Disable ACPI SPCR Console by Default on Arm64"
+	depends on ARM64 && ACPI_SPCR_TABLE
+	default n
+	help
+		For varying privacy and security reasons, sometimes need to
+		completely silence the serial console output, and only enable
+		it by kernel cmdline when needed.
+
+		Say Y to disable ACPI SPCR console by default.
-- 
2.42.1





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

* Re: [PATCH v2] ACPI: Add config to disable ACPI SPCR console by default on arm64
  2024-06-21  4:47 ` [PATCH v2] ACPI: Add config to disable " Liu Wei
@ 2024-06-21 11:26   ` Prarit Bhargava
  2024-06-21 16:39     ` Liu Wei
  0 siblings, 1 reply; 21+ messages in thread
From: Prarit Bhargava @ 2024-06-21 11:26 UTC (permalink / raw)
  To: Liu Wei
  Cc: catalin.marinas, guohanjun, linux-arm-kernel, linux-kernel,
	lpieralisi, rafael, sudeep.holla, will

On 6/21/24 00:47, Liu Wei wrote:
> For varying privacy and security reasons, sometimes we would like to
> completely silence the serial console output, and only enable it through
> cmdline when needed.
> 
> But there are many existing systems that depend on this console,
> so add CONFIG_ARM_DISABLE_ACPI_SPCR_CONSOLE for this situation.
> 
> Signed-off-by: Liu Wei <liuwei09@cestc.cn>
> Suggested-by: Prarit Bhargava <prarit@redhat.com>
> ---
> 
> v2: Add a config option suggested by Prarit
> ---
>   arch/arm64/kernel/acpi.c   | 12 ++++++++++++
>   drivers/acpi/arm64/Kconfig | 11 +++++++++++
>   2 files changed, 23 insertions(+)
> 
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index dba8fcec7f33..3365fabb5cf8 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -227,7 +227,19 @@ void __init acpi_boot_table_init(void)
>   		if (earlycon_acpi_spcr_enable)
>   			early_init_dt_scan_chosen_stdout();
>   	} else {
> +		/*
> +		 * For varying privacy and security reasons, sometimes need
> +		 * to completely silence the serial console output, and only
> +		 * enable it by cmdline when needed.
> +		 * But there are many existing systems that depend on this
> +		 * behavior, so use CONFIG_ARM_DISABLE_ACPI_SPCR_CONSOLE.
> +		 */
> +#ifdef CONFIG_ARM_DISABLE_ACPI_SPCR_CONSOLE
> +		acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
> +#else
>   		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
> +#endif
> +

I don't think you want a config option here after all.  See my previous 
comment about "acpi=nospcr".  I realized that if you do use a config 
then distros will not have the ability to default 'on', and advise users 
to disable it for their use cases.

Try the 'acpi=nospcr' option.  That should keep everyone happy.

P.

>   		if (IS_ENABLED(CONFIG_ACPI_BGRT))
>   			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
>   	}
> diff --git a/drivers/acpi/arm64/Kconfig b/drivers/acpi/arm64/Kconfig
> index b3ed6212244c..7e4d860d7089 100644
> --- a/drivers/acpi/arm64/Kconfig
> +++ b/drivers/acpi/arm64/Kconfig
> @@ -21,3 +21,14 @@ config ACPI_AGDI
>   
>   config ACPI_APMT
>   	bool
> +
> +config ARM_DISABLE_ACPI_SPCR_CONSOLE
> +	bool "Disable ACPI SPCR Console by Default on Arm64"
> +	depends on ARM64 && ACPI_SPCR_TABLE
> +	default n
> +	help
> +		For varying privacy and security reasons, sometimes need to
> +		completely silence the serial console output, and only enable
> +		it by kernel cmdline when needed.
> +
> +		Say Y to disable ACPI SPCR console by default.



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

* Re: [PATCH v2] ACPI: Add config to disable ACPI SPCR console by default on arm64
  2024-06-21 11:26   ` Prarit Bhargava
@ 2024-06-21 16:39     ` Liu Wei
  0 siblings, 0 replies; 21+ messages in thread
From: Liu Wei @ 2024-06-21 16:39 UTC (permalink / raw)
  To: prarit, Liu Wei
  Cc: catalin.marinas, guohanjun, linux-arm-kernel, linux-kernel,
	lpieralisi, rafael, sudeep.holla, will

From: Prarit Bhargava <prarit@redhat.com>

On 6/21/24 00:47, Liu Wei wrote:
> > For varying privacy and security reasons, sometimes we would like to
> > completely silence the serial console output, and only enable it through
> > cmdline when needed.
> > 
> > But there are many existing systems that depend on this console,
> > so add CONFIG_ARM_DISABLE_ACPI_SPCR_CONSOLE for this situation.
> > 
> > Signed-off-by: Liu Wei <liuwei09@cestc.cn>
> > Suggested-by: Prarit Bhargava <prarit@redhat.com>
> > ---
> > 
> > v2: Add a config option suggested by Prarit
> > ---
> >   arch/arm64/kernel/acpi.c   | 12 ++++++++++++
> >   drivers/acpi/arm64/Kconfig | 11 +++++++++++
> >   2 files changed, 23 insertions(+)
> > 
> > diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> > index dba8fcec7f33..3365fabb5cf8 100644
> > --- a/arch/arm64/kernel/acpi.c
> > +++ b/arch/arm64/kernel/acpi.c
> > @@ -227,7 +227,19 @@ void __init acpi_boot_table_init(void)
> >   		if (earlycon_acpi_spcr_enable)
> >   			early_init_dt_scan_chosen_stdout();
> >   	} else {
> > +		/*
> > +		 * For varying privacy and security reasons, sometimes need
> > +		 * to completely silence the serial console output, and only
> > +		 * enable it by cmdline when needed.
> > +		 * But there are many existing systems that depend on this
> > +		 * behavior, so use CONFIG_ARM_DISABLE_ACPI_SPCR_CONSOLE.
> > +		 */
> > +#ifdef CONFIG_ARM_DISABLE_ACPI_SPCR_CONSOLE
> > +		acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
> > +#else
> >   		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
> > +#endif
> > +
> 
> I don't think you want a config option here after all.  See my previous 
> comment about "acpi=nospcr".  I realized that if you do use a config 
> then distros will not have the ability to default 'on', and advise users 
> to disable it for their use cases.
> 
> Try the 'acpi=nospcr' option.  That should keep everyone happy.
>

Ok, I will send new version soon.

Thanks for your suggestion!

Liu Wei
 
> P.
> 




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

* [PATCH V3] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on arm64
  2024-05-30  1:53 [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64 Liu Wei
                   ` (2 preceding siblings ...)
  2024-06-21  4:47 ` [PATCH v2] ACPI: Add config to disable " Liu Wei
@ 2024-06-22  9:35 ` Liu Wei
  2024-06-22 17:05   ` Andrew Lunn
  2024-06-25  3:05 ` [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64 Liu Wei
  4 siblings, 1 reply; 21+ messages in thread
From: Liu Wei @ 2024-06-22  9:35 UTC (permalink / raw)
  To: liuwei09, prarit; +Cc: catalin.marinas, linux-arm-kernel, linux-kernel, will

For varying privacy and security reasons, sometimes we would like to
completely silence the serial console, and only enable it when needed.

But there are many existing systems that depend on this console,
so add acpi=nospcr for this situation.

Signed-off-by: Liu Wei <liuwei09@cestc.cn>
Suggested-by: Prarit Bhargava <prarit@redhat.com>
---

v2: Add a config option suggested by Prarit

v3: Use cmdline acpi=nospcr instead of config
---
 Documentation/admin-guide/kernel-parameters.txt |  9 ++++++---
 arch/arm64/kernel/acpi.c                        | 17 ++++++++++++++++-
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 11e57ba2985c..4c331cfb28f5 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -12,7 +12,7 @@
 	acpi=		[HW,ACPI,X86,ARM64,RISCV64,EARLY]
 			Advanced Configuration and Power Interface
 			Format: { force | on | off | strict | noirq | rsdt |
-				  copy_dsdt }
+				  copy_dsdt | nospcr }
 			force -- enable ACPI if default was off
 			on -- enable ACPI but allow fallback to DT [arm64,riscv64]
 			off -- disable ACPI if default was on
@@ -21,8 +21,11 @@
 				strictly ACPI specification compliant.
 			rsdt -- prefer RSDT over (default) XSDT
 			copy_dsdt -- copy DSDT to memory
-			For ARM64 and RISCV64, ONLY "acpi=off", "acpi=on" or
-			"acpi=force" are available
+			nospcr -- disable ACPI SPCR as default console on ARM64
+			For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
+			"acpi=nospcr" are available
+			For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
+			are available
 
 			See also Documentation/power/runtime_pm.rst, pci=noacpi
 
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index e0e7b93c16cc..35cb12f3b9bd 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -45,6 +45,7 @@ EXPORT_SYMBOL(acpi_pci_disabled);
 static bool param_acpi_off __initdata;
 static bool param_acpi_on __initdata;
 static bool param_acpi_force __initdata;
+static bool param_acpi_nospcr __initdata;
 
 static int __init parse_acpi(char *arg)
 {
@@ -58,6 +59,8 @@ static int __init parse_acpi(char *arg)
 		param_acpi_on = true;
 	else if (strcmp(arg, "force") == 0) /* force ACPI to be enabled */
 		param_acpi_force = true;
+	else if (strcmp(arg, "nospcr") == 0) /* disable ACPI SPCR as default console */
+		param_acpi_nospcr = true;
 	else
 		return -EINVAL;	/* Core will print when we return error */
 
@@ -237,7 +240,19 @@ void __init acpi_boot_table_init(void)
 			acpi_put_table(facs);
 		}
 #endif
-		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
+
+		/*
+		 * For varying privacy and security reasons, sometimes need
+		 * to completely silence the serial console output, and only
+		 * enable it when needed.
+		 * But there are many existing systems that depend on this
+		 * behavior, use acpi=nospcr for this.
+		 */
+		acpi_parse_spcr(earlycon_acpi_spcr_enable,
+			!param_acpi_nospcr);
+		pr_info("Use ACPI SPCR as default console: %s\n",
+				param_acpi_nospcr ? "No" : "Yes");
+
 		if (IS_ENABLED(CONFIG_ACPI_BGRT))
 			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
 	}
-- 
2.42.1





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

* Re: [PATCH V3] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on arm64
  2024-06-22  9:35 ` [PATCH V3] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console " Liu Wei
@ 2024-06-22 17:05   ` Andrew Lunn
  2024-06-24  5:04     ` Liu Wei
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2024-06-22 17:05 UTC (permalink / raw)
  To: Liu Wei; +Cc: prarit, catalin.marinas, linux-arm-kernel, linux-kernel, will

On Sat, Jun 22, 2024 at 05:35:21PM +0800, Liu Wei wrote:
> For varying privacy and security reasons, sometimes we would like to
> completely silence the serial console, and only enable it when needed.
> 
> But there are many existing systems that depend on this console,
> so add acpi=nospcr for this situation.

Maybe it is just me, but i see nospcr and my brain expands it to "no
speaker". Adding to that, your commit message says "completely
silence"...

> +			nospcr -- disable ACPI SPCR as default console on ARM64
> +			For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
> +			"acpi=nospcr" are available
> +			For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
> +			are available

How about putting the word 'serial' in here somewhere, just to give
users an additional clue you are not talking about a speaker, CTRL-G
etc.

	Andrew


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

* Re: [PATCH V3] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on arm64
  2024-06-22 17:05   ` Andrew Lunn
@ 2024-06-24  5:04     ` Liu Wei
  2024-06-24 14:42       ` Will Deacon
  2024-06-24 15:10       ` Andrew Lunn
  0 siblings, 2 replies; 21+ messages in thread
From: Liu Wei @ 2024-06-24  5:04 UTC (permalink / raw)
  To: andrew, Liu Wei
  Cc: catalin.marinas, linux-arm-kernel, linux-kernel, prarit, will

From: Andrew Lunn <andrew@lunn.ch>

> On Sat, Jun 22, 2024 at 05:35:21PM +0800, Liu Wei wrote:
> > For varying privacy and security reasons, sometimes we would like to
> > completely silence the serial console, and only enable it when needed.
> > 
> > But there are many existing systems that depend on this console,
> > so add acpi=nospcr for this situation.
> 
> Maybe it is just me, but i see nospcr and my brain expands it to "no
> speaker". Adding to that, your commit message says "completely
> silence"...
> 
> > +			nospcr -- disable ACPI SPCR as default console on ARM64
> > +			For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
> > +			"acpi=nospcr" are available
> > +			For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
> > +			are available
> 
> How about putting the word 'serial' in here somewhere, just to give
> users an additional clue you are not talking about a speaker, CTRL-G
> etc.

Thank you for your suggestion. 

You mean acpi=nospcr_serial or acpi=no_spcrserial? However, it appears 
somewhat unconventional compared to the original acpi=* parameter.

How about introducing a new one, such as acpi_no_spcr_serial or 
acpi_no_spcr_console?

Best wishes,
Liu Wei

> 	Andrew 




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

* Re: [PATCH V3] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on arm64
  2024-06-24  5:04     ` Liu Wei
@ 2024-06-24 14:42       ` Will Deacon
  2024-06-24 15:10       ` Andrew Lunn
  1 sibling, 0 replies; 21+ messages in thread
From: Will Deacon @ 2024-06-24 14:42 UTC (permalink / raw)
  To: Liu Wei; +Cc: andrew, catalin.marinas, linux-arm-kernel, linux-kernel, prarit

On Mon, Jun 24, 2024 at 01:04:04PM +0800, Liu Wei wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> 
> > On Sat, Jun 22, 2024 at 05:35:21PM +0800, Liu Wei wrote:
> > > For varying privacy and security reasons, sometimes we would like to
> > > completely silence the serial console, and only enable it when needed.
> > > 
> > > But there are many existing systems that depend on this console,
> > > so add acpi=nospcr for this situation.
> > 
> > Maybe it is just me, but i see nospcr and my brain expands it to "no
> > speaker". Adding to that, your commit message says "completely
> > silence"...
> > 
> > > +			nospcr -- disable ACPI SPCR as default console on ARM64
> > > +			For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
> > > +			"acpi=nospcr" are available
> > > +			For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
> > > +			are available
> > 
> > How about putting the word 'serial' in here somewhere, just to give
> > users an additional clue you are not talking about a speaker, CTRL-G
> > etc.
> 
> Thank you for your suggestion. 
> 
> You mean acpi=nospcr_serial or acpi=no_spcrserial? However, it appears 
> somewhat unconventional compared to the original acpi=* parameter.
> 
> How about introducing a new one, such as acpi_no_spcr_serial or 
> acpi_no_spcr_console?

I think acpi=nospcr is fine like it is. Just expand the acronym in the
documentation so that it's obviously not talking about a speaker.

Will


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

* Re: [PATCH V3] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on arm64
  2024-06-24  5:04     ` Liu Wei
  2024-06-24 14:42       ` Will Deacon
@ 2024-06-24 15:10       ` Andrew Lunn
  2024-06-25  2:48         ` Liu Wei
  1 sibling, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2024-06-24 15:10 UTC (permalink / raw)
  To: Liu Wei; +Cc: catalin.marinas, linux-arm-kernel, linux-kernel, prarit, will

On Mon, Jun 24, 2024 at 01:04:04PM +0800, Liu Wei wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> 
> > On Sat, Jun 22, 2024 at 05:35:21PM +0800, Liu Wei wrote:
> > > For varying privacy and security reasons, sometimes we would like to
> > > completely silence the serial console, and only enable it when needed.
> > > 
> > > But there are many existing systems that depend on this console,
> > > so add acpi=nospcr for this situation.
> > 
> > Maybe it is just me, but i see nospcr and my brain expands it to "no
> > speaker". Adding to that, your commit message says "completely
> > silence"...
> > 
> > > +			nospcr -- disable ACPI SPCR as default console on ARM64
> > > +			For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
> > > +			"acpi=nospcr" are available
> > > +			For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
> > > +			are available
> > 
> > How about putting the word 'serial' in here somewhere, just to give
> > users an additional clue you are not talking about a speaker, CTRL-G
> > etc.
> 
> Thank you for your suggestion. 
> 
> You mean acpi=nospcr_serial or acpi=no_spcrserial? However, it appears 
> somewhat unconventional compared to the original acpi=* parameter.

How about:

nospcr -- disable ACPI SPCR as default _serial_ console on ARM64

Please as Will suggested, add a definition somewhere.

       Andrew


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

* Re: [PATCH V3] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on arm64
  2024-06-24 15:10       ` Andrew Lunn
@ 2024-06-25  2:48         ` Liu Wei
  0 siblings, 0 replies; 21+ messages in thread
From: Liu Wei @ 2024-06-25  2:48 UTC (permalink / raw)
  To: andrew, Liu Wei
  Cc: catalin.marinas, linux-arm-kernel, linux-kernel, prarit, will

From: Andrew Lunn <andrew@lunn.ch>

> On Mon, Jun 24, 2024 at 01:04:04PM +0800, Liu Wei wrote:
> > From: Andrew Lunn <andrew@lunn.ch>
> > 
> > > On Sat, Jun 22, 2024 at 05:35:21PM +0800, Liu Wei wrote:
> > > > For varying privacy and security reasons, sometimes we would like to
> > > > completely silence the serial console, and only enable it when needed.
> > > > 
> > > > But there are many existing systems that depend on this console,
> > > > so add acpi=nospcr for this situation.
> > > 
> > > Maybe it is just me, but i see nospcr and my brain expands it to "no
> > > speaker". Adding to that, your commit message says "completely
> > > silence"...
> > > 
> > > > +			nospcr -- disable ACPI SPCR as default console on ARM64
> > > > +			For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
> > > > +			"acpi=nospcr" are available
> > > > +			For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
> > > > +			are available
> > > 
> > > How about putting the word 'serial' in here somewhere, just to give
> > > users an additional clue you are not talking about a speaker, CTRL-G
> > > etc.
> > 
> > Thank you for your suggestion. 
> > 
> > You mean acpi=nospcr_serial or acpi=no_spcrserial? However, it appears 
> > somewhat unconventional compared to the original acpi=* parameter.
> 
> How about:
> 
> nospcr -- disable ACPI SPCR as default _serial_ console on ARM64
> 
> Please as Will suggested, add a definition somewhere.
>

Ok, I will send the v4 version later.

Thanks for all suggestion.

Liu Wei
 
>        Andrew




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

* [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64
  2024-05-30  1:53 [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64 Liu Wei
                   ` (3 preceding siblings ...)
  2024-06-22  9:35 ` [PATCH V3] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console " Liu Wei
@ 2024-06-25  3:05 ` Liu Wei
  2024-06-25 12:58   ` Prarit Bhargava
                     ` (2 more replies)
  4 siblings, 3 replies; 21+ messages in thread
From: Liu Wei @ 2024-06-25  3:05 UTC (permalink / raw)
  To: liuwei09, will
  Cc: catalin.marinas, linux-arm-kernel, linux-kernel, prarit,
	Andrew Lunn

For varying privacy and security reasons, sometimes we would like to
completely silence the _serial_ console, and only enable it when needed.

But there are many existing systems that depend on this _serial_ console,
so add acpi=nospcr to disable console in ACPI SPCR table as default
_serial_ console.

Signed-off-by: Liu Wei <liuwei09@cestc.cn>
Suggested-by: Prarit Bhargava <prarit@redhat.com>
Suggested-by: Will Deacon <will@kernel.org>
Suggested-by: Andrew Lunn <andrew@lunn.ch>
---

v2: Add a config option suggested by Prarit

v3: Use cmdline acpi=nospcr instead of config

v4: Some description in comment or document
---
 .../admin-guide/kernel-parameters.txt          | 10 +++++++---
 arch/arm64/kernel/acpi.c                       | 18 +++++++++++++++++-
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 11e57ba2985c..6814ff7ae446 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -12,7 +12,7 @@
 	acpi=		[HW,ACPI,X86,ARM64,RISCV64,EARLY]
 			Advanced Configuration and Power Interface
 			Format: { force | on | off | strict | noirq | rsdt |
-				  copy_dsdt }
+				  copy_dsdt | nospcr }
 			force -- enable ACPI if default was off
 			on -- enable ACPI but allow fallback to DT [arm64,riscv64]
 			off -- disable ACPI if default was on
@@ -21,8 +21,12 @@
 				strictly ACPI specification compliant.
 			rsdt -- prefer RSDT over (default) XSDT
 			copy_dsdt -- copy DSDT to memory
-			For ARM64 and RISCV64, ONLY "acpi=off", "acpi=on" or
-			"acpi=force" are available
+			nospcr -- disable console in ACPI SPCR table as
+				default _serial_ console on ARM64
+			For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
+			"acpi=nospcr" are available
+			For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
+			are available
 
 			See also Documentation/power/runtime_pm.rst, pci=noacpi
 
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index e0e7b93c16cc..55757d8884d4 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -45,6 +45,7 @@ EXPORT_SYMBOL(acpi_pci_disabled);
 static bool param_acpi_off __initdata;
 static bool param_acpi_on __initdata;
 static bool param_acpi_force __initdata;
+static bool param_acpi_nospcr __initdata;
 
 static int __init parse_acpi(char *arg)
 {
@@ -58,6 +59,8 @@ static int __init parse_acpi(char *arg)
 		param_acpi_on = true;
 	else if (strcmp(arg, "force") == 0) /* force ACPI to be enabled */
 		param_acpi_force = true;
+	else if (strcmp(arg, "nospcr") == 0) /* disable SPCR as default console */
+		param_acpi_nospcr = true;
 	else
 		return -EINVAL;	/* Core will print when we return error */
 
@@ -237,7 +240,20 @@ void __init acpi_boot_table_init(void)
 			acpi_put_table(facs);
 		}
 #endif
-		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
+
+		/*
+		 * For varying privacy and security reasons, sometimes need
+		 * to completely silence the serial console output, and only
+		 * enable it when needed.
+		 * But there are many existing systems that depend on this
+		 * behavior, use acpi=nospcr to disable console in ACPI SPCR
+		 * table as default serial console.
+		 */
+		acpi_parse_spcr(earlycon_acpi_spcr_enable,
+			!param_acpi_nospcr);
+		pr_info("Use ACPI SPCR as default console: %s\n",
+				param_acpi_nospcr ? "No" : "Yes");
+
 		if (IS_ENABLED(CONFIG_ACPI_BGRT))
 			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
 	}
-- 
2.42.1





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

* Re: [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64
  2024-06-25  3:05 ` [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64 Liu Wei
@ 2024-06-25 12:58   ` Prarit Bhargava
  2024-06-26  3:07     ` Liu Wei
  2024-06-26  7:54   ` Hanjun Guo
  2024-07-04 16:22   ` Catalin Marinas
  2 siblings, 1 reply; 21+ messages in thread
From: Prarit Bhargava @ 2024-06-25 12:58 UTC (permalink / raw)
  To: Liu Wei, will
  Cc: catalin.marinas, linux-arm-kernel, linux-kernel, Andrew Lunn

On 6/24/24 23:05, Liu Wei wrote:
> For varying privacy and security reasons, sometimes we would like to
> completely silence the _serial_ console, and only enable it when needed.
> 
> But there are many existing systems that depend on this _serial_ console,
> so add acpi=nospcr to disable console in ACPI SPCR table as default
> _serial_ console.
> 
> Signed-off-by: Liu Wei <liuwei09@cestc.cn>
> Suggested-by: Prarit Bhargava <prarit@redhat.com>
> Suggested-by: Will Deacon <will@kernel.org>
> Suggested-by: Andrew Lunn <andrew@lunn.ch>
> ---
> 
> v2: Add a config option suggested by Prarit
> 
> v3: Use cmdline acpi=nospcr instead of config
> 
> v4: Some description in comment or document
> ---
>   .../admin-guide/kernel-parameters.txt          | 10 +++++++---
>   arch/arm64/kernel/acpi.c                       | 18 +++++++++++++++++-
>   2 files changed, 24 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 11e57ba2985c..6814ff7ae446 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -12,7 +12,7 @@
>   	acpi=		[HW,ACPI,X86,ARM64,RISCV64,EARLY]
>   			Advanced Configuration and Power Interface
>   			Format: { force | on | off | strict | noirq | rsdt |
> -				  copy_dsdt }
> +				  copy_dsdt | nospcr }
>   			force -- enable ACPI if default was off
>   			on -- enable ACPI but allow fallback to DT [arm64,riscv64]
>   			off -- disable ACPI if default was on
> @@ -21,8 +21,12 @@
>   				strictly ACPI specification compliant.
>   			rsdt -- prefer RSDT over (default) XSDT
>   			copy_dsdt -- copy DSDT to memory
> -			For ARM64 and RISCV64, ONLY "acpi=off", "acpi=on" or
> -			"acpi=force" are available
> +			nospcr -- disable console in ACPI SPCR table as
> +				default _serial_ console on ARM64
> +			For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
> +			"acpi=nospcr" are available
> +			For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
> +			are available
>   
>   			See also Documentation/power/runtime_pm.rst, pci=noacpi
>   
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index e0e7b93c16cc..55757d8884d4 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -45,6 +45,7 @@ EXPORT_SYMBOL(acpi_pci_disabled);
>   static bool param_acpi_off __initdata;
>   static bool param_acpi_on __initdata;
>   static bool param_acpi_force __initdata;
> +static bool param_acpi_nospcr __initdata;
>   
>   static int __init parse_acpi(char *arg)
>   {
> @@ -58,6 +59,8 @@ static int __init parse_acpi(char *arg)
>   		param_acpi_on = true;
>   	else if (strcmp(arg, "force") == 0) /* force ACPI to be enabled */
>   		param_acpi_force = true;
> +	else if (strcmp(arg, "nospcr") == 0) /* disable SPCR as default console */
> +		param_acpi_nospcr = true;
>   	else
>   		return -EINVAL;	/* Core will print when we return error */
>   
> @@ -237,7 +240,20 @@ void __init acpi_boot_table_init(void)
>   			acpi_put_table(facs);
>   		}
>   #endif
> -		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
> +
> +		/*
> +		 * For varying privacy and security reasons, sometimes need
> +		 * to completely silence the serial console output, and only
> +		 * enable it when needed.
> +		 * But there are many existing systems that depend on this
> +		 * behavior, use acpi=nospcr to disable console in ACPI SPCR
> +		 * table as default serial console.
> +		 */
> +		acpi_parse_spcr(earlycon_acpi_spcr_enable,
> +			!param_acpi_nospcr);
> +		pr_info("Use ACPI SPCR as default console: %s\n",
> +				param_acpi_nospcr ? "No" : "Yes");
> +
>   		if (IS_ENABLED(CONFIG_ACPI_BGRT))
>   			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
>   	}

This looks good to me.  Sorry that this took so long Liu.

Reviewed-by: Prarit Bhargava <prarit@redhat.com>

P.



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

* Re: [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64
  2024-06-25 12:58   ` Prarit Bhargava
@ 2024-06-26  3:07     ` Liu Wei
  0 siblings, 0 replies; 21+ messages in thread
From: Liu Wei @ 2024-06-26  3:07 UTC (permalink / raw)
  To: prarit, Liu Wei, will
  Cc: andrew, catalin.marinas, linux-arm-kernel, linux-kernel

From: Prarit Bhargava <prarit@redhat.com>

> On 6/24/24 23:05, Liu Wei wrote:
> > For varying privacy and security reasons, sometimes we would like to
> > completely silence the _serial_ console, and only enable it when needed.
> > 
> > But there are many existing systems that depend on this _serial_ console,
> > so add acpi=nospcr to disable console in ACPI SPCR table as default
> > _serial_ console.
> > 
> > Signed-off-by: Liu Wei <liuwei09@cestc.cn>
> > Suggested-by: Prarit Bhargava <prarit@redhat.com>
> > Suggested-by: Will Deacon <will@kernel.org>
> > Suggested-by: Andrew Lunn <andrew@lunn.ch>
> > ---
> > 
> > v2: Add a config option suggested by Prarit
> > 
> > v3: Use cmdline acpi=nospcr instead of config
> > 
> > v4: Some description in comment or document
> > ---
> >   .../admin-guide/kernel-parameters.txt          | 10 +++++++---
> >   arch/arm64/kernel/acpi.c                       | 18 +++++++++++++++++-
> >   2 files changed, 24 insertions(+), 4 deletions(-)
> > 
> >  ... 
> > 
> 
> This looks good to me.  Sorry that this took so long Liu.
> 
> Reviewed-by: Prarit Bhargava <prarit@redhat.com>
> 

Thanks, my pleasure.

Liu Wei
 
> 
> P.




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

* Re: [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64
  2024-06-25  3:05 ` [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64 Liu Wei
  2024-06-25 12:58   ` Prarit Bhargava
@ 2024-06-26  7:54   ` Hanjun Guo
  2024-07-04 16:22   ` Catalin Marinas
  2 siblings, 0 replies; 21+ messages in thread
From: Hanjun Guo @ 2024-06-26  7:54 UTC (permalink / raw)
  To: Liu Wei, will
  Cc: catalin.marinas, linux-arm-kernel, linux-kernel, prarit,
	Andrew Lunn

On 2024/6/25 11:05, Liu Wei wrote:
> For varying privacy and security reasons, sometimes we would like to
> completely silence the _serial_ console, and only enable it when needed.
> 
> But there are many existing systems that depend on this _serial_ console,
> so add acpi=nospcr to disable console in ACPI SPCR table as default
> _serial_ console.

I think this is reasonable, with ACPI SPCR on in default is compatible
with old systems.

> 
> Signed-off-by: Liu Wei <liuwei09@cestc.cn>
> Suggested-by: Prarit Bhargava <prarit@redhat.com>
> Suggested-by: Will Deacon <will@kernel.org>
> Suggested-by: Andrew Lunn <andrew@lunn.ch>
> ---
> 
> v2: Add a config option suggested by Prarit
> 
> v3: Use cmdline acpi=nospcr instead of config
> 
> v4: Some description in comment or document
> ---
>   .../admin-guide/kernel-parameters.txt          | 10 +++++++---
>   arch/arm64/kernel/acpi.c                       | 18 +++++++++++++++++-
>   2 files changed, 24 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 11e57ba2985c..6814ff7ae446 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -12,7 +12,7 @@
>   	acpi=		[HW,ACPI,X86,ARM64,RISCV64,EARLY]
>   			Advanced Configuration and Power Interface
>   			Format: { force | on | off | strict | noirq | rsdt |
> -				  copy_dsdt }
> +				  copy_dsdt | nospcr }
>   			force -- enable ACPI if default was off
>   			on -- enable ACPI but allow fallback to DT [arm64,riscv64]
>   			off -- disable ACPI if default was on
> @@ -21,8 +21,12 @@
>   				strictly ACPI specification compliant.
>   			rsdt -- prefer RSDT over (default) XSDT
>   			copy_dsdt -- copy DSDT to memory
> -			For ARM64 and RISCV64, ONLY "acpi=off", "acpi=on" or
> -			"acpi=force" are available
> +			nospcr -- disable console in ACPI SPCR table as
> +				default _serial_ console on ARM64
> +			For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
> +			"acpi=nospcr" are available
> +			For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
> +			are available
>   
>   			See also Documentation/power/runtime_pm.rst, pci=noacpi
>   
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index e0e7b93c16cc..55757d8884d4 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -45,6 +45,7 @@ EXPORT_SYMBOL(acpi_pci_disabled);
>   static bool param_acpi_off __initdata;
>   static bool param_acpi_on __initdata;
>   static bool param_acpi_force __initdata;
> +static bool param_acpi_nospcr __initdata;
>   
>   static int __init parse_acpi(char *arg)
>   {
> @@ -58,6 +59,8 @@ static int __init parse_acpi(char *arg)
>   		param_acpi_on = true;
>   	else if (strcmp(arg, "force") == 0) /* force ACPI to be enabled */
>   		param_acpi_force = true;
> +	else if (strcmp(arg, "nospcr") == 0) /* disable SPCR as default console */
> +		param_acpi_nospcr = true;
>   	else
>   		return -EINVAL;	/* Core will print when we return error */
>   
> @@ -237,7 +240,20 @@ void __init acpi_boot_table_init(void)
>   			acpi_put_table(facs);
>   		}
>   #endif
> -		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
> +
> +		/*
> +		 * For varying privacy and security reasons, sometimes need
> +		 * to completely silence the serial console output, and only
> +		 * enable it when needed.
> +		 * But there are many existing systems that depend on this
> +		 * behavior, use acpi=nospcr to disable console in ACPI SPCR

Nit: s/behavior/behaviour

> +		 * table as default serial console.
> +		 */
> +		acpi_parse_spcr(earlycon_acpi_spcr_enable,
> +			!param_acpi_nospcr);
> +		pr_info("Use ACPI SPCR as default console: %s\n",
> +				param_acpi_nospcr ? "No" : "Yes");
> +
>   		if (IS_ENABLED(CONFIG_ACPI_BGRT))
>   			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
>   	}

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>

Thanks
Hanjun


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

* Re: [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64
  2024-06-25  3:05 ` [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64 Liu Wei
  2024-06-25 12:58   ` Prarit Bhargava
  2024-06-26  7:54   ` Hanjun Guo
@ 2024-07-04 16:22   ` Catalin Marinas
  2 siblings, 0 replies; 21+ messages in thread
From: Catalin Marinas @ 2024-07-04 16:22 UTC (permalink / raw)
  To: will, Liu Wei; +Cc: linux-arm-kernel, linux-kernel, prarit, Andrew Lunn

On Tue, 25 Jun 2024 11:05:04 +0800, Liu Wei wrote:
> For varying privacy and security reasons, sometimes we would like to
> completely silence the _serial_ console, and only enable it when needed.
> 
> But there are many existing systems that depend on this _serial_ console,
> so add acpi=nospcr to disable console in ACPI SPCR table as default
> _serial_ console.
> 
> [...]

Applied to arm64 (for-next/acpi), thanks!

[1/1] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64
      https://git.kernel.org/arm64/c/f5a4af3c7527

-- 
Catalin



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

end of thread, other threads:[~2024-07-04 16:22 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-30  1:53 [PATCH] ACPI: Do not enable ACPI SPCR console by default on arm64 Liu Wei
2024-05-30 13:06 ` Prarit Bhargava
2024-06-18 15:29   ` Will Deacon
2024-06-18 16:40     ` Sudeep Holla
2024-06-20 12:04       ` Prarit Bhargava
2024-06-21  4:37         ` Liu Wei
2024-05-31  1:52 ` Liu Wei
2024-06-21  4:47 ` [PATCH v2] ACPI: Add config to disable " Liu Wei
2024-06-21 11:26   ` Prarit Bhargava
2024-06-21 16:39     ` Liu Wei
2024-06-22  9:35 ` [PATCH V3] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console " Liu Wei
2024-06-22 17:05   ` Andrew Lunn
2024-06-24  5:04     ` Liu Wei
2024-06-24 14:42       ` Will Deacon
2024-06-24 15:10       ` Andrew Lunn
2024-06-25  2:48         ` Liu Wei
2024-06-25  3:05 ` [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64 Liu Wei
2024-06-25 12:58   ` Prarit Bhargava
2024-06-26  3:07     ` Liu Wei
2024-06-26  7:54   ` Hanjun Guo
2024-07-04 16:22   ` Catalin Marinas

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