summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe
diff options
context:
space:
mode:
authorMichael Brown2017-07-28 22:19:45 +0200
committerMichael Brown2017-07-28 22:30:43 +0200
commit936657832f2262ad04bdf16b9229ce0b1d1c174f (patch)
treebc5ff1a50c989c604e462d4443822b163b2577a8 /src/include/ipxe
parent[acpi] Fix spurious uninitialised-variable warning on some gcc versions (diff)
downloadipxe-936657832f2262ad04bdf16b9229ce0b1d1c174f.tar.gz
ipxe-936657832f2262ad04bdf16b9229ce0b1d1c174f.tar.xz
ipxe-936657832f2262ad04bdf16b9229ce0b1d1c174f.zip
[hyperv] Do not steal ownership from the Gen 2 UEFI firmware
We must not steal ownership from the Gen 2 UEFI firmware, since doing so will cause an immediate system crash (most likely in the form of a reboot). This problem was masked before commit a0f6e75 ("[hyperv] Do not fail if guest OS ID MSR is already set"), since prior to that commit we would always fail if we found any non-zero guest OS identity. We now accept a non-zero previous guest OS identity in order to allow for situations such as chainloading from iPXE to another iPXE, and as a prerequisite for commit b91cc98 ("[hyperv] Cope with Windows Server 2016 enlightenments"). A proper fix would be to reverse engineer the UEFI protocols exposed within the Hyper-V Gen 2 firmware and use these to bind to the VMBus device representing the network connection, (with the native Hyper-V driver moved to become a BIOS-only feature). As an interim solution, fail to initialise the native Hyper-V driver if we detect the guest OS identity known to be used by the Gen 2 UEFI firmware. This will cause the standard all-drivers build (ipxe.efi) to fall back to using the SNP driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r--src/include/ipxe/hyperv.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/ipxe/hyperv.h b/src/include/ipxe/hyperv.h
index 9194a976..9b7e54a5 100644
--- a/src/include/ipxe/hyperv.h
+++ b/src/include/ipxe/hyperv.h
@@ -37,6 +37,13 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
*/
#define HV_GUEST_OS_ID_IPXE ( ( 1ULL << 63 ) | ( 0x18aeULL << 48 ) )
+/** Guest OS identity for Gen 2 UEFI firmware
+ *
+ * This does not conform to the documented structure for guest OS
+ * identities.
+ */
+#define HV_GUEST_OS_ID_UEFI ( 1ULL << 40 )
+
/** Enable hypercall page */
#define HV_HYPERCALL_ENABLE 0x00000001UL