Re: [PATCH RFC v4 01/15] ACPI: Only enumerate enabled (or functional) processor devices

2024-01-31 Thread Miguel Luis
Hi > On 31 Jan 2024, at 15:49, Russell King wrote: > > From: James Morse > > Today the ACPI enumeration code 'visits' all devices that are present. > > This is a problem for arm64, where CPUs are always present, but not > always enabled. When a device-check occurs because the firmware-policy

[PATCH RFC v4 14/15] arm64: document virtual CPU hotplug's expectations

2024-01-31 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 Reviewed-by: Jonathan Cameron Signed-off-by: Russell King (Oracle) --- Outstanding

[PATCH RFC v4 13/15] ACPI: add support to (un)register CPUs based on the _STA enabled bit

2024-01-31 Thread Oracle
From: James Morse acpi_processor_get_info() registers all present CPUs. Registering a CPU is what creates the sysfs entries and triggers the udev notifications. arm64 virtual machines that support 'virtual cpu hotplug' use the enabled bit to indicate whether the CPU can be brought online, as

[PATCH RFC v4 15/15] cpumask: Add enabled cpumask for present CPUs that can be brought online

2024-01-31 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

[PATCH RFC v4 05/15] ACPI: Add post_eject to struct acpi_scan_handler for cpu hotplug

2024-01-31 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

[PATCH RFC v4 06/15] ACPI: convert acpi_processor_post_eject() to use IS_ENABLED()

2024-01-31 Thread Russell King (Oracle)
Rather than ifdef'ing acpi_processor_post_eject() and its use site, use IS_ENABLED() to increase compile coverage. Reviewed-by: Jonathan Cameron Signed-off-by: Russell King (Oracle) --- drivers/acpi/acpi_processor.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

[PATCH RFC v4 12/15] arm64: psci: Ignore DENIED CPUs

2024-01-31 Thread Oracle
From: Jean-Philippe Brucker When a CPU is marked as disabled, but online capable in the MADT, PSCI applies some firmware policy to control when it can be brought online. PSCI returns DENIED to a CPU_ON request if this is not currently permitted. The OS can learn the current policy from the _STA

[PATCH RFC v4 11/15] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs

2024-01-31 Thread Oracle
From: James Morse To support virtual CPU hotplug, ACPI has added an 'online capable' bit to the MADT GICC entries. This indicates a disabled CPU entry may not be possible to online via PSCI until firmware has set enabled bit in _STA. This means that a "usable" GIC is one that is marked as

[PATCH RFC v4 04/15] ACPI: Rename acpi_processor_hotadd_init and remove pre-processor guards

2024-01-31 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 RFC v4 10/15] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc()

2024-01-31 Thread Oracle
From: James Morse gic_acpi_match_gicc() is only called via gic_acpi_count_gicr_regions(). It should only count the number of enabled redistributors, but it also tries to sanity check the GICC entry, currently returning an error if the Enabled bit is set, but the gicr_base_address is zero.

[PATCH RFC v4 08/15] ACPI: Warn when the present bit changes but the feature is not enabled

2024-01-31 Thread Oracle
From: James Morse ACPI firmware can trigger the events to add and remove CPUs, but the OS may not support this. Print an error message when this happens. This gives early warning on arm64 systems that don't support CONFIG_ACPI_HOTPLUG_PRESENT_CPU, as making CPUs not present has side effects

[PATCH RFC v4 09/15] arm64: acpi: Move get_cpu_for_acpi_id() to a header

2024-01-31 Thread Oracle
From: James Morse ACPI identifies CPUs by UID. get_cpu_for_acpi_id() maps the ACPI UID to the linux CPU number. The helper to retrieve this mapping is only available in arm64's numa code. Move it to live next to get_acpi_id_for_cpu(). Signed-off-by: James Morse Reviewed-by: Jonathan Cameron

[PATCH RFC v4 07/15] ACPI: Check _STA present bit before making CPUs not present

2024-01-31 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

[PATCH RFC v4 01/15] ACPI: Only enumerate enabled (or functional) processor devices

2024-01-31 Thread Oracle
From: James Morse Today the ACPI enumeration code 'visits' all devices that are present. This is a problem for arm64, where CPUs are always present, but not always enabled. When a device-check occurs because the firmware-policy has changed and a CPU is now enabled, the following error occurs: |

[PATCH RFC v4 03/15] ACPI: Move acpi_bus_trim_one() before acpi_scan_hot_remove()

2024-01-31 Thread Oracle
From: James Morse A subsequent patch will change acpi_scan_hot_remove() to call acpi_bus_trim_one() instead of acpi_bus_trim(), meaning it can no longer rely on the prototype in the header file. Move these functions further up the file. No change in behaviour. Signed-off-by: James Morse

[PATCH RFC v4 02/15] ACPI: processor: Register all CPUs from acpi_processor_get_info()

2024-01-31 Thread Oracle
From: James Morse To allow ACPI to skip the call to arch_register_cpu() when the _STA value indicates the CPU can't be brought online right now, move the arch_register_cpu() call into acpi_processor_get_info(). Systems can still be booted with 'acpi=off', or not include an ACPI description at

[RFC PATCH v4 00/15] ACPI/arm64: add support for virtual cpu hotplug

2024-01-31 Thread Russell King (Oracle)
Hi, This is another iteration of the Arm64 virtual CPU hotplug support, updated for the review comments on the v3 smaller series posted back in December. I believe all feedback has been addressed - if I have missed something then please accept my apologies. Several patches have been dropped from