diff options
Diffstat (limited to 'arch/x86/xen/p2m.c')
-rw-r--r-- | arch/x86/xen/p2m.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 95fb2aa5927e..0d4ec35895d4 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
@@ -161,6 +161,7 @@ | |||
161 | #include <asm/xen/page.h> | 161 | #include <asm/xen/page.h> |
162 | #include <asm/xen/hypercall.h> | 162 | #include <asm/xen/hypercall.h> |
163 | #include <asm/xen/hypervisor.h> | 163 | #include <asm/xen/hypervisor.h> |
164 | #include <xen/balloon.h> | ||
164 | #include <xen/grant_table.h> | 165 | #include <xen/grant_table.h> |
165 | 166 | ||
166 | #include "multicalls.h" | 167 | #include "multicalls.h" |
@@ -967,7 +968,10 @@ int m2p_remove_override(struct page *page, | |||
967 | if (kmap_op != NULL) { | 968 | if (kmap_op != NULL) { |
968 | if (!PageHighMem(page)) { | 969 | if (!PageHighMem(page)) { |
969 | struct multicall_space mcs; | 970 | struct multicall_space mcs; |
970 | struct gnttab_unmap_grant_ref *unmap_op; | 971 | struct gnttab_unmap_and_replace *unmap_op; |
972 | struct page *scratch_page = get_balloon_scratch_page(); | ||
973 | unsigned long scratch_page_address = (unsigned long) | ||
974 | __va(page_to_pfn(scratch_page) << PAGE_SHIFT); | ||
971 | 975 | ||
972 | /* | 976 | /* |
973 | * It might be that we queued all the m2p grant table | 977 | * It might be that we queued all the m2p grant table |
@@ -990,21 +994,25 @@ int m2p_remove_override(struct page *page, | |||
990 | } | 994 | } |
991 | 995 | ||
992 | mcs = xen_mc_entry( | 996 | mcs = xen_mc_entry( |
993 | sizeof(struct gnttab_unmap_grant_ref)); | 997 | sizeof(struct gnttab_unmap_and_replace)); |
994 | unmap_op = mcs.args; | 998 | unmap_op = mcs.args; |
995 | unmap_op->host_addr = kmap_op->host_addr; | 999 | unmap_op->host_addr = kmap_op->host_addr; |
1000 | unmap_op->new_addr = scratch_page_address; | ||
996 | unmap_op->handle = kmap_op->handle; | 1001 | unmap_op->handle = kmap_op->handle; |
997 | unmap_op->dev_bus_addr = 0; | ||
998 | 1002 | ||
999 | MULTI_grant_table_op(mcs.mc, | 1003 | MULTI_grant_table_op(mcs.mc, |
1000 | GNTTABOP_unmap_grant_ref, unmap_op, 1); | 1004 | GNTTABOP_unmap_and_replace, unmap_op, 1); |
1001 | 1005 | ||
1002 | xen_mc_issue(PARAVIRT_LAZY_MMU); | 1006 | xen_mc_issue(PARAVIRT_LAZY_MMU); |
1003 | 1007 | ||
1004 | set_pte_at(&init_mm, address, ptep, | 1008 | mcs = __xen_mc_entry(0); |
1005 | pfn_pte(pfn, PAGE_KERNEL)); | 1009 | MULTI_update_va_mapping(mcs.mc, scratch_page_address, |
1006 | __flush_tlb_single(address); | 1010 | pfn_pte(page_to_pfn(get_balloon_scratch_page()), |
1011 | PAGE_KERNEL_RO), 0); | ||
1012 | xen_mc_issue(PARAVIRT_LAZY_MMU); | ||
1013 | |||
1007 | kmap_op->host_addr = 0; | 1014 | kmap_op->host_addr = 0; |
1015 | put_balloon_scratch_page(); | ||
1008 | } | 1016 | } |
1009 | } | 1017 | } |
1010 | 1018 | ||