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 16392C2BBCA for ; Tue, 25 Jun 2024 12:58:56 +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:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ahyjuN1IQMhs449YcyfZMjZr4BNWq0ro7neYjEknzhc=; b=2uOkuPFCDg+kjGKheRV4/HmNML 9cdD4JH4shqRJTz3+2+SCmc6Gy1+xOwlIUbr691hE6uHglDD8UYITYm9QT/lbW79fw0l/W8yyGguz dsie0DtAQM3ocT4eTkzbu3kSSgOD5doc2aRpWWSa5hhboxxtOglQwrKqcYR5W/koJTYeaBNxlfzWs AowoVT9muaMFkjb7sQjTktNdB5ilItlJo3SoFqmF8+XI7Hvdmph+2Oqs89DgUfhVliDjFeKgMHo7u f28tN7ZthOEchFCZdY2KZWR4LJfYuwlCt4U6/8mR6RBcEOTc5uZ395CORRFct4a8JnBq+yqoomsht RpYUYNoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sM5ky-00000002sN0-3PcU; Tue, 25 Jun 2024 12:58:44 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sM5ko-00000002sHb-3fCY for linux-arm-kernel@lists.infradead.org; Tue, 25 Jun 2024 12:58:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719320312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ahyjuN1IQMhs449YcyfZMjZr4BNWq0ro7neYjEknzhc=; b=RtFkCNGI+1J/vQMu8OJhoa1VUT/b7dfyAjhOdLX1pdstEWlUHrX6RoQL3xy7loa5CeoPuE PpPt3OiPZj78UUcH9/dN3TP624JAiK1yki+4+T+jKCnvBlB1GLKYS+6z7dPcJhpWVrt/vk aDBjeodq9mwbQzzCPhfRMkTbx7RWWEU= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-392-qs79qdD5MJOYgvRtDqCzgg-1; Tue, 25 Jun 2024 08:58:30 -0400 X-MC-Unique: qs79qdD5MJOYgvRtDqCzgg-1 Received: by mail-oo1-f70.google.com with SMTP id 006d021491bc7-5c19ee51349so8580581eaf.2 for ; Tue, 25 Jun 2024 05:58:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719320309; x=1719925109; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ahyjuN1IQMhs449YcyfZMjZr4BNWq0ro7neYjEknzhc=; b=vkVrfhbOOSsl6NcpsO/FvOVwwgIPqYtH58/DMP6/hBxHFijSqm8O8rcF8a57W6sI/A /1098DNyLVY4AQWpgDMXQpSEK7+AJfNwNr3haNzRpA/k8PUPuZ24PFD4MBExztaei6+N 8Twji76/6ISQrLqHQN78jHJAxJWlHAIxu+8Fryvwe9FKrG9UfBoF+gxOv8EJHZ/LC+KB TIEpNt/7blEHO2cJwRwPmu7jRmCHYDHTVzBFb1+VrYq1DYKRjTUYsBMPgNjXKLOav0d0 gwJE1g9gfzziYsJE/KIVLewAKuHswYX/E7AoV7K72z3IwrIJ2dDEkZzwhLLF0CsXgayI tUbw== X-Forwarded-Encrypted: i=1; AJvYcCWQ1ns4CrjtFLpbRr6fZk3wThT00Go+XmSJttw1tJjgOvvJ8TtYrbwOpElHKNxeWcROEk2kbDISQutJu+qUEAD7th/CTKIvrqCv9IWQ0cd77SBDAdU= X-Gm-Message-State: AOJu0Yymz1HpAnOiX4yZXnXOMhZ6M5WJdoe9oBUbQfVBTwb8T4h85GyH N02IyWBOL6vjAN2jVxk0yc2GI7Ga806tArR3/CPfe0pDREjiMRkm2YmHBjZI/eIIVFzQ3U7nIBP 4EPaynd+iPcz0ZV90LhcMDzk29izf2cxBTZLvcAuYFUW+uqC+3+sFyya3+L2REyXiVrGSvszFo+ TTQ10v X-Received: by 2002:a05:6359:4ca8:b0:1a5:2f55:c47d with SMTP id e5c5f4694b2df-1a52f55c703mr24126755d.9.1719320309412; Tue, 25 Jun 2024 05:58:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHf0Y8yXMMcTnoJ4gMZxd9FhbT0x90EgSLxa/KXAi5ylWcugcCgfKHkt+lHyy3s5RUdEw8tnQ== X-Received: by 2002:a05:6359:4ca8:b0:1a5:2f55:c47d with SMTP id e5c5f4694b2df-1a52f55c703mr24124555d.9.1719320308883; Tue, 25 Jun 2024 05:58:28 -0700 (PDT) Received: from [10.26.1.93] ([66.187.232.136]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b534b6fb20sm30330456d6.58.2024.06.25.05.58.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Jun 2024 05:58:28 -0700 (PDT) Message-ID: <021b66fa-07ad-4ab4-8be9-94985f412d54@redhat.com> Date: Tue, 25 Jun 2024 08:58:27 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64 To: Liu Wei , will@kernel.org Cc: catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Lunn References: <20240530015332.7305-1-liuwei09@cestc.cn> <20240625030504.58025-1-liuwei09@cestc.cn> From: Prarit Bhargava In-Reply-To: <20240625030504.58025-1-liuwei09@cestc.cn> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240625_055835_031874_77D26A22 X-CRM114-Status: GOOD ( 27.31 ) 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 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 > 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 > + * 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 P.