From patchwork Fri Jun 21 04:47:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Wei X-Patchwork-Id: 13706796 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC6BBC27C4F for ; Fri, 21 Jun 2024 04:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dpoVjFbb8Bbt5YDMf4HNn6kxgtpr89iHCphTHxrdXN8=; b=k7MuB4yb5SeQq0GQAkMCAh6ZPr wV18L1yHPyNNwO2oApc//UxnvJee+WjjgTIEimTKeqk+450j7gkSaol5DcMfKgmwXU5Euidtj7KH7 /TGPZezx7SqgG7262jQDu6BORTywztjVhaDbMZyBhYEilZ2LLbjp1qoskROPi9/voGt2Us+QwtgmM eGlgG39XmxGs4Dd9K8WaO4dCRA9NhdjaPAGigHM4BTSzvmjE9kbiz6HmBRliMWY9n64QsVRPLPyrN tAY1kBfu8XAdi+tWahJNLfW1giU6eB44y/2CKbu2k1C+BZOrVGxg/PYjrN8C/WvrtlvvgeEm2ep/g KBfy8dHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKWBz-00000007gMD-0AdA; Fri, 21 Jun 2024 04:48:07 +0000 Received: from [1.203.97.240] (helo=smtp.cecloud.com) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKWBu-00000007gKc-3Ssi for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 04:48:04 +0000 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240620_214803_043440_2E98D84C X-CRM114-Status: GOOD ( 10.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 + * 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.