- cpu: x86: Add support for adding features to existing CPU models

- qemu: domain: Check arch in qemuDomainMakeCPUMigratable
- conf: cpu: Introduce virCPUDefListFeatures
- qemu: domain: Drop added features from migratable CPU
- Add vmx-* features to Broadwell*
- Add vmx-* features to Cascadelake*
- Add vmx-* features to Conroe
- Add vmx-* features to Cooperlake
- Add vmx-* features to core2duo
- Add vmx-* features to Haswell*
- Add vmx-* features to Icelake*
- Add vmx-* features to IvyBridge*
- Add vmx-* features to kvm*
- Add vmx-* features to Nehalem*
- Add vmx-* features to Penryn
- Add vmx-* features to SandyBridge*
- Add vmx-* features to SapphireRapids
- Add vmx-* features to Skylake*
- Add vmx-* features to Snowridge
- Add vmx-* features to Westmere*
- qemu: virtiofs: do not crash if cgroups are missing
- qemu: virtiofs: set correct label when creating the socket
- qemu: virtiofs: error out if getting the group or user name fails
This commit is contained in:
eabdullin 2024-04-30 15:56:53 +03:00
parent 6de10c41f7
commit 2daa9ba65a
41 changed files with 3459 additions and 1831 deletions

View File

@ -0,0 +1,78 @@
From 577c4ca414b26c8586f2586978e55c948bec0a32 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Mon, 11 Mar 2024 15:37:32 +0100
Subject: [PATCH] conf: cpu: Introduce virCPUDefListFeatures
The function returns a list of explicitly mentioned features in the CPU
definition.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
---
src/conf/cpu_conf.c | 24 ++++++++++++++++++++++++
src/conf/cpu_conf.h | 3 +++
src/libvirt_private.syms | 1 +
3 files changed, 28 insertions(+)
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 6e6e1b9a897..4dca7e57ec7 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -982,6 +982,30 @@ virCPUDefFindFeature(const virCPUDef *def,
}
+/**
+ * virCPUDefListExplicitFeatures:
+ * @def: CPU definition
+ *
+ * Provides a list of feature names explicitly mentioned in the CPU definition
+ * regardless of the policy. The caller is responsible for freeing the list.
+ *
+ * Returns a NULL-terminated list of feature names.
+ */
+char **
+virCPUDefListExplicitFeatures(const virCPUDef *def)
+{
+ char **list;
+ size_t i;
+
+ list = g_new0(char *, def->nfeatures + 1);
+
+ for (i = 0; i < def->nfeatures; i++)
+ list[i] = g_strdup(def->features[i].name);
+
+ return list;
+}
+
+
int
virCPUDefFilterFeatures(virCPUDef *cpu,
virCPUDefFeatureFilter filter,
diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
index 2694022fed1..b10c23ee828 100644
--- a/src/conf/cpu_conf.h
+++ b/src/conf/cpu_conf.h
@@ -270,6 +270,9 @@ virCPUDefCheckFeatures(virCPUDef *cpu,
void *opaque,
char ***features);
+char **
+virCPUDefListExplicitFeatures(const virCPUDef *def);
+
virCPUDef **
virCPUDefListParse(const char **xmlCPUs,
unsigned int ncpus,
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 98a925933ef..6b6bcc368ac 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -111,6 +111,7 @@ virCPUDefFree;
virCPUDefFreeFeatures;
virCPUDefFreeModel;
virCPUDefIsEqual;
+virCPUDefListExplicitFeatures;
virCPUDefListFree;
virCPUDefListParse;
virCPUDefNew;

View File

@ -0,0 +1,212 @@
From 5fbfa5ab8a3bf914d2deacd0d281b16aafd593b5 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:50:48 +0100
Subject: [PATCH] cpu: x86: Add support for adding features to existing CPU
models
This is not a good idea in general, but we can (and have to) do it in
specific cases when a feature has always been part of a CPU model in
hypervisor's definition, but we ignored it and did not include the
feature in our definition.
Blindly adding the features to the CPU map and not adding them to
existing CPU models breaks migration between old and new libvirt in both
directions. New libvirt would complain the features got unexpectedly
enabled (as they were not mentioned in the incoming domain XML) even
though they were also enabled on the source and the old libvirt just
didn't know about them. On the other hand, old libvirt would refuse to
accept incoming migration of a domain started by new libvirt because the
domain XML would contain CPU features unknown to the old libvirt.
This is exactly what happened when several vmx-* features were added a
few releases back. Migration between libvirt releases before and after
the addition is now broken.
This patch adds support for added these features to existing CPU models
by marking them with added='yes'. The features will not be considered
part of the CPU model and will be described explicitly via additional
<feature/> elements, but the compatibility check will not complain if
they are enabled by the hypervisor even though they were not explicitly
mentioned in the CPU definition and incoming migration from old libvirt
will succeed.
To fix outgoing migration to old libvirt, we also need to drop all those
features from domain XML unless they were explicitly requested by the
user. This will be handled by a later patch.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
---
src/cpu/cpu_x86.c | 74 ++++++++++++++++++++++++++++++++++++++--
src/cpu/cpu_x86.h | 3 ++
src/libvirt_private.syms | 1 +
3 files changed, 75 insertions(+), 3 deletions(-)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index e8409ce616f..0fad761809c 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -148,6 +148,17 @@ struct _virCPUx86Model {
virCPUx86Signatures *signatures;
virCPUx86Data data;
GStrv removedFeatures;
+
+ /* Features added to the CPU model after its original version was released.
+ * Such features are not really considered part of the model, but the
+ * compatibility check will not complain if they are enabled by the
+ * hypervisor even though they were not explicitly mentioned in the CPU
+ * definition. This should only be used for features which were always
+ * included in the CPU model by the hypervisor, but libvirt didn't support
+ * them when introducing the CPU model. In other words, they were enabled,
+ * but we ignored them.
+ */
+ GStrv addedFeatures;
};
typedef struct _virCPUx86Map virCPUx86Map;
@@ -1276,6 +1287,7 @@ x86ModelFree(virCPUx86Model *model)
virCPUx86SignaturesFree(model->signatures);
virCPUx86DataClear(&model->data);
g_strfreev(model->removedFeatures);
+ g_strfreev(model->addedFeatures);
g_free(model);
}
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Model, x86ModelFree);
@@ -1291,6 +1303,7 @@ x86ModelCopy(virCPUx86Model *model)
copy->signatures = virCPUx86SignaturesCopy(model->signatures);
x86DataCopy(&copy->data, &model->data);
copy->removedFeatures = g_strdupv(model->removedFeatures);
+ copy->addedFeatures = g_strdupv(model->addedFeatures);
copy->vendor = model->vendor;
return g_steal_pointer(&copy);
@@ -1596,17 +1609,20 @@ x86ModelParseFeatures(virCPUx86Model *model,
g_autofree xmlNodePtr *nodes = NULL;
size_t i;
size_t nremoved = 0;
+ size_t nadded = 0;
int n;
if ((n = virXPathNodeSet("./feature", ctxt, &nodes)) <= 0)
return n;
model->removedFeatures = g_new0(char *, n + 1);
+ model->addedFeatures = g_new0(char *, n + 1);
for (i = 0; i < n; i++) {
g_autofree char *ftname = NULL;
virCPUx86Feature *feature;
virTristateBool rem;
+ virTristateBool added;
if (!(ftname = virXMLPropString(nodes[i], "name"))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -1632,10 +1648,21 @@ x86ModelParseFeatures(virCPUx86Model *model,
continue;
}
+ if (virXMLPropTristateBool(nodes[i], "added",
+ VIR_XML_PROP_NONE,
+ &added) < 0)
+ return -1;
+
+ if (added == VIR_TRISTATE_BOOL_YES) {
+ model->addedFeatures[nadded++] = g_strdup(ftname);
+ continue;
+ }
+
x86DataAdd(&model->data, &feature->data);
}
model->removedFeatures = g_renew(char *, model->removedFeatures, nremoved + 1);
+ model->addedFeatures = g_renew(char *, model->addedFeatures, nadded + 1);
return 0;
}
@@ -3022,11 +3049,18 @@ virCPUx86UpdateLive(virCPUDef *cpu,
if (expected == VIR_CPU_FEATURE_DISABLE &&
x86DataIsSubset(&enabled, &feature->data)) {
VIR_DEBUG("Feature '%s' enabled by the hypervisor", feature->name);
- if (cpu->check == VIR_CPU_CHECK_FULL)
+
+ /* Extra features enabled by the hypervisor are ignored by
+ * check='full' in case they were added to the model later for
+ * backward compatibility with the older definition of the model.
+ */
+ if (cpu->check == VIR_CPU_CHECK_FULL &&
+ !g_strv_contains((const char **) model->addedFeatures, feature->name)) {
virBufferAsprintf(&bufAdded, "%s,", feature->name);
- else if (virCPUDefUpdateFeature(cpu, feature->name,
- VIR_CPU_FEATURE_REQUIRE) < 0)
+ } else if (virCPUDefUpdateFeature(cpu, feature->name,
+ VIR_CPU_FEATURE_REQUIRE) < 0) {
return -1;
+ }
}
if (x86DataIsSubset(&disabled, &feature->data) ||
@@ -3491,6 +3525,40 @@ virCPUx86FeatureFilterDropMSR(const char *name,
}
+/**
+ * virCPUx86GetAddedFeatures:
+ * @modelName: CPU model
+ * @features: where to store a pointer to the list of added features
+ *
+ * Gets a list of features added to a specified CPU model after its original
+ * version was already released. The @features will be set to NULL if the list
+ * is empty or it will point to internal structures and thus it must not be
+ * freed or modified by the caller. The pointer is valid for the whole lifetime
+ * of the process.
+ *
+ * Returns 0 on success, -1 otherwise.
+ */
+int
+virCPUx86GetAddedFeatures(const char *modelName,
+ const char * const **features)
+{
+ virCPUx86Map *map;
+ virCPUx86Model *model;
+
+ if (!(map = virCPUx86GetMap()))
+ return -1;
+
+ if (!(model = x86ModelFind(map, modelName))) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("unknown CPU model %1$s"), modelName);
+ return -1;
+ }
+
+ *features = (const char **) model->addedFeatures;
+ return 0;
+}
+
+
struct cpuArchDriver cpuDriverX86 = {
.name = "x86",
.arch = archs,
diff --git a/src/cpu/cpu_x86.h b/src/cpu/cpu_x86.h
index 2721fc90970..2cd965fea4c 100644
--- a/src/cpu/cpu_x86.h
+++ b/src/cpu/cpu_x86.h
@@ -48,3 +48,6 @@ bool virCPUx86FeatureFilterSelectMSR(const char *name,
bool virCPUx86FeatureFilterDropMSR(const char *name,
virCPUFeaturePolicy policy,
void *opaque);
+
+int virCPUx86GetAddedFeatures(const char *modelName,
+ const char * const **features);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 887659784a6..98a925933ef 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1543,6 +1543,7 @@ virCPUx86DataSetSignature;
virCPUx86DataSetVendor;
virCPUx86FeatureFilterDropMSR;
virCPUx86FeatureFilterSelectMSR;
+virCPUx86GetAddedFeatures;
# datatypes.h
virConnectClass;

View File

@ -1,201 +0,0 @@
From bfe53e9145cd5996a791c5caff0686572b850f82 Mon Sep 17 00:00:00 2001
From: Tim Wiederhake <twiederh@redhat.com>
Date: Wed, 6 Sep 2023 13:13:34 +0200
Subject: [PATCH] cpu_map: Add cpu model EPYC Genoa
This was added in qemu commit 166b174188.
No additional features had to be added to libvirt.
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
---
src/cpu_map/index.xml | 1 +
src/cpu_map/meson.build | 1 +
src/cpu_map/x86_EPYC-Genoa.xml | 115 ++++++++++++++++++
.../domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 1 +
6 files changed, 120 insertions(+)
create mode 100644 src/cpu_map/x86_EPYC-Genoa.xml
diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml
index 0187016c1c5..d2c5af57970 100644
--- a/src/cpu_map/index.xml
+++ b/src/cpu_map/index.xml
@@ -70,6 +70,7 @@
<include filename='x86_EPYC-IBPB.xml'/>
<include filename='x86_EPYC-Rome.xml'/>
<include filename='x86_EPYC-Milan.xml'/>
+ <include filename='x86_EPYC-Genoa.xml'/>
<!-- Hygon CPU models -->
<include filename='x86_Dhyana.xml'/>
diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build
index fa83b234741..ae5293e85f1 100644
--- a/src/cpu_map/meson.build
+++ b/src/cpu_map/meson.build
@@ -39,6 +39,7 @@ cpumap_data = [
'x86_Dhyana.xml',
'x86_EPYC-IBPB.xml',
'x86_EPYC.xml',
+ 'x86_EPYC-Genoa.xml',
'x86_EPYC-Milan.xml',
'x86_EPYC-Rome.xml',
'x86_features.xml',
diff --git a/src/cpu_map/x86_EPYC-Genoa.xml b/src/cpu_map/x86_EPYC-Genoa.xml
new file mode 100644
index 00000000000..3e765b89b16
--- /dev/null
+++ b/src/cpu_map/x86_EPYC-Genoa.xml
@@ -0,0 +1,115 @@
+<cpus>
+ <model name='EPYC-Genoa'>
+ <decode host='on' guest='on'/>
+ <signature family='25' model='17'/>
+ <vendor name='AMD'/>
+ <feature name='3dnowprefetch'/>
+ <feature name='abm'/>
+ <feature name='adx'/>
+ <feature name='aes'/>
+ <feature name='amd-psfd'/>
+ <feature name='amd-ssbd'/>
+ <feature name='amd-stibp'/>
+ <feature name='apic'/>
+ <feature name='arat'/>
+ <feature name='auto-ibrs'/>
+ <feature name='avx'/>
+ <feature name='avx2'/>
+ <feature name='avx512-bf16'/>
+ <feature name='avx512-vpopcntdq'/>
+ <feature name='avx512bitalg'/>
+ <feature name='avx512bw'/>
+ <feature name='avx512cd'/>
+ <feature name='avx512dq'/>
+ <feature name='avx512f'/>
+ <feature name='avx512ifma'/>
+ <feature name='avx512vbmi'/>
+ <feature name='avx512vbmi2'/>
+ <feature name='avx512vl'/>
+ <feature name='avx512vnni'/>
+ <feature name='bmi1'/>
+ <feature name='bmi2'/>
+ <feature name='clflush'/>
+ <feature name='clflushopt'/>
+ <feature name='clwb'/>
+ <feature name='clzero'/>
+ <feature name='cmov'/>
+ <feature name='cr8legacy'/>
+ <feature name='cx16'/>
+ <feature name='cx8'/>
+ <feature name='de'/>
+ <feature name='erms'/>
+ <feature name='f16c'/>
+ <feature name='fma'/>
+ <feature name='fpu'/>
+ <feature name='fsgsbase'/>
+ <feature name='fsrm'/>
+ <feature name='fxsr'/>
+ <feature name='fxsr_opt'/>
+ <feature name='gfni'/>
+ <feature name='ibpb'/>
+ <feature name='ibrs'/>
+ <feature name='invpcid'/>
+ <feature name='la57'/>
+ <feature name='lahf_lm'/>
+ <feature name='lfence-always-serializing'/>
+ <feature name='lm'/>
+ <feature name='mca'/>
+ <feature name='mce'/>
+ <feature name='misalignsse'/>
+ <feature name='mmx'/>
+ <feature name='mmxext'/>
+ <feature name='movbe'/>
+ <feature name='msr'/>
+ <feature name='mtrr'/>
+ <feature name='no-nested-data-bp'/>
+ <feature name='npt'/>
+ <feature name='nrip-save'/>
+ <feature name='null-sel-clr-base'/>
+ <feature name='nx'/>
+ <feature name='osvw'/>
+ <feature name='pae'/>
+ <feature name='pat'/>
+ <feature name='pcid'/>
+ <feature name='pclmuldq'/>
+ <feature name='pdpe1gb'/>
+ <feature name='perfctr_core'/>
+ <feature name='pge'/>
+ <feature name='pku'/>
+ <feature name='pni'/>
+ <feature name='popcnt'/>
+ <feature name='pse'/>
+ <feature name='pse36'/>
+ <feature name='rdpid'/>
+ <feature name='rdrand'/>
+ <feature name='rdseed'/>
+ <feature name='rdtscp'/>
+ <feature name='sep'/>
+ <feature name='sha-ni'/>
+ <feature name='smap'/>
+ <feature name='smep'/>
+ <feature name='sse'/>
+ <feature name='sse2'/>
+ <feature name='sse4.1'/>
+ <feature name='sse4.2'/>
+ <feature name='sse4a'/>
+ <feature name='ssse3'/>
+ <feature name='stibp-always-on'/>
+ <feature name='svm'/>
+ <feature name='svme-addr-chk'/>
+ <feature name='syscall'/>
+ <feature name='tsc'/>
+ <feature name='umip'/>
+ <feature name='vaes'/>
+ <feature name='vme'/>
+ <feature name='vnmi'/>
+ <feature name='vpclmulqdq'/>
+ <feature name='wbnoinvd'/>
+ <feature name='xgetbv1'/>
+ <feature name='xsave'/>
+ <feature name='xsavec'/>
+ <feature name='xsaveerptr'/>
+ <feature name='xsaveopt'/>
+ <feature name='xsaves'/>
+ </model>
+</cpus>
diff --git a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml
index 9a9e84e6138..4d438efdf75 100644
--- a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml
@@ -116,6 +116,7 @@
<model usable='no' vendor='AMD'>EPYC-Rome</model>
<model usable='no' vendor='AMD'>EPYC-Milan</model>
<model usable='yes' vendor='AMD'>EPYC-IBPB</model>
+ <model usable='no' vendor='AMD'>EPYC-Genoa</model>
<model usable='yes' vendor='AMD'>EPYC</model>
<model usable='yes' vendor='Hygon'>Dhyana</model>
<model usable='no' vendor='Intel'>Cooperlake</model>
diff --git a/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml
index f898149a3c1..e32cd80c178 100644
--- a/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml
@@ -115,6 +115,7 @@
<model usable='no' vendor='AMD'>EPYC-Rome</model>
<model usable='no' vendor='AMD'>EPYC-Milan</model>
<model usable='no' vendor='AMD'>EPYC-IBPB</model>
+ <model usable='no' vendor='AMD'>EPYC-Genoa</model>
<model usable='no' vendor='AMD'>EPYC</model>
<model usable='no' vendor='Hygon'>Dhyana</model>
<model usable='no' vendor='Intel'>Cooperlake</model>
diff --git a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml b/tests/domaincapsdata/qemu_8.1.0.x86_64.xml
index dbe1af68cbc..919357e577c 100644
--- a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_8.1.0.x86_64.xml
@@ -115,6 +115,7 @@
<model usable='no' vendor='AMD'>EPYC-Rome</model>
<model usable='no' vendor='AMD'>EPYC-Milan</model>
<model usable='yes' vendor='AMD'>EPYC-IBPB</model>
+ <model usable='no' vendor='AMD'>EPYC-Genoa</model>
<model usable='yes' vendor='AMD'>EPYC</model>
<model usable='yes' vendor='Hygon'>Dhyana</model>
<model usable='no' vendor='Intel'>Cooperlake</model>

View File

@ -0,0 +1,358 @@
From ce330dd7e5405573c77801a418345804049315ab Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:00:15 +0100
Subject: [PATCH] Add vmx-* features to Broadwell*
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_Broadwell-IBRS.xml | 75 ++++++++++++++++++++++++
src/cpu_map/x86_Broadwell-noTSX-IBRS.xml | 75 ++++++++++++++++++++++++
src/cpu_map/x86_Broadwell-noTSX.xml | 75 ++++++++++++++++++++++++
src/cpu_map/x86_Broadwell.xml | 75 ++++++++++++++++++++++++
4 files changed, 300 insertions(+)
diff --git a/src/cpu_map/x86_Broadwell-IBRS.xml b/src/cpu_map/x86_Broadwell-IBRS.xml
index 9033d5fcd51..14849032981 100644
--- a/src/cpu_map/x86_Broadwell-IBRS.xml
+++ b/src/cpu_map/x86_Broadwell-IBRS.xml
@@ -59,6 +59,81 @@
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='tsc-deadline'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>
diff --git a/src/cpu_map/x86_Broadwell-noTSX-IBRS.xml b/src/cpu_map/x86_Broadwell-noTSX-IBRS.xml
index c044b60e36e..13f08435b76 100644
--- a/src/cpu_map/x86_Broadwell-noTSX-IBRS.xml
+++ b/src/cpu_map/x86_Broadwell-noTSX-IBRS.xml
@@ -57,6 +57,81 @@
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='tsc-deadline'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>
diff --git a/src/cpu_map/x86_Broadwell-noTSX.xml b/src/cpu_map/x86_Broadwell-noTSX.xml
index 637f29ba1cf..4293b3aeee3 100644
--- a/src/cpu_map/x86_Broadwell-noTSX.xml
+++ b/src/cpu_map/x86_Broadwell-noTSX.xml
@@ -56,6 +56,81 @@
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='tsc-deadline'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>
diff --git a/src/cpu_map/x86_Broadwell.xml b/src/cpu_map/x86_Broadwell.xml
index 82939a45091..37dd1dabcfb 100644
--- a/src/cpu_map/x86_Broadwell.xml
+++ b/src/cpu_map/x86_Broadwell.xml
@@ -58,6 +58,81 @@
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='tsc-deadline'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>

View File

@ -0,0 +1,184 @@
From 5db61952252fa2ab88cc79f064f8f1b61b6c95cb Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:01:25 +0100
Subject: [PATCH] Add vmx-* features to Cascadelake*
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_Cascadelake-Server-noTSX.xml | 76 ++++++++++++++++++++
src/cpu_map/x86_Cascadelake-Server.xml | 74 +++++++++++++++++++
2 files changed, 150 insertions(+)
diff --git a/src/cpu_map/x86_Cascadelake-Server-noTSX.xml b/src/cpu_map/x86_Cascadelake-Server-noTSX.xml
index bfd4629836b..056f43d0887 100644
--- a/src/cpu_map/x86_Cascadelake-Server-noTSX.xml
+++ b/src/cpu_map/x86_Cascadelake-Server-noTSX.xml
@@ -70,6 +70,82 @@
<feature name='tsc'/>
<feature name='tsc-deadline'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
+ <feature name='vmx-xsaves' added='yes'/>
<feature name='x2apic'/>
<feature name='xgetbv1'/>
<feature name='xsave'/>
diff --git a/src/cpu_map/x86_Cascadelake-Server.xml b/src/cpu_map/x86_Cascadelake-Server.xml
index 335e9cb5841..88e51c20678 100644
--- a/src/cpu_map/x86_Cascadelake-Server.xml
+++ b/src/cpu_map/x86_Cascadelake-Server.xml
@@ -72,6 +72,80 @@
<feature name='tsc'/>
<feature name='tsc-deadline'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xgetbv1'/>
<feature name='xsave'/>

View File

@ -0,0 +1,47 @@
From 9cb8c372cd75647e09fac96e6995adab5e8dde79 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:04:45 +0100
Subject: [PATCH] Add vmx-* features to Conroe
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_Conroe.xml | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/cpu_map/x86_Conroe.xml b/src/cpu_map/x86_Conroe.xml
index 4cacee6142e..955297ffc30 100644
--- a/src/cpu_map/x86_Conroe.xml
+++ b/src/cpu_map/x86_Conroe.xml
@@ -31,5 +31,31 @@
<feature name='ssse3'/>
<feature name='syscall'/>
<feature name='tsc'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-exit-ack-intr' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
</model>
</cpus>

View File

@ -0,0 +1,98 @@
From cbee851581fc82ea95d7b6309b85e22f9d1ba0d3 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:05:01 +0100
Subject: [PATCH] Add vmx-* features to Cooperlake
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_Cooperlake.xml | 76 ++++++++++++++++++++++++++++++++++
1 file changed, 76 insertions(+)
diff --git a/src/cpu_map/x86_Cooperlake.xml b/src/cpu_map/x86_Cooperlake.xml
index ceca687334f..af428f2781c 100644
--- a/src/cpu_map/x86_Cooperlake.xml
+++ b/src/cpu_map/x86_Cooperlake.xml
@@ -81,6 +81,82 @@
<feature name='tsc'/>
<feature name='tsc-deadline'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
+ <feature name='vmx-xsaves' added='yes'/>
<feature name='x2apic'/>
<feature name='xgetbv1'/>
<feature name='xsave'/>

View File

@ -0,0 +1,350 @@
From b44679c31f2d46e88ce655c03aef4c3e9ab621ac Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:01:50 +0100
Subject: [PATCH] Add vmx-* features to Haswell*
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_Haswell-IBRS.xml | 73 ++++++++++++++++++++++++++
src/cpu_map/x86_Haswell-noTSX-IBRS.xml | 73 ++++++++++++++++++++++++++
src/cpu_map/x86_Haswell-noTSX.xml | 73 ++++++++++++++++++++++++++
src/cpu_map/x86_Haswell.xml | 73 ++++++++++++++++++++++++++
4 files changed, 292 insertions(+)
diff --git a/src/cpu_map/x86_Haswell-IBRS.xml b/src/cpu_map/x86_Haswell-IBRS.xml
index 0ffe2bae0d4..57b980d14fe 100644
--- a/src/cpu_map/x86_Haswell-IBRS.xml
+++ b/src/cpu_map/x86_Haswell-IBRS.xml
@@ -55,6 +55,79 @@
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='tsc-deadline'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>
diff --git a/src/cpu_map/x86_Haswell-noTSX-IBRS.xml b/src/cpu_map/x86_Haswell-noTSX-IBRS.xml
index 75d709c0098..fcae023ffb5 100644
--- a/src/cpu_map/x86_Haswell-noTSX-IBRS.xml
+++ b/src/cpu_map/x86_Haswell-noTSX-IBRS.xml
@@ -53,6 +53,79 @@
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='tsc-deadline'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>
diff --git a/src/cpu_map/x86_Haswell-noTSX.xml b/src/cpu_map/x86_Haswell-noTSX.xml
index b0a0faa856d..7404052065a 100644
--- a/src/cpu_map/x86_Haswell-noTSX.xml
+++ b/src/cpu_map/x86_Haswell-noTSX.xml
@@ -52,6 +52,79 @@
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='tsc-deadline'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>
diff --git a/src/cpu_map/x86_Haswell.xml b/src/cpu_map/x86_Haswell.xml
index ee16b30f198..99986c5c45c 100644
--- a/src/cpu_map/x86_Haswell.xml
+++ b/src/cpu_map/x86_Haswell.xml
@@ -54,6 +54,79 @@
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='tsc-deadline'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>

View File

@ -0,0 +1,183 @@
From a6f3eafc402fbaf18b2e23e93c8c7339317c7d97 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:02:47 +0100
Subject: [PATCH] Add vmx-* features to Icelake*
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_Icelake-Server-noTSX.xml | 77 ++++++++++++++++++++++++
src/cpu_map/x86_Icelake-Server.xml | 72 ++++++++++++++++++++++
2 files changed, 149 insertions(+)
diff --git a/src/cpu_map/x86_Icelake-Server-noTSX.xml b/src/cpu_map/x86_Icelake-Server-noTSX.xml
index 7c9c32c9776..072f8145c42 100644
--- a/src/cpu_map/x86_Icelake-Server-noTSX.xml
+++ b/src/cpu_map/x86_Icelake-Server-noTSX.xml
@@ -80,6 +80,83 @@
<feature name='umip'/>
<feature name='vaes'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-page-walk-5' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
+ <feature name='vmx-xsaves' added='yes'/>
<feature name='vpclmulqdq'/>
<feature name='wbnoinvd'/>
<feature name='x2apic'/>
diff --git a/src/cpu_map/x86_Icelake-Server.xml b/src/cpu_map/x86_Icelake-Server.xml
index b4685bead05..3a35145d7f0 100644
--- a/src/cpu_map/x86_Icelake-Server.xml
+++ b/src/cpu_map/x86_Icelake-Server.xml
@@ -82,6 +82,78 @@
<feature name='umip'/>
<feature name='vaes'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='vpclmulqdq'/>
<feature name='wbnoinvd'/>
<feature name='x2apic'/>

View File

@ -0,0 +1,168 @@
From 4b707f8bb0003b87f67474bfac02a2feac26c96f Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:04:01 +0100
Subject: [PATCH] Add vmx-* features to IvyBridge*
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_IvyBridge-IBRS.xml | 67 ++++++++++++++++++++++++++++++
src/cpu_map/x86_IvyBridge.xml | 67 ++++++++++++++++++++++++++++++
2 files changed, 134 insertions(+)
diff --git a/src/cpu_map/x86_IvyBridge-IBRS.xml b/src/cpu_map/x86_IvyBridge-IBRS.xml
index 430bc3232db..27d85d86c4e 100644
--- a/src/cpu_map/x86_IvyBridge-IBRS.xml
+++ b/src/cpu_map/x86_IvyBridge-IBRS.xml
@@ -47,6 +47,73 @@
<feature name='tsc'/>
<feature name='tsc-deadline'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>
diff --git a/src/cpu_map/x86_IvyBridge.xml b/src/cpu_map/x86_IvyBridge.xml
index eaf5d02e827..72031cfdc62 100644
--- a/src/cpu_map/x86_IvyBridge.xml
+++ b/src/cpu_map/x86_IvyBridge.xml
@@ -46,6 +46,73 @@
<feature name='tsc'/>
<feature name='tsc-deadline'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>

View File

@ -0,0 +1,154 @@
From a539910c942f5993b967f8265756e3a10363e4f4 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:04:21 +0100
Subject: [PATCH] Add vmx-* features to Nehalem*
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_Nehalem-IBRS.xml | 61 ++++++++++++++++++++++++++++++++
src/cpu_map/x86_Nehalem.xml | 61 ++++++++++++++++++++++++++++++++
2 files changed, 122 insertions(+)
diff --git a/src/cpu_map/x86_Nehalem-IBRS.xml b/src/cpu_map/x86_Nehalem-IBRS.xml
index 00d0d2fe51a..0cfee14c0f7 100644
--- a/src/cpu_map/x86_Nehalem-IBRS.xml
+++ b/src/cpu_map/x86_Nehalem-IBRS.xml
@@ -38,5 +38,66 @@
<feature name='ssse3'/>
<feature name='syscall'/>
<feature name='tsc'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
</model>
</cpus>
diff --git a/src/cpu_map/x86_Nehalem.xml b/src/cpu_map/x86_Nehalem.xml
index 9968001fe79..74ee64ce1c3 100644
--- a/src/cpu_map/x86_Nehalem.xml
+++ b/src/cpu_map/x86_Nehalem.xml
@@ -37,5 +37,66 @@
<feature name='ssse3'/>
<feature name='syscall'/>
<feature name='tsc'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
</model>
</cpus>

View File

@ -0,0 +1,50 @@
From c6fadbb2807c80bd2b812eebd932eb4a34067ccd Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:05:20 +0100
Subject: [PATCH] Add vmx-* features to Penryn
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_Penryn.xml | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/src/cpu_map/x86_Penryn.xml b/src/cpu_map/x86_Penryn.xml
index 29d4cd635b8..b31f96fa431 100644
--- a/src/cpu_map/x86_Penryn.xml
+++ b/src/cpu_map/x86_Penryn.xml
@@ -33,5 +33,34 @@
<feature name='ssse3'/>
<feature name='syscall'/>
<feature name='tsc'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-ack-intr' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
</model>
</cpus>

View File

@ -0,0 +1,160 @@
From 29d492d6488e35db2e96a017ac3fb2712dcb638c Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:03:18 +0100
Subject: [PATCH] Add vmx-* features to SandyBridge*
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_SandyBridge-IBRS.xml | 63 ++++++++++++++++++++++++++++
src/cpu_map/x86_SandyBridge.xml | 63 ++++++++++++++++++++++++++++
2 files changed, 126 insertions(+)
diff --git a/src/cpu_map/x86_SandyBridge-IBRS.xml b/src/cpu_map/x86_SandyBridge-IBRS.xml
index fbdb4f2bf64..297eea8e882 100644
--- a/src/cpu_map/x86_SandyBridge-IBRS.xml
+++ b/src/cpu_map/x86_SandyBridge-IBRS.xml
@@ -41,6 +41,69 @@
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='tsc-deadline'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>
diff --git a/src/cpu_map/x86_SandyBridge.xml b/src/cpu_map/x86_SandyBridge.xml
index 7c85ed42df1..20ea378c471 100644
--- a/src/cpu_map/x86_SandyBridge.xml
+++ b/src/cpu_map/x86_SandyBridge.xml
@@ -40,6 +40,69 @@
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='tsc-deadline'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xsave'/>
</model>

View File

@ -0,0 +1,99 @@
From e67004ec1cec850baa65177d88c6db09376869d3 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:05:34 +0100
Subject: [PATCH] Add vmx-* features to SapphireRapids
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_SapphireRapids.xml | 77 ++++++++++++++++++++++++++++++
1 file changed, 77 insertions(+)
diff --git a/src/cpu_map/x86_SapphireRapids.xml b/src/cpu_map/x86_SapphireRapids.xml
index 2297feeeca2..40164a47e2a 100644
--- a/src/cpu_map/x86_SapphireRapids.xml
+++ b/src/cpu_map/x86_SapphireRapids.xml
@@ -103,6 +103,83 @@
<feature name='umip'/>
<feature name='vaes'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-page-walk-5' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
+ <feature name='vmx-xsaves' added='yes'/>
<feature name='vpclmulqdq'/>
<feature name='wbnoinvd'/>
<feature name='x2apic'/>

View File

@ -0,0 +1,520 @@
From aa064b38fdbafd39d296a0933b7d1b8987eb4cb5 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:00:53 +0100
Subject: [PATCH] Add vmx-* features to Skylake*
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_Skylake-Client-IBRS.xml | 71 +++++++++++++++++
src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml | 72 ++++++++++++++++++
src/cpu_map/x86_Skylake-Client.xml | 71 +++++++++++++++++
src/cpu_map/x86_Skylake-Server-IBRS.xml | 74 ++++++++++++++++++
src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml | 76 +++++++++++++++++++
src/cpu_map/x86_Skylake-Server.xml | 74 ++++++++++++++++++
6 files changed, 438 insertions(+)
diff --git a/src/cpu_map/x86_Skylake-Client-IBRS.xml b/src/cpu_map/x86_Skylake-Client-IBRS.xml
index 5709e7c2f95..1c77f9595b6 100644
--- a/src/cpu_map/x86_Skylake-Client-IBRS.xml
+++ b/src/cpu_map/x86_Skylake-Client-IBRS.xml
@@ -67,6 +67,77 @@
<feature name='tsc'/>
<feature name='tsc-deadline'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xgetbv1'/>
<feature name='xsave'/>
diff --git a/src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml b/src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml
index ffba34502a4..dca117028cd 100644
--- a/src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml
+++ b/src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml
@@ -65,6 +65,78 @@
<feature name='tsc'/>
<feature name='tsc-deadline'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
+ <feature name='vmx-xsaves' added='yes'/>
<feature name='x2apic'/>
<feature name='xgetbv1'/>
<feature name='xsave'/>
diff --git a/src/cpu_map/x86_Skylake-Client.xml b/src/cpu_map/x86_Skylake-Client.xml
index 14cd57e1768..68e5d2d0388 100644
--- a/src/cpu_map/x86_Skylake-Client.xml
+++ b/src/cpu_map/x86_Skylake-Client.xml
@@ -66,6 +66,77 @@
<feature name='tsc'/>
<feature name='tsc-deadline'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xgetbv1'/>
<feature name='xsave'/>
diff --git a/src/cpu_map/x86_Skylake-Server-IBRS.xml b/src/cpu_map/x86_Skylake-Server-IBRS.xml
index 9fb34888094..e467b76242b 100644
--- a/src/cpu_map/x86_Skylake-Server-IBRS.xml
+++ b/src/cpu_map/x86_Skylake-Server-IBRS.xml
@@ -69,6 +69,80 @@
<feature name='tsc'/>
<feature name='tsc-deadline'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xgetbv1'/>
<feature name='xsave'/>
diff --git a/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml b/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml
index c162c0acc31..b8601da0cbc 100644
--- a/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml
+++ b/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml
@@ -67,6 +67,82 @@
<feature name='tsc'/>
<feature name='tsc-deadline'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
+ <feature name='vmx-xsaves' added='yes'/>
<feature name='x2apic'/>
<feature name='xgetbv1'/>
<feature name='xsave'/>
diff --git a/src/cpu_map/x86_Skylake-Server.xml b/src/cpu_map/x86_Skylake-Server.xml
index e022d94c847..cc1e9ddd7f7 100644
--- a/src/cpu_map/x86_Skylake-Server.xml
+++ b/src/cpu_map/x86_Skylake-Server.xml
@@ -68,6 +68,80 @@
<feature name='tsc'/>
<feature name='tsc-deadline'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
<feature name='x2apic'/>
<feature name='xgetbv1'/>
<feature name='xsave'/>

View File

@ -0,0 +1,98 @@
From 64e3c1138a81b98f14e5f1aa1e8e2bb85cfdd1e5 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:05:53 +0100
Subject: [PATCH] Add vmx-* features to Snowridge
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_Snowridge.xml | 76 +++++++++++++++++++++++++++++++++++
1 file changed, 76 insertions(+)
diff --git a/src/cpu_map/x86_Snowridge.xml b/src/cpu_map/x86_Snowridge.xml
index 383a24d367c..bc410bd8f80 100644
--- a/src/cpu_map/x86_Snowridge.xml
+++ b/src/cpu_map/x86_Snowridge.xml
@@ -62,6 +62,82 @@
<feature name='tsc-deadline'/>
<feature name='umip'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-register' added='yes'/>
+ <feature name='vmx-apicv-vid' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-efer' added='yes'/>
+ <feature name='vmx-exit-load-pat' added='yes'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invpcid-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-pml' added='yes'/>
+ <feature name='vmx-posted-intr' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdrand-exit' added='yes'/>
+ <feature name='vmx-rdseed-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-shadow-vmcs' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vmfunc' added='yes'/>
+ <feature name='vmx-vmwrite-vmexit-fields' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
+ <feature name='vmx-xsaves' added='yes'/>
<feature name='x2apic'/>
<feature name='xgetbv1'/>
<feature name='xsave'/>

View File

@ -0,0 +1,158 @@
From 6898b7cd8d61d46db7e92f6cf81daf085b85f724 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:03:38 +0100
Subject: [PATCH] Add vmx-* features to Westmere*
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_Westmere-IBRS.xml | 63 +++++++++++++++++++++++++++++++
src/cpu_map/x86_Westmere.xml | 63 +++++++++++++++++++++++++++++++
2 files changed, 126 insertions(+)
diff --git a/src/cpu_map/x86_Westmere-IBRS.xml b/src/cpu_map/x86_Westmere-IBRS.xml
index c7898f0c226..a5abe8a1e18 100644
--- a/src/cpu_map/x86_Westmere-IBRS.xml
+++ b/src/cpu_map/x86_Westmere-IBRS.xml
@@ -36,5 +36,68 @@
<feature name='ssse3'/>
<feature name='syscall'/>
<feature name='tsc'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
</model>
</cpus>
diff --git a/src/cpu_map/x86_Westmere.xml b/src/cpu_map/x86_Westmere.xml
index 16e4ad6c309..161f1a078e3 100644
--- a/src/cpu_map/x86_Westmere.xml
+++ b/src/cpu_map/x86_Westmere.xml
@@ -37,5 +37,68 @@
<feature name='ssse3'/>
<feature name='syscall'/>
<feature name='tsc'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-x2apic' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr3-load-noexit' added='yes'/>
+ <feature name='vmx-cr3-store-noexit' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-desc-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-entry-load-efer' added='yes'/>
+ <feature name='vmx-entry-load-pat' added='yes'/>
+ <feature name='vmx-entry-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-entry-noload-debugctl' added='yes'/>
+ <feature name='vmx-ept' added='yes'/>
+ <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'/>
+ <feature name='vmx-exit-load-perf-global-ctrl' added='yes'/>
+ <feature name='vmx-exit-nosave-debugctl' added='yes'/>
+ <feature name='vmx-exit-save-efer' added='yes'/>
+ <feature name='vmx-exit-save-pat' added='yes'/>
+ <feature name='vmx-exit-save-preemption-timer' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invept' added='yes'/>
+ <feature name='vmx-invept-all-context' added='yes'/>
+ <feature name='vmx-invept-single-context' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-invvpid' added='yes'/>
+ <feature name='vmx-invvpid-all-context' added='yes'/>
+ <feature name='vmx-invvpid-single-addr' added='yes'/>
+ <feature name='vmx-invvpid-single-context' added='yes'/>
+ <feature name='vmx-invvpid-single-context-noglobals' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mtf' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-page-walk-4' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-preemption-timer' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-rdtscp-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-store-lma' added='yes'/>
+ <feature name='vmx-true-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-unrestricted-guest' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
+ <feature name='vmx-vpid' added='yes'/>
+ <feature name='vmx-wbinvd-exit' added='yes'/>
</model>
</cpus>

View File

@ -0,0 +1,76 @@
From 823c7005a3b0d5275b30ca811479995bfa5820e9 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:06:13 +0100
Subject: [PATCH] Add vmx-* features to core{,2}duo
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_core2duo.xml | 26 ++++++++++++++++++++++++++
src/cpu_map/x86_coreduo.xml | 18 ++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/src/cpu_map/x86_core2duo.xml b/src/cpu_map/x86_core2duo.xml
index 412039fe559..ea23a6c6629 100644
--- a/src/cpu_map/x86_core2duo.xml
+++ b/src/cpu_map/x86_core2duo.xml
@@ -30,5 +30,31 @@
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-apicv-xapic' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-exit-ack-intr' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-ins-outs' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-secondary-ctls' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
+ <feature name='vmx-vnmi' added='yes'/>
+ <feature name='vmx-vnmi-pending' added='yes'/>
</model>
</cpus>
diff --git a/src/cpu_map/x86_coreduo.xml b/src/cpu_map/x86_coreduo.xml
index e2fda9a1d48..24900e637fa 100644
--- a/src/cpu_map/x86_coreduo.xml
+++ b/src/cpu_map/x86_coreduo.xml
@@ -26,5 +26,23 @@
<feature name='sse2'/>
<feature name='tsc'/>
<feature name='vme'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-exit-ack-intr' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
</model>
</cpus>

View File

@ -0,0 +1,70 @@
From 1d03f78c5d0fa2d3422e76bef4c9369ab623bd52 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 7 Mar 2024 14:06:37 +0100
Subject: [PATCH] Add vmx-* features to kvm*
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
---
src/cpu_map/x86_kvm32.xml | 18 ++++++++++++++++++
src/cpu_map/x86_kvm64.xml | 20 ++++++++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/src/cpu_map/x86_kvm32.xml b/src/cpu_map/x86_kvm32.xml
index 9dd96d5b569..ac28c53bd0b 100644
--- a/src/cpu_map/x86_kvm32.xml
+++ b/src/cpu_map/x86_kvm32.xml
@@ -23,5 +23,23 @@
<feature name='sse'/>
<feature name='sse2'/>
<feature name='tsc'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-exit-ack-intr' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-msr-bitmap' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
</model>
</cpus>
diff --git a/src/cpu_map/x86_kvm64.xml b/src/cpu_map/x86_kvm64.xml
index 185af06f784..970a8e73d50 100644
--- a/src/cpu_map/x86_kvm64.xml
+++ b/src/cpu_map/x86_kvm64.xml
@@ -27,5 +27,25 @@
<feature name='sse2'/>
<feature name='syscall'/>
<feature name='tsc'/>
+ <feature name='vmx-activity-hlt' added='yes'/>
+ <feature name='vmx-cr8-load-exit' added='yes'/>
+ <feature name='vmx-cr8-store-exit' added='yes'/>
+ <feature name='vmx-entry-ia32e-mode' added='yes'/>
+ <feature name='vmx-exit-ack-intr' added='yes'/>
+ <feature name='vmx-flexpriority' added='yes'/>
+ <feature name='vmx-hlt-exit' added='yes'/>
+ <feature name='vmx-intr-exit' added='yes'/>
+ <feature name='vmx-invlpg-exit' added='yes'/>
+ <feature name='vmx-io-bitmap' added='yes'/>
+ <feature name='vmx-io-exit' added='yes'/>
+ <feature name='vmx-monitor-exit' added='yes'/>
+ <feature name='vmx-movdr-exit' added='yes'/>
+ <feature name='vmx-mwait-exit' added='yes'/>
+ <feature name='vmx-nmi-exit' added='yes'/>
+ <feature name='vmx-pause-exit' added='yes'/>
+ <feature name='vmx-rdpmc-exit' added='yes'/>
+ <feature name='vmx-rdtsc-exit' added='yes'/>
+ <feature name='vmx-tsc-offset' added='yes'/>
+ <feature name='vmx-vintr-pending' added='yes'/>
</model>
</cpus>

View File

@ -1,53 +0,0 @@
From bbfcf18f504b0eb165c0bbfe2f34b4e20d11c355 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Fri, 25 Aug 2023 00:09:54 -0400
Subject: [PATCH] docs: update description of virsh nodedev-detach --driver
option
--driver can now be used to specify a specific driver to bind to the
device being detached from the host driver (e.g. vfio-pci-igbvf), not
just the *type* of driver (e.g. "vfio" or "xen", which are unnecessary
anyway, since they are implicit in which hypervisor driver is in use)
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
docs/manpages/virsh.rst | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 673812036d3..91e1d5de37d 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -5388,14 +5388,23 @@ nodedev-detach
nodedev-detach nodedev [--driver backend_driver]
-Detach *nodedev* from the host, so that it can safely be used by
-guests via <hostdev> passthrough. This is reversed with
-``nodedev-reattach``, and is done automatically for managed devices.
-
-Different backend drivers expect the device to be bound to different
-dummy devices. For example, QEMU's "vfio" backend driver expects the
-device to be bound to vfio-pci. The *--driver* parameter can be used
-to specify the desired backend driver.
+Detach *nodedev* from the host driver and bind it to a special driver
+that provides the API needed by the hypervisor for assigning the
+device to a virtual machine (using <hostdev> in the domain XML
+definition). This is reversed with ``nodedev-reattach``, and is done
+automatically by the hypervisor driver for managed devices (those
+devices with "managed='yes'" in their XML definition).
+
+Different hypervisors expect the device being assigned to be bound to
+different drivers. For example, QEMU's "vfio" backend requires the
+device to be bound to the driver "vfio-pci" or to a "VFIO variant"
+driver (this is a driver that supports the full API provided by
+vfio-pci, plus some other APIs to support things like live
+migration). The *--driver* parameter can be used to specify a
+particular driver (e.g. a device-specific VFIO variant driver) the
+device should be bound to. When *--driver* is omitted, the default
+driver for the hypervisor is used ("vfio-pci" for QEMU, "pciback" for
+Xen).
nodedev-dumpxml

View File

@ -1,178 +0,0 @@
From 24beaffec33efa3fa077d7b8596d97aa9a038a01 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sun, 9 Jul 2023 00:37:45 -0400
Subject: [PATCH] node_device: support binding other drivers with
virNodeDeviceDetachFlags()
In the past, the only allowable values for the "driver" field of
virNodeDeviceDetachFlags() were "kvm" or "vfio" for the QEMU driver,
and "xen" for the libxl driver. Then "kvm" was deprecated and removed,
so the driver name became essentially irrelevant (because it is always
called via a particular hypervisor driver, and so the "xen" or "vfio"
can be (and almost always is) implied.
With the advent of VFIO variant drivers, the ability to explicitly
specify a driver name once again becomes useful - it can be used to
name the exact VFIO driver that we want bound to the device in place
of vfio-pci, so this patch allows those other names to be passed down
the call chain, where the code in virpci.c can make use of them.
The names "vfio", "kvm", and "xen" retain their special meaning, though:
1) because there may be some application or configuration that still
calls virNodeDeviceDetachFlags() with driverName="vfio", this
single value is substituted with the synonym of NULL, which means
"bind the default driver for this device and hypervisor". This
will currently result in the vfio-pci driver being bound to the
device.
2) in the case of the libxl driver, "xen" means to use the standard
driver used in the case of Xen ("pciback").
3) "kvm" as a driver name always results in an error, as legacy KVM
device assignment was removed from the kernel around 10 years ago.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/hypervisor/domain_driver.c | 11 ++++++-----
src/hypervisor/domain_driver.h | 2 ++
src/libxl/libxl_driver.c | 3 ++-
src/qemu/qemu_driver.c | 33 +++++++++++++++++++--------------
4 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/src/hypervisor/domain_driver.c b/src/hypervisor/domain_driver.c
index a70f75f3ae8..d9469ad6f96 100644
--- a/src/hypervisor/domain_driver.c
+++ b/src/hypervisor/domain_driver.c
@@ -462,6 +462,7 @@ virDomainDriverNodeDeviceReAttach(virNodeDevicePtr dev,
int
virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev,
virHostdevManager *hostdevMgr,
+ virPCIStubDriver driverType,
const char *driverName)
{
g_autoptr(virPCIDevice) pci = NULL;
@@ -471,8 +472,10 @@ virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev,
g_autoptr(virConnect) nodeconn = NULL;
g_autoptr(virNodeDevice) nodedev = NULL;
- if (!driverName)
+ if (driverType == VIR_PCI_STUB_DRIVER_NONE) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("driver type not set"));
return -1;
+ }
if (!(nodeconn = virGetConnectNodeDev()))
return -1;
@@ -504,10 +507,8 @@ virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev,
if (!pci)
return -1;
- if (STREQ(driverName, "vfio"))
- virPCIDeviceSetStubDriverType(pci, VIR_PCI_STUB_DRIVER_VFIO);
- else if (STREQ(driverName, "xen"))
- virPCIDeviceSetStubDriverType(pci, VIR_PCI_STUB_DRIVER_XEN);
+ virPCIDeviceSetStubDriverType(pci, driverType);
+ virPCIDeviceSetStubDriverName(pci, driverName);
return virHostdevPCINodeDeviceDetach(hostdevMgr, pci);
}
diff --git a/src/hypervisor/domain_driver.h b/src/hypervisor/domain_driver.h
index 4241c869320..9942f58fda1 100644
--- a/src/hypervisor/domain_driver.h
+++ b/src/hypervisor/domain_driver.h
@@ -22,6 +22,7 @@
#include "node_device_conf.h"
#include "virhostdev.h"
+#include "virpci.h"
char *
virDomainDriverGenerateRootHash(const char *drivername,
@@ -58,6 +59,7 @@ int virDomainDriverNodeDeviceReAttach(virNodeDevicePtr dev,
int virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev,
virHostdevManager *hostdevMgr,
+ virPCIStubDriver driverType,
const char *driverName);
int virDomainDriverAddIOThreadCheck(virDomainDef *def,
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 3d10f458508..079922dd32a 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -5876,7 +5876,8 @@ libxlNodeDeviceDetachFlags(virNodeDevicePtr dev,
/* virNodeDeviceDetachFlagsEnsureACL() is being called by
* virDomainDriverNodeDeviceDetachFlags() */
- return virDomainDriverNodeDeviceDetachFlags(dev, hostdev_mgr, driverName);
+ return virDomainDriverNodeDeviceDetachFlags(dev, hostdev_mgr,
+ VIR_PCI_STUB_DRIVER_XEN, NULL);
}
static int
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 73fa499e40d..5128b643642 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -70,7 +70,6 @@
#include "domain_driver.h"
#include "domain_postparse.h"
#include "domain_validate.h"
-#include "virpci.h"
#include "virpidfile.h"
#include "virprocess.h"
#include "libvirt_internal.h"
@@ -11407,24 +11406,28 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
virCheckFlags(0, -1);
- if (!driverName)
- driverName = "vfio";
-
- /* Only the 'vfio' driver is supported and a special error message for
- * the previously supported 'kvm' driver is provided below. */
- if (STRNEQ(driverName, "vfio") && STRNEQ(driverName, "kvm")) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("unknown driver name '%1$s'"), driverName);
- return -1;
- }
+ /* For historical reasons, if driverName is "vfio", that is the
+ * same as NULL, i.e. the default vfio driver for this device
+ */
+ if (STREQ_NULLABLE(driverName, "vfio"))
+ driverName = NULL;
- if (STREQ(driverName, "kvm")) {
+ /* the "kvm" driver name was used a very long time ago to force
+ * "legacy KVM device assignment", which hasn't been supported in
+ * over 10 years.
+ */
+ if (STREQ_NULLABLE(driverName, "kvm")) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("KVM device assignment is no longer "
+ _("'legacy KVM' device assignment is no longer "
"supported on this system"));
return -1;
}
+ /* for any other driver, we can't know whether or not it is a VFIO
+ * driver until the device has been bound to it, so we will defer
+ * further validation until then.
+ */
+
if (!qemuHostdevHostSupportsPassthroughVFIO()) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("VFIO device assignment is currently not "
@@ -11434,7 +11437,9 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
/* virNodeDeviceDetachFlagsEnsureACL() is being called by
* virDomainDriverNodeDeviceDetachFlags() */
- return virDomainDriverNodeDeviceDetachFlags(dev, hostdev_mgr, driverName);
+ return virDomainDriverNodeDeviceDetachFlags(dev, hostdev_mgr,
+ VIR_PCI_STUB_DRIVER_VFIO,
+ driverName);
}
static int

View File

@ -1,38 +0,0 @@
From 10e8a518a05922d5592d1405054aed3195aebf06 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Fri, 18 Aug 2023 16:13:16 -0400
Subject: [PATCH] qemu: turn two multiline log messages into single line
Normally I wouldn't bother with a change like this, but I was touching
the function anyway, and wanted to leave it looking nice and tidy.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_driver.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5128b643642..5db42f07533 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11418,8 +11418,7 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
*/
if (STREQ_NULLABLE(driverName, "kvm")) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("'legacy KVM' device assignment is no longer "
- "supported on this system"));
+ _("'legacy KVM' device assignment is no longer supported on this system"));
return -1;
}
@@ -11430,8 +11429,7 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
if (!qemuHostdevHostSupportsPassthroughVFIO()) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("VFIO device assignment is currently not "
- "supported on this system"));
+ _("VFIO device assignment is currently not supported on this system"));
return -1;
}

View File

@ -1,31 +0,0 @@
From c9056e682a8a67dc29e39eb01392fcf8ee978c31 Mon Sep 17 00:00:00 2001
From: Jonathan Wright <jonathan@almalinux.org>
Date: Wed, 3 Jan 2024 09:26:59 -0600
Subject: [PATCH] conf: Restore setting default bus for input devices
Prior to v9.3.0-rc1~30 we used to set default bus for <input/>
devices, during XML parsing. In the commit this code was moved to
a post parse callback. But somehow the line that sets the bus in
one specific case disappeared. Bring it back.
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/577
Fixes: c4bc4d3b82fbe22e03c986ca896090f481df5c10
Signed-off-by: Jonathan Wright <jonathan@almalinux.org>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/conf/domain_postparse.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/conf/domain_postparse.c b/src/conf/domain_postparse.c
index e79913b73f..ee27023f3e 100644
--- a/src/conf/domain_postparse.c
+++ b/src/conf/domain_postparse.c
@@ -657,6 +657,7 @@ virDomainInputDefPostParse(virDomainInputDef *input,
if ((input->type == VIR_DOMAIN_INPUT_TYPE_MOUSE ||
input->type == VIR_DOMAIN_INPUT_TYPE_KBD) &&
(ARCH_IS_X86(def->os.arch) || def->os.arch == VIR_ARCH_NONE)) {
+ input->bus = VIR_DOMAIN_INPUT_BUS_PS2;
} else if (ARCH_IS_S390(def->os.arch) ||
input->type == VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH) {
input->bus = VIR_DOMAIN_INPUT_BUS_VIRTIO;
--

View File

@ -1,99 +0,0 @@
From 1bb961797153a92a40a3c517114e4920c65672d4 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sat, 8 Jul 2023 22:20:39 -0400
Subject: [PATCH] util: add stub driver name to virPCIDevice object
There can be many different drivers that are of the type "VFIO", so
add the driver name to the object and allow getting/setting it.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/libvirt_private.syms | 2 ++
src/util/virpci.c | 17 +++++++++++++++++
src/util/virpci.h | 3 +++
3 files changed, 22 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 190bebdd625..0ca63f09552 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3082,6 +3082,7 @@ virPCIDeviceGetManaged;
virPCIDeviceGetName;
virPCIDeviceGetRemoveSlot;
virPCIDeviceGetReprobe;
+virPCIDeviceGetStubDriverName;
virPCIDeviceGetStubDriverType;
virPCIDeviceGetUnbindFromStub;
virPCIDeviceGetUsedBy;
@@ -3108,6 +3109,7 @@ virPCIDeviceReset;
virPCIDeviceSetManaged;
virPCIDeviceSetRemoveSlot;
virPCIDeviceSetReprobe;
+virPCIDeviceSetStubDriverName;
virPCIDeviceSetStubDriverType;
virPCIDeviceSetUnbindFromStub;
virPCIDeviceSetUsedBy;
diff --git a/src/util/virpci.c b/src/util/virpci.c
index d86a81c2b1d..a53a51d55e2 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -88,6 +88,7 @@ struct _virPCIDevice {
bool managed;
virPCIStubDriver stubDriverType;
+ char *stubDriverName; /* if blank, use default for type */
/* used by reattach function */
bool unbind_from_stub;
@@ -1508,6 +1509,7 @@ virPCIDeviceCopy(virPCIDevice *dev)
copy->path = g_strdup(dev->path);
copy->used_by_drvname = g_strdup(dev->used_by_drvname);
copy->used_by_domname = g_strdup(dev->used_by_domname);
+ copy->stubDriverName = g_strdup(dev->stubDriverName);
return copy;
}
@@ -1522,6 +1524,7 @@ virPCIDeviceFree(virPCIDevice *dev)
g_free(dev->path);
g_free(dev->used_by_drvname);
g_free(dev->used_by_domname);
+ g_free(dev->stubDriverName);
g_free(dev);
}
@@ -1581,6 +1584,20 @@ virPCIDeviceGetStubDriverType(virPCIDevice *dev)
return dev->stubDriverType;
}
+void
+virPCIDeviceSetStubDriverName(virPCIDevice *dev,
+ const char *driverName)
+{
+ g_free(dev->stubDriverName);
+ dev->stubDriverName = g_strdup(driverName);
+}
+
+const char *
+virPCIDeviceGetStubDriverName(virPCIDevice *dev)
+{
+ return dev->stubDriverName;
+}
+
bool
virPCIDeviceGetUnbindFromStub(virPCIDevice *dev)
{
diff --git a/src/util/virpci.h b/src/util/virpci.h
index 485f535bc91..f8f98f39de7 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -137,6 +137,9 @@ bool virPCIDeviceGetManaged(virPCIDevice *dev);
void virPCIDeviceSetStubDriverType(virPCIDevice *dev,
virPCIStubDriver driverType);
virPCIStubDriver virPCIDeviceGetStubDriverType(virPCIDevice *dev);
+void virPCIDeviceSetStubDriverName(virPCIDevice *dev,
+ const char *driverName);
+const char *virPCIDeviceGetStubDriverName(virPCIDevice *dev);
virPCIDeviceAddress *virPCIDeviceGetAddress(virPCIDevice *dev);
int virPCIDeviceSetUsedBy(virPCIDevice *dev,
const char *drv_name,

View File

@ -1,40 +0,0 @@
From 928296b044647fd3cbe409db6903afc791863a90 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sat, 8 Jul 2023 23:05:44 -0400
Subject: [PATCH] util: honor stubDriverName when probing/binding stub driver
for a device
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/util/virpci.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/util/virpci.c b/src/util/virpci.c
index f1936795da7..1158e468bf9 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -1290,17 +1290,20 @@ virPCIDeviceUnbindFromStub(virPCIDevice *dev)
static int
virPCIDeviceBindToStub(virPCIDevice *dev)
{
- const char *stubDriverName;
+ const char *stubDriverName = dev->stubDriverName;
g_autofree char *stubDriverPath = NULL;
g_autofree char *driverLink = NULL;
- /* Check the device is configured to use one of the known stub drivers */
+
if (dev->stubDriverType == VIR_PCI_STUB_DRIVER_NONE) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No stub driver configured for PCI device %1$s"),
dev->name);
return -1;
- } else if (!(stubDriverName = virPCIStubDriverTypeToString(dev->stubDriverType))) {
+ }
+
+ if (!stubDriverName
+ && !(stubDriverName = virPCIStubDriverTypeToString(dev->stubDriverType))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown stub driver configured for PCI device %1$s"),
dev->name);

View File

@ -1,250 +0,0 @@
From 6ce071f6097d9e96892d5a6c7bd3040f43cc925b Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Fri, 2 Jun 2023 14:34:51 -0400
Subject: [PATCH] util: permit existing binding to VFIO variant driver
Before a PCI device can be assigned to a guest with VFIO, that device
must be bound to the vfio-pci driver rather than to the device's
normal host driver. The vfio-pci driver provides APIs that permit QEMU
to perform all the necessary operations to make the device accessible
to the guest.
In the past vfio-pci was the only driver that supplied these APIs, but
there are now vendor/device-specific "VFIO variant" drivers that
provide the basic vfio-pci driver functionality/API while adding
support for device-specific operations (for example these
device-specific drivers may support live migration of certain
devices). All that is needed to make this functionality available is
to bind the vendor-specific "VFIO variant" driver to the device
(rather than the generic vfio-pci driver, which will continue to work,
just without the extra functionality).
But until now libvirt has required that all PCI devices being assigned
to a guest with VFIO specifically have the "vfio-pci" driver bound to
the device. So even if the user manually binds a shiny new
vendor-specific VFIO variant driver to the device (and puts
"managed='no'" in the config to prevent libvirt from changing the
binding), libvirt will just fail during startup of the guest (or
during hotplug) because the driver bound to the device isn't exactly
"vfio-pci".
Beginning with kernel 6.1, it's possible to determine from the sysfs
directory for a device whether the currently-bound driver is the
vfio-pci driver or a VFIO variant - the device directory will have a
subdirectory called "vfio-dev". We can use that to appropriately widen
the list of drivers that libvirt will allow for VFIO device
assignment.
This patch doesn't remove the explicit check for the exact "vfio-pci"
driver (since that would cause systems with pre-6.1 kernels to behave
incorrectly), but adds an additional check for the vfio-dev directory,
so that any VFIO variant driver is acceptable for libvirt to continue
setting up for VFIO device assignment.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/hypervisor/virhostdev.c | 28 +++++--------
src/libvirt_private.syms | 1 +
src/util/virpci.c | 78 ++++++++++++++++++++++++++++++++++---
src/util/virpci.h | 3 ++
4 files changed, 87 insertions(+), 23 deletions(-)
diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c
index 244f057c6ce..b95d6bf3d61 100644
--- a/src/hypervisor/virhostdev.c
+++ b/src/hypervisor/virhostdev.c
@@ -743,9 +743,8 @@ virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr,
mgr->inactivePCIHostdevs) < 0)
goto reattachdevs;
} else {
- g_autofree char *driverPath = NULL;
- g_autofree char *driverName = NULL;
- int stub;
+ g_autofree char *drvName = NULL;
+ virPCIStubDriver drvType;
/* Unmanaged devices should already have been marked as
* inactive: if that's the case, we can simply move on */
@@ -765,19 +764,17 @@ virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr,
* information about active / inactive device across
* daemon restarts has been implemented */
- if (virPCIDeviceGetCurrentDriverPathAndName(pci, &driverPath,
- &driverName) < 0) {
+ if (virPCIDeviceGetCurrentDriverNameAndType(pci, &drvName,
+ &drvType) < 0) {
goto reattachdevs;
}
- stub = virPCIStubDriverTypeFromString(driverName);
-
- if (stub > VIR_PCI_STUB_DRIVER_NONE &&
- stub < VIR_PCI_STUB_DRIVER_LAST) {
+ if (drvType > VIR_PCI_STUB_DRIVER_NONE) {
/* The device is bound to a known stub driver: store this
* information and add a copy to the inactive list */
- virPCIDeviceSetStubDriverType(pci, stub);
+ virPCIDeviceSetStubDriverType(pci, drvType);
+ virPCIDeviceSetStubDriverName(pci, drvName);
VIR_DEBUG("Adding PCI device %s to inactive list",
virPCIDeviceGetName(pci));
@@ -2291,18 +2288,13 @@ virHostdevPrepareOneNVMeDevice(virHostdevManager *hostdev_mgr,
/* Let's check if all PCI devices are NVMe disks. */
for (i = 0; i < virPCIDeviceListCount(pciDevices); i++) {
virPCIDevice *pci = virPCIDeviceListGet(pciDevices, i);
- g_autofree char *drvPath = NULL;
g_autofree char *drvName = NULL;
- int stub = VIR_PCI_STUB_DRIVER_NONE;
+ virPCIStubDriver drvType;
- if (virPCIDeviceGetCurrentDriverPathAndName(pci, &drvPath, &drvName) < 0)
+ if (virPCIDeviceGetCurrentDriverNameAndType(pci, &drvName, &drvType) < 0)
goto cleanup;
- if (drvName)
- stub = virPCIStubDriverTypeFromString(drvName);
-
- if (stub == VIR_PCI_STUB_DRIVER_VFIO ||
- STREQ_NULLABLE(drvName, "nvme"))
+ if (drvType == VIR_PCI_STUB_DRIVER_VFIO || STREQ_NULLABLE(drvName, "nvme"))
continue;
VIR_WARN("Suspicious NVMe disk assignment. PCI device "
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index cc564928170..ab049b38584 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3074,6 +3074,7 @@ virPCIDeviceFileIterate;
virPCIDeviceFree;
virPCIDeviceGetAddress;
virPCIDeviceGetConfigPath;
+virPCIDeviceGetCurrentDriverNameAndType;
virPCIDeviceGetCurrentDriverPathAndName;
virPCIDeviceGetIOMMUGroupDev;
virPCIDeviceGetIOMMUGroupList;
diff --git a/src/util/virpci.c b/src/util/virpci.c
index e6f7554b232..253ddccabdd 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -280,6 +280,73 @@ virPCIDeviceGetCurrentDriverPathAndName(virPCIDevice *dev,
}
+/**
+ * virPCIDeviceGetCurrentDriverNameAndType:
+ * @dev: virPCIDevice object to examine
+ * @drvName: returns name of driver bound to this device (if any)
+ * @drvType: returns type of driver if it is a known stub driver type
+ *
+ * Find the name of the driver bound to @dev (if any) and the type of
+ * the driver if it is a known/recognized "stub" driver (based on the
+ * driver name).
+ *
+ * There are vfio "variant" drivers that provide all the basic
+ * functionality of the standard vfio-pci driver as well as additional
+ * stuff. As of kernel 6.1, the vfio-pci driver and all vfio variant
+ * drivers can be identified (once the driver has been bound to a
+ * device) by looking for the subdirectory "vfio-dev" in the device's
+ * sysfs directory; for example, if the directory
+ * /sys/bus/pci/devices/0000:04:11.4/vfio-dev exists, then the driver
+ * that is currently bound to PCI device 0000:04:11.4 is either
+ * vfio-pci, or a vfio-pci variant driver.
+ *
+ * Return 0 on success, -1 on failure. If -1 is returned, then an error
+ * message has been logged.
+ */
+int
+virPCIDeviceGetCurrentDriverNameAndType(virPCIDevice *dev,
+ char **drvName,
+ virPCIStubDriver *drvType)
+{
+ g_autofree char *drvPath = NULL;
+ g_autofree char *vfioDevDir = NULL;
+ int tmpType;
+
+ if (virPCIDeviceGetCurrentDriverPathAndName(dev, &drvPath, drvName) < 0)
+ return -1;
+
+ if (!*drvName) {
+ *drvType = VIR_PCI_STUB_DRIVER_NONE;
+ return 0;
+ }
+
+ tmpType = virPCIStubDriverTypeFromString(*drvName);
+
+ if (tmpType > VIR_PCI_STUB_DRIVER_NONE) {
+ *drvType = tmpType;
+ return 0; /* exact match of a known driver name (or no name) */
+ }
+
+ /* If the sysfs directory of this device contains a directory
+ * named "vfio-dev" then the currently-bound driver is a vfio
+ * variant driver.
+ */
+
+ vfioDevDir = virPCIFile(dev->name, "vfio-dev");
+
+ if (virFileIsDir(vfioDevDir)) {
+ VIR_DEBUG("Driver %s is a vfio_pci driver", *drvName);
+ *drvType = VIR_PCI_STUB_DRIVER_VFIO;
+ } else {
+ VIR_DEBUG("Driver %s is NOT a vfio_pci driver, or kernel is too old",
+ *drvName);
+ *drvType = VIR_PCI_STUB_DRIVER_NONE;
+ }
+
+ return 0;
+}
+
+
static int
virPCIDeviceConfigOpenInternal(virPCIDevice *dev, bool readonly, bool fatal)
{
@@ -1007,8 +1074,8 @@ virPCIDeviceReset(virPCIDevice *dev,
virPCIDeviceList *activeDevs,
virPCIDeviceList *inactiveDevs)
{
- g_autofree char *drvPath = NULL;
g_autofree char *drvName = NULL;
+ virPCIStubDriver drvType;
int ret = -1;
int fd = -1;
int hdrType = -1;
@@ -1034,15 +1101,16 @@ virPCIDeviceReset(virPCIDevice *dev,
* reset it whenever appropriate, so doing it ourselves would just
* be redundant.
*/
- if (virPCIDeviceGetCurrentDriverPathAndName(dev, &drvPath, &drvName) < 0)
+ if (virPCIDeviceGetCurrentDriverNameAndType(dev, &drvName, &drvType) < 0)
goto cleanup;
- if (virPCIStubDriverTypeFromString(drvName) == VIR_PCI_STUB_DRIVER_VFIO) {
- VIR_DEBUG("Device %s is bound to vfio-pci - skip reset",
- dev->name);
+ if (drvType == VIR_PCI_STUB_DRIVER_VFIO) {
+
+ VIR_DEBUG("Device %s is bound to %s - skip reset", dev->name, drvName);
ret = 0;
goto cleanup;
}
+
VIR_DEBUG("Resetting device %s", dev->name);
if ((fd = virPCIDeviceConfigOpenWrite(dev)) < 0)
diff --git a/src/util/virpci.h b/src/util/virpci.h
index 19c910202a2..faca6cf6f99 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -283,6 +283,9 @@ int virPCIDeviceRebind(virPCIDevice *dev);
int virPCIDeviceGetCurrentDriverPathAndName(virPCIDevice *dev,
char **path,
char **name);
+int virPCIDeviceGetCurrentDriverNameAndType(virPCIDevice *dev,
+ char **drvName,
+ virPCIStubDriver *drvType);
int virPCIDeviceIsPCIExpress(virPCIDevice *dev);
int virPCIDeviceHasPCIExpressLink(virPCIDevice *dev);

View File

@ -1,107 +0,0 @@
From 2d9c9445b9cc093c870f101eb884ddeac3ae40f7 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sun, 9 Jul 2023 15:00:26 -0400
Subject: [PATCH] util: probe stub driver from within function that binds to
stub driver
virPCIProbeStubDriver() and virPCIDeviceBindToStub() both have
very similar code that locally sets a driver name (based on
stubDriverType). These two functions are each also called in just one
place (virPCIDeviceDetach()), with just a small bit of validation code
in between.
To eliminate the "duplicated" code (which is going to be expanded
slightly in upcoming patches to support manually or automatically
picking a VFIO variant driver), this patch modifies
virPCIProbeStubDriver() to take the driver name as an argument
(rather than the virPCIDevice object), and calls it from within
virPCIDeviceBindToStub() (rather than from that function's caller),
using the driverName it has just figured out with the
now-not-duplicated code.
(NB: Since it could be used to probe *any* driver module, the name is
changed to virPCIProbeDriver()).
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/util/virpci.c | 33 ++++++++++++---------------------
1 file changed, 12 insertions(+), 21 deletions(-)
diff --git a/src/util/virpci.c b/src/util/virpci.c
index 253ddccabdd..f1936795da7 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -1154,28 +1154,19 @@ virPCIDeviceReset(virPCIDevice *dev,
static int
-virPCIProbeStubDriver(virPCIStubDriver driver)
+virPCIProbeDriver(const char *driverName)
{
- const char *drvname = NULL;
g_autofree char *drvpath = NULL;
g_autofree char *errbuf = NULL;
- if (driver == VIR_PCI_STUB_DRIVER_NONE ||
- !(drvname = virPCIStubDriverTypeToString(driver))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s",
- _("Attempting to use unknown stub driver"));
- return -1;
- }
-
- drvpath = virPCIDriverDir(drvname);
+ drvpath = virPCIDriverDir(driverName);
/* driver previously loaded, return */
if (virFileExists(drvpath))
return 0;
- if ((errbuf = virKModLoad(drvname))) {
- VIR_WARN("failed to load driver %s: %s", drvname, errbuf);
+ if ((errbuf = virKModLoad(driverName))) {
+ VIR_WARN("failed to load driver %s: %s", driverName, errbuf);
goto cleanup;
}
@@ -1187,14 +1178,14 @@ virPCIProbeStubDriver(virPCIStubDriver driver)
/* If we know failure was because of admin config, let's report that;
* otherwise, report a more generic failure message
*/
- if (virKModIsProhibited(drvname)) {
+ if (virKModIsProhibited(driverName)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to load PCI stub module %1$s: administratively prohibited"),
- drvname);
+ _("Failed to load PCI driver module %1$s: administratively prohibited"),
+ driverName);
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to load PCI stub module %1$s"),
- drvname);
+ _("Failed to load PCI driver module %1$s"),
+ driverName);
}
return -1;
@@ -1316,6 +1307,9 @@ virPCIDeviceBindToStub(virPCIDevice *dev)
return -1;
}
+ if (virPCIProbeDriver(stubDriverName) < 0)
+ return -1;
+
stubDriverPath = virPCIDriverDir(stubDriverName);
driverLink = virPCIFile(dev->name, "driver");
@@ -1359,9 +1353,6 @@ virPCIDeviceDetach(virPCIDevice *dev,
virPCIDeviceList *activeDevs,
virPCIDeviceList *inactiveDevs)
{
- if (virPCIProbeStubDriver(dev->stubDriverType) < 0)
- return -1;
-
if (activeDevs && virPCIDeviceListFind(activeDevs, &dev->address)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Not detaching active device %1$s"), dev->name);

View File

@ -1,132 +0,0 @@
From 222b66974e8256965c089fb0f244dc1e01f708e7 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sat, 8 Jul 2023 23:12:09 -0400
Subject: [PATCH] util: rename virPCIDeviceGetDriverPathAndName
Instead, call it virPCIDeviceGetCurrentDriverPathAndName() to avoid
confusion with the device name that is stored in the virPCIDevice
object - that one is not necessarily the name of the current driver
for the device, but could instead be the driver that we want to be
bound to the device in the future.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/hypervisor/virhostdev.c | 7 ++++---
src/libvirt_private.syms | 2 +-
src/util/virpci.c | 10 ++++++----
src/util/virpci.h | 6 +++---
tests/virpcitest.c | 2 +-
5 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c
index c437ca9d22d..244f057c6ce 100644
--- a/src/hypervisor/virhostdev.c
+++ b/src/hypervisor/virhostdev.c
@@ -765,9 +765,10 @@ virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr,
* information about active / inactive device across
* daemon restarts has been implemented */
- if (virPCIDeviceGetDriverPathAndName(pci,
- &driverPath, &driverName) < 0)
+ if (virPCIDeviceGetCurrentDriverPathAndName(pci, &driverPath,
+ &driverName) < 0) {
goto reattachdevs;
+ }
stub = virPCIStubDriverTypeFromString(driverName);
@@ -2294,7 +2295,7 @@ virHostdevPrepareOneNVMeDevice(virHostdevManager *hostdev_mgr,
g_autofree char *drvName = NULL;
int stub = VIR_PCI_STUB_DRIVER_NONE;
- if (virPCIDeviceGetDriverPathAndName(pci, &drvPath, &drvName) < 0)
+ if (virPCIDeviceGetCurrentDriverPathAndName(pci, &drvPath, &drvName) < 0)
goto cleanup;
if (drvName)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 0ca63f09552..cc564928170 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3074,7 +3074,7 @@ virPCIDeviceFileIterate;
virPCIDeviceFree;
virPCIDeviceGetAddress;
virPCIDeviceGetConfigPath;
-virPCIDeviceGetDriverPathAndName;
+virPCIDeviceGetCurrentDriverPathAndName;
virPCIDeviceGetIOMMUGroupDev;
virPCIDeviceGetIOMMUGroupList;
virPCIDeviceGetLinkCapSta;
diff --git a/src/util/virpci.c b/src/util/virpci.c
index a53a51d55e2..e6f7554b232 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -228,7 +228,7 @@ virPCIFile(const char *device, const char *file)
}
-/* virPCIDeviceGetDriverPathAndName - put the path to the driver
+/* virPCIDeviceGetCurrentDriverPathAndName - put the path to the driver
* directory of the driver in use for this device in @path and the
* name of the driver in @name. Both could be NULL if it's not bound
* to any driver.
@@ -236,7 +236,9 @@ virPCIFile(const char *device, const char *file)
* Return 0 for success, -1 for error.
*/
int
-virPCIDeviceGetDriverPathAndName(virPCIDevice *dev, char **path, char **name)
+virPCIDeviceGetCurrentDriverPathAndName(virPCIDevice *dev,
+ char **path,
+ char **name)
{
int ret = -1;
g_autofree char *drvlink = NULL;
@@ -1032,7 +1034,7 @@ virPCIDeviceReset(virPCIDevice *dev,
* reset it whenever appropriate, so doing it ourselves would just
* be redundant.
*/
- if (virPCIDeviceGetDriverPathAndName(dev, &drvPath, &drvName) < 0)
+ if (virPCIDeviceGetCurrentDriverPathAndName(dev, &drvPath, &drvName) < 0)
goto cleanup;
if (virPCIStubDriverTypeFromString(drvName) == VIR_PCI_STUB_DRIVER_VFIO) {
@@ -1137,7 +1139,7 @@ virPCIDeviceUnbind(virPCIDevice *dev)
g_autofree char *drvpath = NULL;
g_autofree char *driver = NULL;
- if (virPCIDeviceGetDriverPathAndName(dev, &drvpath, &driver) < 0)
+ if (virPCIDeviceGetCurrentDriverPathAndName(dev, &drvpath, &driver) < 0)
return -1;
if (!driver)
diff --git a/src/util/virpci.h b/src/util/virpci.h
index f8f98f39de7..19c910202a2 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -280,9 +280,9 @@ virPCIVPDResource * virPCIDeviceGetVPD(virPCIDevice *dev);
int virPCIDeviceUnbind(virPCIDevice *dev);
int virPCIDeviceRebind(virPCIDevice *dev);
-int virPCIDeviceGetDriverPathAndName(virPCIDevice *dev,
- char **path,
- char **name);
+int virPCIDeviceGetCurrentDriverPathAndName(virPCIDevice *dev,
+ char **path,
+ char **name);
int virPCIDeviceIsPCIExpress(virPCIDevice *dev);
int virPCIDeviceHasPCIExpressLink(virPCIDevice *dev);
diff --git a/tests/virpcitest.c b/tests/virpcitest.c
index 92cc8c07c6f..d69a1b51183 100644
--- a/tests/virpcitest.c
+++ b/tests/virpcitest.c
@@ -37,7 +37,7 @@ testVirPCIDeviceCheckDriver(virPCIDevice *dev, const char *expected)
g_autofree char *path = NULL;
g_autofree char *driver = NULL;
- if (virPCIDeviceGetDriverPathAndName(dev, &path, &driver) < 0)
+ if (virPCIDeviceGetCurrentDriverPathAndName(dev, &path, &driver) < 0)
return -1;
if (STRNEQ_NULLABLE(driver, expected)) {

View File

@ -1,251 +0,0 @@
From cd2843f5463d93eee00fab31fe259ad1b5b27a27 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sat, 8 Jul 2023 22:11:06 -0400
Subject: [PATCH] util: use "stubDriverType" instead of just "stubDriver"
In the past we just kept track of the type of the "stub driver" (the
driver that is bound to a device in order to assign it to a
guest). The next commit will add a stubDriverName to go along with
type, so lets use stubDriverType for the existing enum to make it
easier to keep track of whether we're talking about the name or the
type.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/hypervisor/domain_driver.c | 4 ++--
src/hypervisor/virhostdev.c | 8 ++++----
src/libvirt_private.syms | 4 ++--
src/util/virnvme.c | 2 +-
src/util/virpci.c | 23 ++++++++++++-----------
src/util/virpci.h | 6 +++---
tests/virhostdevtest.c | 2 +-
tests/virpcitest.c | 8 ++++----
8 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/hypervisor/domain_driver.c b/src/hypervisor/domain_driver.c
index 66e09ffb04f..a70f75f3ae8 100644
--- a/src/hypervisor/domain_driver.c
+++ b/src/hypervisor/domain_driver.c
@@ -505,9 +505,9 @@ virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev,
return -1;
if (STREQ(driverName, "vfio"))
- virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(pci, VIR_PCI_STUB_DRIVER_VFIO);
else if (STREQ(driverName, "xen"))
- virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_XEN);
+ virPCIDeviceSetStubDriverType(pci, VIR_PCI_STUB_DRIVER_XEN);
return virHostdevPCINodeDeviceDetach(hostdevMgr, pci);
}
diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c
index eac34747836..c437ca9d22d 100644
--- a/src/hypervisor/virhostdev.c
+++ b/src/hypervisor/virhostdev.c
@@ -244,9 +244,9 @@ virHostdevGetPCIHostDevice(const virDomainHostdevDef *hostdev,
virPCIDeviceSetManaged(actual, hostdev->managed);
if (pcisrc->backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
- virPCIDeviceSetStubDriver(actual, VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(actual, VIR_PCI_STUB_DRIVER_VFIO);
} else if (pcisrc->backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN) {
- virPCIDeviceSetStubDriver(actual, VIR_PCI_STUB_DRIVER_XEN);
+ virPCIDeviceSetStubDriverType(actual, VIR_PCI_STUB_DRIVER_XEN);
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("pci backend driver '%1$s' is not supported"),
@@ -679,7 +679,7 @@ virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr,
for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) {
virPCIDevice *pci = virPCIDeviceListGet(pcidevs, i);
bool strict_acs_check = !!(flags & VIR_HOSTDEV_STRICT_ACS_CHECK);
- bool usesVFIO = (virPCIDeviceGetStubDriver(pci) == VIR_PCI_STUB_DRIVER_VFIO);
+ bool usesVFIO = (virPCIDeviceGetStubDriverType(pci) == VIR_PCI_STUB_DRIVER_VFIO);
struct virHostdevIsPCINodeDeviceUsedData data = {mgr, drv_name, dom_name, false};
int hdrType = -1;
@@ -776,7 +776,7 @@ virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr,
/* The device is bound to a known stub driver: store this
* information and add a copy to the inactive list */
- virPCIDeviceSetStubDriver(pci, stub);
+ virPCIDeviceSetStubDriverType(pci, stub);
VIR_DEBUG("Adding PCI device %s to inactive list",
virPCIDeviceGetName(pci));
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 00cf32d49e8..190bebdd625 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3082,7 +3082,7 @@ virPCIDeviceGetManaged;
virPCIDeviceGetName;
virPCIDeviceGetRemoveSlot;
virPCIDeviceGetReprobe;
-virPCIDeviceGetStubDriver;
+virPCIDeviceGetStubDriverType;
virPCIDeviceGetUnbindFromStub;
virPCIDeviceGetUsedBy;
virPCIDeviceGetVPD;
@@ -3108,7 +3108,7 @@ virPCIDeviceReset;
virPCIDeviceSetManaged;
virPCIDeviceSetRemoveSlot;
virPCIDeviceSetReprobe;
-virPCIDeviceSetStubDriver;
+virPCIDeviceSetStubDriverType;
virPCIDeviceSetUnbindFromStub;
virPCIDeviceSetUsedBy;
virPCIDeviceUnbind;
diff --git a/src/util/virnvme.c b/src/util/virnvme.c
index f7f8dc5ea91..37333d515b4 100644
--- a/src/util/virnvme.c
+++ b/src/util/virnvme.c
@@ -292,7 +292,7 @@ virNVMeDeviceCreatePCIDevice(const virNVMeDevice *nvme)
return NULL;
/* NVMe devices must be bound to vfio */
- virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(pci, VIR_PCI_STUB_DRIVER_VFIO);
virPCIDeviceSetManaged(pci, nvme->managed);
return g_steal_pointer(&pci);
diff --git a/src/util/virpci.c b/src/util/virpci.c
index cc2b07bbba0..d86a81c2b1d 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -87,7 +87,7 @@ struct _virPCIDevice {
bool managed;
- virPCIStubDriver stubDriver;
+ virPCIStubDriver stubDriverType;
/* used by reattach function */
bool unbind_from_stub;
@@ -1233,12 +1233,12 @@ virPCIDeviceBindToStub(virPCIDevice *dev)
g_autofree char *driverLink = NULL;
/* Check the device is configured to use one of the known stub drivers */
- if (dev->stubDriver == VIR_PCI_STUB_DRIVER_NONE) {
+ if (dev->stubDriverType == VIR_PCI_STUB_DRIVER_NONE) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No stub driver configured for PCI device %1$s"),
dev->name);
return -1;
- } else if (!(stubDriverName = virPCIStubDriverTypeToString(dev->stubDriver))) {
+ } else if (!(stubDriverName = virPCIStubDriverTypeToString(dev->stubDriverType))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown stub driver configured for PCI device %1$s"),
dev->name);
@@ -1267,9 +1267,10 @@ virPCIDeviceBindToStub(virPCIDevice *dev)
/* virPCIDeviceDetach:
*
* Detach this device from the host driver, attach it to the stub
- * driver (previously set with virPCIDeviceSetStubDriver(), and add *a
- * copy* of the object to the inactiveDevs list (if provided). This
- * function will *never* consume dev, so the caller should free it.
+ * driver (previously set with virPCIDeviceSetStubDriverType(), and
+ * add *a copy* of the object to the inactiveDevs list (if provided).
+ * This function will *never* consume dev, so the caller should free
+ * it.
*
* Returns 0 on success, -1 on failure (will fail if the device is
* already in the activeDevs list, but will be a NOP if the device is
@@ -1287,7 +1288,7 @@ virPCIDeviceDetach(virPCIDevice *dev,
virPCIDeviceList *activeDevs,
virPCIDeviceList *inactiveDevs)
{
- if (virPCIProbeStubDriver(dev->stubDriver) < 0)
+ if (virPCIProbeStubDriver(dev->stubDriverType) < 0)
return -1;
if (activeDevs && virPCIDeviceListFind(activeDevs, &dev->address)) {
@@ -1569,15 +1570,15 @@ virPCIDeviceGetManaged(virPCIDevice *dev)
}
void
-virPCIDeviceSetStubDriver(virPCIDevice *dev, virPCIStubDriver driver)
+virPCIDeviceSetStubDriverType(virPCIDevice *dev, virPCIStubDriver driverType)
{
- dev->stubDriver = driver;
+ dev->stubDriverType = driverType;
}
virPCIStubDriver
-virPCIDeviceGetStubDriver(virPCIDevice *dev)
+virPCIDeviceGetStubDriverType(virPCIDevice *dev)
{
- return dev->stubDriver;
+ return dev->stubDriverType;
}
bool
diff --git a/src/util/virpci.h b/src/util/virpci.h
index 4d9193f24e5..485f535bc91 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -134,9 +134,9 @@ int virPCIDeviceReset(virPCIDevice *dev,
void virPCIDeviceSetManaged(virPCIDevice *dev,
bool managed);
bool virPCIDeviceGetManaged(virPCIDevice *dev);
-void virPCIDeviceSetStubDriver(virPCIDevice *dev,
- virPCIStubDriver driver);
-virPCIStubDriver virPCIDeviceGetStubDriver(virPCIDevice *dev);
+void virPCIDeviceSetStubDriverType(virPCIDevice *dev,
+ virPCIStubDriver driverType);
+virPCIStubDriver virPCIDeviceGetStubDriverType(virPCIDevice *dev);
virPCIDeviceAddress *virPCIDeviceGetAddress(virPCIDevice *dev);
int virPCIDeviceSetUsedBy(virPCIDevice *dev,
const char *drv_name,
diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c
index ee0d1c1e6b8..04e6c009081 100644
--- a/tests/virhostdevtest.c
+++ b/tests/virhostdevtest.c
@@ -142,7 +142,7 @@ myInit(void)
if (!(dev[i] = virPCIDeviceNew(&subsys->u.pci.addr)))
goto cleanup;
- virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
}
for (i = 0; i < ndisks; i++) {
diff --git a/tests/virpcitest.c b/tests/virpcitest.c
index 769175d7c46..92cc8c07c6f 100644
--- a/tests/virpcitest.c
+++ b/tests/virpcitest.c
@@ -107,7 +107,7 @@ testVirPCIDeviceDetach(const void *opaque G_GNUC_UNUSED)
if (!(dev[i] = virPCIDeviceNew(&devAddr)))
goto cleanup;
- virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
if (virPCIDeviceDetach(dev[i], activeDevs, inactiveDevs) < 0)
goto cleanup;
@@ -149,7 +149,7 @@ testVirPCIDeviceReset(const void *opaque G_GNUC_UNUSED)
if (!(dev[i] = virPCIDeviceNew(&devAddr)))
goto cleanup;
- virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
if (virPCIDeviceReset(dev[i], activeDevs, inactiveDevs) < 0)
goto cleanup;
@@ -190,7 +190,7 @@ testVirPCIDeviceReattach(const void *opaque G_GNUC_UNUSED)
CHECK_LIST_COUNT(activeDevs, 0);
CHECK_LIST_COUNT(inactiveDevs, i + 1);
- virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
}
CHECK_LIST_COUNT(activeDevs, 0);
@@ -249,7 +249,7 @@ testVirPCIDeviceDetachSingle(const void *opaque)
if (!dev)
goto cleanup;
- virPCIDeviceSetStubDriver(dev, VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(dev, VIR_PCI_STUB_DRIVER_VFIO);
if (virPCIDeviceDetach(dev, NULL, NULL) < 0)
goto cleanup;

View File

@ -0,0 +1,77 @@
From 909564c3652d6f6fb5b68ebc5830c6cb524ac713 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Mon, 11 Mar 2024 15:34:37 +0100
Subject: [PATCH] qemu: domain: Check arch in qemuDomainMakeCPUMigratable
The content is arch specific and checking for Icelake-Server CPU model
on non-x86 architectures does not make sense.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
---
src/qemu/qemu_domain.c | 14 ++++++++++----
src/qemu/qemu_domain.h | 3 ++-
src/qemu/qemu_migration_cookie.c | 2 +-
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8c85446c3de..31a6509166d 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6588,10 +6588,15 @@ qemuDomainDefCopy(virQEMUDriver *driver,
int
-qemuDomainMakeCPUMigratable(virCPUDef *cpu)
+qemuDomainMakeCPUMigratable(virArch arch,
+ virCPUDef *cpu)
{
- if (cpu->mode == VIR_CPU_MODE_CUSTOM &&
- STREQ_NULLABLE(cpu->model, "Icelake-Server")) {
+ if (cpu->mode != VIR_CPU_MODE_CUSTOM ||
+ !cpu->model ||
+ !ARCH_IS_X86(arch))
+ return 0;
+
+ if (STREQ(cpu->model, "Icelake-Server")) {
/* Originally Icelake-Server CPU model contained pconfig CPU feature.
* It was never actually enabled and thus it was removed. To enable
* migration to QEMU 3.1.0 (with both new and old libvirt), we
@@ -6781,7 +6786,8 @@ qemuDomainDefFormatBufInternal(virQEMUDriver *driver,
return -1;
}
- if (def->cpu && qemuDomainMakeCPUMigratable(def->cpu) < 0)
+ if (def->cpu &&
+ qemuDomainMakeCPUMigratable(def->os.arch, def->cpu) < 0)
return -1;
/* Old libvirt doesn't understand <audio> elements so
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 98c188cc8f6..07b03182587 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -1045,7 +1045,8 @@ qemuDomainSupportsCheckpointsBlockjobs(virDomainObj *vm)
G_GNUC_WARN_UNUSED_RESULT;
int
-qemuDomainMakeCPUMigratable(virCPUDef *cpu);
+qemuDomainMakeCPUMigratable(virArch arch,
+ virCPUDef *cpu);
int
qemuDomainInitializePflashStorageSource(virDomainObj *vm,
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index 4361949cca4..c53d42a0184 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -545,7 +545,7 @@ qemuMigrationCookieAddCPU(qemuMigrationCookie *mig,
mig->cpu = virCPUDefCopy(vm->def->cpu);
- if (qemuDomainMakeCPUMigratable(mig->cpu) < 0)
+ if (qemuDomainMakeCPUMigratable(vm->def->os.arch, mig->cpu) < 0)
return -1;
mig->flags |= QEMU_MIGRATION_COOKIE_CPU;

View File

@ -0,0 +1,146 @@
From 14d3517410021d59cb53fb4c841a5d9922e814d1 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Mon, 11 Mar 2024 17:04:48 +0100
Subject: [PATCH] qemu: domain: Drop added features from migratable CPU
Features marked with added='yes' in CPU model definitions have to be
removed before migration, otherwise older libvirt would complain about
unknown CPU features. We only do this for features that were enabled for
a given CPU model even with older libvirt, which just ignored the
features. And only for features we added ourselves when updating CPU
definition during domain startup, that is we do not remove features
which were explicitly mentioned by a user.
That said, this is not the safest thing we could do, but it's
effectively the same thing we did before the affected features were
added: we ignored them completely on both sides of migration.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
---
src/qemu/qemu_domain.c | 50 ++++++++++++++++++++++++++++++--
src/qemu/qemu_domain.h | 3 +-
src/qemu/qemu_migration_cookie.c | 5 +++-
3 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 31a6509166d..bc6cf133d4c 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -66,6 +66,7 @@
#include "backup_conf.h"
#include "virutil.h"
#include "virsecureerase.h"
+#include "cpu/cpu_x86.h"
#include <sys/time.h>
#include <fcntl.h>
@@ -6587,10 +6588,36 @@ qemuDomainDefCopy(virQEMUDriver *driver,
}
+typedef struct {
+ const char * const *added;
+ GStrv keep;
+} qemuDomainDropAddedCPUFeaturesData;
+
+
+static bool
+qemuDomainDropAddedCPUFeatures(const char *name,
+ virCPUFeaturePolicy policy G_GNUC_UNUSED,
+ void *opaque)
+{
+ qemuDomainDropAddedCPUFeaturesData *data = opaque;
+
+ if (!g_strv_contains(data->added, name))
+ return true;
+
+ if (data->keep && g_strv_contains((const char **) data->keep, name))
+ return true;
+
+ return false;
+}
+
+
int
qemuDomainMakeCPUMigratable(virArch arch,
- virCPUDef *cpu)
+ virCPUDef *cpu,
+ virCPUDef *origCPU)
{
+ qemuDomainDropAddedCPUFeaturesData data = { 0 };
+
if (cpu->mode != VIR_CPU_MODE_CUSTOM ||
!cpu->model ||
!ARCH_IS_X86(arch))
@@ -6608,6 +6635,25 @@ qemuDomainMakeCPUMigratable(virArch arch,
return -1;
}
+ if (virCPUx86GetAddedFeatures(cpu->model, &data.added) < 0)
+ return -1;
+
+ /* Drop features marked as added in a cpu model, but only
+ * when they are not mentioned in origCPU, i.e., when they were not
+ * explicitly mentioned by the user.
+ */
+ if (data.added) {
+ g_auto(GStrv) keep = NULL;
+
+ if (origCPU) {
+ keep = virCPUDefListExplicitFeatures(origCPU);
+ data.keep = keep;
+ }
+
+ if (virCPUDefFilterFeatures(cpu, qemuDomainDropAddedCPUFeatures, &data) < 0)
+ return -1;
+ }
+
return 0;
}
@@ -6787,7 +6833,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriver *driver,
}
if (def->cpu &&
- qemuDomainMakeCPUMigratable(def->os.arch, def->cpu) < 0)
+ qemuDomainMakeCPUMigratable(def->os.arch, def->cpu, origCPU) < 0)
return -1;
/* Old libvirt doesn't understand <audio> elements so
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 07b03182587..626df6338f1 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -1046,7 +1046,8 @@ qemuDomainSupportsCheckpointsBlockjobs(virDomainObj *vm)
int
qemuDomainMakeCPUMigratable(virArch arch,
- virCPUDef *cpu);
+ virCPUDef *cpu,
+ virCPUDef *origCPU);
int
qemuDomainInitializePflashStorageSource(virDomainObj *vm,
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index c53d42a0184..90cc079c1a2 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -540,12 +540,15 @@ static int
qemuMigrationCookieAddCPU(qemuMigrationCookie *mig,
virDomainObj *vm)
{
+ qemuDomainObjPrivate *priv = vm->privateData;
+
if (mig->cpu)
return 0;
mig->cpu = virCPUDefCopy(vm->def->cpu);
- if (qemuDomainMakeCPUMigratable(vm->def->os.arch, mig->cpu) < 0)
+ if (qemuDomainMakeCPUMigratable(vm->def->os.arch, mig->cpu,
+ priv->origCPU) < 0)
return -1;
mig->flags |= QEMU_MIGRATION_COOKIE_CPU;

View File

@ -0,0 +1,34 @@
From a9da0092198ba2f278cea370f8251f2e29f57c7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Tue, 5 Mar 2024 14:55:26 +0100
Subject: [PATCH] qemu: virtiofs: do not crash if cgroups are missing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
On domain startup, qemuSetupCgroupForExtDevices checks
if a cgroup controller is present and skips the setup if not.
Add a similar check to qemuVirtioFSSetupCgroup to prevent
crashing when hotplugging a virtiofs filesystem.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_virtiofs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c
index d539d0a192e..15dea3bb57f 100644
--- a/src/qemu/qemu_virtiofs.c
+++ b/src/qemu/qemu_virtiofs.c
@@ -353,6 +353,9 @@ qemuVirtioFSSetupCgroup(virDomainObj *vm,
pid_t pid = -1;
int rc;
+ if (!cgroup)
+ return 0;
+
if (!(pidfile = qemuVirtioFSCreatePidFilename(vm, fs->info.alias)))
return -1;

View File

@ -0,0 +1,29 @@
From c9de7a1c3bca9f0732205f2c2b84526781dbf5e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Thu, 7 Mar 2024 13:36:45 +0100
Subject: [PATCH] qemu: virtiofs: error out if getting the group or user name
fails
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_virtiofs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c
index d80cddd3ba9..78897d81778 100644
--- a/src/qemu/qemu_virtiofs.c
+++ b/src/qemu/qemu_virtiofs.c
@@ -388,6 +388,9 @@ qemuVirtioFSPrepareIdMap(virDomainFSDef *fs)
username = virGetUserName(euid);
groupname = virGetGroupName(egid);
+ if (!username || !groupname)
+ return -1;
+
fs->idmap.uidmap = g_new0(virDomainIdMapEntry, 2);
fs->idmap.gidmap = g_new0(virDomainIdMapEntry, 2);

View File

@ -0,0 +1,31 @@
From 4c5b2e1e0d0d0cbbf8c6ed28ce77d055d5974f7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Wed, 6 Mar 2024 17:26:40 +0100
Subject: [PATCH] qemu: virtiofs: set correct label when creating the socket
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Use svirt_t instead of virtd_t, since virtd_t is not available in the
session mode and qemu with svirt_t won't be able to talk to unconfined_t
socket.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_virtiofs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c
index 15dea3bb57f..d80cddd3ba9 100644
--- a/src/qemu/qemu_virtiofs.c
+++ b/src/qemu/qemu_virtiofs.c
@@ -102,7 +102,7 @@ qemuVirtioFSOpenChardev(virQEMUDriver *driver,
chrdev->data.nix.listen = true;
chrdev->data.nix.path = g_strdup(socket_path);
- if (qemuSecuritySetDaemonSocketLabel(driver->securityManager, vm->def) < 0)
+ if (qemuSecuritySetSocketLabel(driver->securityManager, vm->def) < 0)
goto cleanup;
fd = qemuOpenChrChardevUNIXSocket(chrdev);
if (fd < 0) {

View File

@ -1,31 +0,0 @@
From edaa1112ffef253013dcc3318794cebfaa2a6cb7 Mon Sep 17 00:00:00 2001
From: Peter Krempa <pkrempa@redhat.com>
Date: Mon, 29 Jan 2024 16:12:09 +0100
Subject: [PATCH] schema: nodedev: Adjust allowed characters in
'vpdFieldValueFormat'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The check in 'virPCIVPDResourceIsValidTextValue' allows any printable
characters, thus the XML schema should do the same.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/conf/schemas/nodedev.rng | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/schemas/nodedev.rng b/src/conf/schemas/nodedev.rng
index fba40217540..ff073139681 100644
--- a/src/conf/schemas/nodedev.rng
+++ b/src/conf/schemas/nodedev.rng
@@ -869,7 +869,7 @@
<define name="vpdFieldValueFormat">
<data type="string">
- <param name="pattern">[0-9a-zA-F -_,.:;=]{0,255}</param>
+ <param name="pattern">.{0,255}</param>
</data>
</define>

View File

@ -1,80 +0,0 @@
From 9eda33161f49fcf3ba07d648bd80d2a9a2388479 Mon Sep 17 00:00:00 2001
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 23 Jan 2024 16:40:34 +0100
Subject: [PATCH] tests: Test the previously mishandled PCI VPD characters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Modify the test data to validate '<>' and other characters.
Unfortunately the test suite doesn't have a proper end-to-end test, thus
we just add a XML->XML variant and also add data to the binary parser.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
tests/nodedevschemadata/pci_0000_42_00_0_vpd.xml | 4 ++--
tests/virpcimock.c | 4 ++--
tests/virpcivpdtest.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/nodedevschemadata/pci_0000_42_00_0_vpd.xml b/tests/nodedevschemadata/pci_0000_42_00_0_vpd.xml
index 8b56e4f6b41..c9a2901381a 100644
--- a/tests/nodedevschemadata/pci_0000_42_00_0_vpd.xml
+++ b/tests/nodedevschemadata/pci_0000_42_00_0_vpd.xml
@@ -15,7 +15,7 @@
<change_level>B1</change_level>
<manufacture_id>foobar</manufacture_id>
<part_number>MBF2H332A-AEEOT</part_number>
- <serial_number>MT2113X00000</serial_number>
+ <serial_number>MT2113X00000&gt;&lt;</serial_number>
<vendor_field index='0'>PCIeGen4 x8</vendor_field>
<vendor_field index='2'>MBF2H332A-AEEOT</vendor_field>
<vendor_field index='3'>3c53d07eec484d8aab34dabd24fe575aa</vendor_field>
@@ -25,7 +25,7 @@
<asset_tag>fooasset</asset_tag>
<vendor_field index='0'>vendorfield0</vendor_field>
<vendor_field index='2'>vendorfield2</vendor_field>
- <vendor_field index='A'>vendorfieldA</vendor_field>
+ <vendor_field index='A'>!@#$./&gt;&lt;</vendor_field>
<system_field index='B'>systemfieldB</system_field>
<system_field index='0'>systemfield0</system_field>
</fields>
diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index 13b37bb23d4..2f98b0cf13e 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -957,9 +957,9 @@ init_env(void)
't', 'e', 's', 't', 'n', 'a', 'm', 'e',
PCI_VPD_LARGE_RESOURCE_FLAG | PCI_VPD_READ_ONLY_LARGE_RESOURCE_FLAG, 0x16, 0x00,
'P', 'N', 0x02, '4', '2',
- 'E', 'C', 0x04, '4', '2', '4', '2',
+ 'E', 'C', 0x04, '4', '<', '>', '2',
'V', 'A', 0x02, 'E', 'X',
- 'R', 'V', 0x02, 0x31, 0x00,
+ 'R', 'V', 0x02, 0x1D, 0x00,
PCI_VPD_RESOURCE_END_VAL
};
struct pciVPD exampleVPD = {
diff --git a/tests/virpcivpdtest.c b/tests/virpcivpdtest.c
index b4dd68b7aa8..ae5772d3f56 100644
--- a/tests/virpcivpdtest.c
+++ b/tests/virpcivpdtest.c
@@ -424,7 +424,7 @@ testPCIVPDGetFieldValueFormat(const void *data G_GNUC_UNUSED)
# define VPD_W_EXAMPLE_FIELDS \
'V', 'Z', 0x02, '4', '2', \
- 'Y', 'A', 0x04, 'I', 'D', '4', '2', \
+ 'Y', 'A', 0x04, '!', '<', '>', ':', \
'Y', 'F', 0x02, 'E', 'X', \
'Y', 'E', 0x00, \
'R', 'W', 0x02, 0x00, 0x00
@@ -579,7 +579,7 @@ testVirPCIVPDParseFullVPD(const void *opaque G_GNUC_UNUSED)
if (testVirPCIVPDValidateExampleReadOnlyFields(res))
return -1;
- if (STRNEQ_NULLABLE(res->rw->asset_tag, "ID42"))
+ if (STRNEQ_NULLABLE(res->rw->asset_tag, "!<>:"))
return -1;
if (!res->rw->vendor_specific)

View File

@ -1,54 +0,0 @@
From eb3844009dc3bdd50274954618b8cd9962218317 Mon Sep 17 00:00:00 2001
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 24 Jan 2024 15:53:39 +0100
Subject: [PATCH] util: pcivpd: Refactor virPCIVPDResourceIsValidTextValue
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The function is never called with NULL argument. Remove the check and
refactor the rest including the debug statement.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/util/virpcivpd.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
index 248a9b2790e..81c7c317b34 100644
--- a/src/util/virpcivpd.c
+++ b/src/util/virpcivpd.c
@@ -175,23 +175,18 @@ virPCIVPDResourceGetFieldValueFormat(const char *keyword)
bool
virPCIVPDResourceIsValidTextValue(const char *value)
{
- size_t i = 0;
+ const char *v;
+ bool ret = true;
- if (value == NULL)
- return false;
-
- /* An empty string is a valid value. */
- if (STREQ(value, ""))
- return true;
-
- while (i < strlen(value)) {
- if (!g_ascii_isprint(value[i])) {
- VIR_DEBUG("The provided value contains non-ASCII printable characters: %s", value);
- return false;
+ for (v = value; *v; v++) {
+ if (!g_ascii_isprint(*v)) {
+ ret = false;
+ break;
}
- ++i;
}
- return true;
+
+ VIR_DEBUG("val='%s' ret='%d'", value, ret);
+ return ret;
}
void

View File

@ -1,86 +0,0 @@
From 2ccac1e42f34404e3a5af22671a31fa1dca94e94 Mon Sep 17 00:00:00 2001
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 30 Jan 2024 17:11:37 +0100
Subject: [PATCH] virNodeDeviceCapVPDFormat: Properly escape system-originated
strings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Similarly to previous commit other specific fields which come from the
system data and aren't sanitized enough to be safe for XML were also
formatted via virBufferAsprintf.
Other static and safe strings used virBufferEscapeString instead of
virBufferAddLit.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/conf/node_device_conf.c | 32 +++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 87c046e571d..95de77abe9d 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -270,14 +270,6 @@ virNodeDeviceCapVPDFormatCustomSystemField(virPCIVPDResourceCustom *field, virBu
virNodeDeviceCapVPDFormatCustomField(buf, "system_field", field);
}
-static inline void
-virNodeDeviceCapVPDFormatRegularField(virBuffer *buf, const char *keyword, const char *value)
-{
- if (keyword == NULL || value == NULL)
- return;
-
- virBufferAsprintf(buf, "<%s>%s</%s>\n", keyword, value, keyword);
-}
static void
virNodeDeviceCapVPDFormat(virBuffer *buf, virPCIVPDResource *res)
@@ -290,31 +282,33 @@ virNodeDeviceCapVPDFormat(virBuffer *buf, virPCIVPDResource *res)
virBufferEscapeString(buf, "<name>%s</name>\n", res->name);
if (res->ro != NULL) {
- virBufferEscapeString(buf, "<fields access='%s'>\n", "readonly");
-
+ virBufferAddLit(buf, "<fields access='readonly'>\n");
virBufferAdjustIndent(buf, 2);
- virNodeDeviceCapVPDFormatRegularField(buf, "change_level", res->ro->change_level);
- virNodeDeviceCapVPDFormatRegularField(buf, "manufacture_id", res->ro->manufacture_id);
- virNodeDeviceCapVPDFormatRegularField(buf, "part_number", res->ro->part_number);
- virNodeDeviceCapVPDFormatRegularField(buf, "serial_number", res->ro->serial_number);
+
+ virBufferEscapeString(buf, "<change_level>%s</change_level>\n", res->ro->change_level);
+ virBufferEscapeString(buf, "<manufacture_id>%s</manufacture_id>\n", res->ro->manufacture_id);
+ virBufferEscapeString(buf, "<part_number>%s</part_number>\n", res->ro->part_number);
+ virBufferEscapeString(buf, "<serial_number>%s</serial_number>\n", res->ro->serial_number);
+
g_ptr_array_foreach(res->ro->vendor_specific,
(GFunc)virNodeDeviceCapVPDFormatCustomVendorField, buf);
- virBufferAdjustIndent(buf, -2);
+ virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</fields>\n");
}
if (res->rw != NULL) {
- virBufferEscapeString(buf, "<fields access='%s'>\n", "readwrite");
-
+ virBufferAddLit(buf, "<fields access='readwrite'>\n");
virBufferAdjustIndent(buf, 2);
- virNodeDeviceCapVPDFormatRegularField(buf, "asset_tag", res->rw->asset_tag);
+
+ virBufferEscapeString(buf, "<asset_tag>%s</asset_tag>\n", res->rw->asset_tag);
+
g_ptr_array_foreach(res->rw->vendor_specific,
(GFunc)virNodeDeviceCapVPDFormatCustomVendorField, buf);
g_ptr_array_foreach(res->rw->system_specific,
(GFunc)virNodeDeviceCapVPDFormatCustomSystemField, buf);
- virBufferAdjustIndent(buf, -2);
+ virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</fields>\n");
}

View File

@ -1,72 +0,0 @@
From 5373b8c02ce44d0284bc9c60b3b7bc12bff2f867 Mon Sep 17 00:00:00 2001
From: Peter Krempa <pkrempa@redhat.com>
Date: Mon, 29 Jan 2024 15:15:03 +0100
Subject: [PATCH] virNodeDeviceCapVPDFormatCustom*: Escape unsanitized strings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The custom field data is taken from PCI device data which can contain
any printable characters, and thus must be escaped when putting into
XML.
Originally, based on the comment and XML schema which was fixed in
previous commits the idea seemed to be that the parser would validate
that only characters which don't break the XML would be present but that
didn't seem to materialize.
Switch to proper escaping of the XML.
Fixes: 3954378d06a
Resolves: https://issues.redhat.com/browse/RHEL-22314
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/conf/node_device_conf.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 4826be6f423..87c046e571d 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -242,23 +242,32 @@ virNodeDeviceCapMdevTypesFormat(virBuffer *buf,
}
static void
-virNodeDeviceCapVPDFormatCustomVendorField(virPCIVPDResourceCustom *field, virBuffer *buf)
+virNodeDeviceCapVPDFormatCustomField(virBuffer *buf,
+ const char *fieldtype,
+ virPCIVPDResourceCustom *field)
{
+ g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
+ g_auto(virBuffer) content = VIR_BUFFER_INITIALIZER;
+
if (field == NULL || field->value == NULL)
return;
- virBufferAsprintf(buf, "<vendor_field index='%c'>%s</vendor_field>\n", field->idx,
- field->value);
+ virBufferAsprintf(&attrBuf, " index='%c'", field->idx);
+ virBufferEscapeString(&content, "%s", field->value);
+
+ virXMLFormatElementInternal(buf, fieldtype, &attrBuf, &content, false, false);
}
static void
-virNodeDeviceCapVPDFormatCustomSystemField(virPCIVPDResourceCustom *field, virBuffer *buf)
+virNodeDeviceCapVPDFormatCustomVendorField(virPCIVPDResourceCustom *field, virBuffer *buf)
{
- if (field == NULL || field->value == NULL)
- return;
+ virNodeDeviceCapVPDFormatCustomField(buf, "vendor_field", field);
+}
- virBufferAsprintf(buf, "<system_field index='%c'>%s</system_field>\n", field->idx,
- field->value);
+static void
+virNodeDeviceCapVPDFormatCustomSystemField(virPCIVPDResourceCustom *field, virBuffer *buf)
+{
+ virNodeDeviceCapVPDFormatCustomField(buf, "system_field", field);
}
static inline void

View File

@ -1,46 +0,0 @@
From 42df6cc1b4acc40d05ff6bc8e85587e4faec6cac Mon Sep 17 00:00:00 2001
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 24 Jan 2024 15:24:27 +0100
Subject: [PATCH] virPCIVPDResourceIsValidTextValue: Adjust comment to reflect
actual code
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The function does not reject '&', '<', '>' contrary to what it actually
states. Move and adjust the comment.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/util/virpcivpd.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
index 39557c73479..248a9b2790e 100644
--- a/src/util/virpcivpd.c
+++ b/src/util/virpcivpd.c
@@ -167,19 +167,15 @@ virPCIVPDResourceGetFieldValueFormat(const char *keyword)
* value or text field value. The expectations are based on the keywords specified
* in relevant sections of PCI(e) specifications
* ("I.3. VPD Definitions" in PCI specs, "6.28.1 VPD Format" PCIe 4.0).
+ *
+ * The PCI(e) specs mention alphanumeric characters when talking about text fields
+ * and the string resource but also include spaces and dashes in the provided example.
+ * Dots, commas, equal signs have also been observed in values used by major device vendors.
*/
bool
virPCIVPDResourceIsValidTextValue(const char *value)
{
size_t i = 0;
- /*
- * The PCI(e) specs mention alphanumeric characters when talking about text fields
- * and the string resource but also include spaces and dashes in the provided example.
- * Dots, commas, equal signs have also been observed in values used by major device vendors.
- * The specs do not specify a full set of allowed code points and for Libvirt it is important
- * to keep values in the ranges allowed within XML elements (mainly excluding less-than,
- * greater-than and ampersand).
- */
if (value == NULL)
return false;

View File

@ -270,7 +270,7 @@
Summary: Library providing a simple virtualization API
Name: libvirt
Version: 10.0.0
Release: 4%{?dist}%{?extra_release}
Release: 6%{?dist}%{?extra_release}.alma.1
License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
URL: https://libvirt.org/
@ -340,43 +340,52 @@ Patch58: libvirt-qemuMigrationDstPrepareStorage-Properly-consider-path-for-vdpa-
Patch59: libvirt-domain_validate-Account-for-NVDIMM-label-size-properly-when-checking-for-memory-conflicts.patch
# Patches were taken from:
# https://github.com/libvirt/libvirt/commit/cd2843f5463d93eee00fab31fe259ad1b5b27a27.patch
Patch35: libvirt-util-use-stubDriverType-instead-of-just-stubDriver.patch
# https://github.com/libvirt/libvirt/commit/1bb961797153a92a40a3c517114e4920c65672d4.patch
Patch36: libvirt-util-add-stub-driver-name-to-virPCIDevice-object.patch
# https://github.com/libvirt/libvirt/commit/222b66974e8256965c089fb0f244dc1e01f708e7.patch
Patch37: libvirt-util-rename-virPCIDeviceGetDriverPathAndName.patch
# https://github.com/libvirt/libvirt/commit/6ce071f6097d9e96892d5a6c7bd3040f43cc925b.patch
Patch38: libvirt-util-permit-existing-binding-to-VFIO-variant-driver.patch
# https://github.com/libvirt/libvirt/commit/2d9c9445b9cc093c870f101eb884ddeac3ae40f7.patch
Patch39: libvirt-util-probe-stub-driver-from-within-function-that-binds-to-stub-driver.patch
# https://github.com/libvirt/libvirt/commit/928296b044647fd3cbe409db6903afc791863a90.patch
Patch40: libvirt-util-honor-stubDriverName-when-probing.patch
# https://github.com/libvirt/libvirt/commit/24beaffec33efa3fa077d7b8596d97aa9a038a01.patch
Patch41: libvirt-node_device-support-binding-other-drivers-with-virNodeDevice.patch
# https://github.com/libvirt/libvirt/commit/10e8a518a05922d5592d1405054aed3195aebf06.patch
Patch42: libvirt-qemu-turn-two-multiline-log-messages-into-single-line.patch
# https://github.com/libvirt/libvirt/commit/bbfcf18f504b0eb165c0bbfe2f34b4e20d11c355.patch
Patch43: libvirt-docs-update-description-of-virsh-nodedev-detach.patch
# https://gitlab.com/libvirt/libvirt/-/issues/577
# https://gitlab.com/libvirt/libvirt/-/commit/c9056e682a8a67dc29e39eb01392fcf8ee978c31
Patch44: libvirt-regression-input-default-bus.patch
# https://github.com/libvirt/libvirt/commit/42df6cc1b4acc40d05ff6bc8e85587e4faec6cac
Patch45: virPCIVPDResourceIsValidTextValue-Adjust-comment-to-reflect-actual-code.patch
# https://github.com/libvirt/libvirt/commit/eb3844009dc3bdd50274954618b8cd9962218317
Patch46: util-pcivpd-Refactor-virPCIVPDResourceIsValidTextValue.patch
# https://github.com/libvirt/libvirt/commit/5373b8c02ce44d0284bc9c60b3b7bc12bff2f867
Patch47: virNodeDeviceCapVPDFormatCustom-Escape-unsanitized-strings.patch
# https://github.com/libvirt/libvirt/commit/2ccac1e42f34404e3a5af22671a31fa1dca94e94
Patch48: virNodeDeviceCapVPDFormat-Properly-escape-system-originated.patch
# https://github.com/libvirt/libvirt/commit/edaa1112ffef253013dcc3318794cebfaa2a6cb7
Patch49: schema-nodedev-Adjust-allowed-characters-in-vpdFieldValueFormat.patch
# https://github.com/libvirt/libvirt/commit/9eda33161f49fcf3ba07d648bd80d2a9a2388479
Patch50: tests-Test-the-previously-mishandled-PCI-VPD-characters.patch
# https://github.com/libvirt/libvirt/commit/bfe53e9145cd5996a791c5caff0686572b850f82
Patch51: cpu_map-Add-cpu-model-EPYC-Genoa.patch
# https://github.com/libvirt/libvirt/commit/5fbfa5ab8a3bf914d2deacd0d281b16aafd593b5.patch
Patch60: cpu-x86-Add-support-for-adding-features-to-existing-CPU-models.patch
# https://github.com/libvirt/libvirt/commit/909564c3652d6f6fb5b68ebc5830c6cb524ac713.patch
Patch61: qemu-domain-Check-arch-in-qemuDomainMakeCPUMigratable.patch
# https://github.com/libvirt/libvirt/commit/577c4ca414b26c8586f2586978e55c948bec0a32.patch
Patch62: conf-cpu-Introduce-virCPUDefListFeatures.patch
# https://github.com/libvirt/libvirt/commit/14d3517410021d59cb53fb4c841a5d9922e814d1.patch
Patch63: qemu-domain-Drop-added-features-from-migratable-CPU.patch
# https://github.com/libvirt/libvirt/commit/ce330dd7e5405573c77801a418345804049315ab.patch
Patch64: libvirt-Add-vmx-features-to-Broadwell.patch
# https://github.com/libvirt/libvirt/commit/5db61952252fa2ab88cc79f064f8f1b61b6c95cb.patch
Patch65: libvirt-Add-vmx-features-to-Cascadelake.patch
# https://github.com/libvirt/libvirt/commit/9cb8c372cd75647e09fac96e6995adab5e8dde79.patch
Patch66: libvirt-Add-vmx-features-to-Conroe.patch
# https://github.com/libvirt/libvirt/commit/cbee851581fc82ea95d7b6309b85e22f9d1ba0d3.patch
Patch67: libvirt-Add-vmx-features-to-Cooperlake.patch
# https://github.com/libvirt/libvirt/commit/823c7005a3b0d5275b30ca811479995bfa5820e9.patch
Patch68: libvirt-Add-vmx-features-to-core2duo.patch
# https://github.com/libvirt/libvirt/commit/b44679c31f2d46e88ce655c03aef4c3e9ab621ac.patch
Patch69: libvirt-Add-vmx-features-to-Haswell.patch
# https://github.com/libvirt/libvirt/commit/a6f3eafc402fbaf18b2e23e93c8c7339317c7d97.patch
Patch70: libvirt-Add-vmx-features-to-Icelake.patch
# https://github.com/libvirt/libvirt/commit/4b707f8bb0003b87f67474bfac02a2feac26c96f.patch
Patch71: libvirt-Add-vmx-features-to-IvyBridge.patch
# https://github.com/libvirt/libvirt/commit/1d03f78c5d0fa2d3422e76bef4c9369ab623bd52.patch
Patch72: libvirt-Add-vmx-features-to-kvm.patch
# https://github.com/libvirt/libvirt/commit/a539910c942f5993b967f8265756e3a10363e4f4.patch
Patch73: libvirt-Add-vmx-features-to-Nehalem.patch
# https://github.com/libvirt/libvirt/commit/c6fadbb2807c80bd2b812eebd932eb4a34067ccd.patch
Patch74: libvirt-Add-vmx-features-to-Penryn.patch
# https://github.com/libvirt/libvirt/commit/29d492d6488e35db2e96a017ac3fb2712dcb638c.patch
Patch75: libvirt-Add-vmx-features-to-SandyBridge.patch
# https://github.com/libvirt/libvirt/commit/e67004ec1cec850baa65177d88c6db09376869d3.patch
Patch76: libvirt-Add-vmx-features-to-SapphireRapids.patch
# https://github.com/libvirt/libvirt/commit/aa064b38fdbafd39d296a0933b7d1b8987eb4cb5.patch
Patch77: libvirt-Add-vmx-features-to-Skylake.patch
# https://github.com/libvirt/libvirt/commit/64e3c1138a81b98f14e5f1aa1e8e2bb85cfdd1e5.patch
Patch78: libvirt-Add-vmx-features-to-Snowridge.patch
# https://github.com/libvirt/libvirt/commit/6898b7cd8d61d46db7e92f6cf81daf085b85f724.patch
Patch79: libvirt-Add-vmx-features-to-Westmere.patch
# https://github.com/libvirt/libvirt/commit/a9da0092198ba2f278cea370f8251f2e29f57c7d.patch
Patch80: qemu-virtiofs-do-not-crash-if-cgroups-are-missing.patch
# https://github.com/libvirt/libvirt/commit/4c5b2e1e0d0d0cbbf8c6ed28ce77d055d5974f7f.patch
Patch81: qemu-virtiofs-set-correct-label-when-creating-the-socket.patch
# https://github.com/libvirt/libvirt/commit/c9de7a1c3bca9f0732205f2c2b84526781dbf5e5.patch
Patch82: qemu-virtiofs-error-out-if-getting-the-group-or-user-namefails.patch
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release}
@ -583,46 +592,10 @@ Requires: libvirt-daemon-plugin-lockd = %{version}-%{release}
Requires: libvirt-daemon-log = %{version}-%{release}
Requires: libvirt-daemon-proxy = %{version}-%{release}
%description daemon-common
Miscellaneous files and utilities used by other libvirt daemons
%package daemon-lock
Summary: Server side daemon for managing locks
Requires: libvirt-libs = %{version}-%{release}
%description daemon-lock
Server side daemon used to manage locks held against virtual machine
resources
%package daemon-plugin-lockd
Summary: lockd client plugin for virtlockd
Requires: libvirt-libs = %{version}-%{release}
Requires: libvirt-daemon-lock = %{version}-%{release}
%description daemon-plugin-lockd
A client-side plugin that implements disk locking using POSIX fcntl advisory
locks via communication with the virtlockd daemon
%package daemon-log
Summary: Server side daemon for managing logs
Requires: libvirt-libs = %{version}-%{release}
%description daemon-log
Server side daemon used to manage logs from virtual machine consoles
%package daemon-proxy
Summary: Server side daemon providing libvirtd proxy
Requires: libvirt-libs = %{version}-%{release}
# netcat is needed on the server side so that clients that have
# libvirt < 6.9.0 can connect, but newer versions will prefer
# virt-ssh-helper. Making this a Recommends means that it gets
# installed by default, but can still be removed if compatibility
# with old clients is not required
Recommends: /usr/bin/nc
%description daemon-proxy
Server side daemon providing functionality previously provided by
the monolithic libvirtd
%description daemon
Server side daemon required to manage the virtualization capabilities
of recent versions of Linux. Requires a hypervisor specific sub-RPM
for specific drivers.
%package daemon-common
Summary: Files and utilities used by daemons
@ -2051,10 +2024,6 @@ exit 0
%libvirt_systemd_config_pre libvirtd
%libvirt_systemd_config_pre virtnetworkd
%pre daemon-config-network
%libvirt_systemd_config_pre libvirtd
%libvirt_systemd_config_pre virtnetworkd
%post daemon-config-network
if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then
# see if the network used by default network creates a conflict,
@ -2499,6 +2468,8 @@ exit 0
%config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
%endif
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so
%{_datadir}/augeas/lenses/libvirt_sanlock.aug
%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
%dir %attr(0770, root, sanlock) %{_localstatedir}/lib/libvirt/sanlock
%{_sbindir}/virt-sanlock-cleanup
@ -2512,6 +2483,7 @@ exit 0
%{_mandir}/man1/virt-pki-query-dn.1*
%{_mandir}/man1/virt-pki-validate.1*
%{_mandir}/man7/virkey*.7*
%{_bindir}/virsh
%{_bindir}/virt-xml-validate
%{_bindir}/virt-pki-query-dn
%{_bindir}/virt-pki-validate
@ -2716,6 +2688,31 @@ exit 0
%endif
%changelog
* Tue Apr 30 2024 Eduard Abdullin <eabdullin@almalinu.org> - 10.0.0-6.alma.1
- cpu: x86: Add support for adding features to existing CPU models
- qemu: domain: Check arch in qemuDomainMakeCPUMigratable
- conf: cpu: Introduce virCPUDefListFeatures
- qemu: domain: Drop added features from migratable CPU
- Add vmx-* features to Broadwell*
- Add vmx-* features to Cascadelake*
- Add vmx-* features to Conroe
- Add vmx-* features to Cooperlake
- Add vmx-* features to core2duo
- Add vmx-* features to Haswell*
- Add vmx-* features to Icelake*
- Add vmx-* features to IvyBridge*
- Add vmx-* features to kvm*
- Add vmx-* features to Nehalem*
- Add vmx-* features to Penryn
- Add vmx-* features to SandyBridge*
- Add vmx-* features to SapphireRapids
- Add vmx-* features to Skylake*
- Add vmx-* features to Snowridge
- Add vmx-* features to Westmere*
- qemu: virtiofs: do not crash if cgroups are missing
- qemu: virtiofs: set correct label when creating the socket
- qemu: virtiofs: error out if getting the group or user name fails
* Thu Feb 22 2024 Jiri Denemark <jdenemar@redhat.com> - 10.0.0-4
- Set stubDriverName from hostdev driver model attribute during pci device setup (RHEL-25858)
- qemuMigrationDstPrepareStorage: Use 'switch' statement to include all storage types (RHEL-24825)