From: "tip-bot2 for Vishal Moola" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Vishal Moola <vishal.moola@gmail.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
William Kucharski <william.kucharski@linux.dev>,
"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/mm] x86/mm: Convert pgd_page_get_mm() to ptdescs
Date: Mon, 13 Jul 2026 23:07:14 -0000 [thread overview]
Message-ID: <178398403440.1844600.17090728243534856208.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260629185742.126987-8-vishal.moola@gmail.com>
The following commit has been merged into the x86/mm branch of tip:
Commit-ID: dd9850c91665a56babd964df19de2cb90a98c538
Gitweb: https://git.kernel.org/tip/dd9850c91665a56babd964df19de2cb90a98c538
Author: Vishal Moola <vishal.moola@gmail.com>
AuthorDate: Mon, 29 Jun 2026 11:57:40 -07:00
Committer: Dave Hansen <dave.hansen@linux.intel.com>
CommitterDate: Mon, 13 Jul 2026 15:55:10 -07:00
x86/mm: Convert pgd_page_get_mm() to ptdescs
Convert pgd_page_get_mm() to ptdescs. Define struct ptdesc in our
pgtable_types so that our declarations recognize ptdesc as an
appropriate page table type.
Now that all callers are using ptdescs, we can pass in that
ptdesc to get the underlying mm_struct.
Signed-off-by: Vishal Moola <vishal.moola@gmail.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: William Kucharski <william.kucharski@linux.dev>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Link: https://patch.msgid.link/20260629185742.126987-8-vishal.moola@gmail.com
---
arch/x86/include/asm/pgtable.h | 2 +-
arch/x86/include/asm/pgtable_types.h | 2 +-
arch/x86/mm/fault.c | 2 +-
arch/x86/mm/init_64.c | 4 ++--
arch/x86/mm/pgtable.c | 4 ++--
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index ac295ca..dd046f2 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -50,7 +50,7 @@ void ptdump_walk_user_pgd_level_checkwx(void);
extern spinlock_t pgd_lock;
extern struct list_head pgd_list;
-extern struct mm_struct *pgd_page_get_mm(struct page *page);
+struct mm_struct *pgd_page_get_mm(struct ptdesc *pt);
extern pmdval_t early_pmd_flags;
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 2ec250b..95c7f45 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -512,7 +512,7 @@ static inline pgprot_t pgprot_large_2_4k(pgprot_t pgprot)
return __pgprot(protval_large_2_4k(pgprot_val(pgprot)));
}
-
+struct ptdesc;
typedef struct page *pgtable_t;
extern pteval_t __supported_pte_mask;
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index c31ffea..aa88370 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -282,7 +282,7 @@ void arch_sync_kernel_mappings(unsigned long start, unsigned long end)
spinlock_t *pgt_lock;
/* the pgt_lock only for Xen */
- pgt_lock = &pgd_page_get_mm(ptdesc_page(ptdesc))->page_table_lock;
+ pgt_lock = &pgd_page_get_mm(ptdesc)->page_table_lock;
spin_lock(pgt_lock);
vmalloc_sync_one(ptdesc_address(ptdesc), addr);
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 1441f5f..bf529a9 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -152,7 +152,7 @@ static void sync_global_pgds_l5(unsigned long start, unsigned long end)
pgd = (pgd_t *)ptdesc_address(ptdesc) + pgd_index(addr);
/* the pgt_lock only for Xen */
- pgt_lock = &pgd_page_get_mm(ptdesc_page(ptdesc))->page_table_lock;
+ pgt_lock = &pgd_page_get_mm(ptdesc)->page_table_lock;
spin_lock(pgt_lock);
if (!pgd_none(*pgd_ref) && !pgd_none(*pgd))
@@ -195,7 +195,7 @@ static void sync_global_pgds_l4(unsigned long start, unsigned long end)
pgd = (pgd_t *)ptdesc_address(ptdesc) + pgd_index(addr);
p4d = p4d_offset(pgd, addr);
/* the pgt_lock only for Xen */
- pgt_lock = &pgd_page_get_mm(ptdesc_page(ptdesc))->page_table_lock;
+ pgt_lock = &pgd_page_get_mm(ptdesc)->page_table_lock;
spin_lock(pgt_lock);
if (!p4d_none(*p4d_ref) && !p4d_none(*p4d))
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index f32facd..cb03f5a 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -74,9 +74,9 @@ static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm)
virt_to_ptdesc(pgd)->pt_mm = mm;
}
-struct mm_struct *pgd_page_get_mm(struct page *page)
+struct mm_struct *pgd_page_get_mm(struct ptdesc *pt)
{
- return page_ptdesc(page)->pt_mm;
+ return pt->pt_mm;
}
static void pgd_ctor(struct mm_struct *mm, pgd_t *pgd)
next prev parent reply other threads:[~2026-07-13 23:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 18:57 [PATCH v2 0/9] Convert x86 pgd_lists " Vishal Moola
2026-06-29 18:57 ` [PATCH v2 1/9] x86/mm/pat: Use IS_ENABLED() instead of ifdef Vishal Moola
2026-07-13 23:07 ` [tip: x86/mm] " tip-bot2 for Vishal Moola
2026-06-29 18:57 ` [PATCH v2 2/9] x86/mm/pat: Convert __set_pmd_pte() to ptdescs Vishal Moola
2026-07-13 23:07 ` [tip: x86/mm] " tip-bot2 for Vishal Moola
2026-06-29 18:57 ` [PATCH v2 3/9] x86/mm/pat: Convert collapse_pmd_page() " Vishal Moola
2026-07-13 23:07 ` [tip: x86/mm] " tip-bot2 for Vishal Moola
2026-06-29 18:57 ` [PATCH v2 4/9] x86/mm: Convert arch_sync_kernel_mappings() " Vishal Moola
2026-07-13 23:07 ` [tip: x86/mm] " tip-bot2 for Vishal Moola
2026-06-29 18:57 ` [PATCH v2 5/9] x86/mm: Convert sync_global_pgds_l5() " Vishal Moola
2026-07-13 23:07 ` [tip: x86/mm] " tip-bot2 for Vishal Moola
2026-06-29 18:57 ` [PATCH v2 6/9] x86/mm: Convert sync_global_pgds_l4() " Vishal Moola
2026-07-13 23:07 ` [tip: x86/mm] " tip-bot2 for Vishal Moola
2026-06-29 18:57 ` [PATCH v2 7/9] x86/mm: Convert pgd_page_get_mm() " Vishal Moola
2026-07-13 23:07 ` tip-bot2 for Vishal Moola [this message]
2026-06-29 18:57 ` [PATCH v2 8/9] x86/xen: Convert xen_mm_pin_all() " Vishal Moola
2026-07-13 23:07 ` [tip: x86/mm] " tip-bot2 for Vishal Moola
2026-06-29 18:57 ` [PATCH v2 9/9] x86/xen: Convert xen_mm_unpin_all() " Vishal Moola
2026-07-13 23:07 ` [tip: x86/mm] " tip-bot2 for Vishal Moola
2026-07-06 17:48 ` [PATCH v2 0/9] Convert x86 pgd_lists " Vishal Moola
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=178398403440.1844600.17090728243534856208.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=rppt@kernel.org \
--cc=vishal.moola@gmail.com \
--cc=william.kucharski@linux.dev \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®