On 13.11.25 17:49, Grygorii Strashko wrote:
>
>
> On 12.11.25 12:51, Mykyta Poturai wrote:
>> Implement XEN_SYSCTL_CPU_HOTPLUG_{ONLINE,OFFLINE} calls to allow for
>> enabling/disabling CPU cores in runtime.
>>
>> For now this operations only support Arm64. For proper Arm32 support,
>> there needs to be a mechanism to free per-cpu page tables, allocated in
>> init_domheap_mappings.
>> Also, hotplug is not supported if ITS, FFA, or TEE is enabled, as they
>> use non-static IRQ actions.
>>
>> Create a Kconfig option RUNTIME_CPU_CONTROL that reflects this
>> constraints.
>>
>> Signed-off-by: Mykyta Poturai <[email protected]>
>>
>> v3->v4:
>> * don't reimplement cpu_up/down helpers
>> * add Kconfig option
>> * fixup formatting
>>
>> v2->v3:
>> * no changes
>>
>> v1->v2:
>> * remove SMT ops
>> * remove cpu == 0 checks
>> * add XSM hooks
>> * only implement for 64bit Arm
>> ---
>> xen/arch/arm/Kconfig | 4 ++++
>> xen/arch/arm/sysctl.c | 32 ++++++++++++++++++++++++++++++++
>> 2 files changed, 36 insertions(+)
>>
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index cf6af68299..931ae51575 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -274,6 +274,10 @@ config PCI_PASSTHROUGH
>> help
>> This option enables PCI device passthrough
>> +config RUNTIME_CPU_CONTROL
>> + def_bool y
>> + depends on ARM_64 && !TEE && !FFA && !HAS_ITS
>> +
>
> Having it in arch code I think right as Arch can have own deps
> (Linux does it this way), but name has to be fixed and documented (docs).
>
> may be more common name HOTPLUG_CPU (like in linux)?
> naming is up to you.
>
I will change the config name to "CPU_HOTPLUG" in the next version if
everyone is okay with that.
--
Mykyta