From 102f6335b9bea848d5e3a9e32ae34e144d685f83 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Thu, 9 Nov 2023 14:37:19 +0100 Subject: [PATCH] cpu_map: Add missing vmx features from MSR 0x48C Differences from qemu: * "vmx-ept-uc" (bit 8) and "vmx-ept-wb" (bit 14) are not added to qemu's list of named features yet, but used in several qemu cpu models never the less. Add to libvirt regardless. * "vmx-invvpid-single-context" (bit 41) is erroneously called "vmx-invept-single-context" in qemu. This is the name of the feature associated with bit 25 in both libvirt and qemu. * "vmx-invvpid-single-context-noglobals" (bit 43) is erroneously called "vmx-invept-single-context-noglobals". Use the correct name. Signed-off-by: Tim Wiederhake Reviewed-by: Jiri Denemark --- src/cpu_map/x86_features.xml | 53 +++++++++++++++++++ .../x86_64-cpuid-Atom-P5362-enabled.xml | 1 + .../x86_64-cpuid-Atom-P5362-json.xml | 11 ++++ .../x86_64-cpuid-Cooperlake-enabled.xml | 1 + .../x86_64-cpuid-Cooperlake-json.xml | 11 ++++ .../x86_64-cpuid-Core-i7-8550U-enabled.xml | 1 + .../x86_64-cpuid-Core-i7-8550U-json.xml | 11 ++++ ...86_64-cpuid-Xeon-Platinum-9242-enabled.xml | 1 + .../x86_64-cpuid-Xeon-Platinum-9242-json.xml | 11 ++++ ...-cpuid-baseline-Cooperlake+Cascadelake.xml | 11 ++++ .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 11 ++++ tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 11 ++++ .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 11 ++++ tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 11 ++++ .../cpu-host-model-kvm.x86_64-4.2.0.args | 2 +- .../cpu-host-model-kvm.x86_64-5.0.0.args | 2 +- 16 files changed, 158 insertions(+), 2 deletions(-) diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml index 7b6ff44c20..f37b817013 100644 --- a/src/cpu_map/x86_features.xml +++ b/src/cpu_map/x86_features.xml @@ -879,4 +879,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Atom-P5362-enabled.xml b/tests/cputestdata/x86_64-cpuid-Atom-P5362-enabled.xml index 7a1f047382..195bf88765 100644 --- a/tests/cputestdata/x86_64-cpuid-Atom-P5362-enabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Atom-P5362-enabled.xml @@ -10,4 +10,5 @@ + diff --git a/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml b/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml index bb4259058a..d7d8d89d42 100644 --- a/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml @@ -39,6 +39,17 @@ + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Cooperlake-enabled.xml b/tests/cputestdata/x86_64-cpuid-Cooperlake-enabled.xml index 01d81a64a6..7acddcae81 100644 --- a/tests/cputestdata/x86_64-cpuid-Cooperlake-enabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Cooperlake-enabled.xml @@ -11,4 +11,5 @@ + diff --git a/tests/cputestdata/x86_64-cpuid-Cooperlake-json.xml b/tests/cputestdata/x86_64-cpuid-Cooperlake-json.xml index bb1d2f628c..1dee592f23 100644 --- a/tests/cputestdata/x86_64-cpuid-Cooperlake-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Cooperlake-json.xml @@ -35,4 +35,15 @@ + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-enabled.xml index 1bf7882b2e..1309da972b 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-enabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-enabled.xml @@ -9,4 +9,5 @@ + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-json.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-json.xml index e150ef4004..8e590da2c9 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-json.xml @@ -35,6 +35,17 @@ + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-enabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-enabled.xml index b7ffbb2708..a9bf08018a 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-enabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-enabled.xml @@ -10,4 +10,5 @@ + diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-json.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-json.xml index 2813c72012..edb4dfbb5c 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-json.xml @@ -41,4 +41,15 @@ + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Cascadelake.xml b/tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Cascadelake.xml index ca6387e390..0918fc96cb 100644 --- a/tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Cascadelake.xml +++ b/tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Cascadelake.xml @@ -41,4 +41,15 @@ + + + + + + + + + + + diff --git a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml index 398a027e92..563c2cbd24 100644 --- a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml @@ -79,6 +79,17 @@ + + + + + + + + + + + qemu64 diff --git a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml index 446bf915a5..2ee9422dd3 100644 --- a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml @@ -78,6 +78,17 @@ + + + + + + + + + + + qemu64 diff --git a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml index c1dd623709..fbb7549ef5 100644 --- a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml @@ -79,6 +79,17 @@ + + + + + + + + + + + qemu64 diff --git a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml index 4618fd24e4..e8cd88a755 100644 --- a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml @@ -78,6 +78,17 @@ + + + + + + + + + + + qemu64 diff --git a/tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-4.2.0.args b/tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-4.2.0.args index 22e4023886..7f06d6c410 100644 --- a/tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-4.2.0.args +++ b/tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-4.2.0.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes \ -machine pc-q35-4.2,usb=off,dump-guest-core=off \ -accel kvm \ --cpu Skylake-Client-IBRS,ss=on,vmx=on,hypervisor=on,tsc-adjust=on,clflushopt=on,umip=on,md-clear=on,stibp=on,arch-capabilities=on,ssbd=on,xsaves=on,pdpe1gb=on,skip-l1dfl-vmentry=on,pschange-mc-no=on,vmx-ins-outs=on,vmx-true-ctls=on,vmx-store-lma=on,vmx-activity-hlt=on,vmx-vmwrite-vmexit-fields=on,vmx-apicv-xapic=on,vmx-ept=on,vmx-desc-exit=on,vmx-rdtscp-exit=on,vmx-apicv-x2apic=on,vmx-vpid=on,vmx-wbinvd-exit=on,vmx-unrestricted-guest=on,vmx-rdrand-exit=on,vmx-invpcid-exit=on,vmx-vmfunc=on,vmx-shadow-vmcs=on,vmx-rdseed-exit=on,vmx-pml=on,vmx-xsaves=on \ +-cpu Skylake-Client-IBRS,ss=on,vmx=on,hypervisor=on,tsc-adjust=on,clflushopt=on,umip=on,md-clear=on,stibp=on,arch-capabilities=on,ssbd=on,xsaves=on,pdpe1gb=on,skip-l1dfl-vmentry=on,pschange-mc-no=on,vmx-ins-outs=on,vmx-true-ctls=on,vmx-store-lma=on,vmx-activity-hlt=on,vmx-vmwrite-vmexit-fields=on,vmx-apicv-xapic=on,vmx-ept=on,vmx-desc-exit=on,vmx-rdtscp-exit=on,vmx-apicv-x2apic=on,vmx-vpid=on,vmx-wbinvd-exit=on,vmx-unrestricted-guest=on,vmx-rdrand-exit=on,vmx-invpcid-exit=on,vmx-vmfunc=on,vmx-shadow-vmcs=on,vmx-rdseed-exit=on,vmx-pml=on,vmx-xsaves=on,vmx-invvpid=on,vmx-invvpid-single-addr=on,vmx-invvpid-all-context=on,vmx-ept-execonly=on,vmx-page-walk-4=on,vmx-ept-2mb=on,vmx-ept-1gb=on,vmx-invept=on,vmx-eptad=on,vmx-invept-single-context=on,vmx-invept-all-context=on \ -m size=219136k \ -overcommit mem-lock=off \ -smp 1,sockets=1,cores=1,threads=1 \ diff --git a/tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-5.0.0.args b/tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-5.0.0.args index df890b9f89..030d129e66 100644 --- a/tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-5.0.0.args +++ b/tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-5.0.0.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes \ -machine pc-q35-5.0,usb=off,dump-guest-core=off \ -accel kvm \ --cpu Skylake-Client-IBRS,ss=on,vmx=on,hypervisor=on,tsc-adjust=on,clflushopt=on,umip=on,md-clear=on,stibp=on,arch-capabilities=on,ssbd=on,xsaves=on,pdpe1gb=on,skip-l1dfl-vmentry=on,pschange-mc-no=on,vmx-ins-outs=on,vmx-true-ctls=on,vmx-store-lma=on,vmx-activity-hlt=on,vmx-vmwrite-vmexit-fields=on,vmx-apicv-xapic=on,vmx-ept=on,vmx-desc-exit=on,vmx-rdtscp-exit=on,vmx-apicv-x2apic=on,vmx-vpid=on,vmx-wbinvd-exit=on,vmx-unrestricted-guest=on,vmx-rdrand-exit=on,vmx-invpcid-exit=on,vmx-vmfunc=on,vmx-shadow-vmcs=on,vmx-rdseed-exit=on,vmx-pml=on,vmx-xsaves=on \ +-cpu Skylake-Client-IBRS,ss=on,vmx=on,hypervisor=on,tsc-adjust=on,clflushopt=on,umip=on,md-clear=on,stibp=on,arch-capabilities=on,ssbd=on,xsaves=on,pdpe1gb=on,skip-l1dfl-vmentry=on,pschange-mc-no=on,vmx-ins-outs=on,vmx-true-ctls=on,vmx-store-lma=on,vmx-activity-hlt=on,vmx-vmwrite-vmexit-fields=on,vmx-apicv-xapic=on,vmx-ept=on,vmx-desc-exit=on,vmx-rdtscp-exit=on,vmx-apicv-x2apic=on,vmx-vpid=on,vmx-wbinvd-exit=on,vmx-unrestricted-guest=on,vmx-rdrand-exit=on,vmx-invpcid-exit=on,vmx-vmfunc=on,vmx-shadow-vmcs=on,vmx-rdseed-exit=on,vmx-pml=on,vmx-xsaves=on,vmx-invvpid=on,vmx-invvpid-single-addr=on,vmx-invvpid-all-context=on,vmx-ept-execonly=on,vmx-page-walk-4=on,vmx-ept-2mb=on,vmx-ept-1gb=on,vmx-invept=on,vmx-eptad=on,vmx-invept-single-context=on,vmx-invept-all-context=on \ -m size=219136k \ -overcommit mem-lock=off \ -smp 1,sockets=1,cores=1,threads=1 \