From nobody Wed Dec 17 07:26:15 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559304143; cv=none; d=zoho.com; s=zohoarc; b=GJ8y8MqFKWvQUkdRXKnM8RfnICZLoywlkxpRPbxhgi8LOh+f5faRHQiIKRtedYfOqwx1epbxsul09FB26/uWruni3aDvgty68YI5RpTkOvK/dDuAlG0eh/fRrdXH0YmaOA8IKwFimDSQE31mLEao5w783Vxoul2K9La9BjVkFd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559304143; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=bunfgVe5t1lC92pf41zoyb3ZqCTpJPlQitFRNVa8w3s=; b=fjm4eqSHJmFywQ5fZhYZ7ElngPA/MQw911IGz1fGEao9Gznw5uIC84CtlCPHbQxFDtKJ5WXcaTL77EFABlEwNGtNOl0Nq2/Fu9Q4dvmL1kFM+9pibK5Vl1TPxYc2kIhMRItMExk69xzIj+VhdW1ypPW/G0ytKym2JgoStpEHCUA= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559304143295464.51224761774597; Fri, 31 May 2019 05:02:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5D52D81F33; Fri, 31 May 2019 12:02:15 +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 C2865473C4; Fri, 31 May 2019 12:02:08 +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 7A06BE166; Fri, 31 May 2019 12:02:05 +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 x4VC0raA010251 for ; Fri, 31 May 2019 08:00:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5C5D17837A; Fri, 31 May 2019 12:00:53 +0000 (UTC) Received: from orkuz.int.mamuti.net (ovpn-204-108.brq.redhat.com [10.40.204.108]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 222C27836E; Fri, 31 May 2019 12:00:22 +0000 (UTC) Received: by orkuz.int.mamuti.net (Postfix, from userid 500) id C77DC2A1179; Fri, 31 May 2019 14:00:20 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 31 May 2019 14:00:10 +0200 Message-Id: <2533c96ba96cea8e27e03c7d87e43ebf8caccea7.1559303790.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Marcelo Tosatti Subject: [libvirt] [PATCH 4/5] cpu_x86: Probe TSC frequency and scaling support 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 31 May 2019 12:02:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When the host CPU supports invariant TSC the host CPU definition created by virCPUx86GetHost will contain (unless probing fails for some reason) addition TSC related data. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index cb03123787..689b6cdaf5 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2762,6 +2762,15 @@ virCPUx86GetHost(virCPUDefPtr cpu, ret =3D x86DecodeCPUData(cpu, cpuData, models); cpu->microcodeVersion =3D virHostCPUGetMicrocodeVersion(); =20 + /* Probing for TSC frequency makes sense only if the CPU supports + * invariant TSC (Linux calls this constant_tsc in /proc/cpuinfo). */ + if (virCPUx86DataCheckFeature(cpuData, "invtsc") =3D=3D 1) { + VIR_DEBUG("Checking invariant TSC frequency"); + cpu->tsc =3D virHostCPUGetTscInfo(); + } else { + VIR_DEBUG("Host CPU does not support invariant TSC"); + } + cleanup: virCPUx86DataFree(cpuData); return ret; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list