cpu_map: Properly group models in index.xml

We already visually group the included models using comments. This patch
introduces a new <group name='...'> element for doing it properly in a
machine friendly way.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Jiri Denemark 2024-10-22 09:16:46 +02:00
parent 3bb2c2b641
commit e2e7602a22
2 changed files with 110 additions and 96 deletions

View File

@ -116,7 +116,7 @@ loadIncludes(xmlXPathContextPtr ctxt,
int n;
size_t i;
n = virXPathNodeSet("include", ctxt, &nodes);
n = virXPathNodeSet("include|group[@name]/include", ctxt, &nodes);
if (n < 0)
return -1;

View File

@ -3,122 +3,136 @@
<include filename='x86_vendors.xml'/>
<include filename='x86_features.xml'/>
<!-- models -->
<include filename='x86_486.xml'/>
<group name='generic'>
<include filename='x86_486.xml'/>
</group>
<!-- Intel-based QEMU generic CPU models -->
<include filename='x86_pentium.xml'/>
<include filename='x86_pentium2.xml'/>
<include filename='x86_pentium3.xml'/>
<include filename='x86_pentiumpro.xml'/>
<include filename='x86_coreduo.xml'/>
<include filename='x86_n270.xml'/>
<include filename='x86_core2duo.xml'/>
<group name='Intel-based QEMU generic CPU models'>
<include filename='x86_pentium.xml'/>
<include filename='x86_pentium2.xml'/>
<include filename='x86_pentium3.xml'/>
<include filename='x86_pentiumpro.xml'/>
<include filename='x86_coreduo.xml'/>
<include filename='x86_n270.xml'/>
<include filename='x86_core2duo.xml'/>
</group>
<!-- Generic QEMU CPU models -->
<include filename='x86_qemu32.xml'/>
<include filename='x86_kvm32.xml'/>
<include filename='x86_cpu64-rhel5.xml'/>
<include filename='x86_cpu64-rhel6.xml'/>
<include filename='x86_qemu64.xml'/>
<include filename='x86_kvm64.xml'/>
<group name='Generic QEMU CPU models'>
<include filename='x86_qemu32.xml'/>
<include filename='x86_kvm32.xml'/>
<include filename='x86_cpu64-rhel5.xml'/>
<include filename='x86_cpu64-rhel6.xml'/>
<include filename='x86_qemu64.xml'/>
<include filename='x86_kvm64.xml'/>
</group>
<!-- Intel CPU models -->
<include filename='x86_Conroe.xml'/>
<include filename='x86_Penryn.xml'/>
<include filename='x86_Nehalem.xml'/>
<include filename='x86_Nehalem-IBRS.xml'/>
<include filename='x86_Westmere.xml'/>
<include filename='x86_Westmere-IBRS.xml'/>
<include filename='x86_SandyBridge.xml'/>
<include filename='x86_SandyBridge-IBRS.xml'/>
<include filename='x86_IvyBridge.xml'/>
<include filename='x86_IvyBridge-IBRS.xml'/>
<include filename='x86_Haswell-noTSX.xml'/>
<include filename='x86_Haswell-noTSX-IBRS.xml'/>
<include filename='x86_Haswell.xml'/>
<include filename='x86_Haswell-IBRS.xml'/>
<include filename='x86_Broadwell-noTSX.xml'/>
<include filename='x86_Broadwell-noTSX-IBRS.xml'/>
<include filename='x86_Broadwell.xml'/>
<include filename='x86_Broadwell-IBRS.xml'/>
<include filename='x86_Skylake-Client.xml'/>
<include filename='x86_Skylake-Client-IBRS.xml'/>
<include filename='x86_Skylake-Client-noTSX-IBRS.xml'/>
<include filename='x86_Skylake-Server.xml'/>
<include filename='x86_Skylake-Server-IBRS.xml'/>
<include filename='x86_Skylake-Server-noTSX-IBRS.xml'/>
<include filename='x86_Cascadelake-Server.xml'/>
<include filename='x86_Cascadelake-Server-noTSX.xml'/>
<include filename='x86_Icelake-Client.xml'/>
<include filename='x86_Icelake-Client-noTSX.xml'/>
<include filename='x86_Icelake-Server.xml'/>
<include filename='x86_Icelake-Server-noTSX.xml'/>
<include filename='x86_Cooperlake.xml'/>
<include filename='x86_Snowridge.xml'/>
<include filename='x86_SapphireRapids.xml'/>
<include filename='x86_GraniteRapids.xml'/>
<include filename='x86_SierraForest.xml'/>
<group name='Intel CPU models'>
<include filename='x86_Conroe.xml'/>
<include filename='x86_Penryn.xml'/>
<include filename='x86_Nehalem.xml'/>
<include filename='x86_Nehalem-IBRS.xml'/>
<include filename='x86_Westmere.xml'/>
<include filename='x86_Westmere-IBRS.xml'/>
<include filename='x86_SandyBridge.xml'/>
<include filename='x86_SandyBridge-IBRS.xml'/>
<include filename='x86_IvyBridge.xml'/>
<include filename='x86_IvyBridge-IBRS.xml'/>
<include filename='x86_Haswell-noTSX.xml'/>
<include filename='x86_Haswell-noTSX-IBRS.xml'/>
<include filename='x86_Haswell.xml'/>
<include filename='x86_Haswell-IBRS.xml'/>
<include filename='x86_Broadwell-noTSX.xml'/>
<include filename='x86_Broadwell-noTSX-IBRS.xml'/>
<include filename='x86_Broadwell.xml'/>
<include filename='x86_Broadwell-IBRS.xml'/>
<include filename='x86_Skylake-Client.xml'/>
<include filename='x86_Skylake-Client-IBRS.xml'/>
<include filename='x86_Skylake-Client-noTSX-IBRS.xml'/>
<include filename='x86_Skylake-Server.xml'/>
<include filename='x86_Skylake-Server-IBRS.xml'/>
<include filename='x86_Skylake-Server-noTSX-IBRS.xml'/>
<include filename='x86_Cascadelake-Server.xml'/>
<include filename='x86_Cascadelake-Server-noTSX.xml'/>
<include filename='x86_Icelake-Client.xml'/>
<include filename='x86_Icelake-Client-noTSX.xml'/>
<include filename='x86_Icelake-Server.xml'/>
<include filename='x86_Icelake-Server-noTSX.xml'/>
<include filename='x86_Cooperlake.xml'/>
<include filename='x86_Snowridge.xml'/>
<include filename='x86_SapphireRapids.xml'/>
<include filename='x86_GraniteRapids.xml'/>
<include filename='x86_SierraForest.xml'/>
</group>
<!-- AMD CPUs -->
<include filename='x86_athlon.xml'/>
<include filename='x86_phenom.xml'/>
<include filename='x86_Opteron_G1.xml'/>
<include filename='x86_Opteron_G2.xml'/>
<include filename='x86_Opteron_G3.xml'/>
<include filename='x86_Opteron_G4.xml'/>
<include filename='x86_Opteron_G5.xml'/>
<include filename='x86_EPYC.xml'/>
<include filename='x86_EPYC-IBPB.xml'/>
<include filename='x86_EPYC-Rome.xml'/>
<include filename='x86_EPYC-Milan.xml'/>
<include filename='x86_EPYC-Genoa.xml'/>
<group name='AMD CPU models'>
<include filename='x86_athlon.xml'/>
<include filename='x86_phenom.xml'/>
<include filename='x86_Opteron_G1.xml'/>
<include filename='x86_Opteron_G2.xml'/>
<include filename='x86_Opteron_G3.xml'/>
<include filename='x86_Opteron_G4.xml'/>
<include filename='x86_Opteron_G5.xml'/>
<include filename='x86_EPYC.xml'/>
<include filename='x86_EPYC-IBPB.xml'/>
<include filename='x86_EPYC-Rome.xml'/>
<include filename='x86_EPYC-Milan.xml'/>
<include filename='x86_EPYC-Genoa.xml'/>
</group>
<!-- Hygon CPU models -->
<include filename='x86_Dhyana.xml'/>
<group name='Hygon CPU models'>
<include filename='x86_Dhyana.xml'/>
</group>
</arch>
<arch name='ppc64'>
<include filename='ppc64_vendors.xml'/>
<!-- IBM-based CPU models -->
<include filename='ppc64_POWER6.xml'/>
<include filename='ppc64_POWER7.xml'/>
<include filename='ppc64_POWER8.xml'/>
<include filename='ppc64_POWER9.xml'/>
<include filename='ppc64_POWER10.xml'/>
<group name='IBM-based CPU models'>
<include filename='ppc64_POWER6.xml'/>
<include filename='ppc64_POWER7.xml'/>
<include filename='ppc64_POWER8.xml'/>
<include filename='ppc64_POWER9.xml'/>
<include filename='ppc64_POWER10.xml'/>
</group>
<!-- Freescale-based CPU models -->
<include filename='ppc64_POWERPC_e5500.xml'/>
<include filename='ppc64_POWERPC_e6500.xml'/>
<group name='Freescale-based CPU models'>
<include filename='ppc64_POWERPC_e5500.xml'/>
<include filename='ppc64_POWERPC_e6500.xml'/>
</group>
</arch>
<arch name='arm'>
<include filename='arm_vendors.xml'/>
<include filename='arm_features.xml'/>
<!-- ARM-based CPU models -->
<include filename='arm_cortex-a53.xml'/>
<include filename='arm_cortex-a57.xml'/>
<include filename='arm_cortex-a72.xml'/>
<include filename='arm_Neoverse-N1.xml'/>
<include filename='arm_Neoverse-N2.xml'/>
<include filename='arm_Neoverse-V1.xml'/>
<group name='ARM-based CPU models'>
<include filename='arm_cortex-a53.xml'/>
<include filename='arm_cortex-a57.xml'/>
<include filename='arm_cortex-a72.xml'/>
<include filename='arm_Neoverse-N1.xml'/>
<include filename='arm_Neoverse-N2.xml'/>
<include filename='arm_Neoverse-V1.xml'/>
</group>
<!-- Qualcomm-based CPU models -->
<include filename='arm_Falkor.xml'/>
<group name='Qualcomm-based CPU models'>
<include filename='arm_Falkor.xml'/>
</group>
<!-- Cavium-based CPU models -->
<include filename='arm_ThunderX299xx.xml'/>
<group name='Cavium-based CPU models'>
<include filename='arm_ThunderX299xx.xml'/>
</group>
<!-- Fujitsu-based CPU models -->
<include filename='arm_a64fx.xml'/>
<group name='Fujitsu-based CPU models'>
<include filename='arm_a64fx.xml'/>
</group>
<!-- Hisilicon-based CPU models -->
<include filename='arm_Kunpeng-920.xml'/>
<group name='Hisilicon-based CPU models'>
<include filename='arm_Kunpeng-920.xml'/>
</group>
<!-- Phytium-based CPU models -->
<include filename='arm_FT-2000plus.xml'/>
<include filename='arm_Tengyun-S2500.xml'/>
<group name='Phytium-based CPU models'>
<include filename='arm_FT-2000plus.xml'/>
<include filename='arm_Tengyun-S2500.xml'/>
</group>
</arch>
</cpus>