From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 868B11C3F02; Wed, 19 Feb 2025 19:04:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739991855; cv=none; b=rUnHHKb0JA0n5ed1sRcepoS9WQ15X9XHsLMELtyvNsuVp2P+wlrmNPkuwORcW5CQMs2e9Fa32F5R7fcz6kYAohxS/oQyQHXfRJobbyQnghCfhKmRA5YGtOgAWq4oAbVc2wAkC6450kYVu913bpqdaphKQ17VB62iUva9OEdCE4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739991855; c=relaxed/simple; bh=TR4fWPqzQadJ/W0eppkMviJUDNSORR6geJs++8Vt76A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=izLrmBiT0k4b1ehXflRFk0EYFUGOo64TrznSJTgHFGvbEfkEf42lVZqPAI1V45HIyUcaCAA8ffVpiTZibws+bR1rNNkB+bqrNIxzLG6gFfQ35uv+YRyXvF1Lk1HhwzWYl62PGYqJ7A6Ya3wtGJhSTTgoQlRPbXIkPZ/+1im90RQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB9C8C4CED1; Wed, 19 Feb 2025 19:04:08 +0000 (UTC) Date: Wed, 19 Feb 2025 19:04:06 +0000 From: Catalin Marinas To: Ryan Roberts Cc: Will Deacon , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Gerald Schaefer , "David S. Miller" , Andreas Larsson , Arnd Bergmann , Muchun Song , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , David Hildenbrand , "Matthew Wilcox (Oracle)" , Mark Rutland , Anshuman Khandual , Dev Jain , Kevin Brodsky , Alexandre Ghiti , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 3/4] arm64: hugetlb: Fix flush_hugetlb_tlb_range() invalidation level Message-ID: References: <20250217140419.1702389-1-ryan.roberts@arm.com> <20250217140419.1702389-4-ryan.roberts@arm.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250217140419.1702389-4-ryan.roberts@arm.com> On Mon, Feb 17, 2025 at 02:04:16PM +0000, Ryan Roberts wrote: > commit c910f2b65518 ("arm64/mm: Update tlb invalidation routines for > FEAT_LPA2") changed the "invalidation level unknown" hint from 0 to > TLBI_TTL_UNKNOWN (INT_MAX). But the fallback "unknown level" path in > flush_hugetlb_tlb_range() was not updated. So as it stands, when trying > to invalidate CONT_PMD_SIZE or CONT_PTE_SIZE hugetlb mappings, we will > spuriously try to invalidate at level 0 on LPA2-enabled systems. > > Fix this so that the fallback passes TLBI_TTL_UNKNOWN, and while we are > at it, explicitly use the correct stride and level for CONT_PMD_SIZE and > CONT_PTE_SIZE, which should provide a minor optimization. > > Cc: stable@vger.kernel.org > Fixes: c910f2b65518 ("arm64/mm: Update tlb invalidation routines for FEAT_LPA2") > Signed-off-by: Ryan Roberts Reviewed-by: Catalin Marinas