Skip to contentSkip to conversation

powerpc-assert_pte_locked-use-pte_offset_map_nolock.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Aug 11, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: powerpc: assert_pte_locked() use pte_offset_map_nolock()
has been removed from the -mm tree. Its filename was
powerpc-assert_pte_locked-use-pte_offset_map_nolock.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Hugh Dickins <[email protected]>
Subject: powerpc: assert_pte_locked() use pte_offset_map_nolock()
Date: Tue, 11 Jul 2023 21:34:25 -0700 (PDT)

Instead of pte_lockptr(), use the recently added pte_offset_map_nolock() in assert_pte_locked(). BUG if pte_offset_map_nolock() fails.

This mod might cause new crashes: which either expose my ignorance, or indicate issues to be fixed, or limit the usage of assert_pte_locked().

[[email protected]: assert_pte_locked() still needs the pmd_none() check]
Cc Alexander Gordeev <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Aneesh Kumar K.V <[email protected]>
Cc Anshuman Khandual <[email protected]>
Cc Axel Rasmussen <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Claudio Imbrenda <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Gerald Schaefer <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Huang, Ying <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Jann Horn <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Miaohe Lin <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Mike Kravetz <[email protected]>
Cc Mike Rapoport (IBM) <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc Pavel Tatashin <[email protected]>
Cc Peter Xu <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Qi Zheng <[email protected]>
Cc Ralph Campbell <[email protected]>
Cc Russell King <[email protected]>
Cc SeongJae Park <[email protected]>
Cc Song Liu <[email protected]>
Cc Steven Price <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Vishal Moola (Oracle) <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Will Deacon <[email protected]>
Cc Yang Shi <[email protected]>
Cc Yu Zhao <[email protected]>
Cc Zack Rusin <[email protected]>
Cc Zi Yan <[email protected]>

---

 arch/powerpc/mm/pgtable.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
arch/powerpc/mm/pgtable.c renamed from arch/powerpc/mm/pgtable.c~powerpc-assert_pte_locked-use-pte_offset_map_nolock +6 -2
@@ -311,6 +311,8 @@ void assert_pte_locked(struct mm_struct
 	p4d_t *p4d;
 	pud_t *pud;
 	pmd_t *pmd;
+	pte_t *pte;
+	spinlock_t *ptl;
 
 	if (mm == &init_mm)
 		return;
@@ -329,8 +331,10 @@ void assert_pte_locked(struct mm_struct
 	 */
 	if (pmd_none(*pmd))
 		return;
-	BUG_ON(!pmd_present(*pmd));
-	assert_spin_locked(pte_lockptr(mm, pmd));
+	pte = pte_offset_map_nolock(mm, pmd, addr, &ptl);
+	BUG_ON(!pte);
+	assert_spin_locked(ptl);
+	pte_unmap(pte);
 }
 #endif /* CONFIG_DEBUG_VM */
 

_

Patches currently in -mm which might be from [email protected] are