Commit Graph
100 Commits
Author SHA1 Message Date
Jiri Denemark 241318232c domaincapstest: Test SUPPORTED_CPU_FEATURES flag
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:27 +02:00
Jiri Denemark 26ffa1d4f0 virsh: Add --supported-cpu-features option for domcapabilities
The option corresponds to the
VIR_CONNECT_GET_DOMAIN_CAPABILITIES_SUPPORTED_CPU_FEATURES API flag.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:27 +02:00
Jiri Denemark e1efd79e83 Introduce VIR_CONNECT_GET_DOMAIN_CAPABILITIES_SUPPORTED_CPU_FEATURES flag
Some CPU features may be enabled explicitly, but should not
automatically become part of a host-model CPU. Users can now request
such features to be shown in the host-model CPU in domain capabilities
by VIR_CONNECT_GET_DOMAIN_CAPABILITIES_SUPPORTED_CPU_FEATURES flag.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark 090183a7dc Fix documentation of VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES
The flag is designed for expanding the CPU model used by host-model. But
the documentation was sometimes describing it as showing all CPU
features supported on the host, which is wrong as the host may support
features that would not be enabled in host-model.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark 6be1be4938 cpu: Introduce virCPUUpdateFeatures
This new API can be used to update an existing CPU definition with
features described by CPU data.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark a8952076d8 cpu_x86: Introduce virCPUx86DataAddMSR
This just makes the relevant part of virCPUx86GetHost reusable in other
places.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark 3184289356 util: Publish and mock virHostCPUGetMSRFromKVM
The function will later be called when probing QEMU capabilities.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark ed3ae648a9 domaincapstest: Test EXPAND_CPU_FEATURES flag
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark 312000a739 qemu_capabilities: Cache expanded CPU
When probing host model CPU we already expand it to get a list of all
CPU features. Let's store the expanded CPU definition in virQEMUCaps and
copy it to domain capabilities when requested by the
VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES flag instead of
expanding the CPU over and over on each request.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark 8b4f56447f qemu_capabilities: Split conditions in virQEMUCapsInitHostCPUModel
Having 'else' after goto is useless.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark eca4c6672d qemu_capabilities: Use g_autoptr in virQEMUCapsInitHostCPUModel
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark 003b573108 qemu_capabilities: Always sort features in host-model CPU
Expanding a CPU model always produces a sorted list of features so the
features in host-model CPU capabilities were either sorted or not
depending on flags passed to virConnectGetDomainCapabilities.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark b4d3572198 qemu: Move domain caps flags handling to virQEMUCapsFillDomainCPUHostModel
We will need to generate the capabilities in a different way based on
the flags.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark 354ac21cab qemu_capabilities: Split virQEMUCapsFillDomainCPUCaps
Each CPU mode is filled in its own dedicated function.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark 0900cc4f2d cpu_conf: Introduce virCPUDefSortFeatures
Separate the sorting code from virCPUExpandFeatures into a standalone
function.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-06-02 13:45:26 +02:00
Jiri Denemark 7047652806 Post-release version bump to 12.5.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-06-01 12:24:27 +02:00
Jiri Denemark eb0b2e768d Release of libvirt-12.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-06-01 12:21:48 +02:00
Jiri Denemark 200deed341 po: Refresh potfile for v12.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-05-25 22:51:15 +02:00
Jiri Denemark 5d5bb2059d cpu_map: Add DiamondRapids CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:45 +02:00
Jiri Denemark 5e7d3b55f7 cpu_map: Add new versions of GraniteRapids CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:45 +02:00
Jiri Denemark 4ae7955658 cpu_map: Add new versions of SapphireRapids CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:44 +02:00
Jiri Denemark dcce6b51a3 cpu_map: Add new versions of SierraForest CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:44 +02:00
Jiri Denemark 6926bccb52 cpu_map: Add new versions of ClearwaterForest CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:44 +02:00
Jiri Denemark d0e1632694 sync_qemu_models_i386: Add missing features to translation map
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:44 +02:00
Jiri Denemark f08fb5bead cpu_map: Add APX (Advanced Performance Extensions) CPUID features
QEMU commit 60caf14339262b10423e21b1d7d39ad7edec82b7

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:44 +02:00
Jiri Denemark eaed785ca6 cpu_map: Add avx10-vnni-int CPU feature
QEMU commit 24a9bc108840812dfb94edc65962c1998120f77b

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:44 +02:00
Jiri Denemark c8f5ed5a87 cpu_map: Add CPUID feature for MOVRS
QEMU commit f8e830300c9edeaa142fe4cc244d63770a3be4f5

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:44 +02:00
Jiri Denemark 48b6e58997 cpu_map: Add CET related CPU features
QEMU commit 2f25476ae7f3b4c28fde64584a04734b14c8fd37

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:44 +02:00
Jiri Denemark a34f2e6908 cpu_map: Add CPUID features for AMX instructions
The features are reported in a 0x1 subleaf of 0x1e CPUID leaf.

QEMU commit 956b8f0fc38a5ead18d9bf5ceba0861627738835 (some feature were
later renamed by 85dc6147e79140f17b7e4333ec14f302bf9b5e97, which
happened in the same QEMU release so we don't need to care about the
original names).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:44 +02:00
Jiri Denemark 907fb23ace cpu_map: Add gmet and vmx-mbec features for nested virtualization
QEMU commits 746a823a17f25393cc8c0cd1257f6dcef757bc09 and
bfff4b2ae5452463ab8c14b4a8a020288b5ff5d8

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:44 +02:00
Jiri Denemark 4067d5114e sync_qemu_models_i386: Convert family/model to decimal
QEMU defines some CPU models with hexadecimal family, but our CPU map
loading code expects decimals.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:44 +02:00
Jiri Denemark 8714547349 sync_qemu_models_i386: Remove forgotten parentheses
children variable is a list returned by getchildren().

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:43 +02:00
Jiri Denemark eb98cb1a4c Post-release version bump to 12.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-05-02 00:06:30 +02:00
Jiri Denemark 8212539877 Release of libvirt-12.3.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-05-02 00:02:41 +02:00
Jiri Denemark aedba84fb7 po: Refresh potfile for v12.3.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-04-24 17:17:18 +02:00
Jiri Denemark bfb70fba59 Post-release version bump to 12.3.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-04-01 09:41:48 +02:00
Jiri Denemark 93a00a3db8 Release of libvirt-12.2.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-04-01 09:37:13 +02:00
Jiri Denemark f5868958e4 NEWS: Mention VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-03-31 15:11:06 +02:00
Jiri Denemark f590a18da6 po: Refresh potfile for v12.2.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-03-26 13:37:04 +01:00
Jiri Denemark 0b54c9d535 docs: Clarify host-model description in domain capabilities
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-03-11 14:03:59 +01:00
Jiri Denemark 57e5bb55ce virsh: Add --expand-cpu-features option for domcapabilities
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-03-11 14:03:59 +01:00
Jiri Denemark 3215fee349 qemu: Implement VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-03-11 14:03:59 +01:00
Jiri Denemark 8aa13d1b16 Introduce EXPAND_CPU_FEATURES flag for domain capabilities
The new VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES flag for
virConnectGetDomainCapabilities can be used to request the host-model
CPU definition to include all supported features (normally only extra
features relative to the selected CPU model are listed).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-03-11 14:03:59 +01:00
Jiri Denemark d704458b31 Post-release version bump to 12.2.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-03-02 10:27:06 +01:00
Jiri Denemark 6f0df1af01 Release of libvirt-12.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-03-02 10:22:43 +01:00
Jiri Denemark 3d1e6d92de qemu: Fix job handling when domain dies in post-copy migration
When a domain is in post-copy migration phase, we need to keep the job
active if something fails to protect the domain from changes.
Unfortunately, there is a race between migration code and
qemuProcessStop that can cause the job to stay active even when the
domain is gone and thus preventing the domain from being started again
(until virtqemud is restarted). The race is caused by unlocking the vm
object when calling virConnectUnregisterCloseCallback. While the domain
is unlocked qemuProcessStop can finish its work and the domain may no
longer be active when we get the lock back. The post-copy path does not
properly check if a domain is still active.

Instead of adding the virDomainObjIsActive check in all places where
this could happen, we can add it in virDomainObjIsPostcopy and
virDomainObjIsFailedPostcopy and let the code take the pre-copy cleanup
path. Clearly an inactive domain can never be in (failed) post-copy
migration.

https://issues.redhat.com/browse/RHEL-145179

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-02-25 13:44:40 +01:00
Jiri Denemark 634b40ccab po: Refresh potfile for v12.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-02-24 13:59:36 +01:00
Jiri Denemark 3ea0a44f7a qemu: Report error aborting stopped postcopy migration
When virDomainAbortJob is called with VIR_DOMAIN_ABORT_JOB_POSTCOPY flag
and the post-copy migration of the domain is already stopped (either
because of a failure or previous call to virDomainAbortJob), the
migrate-pause QMP command fails with "migrate-pause is currently only
supported during postcopy-active or postcopy-recover state". Such error
might be confusing to end users especially when we mark it as an
internal error. Let's not call the QMP command at all and report a
clear error message instead.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-19 14:19:30 +01:00
Jiri Denemark bdcf0c35bb Post-release version bump to 12.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-01-15 10:12:36 +01:00
Jiri Denemark 4d93728466 Release of libvirt-12.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-01-15 10:07:59 +01:00
Jiri Denemark 0ad017a6de NEWS: Mention shared FS detection race
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-01-14 16:21:57 +01:00
Jiri Denemark 0355b2d05a po: Refresh potfile for v12.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2026-01-09 11:53:11 +01:00
Jiri Denemark c9f45792b7 virfiletest: Fix build on non-Linux
Fixes: 121d179e06
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-12-10 13:12:07 +01:00
Jiri Denemark eedf9ed68b util: Rework virFileIsSharedFSOverride using virFileCheckParents
The newly introduced virFileCheckParents is generic enough to be used
for checking whether a specific path or any of its parents is included
in the overrides array.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-12-10 12:40:15 +01:00
Jiri Denemark 3a44f0c23d util: Fix race condition in virFileIsSharedFSOverride
Switch virFileIsSharedFSOverride to use virFileCheckParents to avoid a
race which could result in virFileCanonicalizePath to be called on a
path that does not exist anymore.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-12-10 12:40:15 +01:00
Jiri Denemark b6addd42be util: Fix race condition in virFileIsSharedFSType
virFileIsSharedFSType could end up calling statfs on a path that no
longer exists and return an error. If this happens for a path on a
shared filesystem, the caller may incorrectly consider the path as
non-shared.

Specifically, when starting a domain with TPM enabled and deciding
whether its vTPM state is stored on a shared storage, the race could
cause qemuTPMEmulatorBuildCommand to consider the state to be
non-shared. This means swtpm would be started without --migration even
when the state is actually stored on a shared storage and any attempt to
migrate such domain would fail with

    Operation not supported: the running swtpm does not support
    migration with shared storage

In fact, any caller of virFileGetExistingParent contained an inherent
TOCTOU race condition as the existing parent of a given path return by
virFileGetExistingParent may no longer exist at the time the caller
wants to check it.

This patch introduces a new virFileCheckParents API which is almost
identical to virFileGetExistingParent, but uses a supplied callback to
check each path. This new API is used in virFileIsSharedFSType to avoid
the race. The old function will later be completely removed once all
callers are switched to the new one.

Fixes: 05526b5090
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-12-10 12:40:14 +01:00
Jiri Denemark 121d179e06 tests: Test virFileIsSharedFSOverride
Technically virFileIsSharedFSOverride is available on any OS, but we
need a mocked realpath() to test it. Because the virfilemock library
also mocks statfs() which is only available on Linux, we don't even try
to load the library anywhere else. Thus we need to skip testing
virFileIsSharedFSOverride on non-Linux too.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-12-10 12:40:14 +01:00
Jiri Denemark 6a3fe7f7e0 spec: Fix RPM build when %{fedora} is undefined
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-12-01 13:27:40 +01:00
Jiri Denemark fce7fabd53 Post-release version bump to 12.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-12-01 11:59:59 +01:00
Jiri Denemark cd16a1e913 Release of libvirt-11.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-12-01 11:57:01 +01:00
Jiri Denemark 54f3472d72 formatdomaincaps: Fix typo in Hyper-V Enlightenments section
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-28 14:56:29 +01:00
Jiri Denemark e60c21fc3f NEWS: Fix incoming migration to QEMU 10.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-28 14:56:19 +01:00
Jiri Denemark faa5c69899 po: Refresh potfile for v11.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-25 13:10:14 +01:00
Jiri Denemark afafb2a28b cpu_map: Add YongFeng-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark a6000b20ba cpu_map: Add YongFeng-v2 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 98b4609b51 cpu_map: Add YongFeng CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark db80641510 cpu_map: Add features used by Zhaoxin YongFeng Processor
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 56ee1bfb7a cpu_map: Add Zhaoxin CentaurHauls CPU vendor
Zhaoxin uses two distinct vendor IDs. This patch is adding one of them
used by Zhaoxin YongFeng Processor.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark ee95c9d7d1 cpu_map: Add EPYC-Turin CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark f37126bc55 cpu_map: Add EPYC-Milan-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 0fcde0edc5 cpu_map: Add EPYC-v5 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark d2925f23e7 cpu_map: Add EPYC-Rome-v5 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 7e8f1698c7 cpu_map: Add EPYC-Genoa-v2 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark dec859cb66 cpu_map: Add ClearwaterForest CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark b8d830ff54 cpu_map: Add GraniteRapids-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark cbc2f8e2b3 cpu_map: Add SapphireRapids-v4 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark bd43aa4cbb cpu_map: Add SierraForest-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 64143828d7 cpu_map: Add SierraForest-v2 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 189d7b64ac cputest: Add data for AMD Ryzen 9 9950X 16-Core CPU
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 034f02d25c cputest: Add data for Intel(R) Xeon(R) 6788P CPU
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark b7c92ce918 cputest: Read more MSRs in cpu-data.py
The features defined in our CPU map use quite a bit more than just the
two MSRs the script is currently trying to read. Let's read all of them
to get complete host CPU data.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark a3395fb598 cputest: Ignore missing MSRs in cpu-data.py
The current code made sense when we were reading only one MSR, but since
we started reading more MSRs, the host CPU would have to support all of
them otherwise the function would just return an empty dict.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 21c61bee36 sync_qemu_models_i386: Support adding models to an empty group
When adding a new CPU vendor, we create a new empty group in
src/cpu_map/index.xml and want to use the sync_qemu_models_i386.py
script to add models there.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark d3888c470a sync_qemu_models_i386: Handle unknown features in GraniteRapids-v2
The GraniteRapids-v2 uses quite a few CPU features unknown to this
script.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark b74b452f8a sync_qemu_models_i386: Print current model for unknown features
This way one can just grep for all warnings in the script output and
still be able to see for which CPU model is defined using features the
script doesn't know about.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 58972035bd sync_qemu_models_i386: Fix typo in CPUID_8000_0021_EAX_No_NESTED_DATA_BP
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 96df5805fd cpu_map: Fix ordering of CPU models in meson.build
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark a86973056a cpu_map: Add feature for detecting Indirect Target Selection immunity
QEMU commit 74978391b2da0116b9109d52931f342118d5a122

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 81c20d2c32 cpu_map: Add feature for detecting Branch History Injection immunity
QEMU commit b611931d4f70b9a3e49e39c405c63b3b5e9c0df1

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Jiri Denemark c80b283277 cpu_map: Add features for Transient Scheduler Attacks mitigation
QEMU commits d8ec0baf4a15082cdc4abe1de28face9a26f0dc9 and
c79a35acadee784610aed40134a12738381b4fba

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Jiri Denemark b72758d62a cpu_map: Add a few missing features to 0x80000021 CPUID leaf
QEMU commit dfd5b456108a75588ab094358ba5754787146d3d

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Jiri Denemark 819ce69b38 cpu_map: Add msr-imm CPU feature
QEMU commit 91084f3b44b1da4935eec85b79c1f97d1c140ada

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Jiri Denemark ba16113c76 qemu: Ignore "ht" CPU feature
The feature does not do anything, QEMU will always set it according to
the CPU topology completely ignoring what we asked for. Unfortunately,
the way the state of "ht" is reported changed in QEMU 10.0.0 (commit
c6bd2dd634208).

QEMU older than 10.0.0 would just report whatever was specified on the
command line totally ignoring the actual state of the feature visible to
a guest. But after the change QEMU reports ht=on in case it enabled "ht"
based on the CPU topology. In all other cases QEMU still reports the
state requested on the command line.

As a result of this change a domain with multiple CPU threads started on
QEMU < 10.0.0 could not be migrated to QEMU >= 10.0.0 unless "ht" was
explicitly enabled in the domain XML because libvirt would see "ht"
enabled on the destination, but disabled on the source (the guest would
see "ht" enabled in both cases anyway). Outgoing migration of domains
started on QEMU >= 10.0.0 is not affected.

To fix this issue we can completely ignore "ht" both in the domain XML
and in the CPU properties reported by QEMU. With this fix incoming
migration to QEMU >= 10.0.0 works again.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/821
Fixes: https://issues.redhat.com/browse/RHEL-104216
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark 4d5c1bc241 qemu_monitor: Filter CPU features reported by QEMU
Some features may be on our ignore list because they do nothing even
though QEMU still supports them and reports their state. But as the
features do nothing, the state reported by QEMU may not correspond to
what the guest sees. To avoid possible confusion we may just pretend
QEMU did not report any of the features on our ignore list.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark c15ae99dab qemu_process: Always fix CPUs on reconnect
We fix CPUs (i.e., remove ignored CPU features) only when libvirt/QEMU
combo used to start the domain is very old and doesn't support
query-cpu-model-expansion, in which case the CPU definition may contain
features that are unknown to QEMU. But even if both libvirt and QEMU are
new enough, we still want to remove features that do nothing to minimize
confusion or to avoid false migration issues.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark 2ab6925218 qemu_domain: Fix qemuDomainFixupCPUs
The function was apparently created when the list of ignored CPU
features contained just cmt and related features. The list grew quite a
bit since then and this function stopped making sense as it would remove
all ignored features from CPU definitions but only if cmt was present.
The issue with cmt is long gone and this function was not really doing
anything. Surprisingly this didn't cause any real issues as we don't
update CPU definitions with features unknown to QEMU. But we may still
want to remove ignored features even though QEMU knows about them for
compatibility reasons.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark fbf44bc8cf qemu_domain: Simplify qemuDomainFixupCPUs
Since virCPUDefFilterFeatures never fails, we can use it for in-place
modifications instead of modifying a temporary virCPUDef copy.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark fd6cf1b44a cpu_conf: Make virCPUDefFilterFeatures return void
The only thing that can fail inside virCPUDefFilterFeatures is
VIR_DELETE_ELEMENT_INPLACE macro. The macro just calls
virDeleteElementsN, which reports a warning when all elements to be
removed are not within the array bounds and returns -1. The function
succeeds otherwise. But since VIR_DELETE_ELEMENT_INPLACE sets the number
of elements to be removed to 1 and we call it with i < cpu->nfeatures,
the safety check in virDeleteElementsN will never fail. And even if we
theoretically called it with wrong arguments, it just wouldn't do
anything.

Thus we can safely assume VIR_DELETE_ELEMENT_INPLACE always succeeds in
virCPUDefFilterFeatures and avoid reporting any errors to simplify
callers.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark 3c7e44d3c8 Post-release version bump to 11.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-03 12:29:58 +01:00
Jiri Denemark 91f3e8b667 Release of libvirt-11.9.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-03 12:26:40 +01:00