From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sinmsgout01.his.huawei.com (sinmsgout01.his.huawei.com [119.8.177.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA00A2D322E for ; Tue, 27 Jan 2026 12:59:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=119.8.177.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769518785; cv=none; b=oCa8hH06Bp4yQGn3LHw+NLN4/9EBFhrmy0GTEXdDNzZAD7IgES0dYhy3/E9BWsxVSOfxgVnqdEjeGsW3IRsvdiZI1yF/2Jfp3udfGuGn8ZH2pztwK626JNml7VfpgqAP6Bwf3R3wtrpdomq8ZOLtaYuzp58Lm4xQqsyK0oS4Hc0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769518785; c=relaxed/simple; bh=JOCR2X2GggqzFkzNtMHaxBuo9yVJptVcnQm7Vrg47tI=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Fx5VAVnkudjOl/VcAGZiTUhJBaxwHFMjEzb3R14IfktS3PTWsgwh9shAjOGtJb+VT1tffiEW112H7q0Qom2T8n26g03BMWhl9q54BhsFD/e9z6hpSDqMlQNJxv7qaengVKlmr8xSq2X3k14cQczp1Z+SmwNMeNtjNNSkmLQbOM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=VQ0c7KuU; arc=none smtp.client-ip=119.8.177.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="VQ0c7KuU" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=S8LiAGHz52z0JtOCVGrYooVecD5f4OG6WmvXLSeQJ94=; b=VQ0c7KuUR7UMFx/neAsOM+A0UyzZZQQnpflYqPcMK/NC9NWvn0dkstOr2MbI02XuwWvVyRzDq +kIVwz9HE6+QCVdWAjCwjCSqkEXZUhbxhT2+R/3nQurOlxC3nxJfbW14vqQwMiQFz0+3+IBM7h4 BTsB7HTMqRR7BhR3wuIYpM0= Received: from frasgout.his.huawei.com (unknown [172.18.146.32]) by sinmsgout01.his.huawei.com (SkyGuard) with ESMTPS id 4f0lmP0zWMz1P6jV; Tue, 27 Jan 2026 20:57:08 +0800 (CST) Received: from mail.maildlp.com (unknown [172.18.224.107]) by frasgout.his.huawei.com (SkyGuard) with ESMTPS id 4f0lpL1wRfzHnH5y; Tue, 27 Jan 2026 20:58:50 +0800 (CST) Received: from dubpeml500005.china.huawei.com (unknown [7.214.145.207]) by mail.maildlp.com (Postfix) with ESMTPS id CF08440584; Tue, 27 Jan 2026 20:59:35 +0800 (CST) Received: from localhost (10.203.177.15) by dubpeml500005.china.huawei.com (7.214.145.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 27 Jan 2026 12:59:35 +0000 Date: Tue, 27 Jan 2026 12:59:33 +0000 From: Jonathan Cameron To: Ryan Roberts CC: Will Deacon , Ard Biesheuvel , Catalin Marinas , Mark Rutland , Linus Torvalds , Oliver Upton , Marc Zyngier , "Dev Jain" , Linu Cherian , , Subject: Re: [PATCH v2 12/13] arm64: mm: Wrap flush_tlb_page() around ___flush_tlb_range() Message-ID: <20260127125933.00006101@huawei.com> In-Reply-To: <20260119172202.1681510-13-ryan.roberts@arm.com> References: <20260119172202.1681510-1-ryan.roberts@arm.com> <20260119172202.1681510-13-ryan.roberts@arm.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500011.china.huawei.com (7.191.174.215) To dubpeml500005.china.huawei.com (7.214.145.207) On Mon, 19 Jan 2026 17:21:59 +0000 Ryan Roberts wrote: > Flushing a page from the tlb is just a special case of flushing a range. > So let's rework flush_tlb_page() so that it simply wraps > ___flush_tlb_range(). While at it, let's also update the API to take the > same flags that we use when flushing a range. This allows us to delete > all the ugly "_nosync", "_local" and "_nonotify" variants. > > Thanks to constant folding, all of the complex looping and tlbi-by-range > options get eliminated so that the generated code for flush_tlb_page() > looks very similar to the previous version. > > Reviewed-by: Linu Cherian > Signed-off-by: Ryan Roberts So this does include the use of the Case TLBF_NOBROADCAST from previous patch, but only whilst (I think) slightly changing behavior. Gah. I'm regretting looking at this series. The original code is really hard to read :) Rather you than me to fix it! > static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end) > { > const unsigned long stride = PAGE_SIZE; > diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c > index be9dab2c7d6a..f91aa686f142 100644 > --- a/arch/arm64/mm/fault.c > +++ b/arch/arm64/mm/fault.c > @@ -239,7 +239,7 @@ int __ptep_set_access_flags(struct vm_area_struct *vma, > * flush_tlb_fix_spurious_fault(). > */ > if (dirty) > - local_flush_tlb_page(vma, address); > + __flush_tlb_page(vma, address, TLBF_NOBROADCAST); Ultimately I think this previously did __tlbi(vale1) and now does __tlbi(vae1) Original call was to __local_flush_tlb_page_notify_nosync() I'd like to see that sort of change called out and explained in the patch description. It's a broader scoped flush so not a bug, but still a functional change. > return 1; > } >