Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1961431rda; Tue, 24 Oct 2023 08:18:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEF4HYMfQvVkLXhktWj64hjYNuK700biwB5xHziBYrsiIgCRG4zaBiphfiBZcyj4/E1FHIm X-Received: by 2002:a05:6a21:3e0d:b0:171:8e16:ea83 with SMTP id bk13-20020a056a213e0d00b001718e16ea83mr2806469pzc.29.1698160736066; Tue, 24 Oct 2023 08:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698160736; cv=none; d=google.com; s=arc-20160816; b=z7giyaWZFwIvSKT/fwzfW9EqP6pQ5u6khgHU28FMoAf8LmKgcdtnc6Jj7wmwxTDz90 9B8H9yYQVbSdn5kMGHOQoUa2GE6FtCfu1zOA/TIj+KuRjWXsW7fWPACD1A/aA7rlRyq3 boF4YD32qTIv6Qzbiy+0I109SMof4GlX47HHplIGOEqhif7sS7/mqvbeET9mosG3w24+ 9otyWN37nrpqnezhjeCt7FBU/Tyeo6kuIyj70QjT4Fbzncej7V0tW88OVNsivndgB9GG TnXXrCAD4R2gw16m6OIXYzNCpOMnonf0faxrdfhegFZ38OMgS1uOM+Pds6a9n0OOUkN2 GRag== 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=KZXjVtVQneKo3WIqS1cOw+7u76KHDqdKIkimTnmicMQ=; fh=o7G67SMpSFLFh+ltBmYAYlGVBCGqqyOmS3JECM/7Wlg=; b=HEFjBdnjvBJY/oXONDY9Okz59R2j+/rgOnZkPmqU8UljX/Ygp6gPKn80tlDny7nA6Y KndXfo9uDrMWbWqa+I7st/GWQW0itYeikma1ddsXVeEyp4bNQgS3JPPjlFDSI8dKryyc nDdNZT75ZOKalHtNXXtsmixDXzj2IFOBKmhQs4GUsVyxQbX11k5QZU9JD0PckK5YmIQi LjF4j/uISy09GxgzWdsx+CwRR5EFPIsGQVnXe/XZB7/Bumed9n9VBbFiZG8BXXRByJof wkxQOOJ1Mn45VrOl6al8Lm2vFjAZCnxPTt9PhXO/4hfzpbZaf3PvL/0hZl+nspFG2gSs ddgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=oQXL+ztb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id e65-20020a636944000000b005aa72875784si8210169pgc.274.2023.10.24.08.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:18:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=oQXL+ztb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 3D0638076643; Tue, 24 Oct 2023 08:18:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232738AbjJXPSg (ORCPT + 99 others); Tue, 24 Oct 2023 11:18:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234761AbjJXPR4 (ORCPT ); Tue, 24 Oct 2023 11:17:56 -0400 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 9D2C71706; Tue, 24 Oct 2023 08:17:14 -0700 (PDT) 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=KZXjVtVQneKo3WIqS1cOw+7u76KHDqdKIkimTnmicMQ=; b=oQXL+ztbtib67CufbaV6bwZs0x 1aL5xpdM/v7yUBuXAU31sRvFyvboD1hASYO/YHcx/XBuWnD2BvD0svJ0CTG88QmZbmHA8WpJK7vyR u9Ipxy5PZEQGUEvJKgUUZA0C1LGpUqRvoV+X42HCHIEkkNg9HYYD8IY55sMBHRhkcN5EFbmyAjw7k 4BTeBQvpcRokJmDvLDgmgSo9QmxbE1J+UgRsJmHOpl+3xAVjCTei9RXRVw+s9E2ZZFNUWuYCr8KhR PU0lqiYWbU1Ayp+ml6gmwkv6xQ0F7ytwCwVr8hU7+uKss0XUB0vKE+ib1JYApv930jkP7XApTB1BE QoWDP9Tw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:35394 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 1qvJ8z-0004MI-1r; Tue, 24 Oct 2023 16:16:33 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qvJ91-00AqPG-0U; Tue, 24 Oct 2023 16:16:35 +0100 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/39] 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, 24 Oct 2023 16:16:35 +0100 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Tue, 24 Oct 2023 08:18:53 -0700 (PDT) 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 Signed-off-by: Russell King (Oracle) --- Changes since RFC: * Expanded conditions to avoid ACPI_HOTPLUG_CPU being enabled when HOTPLUG_CPU isn't. --- arch/ia64/Kconfig | 1 + arch/loongarch/Kconfig | 1 + arch/x86/Kconfig | 1 + drivers/acpi/Kconfig | 1 - drivers/acpi/acpi_processor.c | 18 ------------------ 5 files changed, 3 insertions(+), 19 deletions(-) diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 53faa122b0f4..a3bfd42467ab 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -16,6 +16,7 @@ config IA64 select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO select ACPI + select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR && HOTPLUG_CPU select ACPI_NUMA if NUMA select ARCH_ENABLE_MEMORY_HOTPLUG select ARCH_ENABLE_MEMORY_HOTREMOVE diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index e14396a2ddcb..2bddd202470e 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 66bfabae8814..18729edc879d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -60,6 +60,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 cee82b473dc5..8456d48ba702 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -309,7 +309,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