cpu_map: Drop vmx-ept-{uc,wb} features from CPU models

Although QEMU knows and enables the corresponding MSR bits, it does not
allow users to configure them (there are no names attached to them).
They should have never been added to the CPU map and definitely not to
CPU models as the features will always be considered disabled regardless
on their actual state as QEMU will not report them.

While we cannot drop them completely for backward compatibility, we can
at least remove them from all CPU models.

This is effectively no change for CPU models where the features were
marked with added='yes' because migration source would always remove the
features from domain XML so not adding them to the live XML does not
hurt. On the other side the destination could not ever be surprised by
the features being suddenly enabled as QEMU never reports them, which
means libvirt considers them disabled all the time.

GraniteRapids CPU model is the only one which contains the feature ever
since it was introduced in libvirt, but it was never possible to migrate
a domain with such CPU. The source would always mark vmx-ept-wb as
disabled and the destination without the fixes in this series would drop
the feature from the XML completely as it is unsupported by QEMU and
disabled, but when probing for the actual CPU created by QEMU libvirt
would expect the feature to be enabled (as it is included in the CPU
model and not explicitly mentioned in the domain definition) and fail
the migration. There's nothing the source could do to workaround the
behavior on the destination and migration to older libvirt will still be
broken. But it's possible to migrate a domain with GraniteRapids to a
destination with this series applied from both old and new source.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jiri Denemark 2024-10-08 12:26:45 +02:00
parent 29aa9b02aa
commit b1d4196580
33 changed files with 2 additions and 34 deletions

View File

@ -70,8 +70,6 @@ FEATURES_EXTRA = {
18: "cvt16",
},
(0x0000048c,): {
8: "vmx-ept-uc",
14: "vmx-ept-wb",
41: "vmx-invvpid-single-context", # wrong name in qemu
43: "vmx-invvpid-single-context-noglobals", # wrong name in qemu
}

View File

@ -278,8 +278,6 @@ def translate_feature(name):
"MSR_VMX_EPT_EXECONLY": "vmx-ept-execonly",
"MSR_VMX_EPT_PAGE_WALK_LENGTH_4": "vmx-page-walk-4",
"MSR_VMX_EPT_PAGE_WALK_LENGTH_5": "vmx-page-walk-5",
"MSR_VMX_EPT_UC": "vmx-ept-uc",
"MSR_VMX_EPT_WB": "vmx-ept-wb",
"MSR_VMX_EPT_2MB": "vmx-ept-2mb",
"MSR_VMX_EPT_1GB": "vmx-ept-1gb",
"MSR_VMX_EPT_INVEPT": "vmx-invept",
@ -307,6 +305,7 @@ def translate_feature(name):
name in ("CPUID_EXT_MONITOR", "monitor"),
name in ("MSR_VMX_BASIC_DUAL_MONITOR", "dual-monitor"),
name in ("CPUID_EXT3_TOPOEXT", "topoext"),
name in ("MSR_VMX_EPT_UC", "MSR_VMX_EPT_WB"),
])
if ignore:

View File

@ -78,7 +78,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -76,7 +76,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -75,7 +75,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -77,7 +77,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -89,7 +89,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -91,7 +91,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>

View File

@ -100,7 +100,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -129,7 +129,6 @@
<feature name='vmx-ept-1gb'/>
<feature name='vmx-ept-2mb'/>
<feature name='vmx-ept-execonly'/>
<feature name='vmx-ept-wb'/>
<feature name='vmx-eptad'/>
<feature name='vmx-eptp-switching'/>
<feature name='vmx-exit-ack-intr'/>

View File

@ -74,7 +74,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -72,7 +72,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -71,7 +71,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -73,7 +73,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -99,7 +99,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -101,7 +101,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>

View File

@ -66,7 +66,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>
<feature name='vmx-exit-load-pat' added='yes'/>

View File

@ -65,7 +65,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>
<feature name='vmx-exit-load-pat' added='yes'/>

View File

@ -55,7 +55,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>
<feature name='vmx-exit-load-pat' added='yes'/>

View File

@ -54,7 +54,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>
<feature name='vmx-exit-load-pat' added='yes'/>

View File

@ -58,7 +58,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>
<feature name='vmx-exit-load-pat' added='yes'/>

View File

@ -57,7 +57,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>
<feature name='vmx-exit-load-pat' added='yes'/>

View File

@ -122,7 +122,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -83,7 +83,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -81,7 +81,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -82,7 +82,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -88,7 +88,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>

View File

@ -86,7 +86,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -87,7 +87,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>

View File

@ -81,7 +81,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-eptad' added='yes'/>
<feature name='vmx-eptp-switching' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>

View File

@ -53,7 +53,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>
<feature name='vmx-exit-load-pat' added='yes'/>

View File

@ -54,7 +54,6 @@
<feature name='vmx-ept-1gb' added='yes'/>
<feature name='vmx-ept-2mb' added='yes'/>
<feature name='vmx-ept-execonly' added='yes'/>
<feature name='vmx-ept-wb' added='yes'/>
<feature name='vmx-exit-ack-intr' added='yes'/>
<feature name='vmx-exit-load-efer' added='yes'/>
<feature name='vmx-exit-load-pat' added='yes'/>

View File

@ -3534,6 +3534,7 @@ virQEMUCapsProbeQMPSGXCapabilities(virQEMUCaps *qemuCaps,
const char *ignoredFeatures[] = {
"cmt", "mbm_total", "mbm_local", /* never supported by QEMU */
"osxsave", "ospke", /* dropped from QEMU */
"vmx-ept-uc", "vmx-ept-wb", /* never supported by QEMU */
};
bool