From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B9F993E5A17 for ; Thu, 28 May 2026 11:41:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779968506; cv=none; b=IAFQl1A7F+nT7Fz7I6A1nlRVydOMfPJJ4kV0m2660neFZ0yo/sV82RcHDqMLETw0x9h58cTp8qSbeOVwnWjKlBYzD8hgv7B8eJ37eiZ0WesolQpUx0pbXhHADpmpNBAWLPjl97DkZVvksMvShf1HEYfX6iitLszvFkL6gvHh0dQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779968506; c=relaxed/simple; bh=U8KVBn904hYPekKcFmTuIBYybPXalXFjZ3T0IhFiM1w=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=e+GZVEypt3vjAuYGI+Ze9YSd1EcAyEEe9BEBSrKE5/oCHHr5Ubcw92cLQyoHJyBPfsCBHwMHpb6as6+APhVYga6PGtb3n/jCAPk+HlG2oiDBLNSCQc8OtxzR0qax2OPFpUD6zfNho6z1uD8mu1r3Iu+bOsmDFln4aIJVHODar+E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sZozyMQj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="sZozyMQj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22E461F000E9; Thu, 28 May 2026 11:41:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779968504; bh=WPIqgcPCBHIVxt57RXj+MlO2FA804p8zxza8Nku+WmA=; h=Subject:To:Cc:From:Date; b=sZozyMQjIzfKhQjrOXsfvt9XAYD+m4hkmeLlh2NjVhbLgGBGa89sOIqboxY/iSraY lNmSLB7VEFBpin2+mcye+4gsFDgRt3gZDp80FllirdhVZj7gRH8UqTpkG7oMk5vqeC 56na5JwJ0NT/Owm3YZbbYpSZCGQBQDL4NJE2uYDE= Subject: FAILED: patch "[PATCH] arm64: tlb: Flush walk cache when unsharing PMD tables" failed to apply to 5.10-stable tree To: zengheng4@huawei.com,catalin.marinas@arm.com,stable@vger.kernel.org Cc: From: Date: Thu, 28 May 2026 13:40:37 +0200 Message-ID: <2026052837-spotty-squishier-8961@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x c2ff4764e03e7a8d758352f4aceb8fe1be6ac971 # git commit -s git send-email --to '' --in-reply-to '2026052837-spotty-squishier-8961@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From c2ff4764e03e7a8d758352f4aceb8fe1be6ac971 Mon Sep 17 00:00:00 2001 From: Zeng Heng Date: Thu, 21 May 2026 15:30:11 +0800 Subject: [PATCH] arm64: tlb: Flush walk cache when unsharing PMD tables When huge_pmd_unshare() is called to unshare a PMD table, the tlb_unshare_pmd_ptdesc() function sets tlb->unshared_tables=true but the aarch64 tlb_flush() only checked tlb->freed_tables to determine whether to use TLBF_NONE (vae1is, invalidates walk cache) or TLBF_NOWALKCACHE (vale1is, leaf-only). This caused the stale PMD page table entry to remain in the walk cache after unshare, potentially leading to incorrect page table walks. Fix by including unshared_tables in the check, so that when unsharing tables, TLBF_NONE is used and the walk cache is properly invalidated. Here is the detailed distinction between vae1is and vale1is: | Instruction Combination | Actual Invalidation Scope | | ------------------------ | --------------------------------------------------| | `VAE1IS` + TTL=`0` | All entries at all levels (full invalidation) | | `VAE1IS` + TTL=`2` (L2) | Non-leaf at Level 0/1 + leaf at Level 2 | | `VALE1IS` + TTL=`0` | Leaf entries at all levels (non-leaf not cleared) | | `VALE1IS` + TTL=`2` (L2) | Leaf entry at Level 2 only | Signed-off-by: Zeng Heng Fixes: 8ce720d5bd91 ("mm/hugetlb: fix excessive IPI broadcasts when unsharing PMD tables using mmu_gather") Cc: Signed-off-by: Catalin Marinas diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h index 10869d7731b8..751bd57bc3ba 100644 --- a/arch/arm64/include/asm/tlb.h +++ b/arch/arm64/include/asm/tlb.h @@ -53,7 +53,8 @@ static inline int tlb_get_level(struct mmu_gather *tlb) static inline void tlb_flush(struct mmu_gather *tlb) { struct vm_area_struct vma = TLB_FLUSH_VMA(tlb->mm, 0); - tlbf_t flags = tlb->freed_tables ? TLBF_NONE : TLBF_NOWALKCACHE; + tlbf_t flags = (tlb->freed_tables || tlb->unshared_tables) ? + TLBF_NONE : TLBF_NOWALKCACHE; unsigned long stride = tlb_get_unmap_size(tlb); int tlb_level = tlb_get_level(tlb);