Commit e93ec87
committed
x86/xen: allow larger contiguous memory regions in PV guests
Today a PV guest (including dom0) can create 2MB contiguous memory
regions for DMA buffers at max. This has led to problems at least
with the megaraid_sas driver, which wants to allocate a 2.3MB DMA
buffer.
The limiting factor is the frame array used to do the hypercall for
making the memory contiguous, which has 512 entries and is just a
static array in mmu_pv.c.
In order to not waste memory for non-PV guests, put the initial
frame array into .init.data section and dynamically allocate an array
from the .init_after_bootmem hook of PV guests.
In case a contiguous memory area larger than the initially supported
2MB is requested, allocate a larger buffer for the frame list. Note
that such an allocation is tried only after memory management has been
initialized properly, which is tested via a flag being set in the
.init_after_bootmem hook.
Fixes: 9f40ec8 ("xen/swiotlb: add alignment check for dma buffers")
Signed-off-by: Juergen Gross <[email protected]>
Tested-by: Alan Robinson <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>1 parent 85fcb57 commit e93ec87
1 file changed
+62
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
114 | 159 | | |
115 | 160 | | |
116 | 161 | | |
| |||
814 | 859 | | |
815 | 860 | | |
816 | 861 | | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
817 | 865 | | |
818 | 866 | | |
819 | 867 | | |
| |||
2203 | 2251 | | |
2204 | 2252 | | |
2205 | 2253 | | |
2206 | | - | |
2207 | | - | |
2208 | | - | |
2209 | | - | |
2210 | 2254 | | |
2211 | 2255 | | |
2212 | 2256 | | |
| |||
2323 | 2367 | | |
2324 | 2368 | | |
2325 | 2369 | | |
2326 | | - | |
| 2370 | + | |
2327 | 2371 | | |
2328 | 2372 | | |
2329 | 2373 | | |
2330 | 2374 | | |
2331 | | - | |
2332 | | - | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
2333 | 2382 | | |
2334 | 2383 | | |
2335 | 2384 | | |
2336 | 2385 | | |
2337 | 2386 | | |
| 2387 | + | |
| 2388 | + | |
2338 | 2389 | | |
2339 | 2390 | | |
2340 | 2391 | | |
| |||
2358 | 2409 | | |
2359 | 2410 | | |
2360 | 2411 | | |
2361 | | - | |
| 2412 | + | |
2362 | 2413 | | |
2363 | 2414 | | |
2364 | 2415 | | |
2365 | 2416 | | |
2366 | | - | |
| 2417 | + | |
2367 | 2418 | | |
2368 | 2419 | | |
2369 | 2420 | | |
2370 | 2421 | | |
2371 | 2422 | | |
2372 | 2423 | | |
2373 | 2424 | | |
| 2425 | + | |
| 2426 | + | |
2374 | 2427 | | |
2375 | 2428 | | |
2376 | 2429 | | |
| |||
0 commit comments