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

[PATCH v4 8/8] docs: Document CPU hotplug


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Wed, 12 Nov 2025 10:51:49 +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=W8D5Acrs8dUv0P8H4kunal5LzEZVvHwHaF8eBKEKwHc=; b=gQZMiOibJzHMUO/AXruTFoClKBj68mMPD36LnS6Q3kZPwRnupYRqY9FSN2tG/p0A1/zSMtii+tXqnJpZtILfp7n2qgALnsDEdkGp0FT7HvUJwg3ckxswrDxC6MtFifL7ge5z+qhq5ermuMMvCQqJkYXeiR5EvJLZ9utVHO3Sv1kEaPKyeIT9fyJYxOGBJamBzPtgg44QPN/DNfbR0YQDL2/Mdu2TUCT+ruiNPcAyzg9K7ixE0h9quvVlgJRMnkd89mwRXuOqiNkoa/k0Giy/Nim7p0q0p5+B0fobWSZf2L2zxzPCxGm5SqYZ+MSXFniIw6VyJoAjJt6PXstLgOwTPg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZGa8XjVjnp2FzFUSBZ8QyJOOuBVhe0oD6NXEz9TrS0x+QEJ5ArGth4xhGfojKktN3PS+leW3dnAXbdsSvmWTZaSOiVh+L7wUQQiZDaPlILkZS311MyUGLkOP59QC0kQdQiAcBB24oCxMlbTaah7ivPTo07ixYG6vHIqOVK/e0BWm8hNshFwdSwg5c9g7FZuAvtr2pqA27JKeq5I83H5S7QW2S6nHmEnoDEqQAB09OP/Cnx8RzoYjDh9iicghk7o4Cz9OgYfRMk5tumV399DKUc3SVjkx4TATo3bMngqN9m6Ug5c4HNMtLTlkgwKYrgxRtdF41YDGvx+pV2ECsCIMYg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>, 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.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 12 Nov 2025 10:51:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcU8JZkVRIhtuRGUSqQZ7RQo1TrQ==
  • Thread-topic: [PATCH v4 8/8] docs: Document CPU hotplug

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

v3->v4:
* update configuration section

v2->v3:
* patch introduced
---
 docs/misc/cpu-hotplug.txt | 51 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 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..1fbad0ecf7
--- /dev/null
+++ b/docs/misc/cpu-hotplug.txt
@@ -0,0 +1,51 @@
+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 supported 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 core 0. Sysctl
+calls are routed to core 0 before doing any actual up/down operations on other
+cores.
+
+Configuration
+-------------
+
+Sysctl handlers are enabled unconditionally on x86 architecture. On Arm64,
+handlers are enabled by default when ITS, FFA, and TEE configs are disabled.
+Building of the userspace tool "hptool" is controlled by the "hptool" flag in
+the configure script. It is enabled by default and can be disabled with
+--disable-hptool command line option.
+
+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
-- 
2.51.2



 


Rackspace

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