[PATCH 02/39] ACPI: Use the acpi_device_is_present() helper in more places

2023-10-24 Thread Oracle
: Miguel Luis Signed-off-by: Russell King (Oracle) --- drivers/acpi/scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 691d4b7686ee..ed01e19514ef 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -304,7 +304,7

[PATCH 03/39] ACPI: Rename acpi_scan_device_not_present() to be about enumeration

2023-10-24 Thread Oracle
should be renamed. It was only ever about enumeration, rename it acpi_scan_device_not_enumerated(). No change in behaviour is intended. Signed-off-by: James Morse Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- drivers/acpi/scan.c | 8 1 file changed, 4 insertions(+), 4

[PATCH 04/39] arm64, irqchip/gic-v3, ACPI: Move MADT GICC enabled check into a helper

2023-10-24 Thread Oracle
-by: James Morse Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Remove unnecessary parens * Moved earlier in series --- arch/arm64/kernel/smp.c | 2 +- drivers/acpi/processor_core.c | 2 +- drivers/irqchip/irq-gic-

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

2023-10-24 Thread Oracle
-by: Jonathan Cameron Signed-off-by: Russell King (Oracle) --- drivers/base/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 9ea22e165acd..34b48f660b6b 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -533,7 +533,7

[PATCH 08/39] drivers: base: Move cpu_dev_init() after node_dev_init()

2023-10-24 Thread Oracle
cpu_dev_init() after node_dev_init() so that NUMA architectures can use GENERIC_CPU_DEVICES. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- Note: Jonathan's comment still needs addressing - see https://lore.kernel.org/r/20230914121612.6...@huawei.com --- drivers

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

2023-10-24 Thread Oracle
architectures with extra work can override it. This aligns with the way x86, ia64 and loongarch register hotplug CPUs when they become present. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- Changes since RFC: * Dropped __init from x86/ia64 arch_register_cpu() Changes since RFC

[PATCH 11/39] arm64: setup: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu()

2023-10-24 Thread Oracle
on of CPUs from subsys to driver core initialisation, prior to any initcalls running. Signed-off-by: James Morse Reviewed-by: Russell King (Oracle) Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Add note about initialisation order change. --- arch/arm64/Kconfig

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

2023-10-24 Thread Oracle
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/loon

[PATCH 12/39] ia64/topology: Switch over to GENERIC_CPU_DEVICES

2023-10-24 Thread Oracle
ls running. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Add note about initialisation order change. --- arch/ia64/Kconfig | 1 + arch/ia64/include/asm/cpu.h | 6 -- arch/ia64/kernel/topology.c | 35 +-

[PATCH 10/39] drivers: base: Print a warning instead of panic() when register_cpu() fails

2023-10-24 Thread Oracle
to keep running. Downgrade this to a warning to make it easier to debug this issue. This will allow architectures that switching over to GENERIC_CPU_DEVICES to drop their warning, but keep the existing behaviour. Signed-off-by: James Morse Reviewed-by: Russell King (Oracle) Signed-off-by

[PATCH 18/39] ACPI: Only enumerate enabled (or functional) devices

2023-10-24 Thread Oracle
ctional devices that are not enabled. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- If this change causes problems on deployed hardware, I suggest an arch opt-in: ACPI_IGNORE_STA_ENABLED, that causes acpi_dev_ready_for_enumeration() to only check the present bit. Changes

[PATCH 19/39] ACPI: processor: Add support for processors described as container packages

2023-10-24 Thread Oracle
From: James Morse ACPI has two ways of describing processors in the DSDT. Either as a device object with HID ACPI0007, or as a type 'C' package inside a Processor Container. The ACPI processor driver probes CPUs described as devices, but not those described as packages. Duplicate descriptions ar

[PATCH 16/39] riscv: Switch over to GENERIC_CPU_DEVICES

2023-10-24 Thread Oracle
Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Add note about initialisation order change. --- arch/riscv/Kconfig| 1 + arch/riscv/kernel/setup.c | 19 --- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv

[PATCH 13/39] x86: intel_epb: Don't rely on link order

2023-10-24 Thread Oracle
fragile. Moving the register_cpu() to a different subsys_initcall() leads to a NULL dereference during boot. Make intel_epb_init() a late_initcall(), user-space can't provide a policy before this point anyway. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- subsys_initcall

[PATCH 14/39] x86/topology: Switch over to GENERIC_CPU_DEVICES

2023-10-24 Thread Oracle
ation, prior to any initcalls running. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) Changes since RFC: * Fixed the second copy of arch_register_cpu() used for non-hotplug Changes since RFC v2: * Remove duplicate of the weak generic arch_register_cpu(), spotted by Jon

[PATCH 17/39] arch_topology: Make register_cpu_capacity_sysctl() tolerant to late CPUs

2023-10-24 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 15/39] LoongArch: Switch over to GENERIC_CPU_DEVICES

2023-10-24 Thread Oracle
initialisation, prior to any initcalls running. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Explain the change in behaviour in the patch description (highlighted by Jonathan Cameron - thanks.) Add note about initialisation order change

[PATCH 20/39] ACPI: processor: Register CPUs that are online, but not described in the DSDT

2023-10-24 Thread Oracle
less cpu-hotplug is configured. Signed-off-by: James Morse Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- drivers/acpi/acpi_processor.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/acpi/acpi_processor.c b/drive

[PATCH 21/39] ACPI: processor: Register all CPUs from acpi_processor_get_info()

2023-10-24 Thread Oracle
description at all. For these, the CPUs continue to be registered by cpu_dev_register_generic(). This moves the CPU register logic back to a subsys_initcall(), while the memory nodes will have been registered earlier. Signed-off-by: James Morse Reviewed-by: Gavin Shan Signed-off-by: Russe

[PATCH 23/39] drivers: base: Implement weak arch_unregister_cpu()

2023-10-24 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 24/39] ACPI: Move acpi_bus_trim_one() before acpi_scan_hot_remove()

2023-10-24 Thread Oracle
Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- drivers/acpi/scan.c | 76 ++--- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 06e9bb4a633f

[PATCH 25/39] ACPI: Rename acpi_processor_hotadd_init and remove pre-processor guards

2023-10-24 Thread Oracle
From: James Morse acpi_processor_hotadd_init() will make a CPU present by mapping it based on its hardware id. 'hotadd_init' is ambiguous once there are two different behaviours for cpu hotplug. This is for toggling the _STA present bit. Subsequent patches will add support for toggling the _STA

[PATCH 22/39] ACPI: Rename ACPI_HOTPLUG_CPU to include 'present'

2023-10-24 Thread Oracle
is is only about the ACPI mechanism. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Add Loongarch update --- arch/ia64/Kconfig | 2 +- arch/ia64/include/asm/acpi.h | 2 +- arch/ia64/kernel/a

[PATCH 27/39] ACPI: Check _STA present bit before making CPUs not present

2023-10-24 Thread Oracle
From: James Morse When called acpi_processor_post_eject() unconditionally make a CPU not-present and unregisters it. To add support for AML events where the CPU has become disabled, but remains present, the _STA method should be checked before calling acpi_processor_remove(). Rename acpi_proces

[PATCH 26/39] ACPI: Add post_eject to struct acpi_scan_handler for cpu hotplug

2023-10-24 Thread Oracle
From: James Morse struct acpi_scan_handler has a detach callback that is used to remove a driver when a bus is changed. When interacting with an eject-request, the detach callback is called before _EJ0. This means the ACPI processor driver can't use _STA to determine if a CPU has been made not-p

[PATCH 28/39] ACPI: Warn when the present bit changes but the feature is not enabled

2023-10-24 Thread Oracle
fects for other parts of the system. Signed-off-by: James Morse Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Update commit message with suggestion from Gavin Shan --- drivers/acpi/acpi_processor.c | 8 ++-- 1 file ch

[PATCH 29/39] LoongArch: Use the __weak version of arch_unregister_cpu()

2023-10-24 Thread Oracle
aning cpu_is_hotpluggable() will return false, as get_cpu_device() has returned NULL. Remove arch_unregister_cpu() and use the __weak version. Signed-off-by: James Morse Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- arch/loongarch/kernel/topology.

[PATCH 35/39] ACPI: add support to register CPUs based on the _STA enabled bit

2023-10-24 Thread Oracle
nabled bit, the CPU can be registered and brought online by user-space. Online CPUs, or CPUs that are missing an _STA method must always be registered. Signed-off-by: James Morse Reviewed-by: Gavin Shan Reviewed-by: Jonathan Cameron Signed-off-by: Russell King (Oracle) --- drivers/acpi/acpi_p

[PATCH 30/39] arm64: acpi: Move get_cpu_for_acpi_id() to a header

2023-10-24 Thread Oracle
meron Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- arch/arm64/include/asm/acpi.h | 11 +++ arch/arm64/kernel/acpi_numa.c | 11 --- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h

[PATCH 39/39] ACPI: processor: Only call arch_unregister_cpu() if HOTPLUG_CPU is selected

2023-10-24 Thread Oracle
From: James Morse The kbuild robot points out that configurations without HOTPLUG_CPU selected can try to build acpi_processor_post_eject() without success as arch_unregister_cpu() is not defined. Check this explicitly. This will be merged into: | ACPI: Add post_eject to struct acpi_scan_handler

[PATCH 38/39] cpumask: Add enabled cpumask for present CPUs that can be brought online

2023-10-24 Thread Oracle
From: James Morse The 'offline' file in sysfs shows all offline CPUs, including those that aren't present. User-space is expected to remove not-present CPUs from this list to learn which CPUs could be brought online. CPUs can be present but not-enabled. These CPUs can't be brought online until t

[PATCH 37/39] ACPI: Add _OSC bits to advertise OS support for toggling CPU present/enabled

2023-10-24 Thread Oracle
From: James Morse Platform firmware can disabled a CPU, or make it not-present by making an eject-request notification, then waiting for the os to make it offline and call _EJx. After the firmware updates _STA with the new status. Not all operating systems support this. For arm64 making CPUs not

[PATCH 31/39] ACPICA: Add new MADT GICC flags fields

2023-10-24 Thread Oracle
From: James Morse Add the new flag field to the MADT's GICC structure. 'Online Capable' indicates a disabled CPU can be enabled later. See ACPI specification 6.5 Tabel 5.37: GICC CPU Interface Flags. Signed-off-by: James Morse --- This patch probably needs to go via the upstream acpica project

[PATCH 36/39] arm64: document virtual CPU hotplug's expectations

2023-10-24 Thread Oracle
From: James Morse Add a description of physical and virtual CPU hotplug, explain the differences and elaborate on what is required in ACPI for a working virtual hotplug system. Signed-off-by: James Morse --- Documentation/arch/arm64/cpu-hotplug.rst | 79 Documentation/

[PATCH 33/39] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs

2023-10-24 Thread Oracle
code believes the CPU is present and possible, but it does not have an accessible redistributor. Print a warning and clear the present and possible bits. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) Disabled but online-capable CPUs cause this message to be printed if their red

[PATCH 34/39] arm64: psci: Ignore DENIED CPUs

2023-10-24 Thread Oracle
enabled bit. Handle the PSCI DENIED return code gracefully instead of printing an error. See https://developer.arm.com/documentation/den0022/f/?lang=en page 58. Signed-off-by: Jean-Philippe Brucker [ morse: Rewrote commit message ] Signed-off-by: James Morse Signed-off-by: Russell King (Oracle

[PATCH 32/39] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc()

2023-10-24 Thread Oracle
gic_populate_rdist(), which helpfully also prints what went wrong: | CPU4: mpidr 100 has no re-distributor! Signed-off-by: James Morse Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- drivers/irqchip/irq-gic-v3.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff

[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
fragile. Moving the register_cpu() to a different subsys_initcall() leads to a NULL dereference during boot. Make intel_epb_init() a late_initcall(), user-space can't provide a policy before this point anyway. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- subsys_initcall

[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
architectures with extra work can override it. This aligns with the way x86, ia64 and loongarch register hotplug CPUs when they become present. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- Changes since RFC: * Dropped __init from x86/ia64 arch_register_cpu() Changes since RFC

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

2023-11-07 Thread Oracle
-by: Jonathan Cameron Signed-off-by: Russell King (Oracle) --- drivers/base/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 9ea22e165acd..34b48f660b6b 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -533,7 +533,7

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

2023-11-07 Thread Oracle
cpu_dev_init() after node_dev_init() so that NUMA architectures can use GENERIC_CPU_DEVICES. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- Note: Jonathan's comment still needs addressing - see https://lore.kernel.org/r/20230914121612.6...@huawei.com --- drivers

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

2023-11-07 Thread Oracle
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. Changes since RFC v3: * Dropped ia64 changes --

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

2023-11-07 Thread Oracle
to keep running. Downgrade this to a warning to make it easier to debug this issue. This will allow architectures that switching over to GENERIC_CPU_DEVICES to drop their warning, but keep the existing behaviour. Signed-off-by: James Morse Reviewed-by: Russell King (Oracle) Signed-off-by

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

2023-11-07 Thread Oracle
on of CPUs from subsys to driver core initialisation, prior to any initcalls running. Signed-off-by: James Morse Reviewed-by: Russell King (Oracle) Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Add note about initialisation order change. --- arch/arm64/Kconfig

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

2023-11-07 Thread Oracle
ation, prior to any initcalls running. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) Changes since RFC: * Fixed the second copy of arch_register_cpu() used for non-hotplug Changes since RFC v2: * Remove duplicate of the weak generic arch_register_cpu(), spotted by Jon

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

2023-11-07 Thread Oracle
initialisation, prior to any initcalls running. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Explain the change in behaviour in the patch description (highlighted by Jonathan Cameron - thanks.) Add note about initialisation order change

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

2023-11-07 Thread Oracle
aning cpu_is_hotpluggable() will return false, as get_cpu_device() has returned NULL. Remove arch_unregister_cpu() and use the __weak version. Signed-off-by: James Morse Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- Changes since RFC v3: * Adapt for remov

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

2023-11-07 Thread Oracle
Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Add note about initialisation order change. --- arch/riscv/Kconfig| 1 + arch/riscv/kernel/setup.c | 19 --- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv

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

2023-11-21 Thread Oracle
te by mechanisms like hotplug. One observable difference is the file is now missing for offline CPUs. Signed-off-by: James Morse Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- If the offline CPUs thing is a problem for the tools that consume this value, we'd need to move cpu_capa

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

2023-11-21 Thread Oracle
fragile. Moving the register_cpu() to a different subsys_initcall() leads to a NULL dereference during boot. Make intel_epb_init() a late_initcall(), user-space can't provide a policy before this point anyway. Signed-off-by: James Morse Reviewed-by: Gavin Shan Signed-off-by: Russell King (O

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

2023-11-21 Thread Oracle
d-off-by: James Morse Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- drivers/base/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 9ea22e165acd..34b48f660b6b 100644 --- a/dri

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

2023-11-21 Thread Oracle
architectures with extra work can override it. This aligns with the way x86, ia64 and loongarch register hotplug CPUs when they become present. Signed-off-by: James Morse Reviewed-by: Shaoqin Huang Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- Changes since RFC: * Dropped __init

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

2023-11-21 Thread Oracle
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) --- Changes since RFC: * Expanded conditions to avoid ACPI_HOTPLUG_CPU being enabled when HOTPLUG_CPU isn

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

2023-11-21 Thread Oracle
Signed-off-by: Russell King (Oracle) --- An open question remains from the RFC v2 posting: should we provide a __weak stub for !HOTPLUG_CPU as well, since in later patches ACPI may reference this if the compiler doesn't optimise as we expect? Changes since v1: * Added CONFIG_HOTPLU

[PATCH 11/21] drivers: base: Print a warning instead of panic() when register_cpu() fails

2023-11-21 Thread Oracle
to keep running. Downgrade this to a warning to make it easier to debug this issue. This will allow architectures that switching over to GENERIC_CPU_DEVICES to drop their warning, but keep the existing behaviour. Signed-off-by: James Morse Reviewed-by: Russell King (Oracle) Reviewed-by: Shaoqin

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

2023-11-21 Thread Oracle
cpu_dev_init() after node_dev_init() so that NUMA architectures can use GENERIC_CPU_DEVICES. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) --- Note: Jonathan's comment still needs addressing - see https://lore.kernel.org/r/20230914121612.6...@huawei.com --- drivers

[PATCH 12/21] arm64: setup: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu()

2023-11-21 Thread Oracle
on of CPUs from subsys to driver core initialisation, prior to any initcalls running. Signed-off-by: James Morse Reviewed-by: Russell King (Oracle) Reviewed-by: Shaoqin Huang Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Add note about initialisation

[PATCH 14/21] x86/topology: Switch over to GENERIC_CPU_DEVICES

2023-11-21 Thread Oracle
ation, prior to any initcalls running. Signed-off-by: James Morse Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) Changes since RFC: * Fixed the second copy of arch_register_cpu() used for non-hotplug Changes since RFC v2: * Remove duplicate of the weak generic arch_registe

[PATCH 17/21] LoongArch: Switch over to GENERIC_CPU_DEVICES

2023-11-21 Thread Oracle
initialisation, prior to any initcalls running. Signed-off-by: James Morse Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Explain the change in behaviour in the patch description (highlighted by Jonathan Cameron - thanks.) Add note about

[PATCH 18/21] LoongArch: Use the __weak version of arch_unregister_cpu()

2023-11-21 Thread Oracle
aning cpu_is_hotpluggable() will return false, as get_cpu_device() has returned NULL. Remove arch_unregister_cpu() and use the __weak version. Signed-off-by: James Morse Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- Changes since RFC v3: * Adapt for remov

[PATCH 20/21] riscv: Switch over to GENERIC_CPU_DEVICES

2023-11-21 Thread Oracle
Acked-by: Palmer Dabbelt Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Add note about initialisation order change. --- arch/riscv/Kconfig| 1 + arch/riscv/kernel/setup.c | 19 --- 2 files changed, 5 insertions(+), 15 deletions

[RFC PATCH v3 00/39] ACPI/arm64: add support for virtual cpuhotplug

2023-10-24 Thread Russell King (Oracle)
Hi, I'm posting James' patch set updated with most of the review comments from his RFC v2 series back in September. Individual patches have a changelog attached at the bottom of the commit message. Those which I have finished updating have my S-o-b on them, those which still have outstanding revie

[PATCH 01/39] parisc: simplify smp_prepare_boot_cpu()

2023-10-24 Thread Russell King (Oracle)
ince kernel/cpu.c::boot_cpu_init() already sets CPU 0 to be present and online, there is no need to do this again in smp_prepare_boot_cpu(). Remove this code, and simplify the printk(). Signed-off-by: Russell King (Oracle) --- arch/parisc/kernel/smp.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletio

[PATCH 09/39] drivers: base: remove unnecessary call to register_cpu_under_node()

2023-10-24 Thread Russell King (Oracle)
be removed. Signed-off-by: Russell King (Oracle) --- drivers/base/node.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/base/node.c b/drivers/base/node.c index 493d533f8375..4d5ac7cf8757 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -867,7 +867

Re: [PATCH 38/39] cpumask: Add enabled cpumask for present CPUs that can be brought online

2023-10-24 Thread Russell King (Oracle)
On Tue, Oct 24, 2023 at 06:02:30PM +0200, Greg Kroah-Hartman wrote: > On Tue, Oct 24, 2023 at 04:19:24PM +0100, Russell King wrote: > > From: James Morse > > > > The 'offline' file in sysfs shows all offline CPUs, including those > > that aren't present. User-space is expected to remove not-prese

Re: [RFC PATCH v3 00/39] ACPI/arm64: add support for virtual cpuhotplug

2023-10-24 Thread Russell King (Oracle)
On Tue, Oct 24, 2023 at 04:15:28PM +0100, Russell King (Oracle) wrote: > Hi, > > I'm posting James' patch set updated with most of the review comments > from his RFC v2 series back in September. Individual patches have a > changelog attached at the bottom of the commit

Re: [RFC PATCH v3 00/39] ACPI/arm64: add support for virtual cpuhotplug

2023-10-24 Thread Russell King (Oracle)
On Tue, Oct 24, 2023 at 08:26:58PM +0200, Rafael J. Wysocki wrote: > On Tue, Oct 24, 2023 at 5:15 PM Russell King (Oracle) > wrote: > > > > Hi, > > > > I'm posting James' patch set updated with most of the review comments > > from his RFC v2 serie

Re: [RFC PATCH v3 00/39] ACPI/arm64: add support for virtual cpuhotplug

2023-10-30 Thread Russell King (Oracle)
On Mon, Oct 30, 2023 at 04:41:19PM +, Miguel Luis wrote: > Hi Russell, > > Tested on QEMU, based on Salil's RFC v2 [1], running with KVM. > - boot > - hotplug up to 'maxcpus' > - hotunplug down to the number of boot cpus > - hotplug vcpus and migrate with vcpus offline > - hotplug vcpus and mi

[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 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)
(Oracle) --- drivers/base/cpu.c | 11 ++- include/linux/cpu.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 58bb86091b34..221ffbeb1c9b 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -527,9 +527,18

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

2023-11-07 Thread Russell King (Oracle)
be removed. Signed-off-by: Russell King (Oracle) --- drivers/base/node.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/base/node.c b/drivers/base/node.c index 493d533f8375..4d5ac7cf8757 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -867,7 +867

[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

[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

[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

[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

[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

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

2023-11-09 Thread Russell King (Oracle)
On Thu, Nov 09, 2023 at 06:09:32PM +0800, Shaoqin Huang wrote: > Hi Russell, > > On 11/7/23 18:29, Russell King (Oracle) wrote: > > From: James Morse > > > > Three of the five ACPI architectures create sysfs entries using > > register_cpu() for present C

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

2023-11-13 Thread Russell King (Oracle)
On Mon, Nov 13, 2023 at 10:58:46AM +1000, Gavin Shan wrote: > > > On 11/7/23 20:30, Russell King (Oracle) wrote: > > From: James Morse > > > > NUMA systems require the node descriptions to be ready before CPUs are > > registered. This is so that the node

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

2023-11-13 Thread Russell King (Oracle)
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 > > > > Neither arm64 nor riscv support physical hotadd of CPUs that were not > > present at boot. For arm64 much of the platform descript

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

2023-11-15 Thread Russell King (Oracle)
On Mon, Nov 13, 2023 at 02:04:32PM +1000, Gavin Shan wrote: > On 11/7/23 20:30, Russell King (Oracle) wrote: > > Since "drivers: base: Move cpu_dev_init() after node_dev_init()", we > > can remove some redundant code. > > > > node_dev_init() will walk throug

Re: [PATCH 34/39] arm64: psci: Ignore DENIED CPUs

2023-11-20 Thread Russell King (Oracle)
On Thu, Nov 16, 2023 at 07:45:51AM +, Jianyong Wu wrote: > Hi Russell, > > One inline comment. ... > > Changes since RFC v2 > > * Add specification reference > > * Use EPERM rather than EPROBE_DEFER ... > > @@ -40,7 +40,7 @@ static int cpu_psci_cpu_boot(unsigned int cpu) { > > phys_addr

Re: [PATCH 34/39] arm64: psci: Ignore DENIED CPUs

2023-11-20 Thread Russell King (Oracle)
On Mon, Nov 20, 2023 at 09:36:05AM +, Jianyong Wu wrote: > > > > -Original Message- > > From: Russell King > > Sent: 2023年11月20日 17:25 > > To: Jianyong Wu > > Cc: linux...@vger.kernel.org; loonga...@lists.linux.dev; > > linux-a...@vger.kernel.org; linux-a...@vger.kernel.org; > > lin

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

2023-11-21 Thread Russell King (Oracle)
On Mon, Nov 13, 2023 at 08:00:19AM +, Russell King (Oracle) wrote: > On Mon, Nov 13, 2023 at 10:58:46AM +1000, Gavin Shan wrote: > > > > > > On 11/7/23 20:30, Russell King (Oracle) wrote: > > > From: James Morse > > > > > > NUMA systems requi

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

2023-11-21 Thread Russell King (Oracle)
On Tue, Nov 07, 2023 at 10:29:59AM +, Russell King wrote: > 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: Je

[PATCH 00/21] Initial cleanups for vCPU hotplug

2023-11-21 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 04/21] Loongarch: remove arch_*register_cpu() exports

2023-11-21 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. Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- arch

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

2023-11-21 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. Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- arch/x86

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

2023-11-21 Thread Russell King (Oracle)
Signed-off-by: Russell King (Oracle) --- drivers/base/cpu.c | 11 ++- include/linux/cpu.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 58bb86091b34..221ffbeb1c9b 100644 --- a/drivers/base/cpu.c +++ b/drivers/base

[PATCH 13/21] arm64: convert to arch_cpu_is_hotpluggable()

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

[PATCH 15/21] x86/topology: use weak version of arch_unregister_cpu()

2023-11-21 Thread Russell King (Oracle)
Since the x86 version of arch_unregister_cpu() is the same as the weak version, drop the x86 specific version. Reviewed-by: Gavin Shan 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

[PATCH 16/21] x86/topology: convert to use arch_cpu_is_hotpluggable()

2023-11-21 Thread Russell King (Oracle)
Convert x86 to use the arch_cpu_is_hotpluggable() helper rather than arch_register_cpu(). Reviewed-by: Gavin Shan 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

[PATCH 19/21] LoongArch: convert to use arch_cpu_is_hotpluggable()

2023-11-21 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. Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- arch/loongarch/kernel

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

2023-11-21 Thread Russell King (Oracle)
Convert riscv to use the arch_cpu_is_hotpluggable() helper rather than arch_register_cpu(). Acked-by: Palmer Dabbelt Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- arch/riscv/kernel/setup.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/riscv

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

2023-11-28 Thread Russell King (Oracle)
On Tue, Nov 28, 2023 at 02:37:22PM +, Jonathan Cameron wrote: > On Tue, 07 Nov 2023 10:29:23 + > Russell King wrote: > > > 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 a

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

2023-11-28 Thread Russell King (Oracle)
to a NULL dereference during boot. > > > > Make intel_epb_init() a late_initcall(), user-space can't provide a > > policy before this point anyway. > > > > Signed-off-by: James Morse > > Signed-off-by: Russell King (Oracle) > > Seems reasonabl

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

2023-11-30 Thread Russell King (Oracle)
On Tue, Nov 28, 2023 at 03:11:15PM +, Jonathan Cameron wrote: > On Tue, 07 Nov 2023 10:30:30 + > "Russell King (Oracle)" wrote: > > > Convert arm64 to use the arch_cpu_is_hotpluggable() helper rather than > > arch_register_cpu(). > > > > Sig

  1   2   >