Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796178894; b=o0lmaUA9XDpZUxQG1riB7/w1Ul711aYtBGP3mGIRaipeVVq9ANC/wS47p6kd5SrR4fUm kWWyBsRL6hczsgt3by3FBHR1SHUpYod9VNRnfQgKYkPkJTxFm+jUSuz1RwflgoNBqyd/o rX3db/tVaLcb2fAs6wQV14qVxpsVar9IXdQPBuNYR8IsLMYYvNGPYo6X1A+EkBaAXbDad 7fS6Sq5/iM4gxVX00212RPzaxXCI3PFH31DiNqaPGvUuBjY8Gyr5QqSadwS9xiufFDU+v eOoCHM/+8ZWsuVhepVFPSPtcdrw6GxxJW2NQOfDIPTx7jjTG+K6uYBGN1a0ZpoWEvKQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796178894; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=aWfE16yKxsAAA+BmQKX92v44OYrh5c55K7kTBEc8saM=; b=JQtTStgIB3NGqN0wIYWggK4rES8YTSqRuGs5XJ8qDZ7biHCYmpdT/4QMtKF//QFOqUA7 cXlz801MXfRBhErxLRHEPKIBVQ6A7HkGGiMoKl9waFdMtw5rQ1u6N7PCY1BsoJ9yyDNx5 9CTRkVMwfoOwoxFTHcv6Sz0yVNbftSXet+5/RORi9waLxqiOjsmLQHsnVnCdHcAtqQuMX dCKmc/bIVv0PGd0p70fclLEPVd5i0L403FoZM4SNx2Js0tAprOp6gaKrqkW/+tVimH9y6 eyidXlbOWW5gQpHrfFhkXJHaDAyLWy0xCuWP39uNO+D1LMJ9oBqXdW6l6DS+Qn5yuzg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mPk6KxC9; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22BBE606A330 for ; Wed, 2 Dec 2026 02:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mPk6KxC9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BDDE1F0089C; Wed, 2 Dec 2026 02:34:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796178893; bh=aWfE16yKxsAAA+BmQKX92v44OYrh5c55K7kTBEc8saM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=mPk6KxC9LyOMDdGzk1n7vrXy6GOr3g+9tjcFRjE2CIK1+RKeW1783eL+G3POe/muQ fi0VWqSITmYyS86NRAbglS2TkjTbtaNOYajQTlvgVU3RrIBGyWn+TKyM4uucSKrt4p o3/Aso8kveQh+97o2fdyq3qRolyB7sfzPoCTmxxWXB+NKvmvy7p+jT8cxAf/GNJYOT OGe8OzrHGrHSyGI0IgmdvyOf8HZrKDe2iWBz3kmxHwK6qZOIew294zluk6YeLe17Y7 xJ7Nz7SGUQnHhM9JC5C+jtd4+Dyesg2DvtlS8uwmU8HbauGpeOA2N2co0nfrx4ZYPM Q5IGHIQQ0lWAQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH v2 36/43] arm64: Convert remaining page-size switches to if/else Reply-To: sashiko-reviews@lists.linux.dev To: "Eric Curtin" Cc: kvmarm@lists.linux.dev, "Oliver Upton" , "Marc Zyngier" In-Reply-To: <20261201015240.1017259-37-ericcurtin17@gmail.com> References: <20261201015240.1017259-1-ericcurtin17@gmail.com> <20261201015240.1017259-37-ericcurtin17@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 02:34:52 +0000 X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] arm64/hugetlb: wrong TLB level in __flush_hugetlb_tlb_range() when PMD folded -- commit 5b0d07814855f56d322919aecd907ae1707cccbb Author: Eric Curtin arm64: Convert remaining page-size switches to if/else This commit converts page-size switch statements and preprocessor conditionals to runtime if/else checks and aligns __bss_pgtbl to PAGE_SIZE_MAX to support boot-time page size selection. > diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hu= getlb.h > index d038ff14d16ca..b8487e8c9cf8d 100644 > --- a/arch/arm64/include/asm/hugetlb.h > +++ b/arch/arm64/include/asm/hugetlb.h > @@ -73,20 +73,17 @@ static inline void __flush_hugetlb_tlb_range(struct v= m_area_struct *vma, > unsigned long stride, > tlbf_t flags) > { > - switch (stride) { > #ifndef __PAGETABLE_PMD_FOLDED > - case PUD_SIZE: > + if (stride =3D=3D PUD_SIZE) { > __flush_tlb_range(vma, start, end, PUD_SIZE, 1, flags); > - break; > + return; > + } > #endif > - case CONT_PMD_SIZE: > - case PMD_SIZE: > + if (stride =3D=3D CONT_PMD_SIZE || stride =3D=3D PMD_SIZE) { > __flush_tlb_range(vma, start, end, PMD_SIZE, 2, flags); [Severity: Medium] Does __flush_hugetlb_tlb_range() pass TLB level 1 instead of 2 for PMD_SIZE mappings when the PMD level is folded at runtime? With boot-time page size selection (for example, 42-bit VA booted with 64KB pages), __PAGETABLE_PMD_FOLDED is not defined at compile time, but !pgtable_l3_enabled() holds at runtime and PUD_SIZE equals PMD_SIZE. Because stride =3D=3D PUD_SIZE is checked before stride =3D=3D PMD_SIZE wit= hout a pgtable_l3_enabled() guard, flushing a PMD_SIZE hugetlb range takes the PUD_SIZE branch and issues the TLBI with level hint 1 instead of 2, which can leave stale TLB entries on CPUs with FEAT_TTL. Guarding the PUD_SIZE branch with pgtable_l3_enabled() (or checking PMD_SIZE before PUD_SIZE as in __set_ptes_anysz()) avoids this. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201015240.1017= 259-1-ericcurtin17@gmail.com?part=3D36