Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

s390: implement the new page table range API

Add set_ptes() and update_mmu_cache_range().

Link: https://lkml.kernel.org/r/20230802151406.3735276-24-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
843f9310 864609c6

+24 -9
+24 -9
arch/s390/include/asm/pgtable.h
··· 47 47 * tables contain all the necessary information. 48 48 */ 49 49 #define update_mmu_cache(vma, address, ptep) do { } while (0) 50 + #define update_mmu_cache_range(vmf, vma, addr, ptep, nr) do { } while (0) 50 51 #define update_mmu_cache_pmd(vma, address, ptep) do { } while (0) 51 52 52 53 /* ··· 1317 1316 pgprot_t pgprot_writethrough(pgprot_t prot); 1318 1317 1319 1318 /* 1320 - * Certain architectures need to do special things when PTEs 1321 - * within a page table are directly modified. Thus, the following 1322 - * hook is made available. 1319 + * Set multiple PTEs to consecutive pages with a single call. All PTEs 1320 + * are within the same folio, PMD and VMA. 1323 1321 */ 1324 - static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, 1325 - pte_t *ptep, pte_t entry) 1322 + static inline void set_ptes(struct mm_struct *mm, unsigned long addr, 1323 + pte_t *ptep, pte_t entry, unsigned int nr) 1326 1324 { 1327 1325 if (pte_present(entry)) 1328 1326 entry = clear_pte_bit(entry, __pgprot(_PAGE_UNUSED)); 1329 - if (mm_has_pgste(mm)) 1330 - ptep_set_pte_at(mm, addr, ptep, entry); 1331 - else 1332 - set_pte(ptep, entry); 1327 + if (mm_has_pgste(mm)) { 1328 + for (;;) { 1329 + ptep_set_pte_at(mm, addr, ptep, entry); 1330 + if (--nr == 0) 1331 + break; 1332 + ptep++; 1333 + entry = __pte(pte_val(entry) + PAGE_SIZE); 1334 + addr += PAGE_SIZE; 1335 + } 1336 + } else { 1337 + for (;;) { 1338 + set_pte(ptep, entry); 1339 + if (--nr == 0) 1340 + break; 1341 + ptep++; 1342 + entry = __pte(pte_val(entry) + PAGE_SIZE); 1343 + } 1344 + } 1333 1345 } 1346 + #define set_ptes set_ptes 1334 1347 1335 1348 /* 1336 1349 * Conversion functions: convert a page and protection to a page entry,