From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
"Vishal Moola (Oracle)" <vishal.moola@gmail.com>
Subject: [PATCH 1/4] m68k: mm: Convert get_pointer_table() to use ptdescs
Date: Tue, 10 Jun 2025 17:12:52 -0700 [thread overview]
Message-ID: <20250611001255.527952-2-vishal.moola@gmail.com> (raw)
In-Reply-To: <20250611001255.527952-1-vishal.moola@gmail.com>
Motorola uses get_pointer_table() for page tables, so it should be using
struct ptdesc, not struct page.
This helps us prepare to allocate ptdescs as their own memory
descriptor, and prepares to remove a user of page->lru.
Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
---
arch/m68k/mm/motorola.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 745bd575dcfa..35c3571ffbef 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -148,16 +148,18 @@ void *get_pointer_table(struct mm_struct *mm, int type)
/*
* For a pointer table for a user process address space, a
- * table is taken from a page allocated for the purpose. Each
- * page can hold 8 pointer tables. The page is remapped in
+ * table is taken from a ptdesc allocated for the purpose. Each
+ * ptdesc can hold 8 pointer tables. The ptdesc is remapped in
* virtual address space to be noncacheable.
*/
if (mask == 0) {
- void *page;
+ struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL | __GFP_ZERO, 0);
+ void *pt_addr;
ptable_desc *new;
- if (!(page = (void *)get_zeroed_page(GFP_KERNEL)))
+ if (!ptdesc)
return NULL;
+ pt_addr = ptdesc_address(ptdesc);
switch (type) {
case TABLE_PTE:
@@ -165,23 +167,23 @@ void *get_pointer_table(struct mm_struct *mm, int type)
* m68k doesn't have SPLIT_PTE_PTLOCKS for not having
* SMP.
*/
- pagetable_pte_ctor(mm, virt_to_ptdesc(page));
+ pagetable_pte_ctor(mm, ptdesc);
break;
case TABLE_PMD:
- pagetable_pmd_ctor(mm, virt_to_ptdesc(page));
+ pagetable_pmd_ctor(mm, ptdesc);
break;
case TABLE_PGD:
- pagetable_pgd_ctor(virt_to_ptdesc(page));
+ pagetable_pgd_ctor(ptdesc);
break;
}
- mmu_page_ctor(page);
+ mmu_page_ctor(pt_addr);
- new = PD_PTABLE(page);
+ new = PD_PTABLE(pt_addr);
PD_MARKBITS(new) = ptable_mask(type) - 1;
list_add_tail(new, dp);
- return (pmd_t *)page;
+ return (pmd_t *)pt_addr;
}
for (tmp = 1, off = 0; (mask & tmp) == 0; tmp <<= 1, off += ptable_size(type))
@@ -191,7 +193,7 @@ void *get_pointer_table(struct mm_struct *mm, int type)
/* move to end of list */
list_move_tail(dp, &ptable_list[type]);
}
- return page_address(PD_PAGE(dp)) + off;
+ return ptdesc_address(PD_PTDESC(dp)) + off;
}
int free_pointer_table(void *table, int type)
--
2.49.0
next prev parent reply other threads:[~2025-06-11 0:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 0:12 [PATCH 0/4] Convert motorola to use ptdescs Vishal Moola (Oracle)
2025-06-11 0:12 ` Vishal Moola (Oracle) [this message]
2025-06-26 8:38 ` [PATCH 1/4] m68k: mm: Convert get_pointer_table() " Geert Uytterhoeven
2025-06-11 0:12 ` [PATCH 2/4] m68k: mm: Convert free_pointer_table() " Vishal Moola (Oracle)
2025-06-26 8:39 ` Geert Uytterhoeven
2025-06-11 0:12 ` [PATCH 3/4] m68k: mm: Convert init_pointer_table() " Vishal Moola (Oracle)
2025-06-26 8:39 ` Geert Uytterhoeven
2025-06-11 0:12 ` [PATCH 4/4] m68k: mm: Convert pointer table macros " Vishal Moola (Oracle)
2025-06-26 8:39 ` Geert Uytterhoeven
2025-06-18 16:56 ` [PATCH 0/4] Convert motorola " Vishal Moola (Oracle)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250611001255.527952-2-vishal.moola@gmail.com \
--to=vishal.moola@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).