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 0DC96C43461 for ; Fri, 11 Sep 2020 15:29:32 +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 AF26520770 for ; Fri, 11 Sep 2020 15:29:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HShHOrmB"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="KVOG6+ze" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF26520770 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=ocmD/09j3j1+pQwrSv8alHJUMWFIUiLF/Ot53n8O7wM=; b=HShHOrmBDVW9f8Va65xgHtl2r Fg33Paa+dULl1C5mTeBPHyewn7UFBdXS8X3IEbowgAwQFpUciax6G/F6qxQkwhqDiBfvwaEIDetPx +eqNyT+3rH61CQ1dGSZdzf2lJJ9UOe7goM6ttQC3x95RN3VTHuX0S3a0B+nMc7xYZGtUAShkGfqYg kB5qz9zzEmo65nbItdAuGTGeBLm4bS2K0XYhtpR6uvZZcwf6JOf9JDKwknTjY10K1Lo6jR0A/0EgN hLa2D4eJonxDYegBC7/iFMGf9GQhiR5U0r/KTXnTK71l5AjzfIE3VQrUi9x6qtzi64EmnsO63y4kY FNUN4xFeA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGkyF-0004BO-8w; Fri, 11 Sep 2020 15:28:15 +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 1kGkyC-0004Ak-Om for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 15:28:13 +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 CB642221EB; Fri, 11 Sep 2020 15:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599838092; bh=6cV2mWJIcsvc3E4AksrgeSByklmLHYWmlJOjYI4CUKg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KVOG6+zeqb4cOuFAtx6ydb9KHxbI96sEBa1KRey3btHR6BMrcIgOrFIYNaNAOaMY5 3QuiLd96i5FgCPS2X2FHF/c7/0Iec/YVLmRMj875HcwzkE3a8IWGqbFkl+25fTUeMm zTacF6ylhQu4ESuYxO/iCwyC8iookf0LGExWOcHs= Date: Fri, 11 Sep 2020 16:28:07 +0100 From: Will Deacon To: Catalin Marinas Subject: Re: [PATCH v5 2/2] arm64: Add workaround for Arm Cortex-A77 erratum 1508412 Message-ID: <20200911152807.GA20527@willie-the-truck> References: <20200909231310.3297400-1-robh@kernel.org> <20200909231310.3297400-2-robh@kernel.org> <20200911103714.GA4094@gaia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200911103714.GA4094@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-20200911_112812_878078_C91DB7C5 X-CRM114-Status: GOOD ( 19.82 ) 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 Fri, Sep 11, 2020 at 11:37:14AM +0100, Catalin Marinas wrote: > On Wed, Sep 09, 2020 at 05:13:10PM -0600, Rob Herring wrote: > > diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h > > index 554a7e8ecb07..55dfff8ca466 100644 > > --- a/arch/arm64/include/asm/sysreg.h > > +++ b/arch/arm64/include/asm/sysreg.h > > @@ -943,6 +943,7 @@ > > > > #include > > #include > > +#include > > > > #define __DEFINE_MRS_MSR_S_REGNUM \ > > " .irp num,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30\n" \ > > @@ -1024,6 +1025,17 @@ > > write_sysreg(__scs_new, sysreg); \ > > } while (0) > > > > +#define read_sysreg_par() ({ \ > > + unsigned long flags; \ > > + u64 par; \ > > + local_irq_save(flags); \ > > + asm(ALTERNATIVE("nop", "dmb sy", ARM64_WORKAROUND_1508412)); \ > > + par = read_sysreg(par_el1); \ > > + asm(ALTERNATIVE("nop", "dmb sy", ARM64_WORKAROUND_1508412)); \ > > + local_irq_restore(flags); \ > > + par; \ > > +}) > > As an alternative to local_irq_save/restore, we could have added a dmb > in the kernel_exit macro. The minor nit here is that we always disable > interrupts even when the erratum doesn't apply. > > The EL1 code accessing PAR_EL1 already runs with interrupts disabled > (which covers the prior AT instruction). If that's the case for KVM as > well, we could drop the local_irq_* entirely and just leave the DMB in > the exit to guest code. I wonder if that's actually a more robust approach in the case of psuedo NMIs using ARM64_HAS_IRQ_PRIO_MASKING? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel