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 v9 6/6] docs: Document CPU hotplug
Date: Tue, 22 Sep 2026 01:13:31 +0000 [thread overview]
Message-ID: <87bj9q84w5.fsf@epam.com> (raw)
In-Reply-To: <70484b3362f3b816bf4ed5f70c374c198a8a6eea.1787042017.git.mykyta_poturai@epam.com> (Mykyta Poturai's message of "Tue, 18 Aug 2026 08:48:31 +0000")
Hi,
Mykyta Poturai <Mykyta_Poturai@epam.com> writes:
I have a couple of questions, please see below
> Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
> ---
> v8->v9:
> * fix typos
>
> 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 | 98 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 98 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..4f6068db30
> --- /dev/null
> +++ b/docs/misc/cpu-hotplug.txt
> @@ -0,0 +1,98 @@
> +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 ITS, due to an issue with
> +the redistributor assignment.
In this case you probably want to make sure that
CONFIG_CPU_ONLINE_OFFLINE is incompatible with CONFIG_HAS_ITS
> +
> +On Arm64 there can be problems with FFA if secure FW supports the notification
> +ABI, and with TEE, as both use non-static IRQ actions.
Could you please elaborate on this? AFAIK, OP-TEE has own
cpu_up/cpu_down callbacks, so it should know which CPUs are online.
> +
> +Configuration
> +-------------
> +
> +The presence of the feature is controlled by CONFIG_CPU_ONLINE_OFFLINE option.
> +It is enabled by default on x86 architecture. On Arm64, the option is disabled
> +by default and marked as EXPERT. 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
next prev parent reply other threads:[~2026-09-22 1:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 8:48 [PATCH v9 0/6] Implement CPU hotplug on Arm Mykyta Poturai
2026-08-18 8:48 ` [PATCH v9 1/6] arm/irq: Keep track of irq affinities Mykyta Poturai
2026-08-18 8:48 ` [PATCH v9 2/6] arm/irq: Migrate IRQs during CPU up/down operations Mykyta Poturai
2026-09-22 0:59 ` Volodymyr Babchuk
2026-09-22 1:01 ` Volodymyr Babchuk
2026-08-18 8:48 ` [PATCH v9 4/6] arm/sysctl: Implement cpu hotplug ops Mykyta Poturai
2026-08-18 9:07 ` Jan Beulich
2026-08-18 8:48 ` [PATCH v9 3/6] Kconfig: Make cpu hotplug configurable Mykyta Poturai
2026-08-18 8:48 ` [PATCH v9 5/6] tools: Allow building xen-hptool without CONFIG_MIGRATE Mykyta Poturai
2026-09-09 9:00 ` Anthony PERARD
2026-08-18 8:48 ` [PATCH v9 6/6] docs: Document CPU hotplug Mykyta Poturai
2026-09-22 1:13 ` Volodymyr Babchuk [this message]
2026-10-08 8:48 ` Mykyta Poturai
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=87bj9q84w5.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.