Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3480432pxp; Tue, 8 Mar 2022 15:32:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4qQlvOKFa/1qIfGXaUVFcjslb+wBcLDBJebdStO3BRuAdqM+TjrryxLs/2ZdZbDApzRjv X-Received: by 2002:a17:90b:38c9:b0:1bf:8668:9399 with SMTP id nn9-20020a17090b38c900b001bf86689399mr7136501pjb.87.1646782357214; Tue, 08 Mar 2022 15:32:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646782357; cv=none; d=google.com; s=arc-20160816; b=FQpdnZuZ36u3TnOWEezUt01UJtUEpviLZZBwQlWn00+o9m3yZrQgjrLH3nyLD6x2kI 0GAEuICJ9yL33LB/uv85YKD5FQ2/ovqk8As/4OZG73FDItGP5r7y31HDEikvVl5Q3f9c CCxLcpjvZZf9kpSDpXF14TUL7sheLBdowRalGI7QMjKEPCH4mfrZNIqQTuvq7oO5qAky x5WPEv16geFMGsCCtL/Rf0qYYq1Nz1sCWu9b9S8jpb4pcZ8qV8AgZqOPgVpGvNu3YFRW gdn8RZgwa/ICoUWuPFywgjrAo75JcS6s4C2p/LUejuiky0RhyeO12N+52lnBeUPKKsup fiqw== 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=dAZkd94tzcRdvRieKkWfcBkJvTkJnK9zBdITPJgPy6s=; b=GyuVv2WQraSqKZBzACunAOmknRBazaDsVfreJAwW/fdsxyZlpKTVMg3sq1CWIjKscz RMeaMZSPbX6NlRTM0Gibv4n5tCoRUumSFGYYjsnOVotQgVed3kgaQfxqtMnQcJ1g4TVc jL4cOKiO574vVTCouKX0qD0kzOdY0mlZD1Z/d0qJ3dXf9O2aWBfAxsCv1ezRVFinUwIZ GZZylY1xC8rTAjOPeYmFdLq7zDb4Y0+6roLLSMcngKQQebu9b8yCugTOw3BMA31RTjxw tNgxRSsquwYzWPtJEaSQVa9XKi8upmIY1rXhjbAosSUoi6Si1HAyl92BuacbABWlpFn3 N9Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mO9oSmUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g7-20020a17090a290700b001bf6f0a73a9si339111pjd.151.2022.03.08.15.32.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 15:32:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mO9oSmUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 717C7A9E05; Tue, 8 Mar 2022 15:20:53 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243339AbiCGOnb (ORCPT + 99 others); Mon, 7 Mar 2022 09:43:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239324AbiCGOn2 (ORCPT ); Mon, 7 Mar 2022 09:43:28 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66D8A10FF; Mon, 7 Mar 2022 06:42:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=dAZkd94tzcRdvRieKkWfcBkJvTkJnK9zBdITPJgPy6s=; b=mO9oSmUesbbSZM3vVK9HyTDYQq cK133canotMxKAZ16MzaSlEApH4hnCI5CtCI6hsR7A6tEwzzsv4IUQX/bl6HD1kjRWY8887uvn+2T 6NUL7IIKV2it7/I+weTmFjEISS2i+GL1jllaCYFkdDROh+x3SM/j3u7m+tqv/+FnetomUX4A/TD5d RZonGU9B6SYDqGlYKFlkw77GZX99AJNEzK3XSLH0Io9vhxjZ8fdzQtQuh9Zf2X+C0UPRfn1u5d6WU xjS+BbZau/KIePTW8IudpNYy23HvK5oMyvndoV6Ov7JQBcwckuExbphCZQ6DwAiYLY67gF7wrnebe NbU6hTmw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nREYr-00FIlv-LY; Mon, 07 Mar 2022 14:42:09 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 462BC300169; Mon, 7 Mar 2022 15:42:07 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 30A5B203C59BB; Mon, 7 Mar 2022 15:42:07 +0100 (CET) Date: Mon, 7 Mar 2022 15:42:07 +0100 From: Peter Zijlstra To: Adrian Hunter Cc: Alexander Shishkin , Arnaldo Carvalho de Melo , Jiri Olsa , linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, kvm@vger.kernel.org, H Peter Anvin , Mathieu Poirier , Suzuki K Poulose , Leo Yan , jgross@suse.com, sdeep@vmware.com, pv-drivers@vmware.com, pbonzini@redhat.com, seanjc@google.com, kys@microsoft.com, sthemmin@microsoft.com, virtualization@lists.linux-foundation.org, Andrew.Cooper3@citrix.com, christopher.s.hall@intel.com Subject: Re: [PATCH V2 03/11] perf/x86: Add support for TSC in nanoseconds as a perf event clock Message-ID: References: <20220214110914.268126-1-adrian.hunter@intel.com> <20220214110914.268126-4-adrian.hunter@intel.com> <853ce127-25f0-d0fe-1d8f-0b0dd4f3ce71@intel.com> <30383f92-59cb-2875-1e1b-ff1a0eacd235@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30383f92-59cb-2875-1e1b-ff1a0eacd235@intel.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 07, 2022 at 02:36:03PM +0200, Adrian Hunter wrote: > > diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c > > index 4420499f7bb4..a1f179ed39bf 100644 > > --- a/arch/x86/kernel/paravirt.c > > +++ b/arch/x86/kernel/paravirt.c > > @@ -145,6 +145,15 @@ DEFINE_STATIC_CALL(pv_sched_clock, native_sched_clock); > > > > void paravirt_set_sched_clock(u64 (*func)(void)) > > { > > + /* > > + * Anything with ART on promises to have sane TSC, otherwise the whole > > + * ART thing is useless. In order to make ART useful for guests, we > > + * should continue to use the TSC. As such, ignore any paravirt > > + * muckery. > > + */ > > + if (cpu_feature_enabled(X86_FEATURE_ART)) > > Does not seem to work because the feature X86_FEATURE_ART does not seem to get set. > Possibly because detect_art() excludes anything running on a hypervisor. Simple enough to delete that clause I suppose. Christopher, what is needed to make that go away? I suppose the guest needs to be aware of the active TSC scaling parameters to make it work ?