diff options
| author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2014-02-03 06:43:59 -0500 |
|---|---|---|
| committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2014-02-03 06:44:49 -0500 |
| commit | e85fc9805591a17ca8af50023ee8e2b61d9a123b (patch) | |
| tree | 95fbacb38701217f001adefa0abe6f8b65c5ce84 | |
| parent | f93576e1ac34fd7a93d6f3432e71295bbe6a27ce (diff) | |
Revert "xen/grant-table: Avoid m2p_override during mapping"
This reverts commit 08ece5bb2312b4510b161a6ef6682f37f4eac8a1.
As it breaks ARM builds and needs more attention
on the ARM side.
Acked-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| -rw-r--r-- | arch/x86/include/asm/xen/page.h | 5 | ||||
| -rw-r--r-- | arch/x86/xen/p2m.c | 17 | ||||
| -rw-r--r-- | drivers/block/xen-blkback/blkback.c | 15 | ||||
| -rw-r--r-- | drivers/xen/gntdev.c | 13 | ||||
| -rw-r--r-- | drivers/xen/grant-table.c | 89 | ||||
| -rw-r--r-- | include/xen/grant_table.h | 8 |
6 files changed, 46 insertions, 101 deletions
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index 787e1bb5aafc..3e276eb23d1b 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h | |||
| @@ -52,8 +52,7 @@ extern unsigned long set_phys_range_identity(unsigned long pfn_s, | |||
| 52 | extern int m2p_add_override(unsigned long mfn, struct page *page, | 52 | extern int m2p_add_override(unsigned long mfn, struct page *page, |
| 53 | struct gnttab_map_grant_ref *kmap_op); | 53 | struct gnttab_map_grant_ref *kmap_op); |
| 54 | extern int m2p_remove_override(struct page *page, | 54 | extern int m2p_remove_override(struct page *page, |
| 55 | struct gnttab_map_grant_ref *kmap_op, | 55 | struct gnttab_map_grant_ref *kmap_op); |
| 56 | unsigned long mfn); | ||
| 57 | extern struct page *m2p_find_override(unsigned long mfn); | 56 | extern struct page *m2p_find_override(unsigned long mfn); |
| 58 | extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn); | 57 | extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn); |
| 59 | 58 | ||
| @@ -122,7 +121,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn) | |||
| 122 | pfn = m2p_find_override_pfn(mfn, ~0); | 121 | pfn = m2p_find_override_pfn(mfn, ~0); |
| 123 | } | 122 | } |
| 124 | 123 | ||
| 125 | /* | 124 | /* |
| 126 | * pfn is ~0 if there are no entries in the m2p for mfn or if the | 125 | * pfn is ~0 if there are no entries in the m2p for mfn or if the |
| 127 | * entry doesn't map back to the mfn and m2p_override doesn't have a | 126 | * entry doesn't map back to the mfn and m2p_override doesn't have a |
| 128 | * valid entry for it. | 127 | * valid entry for it. |
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 8009acbe41e4..696c694986d0 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
| @@ -899,6 +899,13 @@ int m2p_add_override(unsigned long mfn, struct page *page, | |||
| 899 | "m2p_add_override: pfn %lx not mapped", pfn)) | 899 | "m2p_add_override: pfn %lx not mapped", pfn)) |
| 900 | return -EINVAL; | 900 | return -EINVAL; |
| 901 | } | 901 | } |
| 902 | WARN_ON(PagePrivate(page)); | ||
| 903 | SetPagePrivate(page); | ||
| 904 | set_page_private(page, mfn); | ||
| 905 | page->index = pfn_to_mfn(pfn); | ||
| 906 | |||
| 907 | if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)))) | ||
| 908 | return -ENOMEM; | ||
| 902 | 909 | ||
| 903 | if (kmap_op != NULL) { | 910 | if (kmap_op != NULL) { |
| 904 | if (!PageHighMem(page)) { | 911 | if (!PageHighMem(page)) { |
| @@ -937,16 +944,19 @@ int m2p_add_override(unsigned long mfn, struct page *page, | |||
| 937 | } | 944 | } |
| 938 | EXPORT_SYMBOL_GPL(m2p_add_override); | 945 | EXPORT_SYMBOL_GPL(m2p_add_override); |
| 939 | int m2p_remove_override(struct page *page, | 946 | int m2p_remove_override(struct page *page, |
| 940 | struct gnttab_map_grant_ref *kmap_op, | 947 | struct gnttab_map_grant_ref *kmap_op) |
| 941 | unsigned long mfn) | ||
| 942 | { | 948 | { |
| 943 | unsigned long flags; | 949 | unsigned long flags; |
| 950 | unsigned long mfn; | ||
| 944 | unsigned long pfn; | 951 | unsigned long pfn; |
| 945 | unsigned long uninitialized_var(address); | 952 | unsigned long uninitialized_var(address); |
| 946 | unsigned level; | 953 | unsigned level; |
| 947 | pte_t *ptep = NULL; | 954 | pte_t *ptep = NULL; |
| 948 | 955 | ||
| 949 | pfn = page_to_pfn(page); | 956 | pfn = page_to_pfn(page); |
| 957 | mfn = get_phys_to_machine(pfn); | ||
| 958 | if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT)) | ||
| 959 | return -EINVAL; | ||
| 950 | 960 | ||
| 951 | if (!PageHighMem(page)) { | 961 | if (!PageHighMem(page)) { |
| 952 | address = (unsigned long)__va(pfn << PAGE_SHIFT); | 962 | address = (unsigned long)__va(pfn << PAGE_SHIFT); |
| @@ -960,7 +970,10 @@ int m2p_remove_override(struct page *page, | |||
| 960 | spin_lock_irqsave(&m2p_override_lock, flags); | 970 | spin_lock_irqsave(&m2p_override_lock, flags); |
| 961 | list_del(&page->lru); | 971 | list_del(&page->lru); |
| 962 | spin_unlock_irqrestore(&m2p_override_lock, flags); | 972 | spin_unlock_irqrestore(&m2p_override_lock, flags); |
| 973 | WARN_ON(!PagePrivate(page)); | ||
| 974 | ClearPagePrivate(page); | ||
| 963 | 975 | ||
| 976 | set_phys_to_machine(pfn, page->index); | ||
| 964 | if (kmap_op != NULL) { | 977 | if (kmap_op != NULL) { |
| 965 | if (!PageHighMem(page)) { | 978 | if (!PageHighMem(page)) { |
| 966 | struct multicall_space mcs; | 979 | struct multicall_space mcs; |
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 875025f299b6..6620b73d0490 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c | |||
| @@ -285,7 +285,8 @@ static void free_persistent_gnts(struct xen_blkif *blkif, struct rb_root *root, | |||
| 285 | 285 | ||
| 286 | if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST || | 286 | if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST || |
| 287 | !rb_next(&persistent_gnt->node)) { | 287 | !rb_next(&persistent_gnt->node)) { |
| 288 | ret = gnttab_unmap_refs(unmap, pages, segs_to_unmap); | 288 | ret = gnttab_unmap_refs(unmap, NULL, pages, |
| 289 | segs_to_unmap); | ||
| 289 | BUG_ON(ret); | 290 | BUG_ON(ret); |
| 290 | put_free_pages(blkif, pages, segs_to_unmap); | 291 | put_free_pages(blkif, pages, segs_to_unmap); |
| 291 | segs_to_unmap = 0; | 292 | segs_to_unmap = 0; |
| @@ -320,7 +321,8 @@ static void unmap_purged_grants(struct work_struct *work) | |||
| 320 | pages[segs_to_unmap] = persistent_gnt->page; | 321 | pages[segs_to_unmap] = persistent_gnt->page; |
| 321 | 322 | ||
| 322 | if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST) { | 323 | if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST) { |
| 323 | ret = gnttab_unmap_refs(unmap, pages, segs_to_unmap); | 324 | ret = gnttab_unmap_refs(unmap, NULL, pages, |
| 325 | segs_to_unmap); | ||
| 324 | BUG_ON(ret); | 326 | BUG_ON(ret); |
| 325 | put_free_pages(blkif, pages, segs_to_unmap); | 327 | put_free_pages(blkif, pages, segs_to_unmap); |
| 326 | segs_to_unmap = 0; | 328 | segs_to_unmap = 0; |
| @@ -328,7 +330,7 @@ static void unmap_purged_grants(struct work_struct *work) | |||
| 328 | kfree(persistent_gnt); | 330 | kfree(persistent_gnt); |
| 329 | } | 331 | } |
| 330 | if (segs_to_unmap > 0) { | 332 | if (segs_to_unmap > 0) { |
| 331 | ret = gnttab_unmap_refs(unmap, pages, segs_to_unmap); | 333 | ret = gnttab_unmap_refs(unmap, NULL, pages, segs_to_unmap); |
| 332 | BUG_ON(ret); | 334 | BUG_ON(ret); |
| 333 | put_free_pages(blkif, pages, segs_to_unmap); | 335 | put_free_pages(blkif, pages, segs_to_unmap); |
| 334 | } | 336 | } |
| @@ -668,14 +670,15 @@ static void xen_blkbk_unmap(struct xen_blkif *blkif, | |||
| 668 | GNTMAP_host_map, pages[i]->handle); | 670 | GNTMAP_host_map, pages[i]->handle); |
| 669 | pages[i]->handle = BLKBACK_INVALID_HANDLE; | 671 | pages[i]->handle = BLKBACK_INVALID_HANDLE; |
| 670 | if (++invcount == BLKIF_MAX_SEGMENTS_PER_REQUEST) { | 672 | if (++invcount == BLKIF_MAX_SEGMENTS_PER_REQUEST) { |
| 671 | ret = gnttab_unmap_refs(unmap, unmap_pages, invcount); | 673 | ret = gnttab_unmap_refs(unmap, NULL, unmap_pages, |
| 674 | invcount); | ||
| 672 | BUG_ON(ret); | 675 | BUG_ON(ret); |
| 673 | put_free_pages(blkif, unmap_pages, invcount); | 676 | put_free_pages(blkif, unmap_pages, invcount); |
| 674 | invcount = 0; | 677 | invcount = 0; |
| 675 | } | 678 | } |
| 676 | } | 679 | } |
| 677 | if (invcount) { | 680 | if (invcount) { |
| 678 | ret = gnttab_unmap_refs(unmap, unmap_pages, invcount); | 681 | ret = gnttab_unmap_refs(unmap, NULL, unmap_pages, invcount); |
| 679 | BUG_ON(ret); | 682 | BUG_ON(ret); |
| 680 | put_free_pages(blkif, unmap_pages, invcount); | 683 | put_free_pages(blkif, unmap_pages, invcount); |
| 681 | } | 684 | } |
| @@ -737,7 +740,7 @@ again: | |||
| 737 | } | 740 | } |
| 738 | 741 | ||
| 739 | if (segs_to_map) { | 742 | if (segs_to_map) { |
| 740 | ret = gnttab_map_refs(map, pages_to_gnt, segs_to_map); | 743 | ret = gnttab_map_refs(map, NULL, pages_to_gnt, segs_to_map); |
| 741 | BUG_ON(ret); | 744 | BUG_ON(ret); |
| 742 | } | 745 | } |
| 743 | 746 | ||
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 34a2704fbc88..073b4a19a8b0 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c | |||
| @@ -284,10 +284,8 @@ static int map_grant_pages(struct grant_map *map) | |||
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | pr_debug("map %d+%d\n", map->index, map->count); | 286 | pr_debug("map %d+%d\n", map->index, map->count); |
| 287 | err = gnttab_map_refs_userspace(map->map_ops, | 287 | err = gnttab_map_refs(map->map_ops, use_ptemod ? map->kmap_ops : NULL, |
| 288 | use_ptemod ? map->kmap_ops : NULL, | 288 | map->pages, map->count); |
| 289 | map->pages, | ||
| 290 | map->count); | ||
| 291 | if (err) | 289 | if (err) |
| 292 | return err; | 290 | return err; |
| 293 | 291 | ||
| @@ -317,10 +315,9 @@ static int __unmap_grant_pages(struct grant_map *map, int offset, int pages) | |||
| 317 | } | 315 | } |
| 318 | } | 316 | } |
| 319 | 317 | ||
| 320 | err = gnttab_unmap_refs_userspace(map->unmap_ops + offset, | 318 | err = gnttab_unmap_refs(map->unmap_ops + offset, |
| 321 | use_ptemod ? map->kmap_ops + offset : NULL, | 319 | use_ptemod ? map->kmap_ops + offset : NULL, map->pages + offset, |
| 322 | map->pages + offset, | 320 | pages); |
| 323 | pages); | ||
| 324 | if (err) | 321 | if (err) |
| 325 | return err; | 322 | return err; |
| 326 | 323 | ||
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 8ee13e2e45e2..b84e3ab839aa 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c | |||
| @@ -928,17 +928,15 @@ void gnttab_batch_copy(struct gnttab_copy *batch, unsigned count) | |||
| 928 | } | 928 | } |
| 929 | EXPORT_SYMBOL_GPL(gnttab_batch_copy); | 929 | EXPORT_SYMBOL_GPL(gnttab_batch_copy); |
| 930 | 930 | ||
| 931 | int __gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | 931 | int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, |
| 932 | struct gnttab_map_grant_ref *kmap_ops, | 932 | struct gnttab_map_grant_ref *kmap_ops, |
| 933 | struct page **pages, unsigned int count, | 933 | struct page **pages, unsigned int count) |
| 934 | bool m2p_override) | ||
| 935 | { | 934 | { |
| 936 | int i, ret; | 935 | int i, ret; |
| 937 | bool lazy = false; | 936 | bool lazy = false; |
| 938 | pte_t *pte; | 937 | pte_t *pte; |
| 939 | unsigned long mfn, pfn; | 938 | unsigned long mfn; |
| 940 | 939 | ||
| 941 | BUG_ON(kmap_ops && !m2p_override); | ||
| 942 | ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, map_ops, count); | 940 | ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, map_ops, count); |
| 943 | if (ret) | 941 | if (ret) |
| 944 | return ret; | 942 | return ret; |
| @@ -957,12 +955,10 @@ int __gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | |||
| 957 | set_phys_to_machine(map_ops[i].host_addr >> PAGE_SHIFT, | 955 | set_phys_to_machine(map_ops[i].host_addr >> PAGE_SHIFT, |
| 958 | map_ops[i].dev_bus_addr >> PAGE_SHIFT); | 956 | map_ops[i].dev_bus_addr >> PAGE_SHIFT); |
| 959 | } | 957 | } |
| 960 | return 0; | 958 | return ret; |
| 961 | } | 959 | } |
| 962 | 960 | ||
| 963 | if (m2p_override && | 961 | if (!in_interrupt() && paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) { |
| 964 | !in_interrupt() && | ||
| 965 | paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) { | ||
| 966 | arch_enter_lazy_mmu_mode(); | 962 | arch_enter_lazy_mmu_mode(); |
| 967 | lazy = true; | 963 | lazy = true; |
| 968 | } | 964 | } |
| @@ -979,20 +975,8 @@ int __gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | |||
| 979 | } else { | 975 | } else { |
| 980 | mfn = PFN_DOWN(map_ops[i].dev_bus_addr); | 976 | mfn = PFN_DOWN(map_ops[i].dev_bus_addr); |
| 981 | } | 977 | } |
| 982 | pfn = page_to_pfn(pages[i]); | 978 | ret = m2p_add_override(mfn, pages[i], kmap_ops ? |
| 983 | 979 | &kmap_ops[i] : NULL); | |
| 984 | WARN_ON(PagePrivate(pages[i])); | ||
| 985 | SetPagePrivate(pages[i]); | ||
| 986 | set_page_private(pages[i], mfn); | ||
| 987 | |||
| 988 | pages[i]->index = pfn_to_mfn(pfn); | ||
| 989 | if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)))) { | ||
| 990 | ret = -ENOMEM; | ||
| 991 | goto out; | ||
| 992 | } | ||
| 993 | if (m2p_override) | ||
| 994 | ret = m2p_add_override(mfn, pages[i], kmap_ops ? | ||
| 995 | &kmap_ops[i] : NULL); | ||
| 996 | if (ret) | 980 | if (ret) |
| 997 | goto out; | 981 | goto out; |
| 998 | } | 982 | } |
| @@ -1003,32 +987,15 @@ int __gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | |||
| 1003 | 987 | ||
| 1004 | return ret; | 988 | return ret; |
| 1005 | } | 989 | } |
| 1006 | |||
| 1007 | int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | ||
| 1008 | struct page **pages, unsigned int count) | ||
| 1009 | { | ||
| 1010 | return __gnttab_map_refs(map_ops, NULL, pages, count, false); | ||
| 1011 | } | ||
| 1012 | EXPORT_SYMBOL_GPL(gnttab_map_refs); | 990 | EXPORT_SYMBOL_GPL(gnttab_map_refs); |
| 1013 | 991 | ||
| 1014 | int gnttab_map_refs_userspace(struct gnttab_map_grant_ref *map_ops, | 992 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, |
| 1015 | struct gnttab_map_grant_ref *kmap_ops, | ||
| 1016 | struct page **pages, unsigned int count) | ||
| 1017 | { | ||
| 1018 | return __gnttab_map_refs(map_ops, kmap_ops, pages, count, true); | ||
| 1019 | } | ||
| 1020 | EXPORT_SYMBOL_GPL(gnttab_map_refs_userspace); | ||
| 1021 | |||
| 1022 | int __gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | ||
| 1023 | struct gnttab_map_grant_ref *kmap_ops, | 993 | struct gnttab_map_grant_ref *kmap_ops, |
| 1024 | struct page **pages, unsigned int count, | 994 | struct page **pages, unsigned int count) |
| 1025 | bool m2p_override) | ||
| 1026 | { | 995 | { |
| 1027 | int i, ret; | 996 | int i, ret; |
| 1028 | bool lazy = false; | 997 | bool lazy = false; |
| 1029 | unsigned long pfn, mfn; | ||
| 1030 | 998 | ||
| 1031 | BUG_ON(kmap_ops && !m2p_override); | ||
| 1032 | ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap_ops, count); | 999 | ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap_ops, count); |
| 1033 | if (ret) | 1000 | if (ret) |
| 1034 | return ret; | 1001 | return ret; |
| @@ -1039,33 +1006,17 @@ int __gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | |||
| 1039 | set_phys_to_machine(unmap_ops[i].host_addr >> PAGE_SHIFT, | 1006 | set_phys_to_machine(unmap_ops[i].host_addr >> PAGE_SHIFT, |
| 1040 | INVALID_P2M_ENTRY); | 1007 | INVALID_P2M_ENTRY); |
| 1041 | } | 1008 | } |
| 1042 | return 0; | 1009 | return ret; |
| 1043 | } | 1010 | } |
| 1044 | 1011 | ||
| 1045 | if (m2p_override && | 1012 | if (!in_interrupt() && paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) { |
| 1046 | !in_interrupt() && | ||
| 1047 | paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) { | ||
| 1048 | arch_enter_lazy_mmu_mode(); | 1013 | arch_enter_lazy_mmu_mode(); |
| 1049 | lazy = true; | 1014 | lazy = true; |
| 1050 | } | 1015 | } |
| 1051 | 1016 | ||
| 1052 | for (i = 0; i < count; i++) { | 1017 | for (i = 0; i < count; i++) { |
| 1053 | pfn = page_to_pfn(pages[i]); | 1018 | ret = m2p_remove_override(pages[i], kmap_ops ? |
| 1054 | mfn = get_phys_to_machine(pfn); | 1019 | &kmap_ops[i] : NULL); |
| 1055 | if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT)) { | ||
| 1056 | ret = -EINVAL; | ||
| 1057 | goto out; | ||
| 1058 | } | ||
| 1059 | |||
| 1060 | set_page_private(pages[i], INVALID_P2M_ENTRY); | ||
| 1061 | WARN_ON(!PagePrivate(pages[i])); | ||
| 1062 | ClearPagePrivate(pages[i]); | ||
| 1063 | set_phys_to_machine(pfn, pages[i]->index); | ||
| 1064 | if (m2p_override) | ||
| 1065 | ret = m2p_remove_override(pages[i], | ||
| 1066 | kmap_ops ? | ||
| 1067 | &kmap_ops[i] : NULL, | ||
| 1068 | mfn); | ||
| 1069 | if (ret) | 1020 | if (ret) |
| 1070 | goto out; | 1021 | goto out; |
| 1071 | } | 1022 | } |
| @@ -1076,22 +1027,8 @@ int __gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | |||
| 1076 | 1027 | ||
| 1077 | return ret; | 1028 | return ret; |
| 1078 | } | 1029 | } |
| 1079 | |||
| 1080 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *map_ops, | ||
| 1081 | struct page **pages, unsigned int count) | ||
| 1082 | { | ||
| 1083 | return __gnttab_unmap_refs(map_ops, NULL, pages, count, false); | ||
| 1084 | } | ||
| 1085 | EXPORT_SYMBOL_GPL(gnttab_unmap_refs); | 1030 | EXPORT_SYMBOL_GPL(gnttab_unmap_refs); |
| 1086 | 1031 | ||
| 1087 | int gnttab_unmap_refs_userspace(struct gnttab_unmap_grant_ref *map_ops, | ||
| 1088 | struct gnttab_map_grant_ref *kmap_ops, | ||
| 1089 | struct page **pages, unsigned int count) | ||
| 1090 | { | ||
| 1091 | return __gnttab_unmap_refs(map_ops, kmap_ops, pages, count, true); | ||
| 1092 | } | ||
| 1093 | EXPORT_SYMBOL_GPL(gnttab_unmap_refs_userspace); | ||
| 1094 | |||
| 1095 | static unsigned nr_status_frames(unsigned nr_grant_frames) | 1032 | static unsigned nr_status_frames(unsigned nr_grant_frames) |
| 1096 | { | 1033 | { |
| 1097 | BUG_ON(grefs_per_grant_frame == 0); | 1034 | BUG_ON(grefs_per_grant_frame == 0); |
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 7ad033dbc845..a5af2a26d94f 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
| @@ -191,15 +191,11 @@ void gnttab_free_auto_xlat_frames(void); | |||
| 191 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) | 191 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) |
| 192 | 192 | ||
| 193 | int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | 193 | int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, |
| 194 | struct gnttab_map_grant_ref *kmap_ops, | ||
| 194 | struct page **pages, unsigned int count); | 195 | struct page **pages, unsigned int count); |
| 195 | int gnttab_map_refs_userspace(struct gnttab_map_grant_ref *map_ops, | ||
| 196 | struct gnttab_map_grant_ref *kmap_ops, | ||
| 197 | struct page **pages, unsigned int count); | ||
| 198 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | 196 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, |
| 197 | struct gnttab_map_grant_ref *kunmap_ops, | ||
| 199 | struct page **pages, unsigned int count); | 198 | struct page **pages, unsigned int count); |
| 200 | int gnttab_unmap_refs_userspace(struct gnttab_unmap_grant_ref *unmap_ops, | ||
| 201 | struct gnttab_map_grant_ref *kunmap_ops, | ||
| 202 | struct page **pages, unsigned int count); | ||
| 203 | 199 | ||
| 204 | /* Perform a batch of grant map/copy operations. Retry every batch slot | 200 | /* Perform a batch of grant map/copy operations. Retry every batch slot |
| 205 | * for which the hypervisor returns GNTST_eagain. This is typically due | 201 | * for which the hypervisor returns GNTST_eagain. This is typically due |
