[libvirt] [PATCH 00/41] Another round of CPU driver patches

This time it's mostly about CPU detection tests. Jiri Denemark (41): cpu_x86: Propagate vendor to guest's virCPUData cpu_x86: Fix CPU data parser cpu: Detect arch when parsing CPU data cpu_x86: Rename CPUID function to eax_in qemu: Refactor qemuMonitorJSONGetCPUx86Data tests: Introduce qemuMonitorTestNewFromFile tests: Fix "Reponse" typo tests: Create simple monitor in qemuMonitorTestNewFromFile cpu_x86: Avoid unnecessary pointers to virCPUx86Data cpu_ppc64: Avoid unnecessary pointer to virCPUppc64Data cpu_x86: Refactor internal KVM features tests: Add CPU detection tests tests: Add CPU detection test for AMD A10-5800K tests: Add CPU detection test for Intel Atom D510 tests: Add CPU detection test for Intel Atom N450 tests: Add CPU detection test for Intel Core i5-2500 tests: Add CPU detection test for Intel Core i5-2540M tests: Add CPU detection test for Intel Core i5-4670T tests: Add CPU detection test for Intel Core i5-6600 tests: Add CPU detection test for Intel Core i7-2600 tests: Add CPU detection test for Intel Core i7-3520M tests: Add CPU detection test for Intel Core i7-3740QM tests: Add CPU detection test for Intel Core i7-3770 tests: Add CPU detection test for Intel Core i7-4600U tests: Add CPU detection test for Intel Core i7-5600U tests: Add CPU detection test for Intel Core2 Duo E6850 tests: Add CPU detection test for Intel Core2 Quad Q9500 tests: Add CPU detection test for AMD FX 8150 tests: Add CPU detection test for AMD Opteron 1352 tests: Add CPU detection test for AMD Opteron 2350 tests: Add CPU detection test for AMD Opteron 6234 tests: Add CPU detection test for AMD Opteron 6282 SE tests: Add CPU detection test for Intel Pentium P6100 tests: Add CPU detection test for AMD Phenom II X4 B95 tests: Add CPU detection test for Intel Xeon 5110 tests: Add CPU detection test for Intel Xeon E3-1245 tests: Add CPU detection test for Intel Xeon E5-2630 tests: Add CPU detection test for Intel Xeon E5-2650 tests: Add CPU detection test for Intel Xeon E7-4820 tests: Add CPU detection test for Intel Xeon W3520 tests: Add CPU detection test for Intel Xeon X5460 src/cpu/cpu.c | 54 ++- src/cpu/cpu.h | 11 +- src/cpu/cpu_map.xml | 224 ++++----- src/cpu/cpu_ppc64.c | 65 +-- src/cpu/cpu_ppc64_data.h | 2 + src/cpu/cpu_x86.c | 530 ++++++++++----------- src/cpu/cpu_x86.h | 4 +- src/cpu/cpu_x86_data.h | 4 +- src/libvirt_private.syms | 2 +- src/qemu/qemu_monitor_json.c | 150 +++--- src/qemu/qemu_monitor_json.h | 4 + tests/Makefile.am | 4 + tests/cputest.c | 186 +++++++- tests/cputestdata/cpu-gather.sh | 35 ++ tests/cputestdata/cpu-parse.sh | 57 +++ tests/cputestdata/x86-cpuid-A10-5800K-guest.xml | 26 + tests/cputestdata/x86-cpuid-A10-5800K-host.xml | 26 + tests/cputestdata/x86-cpuid-A10-5800K-json.xml | 16 + tests/cputestdata/x86-cpuid-A10-5800K.json | 77 +++ tests/cputestdata/x86-cpuid-A10-5800K.xml | 50 ++ tests/cputestdata/x86-cpuid-Atom-D510-guest.xml | 20 + tests/cputestdata/x86-cpuid-Atom-D510-host.xml | 21 + tests/cputestdata/x86-cpuid-Atom-D510.xml | 27 ++ tests/cputestdata/x86-cpuid-Atom-N450-guest.xml | 21 + tests/cputestdata/x86-cpuid-Atom-N450-host.xml | 22 + tests/cputestdata/x86-cpuid-Atom-N450.xml | 27 ++ tests/cputestdata/x86-cpuid-Core-i5-2500-guest.xml | 24 + tests/cputestdata/x86-cpuid-Core-i5-2500-host.xml | 24 + tests/cputestdata/x86-cpuid-Core-i5-2500-json.xml | 9 + tests/cputestdata/x86-cpuid-Core-i5-2500.json | 88 ++++ tests/cputestdata/x86-cpuid-Core-i5-2500.xml | 34 ++ .../cputestdata/x86-cpuid-Core-i5-2540M-guest.xml | 24 + tests/cputestdata/x86-cpuid-Core-i5-2540M-host.xml | 24 + tests/cputestdata/x86-cpuid-Core-i5-2540M-json.xml | 9 + tests/cputestdata/x86-cpuid-Core-i5-2540M.json | 82 ++++ tests/cputestdata/x86-cpuid-Core-i5-2540M.xml | 34 ++ .../cputestdata/x86-cpuid-Core-i5-4670T-guest.xml | 28 ++ tests/cputestdata/x86-cpuid-Core-i5-4670T-host.xml | 28 ++ tests/cputestdata/x86-cpuid-Core-i5-4670T-json.xml | 13 + tests/cputestdata/x86-cpuid-Core-i5-4670T.json | 77 +++ tests/cputestdata/x86-cpuid-Core-i5-4670T.xml | 34 ++ tests/cputestdata/x86-cpuid-Core-i5-6600-guest.xml | 30 ++ tests/cputestdata/x86-cpuid-Core-i5-6600-host.xml | 30 ++ tests/cputestdata/x86-cpuid-Core-i5-6600-json.xml | 14 + tests/cputestdata/x86-cpuid-Core-i5-6600.json | 82 ++++ tests/cputestdata/x86-cpuid-Core-i5-6600.xml | 46 ++ tests/cputestdata/x86-cpuid-Core-i7-2600-guest.xml | 24 + tests/cputestdata/x86-cpuid-Core-i7-2600-host.xml | 24 + tests/cputestdata/x86-cpuid-Core-i7-2600-json.xml | 9 + tests/cputestdata/x86-cpuid-Core-i7-2600.json | 77 +++ tests/cputestdata/x86-cpuid-Core-i7-2600.xml | 34 ++ .../cputestdata/x86-cpuid-Core-i7-3520M-guest.xml | 23 + tests/cputestdata/x86-cpuid-Core-i7-3520M-host.xml | 23 + tests/cputestdata/x86-cpuid-Core-i7-3520M.xml | 34 ++ .../cputestdata/x86-cpuid-Core-i7-3740QM-guest.xml | 23 + .../cputestdata/x86-cpuid-Core-i7-3740QM-host.xml | 23 + .../cputestdata/x86-cpuid-Core-i7-3740QM-json.xml | 9 + tests/cputestdata/x86-cpuid-Core-i7-3740QM.json | 77 +++ tests/cputestdata/x86-cpuid-Core-i7-3740QM.xml | 34 ++ tests/cputestdata/x86-cpuid-Core-i7-3770-guest.xml | 23 + tests/cputestdata/x86-cpuid-Core-i7-3770-host.xml | 23 + tests/cputestdata/x86-cpuid-Core-i7-3770-json.xml | 8 + tests/cputestdata/x86-cpuid-Core-i7-3770.json | 77 +++ tests/cputestdata/x86-cpuid-Core-i7-3770.xml | 34 ++ .../cputestdata/x86-cpuid-Core-i7-4600U-guest.xml | 28 ++ tests/cputestdata/x86-cpuid-Core-i7-4600U-host.xml | 28 ++ tests/cputestdata/x86-cpuid-Core-i7-4600U-json.xml | 13 + tests/cputestdata/x86-cpuid-Core-i7-4600U.json | 82 ++++ tests/cputestdata/x86-cpuid-Core-i7-4600U.xml | 34 ++ .../cputestdata/x86-cpuid-Core-i7-5600U-guest.xml | 28 ++ tests/cputestdata/x86-cpuid-Core-i7-5600U-host.xml | 28 ++ tests/cputestdata/x86-cpuid-Core-i7-5600U-json.xml | 13 + tests/cputestdata/x86-cpuid-Core-i7-5600U.json | 88 ++++ tests/cputestdata/x86-cpuid-Core-i7-5600U.xml | 41 ++ tests/cputestdata/x86-cpuid-Core2-E6850-guest.xml | 21 + tests/cputestdata/x86-cpuid-Core2-E6850-host.xml | 21 + tests/cputestdata/x86-cpuid-Core2-E6850-json.xml | 11 + tests/cputestdata/x86-cpuid-Core2-E6850.json | 77 +++ tests/cputestdata/x86-cpuid-Core2-E6850.xml | 27 ++ tests/cputestdata/x86-cpuid-Core2-Q9500-guest.xml | 22 + tests/cputestdata/x86-cpuid-Core2-Q9500-host.xml | 22 + tests/cputestdata/x86-cpuid-Core2-Q9500.xml | 30 ++ tests/cputestdata/x86-cpuid-FX-8150-guest.xml | 24 + tests/cputestdata/x86-cpuid-FX-8150-host.xml | 24 + tests/cputestdata/x86-cpuid-FX-8150.xml | 49 ++ tests/cputestdata/x86-cpuid-Opteron-1352-guest.xml | 19 + tests/cputestdata/x86-cpuid-Opteron-1352-host.xml | 19 + tests/cputestdata/x86-cpuid-Opteron-1352.xml | 37 ++ tests/cputestdata/x86-cpuid-Opteron-2350-guest.xml | 19 + tests/cputestdata/x86-cpuid-Opteron-2350-host.xml | 19 + tests/cputestdata/x86-cpuid-Opteron-2350-json.xml | 19 + tests/cputestdata/x86-cpuid-Opteron-2350.json | 71 +++ tests/cputestdata/x86-cpuid-Opteron-2350.xml | 37 ++ tests/cputestdata/x86-cpuid-Opteron-6234-guest.xml | 24 + tests/cputestdata/x86-cpuid-Opteron-6234-host.xml | 24 + tests/cputestdata/x86-cpuid-Opteron-6234-json.xml | 16 + tests/cputestdata/x86-cpuid-Opteron-6234.json | 88 ++++ tests/cputestdata/x86-cpuid-Opteron-6234.xml | 51 ++ tests/cputestdata/x86-cpuid-Opteron-6282-guest.xml | 24 + tests/cputestdata/x86-cpuid-Opteron-6282-host.xml | 24 + tests/cputestdata/x86-cpuid-Opteron-6282.xml | 51 ++ .../cputestdata/x86-cpuid-Pentium-P6100-guest.xml | 23 + tests/cputestdata/x86-cpuid-Pentium-P6100-host.xml | 23 + tests/cputestdata/x86-cpuid-Pentium-P6100.xml | 30 ++ tests/cputestdata/x86-cpuid-Phenom-B95-guest.xml | 22 + tests/cputestdata/x86-cpuid-Phenom-B95-host.xml | 31 ++ tests/cputestdata/x86-cpuid-Phenom-B95-json.xml | 20 + tests/cputestdata/x86-cpuid-Phenom-B95.json | 77 +++ tests/cputestdata/x86-cpuid-Phenom-B95.xml | 38 ++ tests/cputestdata/x86-cpuid-Xeon-5110-guest.xml | 20 + tests/cputestdata/x86-cpuid-Xeon-5110-host.xml | 20 + tests/cputestdata/x86-cpuid-Xeon-5110.xml | 27 ++ tests/cputestdata/x86-cpuid-Xeon-E3-1245-guest.xml | 30 ++ tests/cputestdata/x86-cpuid-Xeon-E3-1245-host.xml | 30 ++ tests/cputestdata/x86-cpuid-Xeon-E3-1245-json.xml | 15 + tests/cputestdata/x86-cpuid-Xeon-E3-1245.json | 88 ++++ tests/cputestdata/x86-cpuid-Xeon-E3-1245.xml | 46 ++ tests/cputestdata/x86-cpuid-Xeon-E5-2630-guest.xml | 29 ++ tests/cputestdata/x86-cpuid-Xeon-E5-2630-host.xml | 29 ++ tests/cputestdata/x86-cpuid-Xeon-E5-2630-json.xml | 12 + tests/cputestdata/x86-cpuid-Xeon-E5-2630.json | 77 +++ tests/cputestdata/x86-cpuid-Xeon-E5-2630.xml | 37 ++ tests/cputestdata/x86-cpuid-Xeon-E5-2650-guest.xml | 29 ++ tests/cputestdata/x86-cpuid-Xeon-E5-2650-host.xml | 29 ++ tests/cputestdata/x86-cpuid-Xeon-E5-2650-json.xml | 12 + tests/cputestdata/x86-cpuid-Xeon-E5-2650.json | 71 +++ tests/cputestdata/x86-cpuid-Xeon-E5-2650.xml | 37 ++ tests/cputestdata/x86-cpuid-Xeon-E7-4820-guest.xml | 28 ++ tests/cputestdata/x86-cpuid-Xeon-E7-4820-host.xml | 28 ++ tests/cputestdata/x86-cpuid-Xeon-E7-4820-json.xml | 12 + tests/cputestdata/x86-cpuid-Xeon-E7-4820.json | 77 +++ tests/cputestdata/x86-cpuid-Xeon-E7-4820.xml | 30 ++ tests/cputestdata/x86-cpuid-Xeon-W3520-guest.xml | 23 + tests/cputestdata/x86-cpuid-Xeon-W3520-host.xml | 23 + tests/cputestdata/x86-cpuid-Xeon-W3520-json.xml | 10 + tests/cputestdata/x86-cpuid-Xeon-W3520.json | 77 +++ tests/cputestdata/x86-cpuid-Xeon-W3520.xml | 30 ++ tests/cputestdata/x86-cpuid-Xeon-X5460-guest.xml | 21 + tests/cputestdata/x86-cpuid-Xeon-X5460-host.xml | 21 + tests/cputestdata/x86-cpuid-Xeon-X5460.xml | 27 ++ ...6-host+host+host-model,models,Penryn-result.xml | 1 + tests/qemucapabilitiestest.c | 57 +-- .../qemumonitorjson-getcpu-full.data | 6 +- .../qemumonitorjson-getcpu-host.data | 8 +- tests/qemumonitortestutils.c | 90 +++- tests/qemumonitortestutils.h | 8 +- 146 files changed, 5114 insertions(+), 596 deletions(-) create mode 100755 tests/cputestdata/cpu-gather.sh create mode 100755 tests/cputestdata/cpu-parse.sh create mode 100644 tests/cputestdata/x86-cpuid-A10-5800K-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-A10-5800K-host.xml create mode 100644 tests/cputestdata/x86-cpuid-A10-5800K-json.xml create mode 100644 tests/cputestdata/x86-cpuid-A10-5800K.json create mode 100644 tests/cputestdata/x86-cpuid-A10-5800K.xml create mode 100644 tests/cputestdata/x86-cpuid-Atom-D510-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Atom-D510-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Atom-D510.xml create mode 100644 tests/cputestdata/x86-cpuid-Atom-N450-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Atom-N450-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Atom-N450.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2500-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2500-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2500-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2500.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2500.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2540M-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2540M-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2540M-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2540M.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2540M.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-4670T-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-4670T-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-4670T-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-4670T.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-4670T.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-6600-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-6600-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-6600-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-6600.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-6600.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-2600-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-2600-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-2600-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-2600.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-2600.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3520M-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3520M-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3520M.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3740QM-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3740QM-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3740QM-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3740QM.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3740QM.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3770-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3770-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3770-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3770.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3770.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-4600U-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-4600U-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-4600U-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-4600U.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-4600U.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-5600U-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-5600U-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-5600U-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-5600U.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-5600U.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-E6850-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-E6850-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-E6850-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-E6850.json create mode 100644 tests/cputestdata/x86-cpuid-Core2-E6850.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-Q9500-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-Q9500-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-Q9500.xml create mode 100644 tests/cputestdata/x86-cpuid-FX-8150-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-FX-8150-host.xml create mode 100644 tests/cputestdata/x86-cpuid-FX-8150.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-1352-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-1352-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-1352.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-2350-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-2350-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-2350-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-2350.json create mode 100644 tests/cputestdata/x86-cpuid-Opteron-2350.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6234-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6234-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6234-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6234.json create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6234.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6282-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6282-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6282.xml create mode 100644 tests/cputestdata/x86-cpuid-Pentium-P6100-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Pentium-P6100-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Pentium-P6100.xml create mode 100644 tests/cputestdata/x86-cpuid-Phenom-B95-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Phenom-B95-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Phenom-B95-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Phenom-B95.json create mode 100644 tests/cputestdata/x86-cpuid-Phenom-B95.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-5110-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-5110-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-5110.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E3-1245-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E3-1245-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E3-1245-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E3-1245.json create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E3-1245.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2630-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2630-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2630-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2630.json create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2630.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2650-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2650-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2650-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2650.json create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2650.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E7-4820-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E7-4820-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E7-4820-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E7-4820.json create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E7-4820.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-W3520-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-W3520-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-W3520-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-W3520.json create mode 100644 tests/cputestdata/x86-cpuid-Xeon-W3520.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460.xml -- 2.8.3

When computing CPU data for a given guest CPU we should set CPUID vendor bits appropriately so that we don't lose the vendor when transforming CPU data back to XML description. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu_x86.c | 5 +++++ tests/cputestdata/x86-host+host+host-model,models,Penryn-result.xml | 1 + 2 files changed, 6 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index d0cb653..a05cea6 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1488,6 +1488,11 @@ x86Compute(virCPUDefPtr host, if (!(guest_model = x86ModelCopy(host_model))) goto error; + if (cpu->vendor && + virCPUx86DataAddCPUID(guest_model->data, + &host_model->vendor->cpuid) < 0) + goto error; + if (cpu->type == VIR_CPU_TYPE_GUEST && cpu->match == VIR_CPU_MATCH_EXACT) x86DataSubtract(guest_model->data, diff->data); diff --git a/tests/cputestdata/x86-host+host+host-model,models,Penryn-result.xml b/tests/cputestdata/x86-host+host+host-model,models,Penryn-result.xml index 2696356..63d5e90 100644 --- a/tests/cputestdata/x86-host+host+host-model,models,Penryn-result.xml +++ b/tests/cputestdata/x86-host+host+host-model,models,Penryn-result.xml @@ -1,6 +1,7 @@ <cpu mode='custom' match='exact'> <arch>x86_64</arch> <model fallback='allow'>core2duo</model> + <vendor>Intel</vendor> <feature policy='require' name='ds'/> <feature policy='require' name='acpi'/> <feature policy='require' name='ss'/> -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:15 +0200, Jiri Denemark wrote:
When computing CPU data for a given guest CPU we should set CPUID vendor bits appropriately so that we don't lose the vendor when transforming CPU data back to XML description.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu_x86.c | 5 +++++ tests/cputestdata/x86-host+host+host-model,models,Penryn-result.xml | 1 + 2 files changed, 6 insertions(+)
ACK

The formatter uses /cpudata/cpuid elements and the parser should really do the same. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu_x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index a05cea6..65b7a56 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1309,8 +1309,8 @@ x86CPUDataParse(const char *xmlStr) } ctxt->node = xmlDocGetRootElement(xml); - n = virXPathNodeSet("/cpudata[@arch='x86']/data", ctxt, &nodes); - if (n < 0) { + n = virXPathNodeSet("/cpudata[@arch='x86']/cpuid", ctxt, &nodes); + if (n <= 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no x86 CPU data found")); goto cleanup; -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:16 +0200, Jiri Denemark wrote:
The formatter uses /cpudata/cpuid elements and the parser should really do the same.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu_x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
ACK

A CPU data XML file already contains the architecture, let the parser use it to detect which CPU driver should be used to parse the rest of the file. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu.c | 54 ++++++++++++++++++++++++++++++++++++++++++++---------- src/cpu/cpu.h | 7 +++---- src/cpu/cpu_x86.c | 15 ++------------- 3 files changed, 49 insertions(+), 27 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index dbd0987..8c3d39d 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -77,6 +77,21 @@ cpuGetSubDriver(virArch arch) } +static struct cpuArchDriver * +cpuGetSubDriverByName(const char *name) +{ + size_t i; + + for (i = 0; i < NR_DRIVERS - 1; i++) { + if (STREQ_NULLABLE(name, drivers[i]->name)) + return drivers[i]; + } + + /* use generic driver by default */ + return drivers[NR_DRIVERS - 1]; +} + + /** * cpuCompareXML: * @@ -667,7 +682,6 @@ cpuDataFormat(const virCPUData *data) /** * cpuDataParse: * - * @arch: CPU architecture * @xmlStr: XML string produced by cpuDataFormat * * Parses XML representation of virCPUData structure for test purposes. @@ -675,24 +689,44 @@ cpuDataFormat(const virCPUData *data) * Returns internal CPU data structure parsed from the XML or NULL on error. */ virCPUDataPtr -cpuDataParse(virArch arch, - const char *xmlStr) +cpuDataParse(const char *xmlStr) { struct cpuArchDriver *driver; + xmlDocPtr xml = NULL; + xmlXPathContextPtr ctxt = NULL; + virCPUDataPtr data = NULL; + char *arch; - VIR_DEBUG("arch=%s, xmlStr=%s", virArchToString(arch), xmlStr); + VIR_DEBUG("xmlStr=%s", xmlStr); - if (!(driver = cpuGetSubDriver(arch))) - return NULL; + if (!(xml = virXMLParseStringCtxt(xmlStr, _("CPU data"), &ctxt))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot parse CPU data")); + goto cleanup; + } + + if (!(arch = virXPathString("string(/cpudata/@arch)", ctxt))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing CPU data architecture")); + goto cleanup; + } + + if (!(driver = cpuGetSubDriverByName(arch))) + goto cleanup; if (!driver->dataParse) { virReportError(VIR_ERR_NO_SUPPORT, - _("cannot parse %s CPU data"), - virArchToString(arch)); - return NULL; + _("cannot parse %s CPU data"), arch); + goto cleanup; } - return driver->dataParse(xmlStr); + data = driver->dataParse(ctxt); + + cleanup: + xmlXPathFreeContext(ctxt); + xmlFreeDoc(xml); + VIR_FREE(arch); + return data; } bool diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index f15dc16..7f66585 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -98,7 +98,7 @@ typedef char * (*cpuArchDataFormat)(const virCPUData *data); typedef virCPUDataPtr -(*cpuArchDataParse) (const char *xmlStr); +(*cpuArchDataParse) (xmlXPathContextPtr ctxt); typedef int (*cpuArchGetModels) (char ***models); @@ -207,8 +207,7 @@ cpuGetModels(const char *arch, char ***models) */ char *cpuDataFormat(const virCPUData *data) ATTRIBUTE_NONNULL(1); -virCPUDataPtr cpuDataParse(virArch arch, - const char *xmlStr) - ATTRIBUTE_NONNULL(2); +virCPUDataPtr cpuDataParse(const char *xmlStr) + ATTRIBUTE_NONNULL(1); #endif /* __VIR_CPU_H__ */ diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 65b7a56..f2492b5 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1288,10 +1288,8 @@ x86CPUDataFormat(const virCPUData *data) static virCPUDataPtr -x86CPUDataParse(const char *xmlStr) +x86CPUDataParse(xmlXPathContextPtr ctxt) { - xmlDocPtr xml = NULL; - xmlXPathContextPtr ctxt = NULL; xmlNodePtr *nodes = NULL; virCPUDataPtr cpuData = NULL; virCPUx86Data *data = NULL; @@ -1302,14 +1300,7 @@ x86CPUDataParse(const char *xmlStr) if (VIR_ALLOC(data) < 0) goto cleanup; - if (!(xml = virXMLParseStringCtxt(xmlStr, _("CPU data"), &ctxt))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot parse CPU data")); - goto cleanup; - } - ctxt->node = xmlDocGetRootElement(xml); - - n = virXPathNodeSet("/cpudata[@arch='x86']/cpuid", ctxt, &nodes); + n = virXPathNodeSet("/cpudata/cpuid", ctxt, &nodes); if (n <= 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no x86 CPU data found")); @@ -1331,8 +1322,6 @@ x86CPUDataParse(const char *xmlStr) cleanup: VIR_FREE(nodes); - xmlXPathFreeContext(ctxt); - xmlFreeDoc(xml); virCPUx86DataFree(data); return cpuData; } -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:17 +0200, Jiri Denemark wrote:
A CPU data XML file already contains the architecture, let the parser use it to detect which CPU driver should be used to parse the rest of the file.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu.c | 54 ++++++++++++++++++++++++++++++++++++++++++++---------- src/cpu/cpu.h | 7 +++---- src/cpu/cpu_x86.c | 15 ++------------- 3 files changed, 49 insertions(+), 27 deletions(-)
diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index dbd0987..8c3d39d 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c
[...]
@@ -675,24 +689,44 @@ cpuDataFormat(const virCPUData *data) * Returns internal CPU data structure parsed from the XML or NULL on error. */ virCPUDataPtr -cpuDataParse(virArch arch, - const char *xmlStr) +cpuDataParse(const char *xmlStr) { struct cpuArchDriver *driver; + xmlDocPtr xml = NULL; + xmlXPathContextPtr ctxt = NULL; + virCPUDataPtr data = NULL; + char *arch;
'arch' can be freed uninitialized.
- VIR_DEBUG("arch=%s, xmlStr=%s", virArchToString(arch), xmlStr); + VIR_DEBUG("xmlStr=%s", xmlStr);
- if (!(driver = cpuGetSubDriver(arch))) - return NULL; + if (!(xml = virXMLParseStringCtxt(xmlStr, _("CPU data"), &ctxt))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot parse CPU data")); + goto cleanup; + } + + if (!(arch = virXPathString("string(/cpudata/@arch)", ctxt))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing CPU data architecture")); + goto cleanup; + } + + if (!(driver = cpuGetSubDriverByName(arch))) + goto cleanup;
This doesn't report errors.
if (!driver->dataParse) { virReportError(VIR_ERR_NO_SUPPORT, - _("cannot parse %s CPU data"), - virArchToString(arch)); - return NULL; + _("cannot parse %s CPU data"), arch); + goto cleanup; }
- return driver->dataParse(xmlStr); + data = driver->dataParse(ctxt); + + cleanup: + xmlXPathFreeContext(ctxt); + xmlFreeDoc(xml); + VIR_FREE(arch);
^^^^
+ return data; }
bool
ACK with the two problems fixed.

On Wed, Jun 08, 2016 at 14:36:30 +0200, Peter Krempa wrote:
On Wed, Jun 08, 2016 at 10:22:17 +0200, Jiri Denemark wrote:
A CPU data XML file already contains the architecture, let the parser use it to detect which CPU driver should be used to parse the rest of the file.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu.c | 54 ++++++++++++++++++++++++++++++++++++++++++++---------- src/cpu/cpu.h | 7 +++---- src/cpu/cpu_x86.c | 15 ++------------- 3 files changed, 49 insertions(+), 27 deletions(-)
diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index dbd0987..8c3d39d 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c
[...]
@@ -675,24 +689,44 @@ cpuDataFormat(const virCPUData *data) * Returns internal CPU data structure parsed from the XML or NULL on error. */ virCPUDataPtr -cpuDataParse(virArch arch, - const char *xmlStr) +cpuDataParse(const char *xmlStr) { struct cpuArchDriver *driver; + xmlDocPtr xml = NULL; + xmlXPathContextPtr ctxt = NULL; + virCPUDataPtr data = NULL; + char *arch;
'arch' can be freed uninitialized.
- VIR_DEBUG("arch=%s, xmlStr=%s", virArchToString(arch), xmlStr); + VIR_DEBUG("xmlStr=%s", xmlStr);
- if (!(driver = cpuGetSubDriver(arch))) - return NULL; + if (!(xml = virXMLParseStringCtxt(xmlStr, _("CPU data"), &ctxt))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot parse CPU data")); + goto cleanup; + } + + if (!(arch = virXPathString("string(/cpudata/@arch)", ctxt))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing CPU data architecture")); + goto cleanup; + } + + if (!(driver = cpuGetSubDriverByName(arch))) + goto cleanup;
This doesn't report errors.
Oops, cpuGetSubDriverByName in this patch cannot even return NULL since it wrongly fallbacks to a default driver. I removed the fallback and let cpuGetSubDriverByName report a proper error. Jirka

CPUID instruction normally takes its parameter from EAX, but sometimes ECX is used as an additional parameter. Let's rename 'function' to 'eax_in' in preparation for adding 'ecx_in'. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu_map.xml | 224 ++++++++++----------- src/cpu/cpu_x86.c | 86 ++++---- src/cpu/cpu_x86_data.h | 2 +- src/qemu/qemu_monitor_json.c | 6 +- .../qemumonitorjson-getcpu-full.data | 6 +- .../qemumonitorjson-getcpu-host.data | 8 +- 6 files changed, 167 insertions(+), 165 deletions(-) diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml index 08aded2..1ddc55f 100644 --- a/src/cpu/cpu_map.xml +++ b/src/cpu/cpu_map.xml @@ -6,351 +6,351 @@ <!-- standard features, EDX --> <feature name='fpu'> <!-- CPUID_FP87 --> - <cpuid function='0x00000001' edx='0x00000001'/> + <cpuid eax_in='0x00000001' edx='0x00000001'/> </feature> <feature name='vme'> <!-- CPUID_VME --> - <cpuid function='0x00000001' edx='0x00000002'/> + <cpuid eax_in='0x00000001' edx='0x00000002'/> </feature> <feature name='de'> <!-- CPUID_DE --> - <cpuid function='0x00000001' edx='0x00000004'/> + <cpuid eax_in='0x00000001' edx='0x00000004'/> </feature> <feature name='pse'> <!-- CPUID_PSE --> - <cpuid function='0x00000001' edx='0x00000008'/> + <cpuid eax_in='0x00000001' edx='0x00000008'/> </feature> <feature name='tsc'> <!-- CPUID_TSC --> - <cpuid function='0x00000001' edx='0x00000010'/> + <cpuid eax_in='0x00000001' edx='0x00000010'/> </feature> <feature name='msr'> <!-- CPUID_MSR --> - <cpuid function='0x00000001' edx='0x00000020'/> + <cpuid eax_in='0x00000001' edx='0x00000020'/> </feature> <feature name='pae'> <!-- CPUID_PAE --> - <cpuid function='0x00000001' edx='0x00000040'/> + <cpuid eax_in='0x00000001' edx='0x00000040'/> </feature> <feature name='mce'> <!-- CPUID_MCE --> - <cpuid function='0x00000001' edx='0x00000080'/> + <cpuid eax_in='0x00000001' edx='0x00000080'/> </feature> <feature name='cx8'> <!-- CPUID_CX8 --> - <cpuid function='0x00000001' edx='0x00000100'/> + <cpuid eax_in='0x00000001' edx='0x00000100'/> </feature> <feature name='apic'> <!-- CPUID_APIC --> - <cpuid function='0x00000001' edx='0x00000200'/> + <cpuid eax_in='0x00000001' edx='0x00000200'/> </feature> <feature name='sep'> <!-- CPUID_SEP --> - <cpuid function='0x00000001' edx='0x00000800'/> + <cpuid eax_in='0x00000001' edx='0x00000800'/> </feature> <feature name='mtrr'> <!-- CPUID_MTRR --> - <cpuid function='0x00000001' edx='0x00001000'/> + <cpuid eax_in='0x00000001' edx='0x00001000'/> </feature> <feature name='pge'> <!-- CPUID_PGE --> - <cpuid function='0x00000001' edx='0x00002000'/> + <cpuid eax_in='0x00000001' edx='0x00002000'/> </feature> <feature name='mca'> <!-- CPUID_MCA --> - <cpuid function='0x00000001' edx='0x00004000'/> + <cpuid eax_in='0x00000001' edx='0x00004000'/> </feature> <feature name='cmov'> <!-- CPUID_CMOV --> - <cpuid function='0x00000001' edx='0x00008000'/> + <cpuid eax_in='0x00000001' edx='0x00008000'/> </feature> <feature name='pat'> <!-- CPUID_PAT --> - <cpuid function='0x00000001' edx='0x00010000'/> + <cpuid eax_in='0x00000001' edx='0x00010000'/> </feature> <feature name='pse36'> <!-- CPUID_PSE36 --> - <cpuid function='0x00000001' edx='0x00020000'/> + <cpuid eax_in='0x00000001' edx='0x00020000'/> </feature> <feature name='pn'> <!-- CPUID_PN --> - <cpuid function='0x00000001' edx='0x00040000'/> + <cpuid eax_in='0x00000001' edx='0x00040000'/> </feature> <feature name='clflush'> <!-- CPUID_CLFLUSH --> - <cpuid function='0x00000001' edx='0x00080000'/> + <cpuid eax_in='0x00000001' edx='0x00080000'/> </feature> <feature name='ds'> <!-- CPUID_DTS --> - <cpuid function='0x00000001' edx='0x00200000'/> + <cpuid eax_in='0x00000001' edx='0x00200000'/> </feature> <feature name='acpi'> <!-- CPUID_ACPI --> - <cpuid function='0x00000001' edx='0x00400000'/> + <cpuid eax_in='0x00000001' edx='0x00400000'/> </feature> <feature name='mmx'> <!-- CPUID_MMX --> - <cpuid function='0x00000001' edx='0x00800000'/> + <cpuid eax_in='0x00000001' edx='0x00800000'/> </feature> <feature name='fxsr'> <!-- CPUID_FXSR --> - <cpuid function='0x00000001' edx='0x01000000'/> + <cpuid eax_in='0x00000001' edx='0x01000000'/> </feature> <feature name='sse'> <!-- CPUID_SSE --> - <cpuid function='0x00000001' edx='0x02000000'/> + <cpuid eax_in='0x00000001' edx='0x02000000'/> </feature> <feature name='sse2'> <!-- CPUID_SSE2 --> - <cpuid function='0x00000001' edx='0x04000000'/> + <cpuid eax_in='0x00000001' edx='0x04000000'/> </feature> <feature name='ss'> <!-- CPUID_SS --> - <cpuid function='0x00000001' edx='0x08000000'/> + <cpuid eax_in='0x00000001' edx='0x08000000'/> </feature> <feature name='ht'> <!-- CPUID_HT --> - <cpuid function='0x00000001' edx='0x10000000'/> + <cpuid eax_in='0x00000001' edx='0x10000000'/> </feature> <feature name='tm'> <!-- CPUID_TM --> - <cpuid function='0x00000001' edx='0x20000000'/> + <cpuid eax_in='0x00000001' edx='0x20000000'/> </feature> <feature name='ia64'> <!-- CPUID_IA64 --> - <cpuid function='0x00000001' edx='0x40000000'/> + <cpuid eax_in='0x00000001' edx='0x40000000'/> </feature> <feature name='pbe'> <!-- CPUID_PBE --> - <cpuid function='0x00000001' edx='0x80000000'/> + <cpuid eax_in='0x00000001' edx='0x80000000'/> </feature> <!-- standard features, ECX --> <feature name='pni'> <!-- CPUID_EXT_SSE3 --> - <cpuid function='0x00000001' ecx='0x00000001'/> + <cpuid eax_in='0x00000001' ecx='0x00000001'/> </feature> <feature name='pclmuldq'> - <cpuid function='0x00000001' ecx='0x00000002'/> + <cpuid eax_in='0x00000001' ecx='0x00000002'/> </feature> <feature name='dtes64'> - <cpuid function='0x00000001' ecx='0x00000004'/> + <cpuid eax_in='0x00000001' ecx='0x00000004'/> </feature> <feature name='monitor'> <!-- CPUID_EXT_MONITOR --> - <cpuid function='0x00000001' ecx='0x00000008'/> + <cpuid eax_in='0x00000001' ecx='0x00000008'/> </feature> <feature name='ds_cpl'> <!-- CPUID_EXT_DSCPL --> - <cpuid function='0x00000001' ecx='0x00000010'/> + <cpuid eax_in='0x00000001' ecx='0x00000010'/> </feature> <feature name='vmx'> <!-- CPUID_EXT_VMX --> - <cpuid function='0x00000001' ecx='0x00000020'/> + <cpuid eax_in='0x00000001' ecx='0x00000020'/> </feature> <feature name='smx'> - <cpuid function='0x00000001' ecx='0x00000040'/> + <cpuid eax_in='0x00000001' ecx='0x00000040'/> </feature> <feature name='est'> <!-- CPUID_EXT_EST --> - <cpuid function='0x00000001' ecx='0x00000080'/> + <cpuid eax_in='0x00000001' ecx='0x00000080'/> </feature> <feature name='tm2'> <!-- CPUID_EXT_TM2 --> - <cpuid function='0x00000001' ecx='0x00000100'/> + <cpuid eax_in='0x00000001' ecx='0x00000100'/> </feature> <feature name='ssse3'> <!-- CPUID_EXT_SSSE3 --> - <cpuid function='0x00000001' ecx='0x00000200'/> + <cpuid eax_in='0x00000001' ecx='0x00000200'/> </feature> <feature name='cid'> <!-- CPUID_EXT_CID --> - <cpuid function='0x00000001' ecx='0x00000400'/> + <cpuid eax_in='0x00000001' ecx='0x00000400'/> </feature> <feature name='fma'> - <cpuid function='0x00000001' ecx='0x00001000'/> + <cpuid eax_in='0x00000001' ecx='0x00001000'/> </feature> <feature name='cx16'> <!-- CPUID_EXT_CX16 --> - <cpuid function='0x00000001' ecx='0x00002000'/> + <cpuid eax_in='0x00000001' ecx='0x00002000'/> </feature> <feature name='xtpr'> <!-- CPUID_EXT_XTPR --> - <cpuid function='0x00000001' ecx='0x00004000'/> + <cpuid eax_in='0x00000001' ecx='0x00004000'/> </feature> <feature name='pdcm'> - <cpuid function='0x00000001' ecx='0x00008000'/> + <cpuid eax_in='0x00000001' ecx='0x00008000'/> </feature> <feature name='pcid'> - <cpuid function='0x00000001' ecx='0x00020000'/> + <cpuid eax_in='0x00000001' ecx='0x00020000'/> </feature> <feature name='dca'> <!-- CPUID_EXT_DCA --> - <cpuid function='0x00000001' ecx='0x00040000'/> + <cpuid eax_in='0x00000001' ecx='0x00040000'/> </feature> <feature name='sse4.1'> <!-- CPUID_EXT_SSE41 --> - <cpuid function='0x00000001' ecx='0x00080000'/> + <cpuid eax_in='0x00000001' ecx='0x00080000'/> </feature> <feature name='sse4.2'> <!-- CPUID_EXT_SSE42 --> - <cpuid function='0x00000001' ecx='0x00100000'/> + <cpuid eax_in='0x00000001' ecx='0x00100000'/> </feature> <feature name='x2apic'> <!-- CPUID_EXT_X2APIC --> - <cpuid function='0x00000001' ecx='0x00200000'/> + <cpuid eax_in='0x00000001' ecx='0x00200000'/> </feature> <feature name='movbe'> - <cpuid function='0x00000001' ecx='0x00400000'/> + <cpuid eax_in='0x00000001' ecx='0x00400000'/> </feature> <feature name='popcnt'> <!-- CPUID_EXT_POPCNT --> - <cpuid function='0x00000001' ecx='0x00800000'/> + <cpuid eax_in='0x00000001' ecx='0x00800000'/> </feature> <feature name='tsc-deadline'> - <cpuid function='0x00000001' ecx='0x01000000'/> + <cpuid eax_in='0x00000001' ecx='0x01000000'/> </feature> <feature name='aes'> - <cpuid function='0x00000001' ecx='0x02000000'/> + <cpuid eax_in='0x00000001' ecx='0x02000000'/> </feature> <feature name='xsave'> - <cpuid function='0x00000001' ecx='0x04000000'/> + <cpuid eax_in='0x00000001' ecx='0x04000000'/> </feature> <feature name='osxsave'> - <cpuid function='0x00000001' ecx='0x08000000'/> + <cpuid eax_in='0x00000001' ecx='0x08000000'/> </feature> <feature name='avx'> - <cpuid function='0x00000001' ecx='0x10000000'/> + <cpuid eax_in='0x00000001' ecx='0x10000000'/> </feature> <feature name='f16c'> - <cpuid function='0x00000001' ecx='0x20000000'/> + <cpuid eax_in='0x00000001' ecx='0x20000000'/> </feature> <feature name='rdrand'> - <cpuid function='0x00000001' ecx='0x40000000'/> + <cpuid eax_in='0x00000001' ecx='0x40000000'/> </feature> <feature name='hypervisor'> <!-- CPUID_EXT_HYPERVISOR --> - <cpuid function='0x00000001' ecx='0x80000000'/> + <cpuid eax_in='0x00000001' ecx='0x80000000'/> </feature> <!-- extended features, EDX --> <feature name='syscall'> <!-- CPUID_EXT2_SYSCALL --> - <cpuid function='0x80000001' edx='0x00000800'/> + <cpuid eax_in='0x80000001' edx='0x00000800'/> </feature> <feature name='nx'> <!-- CPUID_EXT2_NX --> - <cpuid function='0x80000001' edx='0x00100000'/> + <cpuid eax_in='0x80000001' edx='0x00100000'/> </feature> <feature name='mmxext'> <!-- CPUID_EXT2_MMXEXT --> - <cpuid function='0x80000001' edx='0x00400000'/> + <cpuid eax_in='0x80000001' edx='0x00400000'/> </feature> <feature name='fxsr_opt'> <!-- CPUID_EXT2_FFXSR --> - <cpuid function='0x80000001' edx='0x02000000'/> + <cpuid eax_in='0x80000001' edx='0x02000000'/> </feature> <feature name='pdpe1gb'> <!-- CPUID_EXT2_PDPE1GB --> - <cpuid function='0x80000001' edx='0x04000000'/> + <cpuid eax_in='0x80000001' edx='0x04000000'/> </feature> <feature name='rdtscp'> <!-- CPUID_EXT2_RDTSCP --> - <cpuid function='0x80000001' edx='0x08000000'/> + <cpuid eax_in='0x80000001' edx='0x08000000'/> </feature> <feature name='lm'> <!-- CPUID_EXT2_LM --> - <cpuid function='0x80000001' edx='0x20000000'/> + <cpuid eax_in='0x80000001' edx='0x20000000'/> </feature> <feature name='3dnowext'> <!-- CPUID_EXT2_3DNOWEXT --> - <cpuid function='0x80000001' edx='0x40000000'/> + <cpuid eax_in='0x80000001' edx='0x40000000'/> </feature> <feature name='3dnow'> <!-- CPUID_EXT2_3DNOW --> - <cpuid function='0x80000001' edx='0x80000000'/> + <cpuid eax_in='0x80000001' edx='0x80000000'/> </feature> <!-- extended features, ECX --> <feature name='lahf_lm'> <!-- CPUID_EXT3_LAHF_LM --> - <cpuid function='0x80000001' ecx='0x00000001'/> + <cpuid eax_in='0x80000001' ecx='0x00000001'/> </feature> <feature name='cmp_legacy'> <!-- CPUID_EXT3_CMP_LEG --> - <cpuid function='0x80000001' ecx='0x00000002'/> + <cpuid eax_in='0x80000001' ecx='0x00000002'/> </feature> <feature name='svm'> <!-- CPUID_EXT3_SVM --> - <cpuid function='0x80000001' ecx='0x00000004'/> + <cpuid eax_in='0x80000001' ecx='0x00000004'/> </feature> <feature name='extapic'> <!-- CPUID_EXT3_EXTAPIC --> - <cpuid function='0x80000001' ecx='0x00000008'/> + <cpuid eax_in='0x80000001' ecx='0x00000008'/> </feature> <feature name='cr8legacy'> <!-- CPUID_EXT3_CR8LEG --> - <cpuid function='0x80000001' ecx='0x00000010'/> + <cpuid eax_in='0x80000001' ecx='0x00000010'/> </feature> <feature name='abm'> <!-- CPUID_EXT3_ABM --> - <cpuid function='0x80000001' ecx='0x00000020'/> + <cpuid eax_in='0x80000001' ecx='0x00000020'/> </feature> <feature name='sse4a'> <!-- CPUID_EXT3_SSE4A --> - <cpuid function='0x80000001' ecx='0x00000040'/> + <cpuid eax_in='0x80000001' ecx='0x00000040'/> </feature> <feature name='misalignsse'> <!-- CPUID_EXT3_MISALIGNSSE --> - <cpuid function='0x80000001' ecx='0x00000080'/> + <cpuid eax_in='0x80000001' ecx='0x00000080'/> </feature> <feature name='3dnowprefetch'> <!-- CPUID_EXT3_3DNOWPREFETCH --> - <cpuid function='0x80000001' ecx='0x00000100'/> + <cpuid eax_in='0x80000001' ecx='0x00000100'/> </feature> <feature name='osvw'> <!-- CPUID_EXT3_OSVW --> - <cpuid function='0x80000001' ecx='0x00000200'/> + <cpuid eax_in='0x80000001' ecx='0x00000200'/> </feature> <feature name='ibs'> - <cpuid function='0x80000001' ecx='0x00000400'/> + <cpuid eax_in='0x80000001' ecx='0x00000400'/> </feature> <feature name='xop'> - <cpuid function='0x80000001' ecx='0x00000800'/> + <cpuid eax_in='0x80000001' ecx='0x00000800'/> </feature> <feature name='skinit'> <!-- CPUID_EXT3_SKINIT --> - <cpuid function='0x80000001' ecx='0x00001000'/> + <cpuid eax_in='0x80000001' ecx='0x00001000'/> </feature> <feature name='wdt'> - <cpuid function='0x80000001' ecx='0x00002000'/> + <cpuid eax_in='0x80000001' ecx='0x00002000'/> </feature> <feature name='lwp'> - <cpuid function='0x80000001' ecx='0x00008000'/> + <cpuid eax_in='0x80000001' ecx='0x00008000'/> </feature> <feature name='fma4'> - <cpuid function='0x80000001' ecx='0x00010000'/> + <cpuid eax_in='0x80000001' ecx='0x00010000'/> </feature> <feature name='tce'> - <cpuid function='0x80000001' ecx='0x00020000'/> + <cpuid eax_in='0x80000001' ecx='0x00020000'/> </feature> <feature name='cvt16'> - <cpuid function='0x80000001' ecx='0x00040000'/> + <cpuid eax_in='0x80000001' ecx='0x00040000'/> </feature> <feature name='nodeid_msr'> - <cpuid function='0x80000001' ecx='0x00080000'/> + <cpuid eax_in='0x80000001' ecx='0x00080000'/> </feature> <feature name='tbm'> - <cpuid function='0x80000001' ecx='0x00200000'/> + <cpuid eax_in='0x80000001' ecx='0x00200000'/> </feature> <feature name='topoext'> - <cpuid function='0x80000001' ecx='0x00400000'/> + <cpuid eax_in='0x80000001' ecx='0x00400000'/> </feature> <feature name='perfctr_core'> - <cpuid function='0x80000001' ecx='0x00800000'/> + <cpuid eax_in='0x80000001' ecx='0x00800000'/> </feature> <feature name='perfctr_nb'> - <cpuid function='0x80000001' ecx='0x01000000'/> + <cpuid eax_in='0x80000001' ecx='0x01000000'/> </feature> <!-- cpuid function 0x7 ecx 0x0 features --> <!-- We support only ecx 0x0 now as it's done by a workaround --> <feature name='fsgsbase'> - <cpuid function='0x00000007' ebx='0x00000001'/> + <cpuid eax_in='0x00000007' ebx='0x00000001'/> </feature> <feature name='tsc_adjust'> - <cpuid function='0x00000007' ebx='0x00000002'/> + <cpuid eax_in='0x00000007' ebx='0x00000002'/> </feature> <feature name='bmi1'> - <cpuid function='0x00000007' ebx='0x00000008'/> + <cpuid eax_in='0x00000007' ebx='0x00000008'/> </feature> <feature name='hle'> - <cpuid function='0x00000007' ebx='0x00000010'/> + <cpuid eax_in='0x00000007' ebx='0x00000010'/> </feature> <feature name='avx2'> - <cpuid function='0x00000007' ebx='0x00000020'/> + <cpuid eax_in='0x00000007' ebx='0x00000020'/> </feature> <feature name='smep'> - <cpuid function='0x00000007' ebx='0x00000080'/> + <cpuid eax_in='0x00000007' ebx='0x00000080'/> </feature> <feature name='bmi2'> - <cpuid function='0x00000007' ebx='0x00000100'/> + <cpuid eax_in='0x00000007' ebx='0x00000100'/> </feature> <feature name='erms'> - <cpuid function='0x00000007' ebx='0x00000200'/> + <cpuid eax_in='0x00000007' ebx='0x00000200'/> </feature> <feature name='invpcid'> - <cpuid function='0x00000007' ebx='0x00000400'/> + <cpuid eax_in='0x00000007' ebx='0x00000400'/> </feature> <feature name='rtm'> - <cpuid function='0x00000007' ebx='0x00000800'/> + <cpuid eax_in='0x00000007' ebx='0x00000800'/> </feature> <feature name='mpx'> - <cpuid function='0x00000007' ebx='0x00004000'/> + <cpuid eax_in='0x00000007' ebx='0x00004000'/> </feature> <feature name='avx512f'> <!-- AVX-512 Foundation --> - <cpuid function='0x00000007' ebx='0x00010000'/> + <cpuid eax_in='0x00000007' ebx='0x00010000'/> </feature> <feature name='rdseed'> - <cpuid function='0x00000007' ebx='0x00040000'/> + <cpuid eax_in='0x00000007' ebx='0x00040000'/> </feature> <feature name='adx'> - <cpuid function='0x00000007' ebx='0x00080000'/> + <cpuid eax_in='0x00000007' ebx='0x00080000'/> </feature> <feature name='smap'> - <cpuid function='0x00000007' ebx='0x00100000'/> + <cpuid eax_in='0x00000007' ebx='0x00100000'/> </feature> <feature name='clflushopt'> - <cpuid function='0x00000007' ebx='0x00800000'/> + <cpuid eax_in='0x00000007' ebx='0x00800000'/> </feature> <feature name='avx512pf'> <!-- AVX-512 Prefetch --> - <cpuid function='0x00000007' ebx='0x04000000'/> + <cpuid eax_in='0x00000007' ebx='0x04000000'/> </feature> <feature name='avx512er'> <!-- AVX-512 Exponential and Reciprocal --> - <cpuid function='0x00000007' ebx='0x08000000'/> + <cpuid eax_in='0x00000007' ebx='0x08000000'/> </feature> <feature name='avx512cd'> <!-- AVX-512 Conflict Detection --> - <cpuid function='0x00000007' ebx='0x10000000'/> + <cpuid eax_in='0x00000007' ebx='0x10000000'/> </feature> <!-- Advanced Power Management edx features --> <feature name='invtsc' migratable='no'> - <cpuid function='0x80000007' edx='0x00000100'/> + <cpuid eax_in='0x80000007' edx='0x00000100'/> </feature> <!-- models --> diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index f2492b5..bc71734 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -68,24 +68,24 @@ struct _virCPUx86KVMFeature { static const virCPUx86KVMFeature x86_kvm_features[] = { - {VIR_CPU_x86_KVM_CLOCKSOURCE, { .function = 0x40000001, .eax = 0x00000001 }}, - {VIR_CPU_x86_KVM_NOP_IO_DELAY, { .function = 0x40000001, .eax = 0x00000002 }}, - {VIR_CPU_x86_KVM_MMU_OP, { .function = 0x40000001, .eax = 0x00000004 }}, - {VIR_CPU_x86_KVM_CLOCKSOURCE2, { .function = 0x40000001, .eax = 0x00000008 }}, - {VIR_CPU_x86_KVM_ASYNC_PF, { .function = 0x40000001, .eax = 0x00000010 }}, - {VIR_CPU_x86_KVM_STEAL_TIME, { .function = 0x40000001, .eax = 0x00000020 }}, - {VIR_CPU_x86_KVM_PV_EOI, { .function = 0x40000001, .eax = 0x00000040 }}, - {VIR_CPU_x86_KVM_PV_UNHALT, { .function = 0x40000001, .eax = 0x00000080 }}, + {VIR_CPU_x86_KVM_CLOCKSOURCE, { .eax_in = 0x40000001, .eax = 0x00000001 }}, + {VIR_CPU_x86_KVM_NOP_IO_DELAY, { .eax_in = 0x40000001, .eax = 0x00000002 }}, + {VIR_CPU_x86_KVM_MMU_OP, { .eax_in = 0x40000001, .eax = 0x00000004 }}, + {VIR_CPU_x86_KVM_CLOCKSOURCE2, { .eax_in = 0x40000001, .eax = 0x00000008 }}, + {VIR_CPU_x86_KVM_ASYNC_PF, { .eax_in = 0x40000001, .eax = 0x00000010 }}, + {VIR_CPU_x86_KVM_STEAL_TIME, { .eax_in = 0x40000001, .eax = 0x00000020 }}, + {VIR_CPU_x86_KVM_PV_EOI, { .eax_in = 0x40000001, .eax = 0x00000040 }}, + {VIR_CPU_x86_KVM_PV_UNHALT, { .eax_in = 0x40000001, .eax = 0x00000080 }}, {VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT, - { .function = 0x40000001, .eax = 0x01000000 }}, - {VIR_CPU_x86_KVM_HV_RUNTIME, { .function = 0x40000003, .eax = 0x00000001 }}, - {VIR_CPU_x86_KVM_HV_SYNIC, { .function = 0x40000003, .eax = 0x00000004 }}, - {VIR_CPU_x86_KVM_HV_STIMER, { .function = 0x40000003, .eax = 0x00000008 }}, - {VIR_CPU_x86_KVM_HV_RELAXED, { .function = 0x40000003, .eax = 0x00000020 }}, - {VIR_CPU_x86_KVM_HV_SPINLOCK, { .function = 0x40000003, .eax = 0x00000022 }}, - {VIR_CPU_x86_KVM_HV_VAPIC, { .function = 0x40000003, .eax = 0x00000030 }}, - {VIR_CPU_x86_KVM_HV_VPINDEX, { .function = 0x40000003, .eax = 0x00000040 }}, - {VIR_CPU_x86_KVM_HV_RESET, { .function = 0x40000003, .eax = 0x00000080 }}, + { .eax_in = 0x40000001, .eax = 0x01000000 }}, + {VIR_CPU_x86_KVM_HV_RUNTIME, { .eax_in = 0x40000003, .eax = 0x00000001 }}, + {VIR_CPU_x86_KVM_HV_SYNIC, { .eax_in = 0x40000003, .eax = 0x00000004 }}, + {VIR_CPU_x86_KVM_HV_STIMER, { .eax_in = 0x40000003, .eax = 0x00000008 }}, + {VIR_CPU_x86_KVM_HV_RELAXED, { .eax_in = 0x40000003, .eax = 0x00000020 }}, + {VIR_CPU_x86_KVM_HV_SPINLOCK, { .eax_in = 0x40000003, .eax = 0x00000022 }}, + {VIR_CPU_x86_KVM_HV_VAPIC, { .eax_in = 0x40000003, .eax = 0x00000030 }}, + {VIR_CPU_x86_KVM_HV_VPINDEX, { .eax_in = 0x40000003, .eax = 0x00000040 }}, + {VIR_CPU_x86_KVM_HV_RESET, { .eax_in = 0x40000003, .eax = 0x00000080 }}, }; typedef struct _virCPUx86Model virCPUx86Model; @@ -203,9 +203,9 @@ virCPUx86CPUIDSorter(const void *a, const void *b) virCPUx86CPUID *da = (virCPUx86CPUID *) a; virCPUx86CPUID *db = (virCPUx86CPUID *) b; - if (da->function > db->function) + if (da->eax_in > db->eax_in) return 1; - else if (da->function < db->function) + else if (da->eax_in < db->eax_in) return -1; return 0; @@ -232,12 +232,12 @@ x86DataCpuidNext(virCPUx86DataIteratorPtr iterator) static virCPUx86CPUID * x86DataCpuid(const virCPUx86Data *data, - uint32_t function) + uint32_t eax_in) { size_t i; for (i = 0; i < data->len; i++) { - if (data->data[i].function == function) + if (data->data[i].eax_in == eax_in) return data->data + i; } @@ -307,7 +307,7 @@ virCPUx86DataAddCPUID(virCPUx86Data *data, { virCPUx86CPUID *existing; - if ((existing = x86DataCpuid(data, cpuid->function))) { + if ((existing = x86DataCpuid(data, cpuid->eax_in))) { x86cpuidSetBits(existing, cpuid); } else { if (VIR_APPEND_ELEMENT_COPY(data->data, data->len, @@ -331,7 +331,7 @@ x86DataAdd(virCPUx86Data *data1, virCPUx86CPUID *cpuid2; while ((cpuid2 = x86DataCpuidNext(&iter))) { - cpuid1 = x86DataCpuid(data1, cpuid2->function); + cpuid1 = x86DataCpuid(data1, cpuid2->eax_in); if (cpuid1) { x86cpuidSetBits(cpuid1, cpuid2); @@ -354,7 +354,7 @@ x86DataSubtract(virCPUx86Data *data1, virCPUx86CPUID *cpuid2; while ((cpuid1 = x86DataCpuidNext(&iter))) { - cpuid2 = x86DataCpuid(data2, cpuid1->function); + cpuid2 = x86DataCpuid(data2, cpuid1->eax_in); x86cpuidClearBits(cpuid1, cpuid2); } } @@ -369,7 +369,7 @@ x86DataIntersect(virCPUx86Data *data1, virCPUx86CPUID *cpuid2; while ((cpuid1 = x86DataCpuidNext(&iter))) { - cpuid2 = x86DataCpuid(data2, cpuid1->function); + cpuid2 = x86DataCpuid(data2, cpuid1->eax_in); if (cpuid2) x86cpuidAndBits(cpuid1, cpuid2); else @@ -397,7 +397,7 @@ x86DataIsSubset(const virCPUx86Data *data, const virCPUx86CPUID *cpuidSubset; while ((cpuidSubset = x86DataCpuidNext(&iter))) { - if (!(cpuid = x86DataCpuid(data, cpuidSubset->function)) || + if (!(cpuid = x86DataCpuid(data, cpuidSubset->eax_in)) || !x86cpuidMatchMasked(cpuid, cpuidSubset)) return false; } @@ -438,7 +438,7 @@ x86DataToVendor(const virCPUx86Data *data, for (i = 0; i < map->nvendors; i++) { virCPUx86VendorPtr vendor = map->vendors[i]; - if ((cpuid = x86DataCpuid(data, vendor->cpuid.function)) && + if ((cpuid = x86DataCpuid(data, vendor->cpuid.eax_in)) && x86cpuidMatchMasked(cpuid, &vendor->cpuid)) { x86cpuidClearBits(cpuid, &vendor->cpuid); return vendor; @@ -553,7 +553,7 @@ x86VendorParse(xmlXPathContextPtr ctxt, goto error; } - vendor->cpuid.function = 0; + vendor->cpuid.eax_in = 0; vendor->cpuid.ebx = virReadBufInt32LE(string); vendor->cpuid.edx = virReadBufInt32LE(string + 4); vendor->cpuid.ecx = virReadBufInt32LE(string + 8); @@ -667,23 +667,25 @@ static int x86ParseCPUID(xmlXPathContextPtr ctxt, virCPUx86CPUID *cpuid) { - unsigned long fun, eax, ebx, ecx, edx; - int ret_fun, ret_eax, ret_ebx, ret_ecx, ret_edx; + unsigned long eax_in; + unsigned long eax, ebx, ecx, edx; + int ret_eax_in, ret_eax, ret_ebx, ret_ecx, ret_edx; memset(cpuid, 0, sizeof(*cpuid)); - fun = eax = ebx = ecx = edx = 0; - ret_fun = virXPathULongHex("string(@function)", ctxt, &fun); + eax_in = 0; + eax = ebx = ecx = edx = 0; + ret_eax_in = virXPathULongHex("string(@eax_in)", ctxt, &eax_in); ret_eax = virXPathULongHex("string(@eax)", ctxt, &eax); ret_ebx = virXPathULongHex("string(@ebx)", ctxt, &ebx); ret_ecx = virXPathULongHex("string(@ecx)", ctxt, &ecx); ret_edx = virXPathULongHex("string(@edx)", ctxt, &edx); - if (ret_fun < 0 || ret_eax == -2 || ret_ebx == -2 - || ret_ecx == -2 || ret_edx == -2) + if (ret_eax_in < 0 || + ret_eax == -2 || ret_ebx == -2 || ret_ecx == -2 || ret_edx == -2) return -1; - cpuid->function = fun; + cpuid->eax_in = eax_in; cpuid->eax = eax; cpuid->ebx = ebx; cpuid->ecx = ecx; @@ -966,7 +968,7 @@ x86ModelCompare(virCPUx86ModelPtr model1, while ((cpuid1 = x86DataCpuidNext(&iter1))) { virCPUx86CompareResult match = SUPERSET; - if ((cpuid2 = x86DataCpuid(model2->data, cpuid1->function))) { + if ((cpuid2 = x86DataCpuid(model2->data, cpuid1->eax_in))) { if (x86cpuidMatch(cpuid1, cpuid2)) continue; else if (!x86cpuidMatchMasked(cpuid1, cpuid2)) @@ -982,7 +984,7 @@ x86ModelCompare(virCPUx86ModelPtr model1, while ((cpuid2 = x86DataCpuidNext(&iter2))) { virCPUx86CompareResult match = SUBSET; - if ((cpuid1 = x86DataCpuid(model1->data, cpuid2->function))) { + if ((cpuid1 = x86DataCpuid(model1->data, cpuid2->eax_in))) { if (x86cpuidMatch(cpuid2, cpuid1)) continue; else if (!x86cpuidMatchMasked(cpuid2, cpuid1)) @@ -1272,10 +1274,10 @@ x86CPUDataFormat(const virCPUData *data) virBufferAddLit(&buf, "<cpudata arch='x86'>\n"); while ((cpuid = x86DataCpuidNext(&iter))) { virBufferAsprintf(&buf, - " <cpuid function='0x%08x'" + " <cpuid eax_in='0x%08x'" " eax='0x%08x' ebx='0x%08x'" " ecx='0x%08x' edx='0x%08x'/>\n", - cpuid->function, + cpuid->eax_in, cpuid->eax, cpuid->ebx, cpuid->ecx, cpuid->edx); } virBufferAddLit(&buf, "</cpudata>\n"); @@ -1884,7 +1886,7 @@ cpuidCall(virCPUx86CPUID *cpuid) "=b" (cpuid->ebx), "=c" (cpuid->ecx), "=d" (cpuid->edx) - : "a" (cpuid->function)); + : "a" (cpuid->eax_in)); # else /* we need to avoid direct use of ebx for CPUID output as it is used * for global offset table on i386 with -fPIC @@ -1900,7 +1902,7 @@ cpuidCall(virCPUx86CPUID *cpuid) "=r" (cpuid->ebx), "=c" (cpuid->ecx), "=d" (cpuid->edx) - : "a" (cpuid->function) + : "a" (cpuid->eax_in) : "cc"); # endif } @@ -1917,7 +1919,7 @@ cpuidSet(uint32_t base, virCPUx86Data *data) max = cpuid.eax; for (i = base; i <= max; i++) { - cpuid.function = i; + cpuid.eax_in = i; cpuidCall(&cpuid); if (virCPUx86DataAddCPUID(data, &cpuid) < 0) return -1; diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index 777cc8d..ca87bc5 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -28,7 +28,7 @@ typedef struct _virCPUx86CPUID virCPUx86CPUID; struct _virCPUx86CPUID { - uint32_t function; + uint32_t eax_in; uint32_t eax; uint32_t ebx; uint32_t ecx; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 585b882..874ed24 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6363,7 +6363,7 @@ qemuMonitorJSONParseCPUx86FeatureWord(virJSONValuePtr data, virCPUx86CPUID *cpuid) { const char *reg; - unsigned long long fun; + unsigned long long eax_in; unsigned long long features; memset(cpuid, 0, sizeof(*cpuid)); @@ -6373,7 +6373,7 @@ qemuMonitorJSONParseCPUx86FeatureWord(virJSONValuePtr data, _("missing cpuid-register in CPU data")); return -1; } - if (virJSONValueObjectGetNumberUlong(data, "cpuid-input-eax", &fun) < 0) { + if (virJSONValueObjectGetNumberUlong(data, "cpuid-input-eax", &eax_in) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing or invalid cpuid-input-eax in CPU data")); return -1; @@ -6384,7 +6384,7 @@ qemuMonitorJSONParseCPUx86FeatureWord(virJSONValuePtr data, return -1; } - cpuid->function = fun; + cpuid->eax_in = eax_in; if (STREQ(reg, "EAX")) { cpuid->eax = features; } else if (STREQ(reg, "EBX")) { diff --git a/tests/qemumonitorjsondata/qemumonitorjson-getcpu-full.data b/tests/qemumonitorjsondata/qemumonitorjson-getcpu-full.data index bba8d31..87a8fb1 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-getcpu-full.data +++ b/tests/qemumonitorjsondata/qemumonitorjson-getcpu-full.data @@ -1,5 +1,5 @@ <cpudata arch='x86'> - <cpuid function='0x00000001' eax='0x00000000' ebx='0x00000000' ecx='0x97ba2223' edx='0x078bfbfd'/> - <cpuid function='0x40000001' eax='0x0100003b' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> - <cpuid function='0x80000001' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> + <cpuid eax_in='0x00000001' eax='0x00000000' ebx='0x00000000' ecx='0x97ba2223' edx='0x078bfbfd'/> + <cpuid eax_in='0x40000001' eax='0x0100003b' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> </cpudata> diff --git a/tests/qemumonitorjsondata/qemumonitorjson-getcpu-host.data b/tests/qemumonitorjsondata/qemumonitorjson-getcpu-host.data index 98b9e7c..83bafe1 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-getcpu-host.data +++ b/tests/qemumonitorjsondata/qemumonitorjson-getcpu-host.data @@ -1,6 +1,6 @@ <cpudata arch='x86'> - <cpuid function='0x00000001' eax='0x00000000' ebx='0x00000000' ecx='0x97ba2223' edx='0x0f8bfbff'/> - <cpuid function='0x00000007' eax='0x00000000' ebx='0x00000002' ecx='0x00000000' edx='0x00000000'/> - <cpuid function='0x40000001' eax='0x0100007b' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> - <cpuid function='0x80000001' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x2993fbff'/> + <cpuid eax_in='0x00000001' eax='0x00000000' ebx='0x00000000' ecx='0x97ba2223' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000007' eax='0x00000000' ebx='0x00000002' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' eax='0x0100007b' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x2993fbff'/> </cpudata> -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:18 +0200, Jiri Denemark wrote:
CPUID instruction normally takes its parameter from EAX, but sometimes ECX is used as an additional parameter. Let's rename 'function' to 'eax_in' in preparation for adding 'ecx_in'.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu_map.xml | 224 ++++++++++----------- src/cpu/cpu_x86.c | 86 ++++---- src/cpu/cpu_x86_data.h | 2 +- src/qemu/qemu_monitor_json.c | 6 +- .../qemumonitorjson-getcpu-full.data | 6 +- .../qemumonitorjson-getcpu-host.data | 8 +- 6 files changed, 167 insertions(+), 165 deletions(-)
ACK

This patch splits qemuMonitorJSONGetCPUx86Data in three functions: - qemuMonitorJSONCheckCPUx86 checks if QEMU supports reporting CPUID features for a guest CPU - qemuMonitorJSONParseCPUx86Features parses CPUID features from a JSON array - qemuMonitorJSONGetCPUx86Data gets the requested guest CPU property from QOM and uses qemuMonitorJSONParseCPUx86Features to parse it Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_monitor_json.c | 183 +++++++++++++++++++++++++------------------ src/qemu/qemu_monitor_json.h | 4 + 2 files changed, 109 insertions(+), 78 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 874ed24..47894f2 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6404,94 +6404,23 @@ qemuMonitorJSONParseCPUx86FeatureWord(virJSONValuePtr data, static int -qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon, - const char *property, - virCPUDataPtr *cpudata) +qemuMonitorJSONParseCPUx86Features(virJSONValuePtr data, + virCPUDataPtr *cpudata) { - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; - virJSONValuePtr element; virCPUx86Data *x86Data = NULL; virCPUx86CPUID cpuid; size_t i; ssize_t n; int ret = -1; - /* look up if the property exists before asking */ - if (!(cmd = qemuMonitorJSONMakeCommand("qom-list", - "s:path", QOM_CPU_PATH, - NULL))) - goto cleanup; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; - - /* check if device exists */ - if ((data = virJSONValueObjectGet(reply, "error"))) { - const char *klass = virJSONValueObjectGetString(data, "class"); - if (STREQ_NULLABLE(klass, "DeviceNotFound") || - STREQ_NULLABLE(klass, "CommandNotFound")) { - ret = -2; - goto cleanup; - } - } - - if (qemuMonitorJSONCheckError(cmd, reply)) - goto cleanup; - - data = virJSONValueObjectGetArray(reply, "return"); - if ((n = virJSONValueArraySize(data)) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("%s CPU property did not return an array"), - property); - goto cleanup; - } - - for (i = 0; i < n; i++) { - element = virJSONValueArrayGet(data, i); - if (STREQ_NULLABLE(virJSONValueObjectGetString(element, "name"), - property)) - break; - } - - /* "property" was not found */ - if (i == n) { - ret = -2; - goto cleanup; - } - - virJSONValueFree(cmd); - virJSONValueFree(reply); - - if (!(cmd = qemuMonitorJSONMakeCommand("qom-get", - "s:path", QOM_CPU_PATH, - "s:property", property, - NULL))) - goto cleanup; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; - - if (qemuMonitorJSONCheckError(cmd, reply)) - goto cleanup; - - if (!(data = virJSONValueObjectGetArray(reply, "return"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("qom-get reply was missing return data")); - goto cleanup; - } - - if ((n = virJSONValueArraySize(data)) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("%s CPU property did not return an array"), - property); - goto cleanup; + _("invalid array of CPUID features")); + return -1; } if (VIR_ALLOC(x86Data) < 0) - goto cleanup; + return -1; for (i = 0; i < n; i++) { if (qemuMonitorJSONParseCPUx86FeatureWord(virJSONValueArrayGet(data, i), @@ -6506,13 +6435,104 @@ qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon, ret = 0; cleanup: - virJSONValueFree(cmd); - virJSONValueFree(reply); virCPUx86DataFree(x86Data); return ret; } +int +qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon, + const char *property, + virCPUDataPtr *cpudata) +{ + virJSONValuePtr cmd = NULL; + virJSONValuePtr reply = NULL; + virJSONValuePtr data; + int ret = -1; + + if (!(cmd = qemuMonitorJSONMakeCommand("qom-get", + "s:path", QOM_CPU_PATH, + "s:property", property, + NULL))) + goto cleanup; + + if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) + goto cleanup; + + if (qemuMonitorJSONCheckError(cmd, reply)) + goto cleanup; + + data = virJSONValueObjectGetArray(reply, "return"); + ret = qemuMonitorJSONParseCPUx86Features(data, cpudata); + + cleanup: + virJSONValueFree(cmd); + virJSONValueFree(reply); + return ret; +} + + +/* + * Returns -1 on error, 0 if QEMU does not support reporting CPUID features + * of a guest CPU, and 1 if the feature is supported. + */ +static int +qemuMonitorJSONCheckCPUx86(qemuMonitorPtr mon) +{ + virJSONValuePtr cmd = NULL; + virJSONValuePtr reply = NULL; + virJSONValuePtr data; + size_t i; + ssize_t n; + int ret = -1; + + if (!(cmd = qemuMonitorJSONMakeCommand("qom-list", + "s:path", QOM_CPU_PATH, + NULL))) + goto cleanup; + + if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) + goto cleanup; + + if ((data = virJSONValueObjectGet(reply, "error"))) { + const char *klass = virJSONValueObjectGetString(data, "class"); + if (STREQ_NULLABLE(klass, "DeviceNotFound") || + STREQ_NULLABLE(klass, "CommandNotFound")) { + ret = 0; + goto cleanup; + } + } + + if (qemuMonitorJSONCheckError(cmd, reply)) + goto cleanup; + + data = virJSONValueObjectGetArray(reply, "return"); + + if ((n = virJSONValueArraySize(data)) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("qom-list reply data was not an array")); + goto cleanup; + } + + for (i = 0; i < n; i++) { + virJSONValuePtr element = virJSONValueArrayGet(data, i); + if (STREQ_NULLABLE(virJSONValueObjectGetString(element, "name"), + "feature-words")) + break; + } + + if (i == n) + ret = 0; + else + ret = 1; + + cleanup: + virJSONValueFree(cmd); + virJSONValueFree(reply); + return ret; +} + + /** * qemuMonitorJSONGetGuestCPU: * @mon: Pointer to the monitor @@ -6529,9 +6549,16 @@ qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon, virArch arch, virCPUDataPtr *data) { + int rc; + switch (arch) { case VIR_ARCH_X86_64: case VIR_ARCH_I686: + if ((rc = qemuMonitorJSONCheckCPUx86(mon)) < 0) + return -1; + else if (!rc) + return -2; + return qemuMonitorJSONGetCPUx86Data(mon, "feature-words", data); default: diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 76758db..586a363 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -457,6 +457,10 @@ int qemuMonitorJSONDetachCharDev(qemuMonitorPtr mon, int qemuMonitorJSONGetDeviceAliases(qemuMonitorPtr mon, char ***aliases); +int qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon, + const char *property, + virCPUDataPtr *cpudata); + int qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon, virArch arch, virCPUDataPtr *data); -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:19 +0200, Jiri Denemark wrote:
This patch splits qemuMonitorJSONGetCPUx86Data in three functions:
- qemuMonitorJSONCheckCPUx86 checks if QEMU supports reporting CPUID features for a guest CPU
- qemuMonitorJSONParseCPUx86Features parses CPUID features from a JSON array
- qemuMonitorJSONGetCPUx86Data gets the requested guest CPU property from QOM and uses qemuMonitorJSONParseCPUx86Features to parse it
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_monitor_json.c | 183 +++++++++++++++++++++++++------------------ src/qemu/qemu_monitor_json.h | 4 + 2 files changed, 109 insertions(+), 78 deletions(-)
ACK

It's a convenient wrapper around qemuMonitorTestNew which feeds the test monitor with QMP replies from a specified file. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/qemucapabilitiestest.c | 57 +--------------------------------------- tests/qemumonitortestutils.c | 62 ++++++++++++++++++++++++++++++++++++++++++++ tests/qemumonitortestutils.h | 3 +++ 3 files changed, 66 insertions(+), 56 deletions(-) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 3d55006..3b0463a 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -35,56 +35,6 @@ struct _testQemuData { const char *base; }; -static qemuMonitorTestPtr -testQemuFeedMonitor(char *replies, - virDomainXMLOptionPtr xmlopt) -{ - qemuMonitorTestPtr test = NULL; - char *tmp = replies; - char *singleReply = tmp; - - /* Our JSON parser expects replies to be separated by a newline character. - * Hence we must preprocess the file a bit. */ - while ((tmp = strchr(tmp, '\n'))) { - /* It is safe to touch tmp[1] since all strings ends with '\0'. */ - bool eof = !tmp[1]; - - if (*(tmp + 1) != '\n') { - *tmp = ' '; - tmp++; - } else { - /* Cut off a single reply. */ - *(tmp + 1) = '\0'; - - if (test) { - if (qemuMonitorTestAddItem(test, NULL, singleReply) < 0) - goto error; - } else { - /* Create new mocked monitor with our greeting */ - if (!(test = qemuMonitorTestNew(true, xmlopt, NULL, NULL, singleReply))) - goto error; - } - - if (!eof) { - /* Move the @tmp and @singleReply. */ - tmp += 2; - singleReply = tmp; - } - } - - if (eof) - break; - } - - if (test && qemuMonitorTestAddItem(test, NULL, singleReply) < 0) - goto error; - - return test; - - error: - qemuMonitorTestFree(test); - return NULL; -} static int testQemuCaps(const void *opaque) @@ -93,7 +43,6 @@ testQemuCaps(const void *opaque) const testQemuData *data = opaque; char *repliesFile = NULL; char *capsFile = NULL; - char *replies = NULL; qemuMonitorTestPtr mon = NULL; virQEMUCapsPtr capsActual = NULL; char *actual = NULL; @@ -104,10 +53,7 @@ testQemuCaps(const void *opaque) abs_srcdir, data->base, data->archName) < 0) goto cleanup; - if (virtTestLoadFile(repliesFile, &replies) < 0) - goto cleanup; - - if (!(mon = testQemuFeedMonitor(replies, data->xmlopt))) + if (!(mon = qemuMonitorTestNewFromFile(repliesFile, data->xmlopt))) goto cleanup; if (!(capsActual = virQEMUCapsNew()) || @@ -125,7 +71,6 @@ testQemuCaps(const void *opaque) cleanup: VIR_FREE(repliesFile); VIR_FREE(capsFile); - VIR_FREE(replies); VIR_FREE(actual); qemuMonitorTestFree(mon); virObjectUnref(capsActual); diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 3d34942..7b276bf 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -24,6 +24,7 @@ #include <string.h> #include <time.h> +#include "testutils.h" #include "qemumonitortestutils.h" #include "virthread.h" @@ -926,6 +927,67 @@ qemuMonitorTestNew(bool json, return NULL; } + +qemuMonitorTestPtr +qemuMonitorTestNewFromFile(const char *fileName, + virDomainXMLOptionPtr xmlopt) +{ + qemuMonitorTestPtr test = NULL; + char *json = NULL; + char *tmp; + char *singleReply; + + if (virtTestLoadFile(fileName, &json) < 0) + goto cleanup; + + /* Our JSON parser expects replies to be separated by a newline character. + * Hence we must preprocess the file a bit. */ + tmp = singleReply = json; + while ((tmp = strchr(tmp, '\n'))) { + /* It is safe to touch tmp[1] since all strings ends with '\0'. */ + bool eof = !tmp[1]; + + if (*(tmp + 1) != '\n') { + *tmp = ' '; + tmp++; + } else { + /* Cut off a single reply. */ + *(tmp + 1) = '\0'; + + if (test) { + if (qemuMonitorTestAddItem(test, NULL, singleReply) < 0) + goto error; + } else { + /* Create new mocked monitor with our greeting */ + if (!(test = qemuMonitorTestNew(true, xmlopt, NULL, NULL, singleReply))) + goto error; + } + + if (!eof) { + /* Move the @tmp and @singleReply. */ + tmp += 2; + singleReply = tmp; + } + } + + if (eof) + break; + } + + if (test && qemuMonitorTestAddItem(test, NULL, singleReply) < 0) + goto error; + + cleanup: + VIR_FREE(json); + return test; + + error: + qemuMonitorTestFree(test); + test = NULL; + goto cleanup; +} + + qemuMonitorTestPtr qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt) { diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index 3f07f65..ca8c143 100644 --- a/tests/qemumonitortestutils.h +++ b/tests/qemumonitortestutils.h @@ -69,6 +69,9 @@ qemuMonitorTestPtr qemuMonitorTestNew(bool json, virQEMUDriverPtr driver, const char *greeting); +qemuMonitorTestPtr qemuMonitorTestNewFromFile(const char *fileName, + virDomainXMLOptionPtr xmlopt); + qemuMonitorTestPtr qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt); -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:20 +0200, Jiri Denemark wrote:
It's a convenient wrapper around qemuMonitorTestNew which feeds the test monitor with QMP replies from a specified file.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/qemucapabilitiestest.c | 57 +--------------------------------------- tests/qemumonitortestutils.c | 62 ++++++++++++++++++++++++++++++++++++++++++++ tests/qemumonitortestutils.h | 3 +++ 3 files changed, 66 insertions(+), 56 deletions(-)
ACK

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/qemumonitortestutils.c | 24 ++++++++++++------------ tests/qemumonitortestutils.h | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 7b276bf..626e37c 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -96,8 +96,8 @@ qemuMonitorTestItemFree(qemuMonitorTestItemPtr item) * Appends data for a reply to the outgoing buffer */ int -qemuMonitorTestAddReponse(qemuMonitorTestPtr test, - const char *response) +qemuMonitorTestAddResponse(qemuMonitorTestPtr test, + const char *response) { size_t want = strlen(response) + 2; size_t have = test->outgoingCapacity - test->outgoingLength; @@ -122,12 +122,12 @@ int qemuMonitorTestAddUnexpectedErrorResponse(qemuMonitorTestPtr test) { if (test->agent || test->json) { - return qemuMonitorTestAddReponse(test, - "{ \"error\": " - " { \"desc\": \"Unexpected command\", " - " \"class\": \"UnexpectedCommand\" } }"); + return qemuMonitorTestAddResponse(test, + "{ \"error\": " + " { \"desc\": \"Unexpected command\", " + " \"class\": \"UnexpectedCommand\" } }"); } else { - return qemuMonitorTestAddReponse(test, "unexpected command"); + return qemuMonitorTestAddResponse(test, "unexpected command"); } } @@ -162,7 +162,7 @@ qemuMonitorReportError(qemuMonitorTestPtr test, const char *errmsg, ...) goto cleanup; } - ret = qemuMonitorTestAddReponse(test, jsonmsg); + ret = qemuMonitorTestAddResponse(test, jsonmsg); cleanup: va_end(msgargs); @@ -499,7 +499,7 @@ qemuMonitorTestProcessCommandDefault(qemuMonitorTestPtr test, if (data->command_name && STRNEQ(data->command_name, cmdname)) ret = qemuMonitorTestAddUnexpectedErrorResponse(test); else - ret = qemuMonitorTestAddReponse(test, data->response); + ret = qemuMonitorTestAddResponse(test, data->response); cleanup: VIR_FREE(cmdcopy); @@ -569,7 +569,7 @@ qemuMonitorTestProcessGuestAgentSync(qemuMonitorTestPtr test, goto cleanup; - ret = qemuMonitorTestAddReponse(test, retmsg); + ret = qemuMonitorTestAddResponse(test, retmsg); cleanup: virJSONValueFree(val); @@ -659,7 +659,7 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTestPtr test, } /* arguments checked out, return the response */ - ret = qemuMonitorTestAddReponse(test, data->response); + ret = qemuMonitorTestAddResponse(test, data->response); cleanup: VIR_FREE(argstr); @@ -911,7 +911,7 @@ qemuMonitorTestNew(bool json, if (!greeting) greeting = json ? QEMU_JSON_GREETING : QEMU_TEXT_GREETING; - if (qemuMonitorTestAddReponse(test, greeting) < 0) + if (qemuMonitorTestAddResponse(test, greeting) < 0) goto error; if (qemuMonitorCommonTestInit(test) < 0) diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index ca8c143..c420737 100644 --- a/tests/qemumonitortestutils.h +++ b/tests/qemumonitortestutils.h @@ -39,8 +39,8 @@ int qemuMonitorTestAddHandler(qemuMonitorTestPtr test, void *opaque, virFreeCallback freecb); -int qemuMonitorTestAddReponse(qemuMonitorTestPtr test, - const char *response); +int qemuMonitorTestAddResponse(qemuMonitorTestPtr test, + const char *response); int qemuMonitorTestAddUnexpectedErrorResponse(qemuMonitorTestPtr test); -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:21 +0200, Jiri Denemark wrote:
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/qemumonitortestutils.c | 24 ++++++++++++------------ tests/qemumonitortestutils.h | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-)
ACK

The current version uses the first JSON reply from the file as monitor greeting. With the new parameter the caller can now request a simple test monitor to be created, which uses an artificial greeting and uses all JSON strings from the file as regular replies. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/qemucapabilitiestest.c | 2 +- tests/qemumonitortestutils.c | 6 +++++- tests/qemumonitortestutils.h | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 3b0463a..32e2147 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -53,7 +53,7 @@ testQemuCaps(const void *opaque) abs_srcdir, data->base, data->archName) < 0) goto cleanup; - if (!(mon = qemuMonitorTestNewFromFile(repliesFile, data->xmlopt))) + if (!(mon = qemuMonitorTestNewFromFile(repliesFile, data->xmlopt, false))) goto cleanup; if (!(capsActual = virQEMUCapsNew()) || diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 626e37c..07da91c 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -930,7 +930,8 @@ qemuMonitorTestNew(bool json, qemuMonitorTestPtr qemuMonitorTestNewFromFile(const char *fileName, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOptionPtr xmlopt, + bool simple) { qemuMonitorTestPtr test = NULL; char *json = NULL; @@ -940,6 +941,9 @@ qemuMonitorTestNewFromFile(const char *fileName, if (virtTestLoadFile(fileName, &json) < 0) goto cleanup; + if (simple && !(test = qemuMonitorTestNewSimple(true, xmlopt))) + goto cleanup; + /* Our JSON parser expects replies to be separated by a newline character. * Hence we must preprocess the file a bit. */ tmp = singleReply = json; diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index c420737..8e2f371 100644 --- a/tests/qemumonitortestutils.h +++ b/tests/qemumonitortestutils.h @@ -70,7 +70,8 @@ qemuMonitorTestPtr qemuMonitorTestNew(bool json, const char *greeting); qemuMonitorTestPtr qemuMonitorTestNewFromFile(const char *fileName, - virDomainXMLOptionPtr xmlopt); + virDomainXMLOptionPtr xmlopt, + bool simple); qemuMonitorTestPtr qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt); -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:22 +0200, Jiri Denemark wrote:
The current version uses the first JSON reply from the file as monitor greeting. With the new parameter the caller can now request a simple test monitor to be created, which uses an artificial greeting and uses all JSON strings from the file as regular replies.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/qemucapabilitiestest.c | 2 +- tests/qemumonitortestutils.c | 6 +++++- tests/qemumonitortestutils.h | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-)
ACK

virCPUData, virCPUx86Feature, and virCPUx86Model all contained a pointer to virCPUx86Data, which was not very nice since the real CPUID data were accessible by yet another pointer from virCPUx86Data. Moreover, using virCPUx86Data directly will make static definitions of internal CPU features a bit easier. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu.h | 2 +- src/cpu/cpu_x86.c | 308 +++++++++++++++++++------------------------ src/cpu/cpu_x86.h | 4 +- src/cpu/cpu_x86_data.h | 2 + src/libvirt_private.syms | 2 +- src/qemu/qemu_monitor_json.c | 9 +- 6 files changed, 142 insertions(+), 185 deletions(-) diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 7f66585..7407e06 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -37,7 +37,7 @@ typedef virCPUData *virCPUDataPtr; struct _virCPUData { virArch arch; union { - virCPUx86Data *x86; + virCPUx86Data x86; virCPUppc64Data *ppc64; /* generic driver needs no data */ } data; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index bc71734..616b07a 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -55,7 +55,7 @@ typedef struct _virCPUx86Feature virCPUx86Feature; typedef virCPUx86Feature *virCPUx86FeaturePtr; struct _virCPUx86Feature { char *name; - virCPUx86Data *data; + virCPUx86Data data; bool migratable; }; @@ -93,7 +93,7 @@ typedef virCPUx86Model *virCPUx86ModelPtr; struct _virCPUx86Model { char *name; virCPUx86VendorPtr vendor; - virCPUx86Data *data; + virCPUx86Data data; }; typedef struct _virCPUx86Map virCPUx86Map; @@ -245,18 +245,17 @@ x86DataCpuid(const virCPUx86Data *data, } void -virCPUx86DataFree(virCPUx86Data *data) +virCPUx86DataClear(virCPUx86Data *data) { if (!data) return; VIR_FREE(data->data); - VIR_FREE(data); } virCPUDataPtr -virCPUx86MakeData(virArch arch, virCPUx86Data **data) +virCPUx86MakeData(virArch arch, virCPUx86Data *data) { virCPUDataPtr cpuData; @@ -265,7 +264,8 @@ virCPUx86MakeData(virArch arch, virCPUx86Data **data) cpuData->arch = arch; cpuData->data.x86 = *data; - *data = NULL; + data->len = 0; + data->data = NULL; return cpuData; } @@ -276,28 +276,24 @@ x86FreeCPUData(virCPUDataPtr data) if (!data) return; - virCPUx86DataFree(data->data.x86); + virCPUx86DataClear(&data->data.x86); VIR_FREE(data); } -static virCPUx86Data * -x86DataCopy(const virCPUx86Data *data) +static int +x86DataCopy(virCPUx86Data *dst, const virCPUx86Data *src) { - virCPUx86Data *copy = NULL; size_t i; - if (VIR_ALLOC(copy) < 0 || - VIR_ALLOC_N(copy->data, data->len) < 0) { - virCPUx86DataFree(copy); - return NULL; - } + if (VIR_ALLOC_N(dst->data, src->len) < 0) + return -1; - copy->len = data->len; - for (i = 0; i < data->len; i++) - copy->data[i] = data->data[i]; + dst->len = src->len; + for (i = 0; i < src->len; i++) + dst->data[i] = src->data[i]; - return copy; + return 0; } @@ -417,8 +413,8 @@ x86DataToCPUFeatures(virCPUDefPtr cpu, for (i = 0; i < map->nfeatures; i++) { virCPUx86FeaturePtr feature = map->features[i]; - if (x86DataIsSubset(data, feature->data)) { - x86DataSubtract(data, feature->data); + if (x86DataIsSubset(data, &feature->data)) { + x86DataSubtract(data, &feature->data); if (virCPUDefAddFeature(cpu, feature->name, policy) < 0) return -1; } @@ -455,33 +451,33 @@ x86DataToCPU(const virCPUx86Data *data, virCPUx86MapPtr map) { virCPUDefPtr cpu; - virCPUx86Data *copy = NULL; - virCPUx86Data *modelData = NULL; + virCPUx86Data copy = VIR_CPU_X86_DATA_INIT; + virCPUx86Data modelData = VIR_CPU_X86_DATA_INIT; virCPUx86VendorPtr vendor; if (VIR_ALLOC(cpu) < 0 || VIR_STRDUP(cpu->model, model->name) < 0 || - !(copy = x86DataCopy(data)) || - !(modelData = x86DataCopy(model->data))) + x86DataCopy(©, data) < 0 || + x86DataCopy(&modelData, &model->data) < 0) goto error; - if ((vendor = x86DataToVendor(copy, map)) && + if ((vendor = x86DataToVendor(©, map)) && VIR_STRDUP(cpu->vendor, vendor->name) < 0) goto error; - x86DataSubtract(copy, modelData); - x86DataSubtract(modelData, data); + x86DataSubtract(©, &modelData); + x86DataSubtract(&modelData, data); /* because feature policy is ignored for host CPU */ cpu->type = VIR_CPU_TYPE_GUEST; - if (x86DataToCPUFeatures(cpu, VIR_CPU_FEATURE_REQUIRE, copy, map) || - x86DataToCPUFeatures(cpu, VIR_CPU_FEATURE_DISABLE, modelData, map)) + if (x86DataToCPUFeatures(cpu, VIR_CPU_FEATURE_REQUIRE, ©, map) || + x86DataToCPUFeatures(cpu, VIR_CPU_FEATURE_DISABLE, &modelData, map)) goto error; cleanup: - virCPUx86DataFree(modelData); - virCPUx86DataFree(copy); + virCPUx86DataClear(&modelData); + virCPUx86DataClear(©); return cpu; error: @@ -600,11 +596,6 @@ x86FeatureNew(void) if (VIR_ALLOC(feature) < 0) return NULL; - if (VIR_ALLOC(feature->data) < 0) { - VIR_FREE(feature); - return NULL; - } - return feature; } @@ -616,7 +607,7 @@ x86FeatureFree(virCPUx86FeaturePtr feature) return; VIR_FREE(feature->name); - virCPUx86DataFree(feature->data); + virCPUx86DataClear(&feature->data); VIR_FREE(feature); } @@ -649,7 +640,7 @@ x86FeatureNames(virCPUx86MapPtr map, for (i = 0; i < map->nfeatures; i++) { virCPUx86FeaturePtr feature = map->features[i]; - if (x86DataIsSubset(data, feature->data)) { + if (x86DataIsSubset(data, &feature->data)) { if (!first) virBufferAdd(&ret, separator, -1); else @@ -738,7 +729,7 @@ x86FeatureParse(xmlXPathContextPtr ctxt, i, feature->name); goto error; } - if (virCPUx86DataAddCPUID(feature->data, &cpuid)) + if (virCPUx86DataAddCPUID(&feature->data, &cpuid)) goto error; } @@ -781,33 +772,26 @@ x86FeaturesLoad(virCPUx86MapPtr map, return 0; } -static virCPUx86Data * -x86DataFromCPUFeatures(virCPUDefPtr cpu, +static int +x86DataFromCPUFeatures(virCPUx86Data *data, + virCPUDefPtr cpu, virCPUx86MapPtr map) { - virCPUx86Data *data; size_t i; - if (VIR_ALLOC(data) < 0) - return NULL; - for (i = 0; i < cpu->nfeatures; i++) { virCPUx86FeaturePtr feature; if (!(feature = x86FeatureFind(map, cpu->features[i].name))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown CPU feature %s"), cpu->features[i].name); - goto error; + return -1; } - if (x86DataAdd(data, feature->data) < 0) - goto error; + if (x86DataAdd(data, &feature->data) < 0) + return -1; } - return data; - - error: - virCPUx86DataFree(data); - return NULL; + return 0; } @@ -819,11 +803,6 @@ x86ModelNew(void) if (VIR_ALLOC(model) < 0) return NULL; - if (VIR_ALLOC(model->data) < 0) { - VIR_FREE(model); - return NULL; - } - return model; } @@ -835,7 +814,7 @@ x86ModelFree(virCPUx86ModelPtr model) return; VIR_FREE(model->name); - virCPUx86DataFree(model->data); + virCPUx86DataClear(&model->data); VIR_FREE(model); } @@ -847,7 +826,7 @@ x86ModelCopy(virCPUx86ModelPtr model) if (VIR_ALLOC(copy) < 0 || VIR_STRDUP(copy->name, model->name) < 0 || - !(copy->data = x86DataCopy(model->data))) { + x86DataCopy(©->data, &model->data) < 0) { x86ModelFree(copy); return NULL; } @@ -909,7 +888,7 @@ x86ModelFromCPU(const virCPUDef *cpu, goto error; } - if (x86DataAdd(model->data, feature->data)) + if (x86DataAdd(&model->data, &feature->data)) goto error; } @@ -936,7 +915,7 @@ x86ModelSubtractCPU(virCPUx86ModelPtr model, return -1; } - x86DataSubtract(model->data, cpu_model->data); + x86DataSubtract(&model->data, &cpu_model->data); for (i = 0; i < cpu->nfeatures; i++) { virCPUx86FeaturePtr feature; @@ -948,7 +927,7 @@ x86ModelSubtractCPU(virCPUx86ModelPtr model, return -1; } - x86DataSubtract(model->data, feature->data); + x86DataSubtract(&model->data, &feature->data); } return 0; @@ -960,15 +939,15 @@ x86ModelCompare(virCPUx86ModelPtr model1, virCPUx86ModelPtr model2) { virCPUx86CompareResult result = EQUAL; - virCPUx86DataIterator iter1 = virCPUx86DataIteratorInit(model1->data); - virCPUx86DataIterator iter2 = virCPUx86DataIteratorInit(model2->data); + virCPUx86DataIterator iter1 = virCPUx86DataIteratorInit(&model1->data); + virCPUx86DataIterator iter2 = virCPUx86DataIteratorInit(&model2->data); virCPUx86CPUID *cpuid1; virCPUx86CPUID *cpuid2; while ((cpuid1 = x86DataCpuidNext(&iter1))) { virCPUx86CompareResult match = SUPERSET; - if ((cpuid2 = x86DataCpuid(model2->data, cpuid1->eax_in))) { + if ((cpuid2 = x86DataCpuid(&model2->data, cpuid1->eax_in))) { if (x86cpuidMatch(cpuid1, cpuid2)) continue; else if (!x86cpuidMatchMasked(cpuid1, cpuid2)) @@ -984,7 +963,7 @@ x86ModelCompare(virCPUx86ModelPtr model1, while ((cpuid2 = x86DataCpuidNext(&iter2))) { virCPUx86CompareResult match = SUBSET; - if ((cpuid1 = x86DataCpuid(model1->data, cpuid2->eax_in))) { + if ((cpuid1 = x86DataCpuid(&model1->data, cpuid2->eax_in))) { if (x86cpuidMatch(cpuid2, cpuid1)) continue; else if (!x86cpuidMatchMasked(cpuid2, cpuid1)) @@ -1044,8 +1023,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, VIR_FREE(name); model->vendor = ancestor->vendor; - virCPUx86DataFree(model->data); - if (!(model->data = x86DataCopy(ancestor->data))) + if (x86DataCopy(&model->data, &ancestor->data) < 0) goto error; } @@ -1089,7 +1067,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, } VIR_FREE(name); - if (x86DataAdd(model->data, feature->data)) + if (x86DataAdd(&model->data, &feature->data)) goto error; } @@ -1207,7 +1185,7 @@ x86MapLoadInternalFeatures(virCPUx86MapPtr map) if (VIR_STRDUP(feature->name, name) < 0) goto error; - if (virCPUx86DataAddCPUID(feature->data, &x86_kvm_features[i].cpuid)) + if (virCPUx86DataAddCPUID(&feature->data, &x86_kvm_features[i].cpuid)) goto error; map->features[map->nfeatures++] = feature; @@ -1267,7 +1245,7 @@ virCPUx86GetMap(void) static char * x86CPUDataFormat(const virCPUData *data) { - virCPUx86DataIterator iter = virCPUx86DataIteratorInit(data->data.x86); + virCPUx86DataIterator iter = virCPUx86DataIteratorInit(&data->data.x86); virCPUx86CPUID *cpuid; virBuffer buf = VIR_BUFFER_INITIALIZER; @@ -1294,14 +1272,11 @@ x86CPUDataParse(xmlXPathContextPtr ctxt) { xmlNodePtr *nodes = NULL; virCPUDataPtr cpuData = NULL; - virCPUx86Data *data = NULL; + virCPUx86Data data = VIR_CPU_X86_DATA_INIT; virCPUx86CPUID cpuid; size_t i; int n; - if (VIR_ALLOC(data) < 0) - goto cleanup; - n = virXPathNodeSet("/cpudata/cpuid", ctxt, &nodes); if (n <= 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -1316,7 +1291,7 @@ x86CPUDataParse(xmlXPathContextPtr ctxt) _("failed to parse cpuid[%zu]"), i); goto cleanup; } - if (virCPUx86DataAddCPUID(data, &cpuid) < 0) + if (virCPUx86DataAddCPUID(&data, &cpuid) < 0) goto cleanup; } @@ -1324,7 +1299,7 @@ x86CPUDataParse(xmlXPathContextPtr ctxt) cleanup: VIR_FREE(nodes); - virCPUx86DataFree(data); + virCPUx86DataClear(&data); return cpuData; } @@ -1370,6 +1345,7 @@ x86Compute(virCPUDefPtr host, virCPUx86ModelPtr cpu_forbid = NULL; virCPUx86ModelPtr diff = NULL; virCPUx86ModelPtr guest_model = NULL; + virCPUx86Data guestData = VIR_CPU_X86_DATA_INIT; virCPUCompareResult ret; virCPUx86CompareResult result; virArch arch; @@ -1429,25 +1405,25 @@ x86Compute(virCPUDefPtr host, !(cpu_forbid = x86ModelFromCPU(cpu, map, VIR_CPU_FEATURE_FORBID))) goto error; - x86DataIntersect(cpu_forbid->data, host_model->data); - if (!x86DataIsEmpty(cpu_forbid->data)) { + x86DataIntersect(&cpu_forbid->data, &host_model->data); + if (!x86DataIsEmpty(&cpu_forbid->data)) { virX86CpuIncompatible(N_("Host CPU provides forbidden features"), - cpu_forbid->data); + &cpu_forbid->data); goto cleanup; } /* first remove features that were inherited from the CPU model and were * explicitly forced, disabled, or made optional */ - x86DataSubtract(cpu_require->data, cpu_force->data); - x86DataSubtract(cpu_require->data, cpu_optional->data); - x86DataSubtract(cpu_require->data, cpu_disable->data); + x86DataSubtract(&cpu_require->data, &cpu_force->data); + x86DataSubtract(&cpu_require->data, &cpu_optional->data); + x86DataSubtract(&cpu_require->data, &cpu_disable->data); result = x86ModelCompare(host_model, cpu_require); if (result == SUBSET || result == UNRELATED) { - x86DataSubtract(cpu_require->data, host_model->data); + x86DataSubtract(&cpu_require->data, &host_model->data); virX86CpuIncompatible(N_("Host CPU does not provide required " "features"), - cpu_require->data); + &cpu_require->data); goto cleanup; } @@ -1456,12 +1432,12 @@ x86Compute(virCPUDefPtr host, if (!(diff = x86ModelCopy(host_model))) goto error; - x86DataSubtract(diff->data, cpu_optional->data); - x86DataSubtract(diff->data, cpu_require->data); - x86DataSubtract(diff->data, cpu_disable->data); - x86DataSubtract(diff->data, cpu_force->data); + x86DataSubtract(&diff->data, &cpu_optional->data); + x86DataSubtract(&diff->data, &cpu_require->data); + x86DataSubtract(&diff->data, &cpu_disable->data); + x86DataSubtract(&diff->data, &cpu_force->data); - if (!x86DataIsEmpty(diff->data)) + if (!x86DataIsEmpty(&diff->data)) ret = VIR_CPU_COMPARE_SUPERSET; if (ret == VIR_CPU_COMPARE_SUPERSET @@ -1469,35 +1445,31 @@ x86Compute(virCPUDefPtr host, && cpu->match == VIR_CPU_MATCH_STRICT) { virX86CpuIncompatible(N_("Host CPU does not strictly match guest CPU: " "Extra features"), - diff->data); + &diff->data); goto cleanup; } if (guest) { - virCPUx86Data *guestData; - if (!(guest_model = x86ModelCopy(host_model))) goto error; if (cpu->vendor && - virCPUx86DataAddCPUID(guest_model->data, + virCPUx86DataAddCPUID(&guest_model->data, &host_model->vendor->cpuid) < 0) goto error; if (cpu->type == VIR_CPU_TYPE_GUEST && cpu->match == VIR_CPU_MATCH_EXACT) - x86DataSubtract(guest_model->data, diff->data); + x86DataSubtract(&guest_model->data, &diff->data); - if (x86DataAdd(guest_model->data, cpu_force->data)) + if (x86DataAdd(&guest_model->data, &cpu_force->data)) goto error; - x86DataSubtract(guest_model->data, cpu_disable->data); + x86DataSubtract(&guest_model->data, &cpu_disable->data); - if (!(guestData = x86DataCopy(guest_model->data)) || - !(*guest = virCPUx86MakeData(arch, &guestData))) { - virCPUx86DataFree(guestData); + if (x86DataCopy(&guestData, &guest_model->data) < 0 || + !(*guest = virCPUx86MakeData(arch, &guestData))) goto error; - } } cleanup: @@ -1509,6 +1481,7 @@ x86Compute(virCPUDefPtr host, x86ModelFree(cpu_disable); x86ModelFree(cpu_forbid); x86ModelFree(guest_model); + virCPUx86DataClear(&guestData); return ret; @@ -1603,8 +1576,8 @@ x86Decode(virCPUDefPtr cpu, virCPUx86ModelPtr candidate; virCPUDefPtr cpuCandidate; virCPUDefPtr cpuModel = NULL; - virCPUx86Data *copy = NULL; - virCPUx86Data *features = NULL; + virCPUx86Data copy = VIR_CPU_X86_DATA_INIT; + virCPUx86Data features = VIR_CPU_X86_DATA_INIT; const virCPUx86Data *cpuData = NULL; virCPUx86VendorPtr vendor; ssize_t i; @@ -1659,7 +1632,7 @@ x86Decode(virCPUDefPtr cpu, cpu->type == VIR_CPU_TYPE_HOST))) { virCPUDefFree(cpuModel); cpuModel = cpuCandidate; - cpuData = candidate->data; + cpuData = &candidate->data; if (rc == 2) break; } else { @@ -1691,13 +1664,13 @@ x86Decode(virCPUDefPtr cpu, } if (flags & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES) { - if (!(copy = x86DataCopy(cpuData)) || - !(features = x86DataFromCPUFeatures(cpuModel, map))) + if (x86DataCopy(©, cpuData) < 0 || + x86DataFromCPUFeatures(&features, cpuModel, map) < 0) goto cleanup; - x86DataSubtract(copy, features); + x86DataSubtract(©, &features); if (x86DataToCPUFeatures(cpuModel, VIR_CPU_FEATURE_REQUIRE, - copy, map) < 0) + ©, map) < 0) goto cleanup; } @@ -1713,8 +1686,8 @@ x86Decode(virCPUDefPtr cpu, cleanup: virCPUDefFree(cpuModel); - virCPUx86DataFree(copy); - virCPUx86DataFree(features); + virCPUx86DataClear(©); + virCPUx86DataClear(&features); return ret; } @@ -1726,26 +1699,27 @@ x86DecodeCPUData(virCPUDefPtr cpu, const char *preferred, unsigned int flags) { - return x86Decode(cpu, data->data.x86, models, nmodels, preferred, flags); + return x86Decode(cpu, &data->data.x86, models, nmodels, preferred, flags); } -static virCPUx86Data * -x86EncodePolicy(const virCPUDef *cpu, +static int +x86EncodePolicy(virCPUx86Data *data, + const virCPUDef *cpu, virCPUx86MapPtr map, virCPUFeaturePolicy policy) { virCPUx86ModelPtr model; - virCPUx86Data *data = NULL; if (!(model = x86ModelFromCPU(cpu, map, policy))) - return NULL; + return -1; - data = model->data; - model->data = NULL; + *data = model->data; + model->data.len = 0; + model->data.data = NULL; x86ModelFree(model); - return data; + return 0; } @@ -1760,12 +1734,12 @@ x86Encode(virArch arch, virCPUDataPtr *vendor) { virCPUx86MapPtr map = NULL; - virCPUx86Data *data_forced = NULL; - virCPUx86Data *data_required = NULL; - virCPUx86Data *data_optional = NULL; - virCPUx86Data *data_disabled = NULL; - virCPUx86Data *data_forbidden = NULL; - virCPUx86Data *data_vendor = NULL; + virCPUx86Data data_forced = VIR_CPU_X86_DATA_INIT; + virCPUx86Data data_required = VIR_CPU_X86_DATA_INIT; + virCPUx86Data data_optional = VIR_CPU_X86_DATA_INIT; + virCPUx86Data data_disabled = VIR_CPU_X86_DATA_INIT; + virCPUx86Data data_forbidden = VIR_CPU_X86_DATA_INIT; + virCPUx86Data data_vendor = VIR_CPU_X86_DATA_INIT; if (forced) *forced = NULL; @@ -1783,35 +1757,25 @@ x86Encode(virArch arch, if (!(map = virCPUx86GetMap())) goto error; - if (forced) { - data_forced = x86EncodePolicy(cpu, map, VIR_CPU_FEATURE_FORCE); - if (!data_forced) - goto error; - } + if (forced && + x86EncodePolicy(&data_forced, cpu, map, VIR_CPU_FEATURE_FORCE) < 0) + goto error; - if (required) { - data_required = x86EncodePolicy(cpu, map, VIR_CPU_FEATURE_REQUIRE); - if (!data_required) - goto error; - } + if (required && + x86EncodePolicy(&data_required, cpu, map, VIR_CPU_FEATURE_REQUIRE) < 0) + goto error; - if (optional) { - data_optional = x86EncodePolicy(cpu, map, VIR_CPU_FEATURE_OPTIONAL); - if (!data_optional) - goto error; - } + if (optional && + x86EncodePolicy(&data_optional, cpu, map, VIR_CPU_FEATURE_OPTIONAL) < 0) + goto error; - if (disabled) { - data_disabled = x86EncodePolicy(cpu, map, VIR_CPU_FEATURE_DISABLE); - if (!data_disabled) - goto error; - } + if (disabled && + x86EncodePolicy(&data_disabled, cpu, map, VIR_CPU_FEATURE_DISABLE) < 0) + goto error; - if (forbidden) { - data_forbidden = x86EncodePolicy(cpu, map, VIR_CPU_FEATURE_FORBID); - if (!data_forbidden) - goto error; - } + if (forbidden && + x86EncodePolicy(&data_forbidden, cpu, map, VIR_CPU_FEATURE_FORBID) < 0) + goto error; if (vendor) { virCPUx86VendorPtr v = NULL; @@ -1822,11 +1786,8 @@ x86Encode(virArch arch, goto error; } - if (v && - (VIR_ALLOC(data_vendor) < 0 || - virCPUx86DataAddCPUID(data_vendor, &v->cpuid) < 0)) { + if (v && virCPUx86DataAddCPUID(&data_vendor, &v->cpuid) < 0) goto error; - } } if (forced && @@ -1851,12 +1812,12 @@ x86Encode(virArch arch, return 0; error: - virCPUx86DataFree(data_forced); - virCPUx86DataFree(data_required); - virCPUx86DataFree(data_optional); - virCPUx86DataFree(data_disabled); - virCPUx86DataFree(data_forbidden); - virCPUx86DataFree(data_vendor); + virCPUx86DataClear(&data_forced); + virCPUx86DataClear(&data_required); + virCPUx86DataClear(&data_optional); + virCPUx86DataClear(&data_disabled); + virCPUx86DataClear(&data_forbidden); + virCPUx86DataClear(&data_vendor); if (forced) x86FreeCPUData(*forced); if (required) @@ -1933,15 +1894,12 @@ static virCPUDataPtr x86NodeData(virArch arch) { virCPUDataPtr cpuData = NULL; - virCPUx86Data *data; + virCPUx86Data data = VIR_CPU_X86_DATA_INIT; - if (VIR_ALLOC(data) < 0) - return NULL; - - if (cpuidSet(CPUX86_BASIC, data) < 0) + if (cpuidSet(CPUX86_BASIC, &data) < 0) goto error; - if (cpuidSet(CPUX86_EXTENDED, data) < 0) + if (cpuidSet(CPUX86_EXTENDED, &data) < 0) goto error; if (!(cpuData = virCPUx86MakeData(arch, &data))) @@ -1950,7 +1908,7 @@ x86NodeData(virArch arch) return cpuData; error: - virCPUx86DataFree(data); + virCPUx86DataClear(&data); return NULL; } @@ -2044,21 +2002,21 @@ x86Baseline(virCPUDefPtr *cpus, } } - x86DataIntersect(base_model->data, model->data); + x86DataIntersect(&base_model->data, &model->data); x86ModelFree(model); model = NULL; } - if (x86DataIsEmpty(base_model->data)) { + if (x86DataIsEmpty(&base_model->data)) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("CPUs are incompatible")); goto error; } - if (vendor && virCPUx86DataAddCPUID(base_model->data, &vendor->cpuid) < 0) + if (vendor && virCPUx86DataAddCPUID(&base_model->data, &vendor->cpuid) < 0) goto error; - if (x86Decode(cpu, base_model->data, models, nmodels, modelName, flags) < 0) + if (x86Decode(cpu, &base_model->data, models, nmodels, modelName, flags) < 0) goto error; if (STREQ_NULLABLE(cpu->model, modelName)) @@ -2105,7 +2063,7 @@ x86UpdateCustom(virCPUDefPtr guest, goto cleanup; } - if (x86DataIsSubset(host_model->data, feature->data)) + if (x86DataIsSubset(&host_model->data, &feature->data)) guest->features[i].policy = VIR_CPU_FEATURE_REQUIRE; else guest->features[i].policy = VIR_CPU_FEATURE_DISABLE; @@ -2116,7 +2074,7 @@ x86UpdateCustom(virCPUDefPtr guest, guest->match = VIR_CPU_MATCH_EXACT; if (x86ModelSubtractCPU(host_model, guest, map) || x86DataToCPUFeatures(guest, VIR_CPU_FEATURE_REQUIRE, - host_model->data, map)) + &host_model->data, map)) goto cleanup; } @@ -2222,7 +2180,7 @@ x86HasFeature(const virCPUData *data, if (!(feature = x86FeatureFind(map, name))) goto cleanup; - ret = x86DataIsSubset(data->data.x86, feature->data) ? 1 : 0; + ret = x86DataIsSubset(&data->data.x86, &feature->data) ? 1 : 0; cleanup: return ret; diff --git a/src/cpu/cpu_x86.h b/src/cpu/cpu_x86.h index af0fa23..09b95a5 100644 --- a/src/cpu/cpu_x86.h +++ b/src/cpu/cpu_x86.h @@ -32,9 +32,9 @@ extern struct cpuArchDriver cpuDriverX86; int virCPUx86DataAddCPUID(virCPUx86Data *data, const virCPUx86CPUID *cpuid); -void virCPUx86DataFree(virCPUx86Data *data); +void virCPUx86DataClear(virCPUx86Data *data); virCPUDataPtr virCPUx86MakeData(virArch arch, - virCPUx86Data **data); + virCPUx86Data *data); #endif /* __VIR_CPU_X86_H__ */ diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index ca87bc5..75f7b30 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -58,6 +58,8 @@ struct _virCPUx86CPUID { # define VIR_CPU_x86_KVM_HV_RESET "__kvm_hv_reset" +# define VIR_CPU_X86_DATA_INIT { 0 } + typedef struct _virCPUx86Data virCPUx86Data; struct _virCPUx86Data { size_t len; diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 4d56d1f..7155bcf 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -941,7 +941,7 @@ cpuUpdate; # cpu/cpu_x86.h virCPUx86DataAddCPUID; -virCPUx86DataFree; +virCPUx86DataClear; virCPUx86MakeData; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 47894f2..2cb0198 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6407,7 +6407,7 @@ static int qemuMonitorJSONParseCPUx86Features(virJSONValuePtr data, virCPUDataPtr *cpudata) { - virCPUx86Data *x86Data = NULL; + virCPUx86Data x86Data = VIR_CPU_X86_DATA_INIT; virCPUx86CPUID cpuid; size_t i; ssize_t n; @@ -6419,13 +6419,10 @@ qemuMonitorJSONParseCPUx86Features(virJSONValuePtr data, return -1; } - if (VIR_ALLOC(x86Data) < 0) - return -1; - for (i = 0; i < n; i++) { if (qemuMonitorJSONParseCPUx86FeatureWord(virJSONValueArrayGet(data, i), &cpuid) < 0 || - virCPUx86DataAddCPUID(x86Data, &cpuid) < 0) + virCPUx86DataAddCPUID(&x86Data, &cpuid) < 0) goto cleanup; } @@ -6435,7 +6432,7 @@ qemuMonitorJSONParseCPUx86Features(virJSONValuePtr data, ret = 0; cleanup: - virCPUx86DataFree(x86Data); + virCPUx86DataClear(&x86Data); return ret; } -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:23 +0200, Jiri Denemark wrote:
virCPUData, virCPUx86Feature, and virCPUx86Model all contained a pointer to virCPUx86Data, which was not very nice since the real CPUID data were accessible by yet another pointer from virCPUx86Data. Moreover, using virCPUx86Data directly will make static definitions of internal CPU features a bit easier.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu.h | 2 +- src/cpu/cpu_x86.c | 308 +++++++++++++++++++------------------------ src/cpu/cpu_x86.h | 4 +- src/cpu/cpu_x86_data.h | 2 + src/libvirt_private.syms | 2 +- src/qemu/qemu_monitor_json.c | 9 +- 6 files changed, 142 insertions(+), 185 deletions(-)
ACK

virCPUData and struct ppc64_model structures contained a pointer to virCPUppc64Data, which was not very nice since the real data were accessible by yet another level of pointers from virCPUppc64Data. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu.h | 2 +- src/cpu/cpu_ppc64.c | 65 +++++++++++++++++++----------------------------- src/cpu/cpu_ppc64_data.h | 2 ++ 3 files changed, 28 insertions(+), 41 deletions(-) diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 7407e06..f1d5276 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -38,7 +38,7 @@ struct _virCPUData { virArch arch; union { virCPUx86Data x86; - virCPUppc64Data *ppc64; + virCPUppc64Data ppc64; /* generic driver needs no data */ } data; }; diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 09f4596..ad2d6a7 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -47,7 +47,7 @@ struct ppc64_vendor { struct ppc64_model { char *name; const struct ppc64_vendor *vendor; - virCPUppc64Data *data; + virCPUppc64Data data; }; struct ppc64_map { @@ -133,39 +133,30 @@ ppc64CheckCompatibilityMode(const char *host_model, } static void -ppc64DataFree(virCPUppc64Data *data) +ppc64DataClear(virCPUppc64Data *data) { if (!data) return; VIR_FREE(data->pvr); - VIR_FREE(data); } -static virCPUppc64Data * -ppc64DataCopy(const virCPUppc64Data *data) +static int +ppc64DataCopy(virCPUppc64Data *dst, const virCPUppc64Data *src) { - virCPUppc64Data *copy; size_t i; - if (VIR_ALLOC(copy) < 0) - goto error; + if (VIR_ALLOC_N(dst->pvr, src->len) < 0) + return -1; - if (VIR_ALLOC_N(copy->pvr, data->len) < 0) - goto error; + dst->len = src->len; - copy->len = data->len; - - for (i = 0; i < data->len; i++) { - copy->pvr[i].value = data->pvr[i].value; - copy->pvr[i].mask = data->pvr[i].mask; + for (i = 0; i < src->len; i++) { + dst->pvr[i].value = src->pvr[i].value; + dst->pvr[i].mask = src->pvr[i].mask; } - return copy; - - error: - ppc64DataFree(copy); - return NULL; + return 0; } static void @@ -198,7 +189,7 @@ ppc64ModelFree(struct ppc64_model *model) if (!model) return; - ppc64DataFree(model->data); + ppc64DataClear(&model->data); VIR_FREE(model->name); VIR_FREE(model); } @@ -214,7 +205,7 @@ ppc64ModelCopy(const struct ppc64_model *model) if (VIR_STRDUP(copy->name, model->name) < 0) goto error; - if (!(copy->data = ppc64DataCopy(model->data))) + if (ppc64DataCopy(©->data, &model->data) < 0) goto error; copy->vendor = model->vendor; @@ -249,8 +240,8 @@ ppc64ModelFindPVR(const struct ppc64_map *map, for (i = 0; i < map->nmodels; i++) { struct ppc64_model *model = map->models[i]; - for (j = 0; j < model->data->len; j++) { - if ((pvr & model->data->pvr[j].mask) == model->data->pvr[j].value) + for (j = 0; j < model->data.len; j++) { + if ((pvr & model->data.pvr[j].mask) == model->data.pvr[j].value) return model; } } @@ -359,9 +350,6 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, if (VIR_ALLOC(model) < 0) goto error; - if (VIR_ALLOC(model->data) < 0) - goto error; - model->name = virXPathString("string(@name)", ctxt); if (!model->name) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -399,10 +387,10 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, goto error; } - if (VIR_ALLOC_N(model->data->pvr, n) < 0) + if (VIR_ALLOC_N(model->data.pvr, n) < 0) goto error; - model->data->len = n; + model->data.len = n; for (i = 0; i < n; i++) { ctxt->node = nodes[i]; @@ -413,7 +401,7 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, model->name); goto error; } - model->data->pvr[i].value = pvr; + model->data.pvr[i].value = pvr; if (virXPathULongHex("string(./@mask)", ctxt, &pvr) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -421,7 +409,7 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, model->name); goto error; } - model->data->pvr[i].mask = pvr; + model->data.pvr[i].mask = pvr; } cleanup: @@ -510,7 +498,7 @@ ppc64MakeCPUData(virArch arch, cpuData->arch = arch; - if (!(cpuData->data.ppc64 = ppc64DataCopy(data))) + if (ppc64DataCopy(&cpuData->data.ppc64, data) < 0) VIR_FREE(cpuData); return cpuData; @@ -632,7 +620,7 @@ ppc64Compute(virCPUDefPtr host, } if (guestData) - if (!(*guestData = ppc64MakeCPUData(arch, guest_model->data))) + if (!(*guestData = ppc64MakeCPUData(arch, &guest_model->data))) goto cleanup; ret = VIR_CPU_COMPARE_IDENTICAL; @@ -685,10 +673,10 @@ ppc64DriverDecode(virCPUDefPtr cpu, if (!data || !(map = ppc64LoadMap())) return -1; - if (!(model = ppc64ModelFindPVR(map, data->data.ppc64->pvr[0].value))) { + if (!(model = ppc64ModelFindPVR(map, data->data.ppc64.pvr[0].value))) { virReportError(VIR_ERR_OPERATION_FAILED, _("Cannot find CPU model with PVR 0x%08x"), - data->data.ppc64->pvr[0].value); + data->data.ppc64.pvr[0].value); goto cleanup; } @@ -718,7 +706,7 @@ ppc64DriverFree(virCPUDataPtr data) if (!data) return; - ppc64DataFree(data->data.ppc64); + ppc64DataClear(&data->data.ppc64); VIR_FREE(data); } @@ -731,10 +719,7 @@ ppc64DriverNodeData(virArch arch) if (VIR_ALLOC(nodeData) < 0) goto error; - if (VIR_ALLOC(nodeData->data.ppc64) < 0) - goto error; - - data = nodeData->data.ppc64; + data = &nodeData->data.ppc64; if (VIR_ALLOC_N(data->pvr, 1) < 0) goto error; diff --git a/src/cpu/cpu_ppc64_data.h b/src/cpu/cpu_ppc64_data.h index c0a130e..6c069eb 100644 --- a/src/cpu/cpu_ppc64_data.h +++ b/src/cpu/cpu_ppc64_data.h @@ -32,6 +32,8 @@ struct _virCPUppc64PVR { uint32_t mask; }; +# define VIR_CPU_PPC64_DATA_INIT { 0 } + typedef struct _virCPUppc64Data virCPUppc64Data; struct _virCPUppc64Data { size_t len; -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:24 +0200, Jiri Denemark wrote:
virCPUData and struct ppc64_model structures contained a pointer to virCPUppc64Data, which was not very nice since the real data were accessible by yet another level of pointers from virCPUppc64Data.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu.h | 2 +- src/cpu/cpu_ppc64.c | 65 +++++++++++++++++++----------------------------- src/cpu/cpu_ppc64_data.h | 2 ++ 3 files changed, 28 insertions(+), 41 deletions(-)
ACK

The internal features are only used in explicit checks with cpuHasFeature. Loading them into the CPU map is dangerous since the features may accidentally be reported to users when decoding CPUID data. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu_x86.c | 156 +++++++++++++++++++++++++++++------------------------- 1 file changed, 85 insertions(+), 71 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 616b07a..82921db 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -59,33 +59,75 @@ struct _virCPUx86Feature { bool migratable; }; -typedef struct _virCPUx86KVMFeature virCPUx86KVMFeature; -typedef virCPUx86KVMFeature *virCPUx86KVMFeaturePtr; -struct _virCPUx86KVMFeature { - const char *name; - const virCPUx86CPUID cpuid; -}; - -static const virCPUx86KVMFeature x86_kvm_features[] = + +#define KVM_FEATURE_DEF(Name, Eax_in, Eax) \ + static virCPUx86CPUID Name ## _cpuid[] = { \ + { .eax_in = Eax_in, .eax = Eax }, \ + } + +#define KVM_FEATURE(Name) \ + { \ + .name = (char *) Name, \ + .data = { \ + .len = ARRAY_CARDINALITY(Name ## _cpuid), \ + .data = Name ## _cpuid \ + } \ + } + +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE, + 0x40000001, 0x00000001); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_NOP_IO_DELAY, + 0x40000001, 0x00000002); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_MMU_OP, + 0x40000001, 0x00000004); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE2, + 0x40000001, 0x00000008); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_ASYNC_PF, + 0x40000001, 0x00000010); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_STEAL_TIME, + 0x40000001, 0x00000020); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_PV_EOI, + 0x40000001, 0x00000040); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_PV_UNHALT, + 0x40000001, 0x00000080); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT, + 0x40000001, 0x01000000); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RUNTIME, + 0x40000003, 0x00000001); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SYNIC, + 0x40000003, 0x00000004); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_STIMER, + 0x40000003, 0x00000008); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RELAXED, + 0x40000003, 0x00000020); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SPINLOCK, + 0x40000003, 0x00000022); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_VAPIC, + 0x40000003, 0x00000030); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_VPINDEX, + 0x40000003, 0x00000040); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RESET, + 0x40000003, 0x00000080); + +static virCPUx86Feature x86_kvm_features[] = { - {VIR_CPU_x86_KVM_CLOCKSOURCE, { .eax_in = 0x40000001, .eax = 0x00000001 }}, - {VIR_CPU_x86_KVM_NOP_IO_DELAY, { .eax_in = 0x40000001, .eax = 0x00000002 }}, - {VIR_CPU_x86_KVM_MMU_OP, { .eax_in = 0x40000001, .eax = 0x00000004 }}, - {VIR_CPU_x86_KVM_CLOCKSOURCE2, { .eax_in = 0x40000001, .eax = 0x00000008 }}, - {VIR_CPU_x86_KVM_ASYNC_PF, { .eax_in = 0x40000001, .eax = 0x00000010 }}, - {VIR_CPU_x86_KVM_STEAL_TIME, { .eax_in = 0x40000001, .eax = 0x00000020 }}, - {VIR_CPU_x86_KVM_PV_EOI, { .eax_in = 0x40000001, .eax = 0x00000040 }}, - {VIR_CPU_x86_KVM_PV_UNHALT, { .eax_in = 0x40000001, .eax = 0x00000080 }}, - {VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT, - { .eax_in = 0x40000001, .eax = 0x01000000 }}, - {VIR_CPU_x86_KVM_HV_RUNTIME, { .eax_in = 0x40000003, .eax = 0x00000001 }}, - {VIR_CPU_x86_KVM_HV_SYNIC, { .eax_in = 0x40000003, .eax = 0x00000004 }}, - {VIR_CPU_x86_KVM_HV_STIMER, { .eax_in = 0x40000003, .eax = 0x00000008 }}, - {VIR_CPU_x86_KVM_HV_RELAXED, { .eax_in = 0x40000003, .eax = 0x00000020 }}, - {VIR_CPU_x86_KVM_HV_SPINLOCK, { .eax_in = 0x40000003, .eax = 0x00000022 }}, - {VIR_CPU_x86_KVM_HV_VAPIC, { .eax_in = 0x40000003, .eax = 0x00000030 }}, - {VIR_CPU_x86_KVM_HV_VPINDEX, { .eax_in = 0x40000003, .eax = 0x00000040 }}, - {VIR_CPU_x86_KVM_HV_RESET, { .eax_in = 0x40000003, .eax = 0x00000080 }}, + KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE), + KVM_FEATURE(VIR_CPU_x86_KVM_NOP_IO_DELAY), + KVM_FEATURE(VIR_CPU_x86_KVM_MMU_OP), + KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE2), + KVM_FEATURE(VIR_CPU_x86_KVM_ASYNC_PF), + KVM_FEATURE(VIR_CPU_x86_KVM_STEAL_TIME), + KVM_FEATURE(VIR_CPU_x86_KVM_PV_EOI), + KVM_FEATURE(VIR_CPU_x86_KVM_PV_UNHALT), + KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_RUNTIME), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_SYNIC), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_STIMER), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_RELAXED), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_SPINLOCK), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_VAPIC), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_VPINDEX), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_RESET), }; typedef struct _virCPUx86Model virCPUx86Model; @@ -627,6 +669,21 @@ x86FeatureFind(virCPUx86MapPtr map, } +static virCPUx86FeaturePtr +x86FeatureFindInternal(const char *name) +{ + size_t i; + size_t count = ARRAY_CARDINALITY(x86_kvm_features); + + for (i = 0; i < count; i++) { + if (STREQ(x86_kvm_features[i].name, name)) + return x86_kvm_features + i; + } + + return NULL; +} + + static char * x86FeatureNames(virCPUx86MapPtr map, const char *separator, @@ -1159,47 +1216,6 @@ x86MapLoadCallback(cpuMapElement element, } -static int -x86MapLoadInternalFeatures(virCPUx86MapPtr map) -{ - size_t i; - virCPUx86FeaturePtr feature = NULL; - size_t nfeatures = map->nfeatures; - size_t count = ARRAY_CARDINALITY(x86_kvm_features); - - if (VIR_EXPAND_N(map->features, nfeatures, count) < 0) - goto error; - - for (i = 0; i < count; i++) { - const char *name = x86_kvm_features[i].name; - - if (x86FeatureFind(map, name)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("CPU feature %s already defined"), name); - goto error; - } - - if (!(feature = x86FeatureNew())) - goto error; - - if (VIR_STRDUP(feature->name, name) < 0) - goto error; - - if (virCPUx86DataAddCPUID(&feature->data, &x86_kvm_features[i].cpuid)) - goto error; - - map->features[map->nfeatures++] = feature; - feature = NULL; - } - - return 0; - - error: - x86FeatureFree(feature); - return -1; -} - - static virCPUx86MapPtr virCPUx86LoadMap(void) { @@ -1211,9 +1227,6 @@ virCPUx86LoadMap(void) if (cpuMapLoad("x86", x86MapLoadCallback, map) < 0) goto error; - if (x86MapLoadInternalFeatures(map) < 0) - goto error; - return map; error: @@ -2177,7 +2190,8 @@ x86HasFeature(const virCPUData *data, if (!(map = virCPUx86GetMap())) return -1; - if (!(feature = x86FeatureFind(map, name))) + if (!(feature = x86FeatureFind(map, name)) && + !(feature = x86FeatureFindInternal(name))) goto cleanup; ret = x86DataIsSubset(&data->data.x86, &feature->data) ? 1 : 0; -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:25 +0200, Jiri Denemark wrote:
The internal features are only used in explicit checks with cpuHasFeature. Loading them into the CPU map is dangerous since the features may accidentally be reported to users when decoding CPUID data.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu_x86.c | 156 +++++++++++++++++++++++++++++------------------------- 1 file changed, 85 insertions(+), 71 deletions(-)
ACK, although typecasting static strings into non-const is a bit gross.

So far we only test CPUID -> CPU def conversion on artificial CPUID data computed from another CPU def. This patch adds the infrastructure to test this conversion on real data gathered from a host CPU and two helper scripts for adding new test data: - cpu-gather.sh runs cpuid tool and qemu-system-x86_64 to get CPUID data from the host CPU; this is what users can be asked to run if they run into an issue with host CPU detection in libvirt - cpu-parse.sh takes the data generated by cpu-gather.sh and creates data files for CPU detection tests The CPUID data queried from QEMU will eventually switch to the format used by query-host-cpu QMP command once QEMU implements it. Until then we just spawn QEMU with -cpu host and query the guest CPU in QOM. They should both provide the same CPUID results, but query-host-cpu does not require any guest CPU to be created by QEMU. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/Makefile.am | 4 ++ tests/cputest.c | 156 +++++++++++++++++++++++++++++++++++++++- tests/cputestdata/cpu-gather.sh | 35 +++++++++ tests/cputestdata/cpu-parse.sh | 57 +++++++++++++++ 4 files changed, 249 insertions(+), 3 deletions(-) create mode 100755 tests/cputestdata/cpu-gather.sh create mode 100755 tests/cputestdata/cpu-parse.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 9238a73..8d37298 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -861,6 +861,10 @@ cputest_SOURCES = \ cputest.c \ testutils.c testutils.h cputest_LDADD = $(LDADDS) $(LIBXML_LIBS) +if WITH_QEMU +cputest_SOURCES += testutilsqemu.c testutilsqemu.h +cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS) +endif WITH_QEMU metadatatest_SOURCES = \ metadatatest.c \ diff --git a/tests/cputest.c b/tests/cputest.c index 431b587..2b243bb 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -40,6 +40,12 @@ #include "cpu/cpu_map.h" #include "virstring.h" +#if WITH_QEMU && WITH_YAJL +# include "testutilsqemu.h" +# include "qemumonitortestutils.h" +# include "qemu/qemu_monitor_json.h" +#endif + #define VIR_FROM_THIS VIR_FROM_CPU enum cpuTestBoolWithError { @@ -53,7 +59,10 @@ enum api { API_GUEST_DATA, API_BASELINE, API_UPDATE, - API_HAS_FEATURE + API_HAS_FEATURE, + API_HOST_CPUID, + API_GUEST_CPUID, + API_JSON_CPUID, }; static const char *apis[] = { @@ -61,7 +70,10 @@ static const char *apis[] = { "guest data", "baseline", "update", - "has feature" + "has feature", + "host CPUID", + "guest CPUID", + "json CPUID", }; struct data { @@ -77,6 +89,10 @@ struct data { int result; }; +#if WITH_QEMU && WITH_YAJL +static virQEMUDriver driver; +#endif + static virCPUDefPtr cpuTestLoadXML(const char *arch, const char *name) @@ -458,12 +474,114 @@ cpuTestHasFeature(const void *arg) } +static int +cpuTestCPUID(const void *arg) +{ + const struct data *data = arg; + int ret = -1; + virCPUDataPtr hostData = NULL; + char *hostFile = NULL; + char *host; + virCPUDefPtr cpu = NULL; + char *result = NULL; + + if (virAsprintf(&hostFile, "%s/cputestdata/%s-cpuid-%s.xml", + abs_srcdir, data->arch, data->host) < 0 || + virtTestLoadFile(hostFile, &host) < 0 || + !(hostData = cpuDataParse(host))) + goto cleanup; + + if (VIR_ALLOC(cpu) < 0) + goto cleanup; + + cpu->arch = hostData->arch; + if (data->api == API_GUEST_CPUID) { + cpu->type = VIR_CPU_TYPE_GUEST; + cpu->match = VIR_CPU_MATCH_EXACT; + cpu->fallback = VIR_CPU_FALLBACK_FORBID; + } else { + cpu->type = VIR_CPU_TYPE_HOST; + } + + if (cpuDecode(cpu, hostData, NULL, 0, NULL) < 0) + goto cleanup; + + if (virAsprintf(&result, "cpuid-%s-%s", + data->host, + data->api == API_HOST_CPUID ? "host" : "guest") < 0) + goto cleanup; + + ret = cpuTestCompareXML(data->arch, cpu, result, false); + + cleanup: + cpuDataFree(hostData); + virCPUDefFree(cpu); + VIR_FREE(result); + return ret; +} + + +#if WITH_QEMU && WITH_YAJL +static int +cpuTestJSONCPUID(const void *arg) +{ + const struct data *data = arg; + virCPUDataPtr cpuData = NULL; + virCPUDefPtr cpu = NULL; + qemuMonitorTestPtr testMon = NULL; + char *json = NULL; + char *result = NULL; + int ret = -1; + + if (virAsprintf(&json, "%s/cputestdata/%s-cpuid-%s.json", + abs_srcdir, data->arch, data->host) < 0 || + virAsprintf(&result, "cpuid-%s-json", data->host) < 0) + goto cleanup; + + if (!(testMon = qemuMonitorTestNewFromFile(json, driver.xmlopt, true))) + goto cleanup; + + if (qemuMonitorJSONGetCPUx86Data(qemuMonitorTestGetMonitor(testMon), + "feature-words", &cpuData) < 0) + goto cleanup; + + if (VIR_ALLOC(cpu) < 0) + goto cleanup; + + cpu->arch = cpuData->arch; + cpu->type = VIR_CPU_TYPE_GUEST; + cpu->match = VIR_CPU_MATCH_EXACT; + cpu->fallback = VIR_CPU_FALLBACK_FORBID; + + if (cpuDecode(cpu, cpuData, NULL, 0, NULL) < 0) + goto cleanup; + + ret = cpuTestCompareXML(data->arch, cpu, result, false); + + cleanup: + qemuMonitorTestFree(testMon); + cpuDataFree(cpuData); + virCPUDefFree(cpu); + VIR_FREE(result); + VIR_FREE(json); + return ret; +} +#endif + + static int (*cpuTest[])(const void *) = { cpuTestCompare, cpuTestGuestData, cpuTestBaseline, cpuTestUpdate, - cpuTestHasFeature + cpuTestHasFeature, + cpuTestCPUID, + cpuTestCPUID, +#if WITH_QEMU && WITH_YAJL + cpuTestJSONCPUID, +#else + NULL, +#endif }; @@ -508,6 +626,13 @@ mymain(void) { int ret = 0; +#if WITH_QEMU && WITH_YAJL + if (qemuTestDriverInit(&driver) < 0) + return EXIT_FAILURE; + + virEventRegisterDefaultImpl(); +#endif + #define DO_TEST(arch, api, name, host, cpu, \ models, nmodels, preferred, flags, result) \ do { \ @@ -562,6 +687,27 @@ mymain(void) models == NULL ? 0 : sizeof(models) / sizeof(char *), \ preferred, 0, result) +#if WITH_QEMU && WITH_YAJL +# define DO_TEST_CPUID_JSON(arch, host, json) \ + do { \ + if (json) { \ + DO_TEST(arch, API_JSON_CPUID, host, host, \ + NULL, NULL, 0, NULL, 0, 0); \ + } \ + } while (0) +#else +# define DO_TEST_CPUID_JSON(arch, host) +#endif + +#define DO_TEST_CPUID(arch, host, json) \ + do { \ + DO_TEST(arch, API_HOST_CPUID, host, host, \ + NULL, NULL, 0, NULL, 0, 0); \ + DO_TEST(arch, API_GUEST_CPUID, host, host, \ + NULL, NULL, 0, NULL, 0, 0); \ + DO_TEST_CPUID_JSON(arch, host, json); \ + } while (0) + /* host to host comparison */ DO_TEST_COMPARE("x86", "host", "host", VIR_CPU_COMPARE_IDENTICAL); DO_TEST_COMPARE("x86", "host", "host-better", VIR_CPU_COMPARE_INCOMPATIBLE); @@ -695,6 +841,10 @@ mymain(void) DO_TEST_GUESTDATA("ppc64", "host", "guest-legacy-incompatible", ppc_models, NULL, -1); DO_TEST_GUESTDATA("ppc64", "host", "guest-legacy-invalid", ppc_models, NULL, -1); +#if WITH_QEMU && WITH_YAJL + qemuTestDriverFree(&driver); +#endif + return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/cputestdata/cpu-gather.sh b/tests/cputestdata/cpu-gather.sh new file mode 100755 index 0000000..c8439a6 --- /dev/null +++ b/tests/cputestdata/cpu-gather.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# The cpuid tool can be usually found in a package called "cpuid". If your +# distro does not provide such package, you can find the sources or binary +# packages at http://www.etallen.com/cpuid.html + +grep 'model name' /proc/cpuinfo | head -n1 + +cpuid -1r + +echo +qemu=qemu-system-x86_64 +for cmd in /usr/bin/$qemu /usr/bin/qemu-kvm /usr/libexec/qemu-kvm; do + if [[ -x $cmd ]]; then + qemu=$cmd + break + fi +done + +qom_get() +{ + path='/machine/unattached/device[0]' + echo '{"execute":"qom-get","arguments":{"path":"'$path'",' \ + '"property":"'$1'"},"id":"'$1'"}' +} + +$qemu -machine accel=kvm -cpu host -nodefaults -nographic -qmp stdio <<EOF +{"execute":"qmp_capabilities"} +`qom_get feature-words` +`qom_get family` +`qom_get model` +`qom_get stepping` +`qom_get model-id` +{"execute":"quit"} +EOF diff --git a/tests/cputestdata/cpu-parse.sh b/tests/cputestdata/cpu-parse.sh new file mode 100755 index 0000000..1b5ab4a --- /dev/null +++ b/tests/cputestdata/cpu-parse.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# Usage: +# ./cpu-gather.sh | ./cpu-parse.sh + +data=`cat` + +model=`sed -ne '/^model name[ ]*:/ {s/^[^:]*: \(.*\)/\1/p; q}' <<<"$data"` + +fname=`sed -e 's/^ *//; + s/ *$//; + s/[ -]\+ \+/ /g; + s/(\([Rr]\|[Tt][Mm]\))//g; + s/.*\(Intel\|AMD\) //; + s/ \(Duo\|Quad\|II X[0-9]\+\) / /; + s/ \(CPU\|Processor\)\>//; + s/ @.*//; + s/ APU .*//; + s/ \(v[0-9]\|SE\)$//; + s/ /-/g' <<<"$model"` +fname="x86-cpuid-$fname" + +xml() +{ + hex='\(0x[0-9a-f]\+\)' + match="$hex $hex: eax=$hex ebx=$hex ecx=$hex edx=$hex" + subst="<cpuid eax_in='\\1' ecx_in='\\2' eax='\\3' ebx='\\4' ecx='\\5' edx='\\6'\\/>" + + echo "<!-- $model -->" + echo "<cpudata arch='x86'>" + sed -ne "s/^ *$match$/ $subst/p" + echo "</cpudata>" +} + +json() +{ + first=true + sed -ne '/{"QMP".*/d; + /{"return": {}}/d; + /{"timestamp":.*/d; + /^{/p' <<<"$data" | \ + while read; do + $first || echo + first=false + json_reformat <<<"$REPLY" | tr -s '\n' + done +} + +xml <<<"$data" >$fname.xml +echo $fname.xml + +json <<<"$data" >$fname.json +if [[ -s $fname.json ]]; then + echo $fname.json +else + rm $fname.new.json +fi -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:26 +0200, Jiri Denemark wrote:
So far we only test CPUID -> CPU def conversion on artificial CPUID data computed from another CPU def. This patch adds the infrastructure to test this conversion on real data gathered from a host CPU and two helper scripts for adding new test data:
- cpu-gather.sh runs cpuid tool and qemu-system-x86_64 to get CPUID data from the host CPU; this is what users can be asked to run if they run into an issue with host CPU detection in libvirt
- cpu-parse.sh takes the data generated by cpu-gather.sh and creates data files for CPU detection tests
The CPUID data queried from QEMU will eventually switch to the format used by query-host-cpu QMP command once QEMU implements it. Until then we just spawn QEMU with -cpu host and query the guest CPU in QOM. They should both provide the same CPUID results, but query-host-cpu does not require any guest CPU to be created by QEMU.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/Makefile.am | 4 ++ tests/cputest.c | 156 +++++++++++++++++++++++++++++++++++++++- tests/cputestdata/cpu-gather.sh | 35 +++++++++ tests/cputestdata/cpu-parse.sh | 57 +++++++++++++++ 4 files changed, 249 insertions(+), 3 deletions(-) create mode 100755 tests/cputestdata/cpu-gather.sh create mode 100755 tests/cputestdata/cpu-parse.sh
[...]
diff --git a/tests/cputest.c b/tests/cputest.c index 431b587..2b243bb 100644 --- a/tests/cputest.c +++ b/tests/cputest.c
[...]
@@ -458,12 +474,114 @@ cpuTestHasFeature(const void *arg) }
+static int +cpuTestCPUID(const void *arg) +{ + const struct data *data = arg; + int ret = -1; + virCPUDataPtr hostData = NULL; + char *hostFile = NULL;
hostFile is not freed
+ char *host;
'host' is uninitialized and not freed
+ virCPUDefPtr cpu = NULL; + char *result = NULL; + + if (virAsprintf(&hostFile, "%s/cputestdata/%s-cpuid-%s.xml", + abs_srcdir, data->arch, data->host) < 0 || + virtTestLoadFile(hostFile, &host) < 0 || + !(hostData = cpuDataParse(host))) + goto cleanup;
This one monster if condition is ugly.
+ + if (VIR_ALLOC(cpu) < 0) + goto cleanup; + + cpu->arch = hostData->arch; + if (data->api == API_GUEST_CPUID) { + cpu->type = VIR_CPU_TYPE_GUEST; + cpu->match = VIR_CPU_MATCH_EXACT; + cpu->fallback = VIR_CPU_FALLBACK_FORBID; + } else { + cpu->type = VIR_CPU_TYPE_HOST; + } + + if (cpuDecode(cpu, hostData, NULL, 0, NULL) < 0) + goto cleanup; + + if (virAsprintf(&result, "cpuid-%s-%s", + data->host, + data->api == API_HOST_CPUID ? "host" : "guest") < 0) + goto cleanup; + + ret = cpuTestCompareXML(data->arch, cpu, result, false); + + cleanup: + cpuDataFree(hostData); + virCPUDefFree(cpu); + VIR_FREE(result); + return ret; +}
ACK

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 2 + tests/cputestdata/x86-cpuid-A10-5800K-guest.xml | 26 +++++++++ tests/cputestdata/x86-cpuid-A10-5800K-host.xml | 26 +++++++++ tests/cputestdata/x86-cpuid-A10-5800K-json.xml | 16 +++++ tests/cputestdata/x86-cpuid-A10-5800K.json | 77 +++++++++++++++++++++++++ tests/cputestdata/x86-cpuid-A10-5800K.xml | 50 ++++++++++++++++ 6 files changed, 197 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-A10-5800K-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-A10-5800K-host.xml create mode 100644 tests/cputestdata/x86-cpuid-A10-5800K-json.xml create mode 100644 tests/cputestdata/x86-cpuid-A10-5800K.json create mode 100644 tests/cputestdata/x86-cpuid-A10-5800K.xml diff --git a/tests/cputest.c b/tests/cputest.c index 2b243bb..16be652 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -841,6 +841,8 @@ mymain(void) DO_TEST_GUESTDATA("ppc64", "host", "guest-legacy-incompatible", ppc_models, NULL, -1); DO_TEST_GUESTDATA("ppc64", "host", "guest-legacy-invalid", ppc_models, NULL, -1); + DO_TEST_CPUID("x86", "A10-5800K", true); + #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); #endif diff --git a/tests/cputestdata/x86-cpuid-A10-5800K-guest.xml b/tests/cputestdata/x86-cpuid-A10-5800K-guest.xml new file mode 100644 index 0000000..ded7b30 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-A10-5800K-guest.xml @@ -0,0 +1,26 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Opteron_G5</model> + <vendor>AMD</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='mmxext'/> + <feature policy='require' name='fxsr_opt'/> + <feature policy='require' name='cmp_legacy'/> + <feature policy='require' name='extapic'/> + <feature policy='require' name='cr8legacy'/> + <feature policy='require' name='osvw'/> + <feature policy='require' name='ibs'/> + <feature policy='require' name='skinit'/> + <feature policy='require' name='wdt'/> + <feature policy='require' name='lwp'/> + <feature policy='require' name='tce'/> + <feature policy='require' name='nodeid_msr'/> + <feature policy='require' name='topoext'/> + <feature policy='require' name='perfctr_core'/> + <feature policy='require' name='perfctr_nb'/> + <feature policy='require' name='bmi1'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-A10-5800K-host.xml b/tests/cputestdata/x86-cpuid-A10-5800K-host.xml new file mode 100644 index 0000000..4ee57d2 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-A10-5800K-host.xml @@ -0,0 +1,26 @@ +<cpu> + <arch>x86_64</arch> + <model>Opteron_G5</model> + <vendor>AMD</vendor> + <feature name='vme'/> + <feature name='ht'/> + <feature name='monitor'/> + <feature name='osxsave'/> + <feature name='mmxext'/> + <feature name='fxsr_opt'/> + <feature name='cmp_legacy'/> + <feature name='extapic'/> + <feature name='cr8legacy'/> + <feature name='osvw'/> + <feature name='ibs'/> + <feature name='skinit'/> + <feature name='wdt'/> + <feature name='lwp'/> + <feature name='tce'/> + <feature name='nodeid_msr'/> + <feature name='topoext'/> + <feature name='perfctr_core'/> + <feature name='perfctr_nb'/> + <feature name='bmi1'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-A10-5800K-json.xml b/tests/cputestdata/x86-cpuid-A10-5800K-json.xml new file mode 100644 index 0000000..6ebef60 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-A10-5800K-json.xml @@ -0,0 +1,16 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Opteron_G5</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='x2apic'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='mmxext'/> + <feature policy='require' name='fxsr_opt'/> + <feature policy='require' name='cmp_legacy'/> + <feature policy='require' name='cr8legacy'/> + <feature policy='require' name='osvw'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='bmi1'/> + <feature policy='disable' name='rdtscp'/> + <feature policy='disable' name='svm'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-A10-5800K.json b/tests/cputestdata/x86-cpuid-A10-5800K.json new file mode 100644 index 0000000..53b39ad --- /dev/null +++ b/tests/cputestdata/x86-cpuid-A10-5800K.json @@ -0,0 +1,77 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 9 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 2165747 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 642779136 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 10 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 3065524739 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 126614527 + } + ], + "id": "feature-words" +} + +{ + "return": 21, + "id": "family" +} + +{ + "return": 16, + "id": "model" +} + +{ + "return": 1, + "id": "stepping" +} + +{ + "return": "AMD A10-5800K APU with Radeon(tm) HD Graphics ", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-A10-5800K.xml b/tests/cputestdata/x86-cpuid-A10-5800K.xml new file mode 100644 index 0000000..2889056 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-A10-5800K.xml @@ -0,0 +1,50 @@ +<!-- AMD A10-5800K APU with Radeon(tm) HD Graphics --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00610f01' ebx='0x00040800' ecx='0x3e98320b' edx='0x178bfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00000000'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000008' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x000003c0' edx='0x40000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x3e' eax='0x00000080' ebx='0x00000340' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x8000001e' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00610f01' ebx='0x20000000' ecx='0x01ebbfff' edx='0x2fd3fbff'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20444d41' ebx='0x2d303141' ecx='0x30303835' edx='0x5041204b'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x69772055' ebx='0x52206874' ecx='0x6f656461' edx='0x6d74286e'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x44482029' ebx='0x61724720' ecx='0x63696870' edx='0x00202073'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0xff40ff18' ebx='0xff40ff30' ecx='0x10040140' edx='0x40020140'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x64006400' ebx='0x64004200' ecx='0x08008140' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x000007d9'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003030' ebx='0x00000000' ecx='0x00004003' edx='0x00000000'/> + <cpuid eax_in='0x80000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000001' ebx='0x00010000' ecx='0x00000000' edx='0x00001cff'/> + <cpuid eax_in='0x8000000b' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000d' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000f' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000010' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000011' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000012' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000013' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000014' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000015' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000016' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000017' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000018' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000019' ecx_in='0x00' eax='0xf040f018' ebx='0x64006400' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001a' ecx_in='0x00' eax='0x00000003' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001b' ecx_in='0x00' eax='0x000000ff' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001c' ecx_in='0x00' eax='0x00000000' ebx='0x80032013' ecx='0x00010200' edx='0x8000000f'/> + <cpuid eax_in='0x8000001d' ecx_in='0x00' eax='0x00000121' ebx='0x00c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x8000001e' ecx_in='0x00' eax='0x00000010' ebx='0x00000100' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Atom-D510-guest.xml | 20 ++++++++++++++++++ tests/cputestdata/x86-cpuid-Atom-D510-host.xml | 21 +++++++++++++++++++ tests/cputestdata/x86-cpuid-Atom-D510.xml | 27 +++++++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Atom-D510-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Atom-D510-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Atom-D510.xml diff --git a/tests/cputest.c b/tests/cputest.c index 16be652..2973368 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -842,6 +842,7 @@ mymain(void) DO_TEST_GUESTDATA("ppc64", "host", "guest-legacy-invalid", ppc_models, NULL, -1); DO_TEST_CPUID("x86", "A10-5800K", true); + DO_TEST_CPUID("x86", "Atom-D510", false); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Atom-D510-guest.xml b/tests/cputestdata/x86-cpuid-Atom-D510-guest.xml new file mode 100644 index 0000000..5e9efc7 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Atom-D510-guest.xml @@ -0,0 +1,20 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>core2duo</model> + <vendor>Intel</vendor> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='cx16'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='movbe'/> + <feature policy='require' name='lahf_lm'/> + <feature policy='disable' name='syscall'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Atom-D510-host.xml b/tests/cputestdata/x86-cpuid-Atom-D510-host.xml new file mode 100644 index 0000000..8cf4341 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Atom-D510-host.xml @@ -0,0 +1,21 @@ +<cpu> + <arch>x86_64</arch> + <model>n270</model> + <vendor>Intel</vendor> + <feature name='pse36'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='ds_cpl'/> + <feature name='tm2'/> + <feature name='cx16'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='movbe'/> + <feature name='lm'/> + <feature name='lahf_lm'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Atom-D510.xml b/tests/cputestdata/x86-cpuid-Atom-D510.xml new file mode 100644 index 0000000..b5aed8e --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Atom-D510.xml @@ -0,0 +1,27 @@ +<!-- Intel(R) Atom(TM) CPU D510 @ 1.66GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000a' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000106ca' ebx='0x00040800' ecx='0x0040e31d' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x4fba5901' ebx='0x0e3080c0' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x04004121' ebx='0x0140003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x04004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x04004143' ebx='0x01c0003f' ecx='0x000003ff' edx='0x00000001'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00000010'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07280203' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x20100000'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20202020' ebx='0x20202020' ecx='0x746e4920' edx='0x52286c65'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x74412029' ebx='0x54286d6f' ecx='0x4320294d' edx='0x44205550'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x20303135' ebx='0x20402020' ecx='0x36362e31' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x02006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x07280203' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x07280203' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Atom-N450-guest.xml | 21 +++++++++++++++++++ tests/cputestdata/x86-cpuid-Atom-N450-host.xml | 22 ++++++++++++++++++++ tests/cputestdata/x86-cpuid-Atom-N450.xml | 27 +++++++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Atom-N450-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Atom-N450-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Atom-N450.xml diff --git a/tests/cputest.c b/tests/cputest.c index 2973368..eae1adb 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -843,6 +843,7 @@ mymain(void) DO_TEST_CPUID("x86", "A10-5800K", true); DO_TEST_CPUID("x86", "Atom-D510", false); + DO_TEST_CPUID("x86", "Atom-N450", false); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Atom-N450-guest.xml b/tests/cputestdata/x86-cpuid-Atom-N450-guest.xml new file mode 100644 index 0000000..be11b88 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Atom-N450-guest.xml @@ -0,0 +1,21 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>core2duo</model> + <vendor>Intel</vendor> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='cx16'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='movbe'/> + <feature policy='require' name='lahf_lm'/> + <feature policy='disable' name='pse36'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Atom-N450-host.xml b/tests/cputestdata/x86-cpuid-Atom-N450-host.xml new file mode 100644 index 0000000..c79713d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Atom-N450-host.xml @@ -0,0 +1,22 @@ +<cpu> + <arch>x86_64</arch> + <model>n270</model> + <vendor>Intel</vendor> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='ds_cpl'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='cx16'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='movbe'/> + <feature name='syscall'/> + <feature name='lm'/> + <feature name='lahf_lm'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Atom-N450.xml b/tests/cputestdata/x86-cpuid-Atom-N450.xml new file mode 100644 index 0000000..1852d67 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Atom-N450.xml @@ -0,0 +1,27 @@ +<!-- Intel(R) Atom(TM) CPU N450 @ 1.66GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000a' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000106ca' ebx='0x00020800' ecx='0x0040e39d' edx='0xbfe9fbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x4fba5901' ebx='0x0e3080c0' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x00004121' ebx='0x0140003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x00004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x00004143' ebx='0x01c0003f' ecx='0x000003ff' edx='0x00000001'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00020220'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07280203' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x20100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20202020' ebx='0x20202020' ecx='0x746e4920' edx='0x52286c65'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x74412029' ebx='0x54286d6f' ecx='0x4320294d' edx='0x4e205550'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x20303534' ebx='0x20402020' ecx='0x36362e31' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x02006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003020' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x07280203' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x07280203' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Core-i5-2500-guest.xml | 24 ++++++ tests/cputestdata/x86-cpuid-Core-i5-2500-host.xml | 24 ++++++ tests/cputestdata/x86-cpuid-Core-i5-2500-json.xml | 9 +++ tests/cputestdata/x86-cpuid-Core-i5-2500.json | 88 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Core-i5-2500.xml | 34 +++++++++ 6 files changed, 180 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2500-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2500-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2500-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2500.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2500.xml diff --git a/tests/cputest.c b/tests/cputest.c index eae1adb..b8439e0 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -844,6 +844,7 @@ mymain(void) DO_TEST_CPUID("x86", "A10-5800K", true); DO_TEST_CPUID("x86", "Atom-D510", false); DO_TEST_CPUID("x86", "Atom-N450", false); + DO_TEST_CPUID("x86", "Core-i5-2500", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core-i5-2500-guest.xml b/tests/cputestdata/x86-cpuid-Core-i5-2500-guest.xml new file mode 100644 index 0000000..d12df2d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-2500-guest.xml @@ -0,0 +1,24 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>SandyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-2500-host.xml b/tests/cputestdata/x86-cpuid-Core-i5-2500-host.xml new file mode 100644 index 0000000..5572ba5 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-2500-host.xml @@ -0,0 +1,24 @@ +<cpu> + <arch>x86_64</arch> + <model>SandyBridge</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='pcid'/> + <feature name='osxsave'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-2500-json.xml b/tests/cputestdata/x86-cpuid-Core-i5-2500-json.xml new file mode 100644 index 0000000..a2ecde6 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-2500-json.xml @@ -0,0 +1,9 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>SandyBridge</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='tsc_adjust'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-2500.json b/tests/cputestdata/x86-cpuid-Core-i5-2500.json new file mode 100644 index 0000000..156b772 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-2500.json @@ -0,0 +1,88 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-eax": 6, + "features": 4 + }, + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 672139264 + }, + { + "cpuid-register": "ECX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 0 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 2 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 2545558019 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 42, + "id": "model" +} + +{ + "return": 7, + "id": "stepping" +} + +{ + "return": " Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Core-i5-2500.xml b/tests/cputestdata/x86-cpuid-Core-i5-2500.xml new file mode 100644 index 0000000..0a33413 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-2500.xml @@ -0,0 +1,34 @@ +<!-- Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000206a7' ebx='0x02100800' ecx='0x1fbae3ff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76035a01' ebx='0x00f0b0ff' ecx='0x00000000' edx='0x00ca0000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x02c0003f' ecx='0x00001fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00001120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000077' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300803' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000001' ecx='0x00000100' edx='0x00000002'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000004' ecx='0x00000201' edx='0x00000002'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20202020' ebx='0x20202020' ecx='0x65746e49' edx='0x2952286c'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x726f4320' ebx='0x4d542865' ecx='0x35692029' edx='0x3035322d'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x50432030' ebx='0x20402055' ecx='0x30332e33' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + .../cputestdata/x86-cpuid-Core-i5-2540M-guest.xml | 24 +++++++ tests/cputestdata/x86-cpuid-Core-i5-2540M-host.xml | 24 +++++++ tests/cputestdata/x86-cpuid-Core-i5-2540M-json.xml | 9 +++ tests/cputestdata/x86-cpuid-Core-i5-2540M.json | 82 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Core-i5-2540M.xml | 34 +++++++++ 6 files changed, 174 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2540M-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2540M-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2540M-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2540M.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-2540M.xml diff --git a/tests/cputest.c b/tests/cputest.c index b8439e0..502bc5a 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -845,6 +845,7 @@ mymain(void) DO_TEST_CPUID("x86", "Atom-D510", false); DO_TEST_CPUID("x86", "Atom-N450", false); DO_TEST_CPUID("x86", "Core-i5-2500", true); + DO_TEST_CPUID("x86", "Core-i5-2540M", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core-i5-2540M-guest.xml b/tests/cputestdata/x86-cpuid-Core-i5-2540M-guest.xml new file mode 100644 index 0000000..d12df2d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-2540M-guest.xml @@ -0,0 +1,24 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>SandyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-2540M-host.xml b/tests/cputestdata/x86-cpuid-Core-i5-2540M-host.xml new file mode 100644 index 0000000..5572ba5 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-2540M-host.xml @@ -0,0 +1,24 @@ +<cpu> + <arch>x86_64</arch> + <model>SandyBridge</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='pcid'/> + <feature name='osxsave'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-2540M-json.xml b/tests/cputestdata/x86-cpuid-Core-i5-2540M-json.xml new file mode 100644 index 0000000..a2ecde6 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-2540M-json.xml @@ -0,0 +1,9 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>SandyBridge</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='tsc_adjust'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-2540M.json b/tests/cputestdata/x86-cpuid-Core-i5-2540M.json new file mode 100644 index 0000000..6dc2a80 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-2540M.json @@ -0,0 +1,82 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-eax": 6, + "features": 4 + }, + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 672139264 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 2 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 2545558019 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 42, + "id": "model" +} + +{ + "return": 7, + "id": "stepping" +} + +{ + "return": " Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Core-i5-2540M.xml b/tests/cputestdata/x86-cpuid-Core-i5-2540M.xml new file mode 100644 index 0000000..3802d7d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-2540M.xml @@ -0,0 +1,34 @@ +<!-- Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000206a7' ebx='0x03100800' ecx='0x1fbae3ff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76035a01' ebx='0x00f0b2ff' ecx='0x00000000' edx='0x00ca0000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x02c0003f' ecx='0x00000fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00021120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000077' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000003'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000004' ecx='0x00000201' edx='0x00000003'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20202020' ebx='0x49202020' ecx='0x6c65746e' edx='0x20295228'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x65726f43' ebx='0x294d5428' ecx='0x2d356920' edx='0x30343532'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x5043204d' ebx='0x20402055' ecx='0x30362e32' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + .../cputestdata/x86-cpuid-Core-i5-4670T-guest.xml | 28 ++++++++ tests/cputestdata/x86-cpuid-Core-i5-4670T-host.xml | 28 ++++++++ tests/cputestdata/x86-cpuid-Core-i5-4670T-json.xml | 13 ++++ tests/cputestdata/x86-cpuid-Core-i5-4670T.json | 77 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Core-i5-4670T.xml | 34 ++++++++++ 6 files changed, 181 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-4670T-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-4670T-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-4670T-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-4670T.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-4670T.xml diff --git a/tests/cputest.c b/tests/cputest.c index 502bc5a..5dfcc59 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -846,6 +846,7 @@ mymain(void) DO_TEST_CPUID("x86", "Atom-N450", false); DO_TEST_CPUID("x86", "Core-i5-2500", true); DO_TEST_CPUID("x86", "Core-i5-2540M", true); + DO_TEST_CPUID("x86", "Core-i5-4670T", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core-i5-4670T-guest.xml b/tests/cputestdata/x86-cpuid-Core-i5-4670T-guest.xml new file mode 100644 index 0000000..77b1a18 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-4670T-guest.xml @@ -0,0 +1,28 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Haswell</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-4670T-host.xml b/tests/cputestdata/x86-cpuid-Core-i5-4670T-host.xml new file mode 100644 index 0000000..32051e4 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-4670T-host.xml @@ -0,0 +1,28 @@ +<cpu> + <arch>x86_64</arch> + <model>Haswell</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='osxsave'/> + <feature name='f16c'/> + <feature name='rdrand'/> + <feature name='pdpe1gb'/> + <feature name='abm'/> + <feature name='tsc_adjust'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-4670T-json.xml b/tests/cputestdata/x86-cpuid-Core-i5-4670T-json.xml new file mode 100644 index 0000000..32b86a1 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-4670T-json.xml @@ -0,0 +1,13 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Haswell</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-4670T.json b/tests/cputestdata/x86-cpuid-Core-i5-4670T.json new file mode 100644 index 0000000..e715ca0 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-4670T.json @@ -0,0 +1,77 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 33 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 739248128 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 4027 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 4160369187 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 60, + "id": "model" +} + +{ + "return": 3, + "id": "stepping" +} + +{ + "return": "Intel(R) Core(TM) i5-4670T CPU @ 2.30GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Core-i5-4670T.xml b/tests/cputestdata/x86-cpuid-Core-i5-4670T.xml new file mode 100644 index 0000000..62960f9 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-4670T.xml @@ -0,0 +1,34 @@ +<!-- Intel(R) Core(TM) i5-4670T CPU @ 2.30GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000306c3' ebx='0x00100800' ecx='0x7ffafbff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76036301' ebx='0x00f0b6ff' ecx='0x00000000' edx='0x00c10000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x02c0003f' ecx='0x00001fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00042120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000077' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00002fbb' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300803' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000001' ecx='0x00000100' edx='0x00000000'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000004' ecx='0x00000201' edx='0x00000000'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x3e' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000021' edx='0x2c100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x726f4320' edx='0x4d542865'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x35692029' ebx='0x3736342d' ecx='0x43205430' edx='0x40205550'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x332e3220' ebx='0x7a484730' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003027' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Core-i5-6600-guest.xml | 30 ++++++++ tests/cputestdata/x86-cpuid-Core-i5-6600-host.xml | 30 ++++++++ tests/cputestdata/x86-cpuid-Core-i5-6600-json.xml | 14 ++++ tests/cputestdata/x86-cpuid-Core-i5-6600.json | 82 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Core-i5-6600.xml | 46 ++++++++++++ 6 files changed, 203 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-6600-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-6600-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-6600-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-6600.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i5-6600.xml diff --git a/tests/cputest.c b/tests/cputest.c index 5dfcc59..9bf91a5 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -847,6 +847,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core-i5-2500", true); DO_TEST_CPUID("x86", "Core-i5-2540M", true); DO_TEST_CPUID("x86", "Core-i5-4670T", true); + DO_TEST_CPUID("x86", "Core-i5-6600", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core-i5-6600-guest.xml b/tests/cputestdata/x86-cpuid-Core-i5-6600-guest.xml new file mode 100644 index 0000000..0001b2d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-6600-guest.xml @@ -0,0 +1,30 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Broadwell</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='mpx'/> + <feature policy='require' name='clflushopt'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-6600-host.xml b/tests/cputestdata/x86-cpuid-Core-i5-6600-host.xml new file mode 100644 index 0000000..0c2aaee --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-6600-host.xml @@ -0,0 +1,30 @@ +<cpu> + <arch>x86_64</arch> + <model>Broadwell</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='osxsave'/> + <feature name='f16c'/> + <feature name='rdrand'/> + <feature name='pdpe1gb'/> + <feature name='abm'/> + <feature name='tsc_adjust'/> + <feature name='mpx'/> + <feature name='clflushopt'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-6600-json.xml b/tests/cputestdata/x86-cpuid-Core-i5-6600-json.xml new file mode 100644 index 0000000..bd54d9d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-6600-json.xml @@ -0,0 +1,14 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Broadwell</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='mpx'/> + <feature policy='require' name='clflushopt'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i5-6600.json b/tests/cputestdata/x86-cpuid-Core-i5-6600.json new file mode 100644 index 0000000..da296f9 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-6600.json @@ -0,0 +1,82 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-eax": 6, + "features": 4 + }, + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 15 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 289 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 739248128 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 10244027 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 4160369155 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 94, + "id": "model" +} + +{ + "return": 3, + "id": "stepping" +} + +{ + "return": "Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Core-i5-6600.xml b/tests/cputestdata/x86-cpuid-Core-i5-6600.xml new file mode 100644 index 0000000..cd0e63d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i5-6600.xml @@ -0,0 +1,46 @@ +<!-- Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x00000016' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000506e3' ebx='0x06100800' ecx='0x7ffafbff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76036301' ebx='0x00f0b6ff' ecx='0x00000000' edx='0x00c30000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x00c0003f' ecx='0x000003ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x02c0003f' ecx='0x00001fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00142120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x000007f7' ebx='0x00000002' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x029c6fbb' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300804' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000001' ecx='0x00000100' edx='0x00000006'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000004' ecx='0x00000201' edx='0x00000006'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x0000001f' ebx='0x00000440' ecx='0x00000440' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x0000000f' ebx='0x000003c0' ecx='0x00000100' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x03' eax='0x00000040' ebx='0x000003c0' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x04' eax='0x00000040' ebx='0x00000400' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000f' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000010' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000011' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000012' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000013' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000014' ecx_in='0x00' eax='0x00000001' ebx='0x0000000f' ecx='0x00000007' edx='0x00000000'/> + <cpuid eax_in='0x00000014' ecx_in='0x01' eax='0x02490002' ebx='0x003f3fff' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000015' ecx_in='0x00' eax='0x00000002' ebx='0x00000114' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000016' ecx_in='0x00' eax='0x00000ce4' ebx='0x00000f3c' ecx='0x00000064' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000121' edx='0x2c100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x726f4320' edx='0x4d542865'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x35692029' ebx='0x3036362d' ecx='0x50432030' edx='0x20402055'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x30332e33' ebx='0x007a4847' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003027' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000ce4' ebx='0x00000f3c' ecx='0x00000064' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000ce4' ebx='0x00000f3c' ecx='0x00000064' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Core-i7-2600-guest.xml | 24 +++++++ tests/cputestdata/x86-cpuid-Core-i7-2600-host.xml | 24 +++++++ tests/cputestdata/x86-cpuid-Core-i7-2600-json.xml | 9 +++ tests/cputestdata/x86-cpuid-Core-i7-2600.json | 77 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Core-i7-2600.xml | 34 ++++++++++ 6 files changed, 169 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-2600-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-2600-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-2600-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-2600.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-2600.xml diff --git a/tests/cputest.c b/tests/cputest.c index 9bf91a5..bd6ef15 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -848,6 +848,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core-i5-2540M", true); DO_TEST_CPUID("x86", "Core-i5-4670T", true); DO_TEST_CPUID("x86", "Core-i5-6600", true); + DO_TEST_CPUID("x86", "Core-i7-2600", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core-i7-2600-guest.xml b/tests/cputestdata/x86-cpuid-Core-i7-2600-guest.xml new file mode 100644 index 0000000..d12df2d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-2600-guest.xml @@ -0,0 +1,24 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>SandyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-2600-host.xml b/tests/cputestdata/x86-cpuid-Core-i7-2600-host.xml new file mode 100644 index 0000000..5572ba5 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-2600-host.xml @@ -0,0 +1,24 @@ +<cpu> + <arch>x86_64</arch> + <model>SandyBridge</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='pcid'/> + <feature name='osxsave'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-2600-json.xml b/tests/cputestdata/x86-cpuid-Core-i7-2600-json.xml new file mode 100644 index 0000000..a2ecde6 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-2600-json.xml @@ -0,0 +1,9 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>SandyBridge</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='tsc_adjust'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-2600.json b/tests/cputestdata/x86-cpuid-Core-i7-2600.json new file mode 100644 index 0000000..dd35449 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-2600.json @@ -0,0 +1,77 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 672139264 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 2 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 2545558019 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 42, + "id": "model" +} + +{ + "return": 7, + "id": "stepping" +} + +{ + "return": " Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Core-i7-2600.xml b/tests/cputestdata/x86-cpuid-Core-i7-2600.xml new file mode 100644 index 0000000..ad15597 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-2600.xml @@ -0,0 +1,34 @@ +<!-- Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000206a7' ebx='0x05100800' ecx='0x1fbae3ff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76035a01' ebx='0x00f0b2ff' ecx='0x00000000' edx='0x00ca0000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x03c0003f' ecx='0x00001fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00001120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000077' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000005'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000008' ecx='0x00000201' edx='0x00000005'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20202020' ebx='0x20202020' ecx='0x65746e49' edx='0x2952286c'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x726f4320' ebx='0x4d542865' ecx='0x37692029' edx='0x3036322d'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x50432030' ebx='0x20402055' ecx='0x30342e33' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + .../cputestdata/x86-cpuid-Core-i7-3520M-guest.xml | 23 +++++++++++++++ tests/cputestdata/x86-cpuid-Core-i7-3520M-host.xml | 23 +++++++++++++++ tests/cputestdata/x86-cpuid-Core-i7-3520M.xml | 34 ++++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3520M-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3520M-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3520M.xml diff --git a/tests/cputest.c b/tests/cputest.c index bd6ef15..050c3de 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -849,6 +849,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core-i5-4670T", true); DO_TEST_CPUID("x86", "Core-i5-6600", true); DO_TEST_CPUID("x86", "Core-i7-2600", true); + DO_TEST_CPUID("x86", "Core-i7-3520M", false); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3520M-guest.xml b/tests/cputestdata/x86-cpuid-Core-i7-3520M-guest.xml new file mode 100644 index 0000000..f5125d4 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3520M-guest.xml @@ -0,0 +1,23 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>IvyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3520M-host.xml b/tests/cputestdata/x86-cpuid-Core-i7-3520M-host.xml new file mode 100644 index 0000000..80d3a9d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3520M-host.xml @@ -0,0 +1,23 @@ +<cpu> + <arch>x86_64</arch> + <model>IvyBridge</model> + <vendor>Intel</vendor> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='pcid'/> + <feature name='osxsave'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3520M.xml b/tests/cputestdata/x86-cpuid-Core-i7-3520M.xml new file mode 100644 index 0000000..3010468 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3520M.xml @@ -0,0 +1,34 @@ +<!-- Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000306a9' ebx='0x03100800' ecx='0x7fbae3ff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76035a01' ebx='0x00f0b2ff' ecx='0x00000000' edx='0x00ca0000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x03c0003f' ecx='0x00000fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00021120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000077' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000281' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000003'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000004' ecx='0x00000201' edx='0x00000003'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20202020' ebx='0x49202020' ecx='0x6c65746e' edx='0x20295228'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x65726f43' ebx='0x294d5428' ecx='0x2d376920' edx='0x30323533'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x5043204d' ebx='0x20402055' ecx='0x30392e32' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + .../cputestdata/x86-cpuid-Core-i7-3740QM-guest.xml | 23 +++++++ .../cputestdata/x86-cpuid-Core-i7-3740QM-host.xml | 23 +++++++ .../cputestdata/x86-cpuid-Core-i7-3740QM-json.xml | 9 +++ tests/cputestdata/x86-cpuid-Core-i7-3740QM.json | 77 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Core-i7-3740QM.xml | 34 ++++++++++ 6 files changed, 167 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3740QM-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3740QM-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3740QM-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3740QM.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3740QM.xml diff --git a/tests/cputest.c b/tests/cputest.c index 050c3de..f9772cd 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -850,6 +850,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core-i5-6600", true); DO_TEST_CPUID("x86", "Core-i7-2600", true); DO_TEST_CPUID("x86", "Core-i7-3520M", false); + DO_TEST_CPUID("x86", "Core-i7-3740QM", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3740QM-guest.xml b/tests/cputestdata/x86-cpuid-Core-i7-3740QM-guest.xml new file mode 100644 index 0000000..f5125d4 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3740QM-guest.xml @@ -0,0 +1,23 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>IvyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3740QM-host.xml b/tests/cputestdata/x86-cpuid-Core-i7-3740QM-host.xml new file mode 100644 index 0000000..80d3a9d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3740QM-host.xml @@ -0,0 +1,23 @@ +<cpu> + <arch>x86_64</arch> + <model>IvyBridge</model> + <vendor>Intel</vendor> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='pcid'/> + <feature name='osxsave'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3740QM-json.xml b/tests/cputestdata/x86-cpuid-Core-i7-3740QM-json.xml new file mode 100644 index 0000000..64e1fc9 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3740QM-json.xml @@ -0,0 +1,9 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>IvyBridge</model> + <feature policy='require' name='ss'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='tsc_adjust'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3740QM.json b/tests/cputestdata/x86-cpuid-Core-i7-3740QM.json new file mode 100644 index 0000000..2b1349f --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3740QM.json @@ -0,0 +1,77 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 672139264 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 643 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 4156170787 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 58, + "id": "model" +} + +{ + "return": 9, + "id": "stepping" +} + +{ + "return": " Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3740QM.xml b/tests/cputestdata/x86-cpuid-Core-i7-3740QM.xml new file mode 100644 index 0000000..3c40d11 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3740QM.xml @@ -0,0 +1,34 @@ +<!-- Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000306a9' ebx='0x03100800' ecx='0x7fbae3ff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76035a01' ebx='0x00f0b2ff' ecx='0x00000000' edx='0x00ca0000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x02c0003f' ecx='0x00001fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00021120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000077' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000281' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000003'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000008' ecx='0x00000201' edx='0x00000003'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x3e' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20202020' ebx='0x6e492020' ecx='0x286c6574' edx='0x43202952'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x2865726f' ebx='0x20294d54' ecx='0x332d3769' edx='0x51303437'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x5043204d' ebx='0x20402055' ecx='0x30372e32' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Core-i7-3770-guest.xml | 23 +++++++ tests/cputestdata/x86-cpuid-Core-i7-3770-host.xml | 23 +++++++ tests/cputestdata/x86-cpuid-Core-i7-3770-json.xml | 8 +++ tests/cputestdata/x86-cpuid-Core-i7-3770.json | 77 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Core-i7-3770.xml | 34 ++++++++++ 6 files changed, 166 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3770-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3770-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3770-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3770.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-3770.xml diff --git a/tests/cputest.c b/tests/cputest.c index f9772cd..9205ce2 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -851,6 +851,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core-i7-2600", true); DO_TEST_CPUID("x86", "Core-i7-3520M", false); DO_TEST_CPUID("x86", "Core-i7-3740QM", true); + DO_TEST_CPUID("x86", "Core-i7-3770", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3770-guest.xml b/tests/cputestdata/x86-cpuid-Core-i7-3770-guest.xml new file mode 100644 index 0000000..f5125d4 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3770-guest.xml @@ -0,0 +1,23 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>IvyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3770-host.xml b/tests/cputestdata/x86-cpuid-Core-i7-3770-host.xml new file mode 100644 index 0000000..80d3a9d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3770-host.xml @@ -0,0 +1,23 @@ +<cpu> + <arch>x86_64</arch> + <model>IvyBridge</model> + <vendor>Intel</vendor> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='pcid'/> + <feature name='osxsave'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3770-json.xml b/tests/cputestdata/x86-cpuid-Core-i7-3770-json.xml new file mode 100644 index 0000000..9b4086e --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3770-json.xml @@ -0,0 +1,8 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>IvyBridge</model> + <feature policy='require' name='ss'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='tsc_adjust'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3770.json b/tests/cputestdata/x86-cpuid-Core-i7-3770.json new file mode 100644 index 0000000..d83e778 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3770.json @@ -0,0 +1,77 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 672139264 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 643 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 4156170755 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 58, + "id": "model" +} + +{ + "return": 9, + "id": "stepping" +} + +{ + "return": " Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Core-i7-3770.xml b/tests/cputestdata/x86-cpuid-Core-i7-3770.xml new file mode 100644 index 0000000..ebdd50e --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-3770.xml @@ -0,0 +1,34 @@ +<!-- Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000306a9' ebx='0x05100800' ecx='0x7fbae3ff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76035a01' ebx='0x00f0b2ff' ecx='0x00000000' edx='0x00ca0000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x03c0003f' ecx='0x00001fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00001120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000077' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000281' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000005'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000008' ecx='0x00000201' edx='0x00000005'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20202020' ebx='0x20202020' ecx='0x65746e49' edx='0x2952286c'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x726f4320' ebx='0x4d542865' ecx='0x37692029' edx='0x3737332d'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x50432030' ebx='0x20402055' ecx='0x30342e33' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + .../cputestdata/x86-cpuid-Core-i7-4600U-guest.xml | 28 ++++++++ tests/cputestdata/x86-cpuid-Core-i7-4600U-host.xml | 28 ++++++++ tests/cputestdata/x86-cpuid-Core-i7-4600U-json.xml | 13 ++++ tests/cputestdata/x86-cpuid-Core-i7-4600U.json | 82 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Core-i7-4600U.xml | 34 +++++++++ 6 files changed, 186 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-4600U-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-4600U-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-4600U-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-4600U.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-4600U.xml diff --git a/tests/cputest.c b/tests/cputest.c index 9205ce2..46d0dcc 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -852,6 +852,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core-i7-3520M", false); DO_TEST_CPUID("x86", "Core-i7-3740QM", true); DO_TEST_CPUID("x86", "Core-i7-3770", true); + DO_TEST_CPUID("x86", "Core-i7-4600U", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core-i7-4600U-guest.xml b/tests/cputestdata/x86-cpuid-Core-i7-4600U-guest.xml new file mode 100644 index 0000000..89c95a8 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-4600U-guest.xml @@ -0,0 +1,28 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Haswell-noTSX</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-4600U-host.xml b/tests/cputestdata/x86-cpuid-Core-i7-4600U-host.xml new file mode 100644 index 0000000..6edbf8f --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-4600U-host.xml @@ -0,0 +1,28 @@ +<cpu> + <arch>x86_64</arch> + <model>Haswell-noTSX</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='osxsave'/> + <feature name='f16c'/> + <feature name='rdrand'/> + <feature name='pdpe1gb'/> + <feature name='abm'/> + <feature name='tsc_adjust'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-4600U-json.xml b/tests/cputestdata/x86-cpuid-Core-i7-4600U-json.xml new file mode 100644 index 0000000..2f6a925 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-4600U-json.xml @@ -0,0 +1,13 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Haswell-noTSX</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-4600U.json b/tests/cputestdata/x86-cpuid-Core-i7-4600U.json new file mode 100644 index 0000000..2b15fad --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-4600U.json @@ -0,0 +1,82 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-eax": 6, + "features": 4 + }, + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 33 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 739248128 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 1963 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 4160369187 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 69, + "id": "model" +} + +{ + "return": 1, + "id": "stepping" +} + +{ + "return": "Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Core-i7-4600U.xml b/tests/cputestdata/x86-cpuid-Core-i7-4600U.xml new file mode 100644 index 0000000..4c0c259 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-4600U.xml @@ -0,0 +1,34 @@ +<!-- Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00040651' ebx='0x02100800' ecx='0x7ffafbff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76036301' ebx='0x00f0b5ff' ecx='0x00000000' edx='0x00c10000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x03c0003f' ecx='0x00000fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x11142120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000077' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x000027ab' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000002'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000004' ecx='0x00000201' edx='0x00000002'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000021' edx='0x2c100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x726f4320' edx='0x4d542865'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x37692029' ebx='0x3036342d' ecx='0x43205530' edx='0x40205550'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x312e3220' ebx='0x7a484730' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003027' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + .../cputestdata/x86-cpuid-Core-i7-5600U-guest.xml | 28 +++++++ tests/cputestdata/x86-cpuid-Core-i7-5600U-host.xml | 28 +++++++ tests/cputestdata/x86-cpuid-Core-i7-5600U-json.xml | 13 ++++ tests/cputestdata/x86-cpuid-Core-i7-5600U.json | 88 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Core-i7-5600U.xml | 41 ++++++++++ 6 files changed, 199 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-5600U-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-5600U-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-5600U-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-5600U.json create mode 100644 tests/cputestdata/x86-cpuid-Core-i7-5600U.xml diff --git a/tests/cputest.c b/tests/cputest.c index 46d0dcc..ec1db82 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -853,6 +853,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core-i7-3740QM", true); DO_TEST_CPUID("x86", "Core-i7-3770", true); DO_TEST_CPUID("x86", "Core-i7-4600U", true); + DO_TEST_CPUID("x86", "Core-i7-5600U", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core-i7-5600U-guest.xml b/tests/cputestdata/x86-cpuid-Core-i7-5600U-guest.xml new file mode 100644 index 0000000..012946d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-5600U-guest.xml @@ -0,0 +1,28 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Broadwell</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-5600U-host.xml b/tests/cputestdata/x86-cpuid-Core-i7-5600U-host.xml new file mode 100644 index 0000000..04e7e78 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-5600U-host.xml @@ -0,0 +1,28 @@ +<cpu> + <arch>x86_64</arch> + <model>Broadwell</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='osxsave'/> + <feature name='f16c'/> + <feature name='rdrand'/> + <feature name='pdpe1gb'/> + <feature name='abm'/> + <feature name='tsc_adjust'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-5600U-json.xml b/tests/cputestdata/x86-cpuid-Core-i7-5600U-json.xml new file mode 100644 index 0000000..9a13e6e --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-5600U-json.xml @@ -0,0 +1,13 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Broadwell</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core-i7-5600U.json b/tests/cputestdata/x86-cpuid-Core-i7-5600U.json new file mode 100644 index 0000000..b570d46 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-5600U.json @@ -0,0 +1,88 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-eax": 6, + "features": 4 + }, + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 289 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 739248128 + }, + { + "cpuid-register": "ECX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 0 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 1839035 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 4160369187 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 61, + "id": "model" +} + +{ + "return": 4, + "id": "stepping" +} + +{ + "return": "Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Core-i7-5600U.xml b/tests/cputestdata/x86-cpuid-Core-i7-5600U.xml new file mode 100644 index 0000000..ecb4a6e --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core-i7-5600U.xml @@ -0,0 +1,41 @@ +<!-- Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x00000014' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000306d4' ebx='0x00100800' ecx='0x7ffafbff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76036301' ebx='0x00f0b5ff' ecx='0x00000000' edx='0x00c30000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x03c0003f' ecx='0x00000fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x11142120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000077' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x021c2fbb' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000000'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000004' ecx='0x00000201' edx='0x00000000'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000001' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000f' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000010' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000011' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000012' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000013' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000014' ecx_in='0x00' eax='0x00000000' ebx='0x00000001' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000121' edx='0x2c100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x726f4320' edx='0x4d542865'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x37692029' ebx='0x3036352d' ecx='0x43205530' edx='0x40205550'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x362e3220' ebx='0x7a484730' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003027' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000000' ebx='0x00000001' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000000' ebx='0x00000001' ecx='0x00000001' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Core2-E6850-guest.xml | 21 +++++++ tests/cputestdata/x86-cpuid-Core2-E6850-host.xml | 21 +++++++ tests/cputestdata/x86-cpuid-Core2-E6850-json.xml | 11 ++++ tests/cputestdata/x86-cpuid-Core2-E6850.json | 77 +++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Core2-E6850.xml | 27 ++++++++ 6 files changed, 158 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core2-E6850-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-E6850-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-E6850-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-E6850.json create mode 100644 tests/cputestdata/x86-cpuid-Core2-E6850.xml diff --git a/tests/cputest.c b/tests/cputest.c index ec1db82..344edcf 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -854,6 +854,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core-i7-3770", true); DO_TEST_CPUID("x86", "Core-i7-4600U", true); DO_TEST_CPUID("x86", "Core-i7-5600U", true); + DO_TEST_CPUID("x86", "Core2-E6850", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core2-E6850-guest.xml b/tests/cputestdata/x86-cpuid-Core2-E6850-guest.xml new file mode 100644 index 0000000..d9df03e --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core2-E6850-guest.xml @@ -0,0 +1,21 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>core2duo</model> + <vendor>Intel</vendor> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='cx16'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='lahf_lm'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core2-E6850-host.xml b/tests/cputestdata/x86-cpuid-Core2-E6850-host.xml new file mode 100644 index 0000000..c5ca1cb --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core2-E6850-host.xml @@ -0,0 +1,21 @@ +<cpu> + <arch>x86_64</arch> + <model>core2duo</model> + <vendor>Intel</vendor> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='cx16'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='lahf_lm'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core2-E6850-json.xml b/tests/cputestdata/x86-cpuid-Core2-E6850-json.xml new file mode 100644 index 0000000..ddd7307 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core2-E6850-json.xml @@ -0,0 +1,11 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Penryn</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='x2apic'/> + <feature policy='require' name='tsc-deadline'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='disable' name='sse4.1'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core2-E6850.json b/tests/cputestdata/x86-cpuid-Core2-E6850.json new file mode 100644 index 0000000..44be368 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core2-E6850.json @@ -0,0 +1,77 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 537921536 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 2 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 2166366721 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 15, + "id": "model" +} + +{ + "return": 11, + "id": "stepping" +} + +{ + "return": "Intel(R) Core(TM)2 Duo CPU E6850 @ 3.00GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Core2-E6850.xml b/tests/cputestdata/x86-cpuid-Core2-E6850.xml new file mode 100644 index 0000000..d832076 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core2-E6850.xml @@ -0,0 +1,27 @@ +<!-- Intel(R) Core(TM)2 Duo CPU E6850 @ 3.00GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000a' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000006fb' ebx='0x01020800' ecx='0x0000e3fd' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x05b0b101' ebx='0x005657f0' ecx='0x00000000' edx='0x2cb43049'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x04000121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x04000122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x04004143' ebx='0x03c0003f' ecx='0x00000fff' edx='0x00000001'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00000220'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000400' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07280202' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x20100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x726f4320' edx='0x4d542865'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x44203229' ebx='0x43206f75' ecx='0x20205550' edx='0x45202020'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x30353836' ebx='0x20402020' ecx='0x30302e33' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x10008040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x07280202' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x07280202' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Core2-Q9500-guest.xml | 22 +++++++++++++++++ tests/cputestdata/x86-cpuid-Core2-Q9500-host.xml | 22 +++++++++++++++++ tests/cputestdata/x86-cpuid-Core2-Q9500.xml | 30 +++++++++++++++++++++++ 4 files changed, 75 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Core2-Q9500-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-Q9500-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Core2-Q9500.xml diff --git a/tests/cputest.c b/tests/cputest.c index 344edcf..4e54a20 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -855,6 +855,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core-i7-4600U", true); DO_TEST_CPUID("x86", "Core-i7-5600U", true); DO_TEST_CPUID("x86", "Core2-E6850", true); + DO_TEST_CPUID("x86", "Core2-Q9500", false); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Core2-Q9500-guest.xml b/tests/cputestdata/x86-cpuid-Core2-Q9500-guest.xml new file mode 100644 index 0000000..37feefa --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core2-Q9500-guest.xml @@ -0,0 +1,22 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Penryn</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='xsave'/> + <feature policy='require' name='osxsave'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core2-Q9500-host.xml b/tests/cputestdata/x86-cpuid-Core2-Q9500-host.xml new file mode 100644 index 0000000..4dc2558 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core2-Q9500-host.xml @@ -0,0 +1,22 @@ +<cpu> + <arch>x86_64</arch> + <model>Penryn</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='xsave'/> + <feature name='osxsave'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Core2-Q9500.xml b/tests/cputestdata/x86-cpuid-Core2-Q9500.xml new file mode 100644 index 0000000..985263b --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Core2-Q9500.xml @@ -0,0 +1,30 @@ +<!-- Intel(R) Core(TM)2 Quad CPU Q9500 @ 2.83GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x0001067a' ebx='0x03040800' ecx='0x0c08e3bd' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x05b0b101' ebx='0x005657f0' ecx='0x00000000' edx='0x2cb43048'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x0c000121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x0c000122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x0c004143' ebx='0x02c0003f' ecx='0x00000fff' edx='0x00000001'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00022220'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000003' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000400' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07280202' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000003' ebx='0x00000240' ecx='0x00000240' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x20100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x726f4320' edx='0x4d542865'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x51203229' ebx='0x20646175' ecx='0x20555043' edx='0x51202020'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x30303539' ebx='0x20402020' ecx='0x33382e32' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0c006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000003' ebx='0x00000240' ecx='0x00000240' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000003' ebx='0x00000240' ecx='0x00000240' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-FX-8150-guest.xml | 24 +++++++++++++ tests/cputestdata/x86-cpuid-FX-8150-host.xml | 24 +++++++++++++ tests/cputestdata/x86-cpuid-FX-8150.xml | 49 +++++++++++++++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-FX-8150-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-FX-8150-host.xml create mode 100644 tests/cputestdata/x86-cpuid-FX-8150.xml diff --git a/tests/cputest.c b/tests/cputest.c index 4e54a20..304b42e 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -856,6 +856,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core-i7-5600U", true); DO_TEST_CPUID("x86", "Core2-E6850", true); DO_TEST_CPUID("x86", "Core2-Q9500", false); + DO_TEST_CPUID("x86", "FX-8150", false); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-FX-8150-guest.xml b/tests/cputestdata/x86-cpuid-FX-8150-guest.xml new file mode 100644 index 0000000..9858ee4 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-FX-8150-guest.xml @@ -0,0 +1,24 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Opteron_G4</model> + <vendor>AMD</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='mmxext'/> + <feature policy='require' name='fxsr_opt'/> + <feature policy='require' name='cmp_legacy'/> + <feature policy='require' name='extapic'/> + <feature policy='require' name='cr8legacy'/> + <feature policy='require' name='osvw'/> + <feature policy='require' name='ibs'/> + <feature policy='require' name='skinit'/> + <feature policy='require' name='wdt'/> + <feature policy='require' name='lwp'/> + <feature policy='require' name='nodeid_msr'/> + <feature policy='require' name='topoext'/> + <feature policy='require' name='perfctr_core'/> + <feature policy='require' name='perfctr_nb'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-FX-8150-host.xml b/tests/cputestdata/x86-cpuid-FX-8150-host.xml new file mode 100644 index 0000000..ec670c6 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-FX-8150-host.xml @@ -0,0 +1,24 @@ +<cpu> + <arch>x86_64</arch> + <model>Opteron_G4</model> + <vendor>AMD</vendor> + <feature name='vme'/> + <feature name='ht'/> + <feature name='monitor'/> + <feature name='osxsave'/> + <feature name='mmxext'/> + <feature name='fxsr_opt'/> + <feature name='cmp_legacy'/> + <feature name='extapic'/> + <feature name='cr8legacy'/> + <feature name='osvw'/> + <feature name='ibs'/> + <feature name='skinit'/> + <feature name='wdt'/> + <feature name='lwp'/> + <feature name='nodeid_msr'/> + <feature name='topoext'/> + <feature name='perfctr_core'/> + <feature name='perfctr_nb'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-FX-8150.xml b/tests/cputestdata/x86-cpuid-FX-8150.xml new file mode 100644 index 0000000..20ac45d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-FX-8150.xml @@ -0,0 +1,49 @@ +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00600f12' ebx='0x03080800' ecx='0x1e98220b' edx='0x178bfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00000000'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x000003c0' edx='0x40000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x3e' eax='0x00000080' ebx='0x00000340' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x8000001e' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00600f12' ebx='0x10000000' ecx='0x01c9bfff' edx='0x2fd3fbff'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20444d41' ebx='0x74285846' ecx='0x382d296d' edx='0x20303531'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x68676945' ebx='0x6f432d74' ecx='0x50206572' edx='0x65636f72'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x726f7373' ebx='0x20202020' ecx='0x20202020' edx='0x00202020'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0xff20ff18' ebx='0xff20ff30' ecx='0x10040140' edx='0x40020140'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x64000000' ebx='0x64004200' ecx='0x08008140' edx='0x0040c140'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x000003d9'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003030' ebx='0x00000000' ecx='0x00004007' edx='0x00000000'/> + <cpuid eax_in='0x80000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000001' ebx='0x00010000' ecx='0x00000000' edx='0x000014ff'/> + <cpuid eax_in='0x8000000b' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000d' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000f' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000010' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000011' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000012' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000013' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000014' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000015' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000016' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000017' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000018' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000019' ecx_in='0x00' eax='0xf020f018' ebx='0x64000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001a' ecx_in='0x00' eax='0x00000003' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001b' ecx_in='0x00' eax='0x000000ff' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001c' ecx_in='0x00' eax='0x00000000' ebx='0x80032013' ecx='0x00010200' edx='0x8000000f'/> + <cpuid eax_in='0x8000001d' ecx_in='0x00' eax='0x00000121' ebx='0x00c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x8000001e' ecx_in='0x00' eax='0x00000001' ebx='0x00000101' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Opteron-1352-guest.xml | 19 +++++++++++ tests/cputestdata/x86-cpuid-Opteron-1352-host.xml | 19 +++++++++++ tests/cputestdata/x86-cpuid-Opteron-1352.xml | 37 ++++++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Opteron-1352-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-1352-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-1352.xml diff --git a/tests/cputest.c b/tests/cputest.c index 304b42e..be3634e 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -857,6 +857,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core2-E6850", true); DO_TEST_CPUID("x86", "Core2-Q9500", false); DO_TEST_CPUID("x86", "FX-8150", false); + DO_TEST_CPUID("x86", "Opteron-1352", false); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Opteron-1352-guest.xml b/tests/cputestdata/x86-cpuid-Opteron-1352-guest.xml new file mode 100644 index 0000000..828a142 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-1352-guest.xml @@ -0,0 +1,19 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Opteron_G3</model> + <vendor>AMD</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='mmxext'/> + <feature policy='require' name='fxsr_opt'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='3dnowext'/> + <feature policy='require' name='3dnow'/> + <feature policy='require' name='cmp_legacy'/> + <feature policy='require' name='extapic'/> + <feature policy='require' name='cr8legacy'/> + <feature policy='require' name='3dnowprefetch'/> + <feature policy='require' name='osvw'/> + <feature policy='require' name='ibs'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Opteron-1352-host.xml b/tests/cputestdata/x86-cpuid-Opteron-1352-host.xml new file mode 100644 index 0000000..399398e --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-1352-host.xml @@ -0,0 +1,19 @@ +<cpu> + <arch>x86_64</arch> + <model>Opteron_G3</model> + <vendor>AMD</vendor> + <feature name='vme'/> + <feature name='ht'/> + <feature name='mmxext'/> + <feature name='fxsr_opt'/> + <feature name='pdpe1gb'/> + <feature name='3dnowext'/> + <feature name='3dnow'/> + <feature name='cmp_legacy'/> + <feature name='extapic'/> + <feature name='cr8legacy'/> + <feature name='3dnowprefetch'/> + <feature name='osvw'/> + <feature name='ibs'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Opteron-1352.xml b/tests/cputestdata/x86-cpuid-Opteron-1352.xml new file mode 100644 index 0000000..f3c2026 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-1352.xml @@ -0,0 +1,37 @@ +<!-- Quad-Core AMD Opteron(tm) Processor 1352 --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x00000005' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00100f23' ebx='0x01040800' ecx='0x00802009' edx='0x178bfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x8000001a' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00100f23' ebx='0x1000034f' ecx='0x000007ff' edx='0xefd3fbff'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x64617551' ebx='0x726f432d' ecx='0x4d412065' edx='0x704f2044'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x6f726574' ebx='0x6d74286e' ecx='0x72502029' edx='0x7365636f'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x20726f73' ebx='0x32353331' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0xff30ff10' ebx='0xff30ff20' ecx='0x40020140' edx='0x40020140'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x20800000' ebx='0x42004200' ecx='0x02008140' edx='0x0010a140'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x000001f9'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003030' ebx='0x00000000' ecx='0x00002003' edx='0x00000000'/> + <cpuid eax_in='0x80000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000001' ebx='0x00000040' ecx='0x00000000' edx='0x00000007'/> + <cpuid eax_in='0x8000000b' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000d' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000f' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000010' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000011' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000012' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000013' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000014' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000015' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000016' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000017' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000018' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000019' ecx_in='0x00' eax='0xf0300000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001a' ecx_in='0x00' eax='0x00000003' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Opteron-2350-guest.xml | 19 ++++++ tests/cputestdata/x86-cpuid-Opteron-2350-host.xml | 19 ++++++ tests/cputestdata/x86-cpuid-Opteron-2350-json.xml | 19 ++++++ tests/cputestdata/x86-cpuid-Opteron-2350.json | 71 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Opteron-2350.xml | 37 +++++++++++ 6 files changed, 166 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Opteron-2350-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-2350-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-2350-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-2350.json create mode 100644 tests/cputestdata/x86-cpuid-Opteron-2350.xml diff --git a/tests/cputest.c b/tests/cputest.c index be3634e..d283c62 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -858,6 +858,7 @@ mymain(void) DO_TEST_CPUID("x86", "Core2-Q9500", false); DO_TEST_CPUID("x86", "FX-8150", false); DO_TEST_CPUID("x86", "Opteron-1352", false); + DO_TEST_CPUID("x86", "Opteron-2350", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Opteron-2350-guest.xml b/tests/cputestdata/x86-cpuid-Opteron-2350-guest.xml new file mode 100644 index 0000000..828a142 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-2350-guest.xml @@ -0,0 +1,19 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Opteron_G3</model> + <vendor>AMD</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='mmxext'/> + <feature policy='require' name='fxsr_opt'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='3dnowext'/> + <feature policy='require' name='3dnow'/> + <feature policy='require' name='cmp_legacy'/> + <feature policy='require' name='extapic'/> + <feature policy='require' name='cr8legacy'/> + <feature policy='require' name='3dnowprefetch'/> + <feature policy='require' name='osvw'/> + <feature policy='require' name='ibs'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Opteron-2350-host.xml b/tests/cputestdata/x86-cpuid-Opteron-2350-host.xml new file mode 100644 index 0000000..399398e --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-2350-host.xml @@ -0,0 +1,19 @@ +<cpu> + <arch>x86_64</arch> + <model>Opteron_G3</model> + <vendor>AMD</vendor> + <feature name='vme'/> + <feature name='ht'/> + <feature name='mmxext'/> + <feature name='fxsr_opt'/> + <feature name='pdpe1gb'/> + <feature name='3dnowext'/> + <feature name='3dnow'/> + <feature name='cmp_legacy'/> + <feature name='extapic'/> + <feature name='cr8legacy'/> + <feature name='3dnowprefetch'/> + <feature name='osvw'/> + <feature name='ibs'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Opteron-2350-json.xml b/tests/cputestdata/x86-cpuid-Opteron-2350-json.xml new file mode 100644 index 0000000..be4cf5c --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-2350-json.xml @@ -0,0 +1,19 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Opteron_G3</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='x2apic'/> + <feature policy='require' name='tsc-deadline'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='mmxext'/> + <feature policy='require' name='fxsr_opt'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='3dnowext'/> + <feature policy='require' name='3dnow'/> + <feature policy='require' name='cmp_legacy'/> + <feature policy='require' name='cr8legacy'/> + <feature policy='require' name='3dnowprefetch'/> + <feature policy='require' name='osvw'/> + <feature policy='disable' name='monitor'/> + <feature policy='disable' name='rdtscp'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Opteron-2350.json b/tests/cputestdata/x86-cpuid-Opteron-2350.json new file mode 100644 index 0000000..79b5afa --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-2350.json @@ -0,0 +1,71 @@ +{ + "return": [ + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 1 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 1015 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 3864004608 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 2174754817 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 126614527 + } + ], + "id": "feature-words" +} + +{ + "return": 16, + "id": "family" +} + +{ + "return": 2, + "id": "model" +} + +{ + "return": 3, + "id": "stepping" +} + +{ + "return": "Quad-Core AMD Opteron(tm) Processor 2350", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Opteron-2350.xml b/tests/cputestdata/x86-cpuid-Opteron-2350.xml new file mode 100644 index 0000000..a928111 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-2350.xml @@ -0,0 +1,37 @@ +<!-- Quad-Core AMD Opteron(tm) Processor 2350 --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x00000005' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00100f23' ebx='0x01040800' ecx='0x00802009' edx='0x178bfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x8000001a' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00100f23' ebx='0x00000b2f' ecx='0x000007ff' edx='0xefd3fbff'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x64617551' ebx='0x726f432d' ecx='0x4d412065' edx='0x704f2044'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x6f726574' ebx='0x6d74286e' ecx='0x72502029' edx='0x7365636f'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x20726f73' ebx='0x30353332' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0xff30ff10' ebx='0xff30ff20' ecx='0x40020140' edx='0x40020140'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x20800000' ebx='0x42004200' ecx='0x02008140' edx='0x0010a140'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x000001f9'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003030' ebx='0x00000000' ecx='0x00002003' edx='0x00000000'/> + <cpuid eax_in='0x80000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000001' ebx='0x00000040' ecx='0x00000000' edx='0x00000007'/> + <cpuid eax_in='0x8000000b' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000d' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000f' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000010' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000011' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000012' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000013' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000014' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000015' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000016' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000017' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000018' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000019' ecx_in='0x00' eax='0xf0300000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001a' ecx_in='0x00' eax='0x00000003' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Opteron-6234-guest.xml | 24 ++++++ tests/cputestdata/x86-cpuid-Opteron-6234-host.xml | 24 ++++++ tests/cputestdata/x86-cpuid-Opteron-6234-json.xml | 16 ++++ tests/cputestdata/x86-cpuid-Opteron-6234.json | 88 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Opteron-6234.xml | 51 +++++++++++++ 6 files changed, 204 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6234-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6234-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6234-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6234.json create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6234.xml diff --git a/tests/cputest.c b/tests/cputest.c index d283c62..4642a91 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -859,6 +859,7 @@ mymain(void) DO_TEST_CPUID("x86", "FX-8150", false); DO_TEST_CPUID("x86", "Opteron-1352", false); DO_TEST_CPUID("x86", "Opteron-2350", true); + DO_TEST_CPUID("x86", "Opteron-6234", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Opteron-6234-guest.xml b/tests/cputestdata/x86-cpuid-Opteron-6234-guest.xml new file mode 100644 index 0000000..9858ee4 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-6234-guest.xml @@ -0,0 +1,24 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Opteron_G4</model> + <vendor>AMD</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='mmxext'/> + <feature policy='require' name='fxsr_opt'/> + <feature policy='require' name='cmp_legacy'/> + <feature policy='require' name='extapic'/> + <feature policy='require' name='cr8legacy'/> + <feature policy='require' name='osvw'/> + <feature policy='require' name='ibs'/> + <feature policy='require' name='skinit'/> + <feature policy='require' name='wdt'/> + <feature policy='require' name='lwp'/> + <feature policy='require' name='nodeid_msr'/> + <feature policy='require' name='topoext'/> + <feature policy='require' name='perfctr_core'/> + <feature policy='require' name='perfctr_nb'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Opteron-6234-host.xml b/tests/cputestdata/x86-cpuid-Opteron-6234-host.xml new file mode 100644 index 0000000..ec670c6 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-6234-host.xml @@ -0,0 +1,24 @@ +<cpu> + <arch>x86_64</arch> + <model>Opteron_G4</model> + <vendor>AMD</vendor> + <feature name='vme'/> + <feature name='ht'/> + <feature name='monitor'/> + <feature name='osxsave'/> + <feature name='mmxext'/> + <feature name='fxsr_opt'/> + <feature name='cmp_legacy'/> + <feature name='extapic'/> + <feature name='cr8legacy'/> + <feature name='osvw'/> + <feature name='ibs'/> + <feature name='skinit'/> + <feature name='wdt'/> + <feature name='lwp'/> + <feature name='nodeid_msr'/> + <feature name='topoext'/> + <feature name='perfctr_core'/> + <feature name='perfctr_nb'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Opteron-6234-json.xml b/tests/cputestdata/x86-cpuid-Opteron-6234-json.xml new file mode 100644 index 0000000..2bb59a3 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-6234-json.xml @@ -0,0 +1,16 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Opteron_G4</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='x2apic'/> + <feature policy='require' name='tsc-deadline'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='mmxext'/> + <feature policy='require' name='fxsr_opt'/> + <feature policy='require' name='cmp_legacy'/> + <feature policy='require' name='cr8legacy'/> + <feature policy='require' name='osvw'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='disable' name='rdtscp'/> + <feature policy='disable' name='svm'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Opteron-6234.json b/tests/cputestdata/x86-cpuid-Opteron-6234.json new file mode 100644 index 0000000..0df3860 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-6234.json @@ -0,0 +1,88 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-eax": 6, + "features": 4 + }, + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 9 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 68595 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 668204031 + }, + { + "cpuid-register": "ECX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 0 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 2 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 2545426947 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 126614527 + } + ], + "id": "feature-words" +} + +{ + "return": 21, + "id": "family" +} + +{ + "return": 1, + "id": "model" +} + +{ + "return": 2, + "id": "stepping" +} + +{ + "return": "AMD Opteron(TM) Processor 6234 ", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Opteron-6234.xml b/tests/cputestdata/x86-cpuid-Opteron-6234.xml new file mode 100644 index 0000000..9a89fd7 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-6234.xml @@ -0,0 +1,51 @@ +<!-- AMD Opteron(TM) Processor 6234 --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00600f12' ebx='0x230c0800' ecx='0x1e98220b' edx='0x178bfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00000000'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x000003c0' edx='0x40000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x3e' eax='0x00000080' ebx='0x00000340' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x8000001e' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00600f12' ebx='0x30000000' ecx='0x01c9bfff' edx='0x2fd3fbff'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20444d41' ebx='0x6574704f' ecx='0x286e6f72' edx='0x20294d54'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x636f7250' ebx='0x6f737365' ecx='0x32362072' edx='0x20203433'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x20202020' ebx='0x20202020' ecx='0x20202020' edx='0x00202020'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0xff20ff18' ebx='0xff20ff30' ecx='0x10040140' edx='0x40020140'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x64000000' ebx='0x64004200' ecx='0x08008140' edx='0x0060e140'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x000003d9'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003030' ebx='0x00000000' ecx='0x0000500b' edx='0x00000000'/> + <cpuid eax_in='0x80000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000001' ebx='0x00010000' ecx='0x00000000' edx='0x000014ff'/> + <cpuid eax_in='0x8000000b' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000d' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000f' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000010' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000011' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000012' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000013' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000014' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000015' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000016' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000017' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000018' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000019' ecx_in='0x00' eax='0xf020f018' ebx='0x64000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001a' ecx_in='0x00' eax='0x00000003' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001b' ecx_in='0x00' eax='0x000000ff' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001c' ecx_in='0x00' eax='0x00000000' ebx='0x80032013' ecx='0x00010200' edx='0x8000000f'/> + <cpuid eax_in='0x8000001d' ecx_in='0x00' eax='0x00000121' ebx='0x00c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x8000001e' ecx_in='0x00' eax='0x00000043' ebx='0x00000101' ecx='0x00000102' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Opteron-6282-guest.xml | 24 ++++++++++ tests/cputestdata/x86-cpuid-Opteron-6282-host.xml | 24 ++++++++++ tests/cputestdata/x86-cpuid-Opteron-6282.xml | 51 ++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6282-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6282-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Opteron-6282.xml diff --git a/tests/cputest.c b/tests/cputest.c index 4642a91..66db46b 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -860,6 +860,7 @@ mymain(void) DO_TEST_CPUID("x86", "Opteron-1352", false); DO_TEST_CPUID("x86", "Opteron-2350", true); DO_TEST_CPUID("x86", "Opteron-6234", true); + DO_TEST_CPUID("x86", "Opteron-6282", false); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Opteron-6282-guest.xml b/tests/cputestdata/x86-cpuid-Opteron-6282-guest.xml new file mode 100644 index 0000000..9858ee4 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-6282-guest.xml @@ -0,0 +1,24 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Opteron_G4</model> + <vendor>AMD</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='mmxext'/> + <feature policy='require' name='fxsr_opt'/> + <feature policy='require' name='cmp_legacy'/> + <feature policy='require' name='extapic'/> + <feature policy='require' name='cr8legacy'/> + <feature policy='require' name='osvw'/> + <feature policy='require' name='ibs'/> + <feature policy='require' name='skinit'/> + <feature policy='require' name='wdt'/> + <feature policy='require' name='lwp'/> + <feature policy='require' name='nodeid_msr'/> + <feature policy='require' name='topoext'/> + <feature policy='require' name='perfctr_core'/> + <feature policy='require' name='perfctr_nb'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Opteron-6282-host.xml b/tests/cputestdata/x86-cpuid-Opteron-6282-host.xml new file mode 100644 index 0000000..ec670c6 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-6282-host.xml @@ -0,0 +1,24 @@ +<cpu> + <arch>x86_64</arch> + <model>Opteron_G4</model> + <vendor>AMD</vendor> + <feature name='vme'/> + <feature name='ht'/> + <feature name='monitor'/> + <feature name='osxsave'/> + <feature name='mmxext'/> + <feature name='fxsr_opt'/> + <feature name='cmp_legacy'/> + <feature name='extapic'/> + <feature name='cr8legacy'/> + <feature name='osvw'/> + <feature name='ibs'/> + <feature name='skinit'/> + <feature name='wdt'/> + <feature name='lwp'/> + <feature name='nodeid_msr'/> + <feature name='topoext'/> + <feature name='perfctr_core'/> + <feature name='perfctr_nb'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Opteron-6282.xml b/tests/cputestdata/x86-cpuid-Opteron-6282.xml new file mode 100644 index 0000000..6e6b81d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Opteron-6282.xml @@ -0,0 +1,51 @@ +<!-- AMD Opteron(tm) Processor 6282 SE --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000d' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00600f12' ebx='0x0b100800' ecx='0x1e98220b' edx='0x178bfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00000000'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x000003c0' edx='0x40000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x3e' eax='0x00000080' ebx='0x00000340' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x8000001e' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00600f12' ebx='0x30000000' ecx='0x01c9bfff' edx='0x2fd3fbff'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20444d41' ebx='0x6574704f' ecx='0x286e6f72' edx='0x20296d74'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x636f7250' ebx='0x6f737365' ecx='0x32362072' edx='0x53203238'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x20202045' ebx='0x20202020' ecx='0x20202020' edx='0x00202020'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0xff20ff18' ebx='0xff20ff30' ecx='0x10040140' edx='0x40020140'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x64000000' ebx='0x64004200' ecx='0x08008140' edx='0x0060e140'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x000003d9'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003030' ebx='0x00000000' ecx='0x0000500f' edx='0x00000000'/> + <cpuid eax_in='0x80000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000001' ebx='0x00010000' ecx='0x00000000' edx='0x000014ff'/> + <cpuid eax_in='0x8000000b' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000d' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000f' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000010' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000011' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000012' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000013' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000014' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000015' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000016' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000017' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000018' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000019' ecx_in='0x00' eax='0xf020f018' ebx='0x64000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001a' ecx_in='0x00' eax='0x00000003' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001b' ecx_in='0x00' eax='0x000000ff' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001c' ecx_in='0x00' eax='0x00000000' ebx='0x80032013' ecx='0x00010200' edx='0x8000000f'/> + <cpuid eax_in='0x8000001d' ecx_in='0x00' eax='0x00000121' ebx='0x00c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x8000001e' ecx_in='0x00' eax='0x0000002b' ebx='0x00000105' ecx='0x00000101' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + .../cputestdata/x86-cpuid-Pentium-P6100-guest.xml | 23 +++++++++++++++++ tests/cputestdata/x86-cpuid-Pentium-P6100-host.xml | 23 +++++++++++++++++ tests/cputestdata/x86-cpuid-Pentium-P6100.xml | 30 ++++++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Pentium-P6100-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Pentium-P6100-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Pentium-P6100.xml diff --git a/tests/cputest.c b/tests/cputest.c index 66db46b..046a76c 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -861,6 +861,7 @@ mymain(void) DO_TEST_CPUID("x86", "Opteron-2350", true); DO_TEST_CPUID("x86", "Opteron-6234", true); DO_TEST_CPUID("x86", "Opteron-6282", false); + DO_TEST_CPUID("x86", "Pentium-P6100", false); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Pentium-P6100-guest.xml b/tests/cputestdata/x86-cpuid-Pentium-P6100-guest.xml new file mode 100644 index 0000000..5ef6e24 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Pentium-P6100-guest.xml @@ -0,0 +1,23 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>core2duo</model> + <vendor>Intel</vendor> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='cx16'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='popcnt'/> + <feature policy='require' name='rdtscp'/> + <feature policy='require' name='lahf_lm'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Pentium-P6100-host.xml b/tests/cputestdata/x86-cpuid-Pentium-P6100-host.xml new file mode 100644 index 0000000..8ae2493 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Pentium-P6100-host.xml @@ -0,0 +1,23 @@ +<cpu> + <arch>x86_64</arch> + <model>core2duo</model> + <vendor>Intel</vendor> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='ds_cpl'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='cx16'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='pcid'/> + <feature name='popcnt'/> + <feature name='rdtscp'/> + <feature name='lahf_lm'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Pentium-P6100.xml b/tests/cputestdata/x86-cpuid-Pentium-P6100.xml new file mode 100644 index 0000000..0d63060 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Pentium-P6100.xml @@ -0,0 +1,30 @@ +<!-- Intel(R) Pentium(R) CPU P6100 @ 2.00GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000b' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00020655' ebx='0x00100800' ecx='0x0082e39d' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x55035a01' ebx='0x00f0b0dd' ecx='0x00000000' edx='0x09ca212c'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x00c0003f' ecx='0x0000007f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x02c0003f' ecx='0x00000fff' edx='0x00000002'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00000120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000005' ebx='0x00000002' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000004' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000001' ecx='0x00000100' edx='0x00000000'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000002' ecx='0x00000201' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x6e655020' edx='0x6d756974'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x20295228' ebx='0x20555043' ecx='0x20202020' edx='0x50202020'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x30303136' ebx='0x20402020' ecx='0x30302e32' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000001' ebx='0x00000001' ecx='0x00000100' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000001' ebx='0x00000001' ecx='0x00000100' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Phenom-B95-guest.xml | 22 +++++++ tests/cputestdata/x86-cpuid-Phenom-B95-host.xml | 31 ++++++++++ tests/cputestdata/x86-cpuid-Phenom-B95-json.xml | 20 ++++++ tests/cputestdata/x86-cpuid-Phenom-B95.json | 77 ++++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Phenom-B95.xml | 38 ++++++++++++ 6 files changed, 189 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Phenom-B95-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Phenom-B95-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Phenom-B95-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Phenom-B95.json create mode 100644 tests/cputestdata/x86-cpuid-Phenom-B95.xml diff --git a/tests/cputest.c b/tests/cputest.c index 046a76c..c67b3df 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -862,6 +862,7 @@ mymain(void) DO_TEST_CPUID("x86", "Opteron-6234", true); DO_TEST_CPUID("x86", "Opteron-6282", false); DO_TEST_CPUID("x86", "Pentium-P6100", false); + DO_TEST_CPUID("x86", "Phenom-B95", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Phenom-B95-guest.xml b/tests/cputestdata/x86-cpuid-Phenom-B95-guest.xml new file mode 100644 index 0000000..60ba9c1 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Phenom-B95-guest.xml @@ -0,0 +1,22 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Opteron_G3</model> + <vendor>AMD</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='mmxext'/> + <feature policy='require' name='fxsr_opt'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='3dnowext'/> + <feature policy='require' name='3dnow'/> + <feature policy='require' name='cmp_legacy'/> + <feature policy='require' name='extapic'/> + <feature policy='require' name='cr8legacy'/> + <feature policy='require' name='3dnowprefetch'/> + <feature policy='require' name='osvw'/> + <feature policy='require' name='ibs'/> + <feature policy='require' name='skinit'/> + <feature policy='require' name='wdt'/> + <feature policy='require' name='invtsc'/> + <feature policy='disable' name='nx'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Phenom-B95-host.xml b/tests/cputestdata/x86-cpuid-Phenom-B95-host.xml new file mode 100644 index 0000000..127b047 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Phenom-B95-host.xml @@ -0,0 +1,31 @@ +<cpu> + <arch>x86_64</arch> + <model>athlon</model> + <vendor>AMD</vendor> + <feature name='mca'/> + <feature name='clflush'/> + <feature name='ht'/> + <feature name='pni'/> + <feature name='monitor'/> + <feature name='cx16'/> + <feature name='popcnt'/> + <feature name='syscall'/> + <feature name='fxsr_opt'/> + <feature name='pdpe1gb'/> + <feature name='rdtscp'/> + <feature name='lm'/> + <feature name='lahf_lm'/> + <feature name='cmp_legacy'/> + <feature name='svm'/> + <feature name='extapic'/> + <feature name='cr8legacy'/> + <feature name='abm'/> + <feature name='sse4a'/> + <feature name='misalignsse'/> + <feature name='3dnowprefetch'/> + <feature name='osvw'/> + <feature name='ibs'/> + <feature name='skinit'/> + <feature name='wdt'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Phenom-B95-json.xml b/tests/cputestdata/x86-cpuid-Phenom-B95-json.xml new file mode 100644 index 0000000..c1070de --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Phenom-B95-json.xml @@ -0,0 +1,20 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Opteron_G3</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='x2apic'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='mmxext'/> + <feature policy='require' name='fxsr_opt'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='3dnowext'/> + <feature policy='require' name='3dnow'/> + <feature policy='require' name='cmp_legacy'/> + <feature policy='require' name='cr8legacy'/> + <feature policy='require' name='3dnowprefetch'/> + <feature policy='require' name='osvw'/> + <feature policy='disable' name='monitor'/> + <feature policy='disable' name='nx'/> + <feature policy='disable' name='rdtscp'/> + <feature policy='disable' name='svm'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Phenom-B95.json b/tests/cputestdata/x86-cpuid-Phenom-B95.json new file mode 100644 index 0000000..5f5badd --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Phenom-B95.json @@ -0,0 +1,77 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 9 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 1011 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 3862956032 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 2157977601 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 126614527 + } + ], + "id": "feature-words" +} + +{ + "return": 16, + "id": "family" +} + +{ + "return": 4, + "id": "model" +} + +{ + "return": 2, + "id": "stepping" +} + +{ + "return": "AMD Phenom(tm) II X4 B95 Processor", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Phenom-B95.xml b/tests/cputestdata/x86-cpuid-Phenom-B95.xml new file mode 100644 index 0000000..ad989f9 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Phenom-B95.xml @@ -0,0 +1,38 @@ +<!-- AMD Phenom(tm) II X4 B95 Processor --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x00000005' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00100f42' ebx='0x00040800' ecx='0x00802009' edx='0x178bfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x8000001b' ebx='0x68747541' ecx='0x444d4163' edx='0x69746e65'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00100f42' ebx='0x10003df6' ecx='0x000037ff' edx='0xefc3fbff'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20444d41' ebx='0x6e656850' ecx='0x74286d6f' edx='0x4920296d'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x34582049' ebx='0x35394220' ecx='0x6f725020' edx='0x73736563'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x0000726f' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0xff30ff10' ebx='0xff30ff20' ecx='0x40020140' edx='0x40020140'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x20800000' ebx='0x42004200' ecx='0x02008140' edx='0x0030b140'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x000001f9'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003030' ebx='0x00000000' ecx='0x00002003' edx='0x00000000'/> + <cpuid eax_in='0x80000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000001' ebx='0x00000040' ecx='0x00000000' edx='0x0000000f'/> + <cpuid eax_in='0x8000000b' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000d' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000000f' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000010' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000011' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000012' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000013' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000014' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000015' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000016' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000017' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000018' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000019' ecx_in='0x00' eax='0xf0300000' ebx='0x60100000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001a' ecx_in='0x00' eax='0x00000003' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x8000001b' ecx_in='0x00' eax='0x0000001f' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Xeon-5110-guest.xml | 20 ++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-5110-host.xml | 20 ++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-5110.xml | 27 +++++++++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Xeon-5110-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-5110-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-5110.xml diff --git a/tests/cputest.c b/tests/cputest.c index c67b3df..c13ed4b 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -863,6 +863,7 @@ mymain(void) DO_TEST_CPUID("x86", "Opteron-6282", false); DO_TEST_CPUID("x86", "Pentium-P6100", false); DO_TEST_CPUID("x86", "Phenom-B95", true); + DO_TEST_CPUID("x86", "Xeon-5110", false); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Xeon-5110-guest.xml b/tests/cputestdata/x86-cpuid-Xeon-5110-guest.xml new file mode 100644 index 0000000..0b9e3f6 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-5110-guest.xml @@ -0,0 +1,20 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>core2duo</model> + <vendor>Intel</vendor> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='cx16'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='dca'/> + <feature policy='require' name='lahf_lm'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-5110-host.xml b/tests/cputestdata/x86-cpuid-Xeon-5110-host.xml new file mode 100644 index 0000000..88c61c4 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-5110-host.xml @@ -0,0 +1,20 @@ +<cpu> + <arch>x86_64</arch> + <model>core2duo</model> + <vendor>Intel</vendor> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='tm2'/> + <feature name='cx16'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='dca'/> + <feature name='lahf_lm'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-5110.xml b/tests/cputestdata/x86-cpuid-Xeon-5110.xml new file mode 100644 index 0000000..557c7dc --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-5110.xml @@ -0,0 +1,27 @@ +<!-- Intel(R) Xeon(R) CPU 5110 @ 1.60GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000a' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000006f6' ebx='0x07020800' ecx='0x0004e33d' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x05b0b101' ebx='0x005657f0' ecx='0x00000000' edx='0x2cb43049'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x04000121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x04000122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x04004143' ebx='0x03c0003f' ecx='0x00000fff' edx='0x00000001'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00000020'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000400' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07280202' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x20100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x6f655820' edx='0x2952286e'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x55504320' ebx='0x20202020' ecx='0x20202020' edx='0x20202020'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x30313135' ebx='0x20402020' ecx='0x30362e31' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x10008040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x07280202' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x07280202' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Xeon-E3-1245-guest.xml | 30 ++++++++ tests/cputestdata/x86-cpuid-Xeon-E3-1245-host.xml | 30 ++++++++ tests/cputestdata/x86-cpuid-Xeon-E3-1245-json.xml | 15 ++++ tests/cputestdata/x86-cpuid-Xeon-E3-1245.json | 88 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-E3-1245.xml | 46 +++++++++++ 6 files changed, 210 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E3-1245-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E3-1245-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E3-1245-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E3-1245.json create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E3-1245.xml diff --git a/tests/cputest.c b/tests/cputest.c index c13ed4b..c86a979 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -864,6 +864,7 @@ mymain(void) DO_TEST_CPUID("x86", "Pentium-P6100", false); DO_TEST_CPUID("x86", "Phenom-B95", true); DO_TEST_CPUID("x86", "Xeon-5110", false); + DO_TEST_CPUID("x86", "Xeon-E3-1245", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Xeon-E3-1245-guest.xml b/tests/cputestdata/x86-cpuid-Xeon-E3-1245-guest.xml new file mode 100644 index 0000000..0001b2d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E3-1245-guest.xml @@ -0,0 +1,30 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Broadwell</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='mpx'/> + <feature policy='require' name='clflushopt'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E3-1245-host.xml b/tests/cputestdata/x86-cpuid-Xeon-E3-1245-host.xml new file mode 100644 index 0000000..0c2aaee --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E3-1245-host.xml @@ -0,0 +1,30 @@ +<cpu> + <arch>x86_64</arch> + <model>Broadwell</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='osxsave'/> + <feature name='f16c'/> + <feature name='rdrand'/> + <feature name='pdpe1gb'/> + <feature name='abm'/> + <feature name='tsc_adjust'/> + <feature name='mpx'/> + <feature name='clflushopt'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E3-1245-json.xml b/tests/cputestdata/x86-cpuid-Xeon-E3-1245-json.xml new file mode 100644 index 0000000..81a41fb --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E3-1245-json.xml @@ -0,0 +1,15 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Broadwell</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='mpx'/> + <feature policy='require' name='clflushopt'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E3-1245.json b/tests/cputestdata/x86-cpuid-Xeon-E3-1245.json new file mode 100644 index 0000000..10fbe06 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E3-1245.json @@ -0,0 +1,88 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-eax": 6, + "features": 4 + }, + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 7 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 289 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 739248128 + }, + { + "cpuid-register": "ECX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 0 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 10244027 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 4160369187 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 94, + "id": "model" +} + +{ + "return": 3, + "id": "stepping" +} + +{ + "return": "Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Xeon-E3-1245.xml b/tests/cputestdata/x86-cpuid-Xeon-E3-1245.xml new file mode 100644 index 0000000..42992db --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E3-1245.xml @@ -0,0 +1,46 @@ +<!-- Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x00000016' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000506e3' ebx='0x00100800' ecx='0x7ffafbff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76036301' ebx='0x00f0b5ff' ecx='0x00000000' edx='0x00c30000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x00c0003f' ecx='0x000003ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x03c0003f' ecx='0x00001fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00142120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x000027f7' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x029c6fbf' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300404' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000000'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000008' ecx='0x00000201' edx='0x00000000'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x0000001f' ebx='0x00000440' ecx='0x00000440' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x0000000f' ebx='0x000003c0' ecx='0x00000100' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x03' eax='0x00000040' ebx='0x000003c0' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x04' eax='0x00000040' ebx='0x00000400' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000f' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000010' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000011' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000012' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000013' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000014' ecx_in='0x00' eax='0x00000001' ebx='0x0000000f' ecx='0x00000007' edx='0x00000000'/> + <cpuid eax_in='0x00000014' ecx_in='0x01' eax='0x02490002' ebx='0x003f3fff' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000015' ecx_in='0x00' eax='0x00000002' ebx='0x00000124' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000016' ecx_in='0x00' eax='0x00000dac' ebx='0x00000f3c' ecx='0x00000064' edx='0x00000000'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000121' edx='0x2c100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x6f655820' edx='0x2952286e'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x55504320' ebx='0x2d334520' ecx='0x35343231' edx='0x20357620'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x2e332040' ebx='0x48473035' ecx='0x0000007a' edx='0x00000000'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003027' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000dac' ebx='0x00000f3c' ecx='0x00000064' edx='0x00000000'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000dac' ebx='0x00000f3c' ecx='0x00000064' edx='0x00000000'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Xeon-E5-2630-guest.xml | 29 ++++++++ tests/cputestdata/x86-cpuid-Xeon-E5-2630-host.xml | 29 ++++++++ tests/cputestdata/x86-cpuid-Xeon-E5-2630-json.xml | 12 ++++ tests/cputestdata/x86-cpuid-Xeon-E5-2630.json | 77 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-E5-2630.xml | 37 +++++++++++ 6 files changed, 185 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2630-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2630-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2630-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2630.json create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2630.xml diff --git a/tests/cputest.c b/tests/cputest.c index c86a979..a9cfbbf 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -865,6 +865,7 @@ mymain(void) DO_TEST_CPUID("x86", "Phenom-B95", true); DO_TEST_CPUID("x86", "Xeon-5110", false); DO_TEST_CPUID("x86", "Xeon-E3-1245", true); + DO_TEST_CPUID("x86", "Xeon-E5-2630", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Xeon-E5-2630-guest.xml b/tests/cputestdata/x86-cpuid-Xeon-E5-2630-guest.xml new file mode 100644 index 0000000..ce5aa79 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E5-2630-guest.xml @@ -0,0 +1,29 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Haswell-noTSX</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='dca'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E5-2630-host.xml b/tests/cputestdata/x86-cpuid-Xeon-E5-2630-host.xml new file mode 100644 index 0000000..26a3b90 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E5-2630-host.xml @@ -0,0 +1,29 @@ +<cpu> + <arch>x86_64</arch> + <model>Haswell-noTSX</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='dca'/> + <feature name='osxsave'/> + <feature name='f16c'/> + <feature name='rdrand'/> + <feature name='pdpe1gb'/> + <feature name='abm'/> + <feature name='tsc_adjust'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E5-2630-json.xml b/tests/cputestdata/x86-cpuid-Xeon-E5-2630-json.xml new file mode 100644 index 0000000..4cf361e --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E5-2630-json.xml @@ -0,0 +1,12 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Haswell-noTSX</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E5-2630.json b/tests/cputestdata/x86-cpuid-Xeon-E5-2630.json new file mode 100644 index 0000000..f1affa4 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E5-2630.json @@ -0,0 +1,77 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 33 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 739248128 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 1963 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 4160369155 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 63, + "id": "model" +} + +{ + "return": 2, + "id": "stepping" +} + +{ + "return": "Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Xeon-E5-2630.xml b/tests/cputestdata/x86-cpuid-Xeon-E5-2630.xml new file mode 100644 index 0000000..dc640ac --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E5-2630.xml @@ -0,0 +1,37 @@ +<!-- Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000f' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000306f2' ebx='0x13100800' ecx='0x7ffefbff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76036301' ebx='0x00f0b5ff' ecx='0x00000000' edx='0x00c10000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x04c0003f' ecx='0x00003fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00002120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000077' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x000037ab' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000013'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000010' ecx='0x00000201' edx='0x00000013'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000f' ecx_in='0x00' eax='0x00000000' ebx='0x0000001f' ecx='0x00000000' edx='0x00000002'/> + <cpuid eax_in='0x0000000f' ecx_in='0x01' eax='0x00000000' ebx='0x00008000' ecx='0x0000001f' edx='0x00000001'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000021' edx='0x2c100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x6f655820' edx='0x2952286e'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x55504320' ebx='0x2d354520' ecx='0x30333632' edx='0x20337620'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x2e322040' ebx='0x48473034' ecx='0x0000007a' edx='0x00000000'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x0000302e' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000000' ebx='0x0000001f' ecx='0x00000000' edx='0x00000002'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000000' ebx='0x0000001f' ecx='0x00000000' edx='0x00000002'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Xeon-E5-2650-guest.xml | 29 +++++++++ tests/cputestdata/x86-cpuid-Xeon-E5-2650-host.xml | 29 +++++++++ tests/cputestdata/x86-cpuid-Xeon-E5-2650-json.xml | 12 ++++ tests/cputestdata/x86-cpuid-Xeon-E5-2650.json | 71 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-E5-2650.xml | 37 +++++++++++ 6 files changed, 179 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2650-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2650-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2650-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2650.json create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E5-2650.xml diff --git a/tests/cputest.c b/tests/cputest.c index a9cfbbf..331e553 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -866,6 +866,7 @@ mymain(void) DO_TEST_CPUID("x86", "Xeon-5110", false); DO_TEST_CPUID("x86", "Xeon-E3-1245", true); DO_TEST_CPUID("x86", "Xeon-E5-2630", true); + DO_TEST_CPUID("x86", "Xeon-E5-2650", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Xeon-E5-2650-guest.xml b/tests/cputestdata/x86-cpuid-Xeon-E5-2650-guest.xml new file mode 100644 index 0000000..ce5aa79 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E5-2650-guest.xml @@ -0,0 +1,29 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Haswell-noTSX</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='dca'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E5-2650-host.xml b/tests/cputestdata/x86-cpuid-Xeon-E5-2650-host.xml new file mode 100644 index 0000000..26a3b90 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E5-2650-host.xml @@ -0,0 +1,29 @@ +<cpu> + <arch>x86_64</arch> + <model>Haswell-noTSX</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='dca'/> + <feature name='osxsave'/> + <feature name='f16c'/> + <feature name='rdrand'/> + <feature name='pdpe1gb'/> + <feature name='abm'/> + <feature name='tsc_adjust'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E5-2650-json.xml b/tests/cputestdata/x86-cpuid-Xeon-E5-2650-json.xml new file mode 100644 index 0000000..36b7bf2 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E5-2650-json.xml @@ -0,0 +1,12 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Haswell-noTSX</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E5-2650.json b/tests/cputestdata/x86-cpuid-Xeon-E5-2650.json new file mode 100644 index 0000000..2cd15f6 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E5-2650.json @@ -0,0 +1,71 @@ +{ + "return": [ + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 33 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 739248128 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 1961 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 4160369187 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 63, + "id": "model" +} + +{ + "return": 2, + "id": "stepping" +} + +{ + "return": "Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Xeon-E5-2650.xml b/tests/cputestdata/x86-cpuid-Xeon-E5-2650.xml new file mode 100644 index 0000000..2b73adf --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E5-2650.xml @@ -0,0 +1,37 @@ +<!-- Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000f' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000306f2' ebx='0x03200800' ecx='0x7ffefbff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x76036301' ebx='0x00f0b5ff' ecx='0x00000000' edx='0x00c10000'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x3c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x3c004122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x3c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x3c07c163' ebx='0x04c0003f' ecx='0x00004fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00002120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000077' ebx='0x00000002' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x000037ab' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000000' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000003'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000005' ebx='0x00000014' ecx='0x00000201' edx='0x00000003'/> + <cpuid eax_in='0x0000000c' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x00' eax='0x00000007' ebx='0x00000340' ecx='0x00000340' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x02' eax='0x00000100' ebx='0x00000240' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000e' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000f' ecx_in='0x00' eax='0x00000000' ebx='0x00000027' ecx='0x00000000' edx='0x00000002'/> + <cpuid eax_in='0x0000000f' ecx_in='0x01' eax='0x00000000' ebx='0x0000a000' ecx='0x00000027' edx='0x00000001'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000021' edx='0x2c100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x6f655820' edx='0x2952286e'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x55504320' ebx='0x2d354520' ecx='0x30353632' edx='0x20337620'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x2e322040' ebx='0x48473033' ecx='0x0000007a' edx='0x00000000'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x0000302e' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000000' ebx='0x00000027' ecx='0x00000000' edx='0x00000002'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000000' ebx='0x00000027' ecx='0x00000000' edx='0x00000002'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Xeon-E7-4820-guest.xml | 28 ++++++++ tests/cputestdata/x86-cpuid-Xeon-E7-4820-host.xml | 28 ++++++++ tests/cputestdata/x86-cpuid-Xeon-E7-4820-json.xml | 12 ++++ tests/cputestdata/x86-cpuid-Xeon-E7-4820.json | 77 ++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-E7-4820.xml | 30 +++++++++ 6 files changed, 176 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E7-4820-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E7-4820-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E7-4820-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E7-4820.json create mode 100644 tests/cputestdata/x86-cpuid-Xeon-E7-4820.xml diff --git a/tests/cputest.c b/tests/cputest.c index 331e553..27a0f1f 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -867,6 +867,7 @@ mymain(void) DO_TEST_CPUID("x86", "Xeon-E3-1245", true); DO_TEST_CPUID("x86", "Xeon-E5-2630", true); DO_TEST_CPUID("x86", "Xeon-E5-2650", true); + DO_TEST_CPUID("x86", "Xeon-E7-4820", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Xeon-E7-4820-guest.xml b/tests/cputestdata/x86-cpuid-Xeon-E7-4820-guest.xml new file mode 100644 index 0000000..55edce9 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E7-4820-guest.xml @@ -0,0 +1,28 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>SandyBridge</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='smx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='dca'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='invtsc'/> + <feature policy='disable' name='tsc-deadline'/> + <feature policy='disable' name='xsave'/> + <feature policy='disable' name='avx'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E7-4820-host.xml b/tests/cputestdata/x86-cpuid-Xeon-E7-4820-host.xml new file mode 100644 index 0000000..4a033ae --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E7-4820-host.xml @@ -0,0 +1,28 @@ +<cpu> + <arch>x86_64</arch> + <model>Westmere</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='pclmuldq'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='smx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='pcid'/> + <feature name='dca'/> + <feature name='x2apic'/> + <feature name='pdpe1gb'/> + <feature name='rdtscp'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E7-4820-json.xml b/tests/cputestdata/x86-cpuid-Xeon-E7-4820-json.xml new file mode 100644 index 0000000..67b1dc7 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E7-4820-json.xml @@ -0,0 +1,12 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>SandyBridge</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='disable' name='xsave'/> + <feature policy='disable' name='avx'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-E7-4820.json b/tests/cputestdata/x86-cpuid-Xeon-E7-4820.json new file mode 100644 index 0000000..a884613 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E7-4820.json @@ -0,0 +1,77 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 739248128 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 2 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 2210013699 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 47, + "id": "model" +} + +{ + "return": 2, + "id": "stepping" +} + +{ + "return": " Intel(R) Xeon(R) CPU E7- 4820 @ 2.00GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Xeon-E7-4820.xml b/tests/cputestdata/x86-cpuid-Xeon-E7-4820.xml new file mode 100644 index 0000000..c0d9982 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-E7-4820.xml @@ -0,0 +1,30 @@ +<!-- Intel(R) Xeon(R) CPU E7- 4820 @ 2.00GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000b' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000206f2' ebx='0x02400800' ecx='0x02bee3ff' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x55035a01' ebx='0x00f0b0eb' ecx='0x00000000' edx='0x09ca212c'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x7c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x7c004122' ebx='0x00c0003f' ecx='0x0000007f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x7c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x7c0fc163' ebx='0x05c0003f' ecx='0x00002fff' edx='0x00000006'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00001120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000007' ebx='0x00000001' ecx='0x00000009' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000004' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000002'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000006' ebx='0x00000010' ecx='0x00000201' edx='0x00000002'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x2c100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x20202020' ebx='0x49202020' ecx='0x6c65746e' edx='0x20295228'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x6e6f6558' ebx='0x20295228' ecx='0x20555043' edx='0x202d3745'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x30323834' ebx='0x20402020' ecx='0x30302e32' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x0000302c' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000002'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000002'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Xeon-W3520-guest.xml | 23 +++++++ tests/cputestdata/x86-cpuid-Xeon-W3520-host.xml | 23 +++++++ tests/cputestdata/x86-cpuid-Xeon-W3520-json.xml | 10 +++ tests/cputestdata/x86-cpuid-Xeon-W3520.json | 77 ++++++++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-W3520.xml | 30 +++++++++ 6 files changed, 164 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Xeon-W3520-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-W3520-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-W3520-json.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-W3520.json create mode 100644 tests/cputestdata/x86-cpuid-Xeon-W3520.xml diff --git a/tests/cputest.c b/tests/cputest.c index 27a0f1f..a860fc7 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -868,6 +868,7 @@ mymain(void) DO_TEST_CPUID("x86", "Xeon-E5-2630", true); DO_TEST_CPUID("x86", "Xeon-E5-2650", true); DO_TEST_CPUID("x86", "Xeon-E7-4820", true); + DO_TEST_CPUID("x86", "Xeon-W3520", true); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Xeon-W3520-guest.xml b/tests/cputestdata/x86-cpuid-Xeon-W3520-guest.xml new file mode 100644 index 0000000..4037fa6 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-W3520-guest.xml @@ -0,0 +1,23 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Nehalem</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='dca'/> + <feature policy='require' name='rdtscp'/> + <feature policy='require' name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-W3520-host.xml b/tests/cputestdata/x86-cpuid-Xeon-W3520-host.xml new file mode 100644 index 0000000..c4a9226 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-W3520-host.xml @@ -0,0 +1,23 @@ +<cpu> + <arch>x86_64</arch> + <model>Nehalem</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='dca'/> + <feature name='rdtscp'/> + <feature name='invtsc'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-W3520-json.xml b/tests/cputestdata/x86-cpuid-Xeon-W3520-json.xml new file mode 100644 index 0000000..3292264 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-W3520-json.xml @@ -0,0 +1,10 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Nehalem</model> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='x2apic'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='rdtscp'/> + <feature policy='require' name='tsc_adjust'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-W3520.json b/tests/cputestdata/x86-cpuid-Xeon-W3520.json new file mode 100644 index 0000000..c75594d --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-W3520.json @@ -0,0 +1,77 @@ +{ + "return": [ + { + "cpuid-register": "EAX", + "cpuid-input-ecx": 1, + "cpuid-input-eax": 13, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483658, + "features": 0 + }, + { + "cpuid-register": "EAX", + "cpuid-input-eax": 1073741825, + "features": 16777467 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 3221225473, + "features": 0 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483655, + "features": 0 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 2147483649, + "features": 1 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 2147483649, + "features": 672139264 + }, + { + "cpuid-register": "EBX", + "cpuid-input-ecx": 0, + "cpuid-input-eax": 7, + "features": 2 + }, + { + "cpuid-register": "ECX", + "cpuid-input-eax": 1, + "features": 2159550977 + }, + { + "cpuid-register": "EDX", + "cpuid-input-eax": 1, + "features": 260832255 + } + ], + "id": "feature-words" +} + +{ + "return": 6, + "id": "family" +} + +{ + "return": 26, + "id": "model" +} + +{ + "return": 5, + "id": "stepping" +} + +{ + "return": "Intel(R) Xeon(R) CPU W3520 @ 2.67GHz", + "id": "model-id" +} diff --git a/tests/cputestdata/x86-cpuid-Xeon-W3520.xml b/tests/cputestdata/x86-cpuid-Xeon-W3520.xml new file mode 100644 index 0000000..0d357f7 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-W3520.xml @@ -0,0 +1,30 @@ +<!-- Intel(R) Xeon(R) CPU W3520 @ 2.67GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000b' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x000106a5' ebx='0x05100800' ecx='0x009ce3bd' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x55035a01' ebx='0x00f0b2e4' ecx='0x00000000' edx='0x09ca212c'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x1c004121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x1c004122' ebx='0x00c0003f' ecx='0x0000007f' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x1c004143' ebx='0x01c0003f' ecx='0x000001ff' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x03' eax='0x1c03c163' ebx='0x03c0003f' ecx='0x00001fff' edx='0x00000002'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00001120'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000003' ebx='0x00000002' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07300403' ebx='0x00000044' ecx='0x00000000' edx='0x00000603'/> + <cpuid eax_in='0x0000000b' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000005'/> + <cpuid eax_in='0x0000000b' ecx_in='0x01' eax='0x00000004' ebx='0x00000008' ecx='0x00000201' edx='0x00000005'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x6f655820' edx='0x2952286e'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x55504320' ebx='0x20202020' ecx='0x20202020' edx='0x57202020'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x30323533' ebx='0x20402020' ecx='0x37362e32' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01006040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003024' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000005'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000100' edx='0x00000005'/> +</cpudata> -- 2.8.3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Xeon-X5460-guest.xml | 21 ++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-X5460-host.xml | 21 ++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-X5460.xml | 27 ++++++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460.xml diff --git a/tests/cputest.c b/tests/cputest.c index a860fc7..b0e63b3 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -869,6 +869,7 @@ mymain(void) DO_TEST_CPUID("x86", "Xeon-E5-2650", true); DO_TEST_CPUID("x86", "Xeon-E7-4820", true); DO_TEST_CPUID("x86", "Xeon-W3520", true); + DO_TEST_CPUID("x86", "Xeon-X5460", false); #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); diff --git a/tests/cputestdata/x86-cpuid-Xeon-X5460-guest.xml b/tests/cputestdata/x86-cpuid-Xeon-X5460-guest.xml new file mode 100644 index 0000000..9e21934 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-X5460-guest.xml @@ -0,0 +1,21 @@ +<cpu mode='custom' match='exact'> + <arch>x86_64</arch> + <model fallback='forbid'>Penryn</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ds'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='dtes64'/> + <feature policy='require' name='monitor'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='est'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='dca'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-X5460-host.xml b/tests/cputestdata/x86-cpuid-Xeon-X5460-host.xml new file mode 100644 index 0000000..e73c478 --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-X5460-host.xml @@ -0,0 +1,21 @@ +<cpu> + <arch>x86_64</arch> + <model>Penryn</model> + <vendor>Intel</vendor> + <feature name='vme'/> + <feature name='ds'/> + <feature name='acpi'/> + <feature name='ss'/> + <feature name='ht'/> + <feature name='tm'/> + <feature name='pbe'/> + <feature name='dtes64'/> + <feature name='monitor'/> + <feature name='ds_cpl'/> + <feature name='vmx'/> + <feature name='est'/> + <feature name='tm2'/> + <feature name='xtpr'/> + <feature name='pdcm'/> + <feature name='dca'/> +</cpu> diff --git a/tests/cputestdata/x86-cpuid-Xeon-X5460.xml b/tests/cputestdata/x86-cpuid-Xeon-X5460.xml new file mode 100644 index 0000000..5e58a3f --- /dev/null +++ b/tests/cputestdata/x86-cpuid-Xeon-X5460.xml @@ -0,0 +1,27 @@ +<!-- Intel(R) Xeon(R) CPU X5460 @ 3.16GHz --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000000' ecx_in='0x00' eax='0x0000000a' ebx='0x756e6547' ecx='0x6c65746e' edx='0x49656e69'/> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00010676' ebx='0x01040800' ecx='0x000ce3bd' edx='0xbfebfbff'/> + <cpuid eax_in='0x00000002' ecx_in='0x00' eax='0x05b0b101' ebx='0x005657f0' ecx='0x00000000' edx='0x2cb4304e'/> + <cpuid eax_in='0x00000003' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000004' ecx_in='0x00' eax='0x0c000121' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x01' eax='0x0c000122' ebx='0x01c0003f' ecx='0x0000003f' edx='0x00000001'/> + <cpuid eax_in='0x00000004' ecx_in='0x02' eax='0x0c004143' ebx='0x05c0003f' ecx='0x00000fff' edx='0x00000001'/> + <cpuid eax_in='0x00000005' ecx_in='0x00' eax='0x00000040' ebx='0x00000040' ecx='0x00000003' edx='0x00002220'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000001' ebx='0x00000002' ecx='0x00000001' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000008' ecx_in='0x00' eax='0x00000400' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000009' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000a' ecx_in='0x00' eax='0x07280202' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> + <cpuid eax_in='0x80000000' ecx_in='0x00' eax='0x80000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x20100800'/> + <cpuid eax_in='0x80000002' ecx_in='0x00' eax='0x65746e49' ebx='0x2952286c' ecx='0x6f655820' edx='0x2952286e'/> + <cpuid eax_in='0x80000003' ecx_in='0x00' eax='0x55504320' ebx='0x20202020' ecx='0x20202020' edx='0x58202020'/> + <cpuid eax_in='0x80000004' ecx_in='0x00' eax='0x30363435' ebx='0x20402020' ecx='0x36312e33' edx='0x007a4847'/> + <cpuid eax_in='0x80000005' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000006' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x18008040' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00003026' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x07280202' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> + <cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x07280202' ebx='0x00000000' ecx='0x00000000' edx='0x00000503'/> +</cpudata> -- 2.8.3

On Wed, Jun 08, 2016 at 10:22:55 +0200, Jiri Denemark wrote:
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Xeon-X5460-guest.xml | 21 ++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-X5460-host.xml | 21 ++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-X5460.xml | 27 ++++++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460.xml
ACK 13-41

On Wed, Jun 08, 2016 at 16:25:51 +0200, Peter Krempa wrote:
On Wed, Jun 08, 2016 at 10:22:55 +0200, Jiri Denemark wrote:
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 1 + tests/cputestdata/x86-cpuid-Xeon-X5460-guest.xml | 21 ++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-X5460-host.xml | 21 ++++++++++++++++++ tests/cputestdata/x86-cpuid-Xeon-X5460.xml | 27 ++++++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460-guest.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460-host.xml create mode 100644 tests/cputestdata/x86-cpuid-Xeon-X5460.xml
ACK 13-41
Thanks for the quick review. I fixed all the issues and pushed this series. Jirka
participants (2)
-
Jiri Denemark
-
Peter Krempa