]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[xen] Use version 1 grant tables by default
authorMichael Brown <mcb30@ipxe.org>
Wed, 13 Aug 2014 16:23:11 +0000 (17:23 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 13 Aug 2014 18:21:42 +0000 (19:21 +0100)
commitbe79ca535ab9891807d8852447d38d35eff3ff63
tree6d87e747cefca89ac721ea300e3be33a36b4e04d
parent3f39f9fcb34712bf46f45e184c1227e21e2b7efd
[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>
src/arch/x86/drivers/xen/hvm.c
src/drivers/net/netfront.c
src/include/ipxe/xen.h
src/include/ipxe/xengrant.h
src/interface/xen/xengrant.c