From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Mykyta Poturai <Mykyta_Poturai@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger@xenproject.org>,
"Stefano Stabellini" <sstabellini@kernel.org>
Subject: Re: [PATCH v11 6/6] docs: Document CPU hotplug
Date: Mon, 9 Nov 2026 23:38:43 +0000 [thread overview]
Message-ID: <87se19d18d.fsf@epam.com> (raw)
In-Reply-To: <b29769962099a9d5ff14b879b87a588ed2e96665.1794222015.git.mykyta_poturai@epam.com> (Mykyta Poturai's message of "Mon, 9 Nov 2026 11:12:49 +0000")
Hi,
Mykyta Poturai <Mykyta_Poturai@epam.com> writes:
> Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> ---
> 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
prev parent reply other threads:[~2026-11-09 23:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 11:12 [PATCH v11 0/6] Implement CPU hotplug on Arm Mykyta Poturai
2026-11-09 11:12 ` [PATCH v11 1/6] arm/irq: Keep track of irq affinities Mykyta Poturai
2026-11-09 11:12 ` [PATCH v11 3/6] Kconfig: Make cpu hotplug configurable Mykyta Poturai
2026-11-09 11:12 ` [PATCH v11 2/6] arm/irq: Migrate IRQs during CPU up/down operations Mykyta Poturai
2026-11-09 11:12 ` [PATCH v11 5/6] tools: Allow building xen-hptool without CONFIG_MIGRATE Mykyta Poturai
2026-11-09 11:12 ` [PATCH v11 4/6] arm/sysctl: Implement cpu hotplug ops Mykyta Poturai
2026-11-09 12:42 ` Jan Beulich
2026-11-09 23:33 ` Volodymyr Babchuk
2026-11-09 11:12 ` [PATCH v11 6/6] docs: Document CPU hotplug Mykyta Poturai
2026-11-09 23:38 ` Volodymyr Babchuk [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87se19d18d.fsf@epam.com \
--to=volodymyr_babchuk@epam.com \
--cc=Mykyta_Poturai@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger@xenproject.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.