From nobody Sun Feb 8 06:46:18 2026 Received: from smtp.cecloud.com (unknown [1.203.97.240]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EEFB6EA4 for ; Fri, 21 Jun 2024 04:54:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=1.203.97.240 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718945666; cv=none; b=BvPVC+QtFw60l9/xjiwQwSmrfeXiDfRXYemTcFFCOLrhMyYkfcm5qnDiQuI0nx0g68M9baT+eTPMGRmrCwyMUXiKjsST5Hf3uaQqfamWAcCkhJ7mLcVFWXQbZLcIOt5pG6nyFRVg754vVWiiqwKe4PTLm4M/uSxpObYz+Z5l6js= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718945666; c=relaxed/simple; bh=bZ9mK9GNb7YG2nv62WAZv4V5fghiZJAaNPQsE+uaTqY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FqxzhkEseVS6XAFnl7cThPpd/Qnnn3BYVnP1a0w3xcq1RrAPiOXu7VN0iypmnM3GhlbmwJ7tfBipd4Y8sB1Lslmhsw24Vv66yJ9c+Oyl8BO+GtAaPinNk9ikAV2E1G3r2DqBF6dPhC7UdShMGk0jL28rwdW6HfSQjPSbxmdym0I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cestc.cn; spf=pass smtp.mailfrom=cestc.cn; arc=none smtp.client-ip=1.203.97.240 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cestc.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cestc.cn Received: from localhost (localhost [127.0.0.1]) by smtp.cecloud.com (Postfix) with ESMTP id 8F64B900112; Fri, 21 Jun 2024 12:48:00 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [111.48.69.245]) by smtp.cecloud.com (postfix) whith ESMTP id P1340310T281473214968176S1718945279182439_; Fri, 21 Jun 2024 12:48:00 +0800 (CST) X-IP-DOMAINF: 1 X-RL-SENDER: liuwei09@cestc.cn X-SENDER: liuwei09@cestc.cn X-LOGIN-NAME: liuwei09@cestc.cn X-FST-TO: prarit@redhat.com X-RCPT-COUNT: 10 X-LOCAL-RCPT-COUNT: 1 X-MUTI-DOMAIN-COUNT: 0 X-SENDER-IP: 111.48.69.245 X-ATTACHMENT-NUM: 0 X-UNIQUE-TAG: <9a2b04ede9b60af26aa0b40245e81f4a> X-System-Flag: 0 From: Liu Wei To: prarit@redhat.com Cc: catalin.marinas@arm.com, guohanjun@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, liuwei09@cestc.cn, lpieralisi@kernel.org, rafael@kernel.org, sudeep.holla@arm.com, will@kernel.org Subject: [PATCH v2] ACPI: Add config to disable ACPI SPCR console by default on arm64 Date: Fri, 21 Jun 2024 12:47:06 +0800 Message-ID: <20240621044706.87181-1-liuwei09@cestc.cn> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240530015332.7305-1-liuwei09@cestc.cn> References: <20240530015332.7305-1-liuwei09@cestc.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Suggested-by: Prarit Bhargava --- 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=20 + * 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 =20 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. --=20 2.42.1