From mboxrd@z Thu Jan 1 00:00:00 1970 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 AF620C27C4F for ; Wed, 26 Jun 2024 07:55:02 +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: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:CC:To: Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IOUf+ZFnsWzsyd3bWVA7KxnUbCg3OTy8L7NPq8bSw74=; b=jtrD3VqHPYzad3GQIWwqA2ptyN uMAWp4yElQ306FqGrRPwMlXD3YlLxIBoF5a696OZcPr/IrB7DAam/Ug1NOVvIz8pvAhBeg176aGlz VQlJkUPCFc80JA7Trx5Gw8nDk2mhkH3EKX5at7RA5TX7uBmjnuYWQpG/1iLfb4jsqfh1rvtzrWyaw w3bv83GYUs1lIJh6zZHEJLjPliCMIckCUVVkjNgJLRDQJx4cgsje0skQx9/i+4TYNrpplqiQNjpm8 mWxEcAbpgow8JUNG9RlaD+6ax40vIf59zllNN2jDAAuR1fHALoUhKOSNFhPhZvbM+jKLMj103LpVa Usht7ekg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMNUL-00000005olN-20Q7; Wed, 26 Jun 2024 07:54:45 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMNUB-00000005ohd-3nNO for linux-arm-kernel@lists.infradead.org; Wed, 26 Jun 2024 07:54:38 +0000 Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4W8DPm00DSzxTqM; Wed, 26 Jun 2024 15:50:03 +0800 (CST) Received: from dggpemf500002.china.huawei.com (unknown [7.185.36.57]) by mail.maildlp.com (Postfix) with ESMTPS id A77FD14011D; Wed, 26 Jun 2024 15:54:23 +0800 (CST) Received: from [10.174.178.247] (10.174.178.247) by dggpemf500002.china.huawei.com (7.185.36.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 26 Jun 2024 15:54:23 +0800 Subject: Re: [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64 To: Liu Wei , CC: , , , , Andrew Lunn References: <20240530015332.7305-1-liuwei09@cestc.cn> <20240625030504.58025-1-liuwei09@cestc.cn> From: Hanjun Guo Message-ID: Date: Wed, 26 Jun 2024 15:54:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20240625030504.58025-1-liuwei09@cestc.cn> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.247] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemf500002.china.huawei.com (7.185.36.57) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240626_005436_336839_2F02A4B2 X-CRM114-Status: GOOD ( 26.44 ) 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 On 2024/6/25 11: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. I think this is reasonable, with ACPI SPCR on in default is compatible with old systems. > > Signed-off-by: Liu Wei > Suggested-by: Prarit Bhargava > Suggested-by: Will Deacon > Suggested-by: Andrew Lunn > --- > > 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 Nit: s/behavior/behaviour > + * 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); > } Reviewed-by: Hanjun Guo Thanks Hanjun