summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2023-11-03 16:40:13 +0100
committerVasily Gorbik <gor@linux.ibm.com>2023-11-05 22:34:58 +0100
commit0031f1c7cf2632a068a80261071b9b1f2d32d836 (patch)
tree4737f15084b49e53a26d1dd8d67302570356cc8c /arch
parentd08d4e7cd6bffe333f09853005aa549a8d57614b (diff)
s390/mm: use compound page order to distinguish page tables
CRSTs always have size of four pages, while 2KB-size page tables always occupy a single page. Use that information to distinguish page tables from CRSTs. Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/mm/pgalloc.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c
index 5b15b45941c6..8159f4fade3f 100644
--- a/arch/s390/mm/pgalloc.c
+++ b/arch/s390/mm/pgalloc.c
@@ -199,20 +199,15 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table,
mm = tlb->mm;
if (mm_alloc_pgste(mm))
gmap_unlink(mm, table, vmaddr);
- table = (unsigned long *)((unsigned long)table | 0x01U);
tlb_remove_ptdesc(tlb, table);
}
-void __tlb_remove_table(void *_table)
+void __tlb_remove_table(void *table)
{
- struct ptdesc *ptdesc;
- unsigned int mask;
- void *table;
+ struct ptdesc *ptdesc = virt_to_ptdesc(table);
+ struct page *page = ptdesc_page(ptdesc);
- mask = (unsigned long)_table & 0x01U;
- table = (void *)((unsigned long)_table ^ mask);
- ptdesc = virt_to_ptdesc(table);
- if (!mask) {
+ if (compound_order(page) == CRST_ALLOC_ORDER) {
/* pmd, pud, or p4d */
pagetable_free(ptdesc);
return;