public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: Liu Wei <liuwei09@cestc.cn>, will@kernel.org
Cc: catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64
Date: Tue, 25 Jun 2024 08:58:27 -0400	[thread overview]
Message-ID: <021b66fa-07ad-4ab4-8be9-94985f412d54@redhat.com> (raw)
In-Reply-To: <20240625030504.58025-1-liuwei09@cestc.cn>

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.


  reply	other threads:[~2024-06-25 12:58 UTC|newest]

Thread overview: 22+ 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-19  3:43       ` Liu Wei
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 [this message]
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=021b66fa-07ad-4ab4-8be9-94985f412d54@redhat.com \
    --to=prarit@redhat.com \
    --cc=andrew@lunn.ch \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuwei09@cestc.cn \
    --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