Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp391451rdf; Tue, 21 Nov 2023 05:47:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsPDIcemnTg4VUoY01SadzRywCjAKe4HJsG4ZxkNI5g2Kik520yMX7ptupuAO4ZjEbQBtE X-Received: by 2002:a62:e803:0:b0:6b1:5d1a:bd0c with SMTP id c3-20020a62e803000000b006b15d1abd0cmr3920436pfi.16.1700574426157; Tue, 21 Nov 2023 05:47:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700574426; cv=none; d=google.com; s=arc-20160816; b=DsxGJ8XmvP5JwnQE5F1q4xo8bpa1T81upXBgwp5F8yRgb2e+K/fFsz6uMpA1aKoLMh XPnqqTApxR0/v/tVn2zkFluO5FYMn5DwIv0MxXdCmBa4cO8LFWPfHYoyUEJpj7LbnMcN qiWoNIIa5t+VeVTHb1mLqYzFCDW61ndDqTkVlys1T7CSZB+xRPEK+UrFL/v/WsODUcUU /2UNv21ge506P54j0zoYbx5lPTSsYEuvQR0GCDsZ6FKez9dV2ApzIbWzv6VcKIiI4Jht V8lvebFfVTKBGUGOM6rmFZAVSEjXzmvpk75glRRkfd4/mmEzm7YYD0E+zV0XPgugW8Zg f/9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:sender:message-id:content-transfer-encoding :content-disposition:mime-version:subject:cc:to:from:references :in-reply-to:dkim-signature; bh=/KlNB6F+rBYz84SQNTntc3fasgQKd7mWpFRbnxNR+80=; fh=o7G67SMpSFLFh+ltBmYAYlGVBCGqqyOmS3JECM/7Wlg=; b=F5FJCJwYbXfoOkN7NvA31BLABt0kmR7ljUpMs83G6Mgw45N3zlCEFUsSRoqHoers1v 3Jzxj2TgFLZaDllr4/xRFqHQ5rHgrmtq7Ve4HMHC5ebQOGmFc2Yq072DmMHJtD5Q0uB3 bcFqFbybITowF6xxo2xAN+YXTdMY9oBztWnVDwM0SXJktYTyeEgBLiKroR7Pcy1+qBb/ v3JAC0RY75pmyJijBsht29YU6QM9jZxbm7yrCJXmL63r3iQP92annNMEkrozPNxpmTAF 32h/XROBW3hhKBLNAU0ZREJiJAG446n5+gHsNV0b2jxAqgDVbCYV/z9RlaW2Hz0ILCbk DBJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Xkvvyfs4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id l5-20020a632505000000b005855f67e490si10543621pgl.690.2023.11.21.05.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 05:47:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Xkvvyfs4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A736A80944DB; Tue, 21 Nov 2023 05:45:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234387AbjKUNpB (ORCPT + 99 others); Tue, 21 Nov 2023 08:45:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234430AbjKUNoo (ORCPT ); Tue, 21 Nov 2023 08:44:44 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9975C1731; Tue, 21 Nov 2023 05:44:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/KlNB6F+rBYz84SQNTntc3fasgQKd7mWpFRbnxNR+80=; b=Xkvvyfs4DS/FkKlCZgDdvVxswL GIvcEGv/g1ewe4Yr6lynMz0Lgg6Gr7kqav7ThFGzwMdsH5I5me6dIqRDXyxSuVZ6OS/0jxArHvCRI 6mmEXkHXKre2efdi1RCJ8fkQPqCfLBeoECCYqyKCNgyKse3lOvBU8vApQHVyGHxhytNHEHiVeEucj xqJSIUlS72qwkQUduvLPX1FYg9QrlyjZJ1c5IaZwikBEImHxb/W75Im9ihqzFnDpQ4LjvHzw2qo4V /FpEJbGH/qYMXlrlL/HwBFI9fcCsREmwLSpxK3ALCjiyx4O0aQzJtACQVtBs3F8Qf5MOUGDymzmYM t9sJUTAA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:52646 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r5R2z-00076s-2P; Tue, 21 Nov 2023 13:44:13 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r5R31-00Csyt-Jq; Tue, 21 Nov 2023 13:44:15 +0000 In-Reply-To: References: From: Russell King (Oracle) To: linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org Cc: Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse , Huacai Chen , WANG Xuerui , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , "Rafael J. Wysocki" , Len Brown , Paul Walmsley , Palmer Dabbelt , Albert Ou Subject: [PATCH 05/21] ACPI: Move ACPI_HOTPLUG_CPU to be disabled on arm64 and riscv MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Tue, 21 Nov 2023 13:44:15 +0000 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 05:45:58 -0800 (PST) From: James Morse Neither arm64 nor riscv support physical hotadd of CPUs that were not present at boot. For arm64 much of the platform description is in static tables which do not have update methods. arm64 does support HOTPLUG_CPU, which is backed by a firmware interface to turn CPUs on and off. acpi_processor_hotadd_init() and acpi_processor_remove() are for adding and removing CPUs that were not present at boot. arm64 systems that do this are not supported as there is currently insufficient information in the platform description. (e.g. did the GICR get removed too?) arm64 currently relies on the MADT enabled flag check in map_gicc_mpidr() to prevent CPUs that were not described as present at boot from being added to the system. Similarly, riscv relies on the same check in map_rintc_hartid(). Both architectures also rely on the weak 'always fails' definitions of acpi_map_cpu() and arch_register_cpu(). Subsequent changes will redefine ACPI_HOTPLUG_CPU as making possible CPUs present. Neither arm64 nor riscv support this. Disable ACPI_HOTPLUG_CPU for arm64 and riscv by removing 'default y' and selecting it on the other three ACPI architectures. This allows the weak definitions of some symbols to be removed. Signed-off-by: James Morse Reviewed-by: Shaoqin Huang Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- Changes since RFC: * Expanded conditions to avoid ACPI_HOTPLUG_CPU being enabled when HOTPLUG_CPU isn't. Changes since RFC v3: * Dropped ia64 changes --- arch/loongarch/Kconfig | 1 + arch/x86/Kconfig | 1 + drivers/acpi/Kconfig | 1 - drivers/acpi/acpi_processor.c | 18 ------------------ 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index ee123820a476..331becb2cb4f 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -5,6 +5,7 @@ config LOONGARCH select ACPI select ACPI_GENERIC_GSI if ACPI select ACPI_MCFG if ACPI + select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR && HOTPLUG_CPU select ACPI_PPTT if ACPI select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI select ARCH_BINFMT_ELF_STATE diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 3762f41bb092..dbdcfc708369 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -59,6 +59,7 @@ config X86 # select ACPI_LEGACY_TABLES_LOOKUP if ACPI select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI + select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR && HOTPLUG_CPU select ARCH_32BIT_OFF_T if X86_32 select ARCH_CLOCKSOURCE_INIT select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index f819e760ff19..a3acfc750fce 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -310,7 +310,6 @@ config ACPI_HOTPLUG_CPU bool depends on ACPI_PROCESSOR && HOTPLUG_CPU select ACPI_CONTAINER - default y config ACPI_PROCESSOR_AGGREGATOR tristate "Processor Aggregator" diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 0f5218e361df..4fe2ef54088c 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -184,24 +184,6 @@ static void __init acpi_pcc_cpufreq_init(void) {} /* Initialization */ #ifdef CONFIG_ACPI_HOTPLUG_CPU -int __weak acpi_map_cpu(acpi_handle handle, - phys_cpuid_t physid, u32 acpi_id, int *pcpu) -{ - return -ENODEV; -} - -int __weak acpi_unmap_cpu(int cpu) -{ - return -ENODEV; -} - -int __weak arch_register_cpu(int cpu) -{ - return -ENODEV; -} - -void __weak arch_unregister_cpu(int cpu) {} - static int acpi_processor_hotadd_init(struct acpi_processor *pr) { unsigned long long sta; -- 2.30.2