Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2105489rdf; Mon, 6 Nov 2023 05:04:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5EqfkY6rMvgyJCEG489loF5QhN01GqjI96WBKThZgIY9ZWTbNJ1+c2Zdu7K/CktmrdFgc X-Received: by 2002:a05:6a00:80c:b0:6c2:e10:42e3 with SMTP id m12-20020a056a00080c00b006c20e1042e3mr14154884pfk.8.1699275867593; Mon, 06 Nov 2023 05:04:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699275867; cv=none; d=google.com; s=arc-20160816; b=hFo8EypFahE/OJaDGlrH3hoOlkUCmSBt3PZ4OVNadpA0obfl4J8ldSaPW24L37oyHy tdmbW4XF8iwte7B9RQiW3f7HxdnxRT4TG9KK/DOSRzugSBInsTmb5ChUiMgYDmhowg5I 2wTeXCkX5alDBC4T8BshX1ySwi111UBkjdSRgwevTjQq0jRyMk6msP1ZXn/rWWbMI6ks saHE6/PPlzn1yKwqE5Y8XH4ISF+PVn8aBiZ9TUHQ9CI92e+W9rr2FwCeD4Pz272QHBZx pCxiMaInYmEsDJv3Ud/wyTjMVg8yjlwaJ3lQghZjbrfdpycDVhQ7UR1ApF8KFVJzwvl3 qPpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7L6rtMC+FXXWyUARbvQwPp03z9ISDZj9kb1PVtNzDHM=; fh=HM1C9N3IaVB9J+pnW5teSCht4mOLh+cdw7rMYKu1q4U=; b=cdfpr9RrOHLizfjbXSkcsVl1cVC3CFNCyWhEgkXdQLUjPKsT3TWv797mTJZOQVQG8S wXoJtzrf3BH4ION0qUixuVWyR7bznlmi71Z441mkjE22MTbamZONGMpIek1bF5gvaJRZ IB0BzGPLsP2eLvgh9RPlY7c0pgUxgaaDJkJXHrwSbzZbrnMs7zgTaBwXxwu3hX1Brgb8 ba044WkfVFwO4VAzBAXa+SAH6E/V6VUngnERh0fWNcugsXnFkmascF1WhGgkiRNbvZnb JNqMk+LjYAVGjOWJ28RcPEcU8xRH9uhck3vaiMYqlmvvbo8GNmp80prkjAsAnZlnq+RR skuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gwp6HCpZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t2-20020a056a00138200b006c21aeb4041si8437251pfg.125.2023.11.06.05.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 05:04:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gwp6HCpZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 83F34803FC21; Mon, 6 Nov 2023 05:04:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231857AbjKFNEK (ORCPT + 99 others); Mon, 6 Nov 2023 08:04:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231920AbjKFNEH (ORCPT ); Mon, 6 Nov 2023 08:04:07 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACF821B2; Mon, 6 Nov 2023 05:04:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699275844; x=1730811844; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=v+viOGU3qwP1vIfGdPJcXm+0kRpH20trqAeV1C9YH3M=; b=gwp6HCpZvU5VFchfRP/Xf+XYr7J1V/l2keBDsVzixseSBgDfo2ivlZS3 sCqctNqvd3uvnI/AVh/Q8vSR3qtfY5cyrmGmwOkj/t1jP6KFBVTIPVVkW X7zEQTESOaDS8s2GhacppEBjmxA2T/kg0AbziHwRzlHWOuBdeob1ifpU6 ln494w+RuNYOe+ufEUEvxeFnKOj+zsmd2BHMSeDkSx7kOkUQy+qY9JBZf XuXcQjzZ6IT49OEz5Bctd0cZOuLKu/j69IPdIiZsFMWgsNe+dEkirGsRM MYgTO3Jqyt2awacaH3lZoLfM8rwcd0mKtMJeoUeUJPCwI1kKgRhjtVD7T g==; X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="368605708" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="368605708" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 05:04:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="879442673" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="879442673" Received: from jgulati-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.249.42.157]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 05:03:59 -0800 Received: by box.shutemov.name (Postfix, from userid 1000) id 8C032104790; Mon, 6 Nov 2023 16:03:56 +0300 (+03) Date: Mon, 6 Nov 2023 16:03:56 +0300 From: "Kirill A. Shutemov" To: "Nikunj A. Dadhania" Cc: seanjc@google.com, pbonzini@redhat.com, Dave Hansen , linux-kernel@vger.kernel.org, thomas.lendacky@amd.com, x86@kernel.org, kvm@vger.kernel.org, bp@alien8.de, mingo@redhat.com, tglx@linutronix.de, dave.hansen@linux.intel.com, dionnaglaze@google.com, pgonda@google.com Subject: Re: [PATCH v5 13/14] x86/tsc: Mark Secure TSC as reliable clocksource Message-ID: <20231106130356.5mppou4pzxmldy22@box.shutemov.name> References: <20231030063652.68675-1-nikunj@amd.com> <20231030063652.68675-14-nikunj@amd.com> <57d63309-51cd-4138-889d-43fbdf5ec790@intel.com> <20231102103306.v7ydmrobd5ibs4yn@box.shutemov.name> <5d8040b2-c761-4cea-a2ec-39319603e94a@amd.com> <20231102123851.jsdolkfz7sd3jys7@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 06 Nov 2023 05:04:23 -0800 (PST) On Mon, Nov 06, 2023 at 05:23:44PM +0530, Nikunj A. Dadhania wrote: > > Maybe kvmclock rating has to be even lower after detecting sane TSC? > > If I set kvmclock rating to 298, I do see exact behavior as you have seen on the bare-metal. > > [ 0.004520] clocksource: clocksource_enqueue: name kvm-clock rating 298 > [...] > [ 1.827422] clocksource: clocksource_enqueue: name tsc-early rating 299 > [...] > [ 3.485059] clocksource: Switched to clocksource tsc-early > [...] > [ 3.623625] clocksource: clocksource_enqueue: name tsc rating 300 > [ 3.628954] clocksource: Switched to clocksource tsc This looks more reasonable to me. But I don't really understand timekeeping. It would be nice to hear from someone who knows what he saying. -- Kiryl Shutsemau / Kirill A. Shutemov