public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Jonas Theisen <j.theisen@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH docs v4 7/7] qm: document hv-reenlightenment and invtsc
Date: Wed,  2 Dec 2026 18:45:24 +0100	[thread overview]
Message-ID: <20261202174530.565487-8-j.theisen@proxmox.com> (raw)
In-Reply-To: <20261202174530.565487-1-j.theisen@proxmox.com>

Explain what the new 'hv-reenlightenment' CPU flag is for, that guests
only use it together with 'hv-frequencies', and that custom CPU types
with 'invtsc' can now be live migrated. As both restrict live
migration to nodes with a compatible TSC frequency, add this to the
refused live migrations, and document which running VMs need to be
stopped and started first.

Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
 qm.adoc | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/qm.adoc b/qm.adoc
index 3856b31..0eea939 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -571,6 +571,19 @@ listings, `Mapping.Modify` gates create/update/delete in the panel, and
 enforced on VM create, VM update, and VM clone, so a user who can clone a VM
 that uses a custom model still needs `Mapping.Use` on that model's ACL path.
 
+Custom CPU types can enable the invariant time stamp counter (TSC) flag
+`invtsc`, which guests need to use the TSC as clock source, for example for
+nested hypervisors or applications that read it directly. The host CPU must have
+an invariant TSC as well. Otherwise, QEMU refuses to start the VM, or starts it
+without the flag if the CPU type is based on `host`. Except for confidential
+VMs, {pve} sets the TSC frequency of such VMs to the one of the host they are
+started on, as QEMU requires it for live migration, snapshots including RAM, and
+hibernation. This restricts live migration to nodes with a compatible TSC
+frequency, see <<qm_migration,Migration>>. VMs started without an explicit TSC
+frequency, for example before an update, must be stopped and started again
+before they can be live migrated. A `-cpu` option in the `args` of a VM replaces
+the CPU generated by {pve}, so it must set `tsc-frequency` itself or be removed.
+
 [[qm_meltdown_spectre]]
 Meltdown / Spectre related CPU flags
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -699,6 +712,17 @@ guests on recent Intel hardware:
   only applies for x86_64 vCPUs; it is silently ignored on other
   architectures.
 
+Windows guests running nested Hyper-V, for example with WSL2 or
+virtualization-based security enabled, can pass a stable clock source on to
+their own guests if the VM has the `hv-reenlightenment` flag and the
+`hv-frequencies` flag, which custom CPU types can enable. As for `invtsc`, {pve}
+sets an explicit TSC frequency for VMs with `hv-reenlightenment`, because KVM
+does not fully implement its notifications about TSC frequency changes. With the
+CPU types `host` and `max`, this also passes through the `invtsc` flag of the
+host CPU, so the target node of a live migration must support it as well. If a
+custom CPU type enabled `hv-reenlightenment` before an update, stop and start
+the VM before migrating it, as its live migration can otherwise fail at the end.
+
 
 NUMA
 ^^^^
@@ -1879,6 +1903,11 @@ if the VM cannot run there:
    of the CPU type.
 ** All VMs require a node that supports their Hyper-V enlightenments, which
    {pve} enables for Windows guests.
+** VMs with an explicit TSC frequency, as set for the `invtsc` and
+   `hv-reenlightenment` CPU flags, require a node that supports TSC scaling, or
+   whose TSC frequency differs from the VM's by at most 250 ppm of its own.
+** VMs with the `invtsc` CPU flag that were started without an explicit TSC
+   frequency cannot be live migrated until they are stopped and started again.
 --
 +
 These checks only apply to VMs that use KVM hardware virtualization. The
-- 
2.47.3





      parent reply	other threads:[~2026-12-02 17:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 17:45 [PATCH docs/qemu-server v4 0/7] live migrate VMs with an invariant TSC or re-enlightenment Jonas Theisen
2026-12-02 17:45 ` [PATCH qemu-server v4 1/7] helpers: add helper to query the host's TSC frequency and scaling support Jonas Theisen
2026-12-02 17:45 ` [PATCH qemu-server v4 2/7] migrate: allow CPU checks that only need information of the target Jonas Theisen
2026-12-02 17:45 ` [PATCH qemu-server v4 3/7] cpu config: add hv-reenlightenment flag and set TSC frequency for it Jonas Theisen
2026-12-02 17:45 ` [PATCH qemu-server v4 4/7] migrate: block migration to nodes that cannot provide the TSC frequency Jonas Theisen
2026-12-02 17:45 ` [PATCH qemu-server v4 5/7] cpu flags: report invtsc support of nodes Jonas Theisen
2026-12-02 17:45 ` [PATCH qemu-server v4 6/7] cpu config: set TSC frequency for invtsc to allow live migration Jonas Theisen
2026-12-02 17:45 ` Jonas Theisen [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=20261202174530.565487-8-j.theisen@proxmox.com \
    --to=j.theisen@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal