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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4F6EC4167D for ; Thu, 9 Nov 2023 09:44:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231349AbjKIJod (ORCPT ); Thu, 9 Nov 2023 04:44:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbjKIJob (ORCPT ); Thu, 9 Nov 2023 04:44:31 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC5292736 for ; Thu, 9 Nov 2023 01:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699523027; 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=OEjQ7xxzDSW6bCsBCGR2pe6qDNDSEL6lx838tIM/GU8=; b=f6+oEIASi65VzaiyTjaD9u+K9jLEYYB14KYR755tiblsv2Eo4qIzmmuAJJyG3PiXjkWptG qbVqlY7RAKtWGUOYTu6FaVBLNFiXxm1n5OP+xyBH879iMbVubfBT1ioo/D77ROwvVORDN2 euRlqCT5Vk/t8ZRuKXLsEJCaVD7RIRM= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-632-fywIOqZONi2V1g8Qj8KutA-1; Thu, 09 Nov 2023 04:43:45 -0500 X-MC-Unique: fywIOqZONi2V1g8Qj8KutA-1 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-2800be2d781so182119a91.1 for ; Thu, 09 Nov 2023 01:43:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699523024; x=1700127824; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OEjQ7xxzDSW6bCsBCGR2pe6qDNDSEL6lx838tIM/GU8=; b=LTYyYV/C4CxC6JmqO6BsvlF3mp/P4rrFemCwHHqvson6BhIwnVhjpvcixhLX+PP9Qk XonkFw8WD37Cy+MVICNhDvveXXBN9L9Di19ikANAyphqqztz/m7bldM1UejYgvvzGbe/ LFB10dgCWzL2xw1AHu2e+Wdxqdoq7DF2hKYeZqlVnMDAkVaH0WVzJCj842WdfSBuEfZE 2I74pgWD39/yunDcCWQ38uSSD4LfpIbPqh7cNUYYxmGZdaPeznEjziocXFr25PvD7ES5 DrGrzQFZSxGP0sa+iPVT5YRuaXfshxtEvZvRnBoPWKsYdcUyygw//3yApf3QxHAnJbjO AuGQ== X-Gm-Message-State: AOJu0Yzie34RPcJghoR2c+9iCkYA73+J85ibPz2kkrlHYGcjf+H2BIYB 384A4eMSiRUDEQMychsIT9i8nENvxHK3IQ77ZAM8IHwZRYcV5T7dYrZU0hMUx8BRn61UsU9+Meu m+ZUdq5DgG2YAgntQLuBnhHHP X-Received: by 2002:a17:902:d4cd:b0:1cc:2bc4:5157 with SMTP id o13-20020a170902d4cd00b001cc2bc45157mr4921098plg.1.1699523024547; Thu, 09 Nov 2023 01:43:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6RZnogij7LzQU0k7NFPHwR/unfu31fUk7J39NRmSg93ajKyOUqEekd23fy6SG5sWCfMu5eg== X-Received: by 2002:a17:902:d4cd:b0:1cc:2bc4:5157 with SMTP id o13-20020a170902d4cd00b001cc2bc45157mr4921073plg.1.1699523024112; Thu, 09 Nov 2023 01:43:44 -0800 (PST) Received: from [10.66.61.39] ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id h21-20020a170902eed500b001bf846dd2d0sm3105978plb.13.2023.11.09.01.43.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Nov 2023 01:43:43 -0800 (PST) Message-ID: <46faa2bd-9f27-2eea-f46d-f02715e2b540@redhat.com> Date: Thu, 9 Nov 2023 17:43:36 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH RFC 05/22] ACPI: Move ACPI_HOTPLUG_CPU to be disabled on arm64 and riscv Content-Language: en-US To: "Russell King (Oracle)" , 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 References: From: Shaoqin Huang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/23 18:29, Russell King (Oracle) 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 > Signed-off-by: Russell King (Oracle) Reviewed-by: Shaoqin Huang > --- > 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 d889a0b97bc1..64620e90c12c 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; -- Shaoqin