From nobody Sun May 12 05:44:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1609888086; cv=none; d=zohomail.com; s=zohoarc; b=cmPOVduJFi1nA8jNIVKwVdaHfV9vVC6WapsQXn99WyPr6OsEdKZrzNB5qenAU2WR4d68g/Ohv6ORTgPUckmcdSwYgPpd9+gLROFfJTexSz7jlEX6fbPkE+rBV+LQkoFW8sb7dtn7xSIPt6e97N6AcRereVDr2wk5gJhcgVHBFfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609888086; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=d468tONdt5zhfpGMXmpKYKhnMHo3ZdQ2gpp0/5qz5ig=; b=MjGfutC/WWb2LVNatbvS+dBHv9lUw+tzGsZ7844GWQmVHvk68vvPupKvjG30FWeVtMej8qBBF1ti5x9RLmImDXpJ5MigyX7ZraPVWao9akklPAVIH5DV6qqj5jbsWhjJxEwV4DeLx6q5llO3Zo5EG+ABg/7yo5A3z9Id2Bgelqc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1609888086250311.4543051756614; Tue, 5 Jan 2021 15:08:06 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-467-msDRsmsLP6qpijBcs2c40w-1; Tue, 05 Jan 2021 18:08:02 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9E42E9CC0E; Tue, 5 Jan 2021 23:07:56 +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 F0B8D1002391; Tue, 5 Jan 2021 23:07:54 +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 55AB9180954D; Tue, 5 Jan 2021 23:07:53 +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 105N7qom002765 for ; Tue, 5 Jan 2021 18:07:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id 576C553C9F; Tue, 5 Jan 2021 23:07:52 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.40.194.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A19F70954 for ; Tue, 5 Jan 2021 23:07:45 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 5D845240499; Wed, 6 Jan 2021 00:07:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609888085; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=d468tONdt5zhfpGMXmpKYKhnMHo3ZdQ2gpp0/5qz5ig=; b=bXM6FQfppIJWALq9DB9DdlPjMZXX4wfH5Uit8CFrtBDDYb/8yJTbeKmkHi+9i1Rn1sLRu2 jZAqGZubr3CtrsUGZGgP9BcRdL+EMsPH3UUk3NungtM7OGcMPfPitkX2S1sQCZkR9c/Kml 20NBZ5+s+1Wk5rL/TE9jghTzr62IKk4= X-MC-Unique: msDRsmsLP6qpijBcs2c40w-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu: The TSC tolerance interval should be closed Date: Wed, 6 Jan 2021 00:07:42 +0100 Message-Id: <767fb597e275d8f01a15bef5243329dace0c0b0b.1609888062.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The kernel refuses to set guest TSC frequency less than a minimum frequency or greater than maximum frequency (both computed based on the host TSC frequency). When writing the libvirt code with a reversed logic (return success when the requested frequency falls within the tolerance interval) I forgot to include the boundaries. Fixes: d8e5b4560006590668d4669f54a46b08ec14c1a2 https://bugzilla.redhat.com/show_bug.cgi?id=3D1839095 Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa --- src/qemu/qemu_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e7421b415f..e9802809a5 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5403,7 +5403,7 @@ qemuProcessStartValidateTSC(virQEMUDriverPtr driver, tsc->frequency, virTristateBoolTypeToString(tsc->scaling), tolerance); =20 - if (freq > minFreq && freq < maxFreq) { + if (freq >=3D minFreq && freq <=3D maxFreq) { VIR_DEBUG("Requested TSC frequency is within tolerance interval"); return 0; } --=20 2.30.0