Using version 1 grant tables limits guests to using 16TB of grantable RAM, and prevents the use of subpage grants. Some versions of the Xen hypervisor refuse to allow the grant table version to be set after the first grant references have been created, so the loaded operating system may be stuck with whatever choice we make here. We therefore currently use version 2 grant tables, since they give the most flexibility to the loaded OS. Current versions (7.2.0) of the Windows PV drivers have no support for version 2 grant tables, and will merrily create version 1 entries in what the hypervisor believes to be a version 2 table. This causes some confusion. Avoid this problem by attempting to use version 1 tables, since otherwise we may render Windows unable to boot. Play nicely with other potential bootloaders by accepting either version 1 or version 2 grant tables (if we are unable to set our requested version). Note that the use of version 1 tables on a 64-bit system introduces a possible failure path in which a frame number cannot fit into the 32-bit field within the v1 structure. This in turn introduces additional failure paths into netfront_transmit() and netfront_refill_rx(). Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
||
145 | 145 |
|
146 | 146 |
|
147 | 147 |
|
148 |
|
|
148 |
|
|
149 | 149 |
|
150 | 150 |
|
151 | 151 |
|
152 |
|
|
152 |
|
|
153 | 153 |
|
154 | 154 |
|
155 |
|
|
155 | 156 |
|
156 | 157 |
|
157 |
|
|
158 | 158 |
|
159 | 159 |
|
160 | 160 |
|
161 | 161 |
|
162 |
|
|
163 |
|
|
164 |
|
|
162 | 165 |
|
163 |
|
|
164 | 166 |
|
165 | 167 |
|
166 | 168 |
|
|
||
218 | 220 |
|
219 | 221 |
|
220 | 222 |
|
221 |
|
|
223 |
|
|
222 | 224 |
|
223 |
|
|
224 |
|
|
225 |
|
|
225 | 226 |
|
226 | 227 |
|
228 |
|
|
227 | 229 |
|
228 | 230 |
|
229 | 231 |
|
|
||
258 | 260 |
|
259 | 261 |
|
260 | 262 |
|
261 |
|
|
263 |
|
|
264 |
|
|
262 | 265 |
|
263 | 266 |
|
264 | 267 |
|
|
||
273 | 276 |
|
274 | 277 |
|
275 | 278 |
|
276 |
|
|
279 |
|
|
277 | 280 |
|
278 | 281 |
|
279 | 282 |
|
|
||
286 | 289 |
|
287 | 290 |
|
288 | 291 |
|
289 |
|
|
292 |
|
|
290 | 293 |
|
291 | 294 |
|
292 | 295 |
|
|
||
296 | 299 |
|
297 | 300 |
|
298 | 301 |
|
299 |
|
|
300 |
|
|
301 | 302 |
|
302 |
|
|
303 |
|
|
304 | 303 |
|
305 | 304 |
|
306 |
|
|
307 |
|
|
308 |
|
|
309 |
|
|
310 |
|
|
305 |
|
|
306 |
|
|
307 |
|
|
311 | 308 |
|
312 |
|
|
313 |
|
|
314 |
|
|
315 |
|
|
316 |
|
|
317 |
|
|
318 |
|
|
319 |
|
|
320 |
|
|
321 |
|
|
322 |
|
|
323 |
|
|
324 |
|
|
325 |
|
|
326 |
|
|
327 |
|
|
309 |
|
|
328 | 310 |
|
329 | 311 |
|
330 | 312 |
|
331 | 313 |
|
332 |
|
|
333 |
|
|
334 |
|
|
335 |
|
|
336 |
|
|
314 |
|
|
315 |
|
|
316 |
|
|
317 |
|
|
337 | 318 |
|
338 | 319 |
|
339 |
|
|
340 |
|
|
341 |
|
|
320 |
|
|
342 | 321 |
|
343 |
|
|
344 |
|
|
345 |
|
|
346 |
|
|
347 |
|
|
348 |
|
|
349 | 322 |
|
350 | 323 |
|
351 | 324 |
|
|
||
354 | 327 |
|
355 | 328 |
|
356 | 329 |
|
357 |
|
|
358 | 330 |
|
359 | 331 |
|
360 |
|
|
361 |
|
|
332 |
|
|
362 | 333 |
|
363 | 334 |
|
364 | 335 |
|
|
||
292 | 292 |
|
293 | 293 |
|
294 | 294 |
|
295 |
|
|
296 |
|
|
295 |
|
|
296 |
|
|
297 |
|
|
298 |
|
|
299 |
|
|
300 |
|
|
301 |
|
|
297 | 302 |
|
298 | 303 |
|
299 | 304 |
|
|
||
309 | 314 |
|
310 | 315 |
|
311 | 316 |
|
317 |
|
|
312 | 318 |
|
313 | 319 |
|
314 | 320 |
|
|
||
320 | 326 |
|
321 | 327 |
|
322 | 328 |
|
329 |
|
|
323 | 330 |
|
324 |
|
|
331 |
|
|
325 | 332 |
|
326 | 333 |
|
327 | 334 |
|
328 | 335 |
|
329 |
|
|
330 |
|
|
331 |
|
|
332 |
|
|
336 |
|
|
337 |
|
|
338 |
|
|
333 | 339 |
|
334 | 340 |
|
335 |
|
|
341 |
|
|
342 |
|
|
343 |
|
|
336 | 344 |
|
337 | 345 |
|
338 | 346 |
|
339 | 347 |
|
340 | 348 |
|
341 |
|
|
342 |
|
|
343 |
|
|
344 |
|
|
345 |
|
|
349 |
|
|
350 |
|
|
346 | 351 |
|
347 | 352 |
|
348 | 353 |
|
349 | 354 |
|
350 | 355 |
|
351 |
|
|
352 |
|
|
353 |
|
|
356 |
|
|
357 |
|
|
358 |
|
|
359 |
|
|
360 |
|
|
361 |
|
|
362 |
|
|
363 |
|
|
364 |
|
|
365 |
|
|
366 |
|
|
354 | 367 |
|
355 |
|
|
368 |
|
|
369 |
|
|
370 |
|
|
371 |
|
|
372 |
|
|
373 |
|
|
374 |
|
|
375 |
|
|
356 | 376 |
|
357 | 377 |
|
358 | 378 |
|
|
||
431 | 451 |
|
432 | 452 |
|
433 | 453 |
|
434 |
|
|
454 |
|
|
435 | 455 |
|
436 |
|
|
456 |
|
|
457 |
|
|
437 | 458 |
|
438 | 459 |
|
439 | 460 |
|
440 | 461 |
|
462 |
|
|
441 | 463 |
|
442 | 464 |
|
443 | 465 |
|
|
||
455 | 477 |
|
456 | 478 |
|
457 | 479 |
|
458 |
|
|
459 |
|
|
460 |
|
|
480 |
|
|
481 |
|
|
482 |
|
|
483 |
|
|
484 |
|
|
485 |
|
|
486 |
|
|
461 | 487 |
|
462 | 488 |
|
463 | 489 |
|
464 | 490 |
|
491 |
|
|
492 |
|
|
493 |
|
|
465 | 494 |
|
466 | 495 |
|
467 | 496 |
|
|
||
526 | 555 |
|
527 | 556 |
|
528 | 557 |
|
529 |
|
|
558 |
|
|
530 | 559 |
|
531 | 560 |
|
532 | 561 |
|
|
||
614 | 643 |
|
615 | 644 |
|
616 | 645 |
|
646 |
|
|
617 | 647 |
|
618 | 648 |
|
619 | 649 |
|
|
||
624 | 654 |
|
625 | 655 |
|
626 | 656 |
|
627 |
|
|
628 |
|
|
629 |
|
|
657 |
|
|
658 |
|
|
659 |
|
|
660 |
|
|
661 |
|
|
630 | 662 |
|
631 | 663 |
|
632 | 664 |
|
|
||
634 | 666 |
|
635 | 667 |
|
636 | 668 |
|
669 |
|
|
670 |
|
|
671 |
|
|
637 | 672 |
|
638 | 673 |
|
639 | 674 |
|
|
||
727 | 762 |
|
728 | 763 |
|
729 | 764 |
|
730 |
|
|
731 | 765 |
|
732 | 766 |
|
733 | 767 |
|
|
||
736 | 770 |
|
737 | 771 |
|
738 | 772 |
|
739 |
|
|
773 |
|
|
740 | 774 |
|
741 | 775 |
|
742 | 776 |
|
|
||
27 | 27 |
|
28 | 28 |
|
29 | 29 |
|
30 |
|
|
31 |
|
|
32 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
33 | 35 |
|
34 | 36 |
|
35 | 37 |
|
|
||
10 | 10 |
|
11 | 11 |
|
12 | 12 |
|
13 |
|
|
13 | 14 |
|
14 | 15 |
|
15 | 16 |
|
16 | 17 |
|
18 |
|
|
19 |
|
|
20 |
|
|
17 | 21 |
|
18 | 22 |
|
19 | 23 |
|
|
||
46 | 50 |
|
47 | 51 |
|
48 | 52 |
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
134 |
|
|
135 |
|
|
136 |
|
|
49 | 137 |
|
50 | 138 |
|
51 | 139 |
|
|
||
54 | 142 |
|
55 | 143 |
|
56 | 144 |
|
57 |
|
|
145 |
|
|
58 | 146 |
|
59 | 147 |
|
60 |
|
|
148 |
|
|
61 | 149 |
|
62 | 150 |
|
63 | 151 |
|
|
||
65 | 153 |
|
66 | 154 |
|
67 | 155 |
|
68 |
|
|
156 |
|
|
157 |
|
|
158 |
|
|
159 |
|
|
69 | 160 |
|
70 | 161 |
|
71 | 162 |
|
|
||
76 | 167 |
|
77 | 168 |
|
78 | 169 |
|
170 |
|
|
79 | 171 |
|
80 |
|
|
172 |
|
|
81 | 173 |
|
82 | 174 |
|
83 |
|
|
175 |
|
|
176 |
|
|
177 |
|
|
84 | 178 |
|
85 | 179 |
|
86 |
|
|
180 |
|
|
181 |
|
|
182 |
|
|
183 |
|
|
184 |
|
|
185 |
|
|
186 |
|
|
187 |
|
|
188 |
|
|
189 |
|
|
190 |
|
|
191 |
|
|
87 | 192 |
|
88 |
|
|
193 |
|
|
194 |
|
|
195 |
|
|
196 |
|
|
197 |
|
|
198 |
|
|
199 |
|
|
200 |
|
|
201 |
|
|
202 |
|
|
203 |
|
|
204 |
|
|
89 | 205 |
|
90 |
|
|
206 |
|
|
207 |
|
|
208 |
|
|
209 |
|
|
210 |
|
|
211 |
|
|
212 |
|
|
213 |
|
|
214 |
|
|
91 | 215 |
|
216 |
|
|
217 |
|
|
218 |
|
|
92 | 219 |
|
93 |
|
|
220 |
|
|
94 | 221 |
|
222 |
|
|
223 |
|
|
95 | 224 |
|
96 | 225 |
|
226 |
|
|
97 | 227 |
|
98 | 228 |
|
99 | 229 |
|
|
||
20 | 20 |
|
21 | 21 |
|
22 | 22 |
|
23 |
|
|
23 | 24 |
|
24 | 25 |
|
25 | 26 |
|
|
||
32 | 33 |
|
33 | 34 |
|
34 | 35 |
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
134 |
|
|
135 |
|
|
35 | 136 |
|
36 | 137 |
|
37 | 138 |
|
|
||
42 | 143 |
|
43 | 144 |
|
44 | 145 |
|
45 |
|
|
46 |
|
|
146 |
|
|
147 |
|
|
148 |
|
|
47 | 149 |
|
48 | 150 |
|
49 | 151 |
|
50 | 152 |
|
51 | 153 |
|
52 |
|
|
53 |
|
|
154 |
|
|
54 | 155 |
|
55 | 156 |
|
56 |
|
|
157 |
|
|
57 | 158 |
|
58 | 159 |
|
59 | 160 |
|
60 |
|
|
161 |
|
|
61 | 162 |
|
62 | 163 |
|
63 | 164 |
|
|
||
66 | 167 |
|
67 | 168 |
|
68 | 169 |
|
69 |
|
|
170 |
|
|
70 | 171 |
|
71 | 172 |
|
72 | 173 |
|
73 | 174 |
|
74 | 175 |
|
75 | 176 |
|
76 |
|
|
77 |
|
|
177 |
|
|
178 |
|
|
78 | 179 |
|
79 |
|
|
180 |
|
|
80 | 181 |
|
81 | 182 |
|
183 |
|
|
184 |
|
|
185 |
|
|
82 | 186 |
|
83 | 187 |
|
84 | 188 |
|
85 | 189 |
|
86 |
|
|
190 |
|
|
87 | 191 |
|
88 | 192 |
|
89 | 193 |
|
|
||
105 | 209 |
|
106 | 210 |
|
107 | 211 |
|
108 |
|
|
212 |
|
|
109 | 213 |
|
110 | 214 |
|
111 | 215 |
|
|
||
114 | 218 |
|
115 | 219 |
|
116 | 220 |
|
117 |
|
|
221 |
|
|
118 | 222 |
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
223 |
|
|
224 |
|
|
225 |
|
|
123 | 226 |
|
124 | 227 |
|
125 | 228 |
|