From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 515ABC433F5 for ; Fri, 19 Nov 2021 12:02:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23612615A4 for ; Fri, 19 Nov 2021 12:02:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 23612615A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qdBAt68Fwg0XltkEanWoyKvmpiS8J/meia50h93emY8=; b=r0S3NqHuGhOpji TlKnmPd364JC4vwlce/8awO0TCV85QlJ8neRgeufeUmAxFnnG0KGFt9utTXvPwFkaE9YLLpnAXH1u 6Gt5qYZ75BbjMD59pWSTNFXmqU56jV1NOG+Oir/D5rd55ckF8DdXh5SaBU8AsEr4Q4Gk52RXFCLyX iZuOYng2HaeO1CuOKzuRcgjrsmOWpU/AKrFLlOgQy2NLjhvjTwB4J3AZ5YurhuMEO9qeaAOsxhaQS +Swelda1FV6MAbSCfFfUPrmvyVRpQbVfFXBUw12fU6hJcXwPByjKS2SVK1OFvHsmj5XHhRTgkMzjt UgFAi3QdO5vbYBl1Xshw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo2ZM-00AKZe-SD; Fri, 19 Nov 2021 12:00:41 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo2Z8-00AKUN-U2 for linux-arm-kernel@lists.infradead.org; Fri, 19 Nov 2021 12:00:28 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 87199615A4; Fri, 19 Nov 2021 12:00:26 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mo2Z6-006XMj-CA; Fri, 19 Nov 2021 12:00:24 +0000 Date: Fri, 19 Nov 2021 12:00:23 +0000 Message-ID: <87h7c873u0.wl-maz@kernel.org> From: Marc Zyngier To: Marcelo Tosatti , Nicolas Saenz Julienne Cc: linux-arm-kernel@lists.infradead.org, rostedt@goodmis.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, mingo@redhat.com, nilal@redhat.com Subject: Re: [RFC PATCH 1/2] arm64/tracing: add cntvct based trace clock In-Reply-To: <20211119112624.GA51423@fuller.cnet> References: <20211119102117.22304-1-nsaenzju@redhat.com> <20211119102117.22304-2-nsaenzju@redhat.com> <20211119112624.GA51423@fuller.cnet> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: mtosatti@redhat.com, nsaenzju@redhat.com, linux-arm-kernel@lists.infradead.org, rostedt@goodmis.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, mingo@redhat.com, nilal@redhat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211119_040027_033149_DCE177F2 X-CRM114-Status: GOOD ( 20.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 19 Nov 2021 11:26:24 +0000, Marcelo Tosatti wrote: > > On Fri, Nov 19, 2021 at 11:21:17AM +0100, Nicolas Saenz Julienne wrote: > > Add a new arm64-specific trace clock using the cntvct register, similar > > to x64-tsc. This gives us: > > - A clock that is relatively fast (1GHz on armv8.6, 1-50MHz otherwise), > > monotonic, and resilient to low power modes. > > - It can be used to correlate events across cpus as well as across > > hypervisor and guests. > > > > By using arch_timer_read_counter() we make sure that armv8.6 cpus use > > the less expensive CNTVCTSS_EL0, which cannot be accessed speculatively. > > Can this register be read by userspace ? (otherwise it won't be possible > to correlate userspace events). Yes. That's part of the userspace ABI. Although this particular accessor is only available from ARMv8.6 and is advertised via a hwcap to userspace. For currently existing implementations, userspace will use the CNTVCT_EL0 accessor, which requires extra synchronisation as it can be speculated. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel