Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vishal Moola <vishal.moola@gmail.com>
To: Dave Hansen <dave.hansen@intel.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org, x86@kernel.org
Cc: Mike Rapoport <rppt@kernel.org>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	xen-devel@lists.xenproject.org, Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Vishal Moola <vishal.moola@gmail.com>,
	William Kucharski <william.kucharski@linux.dev>
Subject: [PATCH v2 9/9] x86/xen: Convert xen_mm_unpin_all() to ptdescs
Date: Mon, 29 Jun 2026 11:57:42 -0700	[thread overview]
Message-ID: <20260629185742.126987-10-vishal.moola@gmail.com> (raw)
In-Reply-To: <20260629185742.126987-1-vishal.moola@gmail.com>

Convert xen_mm_unpin_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 yet.

Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: William Kucharski <william.kucharski@linux.dev>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Vishal Moola <vishal.moola@gmail.com>
---
 arch/x86/xen/mmu_pv.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index 7b23a34db8ff..6ff5a7130e53 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -947,16 +947,16 @@ static void xen_pgd_unpin(struct mm_struct *mm)
  */
 void xen_mm_unpin_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 (PageSavePinned(page)) {
-			BUG_ON(!PagePinned(page));
-			__xen_pgd_unpin(&init_mm, (pgd_t *)page_address(page));
-			ClearPageSavePinned(page);
+	list_for_each_entry(ptdesc, &pgd_list, pt_list) {
+		if (PageSavePinned(ptdesc_page(ptdesc))) {
+			BUG_ON(!PagePinned(ptdesc_page(ptdesc)));
+			__xen_pgd_unpin(&init_mm, (pgd_t *)ptdesc_address(ptdesc));
+			ClearPageSavePinned(ptdesc_page(ptdesc));
 		}
 	}
 
-- 
2.54.0



  parent reply	other threads:[~2026-06-29 18:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 18:57 [PATCH v2 0/9] Convert x86 pgd_lists to ptdescs Vishal Moola
2026-06-29 18:57 ` [PATCH v2 1/9] x86/mm/pat: Use IS_ENABLED() instead of ifdef Vishal Moola
2026-06-29 18:57 ` [PATCH v2 2/9] x86/mm/pat: Convert __set_pmd_pte() to ptdescs Vishal Moola
2026-06-29 18:57 ` [PATCH v2 3/9] x86/mm/pat: Convert collapse_pmd_page() " Vishal Moola
2026-06-29 18:57 ` [PATCH v2 4/9] x86/mm: Convert arch_sync_kernel_mappings() " Vishal Moola
2026-06-29 18:57 ` [PATCH v2 5/9] x86/mm: Convert sync_global_pgds_l5() " Vishal Moola
2026-06-29 18:57 ` [PATCH v2 6/9] x86/mm: Convert sync_global_pgds_l4() " Vishal Moola
2026-06-29 18:57 ` [PATCH v2 7/9] x86/mm: Convert pgd_page_get_mm() " Vishal Moola
2026-06-29 18:57 ` [PATCH v2 8/9] x86/xen: Convert xen_mm_pin_all() " Vishal Moola
2026-06-29 18:57 ` Vishal Moola [this message]
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=20260629185742.126987-10-vishal.moola@gmail.com \
    --to=vishal.moola@gmail.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rppt@kernel.org \
    --cc=tglx@kernel.org \
    --cc=william.kucharski@linux.dev \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.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