linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: Liu Wei <liuwei09@cestc.cn>
Cc: catalin.marinas@arm.com, guohanjun@huawei.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, lpieralisi@kernel.org,
	rafael@kernel.org, sudeep.holla@arm.com, will@kernel.org
Subject: Re: [PATCH v2] ACPI: Add config to disable ACPI SPCR console by default on arm64
Date: Fri, 21 Jun 2024 07:26:51 -0400	[thread overview]
Message-ID: <c3f923f7-05b1-44ec-8cc2-e5dff1cbd2c6@redhat.com> (raw)
In-Reply-To: <20240621044706.87181-1-liuwei09@cestc.cn>

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.



WARNING: multiple messages have this Message-ID (diff)
From: Liu Wei <liuwei09@cestc.cn>
To: prarit@redhat.com, Liu Wei <liuwei09@cestc.cn>
Cc: catalin.marinas@arm.com, guohanjun@huawei.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, lpieralisi@kernel.org,
	rafael@kernel.org, sudeep.holla@arm.com, will@kernel.org
Subject: Re: [PATCH v2] ACPI: Add config to disable ACPI SPCR console by default on arm64
Date: Sat, 22 Jun 2024 00:39:25 +0800	[thread overview]
Message-ID: <c3f923f7-05b1-44ec-8cc2-e5dff1cbd2c6@redhat.com> (raw)
Message-ID: <20240621163925.oWhlLfHRd4WjIcFFSifzPYSZSnPA8tmGXIBkcZEmDr8@z> (raw)
In-Reply-To: <20240621044706.87181-1-liuwei09@cestc.cn>

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




  reply	other threads:[~2024-06-21 11:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=c3f923f7-05b1-44ec-8cc2-e5dff1cbd2c6@redhat.com \
    --to=prarit@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=guohanjun@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuwei09@cestc.cn \
    --cc=lpieralisi@kernel.org \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=will@kernel.org \
    /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).