/* Expected to be called in stop_machine() ("equivalent to taking
every spinlock in the system"), so the locking doesn't really matter all that much.  */
void xen_mm_pin_all(void)
/* Expected to be called in stop_machine() ("equivalent to taking
every spinlock in the system"), so the locking doesn't really matter all that much.  */
void xen_mm_pin_all(void)
{
	unsigned long flags;
	struct page *page;
	spin_lock_irqsave(&pgd_lock, flags);
	list_for_each_entry(page, &pgd_list, lru) {
		if (!PagePinned(page)) {
			__xen_pgd_pin(&init_mm, (pgd_t *)page_address(page));
			SetPageSavePinned(page);
		}
	}
	spin_unlock_irqrestore(&pgd_lock, flags);
}