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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,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 D5054C48BDF for ; Tue, 15 Jun 2021 14:02:31 +0000 (UTC) Received: from bombadil.infradead.org (unknown [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 A114661459 for ; Tue, 15 Jun 2021 14:02:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A114661459 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=cKwAKLx3eAKoBR1d38pZB6oVH+tUdWmFX1KJOr8yHfQ=; b=LJcQ+Xgk4ohDTX tFRDidN8XPyHeE0eE9BRIPXxTXY8ZeBjsBUVQK8Qmp7Lxx0z5YHue2XyJav0OapPB4GUgLnDhclTo aRvkDBK2v4NPLJtyCA2DTmEZ3i4VvOoQfN8UVPByJ9o1U0XRwXljo6U36wjeafBbPmj5oLDo7QjkY KcFW1vS2Kro9JofCEWm/IA37S3cxijWk5q9gU7oS4Z1zDx0I4tvPZn88U/TrtXHUzgxipNFZQqqCY c9bgztHVG8oSI/oMrZl6WHo9pwAwZXIu2QvYAKjgi9INCdkVKU+cvKffd73L0jM1Cs56b+cTZiyZV Hoj2Qkk0+g7MtPIWDmaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt9XC-000MxP-Er; Tue, 15 Jun 2021 13:55:18 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt9GT-000DwX-Ny for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Jun 2021 13:38:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9SG+wvjFriwDVynfEw7wfNjxfqPiixZ8F45rl351DKA=; b=qiZRC0L/S60xvhgcjoqGzmnlba hwUX1PaUyRBKfW+9GJYAHPlx8zFwZBY0Dg/ju20VfkpyjuNgV+pOx99ct9nsJ3Q037euLnKSPgT2j kd7KHSQwpXW0uN0bQ/jFdrsWHJxKZMf67MBbxbrwWzQCbeCoJ4kQLQWj5WueisrChTqQ1vEG5V4b8 G4V2e/VMekhLVlkmo3aBJGTa586IH0vtN3L7XyYxEuZxlaUZDOZirvpZaFHb9t8QCxBH5h7uxt45Z IPdVfNWBr30BlAeJZ7CRM7UMfexm5/l5m3UzgUmf2AoOxvkEIcyPEZ/Dz7EiLttdJNBtVBg7QIGcX L2E7SUhQ==; Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt6cj-007kEz-Gl for linux-arm-kernel@lists.infradead.org; Tue, 15 Jun 2021 10:48:58 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6D4A86142B; Tue, 15 Jun 2021 10:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623754134; bh=TJfIm8k1Atz2WF7Z7ECHGCPI5BYuSbbJkM0oEhG4w7w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MWTaNPG0ap3T7Zm9OpnXlBmlVS91ppMW5bb6mIsSIw0SrnvUyanx+7Jp0FkEm87A3 wpX0lctcSiLESwTN8vU3HNuIG0s/+N1Nadhz/3Pawp9ufmq6lPWtEMn73DuZ9rAk/q HH1MYaRu50hKUNBz5ZYwImW2mbXrSuToqXVt4wNqAJUREq8/rcBj6VWra4DpEs9Qz3 lyRp7mSAp4Ayc2g3nhBc7nWKpXvDR0ndHZ9ZkvcmfwFb7qyt4WE+y18U09LBCJyrwv ssGr8z2dr1CU0xEkH7f1UHC+5AfEFlYaeg/gsAUcwivr+ffByh1FzNpPoosLuqcWUI u+t8xX0UMLBrg== Date: Tue, 15 Jun 2021 11:48:50 +0100 From: Will Deacon To: Catalin Marinas Cc: Yu Zhao , Jia He , Mark Rutland , Marc Zyngier , Suzuki Poulose , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64: mm: fix warning in arch_faults_on_old_pte() Message-ID: <20210615104850.GC20225@willie-the-truck> References: <20210613214728.1695340-1-yuzhao@google.com> <20210614170727.GG30667@arm.com> <20210615103504.GD26027@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210615103504.GD26027@arm.com> 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-20210615_114856_554914_F8381805 X-CRM114-Status: GOOD ( 34.97 ) 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 Tue, Jun 15, 2021 at 11:35:04AM +0100, Catalin Marinas wrote: > On Mon, Jun 14, 2021 at 12:35:06PM -0600, Yu Zhao wrote: > > On Mon, Jun 14, 2021 at 11:07 AM Catalin Marinas > > wrote: > > > On Sun, Jun 13, 2021 at 03:47:28PM -0600, Yu Zhao wrote: > > > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > > > > index efed2830d141..afdb6e0336ed 100644 > > > > --- a/arch/arm64/kernel/cpufeature.c > > > > +++ b/arch/arm64/kernel/cpufeature.c > > > > @@ -1566,6 +1566,14 @@ static bool has_hw_dbm(const struct arm64_cpu_capabilities *cap, > > > > return true; > > > > } > > > > > > > > +static void cpu_enable_hw_af(struct arm64_cpu_capabilities const *cap) > > > > +{ > > > > + if (has_cpuid_feature(cap, SCOPE_LOCAL_CPU)) { > > > > + u64 val = read_sysreg(tcr_el1); > > > > + > > > > + write_sysreg(val | TCR_HA, tcr_el1); > > > > + } > > > > +} > > > > > > This needs an isb(); local_flush_tlb_all() since this bit may be cached > > > in the TLB. See how we did it in __cpu_enable_hw_dbm(). > > > > Thanks. I'll add it. (I omitted it since I saw it as a best effort, > > not correctness related.) > > The TLBs would eventually be flushed but a local TLBI during boot > doesn't hurt performance, so I'd rather have it. > > > > Alternatively you could leave the current TCR_AF bit setting as is (in > > > proc.S) and only add an arm64_features[] entry for AF together with the > > > arch_faults_on_old_pte() change but without any enable function. > > > > > > I'm not sure we have mixed CPUs where only some of them support AF to > > > benefit from this. > > > > Can we mix CPU versions? For example, can we have A75 (v8.2 with > > AFDBM) + A53 (v8 w/o AFDBM) configuration? My understanding is that we > > can't. But I have not been able to find any confirmation on arm.com. > > Oh, don't underestimate the hardware vendors ;). But if they do, with > this patch they just lose the AF benefits which I don't really mind > (together with other 8.2 features which are not present in 8.0). This feels like walking on thin ice to me... it's only a matter of time before a big/little system is produced where AF is busted on one CPU type, and then we'll have to undo all of this as the system cap will break late CPU onlining if you boot on a CPU with working AF. Given that arch_faults_on_old_pte() is purely a performance hint, why don't we just set it based on the capabilities of the boot CPU instead? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel