From nobody Tue Feb 10 05:10:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680013585; cv=none; d=zohomail.com; s=zohoarc; b=IpOzr2lkE3FPIbPN1vDJydjniI4SvadncVBei6+zQzcy8gIK4sOjNaTPyVbshoMDGWQ6UpHW7ThXj0tcspMcXnNENNhMYW2wBln77pB+Vy7/gKTD+KmUVbbo62dyhmAnx2tvh5wVZ7CB4aHJfjYJdIPblVWdflwC84gR+FgsOT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680013585; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=CRLnkDLljI5E78ycGYWJ3mVylorF6AccfUVUa6bCSRc=; b=RPxRtywo7bCT2/txiRcW9NpHgRDa6UXoXnAcQLZiOL5YWGJR5/yUwgl9TlUsD73GCam32wJzYP3yrWFIBQf6lRKuprFn8HokyEvYvynYeipYZ8SRjx4/X90P6rbS4x1/u6hTTgTqgQQS+GgWBIekwcDYH8XBXRa+lft7z4eNnXc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1680013585880298.2017872760232; Tue, 28 Mar 2023 07:26:25 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-265-UZfbtrDaN1KnyyFl2W6RjQ-1; Tue, 28 Mar 2023 10:26:21 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CD04D3C16E9F; Tue, 28 Mar 2023 14:26:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41D102166B26; Tue, 28 Mar 2023 14:26:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 218B6194658C; Tue, 28 Mar 2023 14:26:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5CF981946589 for ; Tue, 28 Mar 2023 14:26:16 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4A9F42166B29; Tue, 28 Mar 2023 14:26:16 +0000 (UTC) Received: from work.fritz.box (unknown [10.39.195.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id D11002166B26; Tue, 28 Mar 2023 14:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680013584; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CRLnkDLljI5E78ycGYWJ3mVylorF6AccfUVUa6bCSRc=; b=aRh1Qd+phZCTj3iTTAJB7BtVreGyTd7+zS1E7nEdezJED3/KgGsgIvkGZFnyg2GhzTlu2z BGejLMjjFn7rXaRIohnNt6GLzuaAkwcb5u6fhwXw/avgnZ0LH+lNvGrvTi0RQbCyOWtF84 izY6hbuuuvvEMj5lc8ZpQY1A751vHxw= X-MC-Unique: UZfbtrDaN1KnyyFl2W6RjQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH] cpu-data.py: Filter out apic current logical processor Date: Tue, 28 Mar 2023 16:26:15 +0200 Message-Id: <20230328142615.39483-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tim Wiederhake Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680013587465100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Commit 10b5e789c5 attempts to filter out the logical processor id in the generated data to remove noise and irrelevant changes in the output. cpuid-leaf 0x0B may have more than two sub-leaves though. Filter out logical processor id from all sub-leaves of 0x0B and 0x1F (superset of the information in 0x0B). Signed-off-by: Tim Wiederhake Reviewed-by: Jiri Denemark --- tests/cputestdata/cpu-data.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/cputestdata/cpu-data.py b/tests/cputestdata/cpu-data.py index 498e07b2f7..b5641f7c16 100755 --- a/tests/cputestdata/cpu-data.py +++ b/tests/cputestdata/cpu-data.py @@ -107,11 +107,14 @@ def gather_cpuid_leaves_kcpuid(output): =20 def gather_cpuid_leaves(args): def mask(regs, eax_in, ecx_in, eax_mask, ebx_mask, ecx_mask, edx_mask): - if regs["eax_in"] =3D=3D eax_in and regs["ecx_in"] =3D=3D ecx_in: - regs["eax"] &=3D eax_mask - regs["ebx"] &=3D ebx_mask - regs["ecx"] &=3D ecx_mask - regs["edx"] &=3D edx_mask + if eax_in !=3D regs["eax_in"]: + return + if ecx_in !=3D regs["ecx_in"] and ecx_in is not None: + return + regs["eax"] &=3D eax_mask + regs["ebx"] &=3D ebx_mask + regs["ecx"] &=3D ecx_mask + regs["edx"] &=3D edx_mask =20 cpuid =3D args.path_to_cpuid or "cpuid" try: @@ -132,8 +135,8 @@ def gather_cpuid_leaves(args): for regs in reglist: # local apic id. Pretend to always run on logical processor #0. mask(regs, 0x01, 0x00, 0xffffffff, 0x00ffffff, 0xffffffff, 0xfffff= fff) - mask(regs, 0x0b, 0x00, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffff= f00) - mask(regs, 0x0b, 0x01, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffff= f00) + mask(regs, 0x0b, None, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000= 000) + mask(regs, 0x1f, None, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000= 000) =20 yield regs =20 --=20 2.39.2