From nobody Sat Feb 7 08:53:27 2026 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.zoho.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 14897686456021009.4726509290692; Fri, 17 Mar 2017 09:37: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 45C888FCE1; Fri, 17 Mar 2017 16:37:25 +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 1C44E183DC; Fri, 17 Mar 2017 16:37:25 +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 B78B818521C8; Fri, 17 Mar 2017 16:37:24 +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 v2HGb43k007175 for ; Fri, 17 Mar 2017 12:37:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9B020BFA6F; Fri, 17 Mar 2017 16:37:04 +0000 (UTC) Received: from mamuti.net (ovpn-204-109.brq.redhat.com [10.40.204.109]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6918CBFA63 for ; Fri, 17 Mar 2017 16:37:02 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 3E4AF1061CA; Fri, 17 Mar 2017 17:36:55 +0100 (CET) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 45C888FCE1 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=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 45C888FCE1 From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 17 Mar 2017 17:36:47 +0100 Message-Id: <9a53dfc3778d745fcd9ec853fa010f8e6bfb1e5b.1489768416.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 09/14] cputest: Add cpuidLeaf helper to cpu-cpuid.py 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, 17 Mar 2017 16:37:25 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- tests/cputestdata/cpu-cpuid.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index 9ea858d98..f4cf6d440 100755 --- a/tests/cputestdata/cpu-cpuid.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -189,6 +189,18 @@ def cpuidIsSet(cpuid, feature): (edx > 0 and leaf["edx"] & edx > 0)) =20 =20 +def cpuidLeaf(cpuid, in_eax, in_ecx): + if in_eax not in cpuid: + cpuid[in_eax] =3D {} + leaf =3D cpuid[in_eax] + + if in_ecx not in leaf: + leaf[in_ecx] =3D {"eax": 0, "ebx": 0, "ecx": 0, "edx": 0} + leaf =3D leaf[in_ecx] + + return leaf + + def parseFeatureWords(path): features =3D None =20 @@ -222,14 +234,7 @@ def parseFeatureWords(path): if "cpuid-input-ecx" in feat: in_ecx =3D feat["cpuid-input-ecx"] =20 - if in_eax not in cpuid: - cpuid[in_eax] =3D {} - leaf =3D cpuid[in_eax] - - if in_ecx not in leaf: - leaf[in_ecx] =3D {"eax": 0, "ebx": 0, "ecx": 0, "edx": 0} - leaf =3D leaf[in_ecx] - + leaf =3D cpuidLeaf(cpuid, in_eax, in_ecx) leaf[feat["cpuid-register"].lower()] =3D feat["features"] =20 return props, cpuid --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list