Skip to content

Commit f5a4af3

Browse files
Liu Weictmarinas
authored andcommitted
ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64
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 <[email protected]> Suggested-by: Prarit Bhargava <[email protected]> Suggested-by: Will Deacon <[email protected]> Suggested-by: Andrew Lunn <[email protected]> Reviewed-by: Hanjun Guo <[email protected]> Reviewed-by: Prarit Bhargava <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent bfe3f0d commit f5a4af3

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
acpi= [HW,ACPI,X86,ARM64,RISCV64,EARLY]
1313
Advanced Configuration and Power Interface
1414
Format: { force | on | off | strict | noirq | rsdt |
15-
copy_dsdt }
15+
copy_dsdt | nospcr }
1616
force -- enable ACPI if default was off
1717
on -- enable ACPI but allow fallback to DT [arm64,riscv64]
1818
off -- disable ACPI if default was on
@@ -21,8 +21,12 @@
2121
strictly ACPI specification compliant.
2222
rsdt -- prefer RSDT over (default) XSDT
2323
copy_dsdt -- copy DSDT to memory
24-
For ARM64 and RISCV64, ONLY "acpi=off", "acpi=on" or
25-
"acpi=force" are available
24+
nospcr -- disable console in ACPI SPCR table as
25+
default _serial_ console on ARM64
26+
For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
27+
"acpi=nospcr" are available
28+
For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
29+
are available
2630

2731
See also Documentation/power/runtime_pm.rst, pci=noacpi
2832

arch/arm64/kernel/acpi.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ EXPORT_SYMBOL(acpi_pci_disabled);
4545
static bool param_acpi_off __initdata;
4646
static bool param_acpi_on __initdata;
4747
static bool param_acpi_force __initdata;
48+
static bool param_acpi_nospcr __initdata;
4849

4950
static int __init parse_acpi(char *arg)
5051
{
@@ -58,6 +59,8 @@ static int __init parse_acpi(char *arg)
5859
param_acpi_on = true;
5960
else if (strcmp(arg, "force") == 0) /* force ACPI to be enabled */
6061
param_acpi_force = true;
62+
else if (strcmp(arg, "nospcr") == 0) /* disable SPCR as default console */
63+
param_acpi_nospcr = true;
6164
else
6265
return -EINVAL; /* Core will print when we return error */
6366

@@ -237,7 +240,20 @@ void __init acpi_boot_table_init(void)
237240
acpi_put_table(facs);
238241
}
239242
#endif
240-
acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
243+
244+
/*
245+
* For varying privacy and security reasons, sometimes need
246+
* to completely silence the serial console output, and only
247+
* enable it when needed.
248+
* But there are many existing systems that depend on this
249+
* behaviour, use acpi=nospcr to disable console in ACPI SPCR
250+
* table as default serial console.
251+
*/
252+
acpi_parse_spcr(earlycon_acpi_spcr_enable,
253+
!param_acpi_nospcr);
254+
pr_info("Use ACPI SPCR as default console: %s\n",
255+
param_acpi_nospcr ? "No" : "Yes");
256+
241257
if (IS_ENABLED(CONFIG_ACPI_BGRT))
242258
acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
243259
}

0 commit comments

Comments
 (0)