From nobody Wed May 14 23:35:35 2025 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 1515440929388344.68237025362794; Mon, 8 Jan 2018 11:48:49 -0800 (PST) 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 A9F244903F; Mon, 8 Jan 2018 19:48:47 +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 751A9620AC; Mon, 8 Jan 2018 19:48:47 +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 2397418033DF; Mon, 8 Jan 2018 19:48:47 +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 w08JlJuf011107 for ; Mon, 8 Jan 2018 14:47:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7B0796A03F; Mon, 8 Jan 2018 19:47:19 +0000 (UTC) Received: from mamuti.net (ovpn-204-21.brq.redhat.com [10.40.204.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B54B6A02E for ; Mon, 8 Jan 2018 19:47:16 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 7919B1093DA; Mon, 8 Jan 2018 20:47:15 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Mon, 8 Jan 2018 20:47:12 +0100 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 2/3] cpu_x86: Add debug messages to x86DecodeUseCandidate 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]); Mon, 08 Jan 2018 19:48:48 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When translating CPUID data into CPU model + features, the code sometimes uses an unexpected CPU model. There may be several reasons for this, starting with wrong expectations and ending with an actual bug in our code. These debug messages will help determining the reason. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 26314a5b3a..2a2f7cbf39 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1774,12 +1774,15 @@ x86DecodeUseCandidate(virCPUx86ModelPtr current, } } =20 - if (preferred && - STREQ(cpuCandidate->model, preferred)) + if (preferred && STREQ(cpuCandidate->model, preferred)) { + VIR_DEBUG("%s is the preferred model", cpuCandidate->model); return 2; + } =20 - if (!cpuCurrent) + if (!cpuCurrent) { + VIR_DEBUG("%s is better than nothing", cpuCandidate->model); return 1; + } =20 /* Ideally we want to select a model with family/model equal to * family/model of the real CPU. Once we found such model, we only @@ -1787,20 +1790,30 @@ x86DecodeUseCandidate(virCPUx86ModelPtr current, */ if (signature && current->signature =3D=3D signature && - candidate->signature !=3D signature) + candidate->signature !=3D signature) { + VIR_DEBUG("%s differs in signature from matching %s", + cpuCandidate->model, cpuCurrent->model); return 0; + } =20 - if (cpuCurrent->nfeatures > cpuCandidate->nfeatures) + if (cpuCurrent->nfeatures > cpuCandidate->nfeatures) { + VIR_DEBUG("%s results in shorter feature list than %s", + cpuCandidate->model, cpuCurrent->model); return 1; + } =20 /* Prefer a candidate with matching signature even though it would * result in longer list of features. */ if (signature && candidate->signature =3D=3D signature && - current->signature !=3D signature) + current->signature !=3D signature) { + VIR_DEBUG("%s provides matching signature", cpuCandidate->model); return 1; + } =20 + VIR_DEBUG("%s does not result in shorter feature list than %s", + cpuCandidate->model, cpuCurrent->model); return 0; } =20 --=20 2.15.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list