[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v11 6/6] docs: Document CPU hotplug


  • To: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Mon, 9 Nov 2026 23:38:43 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=i4cLwG16XlNpnDiz/wJYHhlpRGZpYfEKm9hcM0WWfs4=; b=CMhywG8pShtz2AxV8O34pe4e2IN+F1RmPOtxU2WQDaI+8k/PPWoNPgyYHpjCHj8gMIW52S7fHjC8FgVtGNI/Tb+dj/2hkVy1d/p+67V8Axyw2rZr68GvNQ7hKn6IhOeQtoes8x+TcCYLvjaCy332hxaNTXiQff6MyHb0VmsLKueTxLX5OYvGw8P2cb5O8sAXIfjkJ5pKvnUme6exvly3OBqFCPNuQ5thsrn7ThIREmOyCAxcyfvDgauyAjaaZdZjbSAbz43NDw6TSmMLV1SaLaMhTU5LaLgPTmz6p/tO3PmZkQvs05LWKd/lmZEVMsbW7mJU+DP0shAAknRLqkImDA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Hzu5/F2Dulbond2Qm7ss47ExxGnkWNzsfTdb+Qcd0G/zlbn8pf6pKMJyWz7aUxTp/1lm27n6Uu51qf4mpBzaCMXqWFoegfK1L0U95605nTNeJufNlxRlwv6JpTvBj8UbQn8BanGPC/jhbcU8FLg41V7qxQft53XpRn+od7nIkZNgKRepHoUQiaxK5U6nT6elST6x3AmaL9gkKy6aDIDX/6Tp2pmxUU7oULiHa2MYZeOboeAJOZU4pPkAN+w9SOduHynUa/9i8Ybnx9HWD//yJLYfWHuot8AYY/SC3nY3jv2PN9sIWsJfIh/1yhRuhdU+he+tlUtgCBovUwXqFxA0+A==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 09 Nov 2026 23:38:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHdcDtO8MUZhkc6jkm6vG/XjR44FQ==
  • Thread-topic: [PATCH v11 6/6] docs: Document CPU hotplug

Hi,

Mykyta Poturai <Mykyta_Poturai@xxxxxxxx> writes:

> Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>

Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>

> ---
> v10->v11:
> * sync with latest changes
>
> v9->v10:
> * explain the actual ITS incompatibility
> * say FFA and TEE are incompatible, matching the Kconfig dependency
>
> v8->v9:
> * no changes
>
> v7->v8:
> * remove support status update
> * update config option name
>
> v6->v7:
> * add testing and limitations
>
> v5->v6:
> * no changes
>
> v4->v5:
> * s/supported/implemented/
> * update SUPPORT.md
>
> v3->v4:
> * update configuration section
>
> v2->v3:
> * patch introduced
> ---
>  docs/misc/cpu-hotplug.txt | 102 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 102 insertions(+)
>  create mode 100644 docs/misc/cpu-hotplug.txt
>
> diff --git a/docs/misc/cpu-hotplug.txt b/docs/misc/cpu-hotplug.txt
> new file mode 100644
> index 0000000000..e1b474ca69
> --- /dev/null
> +++ b/docs/misc/cpu-hotplug.txt
> @@ -0,0 +1,102 @@
> +CPU Hotplug
> +===========
> +
> +CPU hotplug is a feature that allows pCPU cores to be added to or removed 
> from a
> +running system without requiring a reboot. It is implemented on x86 and Arm64
> +architectures.
> +
> +Implementation Details
> +----------------------
> +
> +CPU hotplug is implemented through the `XEN_SYSCTL_CPU_HOTPLUG_*` sysctl 
> calls.
> +The specific calls are:
> +
> +- `XEN_SYSCTL_CPU_HOTPLUG_ONLINE`: Brings a pCPU online
> +- `XEN_SYSCTL_CPU_HOTPLUG_OFFLINE`: Takes a pCPU offline
> +- `XEN_SYSCTL_CPU_HOTPLUG_SMT_ENABLE`: Enables SMT threads (x86 only)
> +- `XEN_SYSCTL_CPU_HOTPLUG_SMT_DISABLE`: Disables SMT threads (x86 only)
> +
> +All cores can be disabled, assuming hardware support, except for the boot 
> core.
> +Sysctl calls are routed to the boot core before doing any actual up/down
> +operations on other cores.
> +
> +If there are Xen-bound interrupts pinned to the pCPU being offlined, they 
> will
> +be automatically migrated to other online pCPUs. Interrupts used by guest
> +domains are handled by the scheduler when it reschedules the vCPUs to a new,
> +online, pCPU. When a pCPU is being onlined, some Xen-bound interrupts will 
> get
> +redistributed to the newly onlined pCPU to prevent imbalance.
> +
> +If pCPU being offlined has some vCPUs pinned to it, they will be 
> automatically
> +unpinned and migrated to other online pCPUs.
> +
> +Limitations
> +-----------
> +
> +On Arm64 cpu hotplug is currently not compatible with the ITS: the per-CPU 
> LPI
> +pending table and GICR_CTLR.EnableLPIs are set up once at boot and are not
> +re-usable, so onlining a pCPU a second time fails.
> +
> +On Arm64 it is also not compatible with the FFA and TEE mediators, as both 
> use
> +non-static IRQ actions.
> +
> +Configuration
> +-------------
> +
> +CPU hotplug support in Xen is controlled by the CONFIG_CPU_ONLINE_OFFLINE
> +Kconfig option, which requires EXPERT and depends on HAS_CPU_ONLINE_OFFLINE.
> +HAS_CPU_ONLINE_OFFLINE is selected by x86, and by Arm64 when neither ITS nor
> +TEE support is enabled. The option is enabled by default on x86 and disabled
> +by default on Arm64.
> +
> +The xen-hptool userspace tool is built unconditionally.
> +
> +Usage
> +-----
> +
> +Disable core:
> +
> +$ xen-hptool cpu-offline 2
> +Prepare to offline CPU 2
> +(XEN) Removing cpu 2 from runqueue 0
> +CPU 2 offlined successfully
> +
> +Enable core:
> +
> +$ xen-hptool cpu-online 2
> +Prepare to online CPU 2
> +(XEN) Bringing up CPU2
> +(XEN) GICv3: CPU2: Found redistributor in region 0 @00000a004005c000
> +(XEN) CPU2: Guest atomics will try 1 times before pausing the domain
> +(XEN) CPU 2 booted.
> +(XEN) Adding cpu 2 to runqueue 0
> +CPU 2 onlined successfully
> +
> +Disabling a core with pinned vCPUs:
> +
> +$ xl vcpu-pin 0 3 3 3
> +$ xl vcpu-pin 0 2 3 3
> +$ xl vcpu-pin 0 1 3 3
> +$ xl vcpu-pin 0 0 3 3
> +$ xen-hptool cpu-offline 3
> +Prepare to offline CPU 3
> +(XEN) Breaking affinity for d0v0
> +(XEN) Breaking affinity for d0v1
> +(XEN) Breaking affinity for d0v2
> +(XEN) Breaking affinity for d0v3
> +(XEN) Removing cpu 3 from runqueue 0
> +CPU 3 offlined successfully
> +
> +Testing
> +-------
> +
> +The CPU hotplug feature has been tested on both x86 and Arm64 QEMU setups 
> and on
> +R-Car Gen5 (Arm64) hardware.
> +
> +The tests included:
> +- Offlining and onlining cores with no pinned vCPUs
> +- Offlining cores with pinned vCPUs
> +- Offlining cores with Xen-bound interrupts
> +- Offlining all cores except the boot core
> +- Offlining the boot core (expected to fail)
> +- Enabling and disabling SMT threads (x86 only)
> +- Offlining cores to which guests with passthrough devices are pinned

-- 
WBR, Volodymyr

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.