From nobody Sun Feb 8 12:19:17 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.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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554713025246242.04126807012858; Mon, 8 Apr 2019 01:43:45 -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 816D7316769F; Mon, 8 Apr 2019 08:43:43 +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 5C3C160A9E; Mon, 8 Apr 2019 08:43:43 +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 C3F0E4EA71; Mon, 8 Apr 2019 08:43:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x388gxOX009214 for ; Mon, 8 Apr 2019 04:43:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id EDAC61A267; Mon, 8 Apr 2019 08:42:59 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7175317796 for ; Mon, 8 Apr 2019 08:42:59 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 1DE4510371A; Mon, 8 Apr 2019 10:42:51 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Mon, 8 Apr 2019 10:42:29 +0200 Message-Id: <6b46a84114c6c5f8df8d3ee883dac45bb021da7e.1554711784.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 25/36] cputest: Drop support for old QEMU from 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: , 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.41]); Mon, 08 Apr 2019 08:43:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We don't really need to parse CPU data from QEMU older than 2.9 (i.e., before query-cpu-model-expansion) at this point. But even if there's a need to do so, we can always use an older version of this script to do the conversion. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- tests/cputestdata/cpu-cpuid.py | 262 ++------------------------------- tests/cputestdata/cpu-parse.sh | 3 +- 2 files changed, 12 insertions(+), 253 deletions(-) diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index f549003124..56d5efc1c2 100755 --- a/tests/cputestdata/cpu-cpuid.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -5,175 +5,6 @@ import sys import json import xmltodict =20 -# This is a list of x86 CPU features as of QEMU 2.8.50 and it won't need a= ny -# updates since in the future because query-cpu-model-expansion will be us= ed -# with newer QEMU. -cpuidMap =3D [ - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 001, "edx": 0, "names": ["pni", "sse3"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 002, "edx": 0, "names": ["pclmulqdq", "pclmuldq"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 004, "edx": 0, "names": ["dtes64"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 008, "edx": 0, "names": ["monitor"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 010, "edx": 0, "names": ["ds-cpl", "ds_cpl"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 020, "edx": 0, "names": ["vmx"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 040, "edx": 0, "names": ["smx"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 080, "edx": 0, "names": ["est"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 100, "edx": 0, "names": ["tm2"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 200, "edx": 0, "names": ["ssse3"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 400, "edx": 0, "names": ["cid"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00001= 000, "edx": 0, "names": ["fma"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00002= 000, "edx": 0, "names": ["cx16"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00004= 000, "edx": 0, "names": ["xtpr"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00008= 000, "edx": 0, "names": ["pdcm"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00020= 000, "edx": 0, "names": ["pcid"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00040= 000, "edx": 0, "names": ["dca"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00080= 000, "edx": 0, "names": ["sse4.1", "sse4-1", "sse4_1"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00100= 000, "edx": 0, "names": ["sse4.2", "sse4-2", "sse4_2"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00200= 000, "edx": 0, "names": ["x2apic"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00400= 000, "edx": 0, "names": ["movbe"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00800= 000, "edx": 0, "names": ["popcnt"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x01000= 000, "edx": 0, "names": ["tsc-deadline"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x02000= 000, "edx": 0, "names": ["aes"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x04000= 000, "edx": 0, "names": ["xsave"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x08000= 000, "edx": 0, "names": ["osxsave"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x10000= 000, "edx": 0, "names": ["avx"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x20000= 000, "edx": 0, "names": ["f16c"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x40000= 000, "edx": 0, "names": ["rdrand"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x80000= 000, "edx": 0, "names": ["hypervisor"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000001, "names": ["fpu"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000002, "names": ["vme"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000004, "names": ["de"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000008, "names": ["pse"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000010, "names": ["tsc"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000020, "names": ["msr"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000040, "names": ["pae"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000080, "names": ["mce"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000100, "names": ["cx8"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000200, "names": ["apic"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000800, "names": ["sep"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00001000, "names": ["mtrr"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00002000, "names": ["pge"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00004000, "names": ["mca"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00008000, "names": ["cmov"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00010000, "names": ["pat"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00020000, "names": ["pse36"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00040000, "names": ["pn"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00080000, "names": ["clflush"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00200000, "names": ["ds"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00400000, "names": ["acpi"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00800000, "names": ["mmx"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x01000000, "names": ["fxsr"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x02000000, "names": ["sse"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x04000000, "names": ["sse2"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x08000000, "names": ["ss"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x10000000, "names": ["ht"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x20000000, "names": ["tm"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x40000000, "names": ["ia64"]}, - {"in_eax": 0x00000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x80000000, "names": ["pbe"]}, - {"in_eax": 0x00000006, "in_ecx": 0, "eax": 0x00000004, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["arat"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000001, "ecx"= : 0, "edx": 0, "names": ["fsgsbase"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000002, "ecx"= : 0, "edx": 0, "names": ["tsc-adjust", "tsc_adjust"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000008, "ecx"= : 0, "edx": 0, "names": ["bmi1"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000010, "ecx"= : 0, "edx": 0, "names": ["hle"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000020, "ecx"= : 0, "edx": 0, "names": ["avx2"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000080, "ecx"= : 0, "edx": 0, "names": ["smep"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000100, "ecx"= : 0, "edx": 0, "names": ["bmi2"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000200, "ecx"= : 0, "edx": 0, "names": ["erms"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000400, "ecx"= : 0, "edx": 0, "names": ["invpcid"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00000800, "ecx"= : 0, "edx": 0, "names": ["rtm"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00001000, "ecx"= : 0, "edx": 0, "names": []}, # cmt is unknown to QEMU - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00004000, "ecx"= : 0, "edx": 0, "names": ["mpx"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00010000, "ecx"= : 0, "edx": 0, "names": ["avx512f"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00020000, "ecx"= : 0, "edx": 0, "names": ["avx512dq"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00040000, "ecx"= : 0, "edx": 0, "names": ["rdseed"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00080000, "ecx"= : 0, "edx": 0, "names": ["adx"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00100000, "ecx"= : 0, "edx": 0, "names": ["smap"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00200000, "ecx"= : 0, "edx": 0, "names": ["avx512ifma"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00400000, "ecx"= : 0, "edx": 0, "names": ["pcommit"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x00800000, "ecx"= : 0, "edx": 0, "names": ["clflushopt"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x01000000, "ecx"= : 0, "edx": 0, "names": ["clwb"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x04000000, "ecx"= : 0, "edx": 0, "names": ["avx512pf"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x08000000, "ecx"= : 0, "edx": 0, "names": ["avx512er"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x10000000, "ecx"= : 0, "edx": 0, "names": ["avx512cd"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x20000000, "ecx"= : 0, "edx": 0, "names": ["sha-ni"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x40000000, "ecx"= : 0, "edx": 0, "names": ["avx512bw"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0x80000000, "ecx"= : 0, "edx": 0, "names": ["avx512vl"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 002, "edx": 0, "names": ["avx512vbmi"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 004, "edx": 0, "names": ["umip"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 008, "edx": 0, "names": ["pku"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 010, "edx": 0, "names": ["ospke"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00004= 000, "edx": 0, "names": ["avx512-vpopcntdq"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00010= 000, "edx": 0, "names": ["la57"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00400= 000, "edx": 0, "names": ["rdpid"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000004, "names": ["avx512-4vnniw"]}, - {"in_eax": 0x00000007, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000008, "names": ["avx512-4fmaps"]}, - {"in_eax": 0x0000000d, "in_ecx": 1, "eax": 0x00000001, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["xsaveopt"]}, - {"in_eax": 0x0000000d, "in_ecx": 1, "eax": 0x00000002, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["xsavec"]}, - {"in_eax": 0x0000000d, "in_ecx": 1, "eax": 0x00000004, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["xgetbv1"]}, - {"in_eax": 0x0000000d, "in_ecx": 1, "eax": 0x00000008, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["xsaves"]}, - {"in_eax": 0x40000001, "in_ecx": 0, "eax": 0x00000001, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["kvmclock"]}, - {"in_eax": 0x40000001, "in_ecx": 0, "eax": 0x00000002, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["kvm-nopiodelay", "kvm_nopiodelay"]}, - {"in_eax": 0x40000001, "in_ecx": 0, "eax": 0x00000004, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["kvm-mmu", "kvm_mmu"]}, - {"in_eax": 0x40000001, "in_ecx": 0, "eax": 0x00000008, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["kvmclock"]}, - {"in_eax": 0x40000001, "in_ecx": 0, "eax": 0x00000010, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["kvm-asyncpf", "kvm_asyncpf"]}, - {"in_eax": 0x40000001, "in_ecx": 0, "eax": 0x00000020, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["kvm-steal-time", "kvm_steal_time"]}, - {"in_eax": 0x40000001, "in_ecx": 0, "eax": 0x00000040, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["kvm-pv-eoi", "kvm_pv_eoi"]}, - {"in_eax": 0x40000001, "in_ecx": 0, "eax": 0x00000080, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["kvm-pv-unhalt", "kvm_pv_unhalt"]}, - {"in_eax": 0x40000001, "in_ecx": 0, "eax": 0x01000000, "ebx": 0, "ecx"= : 0, "edx": 0, "names": ["kvmclock-stable-bit"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 001, "edx": 0, "names": ["lahf-lm", "lahf_lm"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 002, "edx": 0, "names": ["cmp-legacy", "cmp_legacy"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 004, "edx": 0, "names": ["svm"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 008, "edx": 0, "names": ["extapic"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 010, "edx": 0, "names": ["cr8legacy"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 020, "edx": 0, "names": ["abm"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 040, "edx": 0, "names": ["sse4a"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 080, "edx": 0, "names": ["misalignsse"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 100, "edx": 0, "names": ["3dnowprefetch"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 200, "edx": 0, "names": ["osvw"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 400, "edx": 0, "names": ["ibs"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00000= 800, "edx": 0, "names": ["xop"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00001= 000, "edx": 0, "names": ["skinit"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00002= 000, "edx": 0, "names": ["wdt"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00008= 000, "edx": 0, "names": ["lwp"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00010= 000, "edx": 0, "names": ["fma4"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00020= 000, "edx": 0, "names": ["tce"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00080= 000, "edx": 0, "names": ["nodeid-msr", "nodeid_msr"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00200= 000, "edx": 0, "names": ["tbm"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00400= 000, "edx": 0, "names": ["topoext"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x00800= 000, "edx": 0, "names": ["perfctr-core", "perfctr_core"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0x01000= 000, "edx": 0, "names": ["perfctr-nb", "perfctr_nb"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000800, "names": ["syscall"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00100000, "names": ["nx", "xd"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00400000, "names": ["mmxext"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x02000000, "names": ["fxsr-opt", "ffxsr", "fxsr_opt"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x04000000, "names": ["pdpe1gb"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x08000000, "names": ["rdtscp"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x20000000, "names": ["lm", "i64"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x40000000, "names": ["3dnowext"]}, - {"in_eax": 0x80000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x80000000, "names": ["3dnow"]}, - {"in_eax": 0x80000007, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000100, "names": ["invtsc"]}, - {"in_eax": 0x8000000A, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000001, "names": ["npt"]}, - {"in_eax": 0x8000000A, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000002, "names": ["lbrv"]}, - {"in_eax": 0x8000000A, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000004, "names": ["svm-lock", "svm_lock"]}, - {"in_eax": 0x8000000A, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000008, "names": ["nrip-save", "nrip_save"]}, - {"in_eax": 0x8000000A, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000010, "names": ["tsc-scale", "tsc_scale"]}, - {"in_eax": 0x8000000A, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000020, "names": ["vmcb-clean", "vmcb_clean"]}, - {"in_eax": 0x8000000A, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000040, "names": ["flushbyasid"]}, - {"in_eax": 0x8000000A, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000080, "names": ["decodeassists"]}, - {"in_eax": 0x8000000A, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000400, "names": ["pause-filter", "pause_filter"]}, - {"in_eax": 0x8000000A, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00001000, "names": ["pfthreshold"]}, - {"in_eax": 0xC0000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000004, "names": ["xstore"]}, - {"in_eax": 0xC0000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000008, "names": ["xstore-en"]}, - {"in_eax": 0xC0000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000040, "names": ["xcrypt"]}, - {"in_eax": 0xC0000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000080, "names": ["xcrypt-en"]}, - {"in_eax": 0xC0000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000100, "names": ["ace2"]}, - {"in_eax": 0xC0000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000200, "names": ["ace2-en"]}, - {"in_eax": 0xC0000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000400, "names": ["phe"]}, - {"in_eax": 0xC0000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00000800, "names": ["phe-en"]}, - {"in_eax": 0xC0000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00001000, "names": ["pmm"]}, - {"in_eax": 0xC0000001, "in_ecx": 0, "eax": 0, "ebx": 0, "ecx": 0, "edx= ": 0x00002000, "names": ["pmm-en"]}, -] - - def cpuidIsSet(cpuid, feature): in_eax =3D feature["in_eax"] in_ecx =3D feature["in_ecx"] @@ -192,68 +23,19 @@ 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 cpuidAdd(cpuid, feature): - leaf =3D cpuidLeaf(cpuid, feature["in_eax"], feature["in_ecx"]) + if feature["in_eax"] not in cpuid: + cpuid[feature["in_eax"]] =3D {} + leaf =3D cpuid[feature["in_eax"]] + + if feature["in_ecx"] not in leaf: + leaf[feature["in_ecx"]] =3D {"eax": 0, "ebx": 0, "ecx": 0, "edx": = 0} + leaf =3D leaf[feature["in_ecx"]] + for reg in ["eax", "ebx", "ecx", "edx"]: leaf[reg] |=3D feature[reg] =20 =20 -def parseFeatureWords(path): - features =3D None - - dec =3D json.JSONDecoder() - - with open(path, "r") as f: - s =3D f.read() - - props =3D {} - rest =3D [] - chunk =3D 0 - while s !=3D "": - (data, pos) =3D dec.raw_decode(s) - if chunk =3D=3D 0: - features =3D data["return"] - elif chunk < 5: - keys =3D ["family", "model", "stepping", "model-id"] - props[keys[chunk - 1]] =3D data["return"] - else: - rest.append(data) - - while pos < len(s) and s[pos] !=3D "{": - pos +=3D 1 - s =3D s[pos:] - chunk +=3D 1 - - if props["model-id"].find("Intel") !=3D -1: - props["vendor"] =3D "GenuineIntel" - elif props["model-id"].find("AMD") !=3D -1: - props["vendor"] =3D "AuthenticAMD" - - cpuid =3D {} - for feat in features: - in_eax =3D feat["cpuid-input-eax"] - in_ecx =3D 0 - if "cpuid-input-ecx" in feat: - in_ecx =3D feat["cpuid-input-ecx"] - - leaf =3D cpuidLeaf(cpuid, in_eax, in_ecx) - leaf[feat["cpuid-register"].lower()] =3D feat["features"] - - return props, cpuid, rest - - def parseQemu(path, features): cpuid =3D {} with open(path, "r") as f: @@ -330,27 +112,6 @@ def formatCpuid(cpuid, path, comment): f.write("\n") =20 =20 -def convert(path): - props, cpuid, rest =3D parseFeatureWords(path) - - for feature in cpuidMap: - value =3D cpuidIsSet(cpuid, feature) - for name in feature["names"]: - props[name] =3D value - - print(path) - with open(path, "w") as f: - json.dump({"return": {"model": {"name": "base", "props": props}}, - "id": "model-expansion"}, - f, indent=3D2, separators=3D(',', ': ')) - f.write("\n") - - for chunk in rest: - f.write("\n") - json.dump(chunk, f, indent=3D2, separators=3D(',', ': ')) - f.write("\n") - - def diff(cpuMap, path): base =3D path.replace(".json", "") jsonFile =3D path @@ -374,16 +135,13 @@ def diff(cpuMap, path): =20 =20 if len(sys.argv) < 3: - print("Usage: %s convert|diff json_file..." % sys.argv[0]) + print("Usage: %s diff json_file..." % sys.argv[0]) sys.exit(1) =20 action =3D sys.argv[1] args =3D sys.argv[2:] =20 -if action =3D=3D "convert": - for path in args: - convert(path) -elif action =3D=3D "diff": +if action =3D=3D "diff": cpuMap =3D parseMap() for path in args: diff(cpuMap, path) diff --git a/tests/cputestdata/cpu-parse.sh b/tests/cputestdata/cpu-parse.sh index 3a2bfa0491..a001647549 100755 --- a/tests/cputestdata/cpu-parse.sh +++ b/tests/cputestdata/cpu-parse.sh @@ -53,7 +53,8 @@ json <<<"$data" >$fname.json if [[ -s $fname.json ]]; then echo $fname.json if ! grep -q model-expansion $fname.json; then - $(dirname $0)/cpu-cpuid.py convert $fname.json + echo "Missing query-cpu-model-expansion reply in $name.json" >&2 + exit 1 fi $(dirname $0)/cpu-cpuid.py diff $fname.json else --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list