mmu.c (2d8ad8719591fa803b0d589ed057fa46f49b7155) mmu.c (a79e53d85683c6dd9f99c90511028adc2043031f)
1/*
2 * Xen mmu operations
3 *
4 * This file contains the various mmu fetch and update operations.
5 * The most important job they must perform is the mapping between the
6 * domain's pfn and the overall machine mfns.
7 *
8 * Xen allows guests to directly update the pagetable, in a controlled

--- 972 unchanged lines hidden (view full) ---

981 * process is under construction or destruction).
982 *
983 * Expected to be called in stop_machine() ("equivalent to taking
984 * every spinlock in the system"), so the locking doesn't really
985 * matter all that much.
986 */
987void xen_mm_pin_all(void)
988{
1/*
2 * Xen mmu operations
3 *
4 * This file contains the various mmu fetch and update operations.
5 * The most important job they must perform is the mapping between the
6 * domain's pfn and the overall machine mfns.
7 *
8 * Xen allows guests to directly update the pagetable, in a controlled

--- 972 unchanged lines hidden (view full) ---

981 * process is under construction or destruction).
982 *
983 * Expected to be called in stop_machine() ("equivalent to taking
984 * every spinlock in the system"), so the locking doesn't really
985 * matter all that much.
986 */
987void xen_mm_pin_all(void)
988{
989 unsigned long flags;
990 struct page *page;
991
989 struct page *page;
990
992 spin_lock_irqsave(&pgd_lock, flags);
991 spin_lock(&pgd_lock);
993
994 list_for_each_entry(page, &pgd_list, lru) {
995 if (!PagePinned(page)) {
996 __xen_pgd_pin(&init_mm, (pgd_t *)page_address(page));
997 SetPageSavePinned(page);
998 }
999 }
1000
992
993 list_for_each_entry(page, &pgd_list, lru) {
994 if (!PagePinned(page)) {
995 __xen_pgd_pin(&init_mm, (pgd_t *)page_address(page));
996 SetPageSavePinned(page);
997 }
998 }
999
1001 spin_unlock_irqrestore(&pgd_lock, flags);
1000 spin_unlock(&pgd_lock);
1002}
1003
1004/*
1005 * The init_mm pagetable is really pinned as soon as its created, but
1006 * that's before we have page structures to store the bits. So do all
1007 * the book-keeping now.
1008 */
1009static __init int xen_mark_pinned(struct mm_struct *mm, struct page *page,

--- 84 unchanged lines hidden (view full) ---

1094}
1095
1096/*
1097 * On resume, undo any pinning done at save, so that the rest of the
1098 * kernel doesn't see any unexpected pinned pagetables.
1099 */
1100void xen_mm_unpin_all(void)
1101{
1001}
1002
1003/*
1004 * The init_mm pagetable is really pinned as soon as its created, but
1005 * that's before we have page structures to store the bits. So do all
1006 * the book-keeping now.
1007 */
1008static __init int xen_mark_pinned(struct mm_struct *mm, struct page *page,

--- 84 unchanged lines hidden (view full) ---

1093}
1094
1095/*
1096 * On resume, undo any pinning done at save, so that the rest of the
1097 * kernel doesn't see any unexpected pinned pagetables.
1098 */
1099void xen_mm_unpin_all(void)
1100{
1102 unsigned long flags;
1103 struct page *page;
1104
1101 struct page *page;
1102
1105 spin_lock_irqsave(&pgd_lock, flags);
1103 spin_lock(&pgd_lock);
1106
1107 list_for_each_entry(page, &pgd_list, lru) {
1108 if (PageSavePinned(page)) {
1109 BUG_ON(!PagePinned(page));
1110 __xen_pgd_unpin(&init_mm, (pgd_t *)page_address(page));
1111 ClearPageSavePinned(page);
1112 }
1113 }
1114
1104
1105 list_for_each_entry(page, &pgd_list, lru) {
1106 if (PageSavePinned(page)) {
1107 BUG_ON(!PagePinned(page));
1108 __xen_pgd_unpin(&init_mm, (pgd_t *)page_address(page));
1109 ClearPageSavePinned(page);
1110 }
1111 }
1112
1115 spin_unlock_irqrestore(&pgd_lock, flags);
1113 spin_unlock(&pgd_lock);
1116}
1117
1118void xen_activate_mm(struct mm_struct *prev, struct mm_struct *next)
1119{
1120 spin_lock(&next->page_table_lock);
1121 xen_pgd_pin(next);
1122 spin_unlock(&next->page_table_lock);
1123}

--- 1292 unchanged lines hidden ---
1114}
1115
1116void xen_activate_mm(struct mm_struct *prev, struct mm_struct *next)
1117{
1118 spin_lock(&next->page_table_lock);
1119 xen_pgd_pin(next);
1120 spin_unlock(&next->page_table_lock);
1121}

--- 1292 unchanged lines hidden ---