aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/xen.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2014-08-13 17:23:11 +0100
committerMichael Brown <mcb30@ipxe.org>2014-08-13 19:21:42 +0100
commitbe79ca535ab9891807d8852447d38d35eff3ff63 (patch)
tree6d87e747cefca89ac721ea300e3be33a36b4e04d /src/include/ipxe/xen.h
parent3f39f9fcb34712bf46f45e184c1227e21e2b7efd (diff)
downloadipxe-be79ca535ab9891807d8852447d38d35eff3ff63.tar.gz
[xen] Use version 1 grant tables by default
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>
Diffstat (limited to 'src/include/ipxe/xen.h')
-rw-r--r--src/include/ipxe/xen.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/include/ipxe/xen.h b/src/include/ipxe/xen.h
index 546b0c348..60aabe03e 100644
--- a/src/include/ipxe/xen.h
+++ b/src/include/ipxe/xen.h
@@ -27,9 +27,11 @@ struct xen_hypercall;
/** A Xen grant table */
struct xen_grant {
/** Grant table entries */
- union grant_entry_v2 *table;
- /** Number of grant table entries (must be a power of two) */
- unsigned int count;
+ struct grant_entry_v1 *table;
+ /** Total grant table length */
+ size_t len;
+ /** Entry size shift (for later version tables) */
+ unsigned int shift;
/** Number of grant table entries in use */
unsigned int used;
/** Most recently used grant reference */