From 35addd78b3d4e4b12e2a2a0df6117b41baf788a8 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Fri, 20 Dec 2024 13:06:06 +0100 Subject: [PATCH] libvirt-10.10.0-3.el10 - qemu: Enable I/O APIC even more frequently (RHEL-71414) - cpu_map: Add avx10* CPU features (RHEL-71897) - cpu_map: Add GraniteRapids-v2 CPU model (RHEL-71897) - cpu_map: Add sha512, sm3, and sm4 CPU features (RHEL-71898) Resolves: RHEL-71414, RHEL-71897, RHEL-71898 --- ...u_map-Add-GraniteRapids-v2-CPU-model.patch | 457 ++++++++++++++++++ libvirt-cpu_map-Add-avx10-CPU-features.patch | 51 ++ ...-Add-sha512-sm3-and-sm4-CPU-features.patch | 41 ++ ...Enable-I-O-APIC-even-more-frequently.patch | 154 ++++++ libvirt.spec | 12 +- 5 files changed, 714 insertions(+), 1 deletion(-) create mode 100644 libvirt-cpu_map-Add-GraniteRapids-v2-CPU-model.patch create mode 100644 libvirt-cpu_map-Add-avx10-CPU-features.patch create mode 100644 libvirt-cpu_map-Add-sha512-sm3-and-sm4-CPU-features.patch create mode 100644 libvirt-qemu-Enable-I-O-APIC-even-more-frequently.patch diff --git a/libvirt-cpu_map-Add-GraniteRapids-v2-CPU-model.patch b/libvirt-cpu_map-Add-GraniteRapids-v2-CPU-model.patch new file mode 100644 index 0000000..584d381 --- /dev/null +++ b/libvirt-cpu_map-Add-GraniteRapids-v2-CPU-model.patch @@ -0,0 +1,457 @@ +From 4dbeaa7e1ce9fffb3e2a2b19ba10cc3d2c19091d Mon Sep 17 00:00:00 2001 +Message-ID: <4dbeaa7e1ce9fffb3e2a2b19ba10cc3d2c19091d.1734696366.git.jdenemar@redhat.com> +From: Jiri Denemark +Date: Wed, 18 Dec 2024 13:46:25 +0100 +Subject: [PATCH] cpu_map: Add GraniteRapids-v2 CPU model + +Introduced by QEMU 9.2.0 + +Signed-off-by: Jiri Denemark +Reviewed-by: Michal Privoznik +(cherry picked from commit 41a6de76bc6e31a206d9d82c84c5d485b710fe01) + +https://issues.redhat.com/browse/RHEL-71897 + +Signed-off-by: Jiri Denemark +--- + src/cpu_map/index.xml | 1 + + src/cpu_map/meson.build | 1 + + src/cpu_map/x86_GraniteRapids-v2.xml | 206 ++++++++++++++++++ + .../domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 57 +++++ + .../domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 47 ++++ + tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 57 +++++ + 6 files changed, 369 insertions(+) + create mode 100644 src/cpu_map/x86_GraniteRapids-v2.xml + +diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml +index 8e74195312..dba2f21811 100644 +--- a/src/cpu_map/index.xml ++++ b/src/cpu_map/index.xml +@@ -121,6 +121,7 @@ + + + ++ + + + +diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build +index fa7faa4016..9a1c048620 100644 +--- a/src/cpu_map/meson.build ++++ b/src/cpu_map/meson.build +@@ -77,6 +77,7 @@ cpumap_data = [ + 'x86_EPYC.xml', + 'x86_features.xml', + 'x86_GraniteRapids-v1.xml', ++ 'x86_GraniteRapids-v2.xml', + 'x86_GraniteRapids.xml', + 'x86_Haswell-IBRS.xml', + 'x86_Haswell-noTSX-IBRS.xml', +diff --git a/src/cpu_map/x86_GraniteRapids-v2.xml b/src/cpu_map/x86_GraniteRapids-v2.xml +new file mode 100644 +index 0000000000..855a43d4ad +--- /dev/null ++++ b/src/cpu_map/x86_GraniteRapids-v2.xml +@@ -0,0 +1,206 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml +index 99445e5f44..d5db9af49e 100644 +--- a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml +@@ -565,6 +565,63 @@ + + + ++ GraniteRapids-v2 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + Haswell + + +diff --git a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml +index 8bf967c99f..7ccdc11412 100644 +--- a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml +@@ -733,6 +733,53 @@ + + + ++ GraniteRapids-v2 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + Haswell + + +diff --git a/tests/domaincapsdata/qemu_9.2.0.x86_64.xml b/tests/domaincapsdata/qemu_9.2.0.x86_64.xml +index 40aa971144..05a5ce4bee 100644 +--- a/tests/domaincapsdata/qemu_9.2.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_9.2.0.x86_64.xml +@@ -564,6 +564,63 @@ + + + ++ GraniteRapids-v2 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + Haswell + + +-- +2.47.1 diff --git a/libvirt-cpu_map-Add-avx10-CPU-features.patch b/libvirt-cpu_map-Add-avx10-CPU-features.patch new file mode 100644 index 0000000..400f317 --- /dev/null +++ b/libvirt-cpu_map-Add-avx10-CPU-features.patch @@ -0,0 +1,51 @@ +From ab3e7f96a75447a1fd8d5f31cc8acf4b61377074 Mon Sep 17 00:00:00 2001 +Message-ID: +From: Jiri Denemark +Date: Wed, 18 Dec 2024 13:30:16 +0100 +Subject: [PATCH] cpu_map: Add avx10* CPU features + +Signed-off-by: Jiri Denemark +Reviewed-by: Michal Privoznik +(cherry picked from commit 30f05acf354437a776b528487bb70ddccf324cd2) + +https://issues.redhat.com/browse/RHEL-71897 + +Signed-off-by: Jiri Denemark +--- + src/cpu_map/x86_features.xml | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml +index 08bf014604..8be8fab42e 100644 +--- a/src/cpu_map/x86_features.xml ++++ b/src/cpu_map/x86_features.xml +@@ -469,6 +469,9 @@ + + + ++ ++ ++ + + + +@@ -541,6 +544,17 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +-- +2.47.1 diff --git a/libvirt-cpu_map-Add-sha512-sm3-and-sm4-CPU-features.patch b/libvirt-cpu_map-Add-sha512-sm3-and-sm4-CPU-features.patch new file mode 100644 index 0000000..841df68 --- /dev/null +++ b/libvirt-cpu_map-Add-sha512-sm3-and-sm4-CPU-features.patch @@ -0,0 +1,41 @@ +From 153ee694e806ebf1ba684c1b7ddfa7a90c9d3adf Mon Sep 17 00:00:00 2001 +Message-ID: <153ee694e806ebf1ba684c1b7ddfa7a90c9d3adf.1734696366.git.jdenemar@redhat.com> +From: Jiri Denemark +Date: Wed, 18 Dec 2024 13:27:40 +0100 +Subject: [PATCH] cpu_map: Add sha512, sm3, and sm4 CPU features + +Introduced by Clearwater Forest platform. + +Signed-off-by: Jiri Denemark +Reviewed-by: Michal Privoznik +(cherry picked from commit 212b7d8e280cabddef1f0996bd9553c6a55babd8) + +https://issues.redhat.com/browse/RHEL-71898 + +Signed-off-by: Jiri Denemark +--- + src/cpu_map/x86_features.xml | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml +index 8be8fab42e..0e1fee6e98 100644 +--- a/src/cpu_map/x86_features.xml ++++ b/src/cpu_map/x86_features.xml +@@ -416,6 +416,15 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +-- +2.47.1 diff --git a/libvirt-qemu-Enable-I-O-APIC-even-more-frequently.patch b/libvirt-qemu-Enable-I-O-APIC-even-more-frequently.patch new file mode 100644 index 0000000..d5a0b59 --- /dev/null +++ b/libvirt-qemu-Enable-I-O-APIC-even-more-frequently.patch @@ -0,0 +1,154 @@ +From 349536b9f6f1df1f652cee5e25b3d2eae42e8170 Mon Sep 17 00:00:00 2001 +Message-ID: <349536b9f6f1df1f652cee5e25b3d2eae42e8170.1734696366.git.jdenemar@redhat.com> +From: Michal Privoznik +Date: Wed, 18 Dec 2024 11:07:26 +0100 +Subject: [PATCH] qemu: Enable I/O APIC even more frequently + +In my previous commit v10.10.0-48-g2d222ecf6e I've made us enable +I/O APIC when there is an IOMMU with EIM. This works well. What +does not work is case when there's just an IOMMU without EIM but +with 256+ vCPUS. Problem is that post parsing happens in two +stages: general domain post parse (where +qemuDomainDefEnableDefaultFeatures() is called) and then per +device post parse (where qemuDomainIOMMUDefPostParse() is +called). Now, in aforementioned case it is the device post parse +phase where EIM is enabled but the code that would enable +VIR_DOMAIN_FEATURE_IOAPIC has already run. + +To resolve this, make the domain post parse callback "foresee" +the future enabling of EIM so that it can turn on I/O APIC +beforehand. + +Resolves: https://issues.redhat.com/browse/RHEL-65844 +Fixes: 2d222ecf6e73614a400b830ac56e9aaa1bc55ecc +Signed-off-by: Michal Privoznik +Reviewed-by: Jiri Denemark +(cherry picked from commit 0162f2008e36df489f6f04e4d6002543acfa171d) +https://issues.redhat.com/browse/RHEL-71414 +Signed-off-by: Michal Privoznik +--- + src/qemu/qemu_postparse.c | 21 +++++++++--- + ...m-autoadd-v2.x86_64-latest.abi-update.args | 1 + + ...im-autoadd-v2.x86_64-latest.abi-update.xml | 1 + + .../intel-iommu-eim-autoadd-v2.xml | 32 +++++++++++++++++++ + tests/qemuxmlconftest.c | 1 + + 5 files changed, 51 insertions(+), 5 deletions(-) + create mode 120000 tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.args + create mode 120000 tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.xml + create mode 100644 tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.xml + +diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c +index f48f172c37..049a6ef2dc 100644 +--- a/src/qemu/qemu_postparse.c ++++ b/src/qemu/qemu_postparse.c +@@ -783,6 +783,15 @@ qemuDomainPstoreDefPostParse(virDomainPstoreDef *pstore, + } + + ++static bool ++qemuDomainNeedsIOMMUWithEIM(const virDomainDef *def) ++{ ++ return ARCH_IS_X86(def->os.arch) && ++ virDomainDefGetVcpusMax(def) > QEMU_MAX_VCPUS_WITHOUT_EIM && ++ qemuDomainIsQ35(def); ++} ++ ++ + static int + qemuDomainIOMMUDefPostParse(virDomainIOMMUDef *iommu, + const virDomainDef *def, +@@ -793,9 +802,7 @@ qemuDomainIOMMUDefPostParse(virDomainIOMMUDef *iommu, + * (EIM) is not explicitly turned off, let's enable it. If we didn't then + * guest will have troubles with interrupts. */ + if (parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE && +- ARCH_IS_X86(def->os.arch) && +- virDomainDefGetVcpusMax(def) > QEMU_MAX_VCPUS_WITHOUT_EIM && +- qemuDomainIsQ35(def) && ++ qemuDomainNeedsIOMMUWithEIM(def) && + iommu && iommu->model == VIR_DOMAIN_IOMMU_MODEL_INTEL) { + + /* eim requires intremap. */ +@@ -1548,9 +1555,13 @@ qemuDomainDefEnableDefaultFeatures(virDomainDef *def, + def->features[VIR_DOMAIN_FEATURE_GIC] = VIR_TRISTATE_SWITCH_ON; + } + +- /* IOMMU with intremap requires split I/O APIC */ ++ /* IOMMU with intremap requires split I/O APIC. But it may happen that ++ * domain already has IOMMU without inremap. This will be fixed in ++ * qemuDomainIOMMUDefPostParse() but there domain definition can't be ++ * modified so change it now. */ + if (def->iommu && +- def->iommu->intremap == VIR_TRISTATE_SWITCH_ON && ++ (def->iommu->intremap == VIR_TRISTATE_SWITCH_ON || ++ qemuDomainNeedsIOMMUWithEIM(def)) && + def->features[VIR_DOMAIN_FEATURE_IOAPIC] == VIR_DOMAIN_IOAPIC_NONE) { + def->features[VIR_DOMAIN_FEATURE_IOAPIC] = VIR_DOMAIN_IOAPIC_QEMU; + } +diff --git a/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.args b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.args +new file mode 120000 +index 0000000000..a7fdee3d71 +--- /dev/null ++++ b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.args +@@ -0,0 +1 @@ ++intel-iommu-eim-autoadd.x86_64-latest.abi-update.args +\ No newline at end of file +diff --git a/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.xml b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.xml +new file mode 120000 +index 0000000000..928ea1b4c8 +--- /dev/null ++++ b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.xml +@@ -0,0 +1 @@ ++intel-iommu-eim-autoadd.x86_64-latest.abi-update.xml +\ No newline at end of file +diff --git a/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.xml b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.xml +new file mode 100644 +index 0000000000..b39ee55786 +--- /dev/null ++++ b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.xml +@@ -0,0 +1,32 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 219100 ++ 288 ++ ++ hvm ++ ++ ++ ++ qemu64 ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-x86_64 ++ ++ ++ ++
++ ++ ++ ++ ++