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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 534E9C433EF for ; Mon, 10 Jan 2022 17:32:11 +0000 (UTC) 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=db0h6ysYaVY1AaNrrzc0jWosPTB0EQHkJY3Akwqax9I=; b=yPxQqT30AS9TeI 73x/goeMS9k6//nBl2heQSA7zUusOAk4NQeljrVSfdaoJPJU4EITzqYRiDz17vLfzabfs4ZAIPhwS qMnHFctzt1kfs5PfXMiBSwt6A8T1qhWRXSd/g9XMTQtMj+sOUMry/QQh6ivqb+HnF6fw+vh1ur79b 0Ax9qQKtYsgIcWB5VEIk0VrvWqLGuNNy163dhJEWtmxrtCC4/EeYrKLL+s1xplhC7vLpgkJvsXr1N wuwUEnoDhrmLI5VWkLEFDAOwR9sOX8pXbwAuHEGqIaYEAZsj8bHpiiEJiAk5bvVg4KTjX8V3ho8Cs eksO1ZsZ4gMp7RjsS2Kg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6yVb-00CZmO-Tk; Mon, 10 Jan 2022 17:31:04 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6yVY-00CZlU-Dl for linux-arm-kernel@lists.infradead.org; Mon, 10 Jan 2022 17:31:01 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 20939B815CC; Mon, 10 Jan 2022 17:30:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E791FC36AE9; Mon, 10 Jan 2022 17:30:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1641835857; bh=c7tBBRmZwlstIWtVXNinzGG1XgJcbSnyXDOYMi21hBA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=o7cfATe82PMMWB89MsUhepka5hDQYm45H7QMqwO4y1KWTcvSxUwClV431SE36UlCG t7gw2w4jsJg6O208WWh3U2xHxc/bVvs6a0XMshnr2EfGTbrYGj77qNKUYDg42shDe9 r2H8Oj+pHWRHvVHTprhxQQbsrqYbgZ51+/BllKucyCB1E/uUX82NXPL04dYjPo4dhX 44zeOk3K4K/LPQsVZoVYI4j3u94bko/dptqKK3a5VkrwSt97sLOVkpQGBgUinQuWCr thGq2mxkkd8/8l5BotJ/lEoD/KD3R+E3tlNRQZJ7Z6E0xphwIihUvN8iDibFibOIoV Gzy/5gKUDzoxQ== 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 1n6yVT-00HBjN-TH; Mon, 10 Jan 2022 17:30:56 +0000 Date: Mon, 10 Jan 2022 17:30:55 +0000 Message-ID: <87fspvts4w.wl-maz@kernel.org> From: Marc Zyngier To: Huichun Feng Cc: linux-arm-kernel@lists.infradead.org Subject: Re: Does clocksource arch_sys_counter synchronize across CPUs? In-Reply-To: References: 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: foxhoundsk.tw@gmail.com, linux-arm-kernel@lists.infradead.org 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-20220110_093100_623640_C1072F27 X-CRM114-Status: GOOD ( 19.35 ) 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 Mon, 10 Jan 2022 16:51:14 +0000, Huichun Feng wrote: > > Hi list, > > AFAIK, one of the clocksource in arm64 (armv8.3, Rpi4) -- RPI4 is ARMv8.0 (not that it matters here). > arch_sys_counter, uses a per-core register CNTVCT as the accessor. > > And comes to consistency of CNTVCT's, after searching some of the > related manuals [0-2], I didn't find statements saying that it is > synchronize across CPUs. However, I've found a recent patch [3] says > that CNTVCT is synchronized in armv8.6. > > So, does CNTVCT synchronize across CPUs in armv8.3? CNTVCT_EL0 is guaranteed to be identical across CPUs as long as CNTVOFF_EL2 is identical across CPUs. That's because all the CPUs source their counters from the same source (see the architecture spec in section D11 for the details). The patch you mention makes use of the *self-synchronisation* feature of the CNTVCTSS_EL0 instruction. which guarantees that the instruction won't be reordered wrt to other instructions in the stream, avoiding the use of an ISB instruction. Nothing to do with cross-CPU synchronisation, which has always been guaranteed (there are broken system integrations though). 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