[libvirt] [PATCH 00/14] Add tests for virCPUUpdateLive API

Jiri Denemark (14): cpu_conf: Introduce virCPUDefFreeFeatures cpu: Introduce virCPUExpandFeatures cpu: Drop unused flags from cpuArchDecode cpu: Move feature expansion out of cpuBaseline cpu: Do not pass virConnectBaselineCPUFlags to cpuBaseline cputest: Move instantiation of JSONDecoder in cpu-convert.py cputest: Rename cpu-convert.py script as cpu-cpuid.py cputest: Add cpuidIsSet helper to cpu-cpuid.py cputest: Add cpuidLeaf helper to cpu-cpuid.py cputest: Add "diff" command to cpu-cpuid.py cputest: Generate data for virCPUUpdateLive cputest: Disable TSX on broken models cputest: Disable "cmt" feature unknown to QEMU cputest: Add tests for virCPUUpdateLive API src/conf/cpu_conf.c | 21 ++- src/conf/cpu_conf.h | 3 + src/cpu/cpu.c | 74 +++++++-- src/cpu/cpu.h | 15 +- src/cpu/cpu_arm.c | 5 +- src/cpu/cpu_ppc64.c | 12 +- src/cpu/cpu_x86.c | 109 ++++++++------ src/libvirt_private.syms | 2 + tests/cputest.c | 160 +++++++++++++++++++- tests/cputestdata/{cpu-convert.py => cpu-cpuid.py} | 165 +++++++++++++++++---- tests/cputestdata/cpu-parse.sh | 3 +- tests/cputestdata/x86_64-baseline-3-expanded.xml | 48 +++--- tests/cputestdata/x86_64-baseline-4-expanded.xml | 68 ++++----- tests/cputestdata/x86_64-baseline-5-expanded.xml | 70 ++++----- .../x86_64-cpuid-A10-5800K-disabled.xml | 7 + .../cputestdata/x86_64-cpuid-A10-5800K-enabled.xml | 8 + .../x86_64-cpuid-Core-i5-2500-disabled.xml | 5 + .../x86_64-cpuid-Core-i5-2500-enabled.xml | 9 ++ .../x86_64-cpuid-Core-i5-2540M-disabled.xml | 5 + .../x86_64-cpuid-Core-i5-2540M-enabled.xml | 9 ++ .../x86_64-cpuid-Core-i5-4670T-disabled.xml | 7 + .../x86_64-cpuid-Core-i5-4670T-enabled.xml | 8 + tests/cputestdata/x86_64-cpuid-Core-i5-4670T.json | 4 +- .../x86_64-cpuid-Core-i5-6600-disabled.xml | 5 + .../x86_64-cpuid-Core-i5-6600-enabled.xml | 9 ++ .../x86_64-cpuid-Core-i7-2600-disabled.xml | 6 + .../x86_64-cpuid-Core-i7-2600-enabled.xml | 8 + .../x86_64-cpuid-Core-i7-3740QM-disabled.xml | 6 + .../x86_64-cpuid-Core-i7-3740QM-enabled.xml | 8 + .../x86_64-cpuid-Core-i7-3770-disabled.xml | 6 + .../x86_64-cpuid-Core-i7-3770-enabled.xml | 8 + .../x86_64-cpuid-Core-i7-4510U-disabled.xml | 5 + .../x86_64-cpuid-Core-i7-4510U-enabled.xml | 9 ++ .../x86_64-cpuid-Core-i7-4600U-disabled.xml | 5 + .../x86_64-cpuid-Core-i7-4600U-enabled.xml | 9 ++ .../x86_64-cpuid-Core-i7-5600U-disabled.xml | 5 + .../x86_64-cpuid-Core-i7-5600U-enabled.xml | 9 ++ .../x86_64-cpuid-Core2-E6850-disabled.xml | 4 + .../x86_64-cpuid-Core2-E6850-enabled.xml | 7 + .../x86_64-cpuid-Opteron-2350-disabled.xml | 7 + .../x86_64-cpuid-Opteron-2350-enabled.xml | 7 + .../x86_64-cpuid-Opteron-6234-disabled.xml | 7 + .../x86_64-cpuid-Opteron-6234-enabled.xml | 9 ++ .../x86_64-cpuid-Phenom-B95-disabled.xml | 7 + .../x86_64-cpuid-Phenom-B95-enabled.xml | 7 + .../x86_64-cpuid-Xeon-E3-1245-disabled.xml | 6 + .../x86_64-cpuid-Xeon-E3-1245-enabled.xml | 9 ++ .../x86_64-cpuid-Xeon-E5-2630-disabled.xml | 7 + .../x86_64-cpuid-Xeon-E5-2630-enabled.xml | 8 + .../x86_64-cpuid-Xeon-E5-2650-disabled.xml | 8 + .../x86_64-cpuid-Xeon-E5-2650-enabled.xml | 7 + .../x86_64-cpuid-Xeon-E7-4820-disabled.xml | 6 + .../x86_64-cpuid-Xeon-E7-4820-enabled.xml | 7 + .../x86_64-cpuid-Xeon-W3520-disabled.xml | 5 + .../x86_64-cpuid-Xeon-W3520-enabled.xml | 7 + 55 files changed, 834 insertions(+), 206 deletions(-) rename tests/cputestdata/{cpu-convert.py => cpu-cpuid.py} (83%) create mode 100644 tests/cputestdata/x86_64-cpuid-A10-5800K-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-A10-5800K-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2500-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2500-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2540M-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2540M-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-6600-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-6600-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3770-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3770-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4600U-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4600U-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core2-E6850-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core2-E6850-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-2350-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-2350-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-6234-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-6234-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Phenom-B95-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Phenom-B95-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-W3520-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-W3520-enabled.xml -- 2.12.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/conf/cpu_conf.c | 21 +++++++++++++++------ src/conf/cpu_conf.h | 3 +++ src/libvirt_private.syms | 1 + 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index d7c8b8ff2..b78531e60 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -62,18 +62,27 @@ VIR_ENUM_IMPL(virCPUFeaturePolicy, VIR_CPU_FEATURE_LAST, "disable", "forbid") -void ATTRIBUTE_NONNULL(1) -virCPUDefFreeModel(virCPUDefPtr def) +void +virCPUDefFreeFeatures(virCPUDefPtr def) { size_t i; - VIR_FREE(def->model); - VIR_FREE(def->vendor); - VIR_FREE(def->vendor_id); - for (i = 0; i < def->nfeatures; i++) VIR_FREE(def->features[i].name); VIR_FREE(def->features); + + def->nfeatures = def->nfeatures_max = 0; +} + + +void ATTRIBUTE_NONNULL(1) +virCPUDefFreeModel(virCPUDefPtr def) +{ + + VIR_FREE(def->model); + VIR_FREE(def->vendor); + VIR_FREE(def->vendor_id); + virCPUDefFreeFeatures(def); } void diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index 9118f037e..3e02deed4 100644 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -125,6 +125,9 @@ struct _virCPUDef { void ATTRIBUTE_NONNULL(1) +virCPUDefFreeFeatures(virCPUDefPtr def); + +void ATTRIBUTE_NONNULL(1) virCPUDefFreeModel(virCPUDefPtr def); void diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 165d8cb25..7ac5e533f 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -71,6 +71,7 @@ virCPUDefCopyWithoutModel; virCPUDefFormat; virCPUDefFormatBuf; virCPUDefFree; +virCPUDefFreeFeatures; virCPUDefFreeModel; virCPUDefParseXML; virCPUDefStealModel; -- 2.12.0

Having to use cpuBaseline with VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES flag to expand CPU features is strange. Not to mention that cpuBaseline can only expand host CPU definitions (i.e., it completely ignores feature policies). The new virCPUExpandFeatures API is designed to work with both host and guest CPU definitions. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu.c | 50 +++++++++++++++++++++++++++++++++++++++++++++ src/cpu/cpu.h | 8 ++++++++ src/cpu/cpu_x86.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ src/libvirt_private.syms | 1 + 4 files changed, 112 insertions(+) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 1461190ba..5604db1d1 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -1063,3 +1063,53 @@ virCPUConvertLegacy(virArch arch, VIR_DEBUG("model=%s", NULLSTR(cpu->model)); return 0; } + + +static int +virCPUFeatureCompare(const void *p1, + const void *p2) +{ + const virCPUFeatureDef *f1 = p1; + const virCPUFeatureDef *f2 = p2; + + return strcmp(f1->name, f2->name); +} + + +/** + * virCPUExpandFeatures: + * + * @arch: CPU architecture + * @cpu: CPU definition to be expanded + * + * Add all features implicitly enabled by the CPU model to the list of + * features. The @cpu is expected to be either a host or a guest representation + * of a host CPU, i.e., only VIR_CPU_FEATURE_REQUIRE and + * VIR_CPU_FEATURE_DISABLE policies are supported. + * + * The updated list of features in the CPU definition is sorted. + * + * Return -1 on error, 0 on success. + */ +int +virCPUExpandFeatures(virArch arch, + virCPUDefPtr cpu) +{ + struct cpuArchDriver *driver; + + VIR_DEBUG("arch=%s, cpu=%p, model=%s, nfeatures=%zu", + virArchToString(arch), cpu, NULLSTR(cpu->model), cpu->nfeatures); + + if (!(driver = cpuGetSubDriver(arch))) + return -1; + + if (driver->expandFeatures && + driver->expandFeatures(cpu) < 0) + return -1; + + qsort(cpu->features, cpu->nfeatures, sizeof(*cpu->features), + virCPUFeatureCompare); + + VIR_DEBUG("nfeatures=%zu", cpu->nfeatures); + return 0; +} diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 7d6d3e921..5a8728bce 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -116,6 +116,9 @@ typedef int typedef int (*virCPUArchConvertLegacy)(virCPUDefPtr cpu); +typedef int +(*virCPUArchExpandFeatures)(virCPUDefPtr cpu); + struct cpuArchDriver { const char *name; const virArch *arch; @@ -135,6 +138,7 @@ struct cpuArchDriver { virCPUArchGetModels getModels; virCPUArchTranslate translate; virCPUArchConvertLegacy convertLegacy; + virCPUArchExpandFeatures expandFeatures; }; @@ -245,6 +249,10 @@ virCPUConvertLegacy(virArch arch, virCPUDefPtr cpu) ATTRIBUTE_NONNULL(2); +int +virCPUExpandFeatures(virArch arch, + virCPUDefPtr cpu); + /* virCPUDataFormat and virCPUDataParse are implemented for unit tests only and * have no real-life usage */ diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 9e208b094..442f0ce44 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2891,6 +2891,58 @@ virCPUx86Translate(virCPUDefPtr cpu, } +static int +virCPUx86ExpandFeatures(virCPUDefPtr cpu) +{ + virCPUx86MapPtr map; + virCPUDefPtr expanded = NULL; + virCPUx86ModelPtr model = NULL; + bool host = cpu->type == VIR_CPU_TYPE_HOST; + size_t i; + int ret = -1; + + if (!(map = virCPUx86GetMap())) + goto cleanup; + + if (!(expanded = virCPUDefCopy(cpu))) + goto cleanup; + + virCPUDefFreeFeatures(expanded); + + if (!(model = x86ModelFind(map, cpu->model))) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown CPU model %s"), cpu->model); + goto cleanup; + } + + if (!(model = x86ModelCopy(model)) || + x86DataToCPUFeatures(expanded, host ? -1 : VIR_CPU_FEATURE_REQUIRE, + &model->data, map) < 0) + goto cleanup; + + for (i = 0; i < cpu->nfeatures; i++) { + virCPUFeatureDefPtr f = cpu->features + i; + + if (!host && + f->policy != VIR_CPU_FEATURE_REQUIRE && + f->policy != VIR_CPU_FEATURE_DISABLE) + continue; + + if (virCPUDefUpdateFeature(expanded, f->name, f->policy) < 0) + goto cleanup; + } + + virCPUDefFreeModel(cpu); + + ret = virCPUDefCopyModel(cpu, expanded, false); + + cleanup: + virCPUDefFree(expanded); + x86ModelFree(model); + return ret; +} + + int virCPUx86DataAddCPUID(virCPUDataPtr cpuData, const virCPUx86CPUID *cpuid) @@ -2965,4 +3017,5 @@ struct cpuArchDriver cpuDriverX86 = { .dataParse = virCPUx86DataParse, .getModels = virCPUx86GetModels, .translate = virCPUx86Translate, + .expandFeatures = virCPUx86ExpandFeatures, }; diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 7ac5e533f..21912434d 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1013,6 +1013,7 @@ virCPUDataFormat; virCPUDataFree; virCPUDataNew; virCPUDataParse; +virCPUExpandFeatures; virCPUGetHost; virCPUGetModels; virCPUTranslate; -- 2.12.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu.c | 2 +- src/cpu/cpu.h | 3 +-- src/cpu/cpu_ppc64.c | 7 ++----- src/cpu/cpu_x86.c | 7 +++---- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 5604db1d1..33581e5fe 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -250,7 +250,7 @@ cpuDecode(virCPUDefPtr cpu, return -1; } - return driver->decode(cpu, data, models, nmodels, preferred, 0); + return driver->decode(cpu, data, models, nmodels, preferred); } diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 5a8728bce..92b0f788e 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -54,8 +54,7 @@ typedef int const virCPUData *data, const char **models, unsigned int nmodels, - const char *preferred, - unsigned int flags); + const char *preferred); typedef int (*cpuArchEncode) (virArch arch, diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 6e16ffd13..0ad8d17d4 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -665,15 +665,12 @@ ppc64DriverDecode(virCPUDefPtr cpu, const virCPUData *data, const char **models, unsigned int nmodels, - const char *preferred ATTRIBUTE_UNUSED, - unsigned int flags) + const char *preferred ATTRIBUTE_UNUSED) { int ret = -1; struct ppc64_map *map; const struct ppc64_model *model; - virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, -1); - if (!data || !(map = ppc64LoadMap())) return -1; @@ -740,7 +737,7 @@ virCPUppc64GetHost(virCPUDefPtr cpu, #endif data->pvr[0].mask = 0xfffffffful; - ret = ppc64DriverDecode(cpu, cpuData, models, nmodels, NULL, 0); + ret = ppc64DriverDecode(cpu, cpuData, models, nmodels, NULL); cleanup: virCPUppc64DataFree(cpuData); diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 442f0ce44..9c480398f 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1984,10 +1984,9 @@ x86DecodeCPUData(virCPUDefPtr cpu, const virCPUData *data, const char **models, unsigned int nmodels, - const char *preferred, - unsigned int flags) + const char *preferred) { - return x86Decode(cpu, &data->data.x86, models, nmodels, preferred, flags); + return x86Decode(cpu, &data->data.x86, models, nmodels, preferred, 0); } @@ -2452,7 +2451,7 @@ virCPUx86GetHost(virCPUDefPtr cpu, cpuidSet(CPUX86_EXTENDED, cpuData) < 0) goto cleanup; - ret = x86DecodeCPUData(cpu, cpuData, models, nmodels, NULL, 0); + ret = x86DecodeCPUData(cpu, cpuData, models, nmodels, NULL); cleanup: virCPUx86DataFree(cpuData); -- 2.12.0

cpuBaseline is responsible for computing a baseline CPU while feature expansion is done by virCPUExpandFeatures. The cpuBaselineXML wrapper (used by hypervisor drivers to implement virConnectBaselineCPU API) calls cpuBaseline followed by virCPUExpandFeatures if requested by VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES flag. The features in the three changed test files had to be sorted using "sort -k 3" because virCPUExpandFeatures returns a sorted list of features. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu.c | 8 +++ src/cpu/cpu_x86.c | 33 ----------- tests/cputest.c | 8 +++ tests/cputestdata/x86_64-baseline-3-expanded.xml | 48 ++++++++-------- tests/cputestdata/x86_64-baseline-4-expanded.xml | 68 +++++++++++------------ tests/cputestdata/x86_64-baseline-5-expanded.xml | 70 ++++++++++++------------ 6 files changed, 109 insertions(+), 126 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 33581e5fe..d53a7ef2c 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -498,6 +498,10 @@ cpuBaselineXML(const char **xmlCPUs, size_t i; VIR_DEBUG("ncpus=%u, nmodels=%u", ncpus, nmodels); + + virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | + VIR_CONNECT_BASELINE_CPU_MIGRATABLE, NULL); + if (xmlCPUs) { for (i = 0; i < ncpus; i++) VIR_DEBUG("xmlCPUs[%zu]=%s", i, NULLSTR(xmlCPUs[i])); @@ -538,6 +542,10 @@ cpuBaselineXML(const char **xmlCPUs, if (!(cpu = cpuBaseline(cpus, ncpus, models, nmodels, flags))) goto error; + if ((flags & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES) && + virCPUExpandFeatures(cpus[0]->arch, cpu) < 0) + goto error; + cpustr = virCPUDefFormat(cpu, NULL, false); cleanup: diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 9c480398f..388102f35 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -967,28 +967,6 @@ x86FeaturesLoad(virCPUx86MapPtr map, return 0; } -static int -x86DataFromCPUFeatures(virCPUx86Data *data, - virCPUDefPtr cpu, - virCPUx86MapPtr map) -{ - size_t i; - - 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); - return -1; - } - - if (x86DataAdd(data, &feature->data) < 0) - return -1; - } - - return 0; -} - static virCPUx86ModelPtr x86ModelNew(void) @@ -1948,17 +1926,6 @@ x86Decode(virCPUDefPtr cpu, } } - if (flags & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES) { - if (x86DataCopy(©, &model->data) < 0 || - x86DataFromCPUFeatures(&features, cpuModel, map) < 0) - goto cleanup; - - x86DataSubtract(©, &features); - if (x86DataToCPUFeatures(cpuModel, VIR_CPU_FEATURE_REQUIRE, - ©, map) < 0) - goto cleanup; - } - if (vendor && VIR_STRDUP(cpu->vendor, vendor->name) < 0) goto cleanup; diff --git a/tests/cputest.c b/tests/cputest.c index 5e205c501..6396e8670 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -325,6 +325,14 @@ cpuTestBaseline(const void *arg) goto cleanup; baseline = cpuBaseline(cpus, ncpus, NULL, 0, data->flags); + + if (baseline && + (data->flags & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES) && + virCPUExpandFeatures(data->arch, baseline) < 0) { + virCPUDefFree(baseline); + baseline = NULL; + } + if (data->result < 0) { virResetLastError(); if (!baseline) { diff --git a/tests/cputestdata/x86_64-baseline-3-expanded.xml b/tests/cputestdata/x86_64-baseline-3-expanded.xml index f0c2273d8..82857e3d4 100644 --- a/tests/cputestdata/x86_64-baseline-3-expanded.xml +++ b/tests/cputestdata/x86_64-baseline-3-expanded.xml @@ -1,35 +1,35 @@ <cpu mode='custom' match='exact'> <model fallback='forbid'>Westmere</model> - <feature policy='require' name='fpu'/> - <feature policy='require' name='de'/> - <feature policy='require' name='pse'/> - <feature policy='require' name='tsc'/> - <feature policy='require' name='msr'/> - <feature policy='require' name='pae'/> - <feature policy='require' name='mce'/> - <feature policy='require' name='cx8'/> + <feature policy='require' name='aes'/> <feature policy='require' name='apic'/> - <feature policy='require' name='sep'/> - <feature policy='require' name='mtrr'/> - <feature policy='require' name='pge'/> - <feature policy='require' name='mca'/> - <feature policy='require' name='cmov'/> - <feature policy='require' name='pat'/> - <feature policy='require' name='pse36'/> <feature policy='require' name='clflush'/> - <feature policy='require' name='mmx'/> + <feature policy='require' name='cmov'/> + <feature policy='require' name='cx16'/> + <feature policy='require' name='cx8'/> + <feature policy='require' name='de'/> + <feature policy='require' name='fpu'/> <feature policy='require' name='fxsr'/> + <feature policy='require' name='lahf_lm'/> + <feature policy='require' name='lm'/> + <feature policy='require' name='mca'/> + <feature policy='require' name='mce'/> + <feature policy='require' name='mmx'/> + <feature policy='require' name='msr'/> + <feature policy='require' name='mtrr'/> + <feature policy='require' name='nx'/> + <feature policy='require' name='pae'/> + <feature policy='require' name='pat'/> + <feature policy='require' name='pge'/> + <feature policy='require' name='pni'/> + <feature policy='require' name='popcnt'/> + <feature policy='require' name='pse'/> + <feature policy='require' name='pse36'/> + <feature policy='require' name='sep'/> <feature policy='require' name='sse'/> <feature policy='require' name='sse2'/> - <feature policy='require' name='pni'/> - <feature policy='require' name='ssse3'/> - <feature policy='require' name='cx16'/> <feature policy='require' name='sse4.1'/> <feature policy='require' name='sse4.2'/> - <feature policy='require' name='popcnt'/> - <feature policy='require' name='aes'/> + <feature policy='require' name='ssse3'/> <feature policy='require' name='syscall'/> - <feature policy='require' name='nx'/> - <feature policy='require' name='lm'/> - <feature policy='require' name='lahf_lm'/> + <feature policy='require' name='tsc'/> </cpu> diff --git a/tests/cputestdata/x86_64-baseline-4-expanded.xml b/tests/cputestdata/x86_64-baseline-4-expanded.xml index 7e4578e1a..e54eca026 100644 --- a/tests/cputestdata/x86_64-baseline-4-expanded.xml +++ b/tests/cputestdata/x86_64-baseline-4-expanded.xml @@ -1,46 +1,46 @@ <cpu mode='custom' match='exact'> <model fallback='forbid'>Westmere</model> <vendor>Intel</vendor> - <feature policy='require' name='vme'/> - <feature policy='require' name='ss'/> - <feature policy='require' name='pclmuldq'/> - <feature policy='require' name='pcid'/> - <feature policy='require' name='x2apic'/> - <feature policy='require' name='tsc-deadline'/> - <feature policy='require' name='xsave'/> - <feature policy='require' name='osxsave'/> - <feature policy='require' name='avx'/> - <feature policy='require' name='hypervisor'/> - <feature policy='require' name='fpu'/> - <feature policy='require' name='de'/> - <feature policy='require' name='pse'/> - <feature policy='require' name='tsc'/> - <feature policy='require' name='msr'/> - <feature policy='require' name='pae'/> - <feature policy='require' name='mce'/> - <feature policy='require' name='cx8'/> + <feature policy='require' name='aes'/> <feature policy='require' name='apic'/> - <feature policy='require' name='sep'/> - <feature policy='require' name='mtrr'/> - <feature policy='require' name='pge'/> - <feature policy='require' name='mca'/> - <feature policy='require' name='cmov'/> - <feature policy='require' name='pat'/> - <feature policy='require' name='pse36'/> + <feature policy='require' name='avx'/> <feature policy='require' name='clflush'/> - <feature policy='require' name='mmx'/> + <feature policy='require' name='cmov'/> + <feature policy='require' name='cx16'/> + <feature policy='require' name='cx8'/> + <feature policy='require' name='de'/> + <feature policy='require' name='fpu'/> <feature policy='require' name='fxsr'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='lahf_lm'/> + <feature policy='require' name='lm'/> + <feature policy='require' name='mca'/> + <feature policy='require' name='mce'/> + <feature policy='require' name='mmx'/> + <feature policy='require' name='msr'/> + <feature policy='require' name='mtrr'/> + <feature policy='require' name='nx'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='pae'/> + <feature policy='require' name='pat'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='pclmuldq'/> + <feature policy='require' name='pge'/> + <feature policy='require' name='pni'/> + <feature policy='require' name='popcnt'/> + <feature policy='require' name='pse'/> + <feature policy='require' name='pse36'/> + <feature policy='require' name='sep'/> + <feature policy='require' name='ss'/> <feature policy='require' name='sse'/> <feature policy='require' name='sse2'/> - <feature policy='require' name='pni'/> - <feature policy='require' name='ssse3'/> - <feature policy='require' name='cx16'/> <feature policy='require' name='sse4.1'/> <feature policy='require' name='sse4.2'/> - <feature policy='require' name='popcnt'/> - <feature policy='require' name='aes'/> + <feature policy='require' name='ssse3'/> <feature policy='require' name='syscall'/> - <feature policy='require' name='nx'/> - <feature policy='require' name='lm'/> - <feature policy='require' name='lahf_lm'/> + <feature policy='require' name='tsc'/> + <feature policy='require' name='tsc-deadline'/> + <feature policy='require' name='vme'/> + <feature policy='require' name='x2apic'/> + <feature policy='require' name='xsave'/> </cpu> diff --git a/tests/cputestdata/x86_64-baseline-5-expanded.xml b/tests/cputestdata/x86_64-baseline-5-expanded.xml index daef2a78f..2c1b40015 100644 --- a/tests/cputestdata/x86_64-baseline-5-expanded.xml +++ b/tests/cputestdata/x86_64-baseline-5-expanded.xml @@ -1,47 +1,47 @@ <cpu mode='custom' match='exact'> <model fallback='allow'>SandyBridge</model> <vendor>Intel</vendor> - <feature policy='require' name='vme'/> - <feature policy='require' name='ss'/> - <feature policy='require' name='pcid'/> - <feature policy='require' name='osxsave'/> - <feature policy='require' name='hypervisor'/> - <feature policy='disable' name='rdtscp'/> - <feature policy='require' name='fpu'/> - <feature policy='require' name='de'/> - <feature policy='require' name='pse'/> - <feature policy='require' name='tsc'/> - <feature policy='require' name='msr'/> - <feature policy='require' name='pae'/> - <feature policy='require' name='mce'/> - <feature policy='require' name='cx8'/> + <feature policy='require' name='aes'/> <feature policy='require' name='apic'/> - <feature policy='require' name='sep'/> - <feature policy='require' name='mtrr'/> - <feature policy='require' name='pge'/> - <feature policy='require' name='mca'/> - <feature policy='require' name='cmov'/> - <feature policy='require' name='pat'/> - <feature policy='require' name='pse36'/> + <feature policy='require' name='avx'/> <feature policy='require' name='clflush'/> - <feature policy='require' name='mmx'/> + <feature policy='require' name='cmov'/> + <feature policy='require' name='cx16'/> + <feature policy='require' name='cx8'/> + <feature policy='require' name='de'/> + <feature policy='require' name='fpu'/> <feature policy='require' name='fxsr'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='lahf_lm'/> + <feature policy='require' name='lm'/> + <feature policy='require' name='mca'/> + <feature policy='require' name='mce'/> + <feature policy='require' name='mmx'/> + <feature policy='require' name='msr'/> + <feature policy='require' name='mtrr'/> + <feature policy='require' name='nx'/> + <feature policy='require' name='osxsave'/> + <feature policy='require' name='pae'/> + <feature policy='require' name='pat'/> + <feature policy='require' name='pcid'/> + <feature policy='require' name='pclmuldq'/> + <feature policy='require' name='pge'/> + <feature policy='require' name='pni'/> + <feature policy='require' name='popcnt'/> + <feature policy='require' name='pse'/> + <feature policy='require' name='pse36'/> + <feature policy='disable' name='rdtscp'/> + <feature policy='require' name='sep'/> + <feature policy='require' name='ss'/> <feature policy='require' name='sse'/> <feature policy='require' name='sse2'/> - <feature policy='require' name='pni'/> - <feature policy='require' name='pclmuldq'/> - <feature policy='require' name='ssse3'/> - <feature policy='require' name='cx16'/> <feature policy='require' name='sse4.1'/> <feature policy='require' name='sse4.2'/> - <feature policy='require' name='x2apic'/> - <feature policy='require' name='popcnt'/> - <feature policy='require' name='tsc-deadline'/> - <feature policy='require' name='aes'/> - <feature policy='require' name='xsave'/> - <feature policy='require' name='avx'/> + <feature policy='require' name='ssse3'/> <feature policy='require' name='syscall'/> - <feature policy='require' name='nx'/> - <feature policy='require' name='lm'/> - <feature policy='require' name='lahf_lm'/> + <feature policy='require' name='tsc'/> + <feature policy='require' name='tsc-deadline'/> + <feature policy='require' name='vme'/> + <feature policy='require' name='x2apic'/> + <feature policy='require' name='xsave'/> </cpu> -- 2.12.0

The public API flags are handled by the cpuBaselineXML wrapper. The internal cpuBaseline API only needs to know whether it is supposed to drop non-migratable features. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu/cpu.c | 14 +++++--------- src/cpu/cpu.h | 4 ++-- src/cpu/cpu_arm.c | 5 +---- src/cpu/cpu_ppc64.c | 5 +---- src/cpu/cpu_x86.c | 18 ++++++------------ tests/cputest.c | 3 ++- 6 files changed, 17 insertions(+), 32 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index d53a7ef2c..8e07e0ce4 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -539,7 +539,8 @@ cpuBaselineXML(const char **xmlCPUs, doc = NULL; } - if (!(cpu = cpuBaseline(cpus, ncpus, models, nmodels, flags))) + if (!(cpu = cpuBaseline(cpus, ncpus, models, nmodels, + !!(flags & VIR_CONNECT_BASELINE_CPU_MIGRATABLE)))) goto error; if ((flags & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES) && @@ -573,18 +574,13 @@ cpuBaselineXML(const char **xmlCPUs, * @ncpus: number of CPUs in @cpus * @models: list of CPU models that can be considered for the baseline CPU * @nmodels: number of CPU models in @models - * @flags: bitwise-OR of virConnectBaselineCPUFlags + * @migratable: requests non-migratable features to be removed from the result * * Computes the most feature-rich CPU which is compatible with all given * host CPUs. If @models array is NULL, all models supported by libvirt will * be considered when computing the baseline CPU model, otherwise the baseline * CPU model will be one of the provided CPU @models. * - * If @flags includes VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES then libvirt - * will explicitly list all CPU features that are part of the host CPU, - * without this flag features that are part of the CPU model will not be - * listed. - * * Returns baseline CPU definition or NULL on error. */ virCPUDefPtr @@ -592,7 +588,7 @@ cpuBaseline(virCPUDefPtr *cpus, unsigned int ncpus, const char **models, unsigned int nmodels, - unsigned int flags) + bool migratable) { struct cpuArchDriver *driver; size_t i; @@ -647,7 +643,7 @@ cpuBaseline(virCPUDefPtr *cpus, return NULL; } - return driver->baseline(cpus, ncpus, models, nmodels, flags); + return driver->baseline(cpus, ncpus, models, nmodels, migratable); } diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 92b0f788e..096eabe4c 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -79,7 +79,7 @@ typedef virCPUDefPtr unsigned int ncpus, const char **models, unsigned int nmodels, - unsigned int flags); + bool migratable); typedef int (*virCPUArchUpdate)(virCPUDefPtr guest, @@ -198,7 +198,7 @@ cpuBaseline (virCPUDefPtr *cpus, unsigned int ncpus, const char **models, unsigned int nmodels, - unsigned int flags) + bool migratable) ATTRIBUTE_NONNULL(1); int diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index a1aba2554..474777656 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -77,13 +77,10 @@ armBaseline(virCPUDefPtr *cpus, unsigned int ncpus ATTRIBUTE_UNUSED, const char **models ATTRIBUTE_UNUSED, unsigned int nmodels ATTRIBUTE_UNUSED, - unsigned int flags) + bool migratable ATTRIBUTE_UNUSED) { virCPUDefPtr cpu = NULL; - virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | - VIR_CONNECT_BASELINE_CPU_MIGRATABLE, NULL); - if (VIR_ALLOC(cpu) < 0 || VIR_STRDUP(cpu->model, cpus[0]->model) < 0) { virCPUDefFree(cpu); diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 0ad8d17d4..f64592b55 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -768,7 +768,7 @@ ppc64DriverBaseline(virCPUDefPtr *cpus, unsigned int ncpus, const char **models ATTRIBUTE_UNUSED, unsigned int nmodels ATTRIBUTE_UNUSED, - unsigned int flags) + bool migratable ATTRIBUTE_UNUSED) { struct ppc64_map *map; const struct ppc64_model *model; @@ -776,9 +776,6 @@ ppc64DriverBaseline(virCPUDefPtr *cpus, virCPUDefPtr cpu = NULL; size_t i; - virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | - VIR_CONNECT_BASELINE_CPU_MIGRATABLE, NULL); - if (!(map = ppc64LoadMap())) goto error; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 388102f35..48648a7f4 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1823,7 +1823,7 @@ x86Decode(virCPUDefPtr cpu, const char **models, unsigned int nmodels, const char *preferred, - unsigned int flags) + bool migratable) { int ret = -1; virCPUx86MapPtr map; @@ -1839,9 +1839,6 @@ x86Decode(virCPUDefPtr cpu, ssize_t i; int rc; - virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | - VIR_CONNECT_BASELINE_CPU_MIGRATABLE, -1); - if (!cpuData || x86DataCopy(&data, cpuData) < 0) return -1; @@ -1913,7 +1910,7 @@ x86Decode(virCPUDefPtr cpu, /* Remove non-migratable features if requested * Note: this only works as long as no CPU model contains non-migratable * features directly */ - if (flags & VIR_CONNECT_BASELINE_CPU_MIGRATABLE) { + if (migratable) { i = 0; while (i < cpuModel->nfeatures) { if (x86FeatureIsMigratable(cpuModel->features[i].name, map)) { @@ -1953,7 +1950,7 @@ x86DecodeCPUData(virCPUDefPtr cpu, unsigned int nmodels, const char *preferred) { - return x86Decode(cpu, &data->data.x86, models, nmodels, preferred, 0); + return x86Decode(cpu, &data->data.x86, models, nmodels, preferred, false); } @@ -2432,7 +2429,7 @@ x86Baseline(virCPUDefPtr *cpus, unsigned int ncpus, const char **models, unsigned int nmodels, - unsigned int flags) + bool migratable) { virCPUx86MapPtr map = NULL; virCPUx86ModelPtr base_model = NULL; @@ -2444,9 +2441,6 @@ x86Baseline(virCPUDefPtr *cpus, const char *modelName; bool matchingNames = true; - virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | - VIR_CONNECT_BASELINE_CPU_MIGRATABLE, NULL); - if (!(map = virCPUx86GetMap())) goto error; @@ -2529,7 +2523,7 @@ x86Baseline(virCPUDefPtr *cpus, virCPUx86DataAddCPUIDInt(&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, migratable) < 0) goto error; if (STREQ_NULLABLE(cpu->model, modelName)) @@ -2838,7 +2832,7 @@ virCPUx86Translate(virCPUDefPtr cpu, if (!(translated = virCPUDefCopyWithoutModel(cpu))) goto cleanup; - if (x86Decode(translated, &model->data, models, nmodels, NULL, 0) < 0) + if (x86Decode(translated, &model->data, models, nmodels, NULL, false) < 0) goto cleanup; for (i = 0; i < cpu->nfeatures; i++) { diff --git a/tests/cputest.c b/tests/cputest.c index 6396e8670..4a4d427e1 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -324,7 +324,8 @@ cpuTestBaseline(const void *arg) if (!(cpus = cpuTestLoadMultiXML(data->arch, data->name, &ncpus))) goto cleanup; - baseline = cpuBaseline(cpus, ncpus, NULL, 0, data->flags); + baseline = cpuBaseline(cpus, ncpus, NULL, 0, + !!(data->flags & VIR_CONNECT_BASELINE_CPU_MIGRATABLE)); if (baseline && (data->flags & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES) && -- 2.12.0

Let's make the object local to the parseFeatureWords function which uses it. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputestdata/cpu-convert.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cputestdata/cpu-convert.py b/tests/cputestdata/cpu-convert.py index 898d42f10..e069408c8 100755 --- a/tests/cputestdata/cpu-convert.py +++ b/tests/cputestdata/cpu-convert.py @@ -174,6 +174,8 @@ cpuidMap = [ def parseFeatureWords(path): features = None + dec = json.JSONDecoder() + with open(path, "r") as f: s = f.read() @@ -220,8 +222,6 @@ def propAdd(props, feature, value): props[name] = value -dec = json.JSONDecoder() - for path in sys.argv[1:]: props, cpuid = parseFeatureWords(path) -- 2.12.0

The new script is going to be more general and the original functionality can be requested by "cpu-cpuid.py convert". Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputestdata/{cpu-convert.py => cpu-cpuid.py} | 17 ++++++++++++++++- tests/cputestdata/cpu-parse.sh | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) rename tests/cputestdata/{cpu-convert.py => cpu-cpuid.py} (98%) diff --git a/tests/cputestdata/cpu-convert.py b/tests/cputestdata/cpu-cpuid.py similarity index 98% rename from tests/cputestdata/cpu-convert.py rename to tests/cputestdata/cpu-cpuid.py index e069408c8..a4dc23378 100755 --- a/tests/cputestdata/cpu-convert.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -222,7 +222,7 @@ def propAdd(props, feature, value): props[name] = value -for path in sys.argv[1:]: +def convert(path): props, cpuid = parseFeatureWords(path) for feature in cpuidMap: @@ -247,3 +247,18 @@ for path in sys.argv[1:]: "id": "model-expansion"}, f, indent = 2, separators = (',', ': ')) f.write("\n") + + +if len(sys.argv) < 3: + print "Usage: %s convert json_file..." % sys.argv[0] + sys.exit(1) + +action = sys.argv[1] +args = sys.argv[2:] + +if action == "convert": + for path in args: + convert(path) +else: + print "Unknown action: " + action + sys.exit(1) diff --git a/tests/cputestdata/cpu-parse.sh b/tests/cputestdata/cpu-parse.sh index 86bcb030d..d823c399b 100755 --- a/tests/cputestdata/cpu-parse.sh +++ b/tests/cputestdata/cpu-parse.sh @@ -53,7 +53,7 @@ json <<<"$data" >$fname.json if [[ -s $fname.json ]]; then echo $fname.json if ! grep -q model-expansion $fname.json; then - $(dirname $0)/cpu-convert.py $fname.json + $(dirname $0)/cpu-cpuid.py convert $fname.json fi else rm $fname.json -- 2.12.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputestdata/cpu-cpuid.py | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index a4dc23378..9ea858d98 100755 --- a/tests/cputestdata/cpu-cpuid.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -171,6 +171,24 @@ cpuidMap = [ ] +def cpuidIsSet(cpuid, feature): + in_eax = feature["in_eax"] + in_ecx = feature["in_ecx"] + eax = feature["eax"] + ebx = feature["ebx"] + ecx = feature["ecx"] + edx = feature["edx"] + + if in_eax not in cpuid or in_ecx not in cpuid[in_eax]: + return False + else: + leaf = cpuid[in_eax][in_ecx] + return ((eax > 0 and leaf["eax"] & eax > 0) or + (ebx > 0 and leaf["ebx"] & ebx > 0) or + (ecx > 0 and leaf["ecx"] & ecx > 0) or + (edx > 0 and leaf["edx"] & edx > 0)) + + def parseFeatureWords(path): features = None @@ -217,30 +235,13 @@ def parseFeatureWords(path): return props, cpuid -def propAdd(props, feature, value): - for name in feature["names"]: - props[name] = value - - def convert(path): props, cpuid = parseFeatureWords(path) for feature in cpuidMap: - in_eax = feature["in_eax"] - in_ecx = feature["in_ecx"] - eax = feature["eax"] - ebx = feature["ebx"] - ecx = feature["ecx"] - edx = feature["edx"] - - if in_eax not in cpuid or in_ecx not in cpuid[in_eax]: - propAdd(props, feature, False) - else: - leaf = cpuid[in_eax][in_ecx] - propAdd(props, feature, ((eax > 0 and leaf["eax"] & eax > 0) or - (ebx > 0 and leaf["ebx"] & ebx > 0) or - (ecx > 0 and leaf["ecx"] & ecx > 0) or - (edx > 0 and leaf["edx"] & edx > 0))) + value = cpuidIsSet(cpuid, feature) + for name in feature["names"]: + props[name] = value with open(path, "w") as f: json.dump({"return": {"model": {"name": "base", "props": props}}, -- 2.12.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputestdata/cpu-cpuid.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index 9ea858d98..f4cf6d440 100755 --- a/tests/cputestdata/cpu-cpuid.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -189,6 +189,18 @@ def cpuidIsSet(cpuid, feature): (edx > 0 and leaf["edx"] & edx > 0)) +def cpuidLeaf(cpuid, in_eax, in_ecx): + if in_eax not in cpuid: + cpuid[in_eax] = {} + leaf = cpuid[in_eax] + + if in_ecx not in leaf: + leaf[in_ecx] = {"eax": 0, "ebx": 0, "ecx": 0, "edx": 0} + leaf = leaf[in_ecx] + + return leaf + + def parseFeatureWords(path): features = None @@ -222,14 +234,7 @@ def parseFeatureWords(path): if "cpuid-input-ecx" in feat: in_ecx = feat["cpuid-input-ecx"] - if in_eax not in cpuid: - cpuid[in_eax] = {} - leaf = cpuid[in_eax] - - if in_ecx not in leaf: - leaf[in_ecx] = {"eax": 0, "ebx": 0, "ecx": 0, "edx": 0} - leaf = leaf[in_ecx] - + leaf = cpuidLeaf(cpuid, in_eax, in_ecx) leaf[feat["cpuid-register"].lower()] = feat["features"] return props, cpuid -- 2.12.0

The new command can be used to generate test data for virCPUUpdateLive. When "cpu-cpuid.py diff x86-cpuid-Something.json" is run, it reads raw CPUID data stored in x86-cpuid-Something.xml and CPUID data from QEMU stored in x86-cpuid-Something.json to produce two more CPUID files: x86-cpuid-Something-enabled.xml and x86-cpuid-Something-disabled.xml. - x86-cpuid-Something-enabled.xml will contain CPUID bits present in x86-cpuid-Something.json (i.e., enabled by QEMU for the "host" CPU) - x86-cpuid-Something-disabled.xml will contain all CPUID bits from x86-cpuid-Something.xml which are not present in x86-cpuid-Something.json (i.e., CPUID bits which the host CPU supports, but QEMU does not enable them for the "host" CPU) Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputestdata/cpu-cpuid.py | 89 +++++++++++++++++++++++++++++++++++++++++- tests/cputestdata/cpu-parse.sh | 1 + 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index f4cf6d440..4b9b04ace 100755 --- a/tests/cputestdata/cpu-cpuid.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -2,6 +2,7 @@ import sys import json +import xmltodict # This is a list of x86 CPU features as of QEMU 2.8.50 and it won't need any # updates since in the future because query-cpu-model-expansion will be used @@ -171,6 +172,16 @@ cpuidMap = [ ] +def reverseCpuidMap(): + features = {} + + for feature in cpuidMap: + for name in feature["names"]: + features[name] = feature + + return features + + def cpuidIsSet(cpuid, feature): in_eax = feature["in_eax"] in_ecx = feature["in_ecx"] @@ -201,6 +212,12 @@ def cpuidLeaf(cpuid, in_eax, in_ecx): return leaf +def cpuidAdd(cpuid, feature): + leaf = cpuidLeaf(cpuid, feature["in_eax"], feature["in_ecx"]) + for reg in ["eax", "ebx", "ecx", "edx"]: + leaf[reg] |= feature[reg] + + def parseFeatureWords(path): features = None @@ -240,6 +257,50 @@ def parseFeatureWords(path): return props, cpuid +def parseQemu(path, features): + cpuid = {} + with open(path, "r") as f: + data = json.load(f) + + for (prop, val) in data["return"]["model"]["props"].iteritems(): + if val and prop in features: + cpuidAdd(cpuid, features[prop]) + + return cpuid + + +def parseCpuid(path): + cpuid = {} + with open(path, "r") as f: + data = xmltodict.parse(f) + + for leaf in data["cpudata"]["cpuid"]: + leaf["in_eax"] = int(leaf["@eax_in"], 0) + leaf["in_ecx"] = int(leaf["@ecx_in"], 0) + for reg in ["eax", "ebx", "ecx", "edx"]: + leaf[reg] = int(leaf["@" + reg], 0) + + cpuidAdd(cpuid, leaf) + + return cpuid + + +def formatCpuid(cpuid, path, comment): + with open(path, "w") as f: + f.write("<!-- " + comment + " -->\n") + f.write("<cpudata arch='x86'>\n") + for in_eax in sorted(cpuid.keys()): + for in_ecx in sorted(cpuid[in_eax].keys()): + leaf = cpuid[in_eax][in_ecx] + line = " <cpuid eax_in='0x%08x' ecx_in='0x%02x' " + line += "eax='0x%08x' ebx='0x%08x' " + line += "ecx='0x%08x' edx='0x%08x'/>\n" + f.write(line %( + in_eax, in_ecx, + leaf["eax"], leaf["ebx"], leaf["ecx"], leaf["edx"])) + f.write("</cpudata>\n") + + def convert(path): props, cpuid = parseFeatureWords(path) @@ -255,8 +316,30 @@ def convert(path): f.write("\n") +def diff(features, path): + base = path.replace(".json", "") + jsonFile = path + cpuidFile = base + ".xml" + enabledFile = base + "-enabled.xml" + disabledFile = base + "-disabled.xml" + + cpuid = parseCpuid(cpuidFile) + qemu = parseQemu(jsonFile, features) + + enabled = {} + disabled = {} + for feature in cpuidMap: + if cpuidIsSet(qemu, feature): + cpuidAdd(enabled, feature) + elif cpuidIsSet(cpuid, feature): + cpuidAdd(disabled, feature) + + formatCpuid(enabled, enabledFile, "Features enabled by QEMU") + formatCpuid(disabled, disabledFile, "Features disabled by QEMU") + + if len(sys.argv) < 3: - print "Usage: %s convert json_file..." % sys.argv[0] + print "Usage: %s convert|diff json_file..." % sys.argv[0] sys.exit(1) action = sys.argv[1] @@ -265,6 +348,10 @@ args = sys.argv[2:] if action == "convert": for path in args: convert(path) +elif action == "diff": + features = reverseCpuidMap() + for path in args: + diff(features, path) else: print "Unknown action: " + action sys.exit(1) diff --git a/tests/cputestdata/cpu-parse.sh b/tests/cputestdata/cpu-parse.sh index d823c399b..cd1ab024b 100755 --- a/tests/cputestdata/cpu-parse.sh +++ b/tests/cputestdata/cpu-parse.sh @@ -55,6 +55,7 @@ if [[ -s $fname.json ]]; then if ! grep -q model-expansion $fname.json; then $(dirname $0)/cpu-cpuid.py convert $fname.json fi + $(dirname $0)/cpu-cpuid.py diff $fname.json else rm $fname.json fi -- 2.12.0

On Fri, Mar 17, 2017 at 05:36:48PM +0100, Jiri Denemark wrote:
The new command can be used to generate test data for virCPUUpdateLive.
When "cpu-cpuid.py diff x86-cpuid-Something.json" is run, it reads raw CPUID data stored in x86-cpuid-Something.xml and CPUID data from QEMU stored in x86-cpuid-Something.json to produce two more CPUID files: x86-cpuid-Something-enabled.xml and x86-cpuid-Something-disabled.xml.
- x86-cpuid-Something-enabled.xml will contain CPUID bits present in x86-cpuid-Something.json (i.e., enabled by QEMU for the "host" CPU)
- x86-cpuid-Something-disabled.xml will contain all CPUID bits from x86-cpuid-Something.xml which are not present in x86-cpuid-Something.json (i.e., CPUID bits which the host CPU supports, but QEMU does not enable them for the "host" CPU)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputestdata/cpu-cpuid.py | 89 +++++++++++++++++++++++++++++++++++++++++- tests/cputestdata/cpu-parse.sh | 1 + 2 files changed, 89 insertions(+), 1 deletion(-)
diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index f4cf6d440..4b9b04ace 100755 --- a/tests/cputestdata/cpu-cpuid.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -2,6 +2,7 @@
import sys import json +import xmltodict
# This is a list of x86 CPU features as of QEMU 2.8.50 and it won't need any # updates since in the future because query-cpu-model-expansion will be used @@ -171,6 +172,16 @@ cpuidMap = [ ]
+def reverseCpuidMap(): + features = {} + + for feature in cpuidMap: + for name in feature["names"]: + features[name] = feature + + return features + + def cpuidIsSet(cpuid, feature): in_eax = feature["in_eax"] in_ecx = feature["in_ecx"] @@ -201,6 +212,12 @@ def cpuidLeaf(cpuid, in_eax, in_ecx): return leaf
+def cpuidAdd(cpuid, feature): + leaf = cpuidLeaf(cpuid, feature["in_eax"], feature["in_ecx"]) + for reg in ["eax", "ebx", "ecx", "edx"]: + leaf[reg] |= feature[reg] + + def parseFeatureWords(path): features = None
@@ -240,6 +257,50 @@ def parseFeatureWords(path): return props, cpuid
+def parseQemu(path, features): + cpuid = {} + with open(path, "r") as f: + data = json.load(f) + + for (prop, val) in data["return"]["model"]["props"].iteritems(): + if val and prop in features: + cpuidAdd(cpuid, features[prop]) + + return cpuid + + +def parseCpuid(path): + cpuid = {} + with open(path, "r") as f: + data = xmltodict.parse(f) + + for leaf in data["cpudata"]["cpuid"]:
I would probably use a new variable to store the converted data, just in case that we don't mess up the original data. Currently it works but it could bite us in the future and it would be hard to debug.
+ leaf["in_eax"] = int(leaf["@eax_in"], 0) + leaf["in_ecx"] = int(leaf["@ecx_in"], 0) + for reg in ["eax", "ebx", "ecx", "edx"]: + leaf[reg] = int(leaf["@" + reg], 0) + + cpuidAdd(cpuid, leaf) + + return cpuid + + +def formatCpuid(cpuid, path, comment): + with open(path, "w") as f: + f.write("<!-- " + comment + " -->\n") + f.write("<cpudata arch='x86'>\n") + for in_eax in sorted(cpuid.keys()): + for in_ecx in sorted(cpuid[in_eax].keys()): + leaf = cpuid[in_eax][in_ecx] + line = " <cpuid eax_in='0x%08x' ecx_in='0x%02x' " + line += "eax='0x%08x' ebx='0x%08x' " + line += "ecx='0x%08x' edx='0x%08x'/>\n"
It is possible to split the long string into multiple lines like this: line = ("string 1" "string 2")
+ f.write(line %( + in_eax, in_ecx, + leaf["eax"], leaf["ebx"], leaf["ecx"], leaf["edx"])) + f.write("</cpudata>\n") + + def convert(path): props, cpuid = parseFeatureWords(path)
@@ -255,8 +316,30 @@ def convert(path): f.write("\n")
+def diff(features, path): + base = path.replace(".json", "") + jsonFile = path + cpuidFile = base + ".xml" + enabledFile = base + "-enabled.xml" + disabledFile = base + "-disabled.xml" + + cpuid = parseCpuid(cpuidFile) + qemu = parseQemu(jsonFile, features) + + enabled = {} + disabled = {} + for feature in cpuidMap: + if cpuidIsSet(qemu, feature): + cpuidAdd(enabled, feature) + elif cpuidIsSet(cpuid, feature): + cpuidAdd(disabled, feature) + + formatCpuid(enabled, enabledFile, "Features enabled by QEMU") + formatCpuid(disabled, disabledFile, "Features disabled by QEMU") + + if len(sys.argv) < 3: - print "Usage: %s convert json_file..." % sys.argv[0] + print "Usage: %s convert|diff json_file..." % sys.argv[0] sys.exit(1)
action = sys.argv[1] @@ -265,6 +348,10 @@ args = sys.argv[2:] if action == "convert": for path in args: convert(path) +elif action == "diff": + features = reverseCpuidMap() + for path in args: + diff(features, path) else: print "Unknown action: " + action sys.exit(1) diff --git a/tests/cputestdata/cpu-parse.sh b/tests/cputestdata/cpu-parse.sh index d823c399b..cd1ab024b 100755 --- a/tests/cputestdata/cpu-parse.sh +++ b/tests/cputestdata/cpu-parse.sh @@ -55,6 +55,7 @@ if [[ -s $fname.json ]]; then if ! grep -q model-expansion $fname.json; then $(dirname $0)/cpu-cpuid.py convert $fname.json fi + $(dirname $0)/cpu-cpuid.py diff $fname.json else rm $fname.json fi -- 2.12.0
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Generated with (cd tests/cputestdata; ./cpu-cpuid.py diff x86_64-cpuid-*.json) Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputestdata/x86_64-cpuid-A10-5800K-disabled.xml | 7 +++++++ tests/cputestdata/x86_64-cpuid-A10-5800K-enabled.xml | 8 ++++++++ tests/cputestdata/x86_64-cpuid-Core-i5-2500-disabled.xml | 5 +++++ tests/cputestdata/x86_64-cpuid-Core-i5-2500-enabled.xml | 9 +++++++++ tests/cputestdata/x86_64-cpuid-Core-i5-2540M-disabled.xml | 5 +++++ tests/cputestdata/x86_64-cpuid-Core-i5-2540M-enabled.xml | 9 +++++++++ tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml | 6 ++++++ tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml | 8 ++++++++ tests/cputestdata/x86_64-cpuid-Core-i5-6600-disabled.xml | 5 +++++ tests/cputestdata/x86_64-cpuid-Core-i5-6600-enabled.xml | 9 +++++++++ tests/cputestdata/x86_64-cpuid-Core-i7-2600-disabled.xml | 6 ++++++ tests/cputestdata/x86_64-cpuid-Core-i7-2600-enabled.xml | 8 ++++++++ tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-disabled.xml | 6 ++++++ tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-enabled.xml | 8 ++++++++ tests/cputestdata/x86_64-cpuid-Core-i7-3770-disabled.xml | 6 ++++++ tests/cputestdata/x86_64-cpuid-Core-i7-3770-enabled.xml | 8 ++++++++ tests/cputestdata/x86_64-cpuid-Core-i7-4510U-disabled.xml | 5 +++++ tests/cputestdata/x86_64-cpuid-Core-i7-4510U-enabled.xml | 9 +++++++++ tests/cputestdata/x86_64-cpuid-Core-i7-4600U-disabled.xml | 5 +++++ tests/cputestdata/x86_64-cpuid-Core-i7-4600U-enabled.xml | 9 +++++++++ tests/cputestdata/x86_64-cpuid-Core-i7-5600U-disabled.xml | 5 +++++ tests/cputestdata/x86_64-cpuid-Core-i7-5600U-enabled.xml | 9 +++++++++ tests/cputestdata/x86_64-cpuid-Core2-E6850-disabled.xml | 4 ++++ tests/cputestdata/x86_64-cpuid-Core2-E6850-enabled.xml | 7 +++++++ tests/cputestdata/x86_64-cpuid-Opteron-2350-disabled.xml | 7 +++++++ tests/cputestdata/x86_64-cpuid-Opteron-2350-enabled.xml | 7 +++++++ tests/cputestdata/x86_64-cpuid-Opteron-6234-disabled.xml | 7 +++++++ tests/cputestdata/x86_64-cpuid-Opteron-6234-enabled.xml | 9 +++++++++ tests/cputestdata/x86_64-cpuid-Phenom-B95-disabled.xml | 7 +++++++ tests/cputestdata/x86_64-cpuid-Phenom-B95-enabled.xml | 7 +++++++ tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-disabled.xml | 6 ++++++ tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-enabled.xml | 9 +++++++++ tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml | 6 ++++++ tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-enabled.xml | 8 ++++++++ tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml | 8 ++++++++ tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-enabled.xml | 7 +++++++ tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-disabled.xml | 6 ++++++ tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-enabled.xml | 7 +++++++ tests/cputestdata/x86_64-cpuid-Xeon-W3520-disabled.xml | 5 +++++ tests/cputestdata/x86_64-cpuid-Xeon-W3520-enabled.xml | 7 +++++++ 40 files changed, 279 insertions(+) create mode 100644 tests/cputestdata/x86_64-cpuid-A10-5800K-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-A10-5800K-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2500-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2500-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2540M-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-2540M-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-6600-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i5-6600-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3770-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-3770-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4600U-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4600U-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core2-E6850-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core2-E6850-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-2350-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-2350-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-6234-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Opteron-6234-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Phenom-B95-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Phenom-B95-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-W3520-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-W3520-enabled.xml diff --git a/tests/cputestdata/x86_64-cpuid-A10-5800K-disabled.xml b/tests/cputestdata/x86_64-cpuid-A10-5800K-disabled.xml new file mode 100644 index 000000000..3bacf2cf9 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-A10-5800K-disabled.xml @@ -0,0 +1,7 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x08000008' edx='0x10000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01cab40c' edx='0x08000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x000014f6'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-A10-5800K-enabled.xml b/tests/cputestdata/x86_64-cpuid-A10-5800K-enabled.xml new file mode 100644 index 000000000..a97702df9 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-A10-5800K-enabled.xml @@ -0,0 +1,8 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xb6b83203' edx='0x078bfbff'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x0000000a' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00210bf3' edx='0x26500800'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000009'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-2500-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-2500-disabled.xml new file mode 100644 index 000000000..510cd97a5 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-2500-disabled.xml @@ -0,0 +1,5 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1fc' edx='0xb0600000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-2500-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-2500-enabled.xml new file mode 100644 index 000000000..1581f800f --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-2500-enabled.xml @@ -0,0 +1,9 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x97ba2203' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000002' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-disabled.xml new file mode 100644 index 000000000..510cd97a5 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-disabled.xml @@ -0,0 +1,5 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1fc' edx='0xb0600000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-enabled.xml new file mode 100644 index 000000000..1581f800f --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-enabled.xml @@ -0,0 +1,9 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x97ba2203' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000002' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml new file mode 100644 index 000000000..601554a81 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml @@ -0,0 +1,6 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1dc' edx='0xb0600000'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml new file mode 100644 index 000000000..8a714379c --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml @@ -0,0 +1,8 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7fa3223' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000fbb' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000021' edx='0x2c100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-6600-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-6600-disabled.xml new file mode 100644 index 000000000..510cd97a5 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-6600-disabled.xml @@ -0,0 +1,5 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1fc' edx='0xb0600000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-6600-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-6600-enabled.xml new file mode 100644 index 000000000..13032d0d2 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-6600-enabled.xml @@ -0,0 +1,9 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7fa3203' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x009c4fbb' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x0000000f' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000121' edx='0x2c100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-disabled.xml new file mode 100644 index 000000000..f25d2888e --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-disabled.xml @@ -0,0 +1,6 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1fc' edx='0xb0600000'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-enabled.xml new file mode 100644 index 000000000..df99a2180 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-enabled.xml @@ -0,0 +1,8 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x97ba2203' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000002' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-disabled.xml new file mode 100644 index 000000000..601554a81 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-disabled.xml @@ -0,0 +1,6 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1dc' edx='0xb0600000'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-enabled.xml new file mode 100644 index 000000000..e596bf119 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-enabled.xml @@ -0,0 +1,8 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7ba2223' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000283' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-3770-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-3770-disabled.xml new file mode 100644 index 000000000..f25d2888e --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-3770-disabled.xml @@ -0,0 +1,6 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1fc' edx='0xb0600000'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-3770-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-3770-enabled.xml new file mode 100644 index 000000000..666c37536 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-3770-enabled.xml @@ -0,0 +1,8 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7ba2203' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000283' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-disabled.xml new file mode 100644 index 000000000..dbc978e73 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-disabled.xml @@ -0,0 +1,5 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c19c' edx='0xb0600000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-enabled.xml new file mode 100644 index 000000000..86896de80 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-enabled.xml @@ -0,0 +1,9 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7fa3223' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x000007ab' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000021' edx='0x2c100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-disabled.xml new file mode 100644 index 000000000..4a0477f78 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-disabled.xml @@ -0,0 +1,5 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1dc' edx='0xb0600000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-enabled.xml new file mode 100644 index 000000000..86896de80 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-enabled.xml @@ -0,0 +1,9 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7fa3223' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x000007ab' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000021' edx='0x2c100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-disabled.xml new file mode 100644 index 000000000..4a0477f78 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-disabled.xml @@ -0,0 +1,5 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1dc' edx='0xb0600000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-enabled.xml new file mode 100644 index 000000000..edc433c9a --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-enabled.xml @@ -0,0 +1,9 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7fa3223' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x001c0fbb' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000121' edx='0x2c100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core2-E6850-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core2-E6850-disabled.xml new file mode 100644 index 000000000..18e4baf3a --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core2-E6850-disabled.xml @@ -0,0 +1,4 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0000c1fc' edx='0xb0600000'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core2-E6850-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core2-E6850-enabled.xml new file mode 100644 index 000000000..af4f6f7ab --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core2-E6850-enabled.xml @@ -0,0 +1,7 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x81202201' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000002' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x20100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Opteron-2350-disabled.xml b/tests/cputestdata/x86_64-cpuid-Opteron-2350-disabled.xml new file mode 100644 index 000000000..3f6fe5405 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Opteron-2350-disabled.xml @@ -0,0 +1,7 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000008' edx='0x10000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000408' edx='0x08000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000006'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Opteron-2350-enabled.xml b/tests/cputestdata/x86_64-cpuid-Opteron-2350-enabled.xml new file mode 100644 index 000000000..7541dff65 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Opteron-2350-enabled.xml @@ -0,0 +1,7 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x81a02001' edx='0x078bfbff'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x000003f7' edx='0xe6500800'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000001'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Opteron-6234-disabled.xml b/tests/cputestdata/x86_64-cpuid-Opteron-6234-disabled.xml new file mode 100644 index 000000000..4dcd74103 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Opteron-6234-disabled.xml @@ -0,0 +1,7 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x08000008' edx='0x10000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01c8b40c' edx='0x08000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x000014f6'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Opteron-6234-enabled.xml b/tests/cputestdata/x86_64-cpuid-Opteron-6234-enabled.xml new file mode 100644 index 000000000..c4cfbcef2 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Opteron-6234-enabled.xml @@ -0,0 +1,9 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x97b82203' edx='0x078bfbff'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000002' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00010bf3' edx='0x26500800'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000009'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Phenom-B95-disabled.xml b/tests/cputestdata/x86_64-cpuid-Phenom-B95-disabled.xml new file mode 100644 index 000000000..3910eb6e5 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Phenom-B95-disabled.xml @@ -0,0 +1,7 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000008' edx='0x10000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0000340c' edx='0x08000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000006'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Phenom-B95-enabled.xml b/tests/cputestdata/x86_64-cpuid-Phenom-B95-enabled.xml new file mode 100644 index 000000000..a8cd01ff4 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Phenom-B95-enabled.xml @@ -0,0 +1,7 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x80a02001' edx='0x078bfbff'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x000003f3' edx='0xe6400800'/> + <cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000009'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-disabled.xml new file mode 100644 index 000000000..1a177705a --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-disabled.xml @@ -0,0 +1,6 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1dc' edx='0xb0600000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-enabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-enabled.xml new file mode 100644 index 000000000..258404233 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-enabled.xml @@ -0,0 +1,9 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7fa3223' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x009c4fbb' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000007' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000121' edx='0x2c100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml new file mode 100644 index 000000000..ea2906506 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml @@ -0,0 +1,6 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1fc' edx='0xb0600000'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-enabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-enabled.xml new file mode 100644 index 000000000..1c2367a3d --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-enabled.xml @@ -0,0 +1,8 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7fa3203' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x000007ab' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000021' edx='0x2c100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml new file mode 100644 index 000000000..a66b5bdd6 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml @@ -0,0 +1,8 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1dc' edx='0xb0600000'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000002' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-enabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-enabled.xml new file mode 100644 index 000000000..4c194af10 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-enabled.xml @@ -0,0 +1,7 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7fa3223' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x000007a9' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000021' edx='0x2c100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-disabled.xml new file mode 100644 index 000000000..e7e0ee6f2 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-disabled.xml @@ -0,0 +1,6 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0004c1fc' edx='0xb0600000'/> + <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-enabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-enabled.xml new file mode 100644 index 000000000..cddc4a675 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-enabled.xml @@ -0,0 +1,7 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x83ba2203' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000002' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x2c100800'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-W3520-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-W3520-disabled.xml new file mode 100644 index 000000000..49737fbdb --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-W3520-disabled.xml @@ -0,0 +1,5 @@ +<!-- Features disabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0004c1bc' edx='0xb0600000'/> + <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> +</cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-W3520-enabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-W3520-enabled.xml new file mode 100644 index 000000000..febef1edd --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-W3520-enabled.xml @@ -0,0 +1,7 @@ +<!-- Features enabled by QEMU --> +<cpudata arch='x86'> + <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x80b82201' edx='0x0f8bfbff'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000002' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000001' edx='0x28100800'/> +</cpudata> -- 2.12.0

Commit v3.1.0-26-gd60012b4e started filtering hle and rtm features from broken Intel Haswell CPUs. QEMU implemented similar functionality and thus it doesn't report rtm and hle features as enabled for Core i5-4670T CPU anymore. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml | 1 + tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml | 2 +- tests/cputestdata/x86_64-cpuid-Core-i5-4670T.json | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml index 601554a81..0c6b68a57 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-disabled.xml @@ -2,5 +2,6 @@ <cpudata arch='x86'> <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1dc' edx='0xb0600000'/> <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000810' ecx='0x00000000' edx='0x00000000'/> <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> </cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml index 8a714379c..31893c0b8 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-enabled.xml @@ -1,7 +1,7 @@ <!-- Features enabled by QEMU --> <cpudata arch='x86'> <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7fa3223' edx='0x0f8bfbff'/> - <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000fbb' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x000007ab' ecx='0x00000000' edx='0x00000000'/> <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> <cpuid eax_in='0x40000001' ecx_in='0x00' eax='0x010000fa' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000021' edx='0x2c100800'/> diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T.json b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T.json index bfcfcfd46..58b1d0369 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T.json +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T.json @@ -5,7 +5,7 @@ "props": { "pfthreshold": false, "pku": false, - "rtm": true, + "rtm": false, "tsc_adjust": true, "tsc-deadline": true, "xstore-en": false, @@ -69,7 +69,7 @@ "avx512-4vnniw": false, "xsave": true, "erms": true, - "hle": true, + "hle": false, "nodeid_msr": false, "est": false, "svm_lock": false, -- 2.12.0

All CPU features which QEMU does not know about but libvirt knows them (currently "cmt" is the only one) are implicitly disabled by QEMU and should be present in x86_64-cpuid-*-disabled.xml. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputestdata/cpu-cpuid.py | 1 + tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml | 1 + tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index 4b9b04ace..85c7c94b1 100755 --- a/tests/cputestdata/cpu-cpuid.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -79,6 +79,7 @@ cpuidMap = [ {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000200, "ecx": 0, "edx": 0, "names": ["erms"]}, {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000400, "ecx": 0, "edx": 0, "names": ["invpcid"]}, {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000800, "ecx": 0, "edx": 0, "names": ["rtm"]}, + {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00001000, "ecx": 0, "edx": 0, "names": []}, # cmt is unknown to QEMU {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00004000, "ecx": 0, "edx": 0, "names": ["mpx"]}, {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00010000, "ecx": 0, "edx": 0, "names": ["avx512f"]}, {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00020000, "ecx": 0, "edx": 0, "names": ["avx512dq"]}, diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml index ea2906506..e6f4ce761 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-disabled.xml @@ -2,5 +2,6 @@ <cpudata arch='x86'> <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1fc' edx='0xb0600000'/> <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000000' edx='0x00000000'/> <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> </cpudata> diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml index a66b5bdd6..9e25e6a94 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-disabled.xml @@ -2,7 +2,7 @@ <cpudata arch='x86'> <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1dc' edx='0xb0600000'/> <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> - <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000002' ecx='0x00000000' edx='0x00000000'/> + <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001002' ecx='0x00000000' edx='0x00000000'/> <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000001' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/> <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/> </cpudata> -- 2.12.0

The test takes x86-cpuid-Something-guest.xml CPU (the CPU libvirt would use for host-model on a CPU described by x86_64-cpuid-Something.xml without talking to QEMU about what it supports on the host) and updates it according to CPUID data from QEMU: x86_64-cpuid-Something-enabled.xml (reported as "feature-words" property of the CPU device) and x86_64-cpuid-Something-disabled.xml (reported as "filtered-features" property of the CPU device). The result is compared to x86_64-cpuid-Something-json.xml (the CPU libvirt would use as host-model based on the reply from query-cpu-model-expansion). The comparison is a bit tricky because the *-json.xml CPU contains fewer disabled features. Only the features which are included in the base CPU model, but listed as disabled in *.json will be disabled in *-json.xml. The CPU computed by virCPUUpdateLive from the test data will list all features present in the host's CPUID data and not enabled in *.json as disabled. The cpuTestUpdateLiveCompare function checks that the computed and expected sets of enabled features match. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) diff --git a/tests/cputest.c b/tests/cputest.c index 4a4d427e1..2c64c2cd0 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -523,6 +523,151 @@ cpuTestGuestCPUID(const void *arg) } +static int +cpuTestUpdateLiveCompare(virArch arch, + virCPUDefPtr actual, + virCPUDefPtr expected) +{ + size_t i, j; + int ret = 0; + + if (virCPUExpandFeatures(arch, actual) < 0 || + virCPUExpandFeatures(arch, expected) < 0) + return -1; + + if (STRNEQ(actual->model, expected->model)) { + VIR_TEST_VERBOSE("Actual CPU model '%s', expected '%s'\n", + actual->model, expected->model); + return -1; + } + + i = j = 0; + while (i < actual->nfeatures || j < expected->nfeatures) { + virCPUFeatureDefPtr featAct = NULL; + virCPUFeatureDefPtr featExp = NULL; + int cmp; + + if (i < actual->nfeatures) + featAct = actual->features + i; + + if (j < expected->nfeatures) + featExp = expected->features + j; + + /* + * Act < Exp => cmp < 0 (missing entry in Exp) + * Act = Exp => cmp = 0 + * Act > Exp => cmp > 0 (missing entry in Act) + * + * NULL > name for any name != NULL + */ + if (featAct && featExp) + cmp = strcmp(featAct->name, featExp->name); + else + cmp = featExp ? 1 : -1; + + if (cmp <= 0) + i++; + if (cmp >= 0) + j++; + + /* Possible combinations of cmp, featAct->policy, and featExp->policy: + * cmp Act Exp result + * --------------------------------- + * 0 dis dis ok + * 0 dis req missing + * 0 req dis extra + * 0 req req ok + * --------------------------------- + * - dis X ok # ignoring extra disabled features + * - req X extra + * --------------------------------- + * + X dis extra + * + X req missing + */ + if ((cmp == 0 && + featAct->policy == VIR_CPU_FEATURE_DISABLE && + featExp->policy == VIR_CPU_FEATURE_REQUIRE) || + (cmp > 0 && + featExp->policy == VIR_CPU_FEATURE_REQUIRE)) { + VIR_TEST_VERBOSE("Actual CPU lacks feature '%s'\n", + featExp->name); + ret = -1; + continue; + } + + if ((cmp == 0 && + featAct->policy == VIR_CPU_FEATURE_REQUIRE && + featExp->policy == VIR_CPU_FEATURE_DISABLE) || + (cmp < 0 && + featAct->policy == VIR_CPU_FEATURE_REQUIRE) || + (cmp > 0 && + featExp->policy == VIR_CPU_FEATURE_DISABLE)) { + VIR_TEST_VERBOSE("Actual CPU has extra feature '%s'\n", + featAct->name); + ret = -1; + } + } + + return ret; +} + + +static int +cpuTestUpdateLive(const void *arg) +{ + const struct data *data = arg; + char *cpuFile = NULL; + virCPUDefPtr cpu = NULL; + char *enabledFile = NULL; + char *enabled = NULL; + virCPUDataPtr enabledData = NULL; + char *disabledFile = NULL; + char *disabled = NULL; + virCPUDataPtr disabledData = NULL; + char *expectedFile = NULL; + virCPUDefPtr expected = NULL; + int ret = -1; + + if (virAsprintf(&cpuFile, "cpuid-%s-guest", data->host) < 0 || + !(cpu = cpuTestLoadXML(data->arch, cpuFile))) + goto cleanup; + + if (virAsprintf(&enabledFile, "%s/cputestdata/%s-cpuid-%s-enabled.xml", + abs_srcdir, virArchToString(data->arch), data->host) < 0 || + virTestLoadFile(enabledFile, &enabled) < 0 || + !(enabledData = virCPUDataParse(enabled))) + goto cleanup; + + if (virAsprintf(&disabledFile, "%s/cputestdata/%s-cpuid-%s-disabled.xml", + abs_srcdir, virArchToString(data->arch), data->host) < 0 || + virTestLoadFile(disabledFile, &disabled) < 0 || + !(disabledData = virCPUDataParse(disabled))) + goto cleanup; + + if (virCPUUpdateLive(data->arch, cpu, enabledData, disabledData) < 0) + goto cleanup; + + if (virAsprintf(&expectedFile, "cpuid-%s-json", data->host) < 0 || + !(expected = cpuTestLoadXML(data->arch, expectedFile))) + goto cleanup; + + ret = cpuTestUpdateLiveCompare(data->arch, cpu, expected); + + cleanup: + VIR_FREE(cpuFile); + virCPUDefFree(cpu); + VIR_FREE(enabledFile); + VIR_FREE(enabled); + virCPUDataFree(enabledData); + VIR_FREE(disabledFile); + VIR_FREE(disabled); + virCPUDataFree(disabledData); + VIR_FREE(expectedFile); + virCPUDefFree(expected); + return ret; +} + + #if WITH_QEMU && WITH_YAJL static int cpuTestJSONCPUID(const void *arg) @@ -697,6 +842,10 @@ mymain(void) DO_TEST(arch, cpuTestGuestCPUID, host, host, \ NULL, NULL, 0, 0, 0); \ DO_TEST_CPUID_JSON(arch, host, json); \ + if (json) { \ + DO_TEST(arch, cpuTestUpdateLive, host, host, \ + NULL, NULL, 0, 0, 0); \ + } \ } while (0) /* host to host comparison */ -- 2.12.0

On 03/17/2017 12:36 PM, Jiri Denemark wrote:
The test takes
x86-cpuid-Something-guest.xml CPU (the CPU libvirt would use for host-model on a CPU described by x86_64-cpuid-Something.xml without talking to QEMU about what it supports on the host)
and updates it according to CPUID data from QEMU:
x86_64-cpuid-Something-enabled.xml (reported as "feature-words" property of the CPU device)
and
x86_64-cpuid-Something-disabled.xml (reported as "filtered-features" property of the CPU device).
The result is compared to
x86_64-cpuid-Something-json.xml (the CPU libvirt would use as host-model based on the reply from query-cpu-model-expansion).
The comparison is a bit tricky because the *-json.xml CPU contains fewer disabled features. Only the features which are included in the base CPU model, but listed as disabled in *.json will be disabled in *-json.xml. The CPU computed by virCPUUpdateLive from the test data will list all features present in the host's CPUID data and not enabled in *.json as disabled. The cpuTestUpdateLiveCompare function checks that the computed and expected sets of enabled features match.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+)
diff --git a/tests/cputest.c b/tests/cputest.c index 4a4d427e1..2c64c2cd0 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -523,6 +523,151 @@ cpuTestGuestCPUID(const void *arg) }
+static int +cpuTestUpdateLiveCompare(virArch arch, + virCPUDefPtr actual, + virCPUDefPtr expected) +{ + size_t i, j; + int ret = 0; + + if (virCPUExpandFeatures(arch, actual) < 0 || + virCPUExpandFeatures(arch, expected) < 0) + return -1; + + if (STRNEQ(actual->model, expected->model)) { + VIR_TEST_VERBOSE("Actual CPU model '%s', expected '%s'\n", + actual->model, expected->model); + return -1; + } + + i = j = 0; + while (i < actual->nfeatures || j < expected->nfeatures) { + virCPUFeatureDefPtr featAct = NULL; + virCPUFeatureDefPtr featExp = NULL; + int cmp; + + if (i < actual->nfeatures) + featAct = actual->features + i; + + if (j < expected->nfeatures) + featExp = expected->features + j; + + /* + * Act < Exp => cmp < 0 (missing entry in Exp) + * Act = Exp => cmp = 0 + * Act > Exp => cmp > 0 (missing entry in Act) + * + * NULL > name for any name != NULL + */ + if (featAct && featExp) + cmp = strcmp(featAct->name, featExp->name); + else + cmp = featExp ? 1 : -1; + + if (cmp <= 0) + i++; + if (cmp >= 0) + j++; + + /* Possible combinations of cmp, featAct->policy, and featExp->policy: + * cmp Act Exp result + * --------------------------------- + * 0 dis dis ok + * 0 dis req missing + * 0 req dis extra + * 0 req req ok + * --------------------------------- + * - dis X ok # ignoring extra disabled features + * - req X extra + * --------------------------------- + * + X dis extra + * + X req missing + */ + if ((cmp == 0 && + featAct->policy == VIR_CPU_FEATURE_DISABLE && + featExp->policy == VIR_CPU_FEATURE_REQUIRE) || + (cmp > 0 && + featExp->policy == VIR_CPU_FEATURE_REQUIRE)) { + VIR_TEST_VERBOSE("Actual CPU lacks feature '%s'\n", + featExp->name); + ret = -1; + continue; + } + + if ((cmp == 0 && + featAct->policy == VIR_CPU_FEATURE_REQUIRE && + featExp->policy == VIR_CPU_FEATURE_DISABLE) || + (cmp < 0 && + featAct->policy == VIR_CPU_FEATURE_REQUIRE) || + (cmp > 0 && + featExp->policy == VIR_CPU_FEATURE_DISABLE)) { + VIR_TEST_VERBOSE("Actual CPU has extra feature '%s'\n", + featAct->name);
I know it's only a test, but this log message raised Coverity's attention because it's not sure featAct is NULL at this point if "cmp > 0". So that I can at least mask it my local tree - could featAct be NULL or should there be a different message if cmp > 0? Tks - John
+ ret = -1; + } + } + + return ret; +} + + +static int +cpuTestUpdateLive(const void *arg) +{ + const struct data *data = arg; + char *cpuFile = NULL; + virCPUDefPtr cpu = NULL; + char *enabledFile = NULL; + char *enabled = NULL; + virCPUDataPtr enabledData = NULL; + char *disabledFile = NULL; + char *disabled = NULL; + virCPUDataPtr disabledData = NULL; + char *expectedFile = NULL; + virCPUDefPtr expected = NULL; + int ret = -1; + + if (virAsprintf(&cpuFile, "cpuid-%s-guest", data->host) < 0 || + !(cpu = cpuTestLoadXML(data->arch, cpuFile))) + goto cleanup; + + if (virAsprintf(&enabledFile, "%s/cputestdata/%s-cpuid-%s-enabled.xml", + abs_srcdir, virArchToString(data->arch), data->host) < 0 || + virTestLoadFile(enabledFile, &enabled) < 0 || + !(enabledData = virCPUDataParse(enabled))) + goto cleanup; + + if (virAsprintf(&disabledFile, "%s/cputestdata/%s-cpuid-%s-disabled.xml", + abs_srcdir, virArchToString(data->arch), data->host) < 0 || + virTestLoadFile(disabledFile, &disabled) < 0 || + !(disabledData = virCPUDataParse(disabled))) + goto cleanup; + + if (virCPUUpdateLive(data->arch, cpu, enabledData, disabledData) < 0) + goto cleanup; + + if (virAsprintf(&expectedFile, "cpuid-%s-json", data->host) < 0 || + !(expected = cpuTestLoadXML(data->arch, expectedFile))) + goto cleanup; + + ret = cpuTestUpdateLiveCompare(data->arch, cpu, expected); + + cleanup: + VIR_FREE(cpuFile); + virCPUDefFree(cpu); + VIR_FREE(enabledFile); + VIR_FREE(enabled); + virCPUDataFree(enabledData); + VIR_FREE(disabledFile); + VIR_FREE(disabled); + virCPUDataFree(disabledData); + VIR_FREE(expectedFile); + virCPUDefFree(expected); + return ret; +} + + #if WITH_QEMU && WITH_YAJL static int cpuTestJSONCPUID(const void *arg) @@ -697,6 +842,10 @@ mymain(void) DO_TEST(arch, cpuTestGuestCPUID, host, host, \ NULL, NULL, 0, 0, 0); \ DO_TEST_CPUID_JSON(arch, host, json); \ + if (json) { \ + DO_TEST(arch, cpuTestUpdateLive, host, host, \ + NULL, NULL, 0, 0, 0); \ + } \ } while (0)
/* host to host comparison */

On Wed, Apr 05, 2017 at 07:37:34 -0400, John Ferlan wrote:
On 03/17/2017 12:36 PM, Jiri Denemark wrote:
The test takes
x86-cpuid-Something-guest.xml CPU (the CPU libvirt would use for host-model on a CPU described by x86_64-cpuid-Something.xml without talking to QEMU about what it supports on the host)
and updates it according to CPUID data from QEMU:
x86_64-cpuid-Something-enabled.xml (reported as "feature-words" property of the CPU device)
and
x86_64-cpuid-Something-disabled.xml (reported as "filtered-features" property of the CPU device).
The result is compared to
x86_64-cpuid-Something-json.xml (the CPU libvirt would use as host-model based on the reply from query-cpu-model-expansion).
The comparison is a bit tricky because the *-json.xml CPU contains fewer disabled features. Only the features which are included in the base CPU model, but listed as disabled in *.json will be disabled in *-json.xml. The CPU computed by virCPUUpdateLive from the test data will list all features present in the host's CPUID data and not enabled in *.json as disabled. The cpuTestUpdateLiveCompare function checks that the computed and expected sets of enabled features match.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputest.c | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+)
diff --git a/tests/cputest.c b/tests/cputest.c index 4a4d427e1..2c64c2cd0 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -523,6 +523,151 @@ cpuTestGuestCPUID(const void *arg) }
+static int +cpuTestUpdateLiveCompare(virArch arch, + virCPUDefPtr actual, + virCPUDefPtr expected) +{ + size_t i, j; + int ret = 0; + + if (virCPUExpandFeatures(arch, actual) < 0 || + virCPUExpandFeatures(arch, expected) < 0) + return -1; + + if (STRNEQ(actual->model, expected->model)) { + VIR_TEST_VERBOSE("Actual CPU model '%s', expected '%s'\n", + actual->model, expected->model); + return -1; + } + + i = j = 0; + while (i < actual->nfeatures || j < expected->nfeatures) { + virCPUFeatureDefPtr featAct = NULL; + virCPUFeatureDefPtr featExp = NULL; + int cmp; + + if (i < actual->nfeatures) + featAct = actual->features + i; + + if (j < expected->nfeatures) + featExp = expected->features + j; + + /* + * Act < Exp => cmp < 0 (missing entry in Exp) + * Act = Exp => cmp = 0 + * Act > Exp => cmp > 0 (missing entry in Act) + * + * NULL > name for any name != NULL + */ + if (featAct && featExp) + cmp = strcmp(featAct->name, featExp->name); + else + cmp = featExp ? 1 : -1; + + if (cmp <= 0) + i++; + if (cmp >= 0) + j++; + + /* Possible combinations of cmp, featAct->policy, and featExp->policy: + * cmp Act Exp result + * --------------------------------- + * 0 dis dis ok + * 0 dis req missing + * 0 req dis extra + * 0 req req ok + * --------------------------------- + * - dis X ok # ignoring extra disabled features + * - req X extra + * --------------------------------- + * + X dis extra + * + X req missing + */ + if ((cmp == 0 && + featAct->policy == VIR_CPU_FEATURE_DISABLE && + featExp->policy == VIR_CPU_FEATURE_REQUIRE) || + (cmp > 0 && + featExp->policy == VIR_CPU_FEATURE_REQUIRE)) { + VIR_TEST_VERBOSE("Actual CPU lacks feature '%s'\n", + featExp->name); + ret = -1; + continue; + } + + if ((cmp == 0 && + featAct->policy == VIR_CPU_FEATURE_REQUIRE && + featExp->policy == VIR_CPU_FEATURE_DISABLE) || + (cmp < 0 && + featAct->policy == VIR_CPU_FEATURE_REQUIRE) || + (cmp > 0 && + featExp->policy == VIR_CPU_FEATURE_DISABLE)) { + VIR_TEST_VERBOSE("Actual CPU has extra feature '%s'\n", + featAct->name);
I know it's only a test, but this log message raised Coverity's attention because it's not sure featAct is NULL at this point if "cmp > 0". So that I can at least mask it my local tree - could featAct be NULL or should there be a different message if cmp > 0?
Oops, featAct should be used only if cmp <= 0, otherwise it will either be NULL or irrelevant and featExp should be used instead. Jirka

On 03/17/2017 12:36 PM, Jiri Denemark wrote:
Jiri Denemark (14): cpu_conf: Introduce virCPUDefFreeFeatures cpu: Introduce virCPUExpandFeatures cpu: Drop unused flags from cpuArchDecode cpu: Move feature expansion out of cpuBaseline cpu: Do not pass virConnectBaselineCPUFlags to cpuBaseline cputest: Move instantiation of JSONDecoder in cpu-convert.py cputest: Rename cpu-convert.py script as cpu-cpuid.py cputest: Add cpuidIsSet helper to cpu-cpuid.py cputest: Add cpuidLeaf helper to cpu-cpuid.py cputest: Add "diff" command to cpu-cpuid.py cputest: Generate data for virCPUUpdateLive cputest: Disable TSX on broken models cputest: Disable "cmt" feature unknown to QEMU cputest: Add tests for virCPUUpdateLive API
Does one of these perhaps fix a segv in virCPUUpdateLive? With current tip of master, it's being called with cpu == NULL: Thread 5 "lt-libvirtd" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f89075bf700 (LWP 21908)] virCPUUpdateLive (arch=VIR_ARCH_X86_64, cpu=0x0, dataEnabled=dataEnabled@entry=0x7f88d00078e0, dataDisabled=0x7f88d0006430) at cpu/cpu.c:750 750 if (cpu->mode != VIR_CPU_MODE_CUSTOM) (gdb) where #0 virCPUUpdateLive (arch=VIR_ARCH_X86_64, cpu=0x0, dataEnabled=dataEnabled@entry=0x7f88d00078e0, dataDisabled=0x7f88d0006430) at cpu/cpu.c:750 #1 0x00007f88eb3646ff in qemuProcessUpdateLiveGuestCPU ( asyncJob=QEMU_ASYNC_JOB_START, vm=0x7f88e01e9480, driver=0x7f88e04e9450) at qemu/qemu_process.c:3876 #2 qemuProcessLaunch (conn=conn@entry=0x7f88d80027f0, driver=driver@entry=0x7f88e04e9450, vm=vm@entry=0x7f88e01e9480, asyncJob=asyncJob@entry=QEMU_ASYNC_JOB_START, incoming=incoming@entry=0x0, snapshot=snapshot@entry=0x0, vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=17) at qemu/qemu_process.c:5731 #3 0x00007f88eb364c66 in qemuProcessStart (conn=conn@entry=0x7f88d80027f0, driver=driver@entry=0x7f88e04e9450, vm=vm@entry=0x7f88e01e9480, asyncJob=asyncJob@entry=QEMU_ASYNC_JOB_START, migrateFrom=migrateFrom@entry=0x0, migrateFd=migrateFd@entry=-1, migratePath=0x0, snapshot=0x0, vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=17) at qemu/qemu_process.c:5927 #4 0x00007f88eb3bf9be in qemuDomainObjStart (conn=0x7f88d80027f0, driver=driver@entry=0x7f88e04e9450, vm=0x7f88e01e9480, flags=flags@entry=0, asyncJob=QEMU_ASYNC_JOB_START) at qemu/qemu_driver.c:6945 #5 0x00007f88eb3c00b6 in qemuDomainCreateWithFlags (dom=0x7f88d00009f0, flags=0) at qemu/qemu_driver.c:6999

On Sun, Mar 19, 2017 at 22:09:47 -0400, Laine Stump wrote:
On 03/17/2017 12:36 PM, Jiri Denemark wrote:
Jiri Denemark (14): cpu_conf: Introduce virCPUDefFreeFeatures cpu: Introduce virCPUExpandFeatures cpu: Drop unused flags from cpuArchDecode cpu: Move feature expansion out of cpuBaseline cpu: Do not pass virConnectBaselineCPUFlags to cpuBaseline cputest: Move instantiation of JSONDecoder in cpu-convert.py cputest: Rename cpu-convert.py script as cpu-cpuid.py cputest: Add cpuidIsSet helper to cpu-cpuid.py cputest: Add cpuidLeaf helper to cpu-cpuid.py cputest: Add "diff" command to cpu-cpuid.py cputest: Generate data for virCPUUpdateLive cputest: Disable TSX on broken models cputest: Disable "cmt" feature unknown to QEMU cputest: Add tests for virCPUUpdateLive API
Does one of these perhaps fix a segv in virCPUUpdateLive? With current tip of master, it's being called with cpu == NULL:
Oops, none of these patches fix the crash. It's a bug in the caller not in the virCPUUpdateLive itself. A patch is coming soon... Jirka

On Fri, Mar 17, 2017 at 05:36:38PM +0100, Jiri Denemark wrote:
Jiri Denemark (14): cpu_conf: Introduce virCPUDefFreeFeatures cpu: Introduce virCPUExpandFeatures cpu: Drop unused flags from cpuArchDecode cpu: Move feature expansion out of cpuBaseline cpu: Do not pass virConnectBaselineCPUFlags to cpuBaseline cputest: Move instantiation of JSONDecoder in cpu-convert.py cputest: Rename cpu-convert.py script as cpu-cpuid.py cputest: Add cpuidIsSet helper to cpu-cpuid.py cputest: Add cpuidLeaf helper to cpu-cpuid.py cputest: Add "diff" command to cpu-cpuid.py cputest: Generate data for virCPUUpdateLive cputest: Disable TSX on broken models cputest: Disable "cmt" feature unknown to QEMU cputest: Add tests for virCPUUpdateLive API
ACK series but see my comment for patch 10/14. Pavel

On Mon, Mar 27, 2017 at 16:11:17 +0200, Pavel Hrdina wrote:
On Fri, Mar 17, 2017 at 05:36:38PM +0100, Jiri Denemark wrote:
Jiri Denemark (14): cpu_conf: Introduce virCPUDefFreeFeatures cpu: Introduce virCPUExpandFeatures cpu: Drop unused flags from cpuArchDecode cpu: Move feature expansion out of cpuBaseline cpu: Do not pass virConnectBaselineCPUFlags to cpuBaseline cputest: Move instantiation of JSONDecoder in cpu-convert.py cputest: Rename cpu-convert.py script as cpu-cpuid.py cputest: Add cpuidIsSet helper to cpu-cpuid.py cputest: Add cpuidLeaf helper to cpu-cpuid.py cputest: Add "diff" command to cpu-cpuid.py cputest: Generate data for virCPUUpdateLive cputest: Disable TSX on broken models cputest: Disable "cmt" feature unknown to QEMU cputest: Add tests for virCPUUpdateLive API
ACK series but see my comment for patch 10/14.
OK, I modified 10/14 according to your suggestions, checked that the script generates identical files to those from 11/14, and pushed this series. (And broke syntax check in non VPATH.) Thanks Jirka
participants (4)
-
Jiri Denemark
-
John Ferlan
-
Laine Stump
-
Pavel Hrdina