[PATCH RFC 00/22] Initial cleanups for vCPU hotplug

2023-11-07 Thread Russell King (Oracle)
Hi, Rather than posting the entire set of vCPU kernel patches, this is a subset of those patches which I hope will be able to be appropriately queued for the next merge window. I am also hoping that nothing here is covered by Rafael's concerns he alluded to in his response to the RFC v3 series. T

[PATCH RFC 01/22] arch_topology: Make register_cpu_capacity_sysctl() tolerant to late CPUs

2023-11-07 Thread Oracle
From: James Morse register_cpu_capacity_sysctl() adds a property to sysfs that describes the CPUs capacity. This is done from a subsys_initcall() that assumes all possible CPUs are registered. With CPU hotplug, possible CPUs aren't registered until they become present, (or for arm64 enabled). Th

[PATCH RFC 02/22] x86: intel_epb: Don't rely on link order

2023-11-07 Thread Oracle
From: James Morse intel_epb_init() is called as a subsys_initcall() to register cpuhp callbacks. The callbacks make use of get_cpu_device() which will return NULL unless register_cpu() has been called. register_cpu() is called from topology_init(), which is also a subsys_initcall(). This is frag

[PATCH RFC 03/22] x86/topology: remove arch_*register_cpu() exports

2023-11-07 Thread Russell King (Oracle)
arch_register_cpu() and arch_unregister_cpu() are not used by anything that can be a module - they are used by drivers/base/cpu.c and drivers/acpi/acpi_processor.c, neither of which can be a module. Remove the exports. Signed-off-by: Russell King (Oracle) --- arch/x86/kernel/topology.c | 2 --

[PATCH RFC 04/22] Loongarch: remove arch_*register_cpu() exports

2023-11-07 Thread Russell King (Oracle)
arch_register_cpu() and arch_unregister_cpu() are not used by anything that can be a module - they are used by drivers/base/cpu.c and drivers/acpi/acpi_processor.c, neither of which can be a module. Remove the exports. Signed-off-by: Russell King (Oracle) --- arch/loongarch/kernel/topology.c |

[PATCH RFC 09/22] drivers: base: add arch_cpu_is_hotpluggable()

2023-11-07 Thread Russell King (Oracle)
The differences between architecture specific implementations of arch_register_cpu() are down to whether the CPU is hotpluggable or not. Rather than overriding the weak version of arch_register_cpu(), provide a function that can be used to provide this detail instead. Signed-off-by: Russell King (

[PATCH RFC 08/22] drivers: base: Implement weak arch_unregister_cpu()

2023-11-07 Thread Oracle
From: James Morse Add arch_unregister_cpu() to allow the ACPI machinery to call unregister_cpu(). This is enough for arm64, riscv and loongarch, but needs to be overridden by x86 and ia64 who need to do more work. CC: Jean-Philippe Brucker Signed-off-by: James Morse --- Changes since v1: * Ad

[PATCH RFC 07/22] drivers: base: Allow parts of GENERIC_CPU_DEVICES to be overridden

2023-11-07 Thread Oracle
From: James Morse Architectures often have extra per-cpu work that needs doing before a CPU is registered, often to determine if a CPU is hotpluggable. To allow the ACPI architectures to use GENERIC_CPU_DEVICES, move the cpu_register() call into arch_register_cpu(), which is made __weak so archi

[PATCH RFC 06/22] drivers: base: Use present CPUs in GENERIC_CPU_DEVICES

2023-11-07 Thread Oracle
From: James Morse Three of the five ACPI architectures create sysfs entries using register_cpu() for present CPUs, whereas arm64, riscv and all GENERIC_CPU_DEVICES do this for possible CPUs. Registering a CPU is what causes them to show up in sysfs. It makes very little sense to register all po

[PATCH RFC 11/22] drivers: base: remove unnecessary call to register_cpu_under_node()

2023-11-07 Thread Russell King (Oracle)
Since "drivers: base: Move cpu_dev_init() after node_dev_init()", we can remove some redundant code. node_dev_init() will walk through the nodes calling register_one_node() on each. This will trickle down to __register_one_node() which walks all present CPUs, calling register_cpu_under_node() on e

[PATCH RFC 10/22] drivers: base: Move cpu_dev_init() after node_dev_init()

2023-11-07 Thread Oracle
From: James Morse NUMA systems require the node descriptions to be ready before CPUs are registered. This is so that the node symlinks can be created in sysfs. Currently no NUMA platform uses GENERIC_CPU_DEVICES, meaning that CPUs are registered by arch code, instead of cpu_dev_init(). Move cpu

[PATCH RFC 05/22] ACPI: Move ACPI_HOTPLUG_CPU to be disabled on arm64 and riscv

2023-11-07 Thread Oracle
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

[PATCH RFC 12/22] drivers: base: Print a warning instead of panic() when register_cpu() fails

2023-11-07 Thread Oracle
From: James Morse loongarch, mips, parisc, riscv and sh all print a warning if register_cpu() returns an error. Architectures that use GENERIC_CPU_DEVICES call panic() instead. Errors in this path indicate something is wrong with the firmware description of the platform, but the kernel is able t

[PATCH RFC 14/22] arm64: convert to arch_cpu_is_hotpluggable()

2023-11-07 Thread Russell King (Oracle)
Convert arm64 to use the arch_cpu_is_hotpluggable() helper rather than arch_register_cpu(). Signed-off-by: Russell King (Oracle) --- arch/arm64/kernel/setup.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 1

[PATCH RFC 13/22] arm64: setup: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu()

2023-11-07 Thread Oracle
From: James Morse To allow ACPI's _STA value to hide CPUs that are present, but not available to online right now due to VMM or firmware policy, the register_cpu() call needs to be made by the ACPI machinery when ACPI is in use. This allows it to hide CPUs that are unavailable from sysfs. Switch

[PATCH RFC 15/22] x86/topology: Switch over to GENERIC_CPU_DEVICES

2023-11-07 Thread Oracle
From: James Morse Now that GENERIC_CPU_DEVICES calls arch_register_cpu(), which can be overridden by the arch code, switch over to this to allow common code to choose when the register_cpu() call is made. x86's struct cpus come from struct x86_cpu, which has no other members or users. Remove thi

[PATCH RFC 16/22] x86/topology: use weak version of arch_unregister_cpu()

2023-11-07 Thread Russell King (Oracle)
Since the x86 version of arch_unregister_cpu() is the same as the weak version, drop the x86 specific version. Signed-off-by: Russell King (Oracle) --- Changes since RFC v3: * Adapt to removal of EXPORT_SYMBOL()s --- arch/x86/kernel/topology.c | 5 - 1 file changed, 5 deletions(-) diff --g

[PATCH RFC 17/22] x86/topology: convert to use arch_cpu_is_hotpluggable()

2023-11-07 Thread Russell King (Oracle)
Convert x86 to use the arch_cpu_is_hotpluggable() helper rather than arch_register_cpu(). Signed-off-by: Russell King (Oracle) --- arch/x86/kernel/topology.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c index 2

[PATCH RFC 18/22] LoongArch: Switch over to GENERIC_CPU_DEVICES

2023-11-07 Thread Oracle
From: James Morse Now that GENERIC_CPU_DEVICES calls arch_register_cpu(), which can be overridden by the arch code, switch over to this to allow common code to choose when the register_cpu() call is made. This allows topology_init() to be removed. This is an intermediate step to the logic being

[PATCH RFC 19/22] LoongArch: Use the __weak version of arch_unregister_cpu()

2023-11-07 Thread Oracle
From: James Morse LoongArch provides its own arch_unregister_cpu(). This clears the hotpluggable flag, then unregisters the CPU. It isn't necessary to clear the hotpluggable flag when unregistering a cpu. unregister_cpu() writes NULL to the percpu cpu_sys_devices pointer, meaning cpu_is_hotplugg

[PATCH RFC 20/22] LoongArch: convert to use arch_cpu_is_hotpluggable()

2023-11-07 Thread Russell King (Oracle)
Convert loongarch to use the arch_cpu_is_hotpluggable() helper rather than arch_register_cpu(). Also remove the export as nothing should be using arch_register_cpu() outside of the core kernel/acpi code. Signed-off-by: Russell King (Oracle) --- arch/loongarch/kernel/topology.c | 7 ++- 1 fil

[PATCH RFC 21/22] riscv: Switch over to GENERIC_CPU_DEVICES

2023-11-07 Thread Oracle
From: James Morse Now that GENERIC_CPU_DEVICES calls arch_register_cpu(), which can be overridden by the arch code, switch over to this to allow common code to choose when the register_cpu() call is made. This allows topology_init() to be removed. This is an intermediate step to the logic being

[PATCH RFC 22/22] riscv: convert to use arch_cpu_is_hotpluggable()

2023-11-07 Thread Russell King (Oracle)
Convert riscv to use the arch_cpu_is_hotpluggable() helper rather than arch_register_cpu(). Signed-off-by: Russell King (Oracle) --- arch/riscv/kernel/setup.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index f8

Re: [RFC Draft net-next] docs: netdev: add section on using lei to manage netdev mail volume

2023-11-07 Thread Matthieu Baerts
Hi David, On 06/11/2023 17:57, David Wei wrote: > On 2023-11-06 03:24, Matthieu Baerts wrote: >> On 05/11/2023 19:50, David Wei wrote: >>> As a beginner to netdev I found the volume of mail to be overwhelming. I >>> only >>> want to focus on core netdev changes and ignore most driver changes. I

Re: [PATCH RFC 21/22] riscv: Switch over to GENERIC_CPU_DEVICES

2023-11-07 Thread Palmer Dabbelt
On Tue, 07 Nov 2023 02:31:06 PST (-0800), rmk+ker...@armlinux.org.uk wrote: From: James Morse Now that GENERIC_CPU_DEVICES calls arch_register_cpu(), which can be overridden by the arch code, switch over to this to allow common code to choose when the register_cpu() call is made. This allows t

Re: [PATCH RFC 22/22] riscv: convert to use arch_cpu_is_hotpluggable()

2023-11-07 Thread Palmer Dabbelt
On Tue, 07 Nov 2023 02:31:11 PST (-0800), rmk+ker...@armlinux.org.uk wrote: Convert riscv to use the arch_cpu_is_hotpluggable() helper rather than arch_register_cpu(). Signed-off-by: Russell King (Oracle) --- arch/riscv/kernel/setup.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-