Received: by 2002:a05:7412:e79e:b0:f3:1519:9f41 with SMTP id o30csp168143rdd; Wed, 22 Nov 2023 12:17:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmUR1zR/xwQ461WAf4R2181H89dX7/rFwltbMuZE5XSsMWF/8XVlW5hMrNHpIFcn66Wa9B X-Received: by 2002:a05:6808:1b06:b0:3b8:4420:b7f6 with SMTP id bx6-20020a0568081b0600b003b84420b7f6mr2248285oib.11.1700684227204; Wed, 22 Nov 2023 12:17:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700684227; cv=none; d=google.com; s=arc-20160816; b=eoGslyxHMda+T9xKBZY09K/jr9plswmFUZQgQssjEIdsQEElM1zGPYiY7XF5UdId7l uQSQ7DYMfPVVtvlotETHnwKoD2WPnYyeT00jiFkKbIqmA7dPcaAnxWnUNzIacHSuWiBd /781RSrH/oqDDz0UhMPmKKMvMEIi9JczG/NtkYeypJ/ByZrCEUBYAToHiwr9Hnz9Ui8K ErJ+onCc9wJ9Xf5NMjA2+je+5yrFh/VKvvLIAI7RrXBQnVnK6jZLXZgupS9AUXn2f60y 6djiRtYC6MQ00Byvtz5SXvZL4p4Bti+w9dtP5ydX9yqrNu+W+SEhhPJHd0ZDXNEJhbr5 1dNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=vMkF8Unz8pNu9rvOyW4hXqms8zfkh1K1P14yvbTazeI=; fh=JN9Bgh+zUEIT4NWhld7UHumHo/Jg8gD6GgWkSjH7WNg=; b=quwjQ4TkVCVIhPuZEfTdz+wsbyNjwHhvFZYxONhSu0da6b1GLJ5PrE/GYYPQCE2IIG 5/ua/NdD/Nrn5DCWpib+GTtK9dyeCQjmv+oZV8jOH8AEY+0AWeNX1Nv4sYWyPajRd08O gRs0kISI6TgXszFMdDYMcVX5/9ZNOgtBKN11Ut0xUUr6ykqNGiyQGgXN5SNb9SW6ilZo KsbwsF+Ff1gNYTVhPgRcfcLZUJlQEnJcRAqGNd8V9bN8rtofypw2neONsgLWcwTEAlvs xNyZEsYhWqm+4t3vNweXXSFJ5+Rd4FcYUUsE1n//WQLgppN87DF+tVwuNEbyuVtlke5v 8ECA== ARC-Authentication-Results: i=1; mx.google.com; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id g22-20020a63f416000000b005b8857bb156si170406pgi.463.2023.11.22.12.17.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 12:17:07 -0800 (PST) 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; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 81BDA826FAA9; Wed, 22 Nov 2023 12:17:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231596AbjKVUQy convert rfc822-to-8bit (ORCPT + 99 others); Wed, 22 Nov 2023 15:16:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbjKVUQy (ORCPT ); Wed, 22 Nov 2023 15:16:54 -0500 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4571BD; Wed, 22 Nov 2023 12:16:50 -0800 (PST) Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-1f4b29abdbcso21055fac.0; Wed, 22 Nov 2023 12:16:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700684210; x=1701289010; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U+AKNbPfGcSitF9DQBk43/GENfS9BTVC5pjwY2CWch8=; b=Bu5pFWc2ETKxL65yawgTFd7QN/bAEYfIseyHUYG/wZv4J0cEI8nhynLHfTa7QvWgpn UY6i6wsyCO4nqk7poMpH3gwZFogrqI2UlMoZKhy385XeLHqUGBy6p4Gj3K26HIjo5vbT SFdIwNj1diF59CY/axcaC0cN3zzJUehQvNm7WSmq2Q3+sE0ji2i2enNeYb6w7XS33RN0 kC1unYUAdEH+y/gchfS7wg79HZqn6UjveITZ7SmkAOqx+ySIfBe05J3oJrMx2v5sTQhu ACPcVkA83B2SibqwvK88yc7xy6DPcyQ4RlnlNZDvltTwmpQLhWw2KjJeHh8qpYJawe/7 CM+A== X-Gm-Message-State: AOJu0YwBcB68LlYn0Nia3sbFrGu7yDB2adf3QhBmPUfU8N4gDfZlEFcg 7Zyt40jhWHNXp1YmKF13Aa/UVAfIY6EGdYP8jrKalExF X-Received: by 2002:a05:6871:7a0:b0:1e9:8a7e:5893 with SMTP id o32-20020a05687107a000b001e98a7e5893mr4323044oap.5.1700684209905; Wed, 22 Nov 2023 12:16:49 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 22 Nov 2023 21:16:39 +0100 Message-ID: Subject: Re: [PATCH 05/21] ACPI: Move ACPI_HOTPLUG_CPU to be disabled on arm64 and riscv To: Russell King Cc: 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, 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=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 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]); Wed, 22 Nov 2023 12:17:03 -0800 (PST) On Tue, Nov 21, 2023 at 2:44 PM Russell King wrote: > > 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) I can apply this if it gets ACKs from the maintainers of the affected architectures. > --- > 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 >