aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/p2m.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index cc2f8dcf8dd..6e56b65edaf 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -692,8 +692,9 @@ int m2p_add_override(unsigned long mfn, struct page *page, bool clear_pte)
692 "m2p_add_override: pfn %lx not mapped", pfn)) 692 "m2p_add_override: pfn %lx not mapped", pfn))
693 return -EINVAL; 693 return -EINVAL;
694 } 694 }
695 695 WARN_ON(PagePrivate(page));
696 page->private = mfn; 696 SetPagePrivate(page);
697 set_page_private(page, mfn);
697 page->index = pfn_to_mfn(pfn); 698 page->index = pfn_to_mfn(pfn);
698 699
699 if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)))) 700 if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn))))
@@ -736,7 +737,8 @@ int m2p_remove_override(struct page *page, bool clear_pte)
736 list_del(&page->lru); 737 list_del(&page->lru);
737 spin_unlock_irqrestore(&m2p_override_lock, flags); 738 spin_unlock_irqrestore(&m2p_override_lock, flags);
738 set_phys_to_machine(pfn, page->index); 739 set_phys_to_machine(pfn, page->index);
739 740 WARN_ON(!PagePrivate(page));
741 ClearPagePrivate(page);
740 if (clear_pte && !PageHighMem(page)) 742 if (clear_pte && !PageHighMem(page))
741 set_pte_at(&init_mm, address, ptep, 743 set_pte_at(&init_mm, address, ptep,
742 pfn_pte(pfn, PAGE_KERNEL)); 744 pfn_pte(pfn, PAGE_KERNEL));
@@ -758,7 +760,7 @@ struct page *m2p_find_override(unsigned long mfn)
758 spin_lock_irqsave(&m2p_override_lock, flags); 760 spin_lock_irqsave(&m2p_override_lock, flags);
759 761
760 list_for_each_entry(p, bucket, lru) { 762 list_for_each_entry(p, bucket, lru) {
761 if (p->private == mfn) { 763 if (page_private(p) == mfn) {
762 ret = p; 764 ret = p;
763 break; 765 break;
764 } 766 }