From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sinmsgout03.his.huawei.com (sinmsgout03.his.huawei.com [119.8.177.38]) (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 C2D2C1E4BE for ; Tue, 27 Jan 2026 12:15:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=119.8.177.38 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769516137; cv=none; b=t8x16Wq0OusgYZKhYHAKvSnhsOXXPP5x97p+SmCdf1ENCYd/IVPl+meaw3CBJcfHaSw5VURhNp7yL9kp/+Xf2EGoDIQe/9GDf5In7VkOeMzfrydKHCRxsslGvbHYr4WGSNykBOuTq/39WMyg88G2njr2RFReyZZi2M7395c1Tyc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769516137; c=relaxed/simple; bh=tiPWiJzHpY2qww7X1ADq6LG0jkRcVmJk/308NnSa67s=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=S/P1GJh+J6M7/oXvl/b7zDWPt2uEwp5ENxXdl5mhFK9RZXlQ96vvZoOKc9bFR+FKb1gfU0eKSu7IZJwwDCv8ipoPt4B4DCwlqnPi0hKsKQYsfAzVGQ9AKAILSlaglZWOr75xNlXivDDyJRQU38R9xgf8zB/U0gUNeJBYeRPMIeM= 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=sXFDwjWk; arc=none smtp.client-ip=119.8.177.38 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="sXFDwjWk" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=ZVFgSV7v+SVxBSQItEHv5QPlcPUOP4v95/hMA3BXYYo=; b=sXFDwjWkDvCx3Bu2OPcTs3wFL8Q5bNgjSk7iZy6+zLdfWCgi1IGe2KL+WNSXaf1bGkhPzuDTJ DvPD/I3CPWEXKu3dlXlMWS70ydMyngsDpsEGPG4BRvJ6FCcRUTVtKzEBLu+DJBopgNoJr5lvb8P 73z5FSu7wAmfptnJC4zU7zM= Received: from frasgout.his.huawei.com (unknown [172.18.146.33]) by sinmsgout03.his.huawei.com (SkyGuard) with ESMTPS id 4f0knR58ZZzMyXm; Tue, 27 Jan 2026 20:12:59 +0800 (CST) Received: from mail.maildlp.com (unknown [172.18.224.107]) by frasgout.his.huawei.com (SkyGuard) with ESMTPS id 4f0kqf0cnWzJ4678; Tue, 27 Jan 2026 20:14:54 +0800 (CST) Received: from dubpeml500005.china.huawei.com (unknown [7.214.145.207]) by mail.maildlp.com (Postfix) with ESMTPS id EEA0B40570; Tue, 27 Jan 2026 20:15:29 +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:15:29 +0000 Date: Tue, 27 Jan 2026 12:15:27 +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 08/13] arm64: mm: Simplify __flush_tlb_range_limit_excess() Message-ID: <20260127121527.0000227e@huawei.com> In-Reply-To: <20260119172202.1681510-9-ryan.roberts@arm.com> References: <20260119172202.1681510-1-ryan.roberts@arm.com> <20260119172202.1681510-9-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: lhrpeml100010.china.huawei.com (7.191.174.197) To dubpeml500005.china.huawei.com (7.214.145.207) On Mon, 19 Jan 2026 17:21:55 +0000 Ryan Roberts wrote: > From: Will Deacon > > __flush_tlb_range_limit_excess() is unnecessarily complicated: > > - It takes a 'start', 'end' and 'pages' argument, whereas it only > needs 'pages' (which the caller has computed from the other two > arguments!). > > - It erroneously compares 'pages' with MAX_TLBI_RANGE_PAGES when > the system doesn't support range-based invalidation but the range to > be invalidated would result in fewer than MAX_DVM_OPS invalidations. > > Simplify the function so that it no longer takes the 'start' and 'end' > arguments and only considers the MAX_TLBI_RANGE_PAGES threshold on > systems that implement range-based invalidation. > > Signed-off-by: Will Deacon > Signed-off-by: Ryan Roberts Reviewed-by: Jonathan Cameron