Linux-csky Archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <gshan@redhat.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
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 <salil.mehta@huawei.com>,
	Jean-Philippe Brucker <jean-philippe@linaro.org>,
	jianyong.wu@arm.com, justin.he@arm.com,
	James Morse <james.morse@arm.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>
Subject: Re: [PATCH RFC 05/22] ACPI: Move ACPI_HOTPLUG_CPU to be disabled on arm64 and riscv
Date: Mon, 13 Nov 2023 20:01:27 +1000	[thread overview]
Message-ID: <29090279-a682-43ff-9710-181cb91bbf91@redhat.com> (raw)
In-Reply-To: <ZVHkykFMp+CMUqyf@shell.armlinux.org.uk>


On 11/13/23 18:56, Russell King (Oracle) wrote:
> On Mon, Nov 13, 2023 at 10:29:39AM +1000, Gavin Shan wrote:
>> On 11/7/23 20:29, Russell King (Oracle) wrote:
>>> From: James Morse <james.morse@arm.com>
>>>
>>> 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 <james.morse@arm.com>
>>> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
>>> ---
>>> 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(-)
>>>
>>
>> With the following nits addressed:
>>
>> Reviewed-by: Gavin Shan <gshan@redhat.com>
>>
>>> 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) {}
>>> -
>>
>> Since we're here, EXPORT_SYMBOL() can be dropped for these functions on
>> x86 and loongarch because they're not called from a module?
> 
> I'm confused, and don't understand your comment. You've r-b the
> previous two patches that remove the EXPORT_SYMBOL()s for
> arch_register_cpu() and arch_unregister_cpu() from x86 and loongarch.
> So it seems your comment is already addressed, and thus makes no
> sense.
> 
> Please clarify.
> 

Exactly, I must be looking into wrong code when reviewing this patch.
Please ignore my comments and my r-b still valid. Sorry for the
unnecessary confusion.

Thanks,
Gavin


  reply	other threads:[~2023-11-13 10:01 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07 10:28 [PATCH RFC 00/22] Initial cleanups for vCPU hotplug Russell King (Oracle)
2023-11-07 10:29 ` [PATCH RFC 01/22] arch_topology: Make register_cpu_capacity_sysctl() tolerant to late CPUs Russell King
2023-11-13  0:04   ` Gavin Shan
2023-11-28 14:37   ` Jonathan Cameron
2023-11-28 15:41     ` Russell King (Oracle)
2023-11-07 10:29 ` [PATCH RFC 02/22] x86: intel_epb: Don't rely on link order Russell King
2023-11-13  0:03   ` Gavin Shan
2023-11-28 14:40   ` Jonathan Cameron
2023-11-28 15:42     ` Russell King (Oracle)
2023-11-07 10:29 ` [PATCH RFC 03/22] x86/topology: remove arch_*register_cpu() exports Russell King (Oracle)
2023-11-13  0:08   ` Gavin Shan
2023-11-28 14:42   ` Jonathan Cameron
2023-11-07 10:29 ` [PATCH RFC 04/22] Loongarch: " Russell King (Oracle)
2023-11-13  0:11   ` Gavin Shan
2023-11-28 14:43   ` Jonathan Cameron
2023-11-07 10:29 ` [PATCH RFC 05/22] ACPI: Move ACPI_HOTPLUG_CPU to be disabled on arm64 and riscv Russell King
2023-11-09  9:43   ` Shaoqin Huang
2023-11-13  0:29   ` Gavin Shan
2023-11-13  8:56     ` Russell King (Oracle)
2023-11-13 10:01       ` Gavin Shan [this message]
2023-11-28 14:46   ` Jonathan Cameron
2023-11-07 10:29 ` [PATCH RFC 06/22] drivers: base: Use present CPUs in GENERIC_CPU_DEVICES Russell King
2023-11-09 10:09   ` Shaoqin Huang
2023-11-09 10:29     ` Russell King (Oracle)
2023-11-09 10:59       ` Shaoqin Huang
2023-11-13  0:37   ` Gavin Shan
2023-11-07 10:29 ` [PATCH RFC 07/22] drivers: base: Allow parts of GENERIC_CPU_DEVICES to be overridden Russell King
2023-11-09 10:13   ` Shaoqin Huang
2023-11-13  0:42   ` Gavin Shan
2023-11-28 14:49   ` Jonathan Cameron
2023-11-07 10:29 ` [PATCH RFC 08/22] drivers: base: Implement weak arch_unregister_cpu() Russell King
2023-11-09 10:51   ` Shaoqin Huang
2023-11-13  0:45   ` Gavin Shan
2023-11-21 13:33   ` Russell King (Oracle)
2023-11-28 14:51     ` Jonathan Cameron
2023-11-07 10:30 ` [PATCH RFC 09/22] drivers: base: add arch_cpu_is_hotpluggable() Russell King (Oracle)
2023-11-10  3:27   ` Shaoqin Huang
2023-11-13  0:56   ` Gavin Shan
2023-11-28 14:53   ` Jonathan Cameron
2023-11-07 10:30 ` [PATCH RFC 10/22] drivers: base: Move cpu_dev_init() after node_dev_init() Russell King
2023-11-13  0:58   ` Gavin Shan
2023-11-13  8:00     ` Russell King (Oracle)
2023-11-21 13:27       ` Russell King (Oracle)
2023-11-28 13:55         ` Jonathan Cameron
2023-11-28 15:00           ` Jonathan Cameron
2023-11-30 12:17     ` Russell King (Oracle)
2023-11-07 10:30 ` [PATCH RFC 11/22] drivers: base: remove unnecessary call to register_cpu_under_node() Russell King (Oracle)
2023-11-13  4:04   ` Gavin Shan
2023-11-15 10:11     ` Russell King (Oracle)
2023-11-07 10:30 ` [PATCH RFC 12/22] drivers: base: Print a warning instead of panic() when register_cpu() fails Russell King
2023-11-10  3:35   ` Shaoqin Huang
2023-11-13  4:03   ` Gavin Shan
2023-11-28 15:05   ` Jonathan Cameron
2023-11-07 10:30 ` [PATCH RFC 13/22] arm64: setup: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu() Russell King
2023-11-10  3:36   ` Shaoqin Huang
2023-11-13  4:07   ` Gavin Shan
2023-11-28 15:08   ` Jonathan Cameron
2023-11-28 15:12     ` Jonathan Cameron
2023-11-07 10:30 ` [PATCH RFC 14/22] arm64: convert to arch_cpu_is_hotpluggable() Russell King (Oracle)
2023-11-10  3:37   ` Shaoqin Huang
2023-11-13  4:09   ` Gavin Shan
2023-11-28 15:11   ` Jonathan Cameron
2023-11-30 12:09     ` Russell King (Oracle)
2023-11-07 10:30 ` [PATCH RFC 15/22] x86/topology: Switch over to GENERIC_CPU_DEVICES Russell King
2023-11-13  4:13   ` Gavin Shan
2023-11-28 15:16   ` Jonathan Cameron
2023-11-07 10:30 ` [PATCH RFC 16/22] x86/topology: use weak version of arch_unregister_cpu() Russell King (Oracle)
2023-11-13  4:16   ` Gavin Shan
2023-11-28 15:17   ` Jonathan Cameron
2023-11-07 10:30 ` [PATCH RFC 17/22] x86/topology: convert to use arch_cpu_is_hotpluggable() Russell King (Oracle)
2023-11-13  4:18   ` Gavin Shan
2023-11-28 15:18   ` Jonathan Cameron
2023-11-07 10:30 ` [PATCH RFC 18/22] LoongArch: Switch over to GENERIC_CPU_DEVICES Russell King
2023-11-13  4:20   ` Gavin Shan
2023-11-28 15:19   ` Jonathan Cameron
2023-11-07 10:30 ` [PATCH RFC 19/22] LoongArch: Use the __weak version of arch_unregister_cpu() Russell King
2023-11-07 10:31 ` [PATCH RFC 20/22] LoongArch: convert to use arch_cpu_is_hotpluggable() Russell King (Oracle)
2023-11-13  4:22   ` Gavin Shan
2023-11-28 15:20   ` Jonathan Cameron
2023-11-07 10:31 ` [PATCH RFC 21/22] riscv: Switch over to GENERIC_CPU_DEVICES Russell King
2023-11-07 17:48   ` Palmer Dabbelt
2023-11-13  4:23   ` Gavin Shan
2023-11-07 10:31 ` [PATCH RFC 22/22] riscv: convert to use arch_cpu_is_hotpluggable() Russell King (Oracle)
2023-11-07 17:48   ` Palmer Dabbelt
2023-11-13  4:24   ` Gavin Shan
2023-11-28 15:21   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29090279-a682-43ff-9710-181cb91bbf91@redhat.com \
    --to=gshan@redhat.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=bp@alien8.de \
    --cc=chenhuacai@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=jean-philippe@linaro.org \
    --cc=jianyong.wu@arm.com \
    --cc=justin.he@arm.com \
    --cc=kernel@xen0n.name \
    --cc=kvmarm@lists.linux.dev \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=loongarch@lists.linux.dev \
    --cc=mingo@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rafael@kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).