x86/xen: Convert xen_mm_pin_all() to ptdescs

Convert xen_mm_pin_all() to ptdescs in preparation for the eventual
splitting of ptdescs from struct page. Continue checking PagePinned
through the underlying page as we do not have a per-memdesc api for
page flags yet.

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>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Link: https://patch.msgid.link/20260629185742.126987-9-vishal.moola@gmail.com
This commit is contained in:
Vishal Moola 2026-06-29 11:57:41 -07:00 committed by Dave Hansen
parent dd9850c916
commit 278ddbd274

View File

@ -836,15 +836,15 @@ static void xen_pgd_pin(struct mm_struct *mm)
*/
void xen_mm_pin_all(void)
{
struct page *page;
struct ptdesc *ptdesc;
spin_lock(&init_mm.page_table_lock);
spin_lock(&pgd_lock);
list_for_each_entry(page, &pgd_list, lru) {
if (!PagePinned(page)) {
__xen_pgd_pin(&init_mm, (pgd_t *)page_address(page));
SetPageSavePinned(page);
list_for_each_entry(ptdesc, &pgd_list, pt_list) {
if (!PagePinned(ptdesc_page(ptdesc))) {
__xen_pgd_pin(&init_mm, (pgd_t *)ptdesc_address(ptdesc));
SetPageSavePinned(ptdesc_page(ptdesc));
}
}