From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918939093294.9646318083967; Fri, 13 Oct 2017 11:22:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D3C7C04AC5D; Fri, 13 Oct 2017 18:22:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F21924250; Fri, 13 Oct 2017 18:22:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AF92F4ED36; Fri, 13 Oct 2017 18:22:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF1gE014038 for ; Fri, 13 Oct 2017 14:15:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 29ED860BE3; Fri, 13 Oct 2017 18:15:01 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E61B753CD1 for ; Fri, 13 Oct 2017 18:14:57 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 09C491006C8; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1D3C7C04AC5D Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:33 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 01/22] util: Introduce virStringListCopy X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 13 Oct 2017 18:22:18 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The API makes a deep copy of a NULL-terminated string list. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change src/util/virstring.c | 37 +++++++++++++++++++++++++++++++++++++ src/util/virstring.h | 3 +++ 2 files changed, 40 insertions(+) diff --git a/src/util/virstring.c b/src/util/virstring.c index 0288d1e677..820b282ac5 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -239,6 +239,43 @@ virStringListRemove(char ***strings, } =20 =20 +/** + * virStringListCopy: + * @dst: where to store the copy of @strings + * @src: a NULL-terminated array of strings + * + * Makes a deep copy of the @src string list and stores it in @dst. Callers + * are responsible for freeing both @dst and @src. + * + * Returns 0 on success, -1 on error. + */ +int +virStringListCopy(char ***dst, + const char **src) +{ + char **copy =3D NULL; + size_t i; + + if (!src) + return 0; + + if (VIR_ALLOC_N(copy, virStringListLength(src) + 1) < 0) + goto error; + + for (i =3D 0; src[i]; i++) { + if (VIR_STRDUP(copy[i], src[i]) < 0) + goto error; + } + + *dst =3D copy; + return 0; + + error: + virStringListFree(copy); + return -1; +} + + /** * virStringListFree: * @str_array: a NULL-terminated array of strings to free diff --git a/src/util/virstring.h b/src/util/virstring.h index 1290fcce15..cfd91be314 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -46,6 +46,9 @@ char **virStringListAdd(const char **strings, void virStringListRemove(char ***strings, const char *item); =20 +int virStringListCopy(char ***dst, + const char **src); + void virStringListFree(char **strings); void virStringListFreeCount(char **strings, size_t count); --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918942668584.7068823592859; Fri, 13 Oct 2017 11:22:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 87F2C7EAA6; Fri, 13 Oct 2017 18:22:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6928018A70; Fri, 13 Oct 2017 18:22:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 25E863FA5F; Fri, 13 Oct 2017 18:22:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF1kK014044 for ; Fri, 13 Oct 2017 14:15:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5EE5460BE3; Fri, 13 Oct 2017 18:15:01 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E626B614EA for ; Fri, 13 Oct 2017 18:14:57 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 0D6991006CA; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 87F2C7EAA6 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:34 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 02/22] conf: Add usability blockers to virDomainCapsCPUModel X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 13 Oct 2017 18:22:22 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When a hypervisor marks a CPU model as unusable on the current host, it may also give us a list of features which prevent the model from being usable. Storing this list in virDomainCapsCPUModel will help the CPU driver with creating a host-model CPU configuration. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change src/conf/domain_capabilities.c | 30 ++++++++++++++++++++++-------- src/conf/domain_capabilities.h | 7 +++++-- src/qemu/qemu_capabilities.c | 11 ++++++----- tests/domaincapstest.c | 6 +++--- 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index f62038b96c..be34576204 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -163,7 +163,8 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr ol= d) for (i =3D 0; i < old->nmodels; i++) { if (virDomainCapsCPUModelsAdd(cpuModels, old->models[i].name, -1, - old->models[i].usable) < 0) + old->models[i].usable, + old->models[i].blockers) < 0) goto error; } =20 @@ -195,7 +196,8 @@ virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr = old, =20 if (virDomainCapsCPUModelsAdd(cpuModels, old->models[i].name, -1, - old->models[i].usable) < 0) + old->models[i].usable, + old->models[i].blockers) < 0) goto error; } =20 @@ -210,7 +212,8 @@ virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr = old, int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, char **name, - virDomainCapsCPUUsable usable) + virDomainCapsCPUUsable usable, + char ***blockers) { if (VIR_RESIZE_N(cpuModels->models, cpuModels->nmodels_max, cpuModels->nmodels, 1) < 0) @@ -218,6 +221,10 @@ virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsP= tr cpuModels, =20 cpuModels->models[cpuModels->nmodels].usable =3D usable; VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].name, *name); + + if (blockers) + VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].blockers, *blo= ckers); + cpuModels->nmodels++; return 0; } @@ -227,20 +234,27 @@ int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, ssize_t nameLen, - virDomainCapsCPUUsable usable) + virDomainCapsCPUUsable usable, + char **blockers) { - char *copy =3D NULL; + char *nameCopy =3D NULL; + char **blockersCopy =3D NULL; =20 - if (VIR_STRNDUP(copy, name, nameLen) < 0) + if (VIR_STRNDUP(nameCopy, name, nameLen) < 0) goto error; =20 - if (virDomainCapsCPUModelsAddSteal(cpuModels, ©, usable) < 0) + if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0) + goto error; + + if (virDomainCapsCPUModelsAddSteal(cpuModels, &nameCopy, + usable, &blockersCopy) < 0) goto error; =20 return 0; =20 error: - VIR_FREE(copy); + VIR_FREE(nameCopy); + virStringListFree(blockersCopy); return -1; } =20 diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 82183c4524..8c71dec21e 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -116,6 +116,7 @@ typedef virDomainCapsCPUModel *virDomainCapsCPUModelPtr; struct _virDomainCapsCPUModel { char *name; virDomainCapsCPUUsable usable; + char **blockers; /* NULL-terminated list of usability blockers */ }; =20 typedef struct _virDomainCapsCPUModels virDomainCapsCPUModels; @@ -171,11 +172,13 @@ virDomainCapsCPUModelsPtr virDomainCapsCPUModelsFilte= r(virDomainCapsCPUModelsPtr const char **blackl= ist); int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, char **name, - virDomainCapsCPUUsable usable); + virDomainCapsCPUUsable usable, + char ***blockers); int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, ssize_t nameLen, - virDomainCapsCPUUsable usable); + virDomainCapsCPUUsable usable, + char **blockers); =20 # define VIR_DOMAIN_CAPS_ENUM_SET(capsEnum, ...) \ do { \ diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f9028157f1..7f4d019e9b 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -796,7 +796,7 @@ virQEMUCapsParseX86Models(const char *output, } =20 if (virDomainCapsCPUModelsAdd(cpus, p, len, - VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0) + VIR_DOMCAPS_CPU_USABLE_UNKNOWN, NULL= ) < 0) goto error; } while ((p =3D next)); =20 @@ -854,7 +854,7 @@ virQEMUCapsParsePPCModels(const char *output, continue; =20 if (virDomainCapsCPUModelsAdd(cpus, p, t - p - 1, - VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0) + VIR_DOMCAPS_CPU_USABLE_UNKNOWN, NULL= ) < 0) goto error; } while ((p =3D next)); =20 @@ -2526,7 +2526,7 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, } =20 for (i =3D 0; i < count; i++) { - if (virDomainCapsCPUModelsAdd(cpus, name[i], -1, usable) < 0) + if (virDomainCapsCPUModelsAdd(cpus, name[i], -1, usable, NULL) < 0) return -1; } =20 @@ -3007,7 +3007,8 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemu= Caps, else if (cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_NO) usable =3D VIR_DOMCAPS_CPU_USABLE_NO; =20 - if (virDomainCapsCPUModelsAddSteal(models, &cpus[i]->name, usable)= < 0) + if (virDomainCapsCPUModelsAddSteal(models, &cpus[i]->name, usable, + NULL) < 0) goto cleanup; } =20 @@ -3770,7 +3771,7 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, goto cleanup; } =20 - if (virDomainCapsCPUModelsAddSteal(cpus, &str, usable) < 0) + if (virDomainCapsCPUModelsAddSteal(cpus, &str, usable, NULL) < 0) goto cleanup; } =20 diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 2719473244..7aeac4507f 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -88,11 +88,11 @@ fillAllCaps(virDomainCapsPtr domCaps) cpu->hostModel =3D virCPUDefCopy(&host); if (!(cpu->custom =3D virDomainCapsCPUModelsNew(3)) || virDomainCapsCPUModelsAdd(cpu->custom, "Model1", -1, - VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0 || + VIR_DOMCAPS_CPU_USABLE_UNKNOWN, NULL) < = 0 || virDomainCapsCPUModelsAdd(cpu->custom, "Model2", -1, - VIR_DOMCAPS_CPU_USABLE_NO) < 0 || + VIR_DOMCAPS_CPU_USABLE_NO, NULL) < 0 || virDomainCapsCPUModelsAdd(cpu->custom, "Model3", -1, - VIR_DOMCAPS_CPU_USABLE_YES) < 0) + VIR_DOMCAPS_CPU_USABLE_YES, NULL) < 0) return -1; =20 disk->supported =3D true; --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507920409795132.95917025685412; Fri, 13 Oct 2017 11:46:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C1B3820F0; Fri, 13 Oct 2017 18:46:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7930A612A2; Fri, 13 Oct 2017 18:46:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 19689410B4; Fri, 13 Oct 2017 18:46:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF0mO014027 for ; Fri, 13 Oct 2017 14:15:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 84A155C543; Fri, 13 Oct 2017 18:15:00 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DBBF05C88B for ; Fri, 13 Oct 2017 18:14:57 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 124F41006D0; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9C1B3820F0 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:35 +0200 Message-Id: <2cc47e64c4e10f4efd4454de1215429edf41fff7.1507918307.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 03/22] qemu: Store CPU usability blockers in caps cache X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 13 Oct 2017 18:46:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - modified error message src/qemu/qemu_capabilities.c | 51 ++++++++++++++++++++++++++++++++++++++++= ++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 7f4d019e9b..507c7651a1 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3729,6 +3729,10 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, size_t i; int n; int ret =3D -1; + xmlNodePtr node; + xmlNodePtr *blockerNodes =3D NULL; + char **blockers =3D NULL; + int nblockers; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) n =3D virXPathNodeSet("./cpu[@type=3D'kvm']", ctxt, &nodes); @@ -3771,7 +3775,34 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, goto cleanup; } =20 - if (virDomainCapsCPUModelsAddSteal(cpus, &str, usable, NULL) < 0) + node =3D ctxt->node; + ctxt->node =3D nodes[i]; + nblockers =3D virXPathNodeSet("./blocker", ctxt, &blockerNodes); + ctxt->node =3D node; + + if (nblockers < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("failed to parse CPU blockers in QEMU capabil= ities")); + goto cleanup; + } + + if (nblockers > 0) { + size_t j; + + if (VIR_ALLOC_N(blockers, nblockers + 1) < 0) + goto cleanup; + + for (j =3D 0; j < nblockers; j++) { + if (!(blockers[j] =3D virXMLPropString(blockerNodes[j], "n= ame"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing blocker name in QEMU " + "capabilities cache")); + goto cleanup; + } + } + } + + if (virDomainCapsCPUModelsAddSteal(cpus, &str, usable, &blockers) = < 0) goto cleanup; } =20 @@ -3780,6 +3811,8 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, cleanup: VIR_FREE(nodes); VIR_FREE(str); + VIR_FREE(blockerNodes); + virStringListFree(blockers); return ret; } =20 @@ -4137,7 +4170,21 @@ virQEMUCapsFormatCPUModels(virQEMUCapsPtr qemuCaps, virBufferAsprintf(buf, " usable=3D'%s'", virDomainCapsCPUUsableTypeToString(cpu->usab= le)); } - virBufferAddLit(buf, "/>\n"); + + if (cpu->blockers) { + size_t j; + + virBufferAddLit(buf, ">\n"); + virBufferAdjustIndent(buf, 2); + + for (j =3D 0; cpu->blockers[j]; j++) + virBufferAsprintf(buf, "\n", cpu->bl= ockers[j]); + + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + } else { + virBufferAddLit(buf, "/>\n"); + } } } =20 --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918967814376.46796768201295; Fri, 13 Oct 2017 11:22:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C8192C975D; Fri, 13 Oct 2017 18:22:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 722E75D75A; Fri, 13 Oct 2017 18:22:46 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 30DD93FC71; Fri, 13 Oct 2017 18:22:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF1ip014049 for ; Fri, 13 Oct 2017 14:15:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6CDC05D6A6; Fri, 13 Oct 2017 18:15:01 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14AEF5D6A4 for ; Fri, 13 Oct 2017 18:14:57 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 168CB1006CF; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9C8192C975D Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:36 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 04/22] qemu: Parse unavailable features for CPU models X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 13 Oct 2017 18:22:47 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" query-cpu-definitions QMP command returns a list of unavailable features which prevent CPU models from being usable on the current host. So far we only checked whether the list was empty to mark CPU models as (un)usable. This patch parses all unavailable features for each CPU model and stores them in virDomainCapsCPUModel as a list of usability blockers. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - simplified parsing of CPU usability blockers in qemuMonitorJSONGetCPUDefinitions src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_monitor.c | 2 + src/qemu/qemu_monitor.h | 1 + src/qemu/qemu_monitor_json.c | 28 +- tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 1102 +++++++++++++++++= ++-- tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 236 ++++- tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 154 ++- tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 154 ++- 8 files changed, 1556 insertions(+), 123 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 507c7651a1..5b532b247c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3008,7 +3008,7 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemu= Caps, usable =3D VIR_DOMCAPS_CPU_USABLE_NO; =20 if (virDomainCapsCPUModelsAddSteal(models, &cpus[i]->name, usable, - NULL) < 0) + &cpus[i]->blockers) < 0) goto cleanup; } =20 diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 7a26785878..aac318f787 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3736,6 +3736,8 @@ qemuMonitorCPUDefInfoFree(qemuMonitorCPUDefInfoPtr cp= u) { if (!cpu) return; + + virStringListFree(cpu->blockers); VIR_FREE(cpu->name); VIR_FREE(cpu); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 1647b46972..40d90d0da6 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -973,6 +973,7 @@ typedef qemuMonitorCPUDefInfo *qemuMonitorCPUDefInfoPtr; struct _qemuMonitorCPUDefInfo { virTristateBool usable; char *name; + char **blockers; /* NULL-terminated string list */ }; =20 int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e591e85073..5546d1aa1f 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5078,6 +5078,8 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, =20 if (virJSONValueObjectHasKey(child, "unavailable-features")) { virJSONValuePtr blockers; + size_t j; + int len; =20 blockers =3D virJSONValueObjectGetArray(child, "unavailable-features"); @@ -5088,10 +5090,30 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, goto cleanup; } =20 - if (virJSONValueArraySize(blockers) > 0) - cpu->usable =3D VIR_TRISTATE_BOOL_NO; - else + len =3D virJSONValueArraySize(blockers); + + if (len =3D=3D 0) { cpu->usable =3D VIR_TRISTATE_BOOL_YES; + continue; + } + + cpu->usable =3D VIR_TRISTATE_BOOL_NO; + if (VIR_ALLOC_N(cpu->blockers, len + 1) < 0) + goto cleanup; + + for (j =3D 0; j < len; j++) { + virJSONValuePtr blocker =3D virJSONValueArrayGet(blockers,= j); + + if (blocker->type !=3D VIR_JSON_TYPE_STRING) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unexpected value in unavailable-feat= ures " + "array")); + goto cleanup; + } + + if (VIR_STRDUP(cpu->blockers[j], virJSONValueGetString(blo= cker)) < 0) + goto cleanup; + } } } =20 diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemuc= apabilitiesdata/caps_2.10.0.s390x.xml index 2546ebdd9d..7e44652feb 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml @@ -242,72 +242,1050 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.10.0.x86_64.xml index 10a182e185..ddbd8c32fa 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml @@ -701,7 +701,14 @@ - + + + + + + + + @@ -710,31 +717,104 @@ - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - + + + + - - + + + + + + + + + + + + + + - + + + - + + + + @@ -745,22 +825,132 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.8.0.x86_64.xml index 88029c04dd..3165b2dee3 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml @@ -217,7 +217,14 @@ - + + + + + + + + @@ -226,14 +233,32 @@ - + + + + + - - - + + + + + + + + + + + + + + + + + @@ -244,10 +269,15 @@ - + + + - + + + + @@ -258,21 +288,111 @@ - - + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.9.0.x86_64.xml index e3ff127270..05f9dc0308 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -694,7 +694,14 @@ - + + + + + + + + @@ -703,14 +710,32 @@ - + + + + + - - - + + + + + + + + + + + + + + + + + @@ -722,11 +747,16 @@ - + + + - + + + + @@ -737,21 +767,111 @@ - - + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15079204246941021.6431034019247; Fri, 13 Oct 2017 11:47:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 81893C04B93A; Fri, 13 Oct 2017 18:47:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E1741814C; Fri, 13 Oct 2017 18:47:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1CF0B18355C1; Fri, 13 Oct 2017 18:47:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF73D014169 for ; Fri, 13 Oct 2017 14:15:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id C128660176; Fri, 13 Oct 2017 18:15:07 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CE526047F for ; Fri, 13 Oct 2017 18:15:02 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 190021006E4; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 81893C04B93A Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:37 +0200 Message-Id: <8bcfef61304aa8806354badeac733f1d7ac20bb0.1507918307.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 05/22] cpu: Use virDomainCapsCPUModelsPtr in cpu driver APIs X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 13 Oct 2017 18:47:04 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" All APIs which expect a list of CPU models supported by hypervisors were switched from char **models and int models to just accept a pointer to virDomainCapsCPUModels object stored in domain capabilities. This avoids the need to transform virDomainCapsCPUModelsPtr into a NULL-terminated list of model names and also allows the various cpu driver APIs to access additional details (such as its usability) about each CPU model. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - updated debug message - dropped unreachable return statement src/cpu/cpu.c | 78 +++++++++++++----------------------- src/cpu/cpu.h | 28 +++++-------- src/cpu/cpu_arm.c | 3 +- src/cpu/cpu_ppc64.c | 13 +++--- src/cpu/cpu_x86.c | 25 +++++------- src/libxl/libxl_capabilities.c | 2 +- src/libxl/libxl_driver.c | 2 +- src/qemu/qemu_capabilities.c | 63 +++++------------------------- src/qemu/qemu_capabilities.h | 6 +-- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_process.c | 9 +---- src/test/test_driver.c | 2 +- tests/cputest.c | 89 ++++++++++++++++++++++++++++++--------= ---- 13 files changed, 137 insertions(+), 185 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index dc72ed42d8..42b836354d 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -192,7 +192,6 @@ virCPUCompare(virArch arch, * @cpu: CPU definition stub to be filled in * @data: internal CPU data to be decoded into @cpu definition * @models: list of CPU models that can be considered when decoding @data - * @nmodels: number of CPU models in @models * @preferred: CPU models that should be used if possible * * Decodes internal CPU data into a CPU definition consisting of a CPU mod= el @@ -214,24 +213,17 @@ virCPUCompare(virArch arch, int cpuDecode(virCPUDefPtr cpu, const virCPUData *data, - const char **models, - unsigned int nmodels, + virDomainCapsCPUModelsPtr models, const char *preferred) { struct cpuArchDriver *driver; =20 - VIR_DEBUG("cpu=3D%p, data=3D%p, nmodels=3D%u, preferred=3D%s", - cpu, data, nmodels, NULLSTR(preferred)); + VIR_DEBUG("cpu=3D%p, data=3D%p, models=3D%p, preferred=3D%s", + cpu, data, models, NULLSTR(preferred)); if (models) { size_t i; - for (i =3D 0; i < nmodels; i++) - VIR_DEBUG("models[%zu]=3D%s", i, NULLSTR(models[i])); - } - - if (models =3D=3D NULL && nmodels !=3D 0) { - virReportError(VIR_ERR_INVALID_ARG, "%s", - _("nonzero nmodels doesn't match with NULL models")= ); - return -1; + for (i =3D 0; i < models->nmodels; i++) + VIR_DEBUG("models[%zu]=3D%s", i, models->models[i].name); } =20 if (cpu->type > VIR_CPU_TYPE_GUEST || @@ -251,7 +243,7 @@ cpuDecode(virCPUDefPtr cpu, return -1; } =20 - return driver->decode(cpu, data, models, nmodels, preferred); + return driver->decode(cpu, data, models, preferred); } =20 =20 @@ -384,7 +376,6 @@ virCPUGetHostIsSupported(virArch arch) * @type: requested type of the CPU * @nodeInfo: simplified CPU topology (optional) * @models: list of CPU models that can be considered for host CPU - * @nmodels: number of CPU models in @models * * Create CPU definition describing the host's CPU. * @@ -412,15 +403,14 @@ virCPUDefPtr virCPUGetHost(virArch arch, virCPUType type, virNodeInfoPtr nodeInfo, - const char **models, - unsigned int nmodels) + virDomainCapsCPUModelsPtr models) { struct cpuArchDriver *driver; virCPUDefPtr cpu =3D NULL; =20 - VIR_DEBUG("arch=3D%s, type=3D%s, nodeInfo=3D%p, models=3D%p, nmodels= =3D%u", + VIR_DEBUG("arch=3D%s, type=3D%s, nodeInfo=3D%p, models=3D%p", virArchToString(arch), virCPUTypeToString(type), nodeInfo, - models, nmodels); + models); =20 if (!(driver =3D cpuGetSubDriver(arch))) return NULL; @@ -462,7 +452,7 @@ virCPUGetHost(virArch arch, * filled in. */ if (driver->getHost) { - if (driver->getHost(cpu, models, nmodels) < 0 && + if (driver->getHost(cpu, models) < 0 && !nodeInfo) goto error; } else if (nodeInfo) { @@ -491,7 +481,7 @@ virCPUProbeHost(virArch arch) if (virCapabilitiesGetNodeInfo(&nodeinfo)) return NULL; =20 - return virCPUGetHost(arch, VIR_CPU_TYPE_HOST, &nodeinfo, NULL, 0); + return virCPUGetHost(arch, VIR_CPU_TYPE_HOST, &nodeinfo, NULL); } =20 =20 @@ -501,11 +491,10 @@ virCPUProbeHost(virArch arch) * @cpus: list of host CPU definitions * @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 * @migratable: requests non-migratable features to be removed from the re= sult * * Computes the most feature-rich CPU which is compatible with all given - * host CPUs. If @models array is NULL, all models supported by libvirt wi= ll + * host CPUs. If @models is NULL, all models supported by libvirt will * be considered when computing the baseline CPU model, otherwise the base= line * CPU model will be one of the provided CPU @models. * @@ -514,21 +503,20 @@ virCPUProbeHost(virArch arch) virCPUDefPtr cpuBaseline(virCPUDefPtr *cpus, unsigned int ncpus, - const char **models, - unsigned int nmodels, + virDomainCapsCPUModelsPtr models, bool migratable) { struct cpuArchDriver *driver; size_t i; =20 - VIR_DEBUG("ncpus=3D%u, nmodels=3D%u", ncpus, nmodels); + VIR_DEBUG("ncpus=3D%u, models=3D%p, migratable=3D%d", ncpus, models, m= igratable); if (cpus) { for (i =3D 0; i < ncpus; i++) VIR_DEBUG("cpus[%zu]=3D%p", i, cpus[i]); } if (models) { - for (i =3D 0; i < nmodels; i++) - VIR_DEBUG("models[%zu]=3D%s", i, NULLSTR(models[i])); + for (i =3D 0; i < models->nmodels; i++) + VIR_DEBUG("models[%zu]=3D%s", i, models->models[i].name); } =20 if (cpus =3D=3D NULL && ncpus !=3D 0) { @@ -555,12 +543,6 @@ cpuBaseline(virCPUDefPtr *cpus, } } =20 - if (models =3D=3D NULL && nmodels !=3D 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("nonzero nmodels doesn't match with NULL mo= dels")); - return NULL; - } - if ((driver =3D cpuGetSubDriver(cpus[0]->arch)) =3D=3D NULL) return NULL; =20 @@ -571,7 +553,7 @@ cpuBaseline(virCPUDefPtr *cpus, return NULL; } =20 - return driver->baseline(cpus, ncpus, models, nmodels, migratable); + return driver->baseline(cpus, ncpus, models, migratable); } =20 =20 @@ -844,25 +826,23 @@ virCPUDataParse(const char *xmlStr) * * @model: CPU model to be checked * @models: list of supported CPU models - * @nmodels: number of models in @models * * Checks whether @model can be found in the list of supported @models. - * If @models is empty, all models are supported. + * If @models is NULL, all models are supported. * * Returns true if @model is supported, false otherwise. */ bool virCPUModelIsAllowed(const char *model, - const char **models, - unsigned int nmodels) + virDomainCapsCPUModelsPtr models) { size_t i; =20 - if (!models || !nmodels) + if (!models) return true; =20 - for (i =3D 0; i < nmodels; i++) { - if (models[i] && STREQ(models[i], model)) + for (i =3D 0; i < models->nmodels; i++) { + if (STREQ(models->models[i].name, model)) return true; } return false; @@ -908,8 +888,7 @@ virCPUGetModels(virArch arch, char ***models) * * @arch: CPU architecture * @cpu: CPU definition to be translated - * @models: NULL-terminated list of allowed CPU models (NULL if all are al= lowed) - * @nmodels: number of CPU models in @models + * @models: list of allowed CPU models (NULL if all are allowed) * * Translates @cpu model (if allowed by @cpu->fallback) to a closest CPU m= odel * from @models list. @@ -922,13 +901,12 @@ virCPUGetModels(virArch arch, char ***models) int virCPUTranslate(virArch arch, virCPUDefPtr cpu, - const char **models, - unsigned int nmodels) + virDomainCapsCPUModelsPtr models) { struct cpuArchDriver *driver; =20 - VIR_DEBUG("arch=3D%s, cpu=3D%p, model=3D%s, models=3D%p, nmodels=3D%u", - virArchToString(arch), cpu, NULLSTR(cpu->model), models, nmo= dels); + VIR_DEBUG("arch=3D%s, cpu=3D%p, model=3D%s, models=3D%p", + virArchToString(arch), cpu, NULLSTR(cpu->model), models); =20 if (!(driver =3D cpuGetSubDriver(arch))) return -1; @@ -937,7 +915,7 @@ virCPUTranslate(virArch arch, cpu->mode =3D=3D VIR_CPU_MODE_HOST_PASSTHROUGH) return 0; =20 - if (virCPUModelIsAllowed(cpu->model, models, nmodels)) + if (virCPUModelIsAllowed(cpu->model, models)) return 0; =20 if (cpu->fallback !=3D VIR_CPU_FALLBACK_ALLOW) { @@ -954,7 +932,7 @@ virCPUTranslate(virArch arch, return -1; } =20 - if (driver->translate(cpu, models, nmodels) < 0) + if (driver->translate(cpu, models) < 0) return -1; =20 VIR_DEBUG("model=3D%s", NULLSTR(cpu->model)); diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 5daff186c4..d325fe3d04 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -27,6 +27,7 @@ # include "virerror.h" # include "datatypes.h" # include "virarch.h" +# include "domain_capabilities.h" # include "cpu_conf.h" # include "cpu_x86_data.h" # include "cpu_ppc64_data.h" @@ -52,8 +53,7 @@ typedef virCPUCompareResult typedef int (*cpuArchDecode) (virCPUDefPtr cpu, const virCPUData *data, - const char **models, - unsigned int nmodels, + virDomainCapsCPUModelsPtr models, const char *preferred); =20 typedef int @@ -71,14 +71,12 @@ typedef void =20 typedef int (*virCPUArchGetHost)(virCPUDefPtr cpu, - const char **models, - unsigned int nmodels); + virDomainCapsCPUModelsPtr models); =20 typedef virCPUDefPtr (*cpuArchBaseline) (virCPUDefPtr *cpus, unsigned int ncpus, - const char **models, - unsigned int nmodels, + virDomainCapsCPUModelsPtr models, bool migratable); =20 typedef int @@ -109,8 +107,7 @@ typedef int =20 typedef int (*virCPUArchTranslate)(virCPUDefPtr cpu, - const char **models, - unsigned int nmodels); + virDomainCapsCPUModelsPtr models); =20 typedef int (*virCPUArchConvertLegacy)(virCPUDefPtr cpu); @@ -165,8 +162,7 @@ virCPUCompare(virArch arch, int cpuDecode (virCPUDefPtr cpu, const virCPUData *data, - const char **models, - unsigned int nmodels, + virDomainCapsCPUModelsPtr models, const char *preferred) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); =20 @@ -194,8 +190,7 @@ virCPUDefPtr virCPUGetHost(virArch arch, virCPUType type, virNodeInfoPtr nodeInfo, - const char **models, - unsigned int nmodels); + virDomainCapsCPUModelsPtr models); =20 virCPUDefPtr virCPUProbeHost(virArch arch); @@ -203,8 +198,7 @@ virCPUProbeHost(virArch arch); virCPUDefPtr cpuBaseline (virCPUDefPtr *cpus, unsigned int ncpus, - const char **models, - unsigned int nmodels, + virDomainCapsCPUModelsPtr models, bool migratable); =20 int @@ -235,8 +229,7 @@ virCPUDataCheckFeature(const virCPUData *data, =20 bool virCPUModelIsAllowed(const char *model, - const char **models, - unsigned int nmodels) + virDomainCapsCPUModelsPtr models) ATTRIBUTE_NONNULL(1); =20 int @@ -245,8 +238,7 @@ virCPUGetModels(virArch arch, char ***models); int virCPUTranslate(virArch arch, virCPUDefPtr cpu, - const char **models, - unsigned int nmodels) + virDomainCapsCPUModelsPtr models) ATTRIBUTE_NONNULL(2); =20 int diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index 474777656c..44cb4fea68 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -75,8 +75,7 @@ virCPUarmUpdate(virCPUDefPtr guest, static virCPUDefPtr armBaseline(virCPUDefPtr *cpus, unsigned int ncpus ATTRIBUTE_UNUSED, - const char **models ATTRIBUTE_UNUSED, - unsigned int nmodels ATTRIBUTE_UNUSED, + virDomainCapsCPUModelsPtr models ATTRIBUTE_UNUSED, bool migratable ATTRIBUTE_UNUSED) { virCPUDefPtr cpu =3D NULL; diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 5c5fc0fec6..902c465cf4 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -669,8 +669,7 @@ virCPUppc64Compare(virCPUDefPtr host, static int ppc64DriverDecode(virCPUDefPtr cpu, const virCPUData *data, - const char **models, - unsigned int nmodels, + virDomainCapsCPUModelsPtr models, const char *preferred ATTRIBUTE_UNUSED) { int ret =3D -1; @@ -687,7 +686,7 @@ ppc64DriverDecode(virCPUDefPtr cpu, goto cleanup; } =20 - if (!virCPUModelIsAllowed(model->name, models, nmodels)) { + if (!virCPUModelIsAllowed(model->name, models)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("CPU model %s is not supported by hypervisor"), model->name); @@ -720,8 +719,7 @@ virCPUppc64DataFree(virCPUDataPtr data) =20 static int virCPUppc64GetHost(virCPUDefPtr cpu, - const char **models, - unsigned int nmodels) + virDomainCapsCPUModelsPtr models) { virCPUDataPtr cpuData =3D NULL; virCPUppc64Data *data; @@ -743,7 +741,7 @@ virCPUppc64GetHost(virCPUDefPtr cpu, #endif data->pvr[0].mask =3D 0xfffffffful; =20 - ret =3D ppc64DriverDecode(cpu, cpuData, models, nmodels, NULL); + ret =3D ppc64DriverDecode(cpu, cpuData, models, NULL); =20 cleanup: virCPUppc64DataFree(cpuData); @@ -772,8 +770,7 @@ virCPUppc64Update(virCPUDefPtr guest, static virCPUDefPtr ppc64DriverBaseline(virCPUDefPtr *cpus, unsigned int ncpus, - const char **models ATTRIBUTE_UNUSED, - unsigned int nmodels ATTRIBUTE_UNUSED, + virDomainCapsCPUModelsPtr models ATTRIBUTE_UNUSED, bool migratable ATTRIBUTE_UNUSED) { struct ppc64_map *map; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 5ce205f9c1..3f9e83ca72 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1820,8 +1820,7 @@ x86DataFilterTSX(virCPUx86Data *data, static int x86Decode(virCPUDefPtr cpu, const virCPUx86Data *cpuData, - const char **models, - unsigned int nmodels, + virDomainCapsCPUModelsPtr models, const char *preferred, bool migratable) { @@ -1855,7 +1854,7 @@ x86Decode(virCPUDefPtr cpu, */ for (i =3D map->nmodels - 1; i >=3D 0; i--) { candidate =3D map->models[i]; - if (!virCPUModelIsAllowed(candidate->name, models, nmodels)) { + if (!virCPUModelIsAllowed(candidate->name, models)) { if (preferred && STREQ(candidate->name, preferred)) { if (cpu->fallback !=3D VIR_CPU_FALLBACK_ALLOW) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -1946,11 +1945,10 @@ x86Decode(virCPUDefPtr cpu, static int x86DecodeCPUData(virCPUDefPtr cpu, const virCPUData *data, - const char **models, - unsigned int nmodels, + virDomainCapsCPUModelsPtr models, const char *preferred) { - return x86Decode(cpu, &data->data.x86, models, nmodels, preferred, fal= se); + return x86Decode(cpu, &data->data.x86, models, preferred, false); } =20 =20 @@ -2402,8 +2400,7 @@ cpuidSet(uint32_t base, virCPUDataPtr data) =20 static int virCPUx86GetHost(virCPUDefPtr cpu, - const char **models, - unsigned int nmodels) + virDomainCapsCPUModelsPtr models) { virCPUDataPtr cpuData =3D NULL; int ret =3D -1; @@ -2415,7 +2412,7 @@ virCPUx86GetHost(virCPUDefPtr cpu, cpuidSet(CPUX86_EXTENDED, cpuData) < 0) goto cleanup; =20 - ret =3D x86DecodeCPUData(cpu, cpuData, models, nmodels, NULL); + ret =3D x86DecodeCPUData(cpu, cpuData, models, NULL); =20 cleanup: virCPUx86DataFree(cpuData); @@ -2427,8 +2424,7 @@ virCPUx86GetHost(virCPUDefPtr cpu, static virCPUDefPtr x86Baseline(virCPUDefPtr *cpus, unsigned int ncpus, - const char **models, - unsigned int nmodels, + virDomainCapsCPUModelsPtr models, bool migratable) { virCPUx86MapPtr map =3D NULL; @@ -2523,7 +2519,7 @@ x86Baseline(virCPUDefPtr *cpus, virCPUx86DataAddCPUIDInt(&base_model->data, &vendor->cpuid) < 0) goto error; =20 - if (x86Decode(cpu, &base_model->data, models, nmodels, modelName, migr= atable) < 0) + if (x86Decode(cpu, &base_model->data, models, modelName, migratable) <= 0) goto error; =20 if (STREQ_NULLABLE(cpu->model, modelName)) @@ -2805,8 +2801,7 @@ virCPUx86GetModels(char ***models) =20 static int virCPUx86Translate(virCPUDefPtr cpu, - const char **models, - unsigned int nmodels) + virDomainCapsCPUModelsPtr models) { virCPUDefPtr translated =3D NULL; virCPUx86MapPtr map; @@ -2830,7 +2825,7 @@ virCPUx86Translate(virCPUDefPtr cpu, if (!(translated =3D virCPUDefCopyWithoutModel(cpu))) goto cleanup; =20 - if (x86Decode(translated, &model->data, models, nmodels, NULL, false) = < 0) + if (x86Decode(translated, &model->data, models, NULL, false) < 0) goto cleanup; =20 for (i =3D 0; i < cpu->nfeatures; i++) { diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index e0959202b3..4def561143 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -192,7 +192,7 @@ libxlCapsInitCPU(virCapsPtr caps, libxl_physinfo *phy_i= nfo, ret =3D 0; =20 if (!(data =3D libxlCapsNodeData(cpu, phy_info->hw_cap, version)) || - cpuDecode(cpu, data, NULL, 0, NULL) < 0) { + cpuDecode(cpu, data, NULL, NULL) < 0) { VIR_WARN("Failed to initialize host cpu features"); goto error; } diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 8483d6ecf7..ad171f09c3 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -6460,7 +6460,7 @@ libxlConnectBaselineCPU(virConnectPtr conn, if (!(cpus =3D virCPUDefListParse(xmlCPUs, ncpus, VIR_CPU_TYPE_HOST))) goto cleanup; =20 - if (!(cpu =3D cpuBaseline(cpus, ncpus, NULL, 0, + if (!(cpu =3D cpuBaseline(cpus, ncpus, NULL, !!(flags & VIR_CONNECT_BASELINE_CPU_MIGRATABLE= )))) goto cleanup; =20 diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5b532b247c..4bdc3f26c9 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1168,18 +1168,8 @@ virQEMUCapsProbeHostCPUForEmulator(virArch hostArch, virQEMUCapsPtr qemuCaps, virDomainVirtType type) { - size_t nmodels; - char **models; - virCPUDefPtr cpu; - - if (virQEMUCapsGetCPUDefinitions(qemuCaps, type, &models, &nmodels) < = 0) - return NULL; - - cpu =3D virCPUGetHost(hostArch, VIR_CPU_TYPE_GUEST, NULL, - (const char **) models, nmodels); - - virStringListFreeCount(models, nmodels); - return cpu; + return virCPUGetHost(hostArch, VIR_CPU_TYPE_GUEST, NULL, + virQEMUCapsGetCPUDefinitions(qemuCaps, type)); } =20 =20 @@ -2534,45 +2524,14 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCap= s, } =20 =20 -int +virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, - char ***names, - size_t *count) + virDomainVirtType type) { - size_t i; - char **models =3D NULL; - virDomainCapsCPUModelsPtr cpus; - - *count =3D 0; - if (names) - *names =3D NULL; - if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - cpus =3D qemuCaps->kvmCPUModels; + return qemuCaps->kvmCPUModels; else - cpus =3D qemuCaps->tcgCPUModels; - - if (!cpus) - return 0; - - if (names && VIR_ALLOC_N(models, cpus->nmodels) < 0) - return -1; - - for (i =3D 0; i < cpus->nmodels; i++) { - virDomainCapsCPUModelPtr cpu =3D cpus->models + i; - if (models && VIR_STRDUP(models[i], cpu->name) < 0) - goto error; - } - - if (names) - *names =3D models; - *count =3D cpus->nmodels; - return 0; - - error: - virStringListFreeCount(models, i); - return -1; + return qemuCaps->tcgCPUModels; } =20 =20 @@ -3394,8 +3353,6 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, virCPUDataPtr data =3D NULL; unsigned long long sigFamily =3D 0; unsigned long long sigModel =3D 0; - size_t nmodels =3D 0; - char **models =3D NULL; int ret =3D -1; size_t i; =20 @@ -3440,15 +3397,15 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, if (virCPUx86DataSetSignature(data, sigFamily, sigModel) < 0) goto cleanup; =20 - if (virQEMUCapsGetCPUDefinitions(qemuCaps, type, &models, &nmodels) < = 0 || - cpuDecode(cpu, data, (const char **) models, nmodels, NULL) < 0) + if (cpuDecode(cpu, data, + virQEMUCapsGetCPUDefinitions(qemuCaps, type), + NULL) < 0) goto cleanup; =20 ret =3D 0; =20 cleanup: virCPUDataFree(data); - virStringListFreeCount(models, nmodels); return ret; } =20 @@ -3534,7 +3491,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, } else if (type =3D=3D VIR_DOMAIN_VIRT_KVM && virCPUGetHostIsSupported(qemuCaps->arch)) { if (!(fullCPU =3D virCPUGetHost(qemuCaps->arch, VIR_CPU_TYPE_GUEST, - NULL, NULL, 0))) + NULL, NULL))) goto error; =20 for (i =3D 0; i < cpu->nfeatures; i++) { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 2d16e5b0ef..cacc2b77ed 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -470,10 +470,8 @@ int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCa= ps, const char **name, size_t count, virDomainCapsCPUUsable usable); -int virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, - char ***names, - size_t *count); +virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemu= Caps, + virDomainVirtType t= ype); =20 typedef enum { /* Host CPU definition reported in domain capabilities. */ diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7c6f1674a9..842e088519 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13055,7 +13055,7 @@ qemuConnectBaselineCPU(virConnectPtr conn ATTRIBUTE= _UNUSED, if (!(cpus =3D virCPUDefListParse(xmlCPUs, ncpus, VIR_CPU_TYPE_HOST))) goto cleanup; =20 - if (!(baseline =3D cpuBaseline(cpus, ncpus, NULL, 0, + if (!(baseline =3D cpuBaseline(cpus, ncpus, NULL, !!(flags & VIR_CONNECT_BASELINE_CPU_MIGRA= TABLE)))) goto cleanup; =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9f26dfccf8..0cb023095b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5166,8 +5166,6 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, unsigned int flags) { int ret =3D -1; - size_t nmodels =3D 0; - char **models =3D NULL; =20 if (!def->cpu) return 0; @@ -5219,17 +5217,14 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, VIR_QEMU_CAPS_HOST_CPU_MIGRAT= ABLE)) < 0) goto cleanup; =20 - if (virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType, - &models, &nmodels) < 0 || - virCPUTranslate(def->os.arch, def->cpu, - (const char **) models, nmodels) < 0) + if (virCPUTranslate(def->os.arch, def->cpu, + virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtTy= pe)) < 0) goto cleanup; =20 def->cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; ret =3D 0; =20 cleanup: - virStringListFreeCount(models, nmodels); return ret; } =20 diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 1c48347994..5508a79230 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1536,7 +1536,7 @@ testConnectBaselineCPU(virConnectPtr conn ATTRIBUTE_U= NUSED, if (!(cpus =3D virCPUDefListParse(xmlCPUs, ncpus, VIR_CPU_TYPE_HOST))) goto cleanup; =20 - if (!(cpu =3D cpuBaseline(cpus, ncpus, NULL, 0, false))) + if (!(cpu =3D cpuBaseline(cpus, ncpus, NULL, false))) goto cleanup; =20 if ((flags & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES) && diff --git a/tests/cputest.c b/tests/cputest.c index 913ca77231..552c07e2c5 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -61,9 +61,8 @@ struct data { virArch arch; const char *host; const char *name; - const char **models; + virDomainCapsCPUModelsPtr models; const char *modelsName; - unsigned int nmodels; unsigned int flags; int result; }; @@ -264,13 +263,13 @@ cpuTestGuestCPU(const void *arg) } =20 if (virCPUUpdate(host->arch, cpu, host) < 0 || - virCPUTranslate(host->arch, cpu, data->models, data->nmodels) < 0)= { + virCPUTranslate(host->arch, cpu, data->models) < 0) { ret =3D -1; goto cleanup; } =20 virBufferAsprintf(&buf, "%s+%s", data->host, data->name); - if (data->nmodels) + if (data->modelsName) virBufferAsprintf(&buf, ",%s", data->modelsName); virBufferAddLit(&buf, "-result"); =20 @@ -322,7 +321,7 @@ cpuTestBaseline(const void *arg) if (!(cpus =3D cpuTestLoadMultiXML(data->arch, data->name, &ncpus))) goto cleanup; =20 - baseline =3D cpuBaseline(cpus, ncpus, NULL, 0, + baseline =3D cpuBaseline(cpus, ncpus, NULL, !!(data->flags & VIR_CONNECT_BASELINE_CPU_MIGRA= TABLE)); =20 if (baseline && @@ -492,7 +491,7 @@ cpuTestCPUID(bool guest, const void *arg) cpu->type =3D VIR_CPU_TYPE_HOST; } =20 - if (cpuDecode(cpu, hostData, NULL, 0, NULL) < 0) + if (cpuDecode(cpu, hostData, NULL, NULL) < 0) goto cleanup; =20 if (virAsprintf(&result, "cpuid-%s-%s", @@ -729,15 +728,43 @@ cpuTestJSONCPUID(const void *arg) #endif =20 =20 -static const char *model486[] =3D { "486" }; -static const char *nomodel[] =3D { "nomodel" }; -static const char *models[] =3D { "qemu64", "core2duo", "Nehalem" }; -static const char *haswell[] =3D { "SandyBridge", "Haswell" }; -static const char *ppc_models[] =3D { "POWER6", "POWER7", "POWER8" }; +static const char *model486_list[] =3D { "486", NULL }; +static const char *nomodel_list[] =3D { "nomodel", NULL }; +static const char *models_list[] =3D { "qemu64", "core2duo", "Nehalem"= , NULL }; +static const char *haswell_list[] =3D { "SandyBridge", "Haswell", NULL = }; +static const char *ppc_models_list[] =3D { "POWER6", "POWER7", "POWER8", N= ULL }; + +static virDomainCapsCPUModelsPtr +cpuTestInitModels(const char **list) +{ + virDomainCapsCPUModelsPtr cpus; + const char **model; + + if (!(cpus =3D virDomainCapsCPUModelsNew(0))) + return NULL; + + for (model =3D list; *model; model++) { + if (virDomainCapsCPUModelsAdd(cpus, *model, -1, + VIR_DOMCAPS_CPU_USABLE_UNKNOWN, NULL= ) < 0) + goto error; + } + + return cpus; + + error: + virObjectUnref(cpus); + return NULL; +} + =20 static int mymain(void) { + virDomainCapsCPUModelsPtr model486 =3D NULL; + virDomainCapsCPUModelsPtr nomodel =3D NULL; + virDomainCapsCPUModelsPtr models =3D NULL; + virDomainCapsCPUModelsPtr haswell =3D NULL; + virDomainCapsCPUModelsPtr ppc_models =3D NULL; int ret =3D 0; =20 #if WITH_QEMU && WITH_YAJL @@ -747,13 +774,22 @@ mymain(void) virEventRegisterDefaultImpl(); #endif =20 + if (!(model486 =3D cpuTestInitModels(model486_list)) || + !(nomodel =3D cpuTestInitModels(nomodel_list)) || + !(models =3D cpuTestInitModels(models_list)) || + !(haswell =3D cpuTestInitModels(haswell_list)) || + !(ppc_models =3D cpuTestInitModels(ppc_models_list))) { + ret =3D -1; + goto cleanup; + } + #define DO_TEST(arch, api, name, host, cpu, \ - models, nmodels, flags, result) \ + models, flags, result) \ do { \ struct data data =3D { \ arch, host, cpu, models, \ models =3D=3D NULL ? NULL : #models, = \ - nmodels, flags, result \ + flags, result \ }; \ char *testLabel; \ char *tmp; \ @@ -784,12 +820,12 @@ mymain(void) #define DO_TEST_COMPARE(arch, host, cpu, result) \ DO_TEST(arch, cpuTestCompare, \ host "/" cpu " (" #result ")", \ - host, cpu, NULL, 0, 0, result) + host, cpu, NULL, 0, result) =20 #define DO_TEST_UPDATE_ONLY(arch, host, cpu) \ DO_TEST(arch, cpuTestUpdate, \ cpu " on " host, \ - host, cpu, NULL, 0, 0, 0) + host, cpu, NULL, 0, 0) =20 #define DO_TEST_UPDATE(arch, host, cpu, result) \ do { \ @@ -809,7 +845,7 @@ mymain(void) ret =3D -1; \ } else { \ DO_TEST(arch, cpuTestBaseline, label, NULL, \ - "baseline-" name, NULL, 0, flags, result); \ + "baseline-" name, NULL, flags, result); \ } \ VIR_FREE(label); \ } while (0) @@ -817,21 +853,19 @@ mymain(void) #define DO_TEST_HASFEATURE(arch, host, feature, result) \ DO_TEST(arch, cpuTestHasFeature, \ host "/" feature " (" #result ")", \ - host, feature, NULL, 0, 0, result) + host, feature, NULL, 0, result) =20 #define DO_TEST_GUESTCPU(arch, host, cpu, models, result) \ DO_TEST(arch, cpuTestGuestCPU, \ host "/" cpu " (" #models ")", \ - host, cpu, models, \ - models =3D=3D NULL ? 0 : sizeof(models) / sizeof(char *), = \ - 0, result) + host, cpu, models, 0, result) =20 #if WITH_QEMU && WITH_YAJL # define DO_TEST_CPUID_JSON(arch, host, json) \ do { \ if (json) { \ DO_TEST(arch, cpuTestJSONCPUID, host, host, \ - NULL, NULL, 0, 0, 0); \ + NULL, NULL, 0, 0); \ } \ } while (0) #else @@ -841,13 +875,13 @@ mymain(void) #define DO_TEST_CPUID(arch, host, json) \ do { \ DO_TEST(arch, cpuTestHostCPUID, host, host, \ - NULL, NULL, 0, 0, 0); \ + NULL, NULL, 0, 0); \ DO_TEST(arch, cpuTestGuestCPUID, host, host, \ - NULL, NULL, 0, 0, 0); \ + NULL, NULL, 0, 0); \ DO_TEST_CPUID_JSON(arch, host, json); \ if (json) { \ DO_TEST(arch, cpuTestUpdateLive, host, host, \ - NULL, NULL, 0, 0, 0); \ + NULL, NULL, 0, 0); \ } \ } while (0) =20 @@ -1012,10 +1046,17 @@ mymain(void) DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-W3520", true); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-X5460", false); =20 + cleanup: #if WITH_QEMU && WITH_YAJL qemuTestDriverFree(&driver); #endif =20 + virObjectUnref(model486); + virObjectUnref(nomodel); + virObjectUnref(models); + virObjectUnref(haswell); + virObjectUnref(ppc_models); + return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507920421879180.20432280434272; Fri, 13 Oct 2017 11:47:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EA5E083F43; Fri, 13 Oct 2017 18:47:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9B0D18A64; Fri, 13 Oct 2017 18:47:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 95EF63FAED; Fri, 13 Oct 2017 18:47:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF7mt014160 for ; Fri, 13 Oct 2017 14:15:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9793F4250; Fri, 13 Oct 2017 18:15:07 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 249036024D for ; Fri, 13 Oct 2017 18:15:02 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 1E93C1006E6; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EA5E083F43 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:38 +0200 Message-Id: <4858bb9037d9341855c50d500e29384c5f03f421.1507918307.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 06/22] cpu: Drop unused parameter from cpuDecode X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 13 Oct 2017 18:47:01 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The "preferred" parameter is not used by any caller of cpuDecode anymore. It's only used internally in cpu_x86 to implement cpuBaseline. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change src/cpu/cpu.c | 15 ++++----------- src/cpu/cpu.h | 6 ++---- src/cpu/cpu_ppc64.c | 5 ++--- src/cpu/cpu_x86.c | 7 +++---- src/libxl/libxl_capabilities.c | 2 +- src/qemu/qemu_capabilities.c | 4 +--- tests/cputest.c | 2 +- 7 files changed, 14 insertions(+), 27 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 42b836354d..f589666562 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -192,34 +192,27 @@ virCPUCompare(virArch arch, * @cpu: CPU definition stub to be filled in * @data: internal CPU data to be decoded into @cpu definition * @models: list of CPU models that can be considered when decoding @data - * @preferred: CPU models that should be used if possible * * Decodes internal CPU data into a CPU definition consisting of a CPU mod= el * and a list of CPU features. The @cpu model stub is supposed to have arc= h, * type, match and fallback members set, this function will add the rest. = If * @models list is NULL, all models supported by libvirt will be considered * when decoding the data. In general, this function will select the model - * closest to the CPU specified by @data unless @preferred is non-NULL, in - * which case the @preferred model will be used as long as it is compatible - * with @data. + * closest to the CPU specified by @data. * * For VIR_ARCH_I686 and VIR_ARCH_X86_64 architectures this means the comp= uted * CPU definition will have the shortest possible list of additional featu= res. - * When @preferred is non-NULL, the @preferred model will be used even if - * other models would result in a shorter list of additional features. * * Returns 0 on success, -1 on error. */ int cpuDecode(virCPUDefPtr cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models, - const char *preferred) + virDomainCapsCPUModelsPtr models) { struct cpuArchDriver *driver; =20 - VIR_DEBUG("cpu=3D%p, data=3D%p, models=3D%p, preferred=3D%s", - cpu, data, models, NULLSTR(preferred)); + VIR_DEBUG("cpu=3D%p, data=3D%p, models=3D%p", cpu, data, models); if (models) { size_t i; for (i =3D 0; i < models->nmodels; i++) @@ -243,7 +236,7 @@ cpuDecode(virCPUDefPtr cpu, return -1; } =20 - return driver->decode(cpu, data, models, preferred); + return driver->decode(cpu, data, models); } =20 =20 diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index d325fe3d04..83d5bcb63f 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -53,8 +53,7 @@ typedef virCPUCompareResult typedef int (*cpuArchDecode) (virCPUDefPtr cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models, - const char *preferred); + virDomainCapsCPUModelsPtr models); =20 typedef int (*cpuArchEncode) (virArch arch, @@ -162,8 +161,7 @@ virCPUCompare(virArch arch, int cpuDecode (virCPUDefPtr cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models, - const char *preferred) + virDomainCapsCPUModelsPtr models) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); =20 int diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 902c465cf4..76582d4083 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -669,8 +669,7 @@ virCPUppc64Compare(virCPUDefPtr host, static int ppc64DriverDecode(virCPUDefPtr cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models, - const char *preferred ATTRIBUTE_UNUSED) + virDomainCapsCPUModelsPtr models) { int ret =3D -1; struct ppc64_map *map; @@ -741,7 +740,7 @@ virCPUppc64GetHost(virCPUDefPtr cpu, #endif data->pvr[0].mask =3D 0xfffffffful; =20 - ret =3D ppc64DriverDecode(cpu, cpuData, models, NULL); + ret =3D ppc64DriverDecode(cpu, cpuData, models); =20 cleanup: virCPUppc64DataFree(cpuData); diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 3f9e83ca72..84ec878d1b 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1945,10 +1945,9 @@ x86Decode(virCPUDefPtr cpu, static int x86DecodeCPUData(virCPUDefPtr cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models, - const char *preferred) + virDomainCapsCPUModelsPtr models) { - return x86Decode(cpu, &data->data.x86, models, preferred, false); + return x86Decode(cpu, &data->data.x86, models, NULL, false); } =20 =20 @@ -2412,7 +2411,7 @@ virCPUx86GetHost(virCPUDefPtr cpu, cpuidSet(CPUX86_EXTENDED, cpuData) < 0) goto cleanup; =20 - ret =3D x86DecodeCPUData(cpu, cpuData, models, NULL); + ret =3D x86DecodeCPUData(cpu, cpuData, models); =20 cleanup: virCPUx86DataFree(cpuData); diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 4def561143..18596c7c72 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -192,7 +192,7 @@ libxlCapsInitCPU(virCapsPtr caps, libxl_physinfo *phy_i= nfo, ret =3D 0; =20 if (!(data =3D libxlCapsNodeData(cpu, phy_info->hw_cap, version)) || - cpuDecode(cpu, data, NULL, NULL) < 0) { + cpuDecode(cpu, data, NULL) < 0) { VIR_WARN("Failed to initialize host cpu features"); goto error; } diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 4bdc3f26c9..8803980495 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3397,9 +3397,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, if (virCPUx86DataSetSignature(data, sigFamily, sigModel) < 0) goto cleanup; =20 - if (cpuDecode(cpu, data, - virQEMUCapsGetCPUDefinitions(qemuCaps, type), - NULL) < 0) + if (cpuDecode(cpu, data, virQEMUCapsGetCPUDefinitions(qemuCaps, type))= < 0) goto cleanup; =20 ret =3D 0; diff --git a/tests/cputest.c b/tests/cputest.c index 552c07e2c5..cc95f1d551 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -491,7 +491,7 @@ cpuTestCPUID(bool guest, const void *arg) cpu->type =3D VIR_CPU_TYPE_HOST; } =20 - if (cpuDecode(cpu, hostData, NULL, NULL) < 0) + if (cpuDecode(cpu, hostData, NULL) < 0) goto cleanup; =20 if (virAsprintf(&result, "cpuid-%s-%s", --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150791894547899.63277566267686; Fri, 13 Oct 2017 11:22:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 297D3883C4; Fri, 13 Oct 2017 18:22:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 038AB183CE; Fri, 13 Oct 2017 18:22:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BEA2A18355C1; Fri, 13 Oct 2017 18:22:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF3DA014057 for ; Fri, 13 Oct 2017 14:15:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D72E5D6AE; Fri, 13 Oct 2017 18:15:03 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB53E5D6A4 for ; Fri, 13 Oct 2017 18:15:02 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 225F61006EF; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 297D3883C4 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:39 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 07/22] conf: Introduce virDomainCapsCPUModelsGet X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 13 Oct 2017 18:22:24 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This internal API can be used to find a specific CPU model in virDomainCapsCPUModels list. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - new patch which replaces the original 07/23 (cpu: Return model from virCPUModelIsAllowed) src/conf/domain_capabilities.c | 18 ++++++++++++++++++ src/conf/domain_capabilities.h | 4 ++++ src/cpu/cpu.c | 8 +------- src/libvirt_private.syms | 1 + 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index be34576204..729d905e2d 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -259,6 +259,24 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cp= uModels, } =20 =20 +virDomainCapsCPUModelPtr +virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels, + const char *name) +{ + size_t i; + + if (!cpuModels) + return NULL; + + for (i =3D 0; i < cpuModels->nmodels; i++) { + if (STREQ(cpuModels->models[i].name, name)) + return cpuModels->models + i; + } + + return NULL; +} + + int virDomainCapsEnumSet(virDomainCapsEnumPtr capsEnum, const char *capsEnumName, diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 8c71dec21e..07640ed67f 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -179,6 +179,10 @@ int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPt= r cpuModels, ssize_t nameLen, virDomainCapsCPUUsable usable, char **blockers); +virDomainCapsCPUModelPtr +virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels, + const char *name); + =20 # define VIR_DOMAIN_CAPS_ENUM_SET(capsEnum, ...) \ do { \ diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index f589666562..047e3b1112 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -829,16 +829,10 @@ bool virCPUModelIsAllowed(const char *model, virDomainCapsCPUModelsPtr models) { - size_t i; - if (!models) return true; =20 - for (i =3D 0; i < models->nmodels; i++) { - if (STREQ(models->models[i].name, model)) - return true; - } - return false; + return !!virDomainCapsCPUModelsGet(models, model); } =20 =20 diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 26c5ddb405..4c56f17e29 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -174,6 +174,7 @@ virDomainCapsCPUModelsAdd; virDomainCapsCPUModelsAddSteal; virDomainCapsCPUModelsCopy; virDomainCapsCPUModelsFilter; +virDomainCapsCPUModelsGet; virDomainCapsCPUModelsNew; virDomainCapsCPUUsableTypeFromString; virDomainCapsCPUUsableTypeToString; --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150792041462346.7653741749275; Fri, 13 Oct 2017 11:46:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD43A7E423; Fri, 13 Oct 2017 18:46:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2E6260F84; Fri, 13 Oct 2017 18:46:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 63F843FC75; Fri, 13 Oct 2017 18:46:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF3OC014058 for ; Fri, 13 Oct 2017 14:15:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D2755D6A8; Fri, 13 Oct 2017 18:15:03 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB5D35D6A6 for ; Fri, 13 Oct 2017 18:15:02 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 252201006E7; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DD43A7E423 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:40 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 08/22] cpu_x86: Move x86FeatureFind* to avoid forward prototypes X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 13 Oct 2017 18:46:53 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change src/cpu/cpu_x86.c | 61 ++++++++++++++++++++++++++++-----------------------= ---- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 84ec878d1b..8dff333e13 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -240,6 +240,37 @@ x86cpuidAndBits(virCPUx86CPUID *cpuid, cpuid->edx &=3D mask->edx; } =20 + +static virCPUx86FeaturePtr +x86FeatureFind(virCPUx86MapPtr map, + const char *name) +{ + size_t i; + + for (i =3D 0; i < map->nfeatures; i++) { + if (STREQ(map->features[i]->name, name)) + return map->features[i]; + } + + return NULL; +} + + +static virCPUx86FeaturePtr +x86FeatureFindInternal(const char *name) +{ + size_t i; + size_t count =3D ARRAY_CARDINALITY(x86_kvm_features); + + for (i =3D 0; i < count; i++) { + if (STREQ(x86_kvm_features[i].name, name)) + return x86_kvm_features + i; + } + + return NULL; +} + + static int virCPUx86CPUIDSorter(const void *a, const void *b) { @@ -753,36 +784,6 @@ x86FeatureFree(virCPUx86FeaturePtr feature) } =20 =20 -static virCPUx86FeaturePtr -x86FeatureFind(virCPUx86MapPtr map, - const char *name) -{ - size_t i; - - for (i =3D 0; i < map->nfeatures; i++) { - if (STREQ(map->features[i]->name, name)) - return map->features[i]; - } - - return NULL; -} - - -static virCPUx86FeaturePtr -x86FeatureFindInternal(const char *name) -{ - size_t i; - size_t count =3D ARRAY_CARDINALITY(x86_kvm_features); - - for (i =3D 0; i < count; i++) { - if (STREQ(x86_kvm_features[i].name, name)) - return x86_kvm_features + i; - } - - return NULL; -} - - static int x86FeatureInData(const char *name, const virCPUx86Data *data, --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918956393480.99061641502533; Fri, 13 Oct 2017 11:22:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2985D7E399; Fri, 13 Oct 2017 18:22:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A9E71822E; Fri, 13 Oct 2017 18:22:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CB3E94EE4F; Fri, 13 Oct 2017 18:22:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF7vu014159 for ; Fri, 13 Oct 2017 14:15:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9740860BEC; Fri, 13 Oct 2017 18:15:07 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 23A0660F84 for ; Fri, 13 Oct 2017 18:15:02 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 2754E1006F0; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2985D7E399 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:41 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 09/22] cpu_x86: Disable blockers from unusable CPU models X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 13 Oct 2017 18:22:35 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When decoding CPUID data to virCPUDef we need to be careful about using a CPU model which cannot be directly used on the current host. Normally, libvirt would notice the features which prevent the model from being usable and it would disable them in the computed virCPUDef, but this won't work in case the definition of the CPU model in QEMU contains more features than what we have in cpu_map.xml. We need to count with the usability blockers we got from QEMU and explicitly disable all of them to make the computed virCPUDef usable. https://bugzilla.redhat.com/show_bug.cgi?id=3D1464832 Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - use virDomainCapsCPUModelsGet instead of virCPUModelIsAllowed src/cpu/cpu_x86.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 8dff333e13..b177885f5e 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -627,7 +627,8 @@ x86DataAddSignature(virCPUx86Data *data, static virCPUDefPtr x86DataToCPU(const virCPUx86Data *data, virCPUx86ModelPtr model, - virCPUx86MapPtr map) + virCPUx86MapPtr map, + virDomainCapsCPUModelPtr hvModel) { virCPUDefPtr cpu; virCPUx86Data copy =3D VIR_CPU_X86_DATA_INIT; @@ -647,6 +648,21 @@ x86DataToCPU(const virCPUx86Data *data, x86DataSubtract(©, &modelData); x86DataSubtract(&modelData, data); =20 + /* The hypervisor's version of the CPU model (hvModel) may contain + * additional features which may be currently unavailable. Such featur= es + * block usage of the CPU model and we need to explicitly disable them. + */ + if (hvModel && hvModel->blockers) { + char **blocker; + virCPUx86FeaturePtr feature; + + for (blocker =3D hvModel->blockers; *blocker; blocker++) { + if ((feature =3D x86FeatureFind(map, *blocker)) && + !x86DataIsSubset(©, &feature->data)) + x86DataAdd(&modelData, &feature->data); + } + } + /* because feature policy is ignored for host CPU */ cpu->type =3D VIR_CPU_TYPE_GUEST; =20 @@ -1835,6 +1851,7 @@ x86Decode(virCPUDefPtr cpu, virCPUx86Data copy =3D VIR_CPU_X86_DATA_INIT; virCPUx86Data features =3D VIR_CPU_X86_DATA_INIT; virCPUx86VendorPtr vendor; + virDomainCapsCPUModelPtr hvModel =3D NULL; uint32_t signature; ssize_t i; int rc; @@ -1855,7 +1872,8 @@ x86Decode(virCPUDefPtr cpu, */ for (i =3D map->nmodels - 1; i >=3D 0; i--) { candidate =3D map->models[i]; - if (!virCPUModelIsAllowed(candidate->name, models)) { + if (models && + !(hvModel =3D virDomainCapsCPUModelsGet(models, candidate->nam= e))) { if (preferred && STREQ(candidate->name, preferred)) { if (cpu->fallback !=3D VIR_CPU_FALLBACK_ALLOW) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -1883,7 +1901,7 @@ x86Decode(virCPUDefPtr cpu, continue; } =20 - if (!(cpuCandidate =3D x86DataToCPU(&data, candidate, map))) + if (!(cpuCandidate =3D x86DataToCPU(&data, candidate, map, hvModel= ))) goto cleanup; cpuCandidate->type =3D cpu->type; =20 --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918969985948.3197207128757; Fri, 13 Oct 2017 11:22:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 138C413A49; Fri, 13 Oct 2017 18:22:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EAFBC18238; Fri, 13 Oct 2017 18:22:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B56C918355DE; Fri, 13 Oct 2017 18:22:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF3jA014072 for ; Fri, 13 Oct 2017 14:15:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9A498614F6; Fri, 13 Oct 2017 18:15:03 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E28D6BF66 for ; Fri, 13 Oct 2017 18:15:02 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 2BD861006F2; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 138C413A49 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:42 +0200 Message-Id: <4de28e5ed7c470486a4c15a3031b9748a952700b.1507918307.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 10/22] cputest: Replace bool with cpuTestCPUIDJson enum X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 13 Oct 2017 18:22:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We will soon need to handle more than two values. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - changed commit summary tests/cputest.c | 79 ++++++++++++++++++++++++++++++-----------------------= ---- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index cc95f1d551..57cff04f38 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -670,6 +670,11 @@ cpuTestUpdateLive(const void *arg) } =20 =20 +typedef enum { + JSON_NONE, + JSON_HOST, +} cpuTestCPUIDJson; + #if WITH_QEMU && WITH_YAJL static int cpuTestJSONCPUID(const void *arg) @@ -863,7 +868,7 @@ mymain(void) #if WITH_QEMU && WITH_YAJL # define DO_TEST_CPUID_JSON(arch, host, json) \ do { \ - if (json) { \ + if (json !=3D JSON_NONE) { \ DO_TEST(arch, cpuTestJSONCPUID, host, host, \ NULL, NULL, 0, 0); \ } \ @@ -879,7 +884,7 @@ mymain(void) DO_TEST(arch, cpuTestGuestCPUID, host, host, \ NULL, NULL, 0, 0); \ DO_TEST_CPUID_JSON(arch, host, json); \ - if (json) { \ + if (json !=3D JSON_NONE) { \ DO_TEST(arch, cpuTestUpdateLive, host, host, \ NULL, NULL, 0, 0); \ } \ @@ -1010,41 +1015,41 @@ mymain(void) DO_TEST_GUESTCPU(VIR_ARCH_PPC64, "host", "guest-legacy-incompatible", = ppc_models, -1); DO_TEST_GUESTCPU(VIR_ARCH_PPC64, "host", "guest-legacy-invalid", ppc_m= odels, -1); =20 - DO_TEST_CPUID(VIR_ARCH_X86_64, "A10-5800K", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Atom-D510", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Atom-N450", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-2500", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-2540M", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-4670T", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-6600", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-2600", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3520M", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3740QM", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3770", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-4600U", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-4510U", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-5600U", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-5600U-arat", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core2-E6850", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core2-Q9500", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "EPYC-7601-32-Core", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "FX-8150", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-1352", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-2350", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-6234", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-6282", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Pentium-P6100", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Phenom-B95", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Ryzen-7-1800X-Eight-Core", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-5110", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E3-1245", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2630", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2650", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-4820", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-8890", false); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-Gold-6148", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-W3520", true); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-X5460", false); + DO_TEST_CPUID(VIR_ARCH_X86_64, "A10-5800K", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Atom-D510", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Atom-N450", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-2500", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-2540M", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-4670T", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-6600", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-2600", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3520M", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3740QM", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3770", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-4600U", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-4510U", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-5600U", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-5600U-arat", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core2-E6850", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core2-Q9500", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "EPYC-7601-32-Core", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "FX-8150", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-1352", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-2350", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-6234", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Opteron-6282", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Pentium-P6100", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Phenom-B95", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Ryzen-7-1800X-Eight-Core", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-5110", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E3-1245", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2630", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2650", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-4820", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-8890", JSON_NONE); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-Gold-6148", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-W3520", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-X5460", JSON_NONE); =20 cleanup: #if WITH_QEMU && WITH_YAJL --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918982583978.597250567006; Fri, 13 Oct 2017 11:23:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C4B92CE933; Fri, 13 Oct 2017 18:23:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D16D1814C; Fri, 13 Oct 2017 18:23:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 34B1318355E0; Fri, 13 Oct 2017 18:22:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF4mP014097 for ; Fri, 13 Oct 2017 14:15:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 65F0B5D6B7; Fri, 13 Oct 2017 18:15:04 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 216485D6A4 for ; Fri, 13 Oct 2017 18:15:03 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 2F89C1006F3; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8C4B92CE933 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:43 +0200 Message-Id: <247fdf68206b2f25ba768b0c360f92e22abffd61.1507918307.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 11/22] cputest: Avoid calling json_reformat in cpu-parse.sh X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 13 Oct 2017 18:23:02 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Various version of json_reformat use different number of spaces for indenting. Let's use a simple python reformatter to gain full control over the formatting for consistent results. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change tests/cputestdata/cpu-parse.sh | 2 +- tests/cputestdata/cpu-reformat.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 tests/cputestdata/cpu-reformat.py diff --git a/tests/cputestdata/cpu-parse.sh b/tests/cputestdata/cpu-parse.sh index cd1ab024b3..96ff1074e0 100755 --- a/tests/cputestdata/cpu-parse.sh +++ b/tests/cputestdata/cpu-parse.sh @@ -42,7 +42,7 @@ json() while read; do $first || echo first=3Dfalse - json_reformat <<<"$REPLY" | tr -s '\n' + $(dirname $0)/cpu-reformat.py <<<"$REPLY" done } =20 diff --git a/tests/cputestdata/cpu-reformat.py b/tests/cputestdata/cpu-refo= rmat.py new file mode 100755 index 0000000000..999ef1698c --- /dev/null +++ b/tests/cputestdata/cpu-reformat.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python2 + +import sys +import json + +dec =3D json.JSONDecoder() +data, pos =3D dec.raw_decode(sys.stdin.read()) +json.dump(data, sys.stdout, indent =3D 2, separators =3D (',', ': ')) +print --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918976162582.7479883214327; Fri, 13 Oct 2017 11:22:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3930680C0F; Fri, 13 Oct 2017 18:22:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F0573612B0; Fri, 13 Oct 2017 18:22:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B8D553FACF; Fri, 13 Oct 2017 18:22:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF49U014092 for ; Fri, 13 Oct 2017 14:15:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 427726047B; Fri, 13 Oct 2017 18:15:04 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0911850EDC for ; Fri, 13 Oct 2017 18:15:03 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 31AA21006F1; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3930680C0F Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:44 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 12/22] cputest: Print correct feature in virCPUUpdateLive test X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 13 Oct 2017 18:22:55 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" If the actual result does not match our expectation, the tests would not correctly show the difference if a CPU feature is disabled in the expected result and the actual result does not mention it at all. The test could complain about an unrelated CPU feature or it could even crash in case the actual result contains no more features to go through. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change tests/cputest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cputest.c b/tests/cputest.c index 57cff04f38..dcfdf57d43 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -605,7 +605,7 @@ cpuTestUpdateLiveCompare(virArch arch, (cmp > 0 && featExp->policy =3D=3D VIR_CPU_FEATURE_DISABLE)) { VIR_TEST_VERBOSE("Actual CPU has extra feature '%s'\n", - featAct->name); + cmp <=3D 0 ? featAct->name : featExp->name); ret =3D -1; } } --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150791895001452.807703370468516; Fri, 13 Oct 2017 11:22:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C38363680C; Fri, 13 Oct 2017 18:22:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A42986BF60; Fri, 13 Oct 2017 18:22:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6869F18355DD; Fri, 13 Oct 2017 18:22:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF4NH014103 for ; Fri, 13 Oct 2017 14:15:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 72C9060176; Fri, 13 Oct 2017 18:15:04 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 090BC6047F for ; Fri, 13 Oct 2017 18:15:03 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 366C71006F4; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C38363680C Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:45 +0200 Message-Id: <9f8c62e60f3587054714e06982ba9d2365319119.1507918307.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 13/22] cputest: Test CPU usability blockers X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 13 Oct 2017 18:22:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Gather query-cpu-definitions results and use them for testing CPU model usability blockers in CPUID to virCPUDef translation. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_capspriv.h | 5 +++++ tests/cputest.c | 12 +++++++++++- tests/cputestdata/cpu-cpuid.py | 26 +++++++++++++++++++------- tests/cputestdata/cpu-gather.sh | 1 + 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 8803980495..4de411e397 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2933,7 +2933,7 @@ virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCa= ps, } =20 =20 -static int +int virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps, qemuMonitorPtr mon, bool tcg) diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index d05256bd35..f23995ec6e 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -101,4 +101,9 @@ virQEMUCapsParseHelpStr(const char *qemu, int virQEMUCapsParseDeviceStr(virQEMUCapsPtr qemuCaps, const char *str); + +int +virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps, + qemuMonitorPtr mon, + bool tcg); #endif diff --git a/tests/cputest.c b/tests/cputest.c index dcfdf57d43..0a07a2da14 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -673,6 +673,7 @@ cpuTestUpdateLive(const void *arg) typedef enum { JSON_NONE, JSON_HOST, + JSON_MODELS, } cpuTestCPUIDJson; =20 #if WITH_QEMU && WITH_YAJL @@ -704,10 +705,19 @@ cpuTestJSONCPUID(const void *arg) if (!(qemuCaps =3D virQEMUCapsNew())) goto cleanup; =20 + virQEMUCapsSet(qemuCaps, QEMU_CAPS_KVM); + if (data->flags =3D=3D JSON_MODELS) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS); + virQEMUCapsSetArch(qemuCaps, data->arch); virQEMUCapsSetCPUModelInfo(qemuCaps, VIR_DOMAIN_VIRT_KVM, model); model =3D NULL; =20 + if (virQEMUCapsProbeQMPCPUDefinitions(qemuCaps, + qemuMonitorTestGetMonitor(testMo= n), + false) < 0) + goto cleanup; + if (VIR_ALLOC(cpu) < 0) goto cleanup; =20 @@ -870,7 +880,7 @@ mymain(void) do { \ if (json !=3D JSON_NONE) { \ DO_TEST(arch, cpuTestJSONCPUID, host, host, \ - NULL, NULL, 0, 0); \ + NULL, NULL, json, 0); \ } \ } while (0) #else diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index a2fd938c24..4fe8e8b952 100755 --- a/tests/cputestdata/cpu-cpuid.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -228,17 +228,22 @@ def parseFeatureWords(path): s =3D f.read() =20 props =3D {} - for i in range(5): + rest =3D [] + chunk =3D 0 + while s !=3D "": (data, pos) =3D dec.raw_decode(s) - if i =3D=3D 0: + if chunk =3D=3D 0: features =3D data["return"] - else: + elif chunk < 5: keys =3D ["family", "model", "stepping", "model-id"] - props[keys[i - 1]] =3D data["return"] + props[keys[chunk - 1]] =3D data["return"] + else: + rest.append(data) =20 while pos < len(s) and s[pos] !=3D "{": pos +=3D 1 s =3D s[pos:] + chunk +=3D 1 =20 if props["model-id"].find("Intel") !=3D -1: props["vendor"] =3D "GenuineIntel" @@ -255,13 +260,13 @@ def parseFeatureWords(path): leaf =3D cpuidLeaf(cpuid, in_eax, in_ecx) leaf[feat["cpuid-register"].lower()] =3D feat["features"] =20 - return props, cpuid + return props, cpuid, rest =20 =20 def parseQemu(path, features): cpuid =3D {} with open(path, "r") as f: - data =3D json.load(f) + data, pos =3D json.JSONDecoder().raw_decode(f.read()) =20 for (prop, val) in data["return"]["model"]["props"].iteritems(): if val and prop in features: @@ -288,6 +293,7 @@ def parseCpuid(path): =20 =20 def formatCpuid(cpuid, path, comment): + print path with open(path, "w") as f: f.write("\n") f.write("\n") @@ -304,19 +310,25 @@ def formatCpuid(cpuid, path, comment): =20 =20 def convert(path): - props, cpuid =3D parseFeatureWords(path) + props, cpuid, rest =3D parseFeatureWords(path) =20 for feature in cpuidMap: value =3D cpuidIsSet(cpuid, feature) for name in feature["names"]: props[name] =3D value =20 + print path with open(path, "w") as f: json.dump({"return": {"model": {"name": "base", "props": props}}, "id": "model-expansion"}, f, indent =3D 2, separators =3D (',', ': ')) f.write("\n") =20 + for chunk in rest: + f.write("\n") + json.dump(chunk, f, indent =3D 2, separators =3D (',', ': ')) + f.write("\n") + =20 def diff(features, path): base =3D path.replace(".json", "") diff --git a/tests/cputestdata/cpu-gather.sh b/tests/cputestdata/cpu-gather= .sh index 83963557ec..9c696f57bd 100755 --- a/tests/cputestdata/cpu-gather.sh +++ b/tests/cputestdata/cpu-gather.sh @@ -58,5 +58,6 @@ $( qom_get model-id fi ) +{"execute":"query-cpu-definitions","id":"definitions"} {"execute":"quit"} EOF --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918977332346.9878977836927; Fri, 13 Oct 2017 11:22:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 254F5C00DB9C; Fri, 13 Oct 2017 18:22:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F11F950F1E; Fri, 13 Oct 2017 18:22:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3D22B18355E1; Fri, 13 Oct 2017 18:22:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF35O014073 for ; Fri, 13 Oct 2017 14:15:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 99C31614EC; Fri, 13 Oct 2017 18:15:03 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 310836BF69 for ; Fri, 13 Oct 2017 18:15:03 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 387E01006F5; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 254F5C00DB9C Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:46 +0200 Message-Id: <4db51917de456f1bd3652440cd6fce559bc9f88a.1507918308.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 14/22] cputest: Separate QEMUCaps creation from cpuTestCPUIDJson X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 13 Oct 2017 18:22:56 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" To make the code reusable by other tests. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change tests/cputest.c | 97 +++++++++++++++++++++++++++++++++++------------------= ---- 1 file changed, 60 insertions(+), 37 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index 0a07a2da14..b72c17a168 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -460,6 +460,64 @@ cpuTestHasFeature(const void *arg) } =20 =20 +typedef enum { + JSON_NONE, + JSON_HOST, + JSON_MODELS, +} cpuTestCPUIDJson; + +#if WITH_QEMU && WITH_YAJL +static virQEMUCapsPtr +cpuTestMakeQEMUCaps(const struct data *data) +{ + virQEMUCapsPtr qemuCaps =3D NULL; + qemuMonitorTestPtr testMon =3D NULL; + qemuMonitorCPUModelInfoPtr model =3D NULL; + char *json =3D NULL; + + if (virAsprintf(&json, "%s/cputestdata/%s-cpuid-%s.json", + abs_srcdir, virArchToString(data->arch), data->host) <= 0) + goto error; + + if (!(testMon =3D qemuMonitorTestNewFromFile(json, driver.xmlopt, true= ))) + goto error; + + if (qemuMonitorGetCPUModelExpansion(qemuMonitorTestGetMonitor(testMon), + QEMU_MONITOR_CPU_MODEL_EXPANSION_S= TATIC, + "host", true, &model) < 0) + goto error; + + if (!(qemuCaps =3D virQEMUCapsNew())) + goto error; + + virQEMUCapsSet(qemuCaps, QEMU_CAPS_KVM); + if (data->flags =3D=3D JSON_MODELS) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS); + + virQEMUCapsSetArch(qemuCaps, data->arch); + virQEMUCapsSetCPUModelInfo(qemuCaps, VIR_DOMAIN_VIRT_KVM, model); + model =3D NULL; + + if (virQEMUCapsProbeQMPCPUDefinitions(qemuCaps, + qemuMonitorTestGetMonitor(testMo= n), + false) < 0) + goto error; + + cleanup: + qemuMonitorCPUModelInfoFree(model); + qemuMonitorTestFree(testMon); + VIR_FREE(json); + + return qemuCaps; + + error: + virObjectUnref(qemuCaps); + qemuCaps =3D NULL; + goto cleanup; +} +#endif + + static int cpuTestCPUID(bool guest, const void *arg) { @@ -670,52 +728,20 @@ cpuTestUpdateLive(const void *arg) } =20 =20 -typedef enum { - JSON_NONE, - JSON_HOST, - JSON_MODELS, -} cpuTestCPUIDJson; - #if WITH_QEMU && WITH_YAJL static int cpuTestJSONCPUID(const void *arg) { const struct data *data =3D arg; - qemuMonitorCPUModelInfoPtr model =3D NULL; virQEMUCapsPtr qemuCaps =3D NULL; virCPUDefPtr cpu =3D NULL; - qemuMonitorTestPtr testMon =3D NULL; - char *json =3D NULL; char *result =3D NULL; int ret =3D -1; =20 - if (virAsprintf(&json, "%s/cputestdata/%s-cpuid-%s.json", - abs_srcdir, virArchToString(data->arch), data->host) <= 0 || - virAsprintf(&result, "cpuid-%s-json", data->host) < 0) + if (virAsprintf(&result, "cpuid-%s-json", data->host) < 0) goto cleanup; =20 - if (!(testMon =3D qemuMonitorTestNewFromFile(json, driver.xmlopt, true= ))) - goto cleanup; - - if (qemuMonitorGetCPUModelExpansion(qemuMonitorTestGetMonitor(testMon), - QEMU_MONITOR_CPU_MODEL_EXPANSION_S= TATIC, - "host", true, &model) < 0) - goto cleanup; - - if (!(qemuCaps =3D virQEMUCapsNew())) - goto cleanup; - - virQEMUCapsSet(qemuCaps, QEMU_CAPS_KVM); - if (data->flags =3D=3D JSON_MODELS) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS); - - virQEMUCapsSetArch(qemuCaps, data->arch); - virQEMUCapsSetCPUModelInfo(qemuCaps, VIR_DOMAIN_VIRT_KVM, model); - model =3D NULL; - - if (virQEMUCapsProbeQMPCPUDefinitions(qemuCaps, - qemuMonitorTestGetMonitor(testMo= n), - false) < 0) + if (!(qemuCaps =3D cpuTestMakeQEMUCaps(data))) goto cleanup; =20 if (VIR_ALLOC(cpu) < 0) @@ -732,12 +758,9 @@ cpuTestJSONCPUID(const void *arg) ret =3D cpuTestCompareXML(data->arch, cpu, result); =20 cleanup: - qemuMonitorCPUModelInfoFree(model); virObjectUnref(qemuCaps); - qemuMonitorTestFree(testMon); virCPUDefFree(cpu); VIR_FREE(result); - VIR_FREE(json); return ret; } #endif --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150792041648575.52029365466387; Fri, 13 Oct 2017 11:46:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 742884A702; Fri, 13 Oct 2017 18:46:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 50DCA5C462; Fri, 13 Oct 2017 18:46:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 162F718355DB; Fri, 13 Oct 2017 18:46:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF5Oj014116 for ; Fri, 13 Oct 2017 14:15:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id C7AF15D6A6; Fri, 13 Oct 2017 18:15:05 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F1C35D6A8 for ; Fri, 13 Oct 2017 18:15:05 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 3CC4B1006F7; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 742884A702 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:47 +0200 Message-Id: <86c355cf049e344cbacfaea762d151065a63092b.1507918308.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 15/22] cputest: Use CPU models from QEMU when available X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 13 Oct 2017 18:46:55 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When testing cpuDecode for computing guest CPU definition from CPUID data (the CPU definition reported by domain capabilities), we need to use CPU models (and their usability blockers) from QEMU if they are available to cpuDecode in the same way it is actually used in the qemu driver. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - dropped if (models) before virObjectRef() - virDomainCapsCPUModelsGet is used instead of virCPUModelIsAllowed, which means [PATCH 15/23] build: Export virCPUModelIsAllowed private = API from v1 can be dropped tests/cputest.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++-= ---- 1 file changed, 76 insertions(+), 6 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index b72c17a168..9e1e20f83f 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -515,6 +515,36 @@ cpuTestMakeQEMUCaps(const struct data *data) qemuCaps =3D NULL; goto cleanup; } + + +static virDomainCapsCPUModelsPtr +cpuTestGetCPUModels(const struct data *data) +{ + virDomainCapsCPUModelsPtr models =3D NULL; + virQEMUCapsPtr qemuCaps; + + if (data->flags !=3D JSON_MODELS) + return NULL; + + if (!(qemuCaps =3D cpuTestMakeQEMUCaps(data))) + return NULL; + + models =3D virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM); + virObjectRef(models); + + virObjectUnref(qemuCaps); + + return models; +} + +#else /* if WITH_QEMU && WITH_YAJL */ + +static virDomainCapsCPUModelsPtr +cpuTestGetCPUModels(const struct data *data ATTRIBUTE_UNUSED) +{ + return NULL; +} + #endif =20 =20 @@ -528,6 +558,7 @@ cpuTestCPUID(bool guest, const void *arg) char *host =3D NULL; virCPUDefPtr cpu =3D NULL; char *result =3D NULL; + virDomainCapsCPUModelsPtr models =3D NULL; =20 if (virAsprintf(&hostFile, "%s/cputestdata/%s-cpuid-%s.xml", abs_srcdir, virArchToString(data->arch), data->host) <= 0) @@ -549,7 +580,10 @@ cpuTestCPUID(bool guest, const void *arg) cpu->type =3D VIR_CPU_TYPE_HOST; } =20 - if (cpuDecode(cpu, hostData, NULL) < 0) + if (guest) + models =3D cpuTestGetCPUModels(data); + + if (cpuDecode(cpu, hostData, models) < 0) goto cleanup; =20 if (virAsprintf(&result, "cpuid-%s-%s", @@ -565,6 +599,7 @@ cpuTestCPUID(bool guest, const void *arg) virCPUDataFree(hostData); virCPUDefFree(cpu); VIR_FREE(result); + virObjectUnref(models); return ret; } =20 @@ -686,6 +721,8 @@ cpuTestUpdateLive(const void *arg) virCPUDataPtr disabledData =3D NULL; char *expectedFile =3D NULL; virCPUDefPtr expected =3D NULL; + virDomainCapsCPUModelsPtr hvModels =3D NULL; + virDomainCapsCPUModelsPtr models =3D NULL; int ret =3D -1; =20 if (virAsprintf(&cpuFile, "cpuid-%s-guest", data->host) < 0 || @@ -704,13 +741,44 @@ cpuTestUpdateLive(const void *arg) !(disabledData =3D virCPUDataParse(disabled))) goto cleanup; =20 - if (virCPUUpdateLive(data->arch, cpu, enabledData, disabledData) < 0) - goto cleanup; - if (virAsprintf(&expectedFile, "cpuid-%s-json", data->host) < 0 || !(expected =3D cpuTestLoadXML(data->arch, expectedFile))) goto cleanup; =20 + /* In case the host CPU signature does not exactly match any CPU model= from + * cpu_map.xml, the CPU model we detect from CPUID may differ from the= one + * we compute by asking QEMU. Since this test expands both CPU models = and + * compares their features, we can try to translate the 'actual' CPU to + * use the CPU model from 'expected'. + */ + if (STRNEQ(cpu->model, expected->model)) { + virDomainCapsCPUModelPtr hvModel; + char **blockers =3D NULL; + virDomainCapsCPUUsable usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; + + if (!(models =3D virDomainCapsCPUModelsNew(0))) + goto cleanup; + + hvModels =3D cpuTestGetCPUModels(data); + hvModel =3D virDomainCapsCPUModelsGet(hvModels, expected->model); + + if (hvModel) { + blockers =3D hvModel->blockers; + usable =3D hvModel->usable; + } + + if (virDomainCapsCPUModelsAdd(models, expected->model, -1, + usable, blockers) < 0) + goto cleanup; + + cpu->fallback =3D VIR_CPU_FALLBACK_ALLOW; + ignore_value(virCPUTranslate(data->arch, cpu, models)); + cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; + } + + if (virCPUUpdateLive(data->arch, cpu, enabledData, disabledData) < 0) + goto cleanup; + ret =3D cpuTestUpdateLiveCompare(data->arch, cpu, expected); =20 cleanup: @@ -724,6 +792,8 @@ cpuTestUpdateLive(const void *arg) virCPUDataFree(disabledData); VIR_FREE(expectedFile); virCPUDefFree(expected); + virObjectUnref(hvModels); + virObjectUnref(models); return ret; } =20 @@ -915,11 +985,11 @@ mymain(void) DO_TEST(arch, cpuTestHostCPUID, host, host, \ NULL, NULL, 0, 0); \ DO_TEST(arch, cpuTestGuestCPUID, host, host, \ - NULL, NULL, 0, 0); \ + NULL, NULL, json, 0); \ DO_TEST_CPUID_JSON(arch, host, json); \ if (json !=3D JSON_NONE) { \ DO_TEST(arch, cpuTestUpdateLive, host, host, \ - NULL, NULL, 0, 0); \ + NULL, NULL, json, 0); \ } \ } while (0) =20 --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918951145493.0770502599098; Fri, 13 Oct 2017 11:22:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3712225789; Fri, 13 Oct 2017 18:22:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 157AA5D6B7; Fri, 13 Oct 2017 18:22:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D14E918355DD; Fri, 13 Oct 2017 18:22:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF5Oc014115 for ; Fri, 13 Oct 2017 14:15:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id C6D305D6A4; Fri, 13 Oct 2017 18:15:05 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5ED685D6A6 for ; Fri, 13 Oct 2017 18:15:05 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 400D31006F8; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3712225789 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:48 +0200 Message-Id: <93163aafbe5cc47edafd7a5efac1c172900d133e.1507918308.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 16/22] cputest: Add query-cpu-definitions reply for Core-i5-2540M X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 13 Oct 2017 18:22:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The unavailable features do not make any difference in this case, because this is a SandyBridge CPU which has an empty list of unavailable features. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change tests/cputest.c | 2 +- tests/cputestdata/x86_64-cpuid-Core-i5-2540M.json | 362 ++++++++++++++++++= ++++ 2 files changed, 363 insertions(+), 1 deletion(-) diff --git a/tests/cputest.c b/tests/cputest.c index 9e1e20f83f..a15b1c8935 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -1122,7 +1122,7 @@ mymain(void) DO_TEST_CPUID(VIR_ARCH_X86_64, "Atom-D510", JSON_NONE); DO_TEST_CPUID(VIR_ARCH_X86_64, "Atom-N450", JSON_NONE); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-2500", JSON_HOST); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-2540M", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-2540M", JSON_MODELS); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-4670T", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-6600", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-2600", JSON_HOST); diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-2540M.json b/tests/cput= estdata/x86_64-cpuid-Core-i5-2540M.json index d813326f6f..a8ed64ed63 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-2540M.json +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-2540M.json @@ -201,3 +201,365 @@ }, "id": "model-expansion" } + +{ + "return": [ + { + "typename": "max-x86_64-cpu", + "unavailable-features": [], + "migration-safe": false, + "static": false, + "name": "max" + }, + { + "typename": "host-x86_64-cpu", + "unavailable-features": [], + "migration-safe": false, + "static": false, + "name": "host" + }, + { + "typename": "base-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": true, + "name": "base" + }, + { + "typename": "qemu64-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "qemu64" + }, + { + "typename": "qemu32-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "qemu32" + }, + { + "typename": "phenom-x86_64-cpu", + "unavailable-features": [ + "mmxext", + "fxsr-opt", + "pdpe1gb", + "3dnowext", + "3dnow", + "abm", + "sse4a", + "npt" + ], + "migration-safe": true, + "static": false, + "name": "phenom" + }, + { + "typename": "pentium3-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium3" + }, + { + "typename": "pentium2-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium2" + }, + { + "typename": "pentium-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium" + }, + { + "typename": "n270-x86_64-cpu", + "unavailable-features": [ + "movbe" + ], + "migration-safe": true, + "static": false, + "name": "n270" + }, + { + "typename": "kvm64-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "kvm64" + }, + { + "typename": "kvm32-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "kvm32" + }, + { + "typename": "coreduo-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "coreduo" + }, + { + "typename": "core2duo-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "core2duo" + }, + { + "typename": "athlon-x86_64-cpu", + "unavailable-features": [ + "mmxext", + "3dnowext", + "3dnow" + ], + "migration-safe": true, + "static": false, + "name": "athlon" + }, + { + "typename": "Westmere-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Westmere" + }, + { + "typename": "Skylake-Client-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "mpx", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch", + "xsavec", + "xgetbv1", + "mpx", + "mpx" + ], + "migration-safe": true, + "static": false, + "name": "Skylake-Client" + }, + { + "typename": "SandyBridge-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "SandyBridge" + }, + { + "typename": "Penryn-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Penryn" + }, + { + "typename": "Opteron_G5-x86_64-cpu", + "unavailable-features": [ + "fma", + "f16c", + "pdpe1gb", + "abm", + "sse4a", + "misalignsse", + "3dnowprefetch", + "xop", + "fma4", + "tbm" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G5" + }, + { + "typename": "Opteron_G4-x86_64-cpu", + "unavailable-features": [ + "pdpe1gb", + "abm", + "sse4a", + "misalignsse", + "3dnowprefetch", + "xop", + "fma4" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G4" + }, + { + "typename": "Opteron_G3-x86_64-cpu", + "unavailable-features": [ + "abm", + "sse4a", + "misalignsse" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G3" + }, + { + "typename": "Opteron_G2-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Opteron_G2" + }, + { + "typename": "Opteron_G1-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Opteron_G1" + }, + { + "typename": "Nehalem-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Nehalem" + }, + { + "typename": "IvyBridge-x86_64-cpu", + "unavailable-features": [ + "f16c", + "rdrand", + "fsgsbase", + "smep", + "erms" + ], + "migration-safe": true, + "static": false, + "name": "IvyBridge" + }, + { + "typename": "Haswell-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "abm" + ], + "migration-safe": true, + "static": false, + "name": "Haswell" + }, + { + "typename": "Haswell-noTSX-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "abm" + ], + "migration-safe": true, + "static": false, + "name": "Haswell-noTSX" + }, + { + "typename": "Conroe-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Conroe" + }, + { + "typename": "Broadwell-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch" + ], + "migration-safe": true, + "static": false, + "name": "Broadwell" + }, + { + "typename": "Broadwell-noTSX-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch" + ], + "migration-safe": true, + "static": false, + "name": "Broadwell-noTSX" + }, + { + "typename": "486-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "486" + } + ], + "id": "definitions" +} --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918982612232.9221014604925; Fri, 13 Oct 2017 11:23:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9F0D481E0C; Fri, 13 Oct 2017 18:23:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 789DE6BF65; Fri, 13 Oct 2017 18:23:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 440854EE4F; Fri, 13 Oct 2017 18:23:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF83G014179 for ; Fri, 13 Oct 2017 14:15:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 32D7360A9D; Fri, 13 Oct 2017 18:15:08 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 778E16BF62 for ; Fri, 13 Oct 2017 18:15:05 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 4370E1006F9; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9F0D481E0C Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:49 +0200 Message-Id: <6f693c0792fe19395dc5e511bfa643ba34463f9a.1507918308.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 17/22] cputest: Add CPUID data for Intel(R) Xeon(R) CPU E7-4830 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 13 Oct 2017 18:23:02 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change tests/cputest.c | 1 + .../x86_64-cpuid-Xeon-E7-4830-disabled.xml | 5 + .../x86_64-cpuid-Xeon-E7-4830-enabled.xml | 8 + .../x86_64-cpuid-Xeon-E7-4830-guest.xml | 28 +++ .../cputestdata/x86_64-cpuid-Xeon-E7-4830-host.xml | 29 +++ .../cputestdata/x86_64-cpuid-Xeon-E7-4830-json.xml | 13 ++ tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.json | 235 +++++++++++++++++= ++++ tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.xml | 30 +++ 8 files changed, 349 insertions(+) create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-disabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-enabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-guest.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-host.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-json.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.json create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.xml diff --git a/tests/cputest.c b/tests/cputest.c index a15b1c8935..43622eb74b 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -1149,6 +1149,7 @@ mymain(void) DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2630", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2650", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-4820", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-4830", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-8890", JSON_NONE); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-Gold-6148", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-W3520", JSON_HOST); diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-disabled.xml b/tes= ts/cputestdata/x86_64-cpuid-Xeon-E7-4830-disabled.xml new file mode 100644 index 0000000000..a9cbd949e4 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-disabled.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-enabled.xml b/test= s/cputestdata/x86_64-cpuid-Xeon-E7-4830-enabled.xml new file mode 100644 index 0000000000..1b80f414e5 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-enabled.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-guest.xml b/tests/= cputestdata/x86_64-cpuid-Xeon-E7-4830-guest.xml new file mode 100644 index 0000000000..dbf8580a0e --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-guest.xml @@ -0,0 +1,28 @@ + + SandyBridge + Intel + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-host.xml b/tests/c= putestdata/x86_64-cpuid-Xeon-E7-4830-host.xml new file mode 100644 index 0000000000..52902479b9 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-host.xml @@ -0,0 +1,29 @@ + + x86_64 + Westmere + Intel + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-json.xml b/tests/c= putestdata/x86_64-cpuid-Xeon-E7-4830-json.xml new file mode 100644 index 0000000000..c3f04d00d1 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-json.xml @@ -0,0 +1,13 @@ + + SandyBridge + Intel + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.json b/tests/cpute= stdata/x86_64-cpuid-Xeon-E7-4830.json new file mode 100644 index 0000000000..012e1d0c5c --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.json @@ -0,0 +1,235 @@ +{ + "return": { + "model": { + "name": "base", + "props": { + "pfthreshold": false, + "pku": false, + "rtm": false, + "tsc_adjust": true, + "tsc-deadline": true, + "xstore-en": false, + "cpuid-0xb": true, + "abm": false, + "ia64": false, + "kvm-mmu": false, + "xsaveopt": false, + "hv-spinlocks": -1, + "tce": false, + "realized": false, + "kvm_steal_time": true, + "smep": false, + "fpu": true, + "xcrypt": false, + "sse4_2": true, + "clflush": true, + "sse4_1": true, + "flushbyasid": false, + "kvm-steal-time": true, + "lm": true, + "tsc": true, + "adx": false, + "fxsr": true, + "sha-ni": false, + "decodeassists": false, + "hv-relaxed": false, + "pclmuldq": true, + "xgetbv1": false, + "xstore": false, + "vmcb_clean": false, + "tsc-adjust": true, + "vme": true, + "vendor": "GenuineIntel", + "arat": true, + "ffxsr": false, + "de": true, + "aes": true, + "pse": true, + "ds-cpl": false, + "fxsr_opt": false, + "tbm": false, + "sse": true, + "phe-en": false, + "f16c": false, + "ds": false, + "mpx": false, + "vmware-cpuid-freq": true, + "avx512f": false, + "avx2": false, + "level": 11, + "pbe": false, + "cx16": true, + "ds_cpl": false, + "movbe": false, + "perfctr-nb": false, + "nrip_save": false, + "kvm_mmu": false, + "ospke": false, + "pmu": false, + "avx512ifma": false, + "stepping": 2, + "sep": true, + "sse4a": false, + "avx512dq": false, + "core-id": -1, + "i64": true, + "avx512-4vnniw": false, + "xsave": false, + "pmm": false, + "hle": false, + "nodeid_msr": false, + "hv-crash": false, + "est": false, + "osxsave": false, + "xop": false, + "smx": false, + "tsc-scale": false, + "monitor": false, + "avx512er": false, + "apic": true, + "sse4.1": true, + "sse4.2": true, + "hv-vapic": false, + "pause-filter": false, + "lahf-lm": true, + "kvm-nopiodelay": true, + "cmp_legacy": false, + "acpi": false, + "fma4": false, + "mmx": true, + "svm_lock": false, + "pcommit": false, + "mtrr": true, + "clwb": false, + "dca": false, + "pdcm": false, + "xcrypt-en": false, + "3dnow": false, + "invtsc": false, + "tm2": false, + "hv-time": false, + "hypervisor": true, + "kvmclock-stable-bit": true, + "xlevel": 2147483656, + "lahf_lm": true, + "enforce": false, + "pcid": true, + "sse4-1": true, + "lbrv": false, + "avx512-vpopcntdq": false, + "avx512-4fmaps": false, + "fill-mtrr-mask": true, + "pause_filter": false, + "svm-lock": false, + "popcnt": true, + "nrip-save": false, + "avx512vl": false, + "x2apic": true, + "kvmclock": true, + "smap": false, + "pdpe1gb": true, + "family": 6, + "min-level": 11, + "xlevel2": 0, + "dtes64": false, + "xd": true, + "kvm_pv_eoi": true, + "ace2": false, + "kvm_pv_unhalt": true, + "xtpr": false, + "perfctr_nb": false, + "avx512bw": false, + "l3-cache": true, + "nx": true, + "lwp": false, + "msr": true, + "syscall": true, + "tm": false, + "perfctr-core": false, + "memory": "/machine/unattached/system[0]", + "pge": true, + "pn": false, + "fma": false, + "nodeid-msr": false, + "xsavec": false, + "socket-id": -1, + "thread-id": -1, + "cx8": true, + "mce": true, + "avx512cd": false, + "cr8legacy": false, + "mca": true, + "avx512pf": false, + "pni": true, + "hv-vendor-id": "", + "rdseed": false, + "osvw": false, + "fsgsbase": false, + "model-id": " Intel(R) Xeon(R) CPU E7- 4830 @ 2.13GHz", + "cmp-legacy": false, + "kvm-pv-unhalt": true, + "rdtscp": true, + "mmxext": false, + "host-phys-bits": true, + "cid": false, + "vmx": false, + "ssse3": true, + "extapic": false, + "pse36": true, + "min-xlevel": 2147483656, + "ibs": false, + "la57": false, + "avx": false, + "kvm-no-smi-migration": false, + "ace2-en": false, + "umip": false, + "invpcid": false, + "bmi1": false, + "bmi2": false, + "vmcb-clean": false, + "erms": false, + "cmov": true, + "check": true, + "perfctr_core": false, + "misalignsse": false, + "clflushopt": false, + "pat": true, + "sse4-2": true, + "3dnowprefetch": false, + "rdpid": false, + "full-cpuid-auto-level": true, + "pae": true, + "wdt": false, + "tsc_scale": false, + "skinit": false, + "fxsr-opt": false, + "kvm_nopiodelay": true, + "phys-bits": 0, + "kvm": true, + "pmm-en": false, + "phe": false, + "3dnowext": false, + "lmce": true, + "ht": false, + "tsc-frequency": 0, + "kvm-pv-eoi": true, + "npt": false, + "apic-id": 4294967295, + "kvm_asyncpf": true, + "min-xlevel2": 0, + "pclmulqdq": true, + "svm": false, + "sse3": true, + "sse2": true, + "ss": true, + "topoext": false, + "rdrand": false, + "avx512vbmi": false, + "kvm-asyncpf": true, + "xsaves": false, + "model": 47 + } + } + }, + "id": "model-expansion" +} diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.xml b/tests/cputes= tdata/x86_64-cpuid-Xeon-E7-4830.xml new file mode 100644 index 0000000000..d565238167 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918959007427.54081790982923; Fri, 13 Oct 2017 11:22:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2DFE70AB9; Fri, 13 Oct 2017 18:22:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F1F76BF62; Fri, 13 Oct 2017 18:22:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 67FC518355E3; Fri, 13 Oct 2017 18:22:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF8G6014187 for ; Fri, 13 Oct 2017 14:15:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6A1F61814C; Fri, 13 Oct 2017 18:15:08 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAC2217C1B for ; Fri, 13 Oct 2017 18:15:05 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 462A41006F6; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E2DFE70AB9 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:50 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 18/22] cputest: Add query-cpu-definitions reply for Xeon-E7-4830 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 13 Oct 2017 18:22:38 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This CPU was incorrectly detected as SandyBridge before because the number of additional elements was the same for both SandyBridge and Westmere CPU models, but SandyBridge is newer (the CPU signature does not help here because it doesn't match any signature defined in cpu_map.xml). But since QEMU's version of SandyBridge CPU model contains xsaveopt which needs to be disabled, Westmere becomes the best CPU model when translating CPUID data to virCPUDef. Unfortunately, this doesn't help with translating the data we got from QEMU and the CPU model is still computed as SandyBridge in this case. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change tests/cputest.c | 2 +- .../x86_64-cpuid-Xeon-E7-4830-guest.xml | 8 +- .../cputestdata/x86_64-cpuid-Xeon-E7-4830-json.xml | 1 + tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.json | 422 +++++++++++++++++= ++++ 4 files changed, 428 insertions(+), 5 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index 43622eb74b..14512147df 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -1149,7 +1149,7 @@ mymain(void) DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2630", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2650", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-4820", JSON_HOST); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-4830", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-4830", JSON_MODELS); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-8890", JSON_NONE); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-Gold-6148", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-W3520", JSON_HOST); diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-guest.xml b/tests/= cputestdata/x86_64-cpuid-Xeon-E7-4830-guest.xml index dbf8580a0e..659779687a 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-guest.xml @@ -1,5 +1,5 @@ - SandyBridge + Westmere Intel @@ -8,6 +8,7 @@ + @@ -19,10 +20,9 @@ + + - - - diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-json.xml b/tests/c= putestdata/x86_64-cpuid-Xeon-E7-4830-json.xml index c3f04d00d1..aae32bd7e2 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830-json.xml @@ -10,4 +10,5 @@ + diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.json b/tests/cpute= stdata/x86_64-cpuid-Xeon-E7-4830.json index 012e1d0c5c..732f65d1d9 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.json +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4830.json @@ -233,3 +233,425 @@ }, "id": "model-expansion" } + +{ + "return": [ + { + "typename": "max-x86_64-cpu", + "unavailable-features": [], + "migration-safe": false, + "static": false, + "name": "max" + }, + { + "typename": "host-x86_64-cpu", + "unavailable-features": [], + "migration-safe": false, + "static": false, + "name": "host" + }, + { + "typename": "base-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": true, + "name": "base" + }, + { + "typename": "qemu64-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "qemu64" + }, + { + "typename": "qemu32-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "qemu32" + }, + { + "typename": "phenom-x86_64-cpu", + "unavailable-features": [ + "mmxext", + "fxsr-opt", + "3dnowext", + "3dnow", + "abm", + "sse4a", + "npt" + ], + "migration-safe": true, + "static": false, + "name": "phenom" + }, + { + "typename": "pentium3-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium3" + }, + { + "typename": "pentium2-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium2" + }, + { + "typename": "pentium-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium" + }, + { + "typename": "n270-x86_64-cpu", + "unavailable-features": [ + "movbe" + ], + "migration-safe": true, + "static": false, + "name": "n270" + }, + { + "typename": "kvm64-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "kvm64" + }, + { + "typename": "kvm32-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "kvm32" + }, + { + "typename": "cpu64-rhel6-x86_64-cpu", + "unavailable-features": [ + "abm", + "sse4a" + ], + "migration-safe": true, + "static": false, + "name": "cpu64-rhel6" + }, + { + "typename": "coreduo-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "coreduo" + }, + { + "typename": "core2duo-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "core2duo" + }, + { + "typename": "athlon-x86_64-cpu", + "unavailable-features": [ + "mmxext", + "3dnowext", + "3dnow" + ], + "migration-safe": true, + "static": false, + "name": "athlon" + }, + { + "typename": "Westmere-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Westmere" + }, + { + "typename": "Skylake-Client-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "xsave", + "avx", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "mpx", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch", + "xsaveopt", + "xsavec", + "xgetbv1", + "xsave", + "xsave", + "avx", + "mpx", + "mpx" + ], + "migration-safe": true, + "static": false, + "name": "Skylake-Client" + }, + { + "typename": "SandyBridge-x86_64-cpu", + "unavailable-features": [ + "xsave", + "avx", + "xsaveopt", + "xsave", + "xsave", + "avx" + ], + "migration-safe": true, + "static": false, + "name": "SandyBridge" + }, + { + "typename": "Penryn-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Penryn" + }, + { + "typename": "Opteron_G5-x86_64-cpu", + "unavailable-features": [ + "fma", + "xsave", + "avx", + "f16c", + "abm", + "sse4a", + "misalignsse", + "3dnowprefetch", + "xop", + "fma4", + "tbm", + "xsave", + "xsave", + "avx" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G5" + }, + { + "typename": "Opteron_G4-x86_64-cpu", + "unavailable-features": [ + "xsave", + "avx", + "abm", + "sse4a", + "misalignsse", + "3dnowprefetch", + "xop", + "fma4", + "xsave", + "xsave", + "avx" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G4" + }, + { + "typename": "Opteron_G3-x86_64-cpu", + "unavailable-features": [ + "abm", + "sse4a", + "misalignsse" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G3" + }, + { + "typename": "Opteron_G2-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Opteron_G2" + }, + { + "typename": "Opteron_G1-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Opteron_G1" + }, + { + "typename": "Nehalem-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Nehalem" + }, + { + "typename": "IvyBridge-x86_64-cpu", + "unavailable-features": [ + "xsave", + "avx", + "f16c", + "rdrand", + "fsgsbase", + "smep", + "erms", + "xsaveopt", + "xsave", + "xsave", + "avx" + ], + "migration-safe": true, + "static": false, + "name": "IvyBridge" + }, + { + "typename": "Haswell-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "xsave", + "avx", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "abm", + "xsaveopt", + "xsave", + "xsave", + "avx" + ], + "migration-safe": true, + "static": false, + "name": "Haswell" + }, + { + "typename": "Haswell-noTSX-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "xsave", + "avx", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "abm", + "xsaveopt", + "xsave", + "xsave", + "avx" + ], + "migration-safe": true, + "static": false, + "name": "Haswell-noTSX" + }, + { + "typename": "Conroe-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Conroe" + }, + { + "typename": "Broadwell-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "xsave", + "avx", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch", + "xsaveopt", + "xsave", + "xsave", + "avx" + ], + "migration-safe": true, + "static": false, + "name": "Broadwell" + }, + { + "typename": "Broadwell-noTSX-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "xsave", + "avx", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch", + "xsaveopt", + "xsave", + "xsave", + "avx" + ], + "migration-safe": true, + "static": false, + "name": "Broadwell-noTSX" + }, + { + "typename": "486-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "486" + } + ], + "id": "definitions" +} --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918961124778.6085873343984; Fri, 13 Oct 2017 11:22:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CE22C059B8B; Fri, 13 Oct 2017 18:22:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E2FF1822C; Fri, 13 Oct 2017 18:22:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CCE93410B5; Fri, 13 Oct 2017 18:22:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF8hP014188 for ; Fri, 13 Oct 2017 14:15:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 69B765D722; Fri, 13 Oct 2017 18:15:08 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB1464F9E2 for ; Fri, 13 Oct 2017 18:15:05 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 495671006FA; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2CE22C059B8B Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:51 +0200 Message-Id: <088e7b1c51e7abdc43cbda3aadd0f098330510e2.1507918308.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 19/22] cputest: Update Xeon-E3-1245 data X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 13 Oct 2017 18:22:40 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" xsaves is supported by current QEMU/KVM on this CPU. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change .../x86_64-cpuid-Xeon-E3-1245-disabled.xml | 1 - .../x86_64-cpuid-Xeon-E3-1245-enabled.xml | 2 +- .../cputestdata/x86_64-cpuid-Xeon-E3-1245-json.xml | 1 + tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.json | 413 +++++++++++------= ---- tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.xml | 7 +- 5 files changed, 232 insertions(+), 192 deletions(-) diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-disabled.xml b/tes= ts/cputestdata/x86_64-cpuid-Xeon-E3-1245-disabled.xml index 1a177705a8..4a0477f788 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-disabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-disabled.xml @@ -1,6 +1,5 @@ - diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-enabled.xml b/test= s/cputestdata/x86_64-cpuid-Xeon-E3-1245-enabled.xml index 2584042339..f31f7317b6 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-enabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-enabled.xml @@ -3,7 +3,7 @@ - + diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-json.xml b/tests/c= putestdata/x86_64-cpuid-Xeon-E3-1245-json.xml index 7af75509e6..ad98679027 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-json.xml @@ -6,5 +6,6 @@ + diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.json b/tests/cpute= stdata/x86_64-cpuid-Xeon-E3-1245.json index 4828da5884..bb5d7d8830 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.json +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.json @@ -3,199 +3,238 @@ "model": { "name": "base", "props": { - "pfthreshold": false, - "pku": false, - "rtm": true, - "tsc_adjust": true, - "tsc-deadline": true, - "xstore-en": false, - "tsc-scale": false, - "sse": true, - "smap": true, - "stepping": 3, - "tce": false, - "kvm_steal_time": true, - "smep": true, - "rdpid": false, - "xcrypt": false, - "sse4_2": true, - "monitor": false, - "sse4_1": true, - "kvm-mmu": false, - "flushbyasid": false, - "kvm-steal-time": true, - "lm": true, - "tsc": true, - "adx": true, - "fxsr": true, - "sha-ni": false, - "tm": false, - "pclmuldq": true, - "xgetbv1": true, - "xstore": false, - "vmcb_clean": false, - "vme": true, - "vendor": "GenuineIntel", - "arat": true, - "ffxsr": false, - "de": true, - "avx512f": false, - "pse": true, - "ds-cpl": false, - "tbm": false, - "ia64": false, - "phe-en": false, - "f16c": true, - "ds": false, - "mpx": true, - "tsc-adjust": true, - "aes": true, - "avx2": true, - "pbe": false, - "cx16": true, - "ds_cpl": false, - "movbe": true, - "perfctr-nb": false, - "nrip_save": false, - "kvm_mmu": false, - "ospke": false, - "avx512ifma": false, - "vmx": true, - "sep": true, - "xsaveopt": true, - "sse4a": false, - "avx512dq": false, - "i64": true, - "avx512-4vnniw": false, - "xsave": true, - "erms": true, - "hle": true, - "nodeid_msr": false, - "est": false, - "svm_lock": false, - "xop": false, - "model-id": "Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz", - "abm": true, - "avx512er": false, - "sse4.1": true, - "sse4.2": true, - "pause-filter": false, - "lahf-lm": true, - "kvm-nopiodelay": true, - "cmp_legacy": false, - "acpi": false, - "fma4": false, - "popcnt": true, - "mmx": true, - "osxsave": false, - "pcommit": false, - "avx512pf": false, - "clwb": false, - "dca": false, - "pdcm": false, - "xcrypt-en": false, - "3dnow": false, - "invtsc": false, - "tm2": false, - "hypervisor": true, - "kvmclock-stable-bit": true, - "fxsr-opt": false, - "pcid": true, - "sse4-1": true, - "sse4-2": true, - "avx512-vpopcntdq": false, - "avx512-4fmaps": false, - "pause_filter": false, - "svm-lock": false, - "rdrand": true, - "nrip-save": false, - "avx512vl": false, - "x2apic": true, - "kvmclock": true, - "pge": true, - "family": 6, - "dtes64": false, - "xd": true, - "kvm_pv_eoi": true, - "ace2": false, - "kvm_pv_unhalt": true, - "xtpr": false, - "perfctr_nb": false, - "avx512bw": false, - "nx": true, - "lwp": false, - "msr": true, - "ace2-en": false, - "decodeassists": false, - "perfctr-core": false, - "pn": false, - "fma": true, - "nodeid-msr": false, - "kvm_asyncpf": true, - "clflush": true, - "cx8": true, - "mce": true, - "avx512cd": false, - "cr8legacy": false, - "mca": true, - "pni": true, - "rdseed": true, - "apic": true, - "fsgsbase": true, - "cmp-legacy": false, - "kvm-pv-unhalt": true, - "rdtscp": true, - "mmxext": false, - "cid": false, - "ssse3": true, - "extapic": false, - "pse36": true, - "mtrr": true, - "ibs": false, - "la57": false, - "avx": true, - "syscall": true, - "umip": false, - "invpcid": true, - "avx512vbmi": false, - "kvm-asyncpf": true, - "vmcb-clean": false, - "pmm": false, + "phys-bits": 0, + "core-id": -1, + "xlevel": 2147483656, "cmov": true, - "perfctr_core": false, - "misalignsse": false, - "clflushopt": true, - "pat": true, - "lbrv": false, - "3dnowprefetch": true, - "fpu": true, - "pae": true, - "wdt": false, - "tsc_scale": false, - "skinit": false, - "fxsr_opt": false, - "kvm_nopiodelay": true, - "pmm-en": false, - "phe": false, - "3dnowext": false, - "osvw": false, - "ht": false, - "pdpe1gb": true, - "kvm-pv-eoi": true, - "npt": false, + "ia64": false, + "aes": true, + "mmx": true, + "arat": true, + "rdpid": false, + "pause-filter": false, "xsavec": true, - "lahf_lm": true, - "pclmulqdq": true, + "osxsave": false, + "tsc-frequency": 0, + "xd": true, + "hv-vendor-id": "", + "kvm-asyncpf": true, + "kvm_asyncpf": true, + "perfctr_core": false, + "perfctr-core": false, + "mpx": true, + "avx512cd": false, + "decodeassists": false, + "pbe": false, + "sse4_1": true, + "sse4.1": true, + "sse4-1": true, + "family": 6, + "vmware-cpuid-freq": true, + "avx512f": false, + "xcrypt": false, + "hv-runtime": false, + "msr": true, + "mce": true, + "mca": true, + "thread-id": -1, + "min-level": 13, + "xgetbv1": true, + "cid": false, + "hv-relaxed": false, + "fxsr": true, + "ds": false, + "hv-crash": false, + "xsaveopt": true, + "xtpr": false, + "avx512-vpopcntdq": false, + "phe": false, + "avx512vl": false, + "extapic": false, + "3dnowprefetch": true, + "cr8legacy": false, + "cpuid-0xb": true, + "xcrypt-en": false, + "kvm_pv_eoi": true, + "apic-id": 4294967295, + "pn": false, + "dca": false, + "vendor": "GenuineIntel", + "pku": false, + "smx": false, + "cmp-legacy": false, + "cmp_legacy": false, + "node-id": -1, + "avx512-4fmaps": false, + "vmcb-clean": false, + "vmcb_clean": false, + "3dnowext": false, + "hle": true, + "npt": false, + "memory": "/machine/unattached/system[0]", + "clwb": false, + "lbrv": false, + "adx": true, + "ss": true, + "pni": true, + "svm_lock": false, + "svm-lock": false, + "smep": true, + "pfthreshold": false, + "smap": true, + "x2apic": true, + "avx512vbmi": false, + "hv-stimer": false, + "i64": true, + "flushbyasid": false, + "f16c": true, + "ace2-en": false, + "pat": true, + "pae": true, + "sse": true, + "phe-en": false, + "kvm-nopiodelay": true, + "kvm_nopiodelay": true, + "tm": false, + "kvmclock-stable-bit": true, + "hypervisor": true, + "socket-id": -1, + "pcommit": false, + "syscall": true, + "level": 13, + "avx512dq": false, "svm": false, + "full-cpuid-auto-level": true, + "hv-reset": false, + "invtsc": false, "sse3": true, "sse2": true, - "ss": true, - "topoext": false, - "smx": false, - "bmi1": true, + "est": false, + "avx512ifma": false, + "tm2": false, + "kvm-pv-eoi": true, + "cx8": true, + "kvm-mmu": false, + "kvm_mmu": false, + "sse4_2": true, + "sse4.2": true, + "sse4-2": true, + "pge": true, + "fill-mtrr-mask": true, + "pdcm": false, + "nodeid_msr": false, + "model": 94, + "movbe": true, + "nrip-save": false, + "nrip_save": false, + "sse4a": false, + "ssse3": true, + "kvm_pv_unhalt": true, + "invpcid": true, + "pdpe1gb": true, + "tsc-deadline": true, + "fma": true, + "cx16": true, + "de": true, + "enforce": false, + "stepping": 3, + "xsave": true, + "clflush": true, + "skinit": false, + "tce": false, + "tsc": true, + "fpu": true, + "ds-cpl": false, + "ds_cpl": false, + "ibs": false, + "host-phys-bits": false, + "fma4": false, + "la57": false, + "osvw": false, + "check": true, + "hv-spinlocks": -1, + "pmm": false, + "apic": true, + "pmu": false, + "min-xlevel2": 0, + "tsc-adjust": true, + "tsc_adjust": true, + "kvm-steal-time": true, + "kvm_steal_time": true, + "kvmclock": true, + "l3-cache": true, + "lwp": false, + "xop": false, + "avx": true, + "ospke": false, + "ace2": false, + "acpi": false, + "avx512bw": false, + "hv-vapic": false, + "fsgsbase": true, + "ht": false, + "nx": true, + "pclmulqdq": true, + "mmxext": false, + "popcnt": true, + "xsaves": true, + "tcg-cpuid": true, + "lm": true, + "umip": false, + "avx2": true, + "pse": true, + "sep": true, + "pclmuldq": true, + "nodeid-msr": false, + "kvm": true, + "misalignsse": false, + "min-xlevel": 2147483656, "bmi2": true, - "xsaves": false, - "model": 94 + "bmi1": true, + "kvm-pv-unhalt": true, + "realized": false, + "tsc_scale": false, + "tsc-scale": false, + "topoext": false, + "hv-vpindex": false, + "xlevel2": 0, + "clflushopt": true, + "kvm-no-smi-migration": false, + "monitor": false, + "avx512er": false, + "pmm-en": false, + "pcid": true, + "3dnow": false, + "erms": true, + "lahf-lm": true, + "lahf_lm": true, + "xstore": false, + "hv-synic": false, + "fxsr-opt": false, + "fxsr_opt": false, + "rtm": true, + "lmce": true, + "hv-time": false, + "perfctr-nb": false, + "perfctr_nb": false, + "ffxsr": false, + "rdrand": true, + "rdseed": true, + "avx512-4vnniw": false, + "vme": true, + "vmx": true, + "dtes64": false, + "mtrr": true, + "rdtscp": true, + "pse36": true, + "tbm": false, + "wdt": false, + "pause_filter": false, + "model-id": "Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz", + "sha-ni": false, + "abm": true, + "avx512pf": false, + "xstore-en": false } } }, diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.xml b/tests/cputes= tdata/x86_64-cpuid-Xeon-E3-1245.xml index 42992db7d9..f130a70f37 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.xml @@ -1,7 +1,7 @@ - + @@ -14,14 +14,15 @@ - - + + + --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15079189880671007.4704845444177; Fri, 13 Oct 2017 11:23:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 049E483F40; Fri, 13 Oct 2017 18:23:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CEBFB5D6A8; Fri, 13 Oct 2017 18:23:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B725418355EA; Fri, 13 Oct 2017 18:22:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF6rN014129 for ; Fri, 13 Oct 2017 14:15:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3B4F6614F7; Fri, 13 Oct 2017 18:15:06 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3A846BF66 for ; Fri, 13 Oct 2017 18:15:05 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 4CA0F1006FB; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 049E483F40 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:52 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 20/22] cputest: Add query-cpu-definitions reply for Xeon-E3-1245 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 13 Oct 2017 18:23:07 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change tests/cputest.c | 2 +- tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.json | 299 +++++++++++++++++++= ++++ 2 files changed, 300 insertions(+), 1 deletion(-) diff --git a/tests/cputest.c b/tests/cputest.c index 14512147df..cceb4c82bf 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -1145,7 +1145,7 @@ mymain(void) DO_TEST_CPUID(VIR_ARCH_X86_64, "Phenom-B95", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Ryzen-7-1800X-Eight-Core", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-5110", JSON_NONE); - DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E3-1245", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E3-1245", JSON_MODELS); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2630", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E5-2650", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-4820", JSON_HOST); diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.json b/tests/cpute= stdata/x86_64-cpuid-Xeon-E3-1245.json index bb5d7d8830..33d8221853 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.json +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245.json @@ -240,3 +240,302 @@ }, "id": "model-expansion" } + +{ + "return": [ + { + "name": "max", + "typename": "max-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": false + }, + { + "name": "host", + "typename": "host-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": false + }, + { + "name": "base", + "typename": "base-x86_64-cpu", + "unavailable-features": [ + ], + "static": true, + "migration-safe": true + }, + { + "name": "qemu64", + "typename": "qemu64-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "qemu32", + "typename": "qemu32-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "phenom", + "typename": "phenom-x86_64-cpu", + "unavailable-features": [ + "mmxext", + "fxsr-opt", + "3dnowext", + "3dnow", + "sse4a", + "npt" + ], + "static": false, + "migration-safe": true + }, + { + "name": "pentium3", + "typename": "pentium3-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "pentium2", + "typename": "pentium2-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "pentium", + "typename": "pentium-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "n270", + "typename": "n270-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "kvm64", + "typename": "kvm64-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "kvm32", + "typename": "kvm32-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "coreduo", + "typename": "coreduo-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "core2duo", + "typename": "core2duo-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "athlon", + "typename": "athlon-x86_64-cpu", + "unavailable-features": [ + "mmxext", + "3dnowext", + "3dnow" + ], + "static": false, + "migration-safe": true + }, + { + "name": "Westmere", + "typename": "Westmere-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "Skylake-Server", + "typename": "Skylake-Server-x86_64-cpu", + "unavailable-features": [ + "avx512f", + "avx512dq", + "clwb", + "avx512cd", + "avx512bw", + "avx512vl", + "avx512f", + "avx512f", + "avx512f" + ], + "static": false, + "migration-safe": true + }, + { + "name": "Skylake-Client", + "typename": "Skylake-Client-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "SandyBridge", + "typename": "SandyBridge-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "Penryn", + "typename": "Penryn-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "Opteron_G5", + "typename": "Opteron_G5-x86_64-cpu", + "unavailable-features": [ + "sse4a", + "misalignsse", + "xop", + "fma4", + "tbm" + ], + "static": false, + "migration-safe": true + }, + { + "name": "Opteron_G4", + "typename": "Opteron_G4-x86_64-cpu", + "unavailable-features": [ + "sse4a", + "misalignsse", + "xop", + "fma4" + ], + "static": false, + "migration-safe": true + }, + { + "name": "Opteron_G3", + "typename": "Opteron_G3-x86_64-cpu", + "unavailable-features": [ + "sse4a", + "misalignsse" + ], + "static": false, + "migration-safe": true + }, + { + "name": "Opteron_G2", + "typename": "Opteron_G2-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "Opteron_G1", + "typename": "Opteron_G1-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "Nehalem", + "typename": "Nehalem-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "IvyBridge", + "typename": "IvyBridge-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "Haswell", + "typename": "Haswell-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "Haswell-noTSX", + "typename": "Haswell-noTSX-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "Conroe", + "typename": "Conroe-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "Broadwell", + "typename": "Broadwell-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "Broadwell-noTSX", + "typename": "Broadwell-noTSX-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + }, + { + "name": "486", + "typename": "486-x86_64-cpu", + "unavailable-features": [ + ], + "static": false, + "migration-safe": true + } + ], + "id": "definitions" +} --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507918953858355.3462360808321; Fri, 13 Oct 2017 11:22:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B185A7AEB7; Fri, 13 Oct 2017 18:22:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8FB28614FF; Fri, 13 Oct 2017 18:22:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 545C318355E0; Fri, 13 Oct 2017 18:22:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF6Du014139 for ; Fri, 13 Oct 2017 14:15:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C70460176; Fri, 13 Oct 2017 18:15:06 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCC5B50ED8 for ; Fri, 13 Oct 2017 18:15:05 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 5001C1006FC; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B185A7AEB7 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:53 +0200 Message-Id: <0d84be251409ddffdf621ba9d6bc8f94e3cfdeda.1507918308.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 21/22] cputest: Update Core-i7-2600 data X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 13 Oct 2017 18:22:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" arat is now enabled even if the hardware does not support it. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change .../x86_64-cpuid-Core-i7-2600-disabled.xml | 1 - .../x86_64-cpuid-Core-i7-2600-enabled.xml | 1 + .../cputestdata/x86_64-cpuid-Core-i7-2600-json.xml | 1 + tests/cputestdata/x86_64-cpuid-Core-i7-2600.json | 496 +++++++++++++++++= ++-- tests/cputestdata/x86_64-cpuid-Core-i7-2600.xml | 6 +- 5 files changed, 455 insertions(+), 50 deletions(-) diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-disabled.xml b/tes= ts/cputestdata/x86_64-cpuid-Core-i7-2600-disabled.xml index f25d2888eb..510cd97a5b 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-disabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-disabled.xml @@ -1,6 +1,5 @@ - diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-enabled.xml b/test= s/cputestdata/x86_64-cpuid-Core-i7-2600-enabled.xml index df99a21807..1581f800f1 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-enabled.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-enabled.xml @@ -1,6 +1,7 @@ + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-json.xml b/tests/c= putestdata/x86_64-cpuid-Core-i7-2600-json.xml index 25c87e164e..c9ae651922 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-json.xml @@ -5,6 +5,7 @@ + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600.json b/tests/cpute= stdata/x86_64-cpuid-Core-i7-2600.json index 19c448c10b..c80c89b0d7 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-2600.json +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600.json @@ -9,19 +9,21 @@ "tsc_adjust": true, "tsc-deadline": true, "xstore-en": false, - "tsc-scale": false, - "sse": true, - "smap": false, - "stepping": 7, + "cpuid-0xb": true, + "abm": false, + "ia64": false, + "kvm-mmu": false, + "xsaveopt": true, + "hv-spinlocks": -1, "tce": false, + "realized": false, "kvm_steal_time": true, "smep": false, - "rdpid": false, + "fpu": true, "xcrypt": false, "sse4_2": true, - "monitor": false, + "clflush": true, "sse4_1": true, - "kvm-mmu": false, "flushbyasid": false, "kvm-steal-time": true, "lm": true, @@ -29,28 +31,32 @@ "adx": false, "fxsr": true, "sha-ni": false, - "tm": false, + "decodeassists": false, + "hv-relaxed": false, "pclmuldq": true, "xgetbv1": false, "xstore": false, "vmcb_clean": false, + "tsc-adjust": true, "vme": true, "vendor": "GenuineIntel", - "arat": false, + "arat": true, "ffxsr": false, "de": true, - "avx512f": false, + "aes": true, "pse": true, "ds-cpl": false, + "fxsr_opt": false, "tbm": false, - "ia64": false, + "sse": true, "phe-en": false, "f16c": false, "ds": false, "mpx": false, - "tsc-adjust": true, - "aes": true, + "vmware-cpuid-freq": true, + "avx512f": false, "avx2": false, + "level": 13, "pbe": false, "cx16": true, "ds_cpl": false, @@ -59,37 +65,41 @@ "nrip_save": false, "kvm_mmu": false, "ospke": false, + "pmu": false, "avx512ifma": false, - "vmx": false, + "stepping": 7, "sep": true, - "xsaveopt": true, "sse4a": false, "avx512dq": false, + "core-id": -1, "i64": true, "avx512-4vnniw": false, "xsave": true, - "erms": false, + "pmm": false, "hle": false, "nodeid_msr": false, + "hv-crash": false, "est": false, - "svm_lock": false, + "osxsave": false, "xop": false, - "model-id": " Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz", - "abm": false, + "smx": false, + "tsc-scale": false, + "monitor": false, "avx512er": false, + "apic": true, "sse4.1": true, "sse4.2": true, + "hv-vapic": false, "pause-filter": false, "lahf-lm": true, "kvm-nopiodelay": true, "cmp_legacy": false, "acpi": false, "fma4": false, - "popcnt": true, "mmx": true, - "osxsave": false, + "svm_lock": false, "pcommit": false, - "avx512pf": false, + "mtrr": true, "clwb": false, "dca": false, "pdcm": false, @@ -97,23 +107,30 @@ "3dnow": false, "invtsc": false, "tm2": false, + "hv-time": false, "hypervisor": true, "kvmclock-stable-bit": true, - "fxsr-opt": false, + "xlevel": 2147483656, + "lahf_lm": true, + "enforce": false, "pcid": true, "sse4-1": true, - "sse4-2": true, + "lbrv": false, "avx512-vpopcntdq": false, "avx512-4fmaps": false, + "fill-mtrr-mask": true, "pause_filter": false, "svm-lock": false, - "rdrand": false, + "popcnt": true, "nrip-save": false, "avx512vl": false, "x2apic": true, "kvmclock": true, - "pge": true, + "smap": false, + "pdpe1gb": false, "family": 6, + "min-level": 13, + "xlevel2": 0, "dtes64": false, "xd": true, "kvm_pv_eoi": true, @@ -122,78 +139,93 @@ "xtpr": false, "perfctr_nb": false, "avx512bw": false, + "l3-cache": true, "nx": true, "lwp": false, "msr": true, - "ace2-en": false, - "decodeassists": false, + "syscall": true, + "tm": false, "perfctr-core": false, + "memory": "/machine/unattached/system[0]", + "pge": true, "pn": false, "fma": false, "nodeid-msr": false, - "kvm_asyncpf": true, - "clflush": true, + "xsavec": false, + "socket-id": -1, + "thread-id": -1, "cx8": true, "mce": true, "avx512cd": false, "cr8legacy": false, "mca": true, + "avx512pf": false, "pni": true, + "hv-vendor-id": "", "rdseed": false, - "apic": true, + "osvw": false, "fsgsbase": false, + "model-id": " Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz", "cmp-legacy": false, "kvm-pv-unhalt": true, "rdtscp": true, "mmxext": false, + "host-phys-bits": true, "cid": false, + "vmx": false, "ssse3": true, "extapic": false, "pse36": true, - "mtrr": true, + "min-xlevel": 2147483656, "ibs": false, "la57": false, "avx": true, - "syscall": true, + "kvm-no-smi-migration": false, + "ace2-en": false, "umip": false, "invpcid": false, - "avx512vbmi": false, - "kvm-asyncpf": true, + "bmi1": false, + "bmi2": false, "vmcb-clean": false, - "pmm": false, + "erms": false, "cmov": true, + "check": true, "perfctr_core": false, "misalignsse": false, "clflushopt": false, "pat": true, - "lbrv": false, + "sse4-2": true, "3dnowprefetch": false, - "fpu": true, + "rdpid": false, + "full-cpuid-auto-level": true, "pae": true, "wdt": false, "tsc_scale": false, "skinit": false, - "fxsr_opt": false, + "fxsr-opt": false, "kvm_nopiodelay": true, + "phys-bits": 0, + "kvm": true, "pmm-en": false, "phe": false, "3dnowext": false, - "osvw": false, + "lmce": true, "ht": false, - "pdpe1gb": false, + "tsc-frequency": 0, "kvm-pv-eoi": true, "npt": false, - "xsavec": false, - "lahf_lm": true, + "apic-id": 4294967295, + "kvm_asyncpf": true, + "min-xlevel2": 0, "pclmulqdq": true, "svm": false, "sse3": true, "sse2": true, "ss": true, "topoext": false, - "smx": false, - "bmi1": false, - "bmi2": false, + "rdrand": false, + "avx512vbmi": false, + "kvm-asyncpf": true, "xsaves": false, "model": 42 } @@ -201,3 +233,375 @@ }, "id": "model-expansion" } + +{ + "return": [ + { + "typename": "max-x86_64-cpu", + "unavailable-features": [], + "migration-safe": false, + "static": false, + "name": "max" + }, + { + "typename": "host-x86_64-cpu", + "unavailable-features": [], + "migration-safe": false, + "static": false, + "name": "host" + }, + { + "typename": "base-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": true, + "name": "base" + }, + { + "typename": "qemu64-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "qemu64" + }, + { + "typename": "qemu32-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "qemu32" + }, + { + "typename": "phenom-x86_64-cpu", + "unavailable-features": [ + "mmxext", + "fxsr-opt", + "pdpe1gb", + "3dnowext", + "3dnow", + "abm", + "sse4a", + "npt" + ], + "migration-safe": true, + "static": false, + "name": "phenom" + }, + { + "typename": "pentium3-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium3" + }, + { + "typename": "pentium2-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium2" + }, + { + "typename": "pentium-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium" + }, + { + "typename": "n270-x86_64-cpu", + "unavailable-features": [ + "movbe" + ], + "migration-safe": true, + "static": false, + "name": "n270" + }, + { + "typename": "kvm64-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "kvm64" + }, + { + "typename": "kvm32-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "kvm32" + }, + { + "typename": "cpu64-rhel6-x86_64-cpu", + "unavailable-features": [ + "abm", + "sse4a" + ], + "migration-safe": true, + "static": false, + "name": "cpu64-rhel6" + }, + { + "typename": "coreduo-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "coreduo" + }, + { + "typename": "core2duo-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "core2duo" + }, + { + "typename": "athlon-x86_64-cpu", + "unavailable-features": [ + "mmxext", + "3dnowext", + "3dnow" + ], + "migration-safe": true, + "static": false, + "name": "athlon" + }, + { + "typename": "Westmere-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Westmere" + }, + { + "typename": "Skylake-Client-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "mpx", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch", + "xsavec", + "xgetbv1", + "mpx", + "mpx" + ], + "migration-safe": true, + "static": false, + "name": "Skylake-Client" + }, + { + "typename": "SandyBridge-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "SandyBridge" + }, + { + "typename": "Penryn-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Penryn" + }, + { + "typename": "Opteron_G5-x86_64-cpu", + "unavailable-features": [ + "fma", + "f16c", + "pdpe1gb", + "abm", + "sse4a", + "misalignsse", + "3dnowprefetch", + "xop", + "fma4", + "tbm" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G5" + }, + { + "typename": "Opteron_G4-x86_64-cpu", + "unavailable-features": [ + "pdpe1gb", + "abm", + "sse4a", + "misalignsse", + "3dnowprefetch", + "xop", + "fma4" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G4" + }, + { + "typename": "Opteron_G3-x86_64-cpu", + "unavailable-features": [ + "abm", + "sse4a", + "misalignsse" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G3" + }, + { + "typename": "Opteron_G2-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Opteron_G2" + }, + { + "typename": "Opteron_G1-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Opteron_G1" + }, + { + "typename": "Nehalem-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Nehalem" + }, + { + "typename": "IvyBridge-x86_64-cpu", + "unavailable-features": [ + "f16c", + "rdrand", + "fsgsbase", + "smep", + "erms" + ], + "migration-safe": true, + "static": false, + "name": "IvyBridge" + }, + { + "typename": "Haswell-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "abm" + ], + "migration-safe": true, + "static": false, + "name": "Haswell" + }, + { + "typename": "Haswell-noTSX-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "abm" + ], + "migration-safe": true, + "static": false, + "name": "Haswell-noTSX" + }, + { + "typename": "Conroe-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Conroe" + }, + { + "typename": "Broadwell-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch" + ], + "migration-safe": true, + "static": false, + "name": "Broadwell" + }, + { + "typename": "Broadwell-noTSX-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch" + ], + "migration-safe": true, + "static": false, + "name": "Broadwell-noTSX" + }, + { + "typename": "486-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "486" + } + ], + "id": "definitions" +} diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600.xml b/tests/cputes= tdata/x86_64-cpuid-Core-i7-2600.xml index ad15597d6b..8c0f847fef 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-2600.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600.xml @@ -1,7 +1,7 @@ - + @@ -14,8 +14,8 @@ - - + + --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 18:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507920420458523.6649369853099; Fri, 13 Oct 2017 11:47:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F2784A6E9; Fri, 13 Oct 2017 18:46:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4E86817C1B; Fri, 13 Oct 2017 18:46:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 193263FACF; Fri, 13 Oct 2017 18:46:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9DIF6H0014134 for ; Fri, 13 Oct 2017 14:15:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5B9A65C543; Fri, 13 Oct 2017 18:15:06 +0000 (UTC) Received: from mamuti.net (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B28145C8A1 for ; Fri, 13 Oct 2017 18:15:05 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 58FAD1006FF; Fri, 13 Oct 2017 20:14:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6F2784A6E9 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 13 Oct 2017 20:14:54 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 22/22] cputest: Make a crippled version of Core-i7-2600 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 13 Oct 2017 18:46:58 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" xsaveopt is artificially removed from the host to test disabled feature which is only included in QEMU's version of the CPU model. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- Notes: Version 2: - no change tests/cputest.c | 1 + ...x86_64-cpuid-Core-i7-2600-xsaveopt-disabled.xml | 6 + .../x86_64-cpuid-Core-i7-2600-xsaveopt-enabled.xml | 8 + .../x86_64-cpuid-Core-i7-2600-xsaveopt-guest.xml | 25 + .../x86_64-cpuid-Core-i7-2600-xsaveopt-host.xml | 25 + .../x86_64-cpuid-Core-i7-2600-xsaveopt-json.xml | 11 + .../x86_64-cpuid-Core-i7-2600-xsaveopt.json | 615 +++++++++++++++++= ++++ .../x86_64-cpuid-Core-i7-2600-xsaveopt.xml | 33 ++ 8 files changed, 724 insertions(+) create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-di= sabled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-en= abled.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-gu= est.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-ho= st.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-js= on.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt.js= on create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt.xml diff --git a/tests/cputest.c b/tests/cputest.c index cceb4c82bf..f92e631773 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -1126,6 +1126,7 @@ mymain(void) DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-4670T", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i5-6600", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-2600", JSON_HOST); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-2600-xsaveopt", JSON_MODELS); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3520M", JSON_NONE); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3740QM", JSON_HOST); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3770", JSON_HOST); diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-disabled.= xml b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-disabled.xml new file mode 100644 index 0000000000..281cc1512a --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-disabled.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-enabled.x= ml b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-enabled.xml new file mode 100644 index 0000000000..3c2d7e33d6 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-enabled.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-guest.xml= b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-guest.xml new file mode 100644 index 0000000000..9bb60009e8 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-guest.xml @@ -0,0 +1,25 @@ + + SandyBridge + Intel + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-host.xml = b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-host.xml new file mode 100644 index 0000000000..e139004923 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-host.xml @@ -0,0 +1,25 @@ + + x86_64 + SandyBridge + Intel + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-json.xml = b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-json.xml new file mode 100644 index 0000000000..3a799052e7 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt-json.xml @@ -0,0 +1,11 @@ + + SandyBridge + Intel + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt.json b/te= sts/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt.json new file mode 100644 index 0000000000..ae079f3c54 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt.json @@ -0,0 +1,615 @@ +{ + "return": { + "model": { + "name": "base", + "props": { + "pfthreshold": false, + "pku": false, + "rtm": false, + "tsc_adjust": true, + "tsc-deadline": true, + "xstore-en": false, + "cpuid-0xb": true, + "abm": false, + "ia64": false, + "kvm-mmu": false, + "xsaveopt": false, + "hv-spinlocks": -1, + "tce": false, + "realized": false, + "kvm_steal_time": true, + "smep": false, + "fpu": true, + "xcrypt": false, + "sse4_2": true, + "clflush": true, + "sse4_1": true, + "flushbyasid": false, + "kvm-steal-time": true, + "lm": true, + "tsc": true, + "adx": false, + "fxsr": true, + "sha-ni": false, + "decodeassists": false, + "hv-relaxed": false, + "pclmuldq": true, + "xgetbv1": false, + "xstore": false, + "vmcb_clean": false, + "tsc-adjust": true, + "vme": true, + "vendor": "GenuineIntel", + "arat": true, + "ffxsr": false, + "de": true, + "aes": true, + "pse": true, + "ds-cpl": false, + "fxsr_opt": false, + "tbm": false, + "sse": true, + "phe-en": false, + "f16c": false, + "ds": false, + "mpx": false, + "vmware-cpuid-freq": true, + "avx512f": false, + "avx2": false, + "level": 13, + "pbe": false, + "cx16": true, + "ds_cpl": false, + "movbe": false, + "perfctr-nb": false, + "nrip_save": false, + "kvm_mmu": false, + "ospke": false, + "pmu": false, + "avx512ifma": false, + "stepping": 7, + "sep": true, + "sse4a": false, + "avx512dq": false, + "core-id": -1, + "i64": true, + "avx512-4vnniw": false, + "xsave": true, + "pmm": false, + "hle": false, + "nodeid_msr": false, + "hv-crash": false, + "est": false, + "osxsave": false, + "xop": false, + "smx": false, + "tsc-scale": false, + "monitor": false, + "avx512er": false, + "apic": true, + "sse4.1": true, + "sse4.2": true, + "hv-vapic": false, + "pause-filter": false, + "lahf-lm": true, + "kvm-nopiodelay": true, + "cmp_legacy": false, + "acpi": false, + "fma4": false, + "mmx": true, + "svm_lock": false, + "pcommit": false, + "mtrr": true, + "clwb": false, + "dca": false, + "pdcm": false, + "xcrypt-en": false, + "3dnow": false, + "invtsc": false, + "tm2": false, + "hv-time": false, + "hypervisor": true, + "kvmclock-stable-bit": true, + "xlevel": 2147483656, + "lahf_lm": true, + "enforce": false, + "pcid": true, + "sse4-1": true, + "lbrv": false, + "avx512-vpopcntdq": false, + "avx512-4fmaps": false, + "fill-mtrr-mask": true, + "pause_filter": false, + "svm-lock": false, + "popcnt": true, + "nrip-save": false, + "avx512vl": false, + "x2apic": true, + "kvmclock": true, + "smap": false, + "pdpe1gb": false, + "family": 6, + "min-level": 13, + "xlevel2": 0, + "dtes64": false, + "xd": true, + "kvm_pv_eoi": true, + "ace2": false, + "kvm_pv_unhalt": true, + "xtpr": false, + "perfctr_nb": false, + "avx512bw": false, + "l3-cache": true, + "nx": true, + "lwp": false, + "msr": true, + "syscall": true, + "tm": false, + "perfctr-core": false, + "memory": "/machine/unattached/system[0]", + "pge": true, + "pn": false, + "fma": false, + "nodeid-msr": false, + "xsavec": false, + "socket-id": -1, + "thread-id": -1, + "cx8": true, + "mce": true, + "avx512cd": false, + "cr8legacy": false, + "mca": true, + "avx512pf": false, + "pni": true, + "hv-vendor-id": "", + "rdseed": false, + "osvw": false, + "fsgsbase": false, + "model-id": " Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz", + "cmp-legacy": false, + "kvm-pv-unhalt": true, + "rdtscp": true, + "mmxext": false, + "host-phys-bits": true, + "cid": false, + "vmx": false, + "ssse3": true, + "extapic": false, + "pse36": true, + "min-xlevel": 2147483656, + "ibs": false, + "la57": false, + "avx": true, + "kvm-no-smi-migration": false, + "ace2-en": false, + "umip": false, + "invpcid": false, + "bmi1": false, + "bmi2": false, + "vmcb-clean": false, + "erms": false, + "cmov": true, + "check": true, + "perfctr_core": false, + "misalignsse": false, + "clflushopt": false, + "pat": true, + "sse4-2": true, + "3dnowprefetch": false, + "rdpid": false, + "full-cpuid-auto-level": true, + "pae": true, + "wdt": false, + "tsc_scale": false, + "skinit": false, + "fxsr-opt": false, + "kvm_nopiodelay": true, + "phys-bits": 0, + "kvm": true, + "pmm-en": false, + "phe": false, + "3dnowext": false, + "lmce": true, + "ht": false, + "tsc-frequency": 0, + "kvm-pv-eoi": true, + "npt": false, + "apic-id": 4294967295, + "kvm_asyncpf": true, + "min-xlevel2": 0, + "pclmulqdq": true, + "svm": false, + "sse3": true, + "sse2": true, + "ss": true, + "topoext": false, + "rdrand": false, + "avx512vbmi": false, + "kvm-asyncpf": true, + "xsaves": false, + "model": 42 + } + } + }, + "id": "model-expansion" +} + +{ + "return": [ + { + "typename": "max-x86_64-cpu", + "unavailable-features": [], + "migration-safe": false, + "static": false, + "name": "max" + }, + { + "typename": "host-x86_64-cpu", + "unavailable-features": [], + "migration-safe": false, + "static": false, + "name": "host" + }, + { + "typename": "base-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": true, + "name": "base" + }, + { + "typename": "qemu64-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "qemu64" + }, + { + "typename": "qemu32-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "qemu32" + }, + { + "typename": "phenom-x86_64-cpu", + "unavailable-features": [ + "mmxext", + "fxsr-opt", + "pdpe1gb", + "3dnowext", + "3dnow", + "abm", + "sse4a", + "npt" + ], + "migration-safe": true, + "static": false, + "name": "phenom" + }, + { + "typename": "pentium3-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium3" + }, + { + "typename": "pentium2-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium2" + }, + { + "typename": "pentium-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "pentium" + }, + { + "typename": "n270-x86_64-cpu", + "unavailable-features": [ + "movbe" + ], + "migration-safe": true, + "static": false, + "name": "n270" + }, + { + "typename": "kvm64-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "kvm64" + }, + { + "typename": "kvm32-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "kvm32" + }, + { + "typename": "cpu64-rhel6-x86_64-cpu", + "unavailable-features": [ + "abm", + "sse4a" + ], + "migration-safe": true, + "static": false, + "name": "cpu64-rhel6" + }, + { + "typename": "coreduo-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "coreduo" + }, + { + "typename": "core2duo-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "core2duo" + }, + { + "typename": "athlon-x86_64-cpu", + "unavailable-features": [ + "mmxext", + "3dnowext", + "3dnow" + ], + "migration-safe": true, + "static": false, + "name": "athlon" + }, + { + "typename": "Westmere-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Westmere" + }, + { + "typename": "Skylake-Client-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "mpx", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch", + "xsavec", + "xgetbv1", + "mpx", + "mpx", + "xsaveopt" + ], + "migration-safe": true, + "static": false, + "name": "Skylake-Client" + }, + { + "typename": "SandyBridge-x86_64-cpu", + "unavailable-features": [ + "xsaveopt" + ], + "migration-safe": true, + "static": false, + "name": "SandyBridge" + }, + { + "typename": "Penryn-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Penryn" + }, + { + "typename": "Opteron_G5-x86_64-cpu", + "unavailable-features": [ + "fma", + "f16c", + "pdpe1gb", + "abm", + "sse4a", + "misalignsse", + "3dnowprefetch", + "xop", + "fma4", + "tbm" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G5" + }, + { + "typename": "Opteron_G4-x86_64-cpu", + "unavailable-features": [ + "pdpe1gb", + "abm", + "sse4a", + "misalignsse", + "3dnowprefetch", + "xop", + "fma4" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G4" + }, + { + "typename": "Opteron_G3-x86_64-cpu", + "unavailable-features": [ + "abm", + "sse4a", + "misalignsse" + ], + "migration-safe": true, + "static": false, + "name": "Opteron_G3" + }, + { + "typename": "Opteron_G2-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Opteron_G2" + }, + { + "typename": "Opteron_G1-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Opteron_G1" + }, + { + "typename": "Nehalem-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Nehalem" + }, + { + "typename": "IvyBridge-x86_64-cpu", + "unavailable-features": [ + "f16c", + "rdrand", + "fsgsbase", + "smep", + "erms", + "xsaveopt" + ], + "migration-safe": true, + "static": false, + "name": "IvyBridge" + }, + { + "typename": "Haswell-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "abm", + "xsaveopt" + ], + "migration-safe": true, + "static": false, + "name": "Haswell" + }, + { + "typename": "Haswell-noTSX-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "abm", + "xsaveopt" + ], + "migration-safe": true, + "static": false, + "name": "Haswell-noTSX" + }, + { + "typename": "Conroe-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "Conroe" + }, + { + "typename": "Broadwell-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "hle", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rtm", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch", + "xsaveopt" + ], + "migration-safe": true, + "static": false, + "name": "Broadwell" + }, + { + "typename": "Broadwell-noTSX-x86_64-cpu", + "unavailable-features": [ + "fma", + "movbe", + "f16c", + "rdrand", + "fsgsbase", + "bmi1", + "avx2", + "smep", + "bmi2", + "erms", + "invpcid", + "rdseed", + "adx", + "smap", + "abm", + "3dnowprefetch", + "xsaveopt" + ], + "migration-safe": true, + "static": false, + "name": "Broadwell-noTSX" + }, + { + "typename": "486-x86_64-cpu", + "unavailable-features": [], + "migration-safe": true, + "static": false, + "name": "486" + } + ], + "id": "definitions" +} diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt.xml b/tes= ts/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt.xml new file mode 100644 index 0000000000..c2c9730a41 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-xsaveopt.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list