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 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B1FCC433DF for ; Thu, 30 Jul 2020 08:24:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 DC253204EA for ; Thu, 30 Jul 2020 08:24:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NMyTO6R0"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="favUfCOG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC253204EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VzAFZ3A3WvzcpULKu/b1UveE8moaMKkCmWjnFReh0Tc=; b=NMyTO6R0QtOIRHa+N77ZOH/2h Rv3hgVU1QD/EMEYL3biBOPHp9nB8qWeo1k8U5Ua9iIOY2hzMtuSMmZMGty5doGr3zGI4n14In9FAz cunexJDbu/9cWr+nxD3cJrmv1XfKw7N1gDMJ5zIHAChgNlDqLxMpMntaWtIEqz+HyMjHhC0i5Hoz8 GnPvle9LaAuECSN6jrN0x+5zahDzMOkS5cnVJvLX16vMlrXjHEnMoqbENmb9kFrqZDqjIkMZCn4f9 p32lrajurBDd0TrRqpTHQB/apUOufPLz+ksTgeCK2d9LWKKIZ79BrzTiJ/LiX1tmRJIdG1YxGgpEP OO/ZUlgwg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k13pq-0005kf-Na; Thu, 30 Jul 2020 08:22:42 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k13pi-0005j2-AE for linux-arm-kernel@lists.infradead.org; Thu, 30 Jul 2020 08:22:35 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (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 3B434204EA; Thu, 30 Jul 2020 08:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596097352; bh=aKR339rvFZ/2LR6RrTw4ykalF/OU2/9B2fF8Qx+XlW8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=favUfCOGHZ7HdWgZXIZ+X0fMC3A+2B3+n4SJRkilr10BFxhtRzlAAor9pK2x2pXgc 4pBV6okym/1xP+/mLhr/AzT7E9P6O5O0zmlPytuNIa3zDLFuwDIGpg5ByWkNwjWg+e FdiaSv6pp6GUa4NHIPs6j4G+z4OEXtSL/S9WtGnc= Date: Thu, 30 Jul 2020 09:22:27 +0100 From: Will Deacon To: Catalin Marinas Subject: Re: [PATCH v3 3/3] arm64: Add workaround for Arm Cortex-A77 erratum 1508412 Message-ID: <20200730082227.GA24095@willie-the-truck> References: <20200717205233.903344-1-robh@kernel.org> <20200717205233.903344-4-robh@kernel.org> <20200729163800.GA24572@gaia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200729163800.GA24572@gaia> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200730_042234_441050_B81E1590 X-CRM114-Status: GOOD ( 17.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Suzuki K Poulose , Marc Zyngier , James Morse , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Julien Thierry 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 Wed, Jul 29, 2020 at 05:38:00PM +0100, Catalin Marinas wrote: > On Fri, Jul 17, 2020 at 02:52:33PM -0600, Rob Herring wrote: > > diff --git a/arch/arm64/include/asm/kvm_hyp.h b/arch/arm64/include/asm/kvm_hyp.h > > index ce3080834bfa..ce5b0d9b12bf 100644 > > --- a/arch/arm64/include/asm/kvm_hyp.h > > +++ b/arch/arm64/include/asm/kvm_hyp.h > > @@ -46,6 +46,17 @@ > > #define read_sysreg_el2(r) read_sysreg_elx(r, _EL2, _EL1) > > #define write_sysreg_el2(v,r) write_sysreg_elx(v, r, _EL2, _EL1) > > > > +static inline u64 __hyp_text read_sysreg_par(void) > > +{ > > + u64 par; > > + if (cpus_have_const_cap(ARM64_WORKAROUND_1508412)) > > + dmb(sy); > > + par = read_sysreg(par_el1); > > + if (cpus_have_const_cap(ARM64_WORKAROUND_1508412)) > > + dmb(sy); > > + return par; > > +} > > Even if that's not always called on a critical path, I agree with Andrew > that we could use alternatives here for dmb(sy). Even then, I'm not sure how this helps if the CPU can speculatively branch to the PAR access without executing the DMB. Is that not possible on A77? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel