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=-10.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,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 42A08C433E0 for ; Wed, 24 Feb 2021 11:18:04 +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 D0CF464EC3 for ; Wed, 24 Feb 2021 11:18:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0CF464EC3 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=lgVuzLnJhpHSfdr03+FBq8l7C2XAf7/ITrX3EaSYgmk=; b=H8LtzEKzAtGq+mo7Z68FhBKGa z8dqzHCsEGqAM1LEfQfspH5VtXUkYnk1/cYk6FSmgkvZgeCz0sgQ1r/Bvov6+KnqY0c3LEJayKYrm 4OKqK/tykdpQ7KtNcyALiwJJZlEXZddudtGN9UY4xO4uW4slUOEM+/LfB2Hw2/vH92mtpRddbL5Oc 9sqyR3Vmij5weu7dkAZTz2L0GBKxsplDlbrSXBSmH5//npYvZPFh7z4OFpGx/j7IXatZLR9L/flgV yvYH1yiqn1U4m2XvTwvu0E7ALQs0fIJA/jSuhfzoia0Em++Adlnqu5lIlpmkK5HNM5UC1Vl5WYefC uOpMHIwGg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEsA5-0004C9-Ri; Wed, 24 Feb 2021 11:16:57 +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 1lEsA4-0004Bd-2l for linux-arm-kernel@lists.infradead.org; Wed, 24 Feb 2021 11:16:56 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id A315460234; Wed, 24 Feb 2021 11:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614165415; bh=V1GPY/z+BTHz05vt9t27DQCn44KkAAQuotjaHc81vwc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YZFHMNZWZUnAJluzLaDocAEzsOc3+K3DYIUquTiZU1eGwbdylzUkZwT9g2xVsZocX 0c4Ht6zSgf8PQFcZ226BjD2+YeJEbCkwZekdl1ucXHGUjFahGOXhzqdg4+LEKLYUtN cYSma0hAGEKY05uTg+dnqGb4TyuU5xzm37Bw2DbifXmo7MYvmJNAqlf8j4FrGtwnO8 +xDgC6c2juem0LqvuqSt80Am08ydQwLA7wrv/MQpnlEnyLrqqXzDHIUAkrOznSPJLt sTFcXVuf7z9ObXwOiVdcpSwsOm+FBIZvGkJ3AFJ7kX2xXkTjaHijmQNw8ryBNB+IFa 9On3qj7Ot9ymQ== Date: Wed, 24 Feb 2021 11:16:50 +0000 From: Will Deacon To: Mark Rutland Subject: Re: [PATCH 2/3] arm64: Add missing ISB after invalidating TLB in __primary_switch Message-ID: <20210224111648.GA11554@willie-the-truck> References: <20210224093738.3629662-1-maz@kernel.org> <20210224093738.3629662-3-maz@kernel.org> <20210224110506.GA50741@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210224110506.GA50741@C02TD0UTHF1T.local> 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-20210224_061656_218173_F2C105C9 X-CRM114-Status: GOOD ( 21.32 ) 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: Marc Zyngier , Guillaume Tucker , Catalin Marinas , kernel-team@android.com, Ard Biesheuvel , linux-arm-kernel@lists.infradead.org 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, Feb 24, 2021 at 11:06:43AM +0000, Mark Rutland wrote: > On Wed, Feb 24, 2021 at 09:37:37AM +0000, Marc Zyngier wrote: > > Although there has been a bit of back and forth on the subject, > > it appears that invalidating TLBs requires an ISB instruction > > after the TLBI/DSB sequence, as documented in d0b7a302d58a > > ("Revert "arm64: Remove unnecessary ISBs from set_{pte,pmd,pud}""). > > That commit describes a different scenario (going faulting->valid > without TLB maintenance), and I don't think that implies anything about > the behaviour in the presence of a TLBI, which is quite different. Sorry, that was my fault. I remember this all happened around the same time. > Howerver, I do see that commits: > > 7f0b1bf045113489 ("arm64: Fix barriers used for page table modifications") > 51696d346c49c6cf ("arm64: tlb: Ensure we execute an ISB following walk cache invalidation") > > ... assume that we need an ISB after a TLBI+DSB, so I think it would be > better to refer to those, to avoid conflating the distinct cases. > > > Add the missing ISB in __primary_switch, just in case. > > > > Fixes: 3c5e9f238bc4 ("arm64: head.S: move KASLR processing out of __enable_mmu()") > > Suggested-by: Will Deacon > > Signed-off-by: Marc Zyngier > > For consistency with the other kernel TLBI paths, I'm fine with this > (assuming we update the commit message accordingly): > > Acked-by: Mark Rutland > > My understanding is that we don't need an ISB after invalidation, and if > we align on that understanding we can follow up and update all of the > TLBI paths in one go. Without FEAT_ETS, I think the ISB is required to complete TLBI: | In an implementation that does not implement FEAT_ETS, a TLB maintenance | instruction executed by a PE, PEx, can complete at any time after it is | issued, but is only guaranteed to be finished for a PE, PEx, after the | execution of DSB by the PEx followed by a Context synchronization event. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel