diff options
author | David Vrabel <david.vrabel@citrix.com> | 2014-07-02 06:25:29 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2014-07-14 15:28:30 -0400 |
commit | 438b33c7145ca8a5131a30c36d8f59bce119a19a (patch) | |
tree | 3f7550d8598a3cb764982543ba34efd35f787d0a /arch/x86/xen | |
parent | 162e371712768248a38646eefa71af38b6e0f8ce (diff) |
xen/grant-table: remove support for V2 tables
Since 11c7ff17c9b6dbf3a4e4f36be30ad531a6cf0ec9 (xen/grant-table: Force
to use v1 of grants.) the code for V2 grant tables is not used.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r-- | arch/x86/xen/grant-table.c | 60 |
1 files changed, 5 insertions, 55 deletions
diff --git a/arch/x86/xen/grant-table.c b/arch/x86/xen/grant-table.c index ebfa9b2c871d..c0413046483a 100644 --- a/arch/x86/xen/grant-table.c +++ b/arch/x86/xen/grant-table.c | |||
@@ -49,7 +49,7 @@ | |||
49 | static struct gnttab_vm_area { | 49 | static struct gnttab_vm_area { |
50 | struct vm_struct *area; | 50 | struct vm_struct *area; |
51 | pte_t **ptes; | 51 | pte_t **ptes; |
52 | } gnttab_shared_vm_area, gnttab_status_vm_area; | 52 | } gnttab_shared_vm_area; |
53 | 53 | ||
54 | int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, | 54 | int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, |
55 | unsigned long max_nr_gframes, | 55 | unsigned long max_nr_gframes, |
@@ -73,43 +73,16 @@ int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, | |||
73 | return 0; | 73 | return 0; |
74 | } | 74 | } |
75 | 75 | ||
76 | int arch_gnttab_map_status(uint64_t *frames, unsigned long nr_gframes, | ||
77 | unsigned long max_nr_gframes, | ||
78 | grant_status_t **__shared) | ||
79 | { | ||
80 | grant_status_t *shared = *__shared; | ||
81 | unsigned long addr; | ||
82 | unsigned long i; | ||
83 | |||
84 | if (shared == NULL) | ||
85 | *__shared = shared = gnttab_status_vm_area.area->addr; | ||
86 | |||
87 | addr = (unsigned long)shared; | ||
88 | |||
89 | for (i = 0; i < nr_gframes; i++) { | ||
90 | set_pte_at(&init_mm, addr, gnttab_status_vm_area.ptes[i], | ||
91 | mfn_pte(frames[i], PAGE_KERNEL)); | ||
92 | addr += PAGE_SIZE; | ||
93 | } | ||
94 | |||
95 | return 0; | ||
96 | } | ||
97 | |||
98 | void arch_gnttab_unmap(void *shared, unsigned long nr_gframes) | 76 | void arch_gnttab_unmap(void *shared, unsigned long nr_gframes) |
99 | { | 77 | { |
100 | pte_t **ptes; | ||
101 | unsigned long addr; | 78 | unsigned long addr; |
102 | unsigned long i; | 79 | unsigned long i; |
103 | 80 | ||
104 | if (shared == gnttab_status_vm_area.area->addr) | ||
105 | ptes = gnttab_status_vm_area.ptes; | ||
106 | else | ||
107 | ptes = gnttab_shared_vm_area.ptes; | ||
108 | |||
109 | addr = (unsigned long)shared; | 81 | addr = (unsigned long)shared; |
110 | 82 | ||
111 | for (i = 0; i < nr_gframes; i++) { | 83 | for (i = 0; i < nr_gframes; i++) { |
112 | set_pte_at(&init_mm, addr, ptes[i], __pte(0)); | 84 | set_pte_at(&init_mm, addr, gnttab_shared_vm_area.ptes[i], |
85 | __pte(0)); | ||
113 | addr += PAGE_SIZE; | 86 | addr += PAGE_SIZE; |
114 | } | 87 | } |
115 | } | 88 | } |
@@ -129,35 +102,12 @@ static int arch_gnttab_valloc(struct gnttab_vm_area *area, unsigned nr_frames) | |||
129 | return 0; | 102 | return 0; |
130 | } | 103 | } |
131 | 104 | ||
132 | static void arch_gnttab_vfree(struct gnttab_vm_area *area) | 105 | int arch_gnttab_init(unsigned long nr_shared) |
133 | { | 106 | { |
134 | free_vm_area(area->area); | ||
135 | kfree(area->ptes); | ||
136 | } | ||
137 | |||
138 | int arch_gnttab_init(unsigned long nr_shared, unsigned long nr_status) | ||
139 | { | ||
140 | int ret; | ||
141 | |||
142 | if (!xen_pv_domain()) | 107 | if (!xen_pv_domain()) |
143 | return 0; | 108 | return 0; |
144 | 109 | ||
145 | ret = arch_gnttab_valloc(&gnttab_shared_vm_area, nr_shared); | 110 | return arch_gnttab_valloc(&gnttab_shared_vm_area, nr_shared); |
146 | if (ret < 0) | ||
147 | return ret; | ||
148 | |||
149 | /* | ||
150 | * Always allocate the space for the status frames in case | ||
151 | * we're migrated to a host with V2 support. | ||
152 | */ | ||
153 | ret = arch_gnttab_valloc(&gnttab_status_vm_area, nr_status); | ||
154 | if (ret < 0) | ||
155 | goto err; | ||
156 | |||
157 | return 0; | ||
158 | err: | ||
159 | arch_gnttab_vfree(&gnttab_shared_vm_area); | ||
160 | return -ENOMEM; | ||
161 | } | 111 | } |
162 | 112 | ||
163 | #ifdef CONFIG_XEN_PVH | 113 | #ifdef CONFIG_XEN_PVH |