ipxe.git
18 months ago[process] Include process name in debug messages
Michael Brown [Tue, 20 Feb 2018 18:02:25 +0000 (18:02 +0000)] 
[process] Include process name in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
18 months ago[efi] Raise TPL within EFI_USB_IO_PROTOCOL entry points
Michael Brown [Tue, 20 Feb 2018 11:19:39 +0000 (11:19 +0000)] 
[efi] Raise TPL within EFI_USB_IO_PROTOCOL entry points

Signed-off-by: Michael Brown <mcb30@ipxe.org>
18 months ago[efi] Raise TPL within EFI_SIMPLE_NETWORK_PROTOCOL entry points
Michael Brown [Tue, 20 Feb 2018 11:08:25 +0000 (11:08 +0000)] 
[efi] Raise TPL within EFI_SIMPLE_NETWORK_PROTOCOL entry points

Signed-off-by: Michael Brown <mcb30@ipxe.org>
18 months ago[efi] Run at TPL_CALLBACK to protect against UEFI timers
Michael Brown [Tue, 20 Feb 2018 10:56:31 +0000 (10:56 +0000)] 
[efi] Run at TPL_CALLBACK to protect against UEFI timers

As noted in the comments, UEFI manages to combines the all of the
worst aspects of both a polling design (inefficiency and inability to
sleep until something interesting happens) and of an interrupt-driven
design (the complexity of code that could be preempted at any time,
thanks to UEFI timers).

This causes problems in particular for UEFI USB keyboards: the
keyboard driver calls UsbAsyncInterruptTransfer() to set up a periodic
timer which is used to poll the USB bus.  This poll may interrupt a
critical section within iPXE, typically resulting in list corruption
and either a hang or reboot.

Work around this problem by mirroring the BIOS design, in which we run
with interrupts disabled almost all of the time.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
18 months ago[xhci] Consume event TRB before reporting completion to USB core
Michael Brown [Mon, 19 Feb 2018 18:59:45 +0000 (18:59 +0000)] 
[xhci] Consume event TRB before reporting completion to USB core

Reporting a completion via usb_complete() will pass control outside
the scope of xhci.c, and could potentially result in a further call to
xhci_event_poll() before returning from usb_complete().  Since we
currently update the event consumer counter only after calling
usb_complete(), this can result in duplicate completions and
consequent corruption of the submission TRB ring structures.

Fix by updating the event ring consumer counter before passing control
to usb_complete().

Reported-by: Andreas Hammarskjöld <junior@2PintSoftware.com>
Tested-by: Andreas Hammarskjöld <junior@2PintSoftware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
18 months ago[http] Allow for domain names within NTLM user names
Michael Brown [Mon, 19 Feb 2018 11:58:28 +0000 (11:58 +0000)] 
[http] Allow for domain names within NTLM user names

Allow a NetBIOS domain name to be specified within a URL using a
syntax such as:

  http://domain%5Cusername:password@server/path

Signed-off-by: Michael Brown <mcb30@ipxe.org>
19 months ago[intel] Work around broken reset mechanism in i219 devices
Michael Brown [Sat, 3 Feb 2018 19:21:54 +0000 (19:21 +0000)] 
[intel] Work around broken reset mechanism in i219 devices

The i219 appears to have a seriously broken reset mechanism.  After
any transmit or receive activity, resetting the card will break both
the transmit and receive datapaths until the next PCI bus reset.

The Linux and BSD drivers include a convoluted workaround authored by
Intel which involves setting a bit in the undocumented FEXTNVM11
register, then transmitting a dummy 512-byte packet containing garbage
data, then reconfiguring the receive descriptor prefetch thresholds
and temporarily reenabling the receive datapath.  The comments in the
Intel fix do not even remotely match what the code actually does, and
the code accidentally leaves the transmitter enabled after use.

Experimentation suggests that an equivalent fix is to simply set the
undocumented bit in FEXTNVM11 before enabling the transmit or receive
descriptor rings.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
19 months ago[xhci] Assume an invalid PSI table if any invalid PSI value is observed
Michael Brown [Mon, 29 Jan 2018 21:25:11 +0000 (21:25 +0000)] 
[xhci] Assume an invalid PSI table if any invalid PSI value is observed

Invalid protocol speed ID tables appear to be increasingly common in
the wild, to the point that it is infeasible to apply an explicit
XHCI_BAD_PSIV flag for each offending PCI device ID.

Fix by assuming an invalid PSI table as soon as any invalid value is
reported by the hardware.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
19 months ago[ena] Fix spurious uninitialised variable warning on older versions of gcc
Michael Brown [Wed, 17 Jan 2018 14:09:56 +0000 (14:09 +0000)] 
[ena] Fix spurious uninitialised variable warning on older versions of gcc

Some older versions of gcc (observed with gcc 4.7.2) report a spurious
uninitialised variable warning in ena_get_device_attributes().  Work
around this warning by manually inlining the relevant code (which has
only a single call site).

Reported-by: xbgmsharp <xbgmsharp@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[netdevice] Make netdev_irq_enabled() independent of netdev_irq_supported()
Martin Habets [Wed, 10 Jan 2018 15:32:34 +0000 (15:32 +0000)] 
[netdevice] Make netdev_irq_enabled() independent of netdev_irq_supported()

The UNDI layer uses the NETDEV_IRQ_ENABLED flag to choose whether to
return PXENV_UNDI_ISR_OUT_OURS or PXENV_UNDI_ISR_OUT_NOT_OURS for a
given interrupt.  For a network device that does not support
interrupts, the flag will never be set and so pxenv_undi_isr() will
always return PXENV_UNDI_ISR_OUT_NOT_OURS.  This causes some NBPs
(such as lpxelinux.0) to hang.

Redefine NETDEV_IRQ_ENABLED as a simple administrative flag which can
be set even on network devices that do not support interrupts.  This
allows pxenv_undi_isr() (which is the sole user of NETDEV_IRQ_ENABLED)
to function as expected by lpxelinux.0.

Signed-off-by: Martin Habets <mhabets@solarflare.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[tg3] Add support for SerDes PHY initialization
Joseph Wong [Sun, 14 Jan 2018 21:26:36 +0000 (21:26 +0000)] 
[tg3] Add support for SerDes PHY initialization

Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[skel] Remove MII interface
Michael Brown [Sun, 14 Jan 2018 21:16:36 +0000 (21:16 +0000)] 
[skel] Remove MII interface

Most drivers do not utilise an MII interface, since the link state is
typically available directly from a memory-mapped register.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[ena] Add driver for Amazon ENA virtual function NIC
Michael Brown [Mon, 8 Jan 2018 13:21:40 +0000 (13:21 +0000)] 
[ena] Add driver for Amazon ENA virtual function NIC

Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[build] Avoid use of "ld --oformat binary"
Michael Brown [Tue, 2 Jan 2018 20:26:40 +0000 (21:26 +0100)] 
[build] Avoid use of "ld --oformat binary"

Using "ld --oformat binary" for mbr.bin and usbdisk.bin seems to cause
segmentation faults on some versions of binutils (observed on Fedora
27).  Work around this problem by using ld to create an intermediate
ELF object, followed by objcopy (via the existing %.tmp -> %.bin rule)
to create the final binary.

Note that we cannot simply use a single-stage "objcopy -O binary"
since this will not process the relocation records for x86_64: see
commit 1afcccd ("[build] Do not use "objcopy -O binary" for objects
with relocation records").

Reported-by: Brent S <bts@square-r00t.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[legal] Add missing FILE_LICENCE declarations
Michael Brown [Fri, 29 Dec 2017 11:57:00 +0000 (11:57 +0000)] 
[legal] Add missing FILE_LICENCE declarations

Add missing FILE_LICENCE declarations to x86_64 headers based on the
corresponding i386 headers (from which the x86_64 headers were
originally derived).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[legal] Add missing FILE_LICENCE declarations
Michael Brown [Fri, 29 Dec 2017 11:53:46 +0000 (11:53 +0000)] 
[legal] Add missing FILE_LICENCE declarations

Add missing FILE_LICENCE declarations to EFI headers based on the
corresponding source file.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[image] Omit URI query string and fragment from download progress messages
Michael Brown [Thu, 28 Dec 2017 13:38:50 +0000 (13:38 +0000)] 
[image] Omit URI query string and fragment from download progress messages

The URIs printed as part of download progress messages are intended to
provide a quick visual progress indication to the user.  Very long
query strings can render this visual indication useless in practice,
since the most important information (generally the URI host and path)
is drowned out by multiple lines of human-illegible URI-encoded data.

Omit the query string entirely from the download progress message.
For consistency and brevity, also omit the URI fragment along with the
username and password (which was previously redacted anyway).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[http] Report unsuccessful response status lines at DBGVL_LOG
Michael Brown [Thu, 28 Dec 2017 13:04:59 +0000 (13:04 +0000)] 
[http] Report unsuccessful response status lines at DBGVL_LOG

The precise HTTP response status code is currently visible only at
DBGLVL_EXTRA.  Allow for easier debugging by reporting the whole
status line at DBGLVL_LOG for any unsuccessful responses.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[http] Include error messages for 4xx and 5xx response codes
Michael Brown [Thu, 28 Dec 2017 12:34:07 +0000 (12:34 +0000)] 
[http] Include error messages for 4xx and 5xx response codes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[xen] Skip probing of any unsupported device types
Michael Brown [Thu, 28 Dec 2017 12:09:27 +0000 (12:09 +0000)] 
[xen] Skip probing of any unsupported device types

Xen 4.4 includes the device "device/suspend/event-channel" which does
not have a "backend" key.  This currently causes the entire XenBus
device tree probe to fail.

Fix by skipping probe attempts for device types for which there is no
iPXE driver.

Debugged-by: Eytan Heidingsfeld <eytanh@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 months ago[intel] Add PCI device ID for X550-T2
Janos Mattyasovszky [Wed, 20 Dec 2017 12:20:43 +0000 (12:20 +0000)] 
[intel] Add PCI device ID for X550-T2

Signed-off-by: Michael Brown <mcb30@ipxe.org>
22 months ago[http] Add support for NTLM authentication
Michael Brown [Sat, 11 Nov 2017 22:43:03 +0000 (22:43 +0000)] 
[http] Add support for NTLM authentication

Signed-off-by: Michael Brown <mcb30@ipxe.org>
22 months ago[http] Handle parsing of WWW-Authenticate header within authentication scheme
Michael Brown [Sat, 11 Nov 2017 22:05:53 +0000 (22:05 +0000)] 
[http] Handle parsing of WWW-Authenticate header within authentication scheme

Allow individual authentication schemes to parse WWW-Authenticate
headers that do not comply with RFC2617.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
22 months ago[http] Gracefully handle offers of multiple authentication schemes
Michael Brown [Tue, 7 Nov 2017 11:33:13 +0000 (11:33 +0000)] 
[http] Gracefully handle offers of multiple authentication schemes

Servers may provide multiple WWW-Authenticate headers, each offering a
different authentication scheme.  We currently fail the request as
soon as we encounter an unrecognised scheme, which prevents subsequent
offers from succeeding.

Fix by silently ignoring headers for schemes that we do not recognise.
If no schemes are recognised then the request will eventually fail
anyway due to the 401 response code.

If multiple schemes are supported, arbitrarily choose the scheme
appearing first within the response headers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
22 months ago[ntlm] Add support for NTLM authentication mechanism
Michael Brown [Wed, 8 Nov 2017 19:08:54 +0000 (19:08 +0000)] 
[ntlm] Add support for NTLM authentication mechanism

Signed-off-by: Michael Brown <mcb30@ipxe.org>
22 months ago[crypto] Add MD4 message digest algorithm
Michael Brown [Tue, 7 Nov 2017 23:20:10 +0000 (23:20 +0000)] 
[crypto] Add MD4 message digest algorithm

Signed-off-by: Michael Brown <mcb30@ipxe.org>
22 months ago[crypto] Eliminate repetitions in MD5 round constant table
Michael Brown [Sun, 12 Nov 2017 18:30:08 +0000 (18:30 +0000)] 
[crypto] Eliminate repetitions in MD5 round constant table

Signed-off-by: Michael Brown <mcb30@ipxe.org>
22 months ago[crypto] Fix endianness typo in comment
Michael Brown [Sat, 11 Nov 2017 23:44:50 +0000 (23:44 +0000)] 
[crypto] Fix endianness typo in comment

Signed-off-by: Michael Brown <mcb30@ipxe.org>
23 months ago[efi] Allow for building with older versions of elf.h system header
Michael Brown [Sun, 24 Sep 2017 18:26:58 +0000 (19:26 +0100)] 
[efi] Allow for building with older versions of elf.h system header

Signed-off-by: Michael Brown <mcb30@ipxe.org>
23 months ago[efi] Accept (and ignore) R_ARM_V4BX relocations
Heinrich Schuchardt [Sun, 10 Sep 2017 15:12:16 +0000 (17:12 +0200)] 
[efi] Accept (and ignore) R_ARM_V4BX relocations

Relocation type R_ARM_V4BX requires no computation.  It marks the
location of an ARMv4 branch exchange instruction.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
23 months ago[crypto] Fail fast if cross-certificate source is empty
Ladi Prosek [Wed, 20 Sep 2017 09:52:16 +0000 (11:52 +0200)] 
[crypto] Fail fast if cross-certificate source is empty

In fully self-contained deployments it may be desirable to build iPXE
with an empty CROSSCERT source to avoid talking to external services.

Add an explicit check for this case and make validator_start_download
fail immediately if the base URI is empty.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
23 months ago[efi] Inhibit our driver Start() method during disconnection attempts
Michael Brown [Fri, 22 Sep 2017 13:02:40 +0000 (14:02 +0100)] 
[efi] Inhibit our driver Start() method during disconnection attempts

Some HP BIOSes (observed with a Z840) seem to attempt to connect our
drivers in the middle of our call to DisconnectController().  The
precise chain of events is unclear, but the symptom is that we see
several calls to our Supported() and Start() methods, followed by a
system lock-up.

Work around this dubious BIOS behaviour by explicitly failing calls to
our Start() method while we are in the middle of attempting to
disconnect drivers.

Reported-by: Jordan Wright <jordan.m.wright@disney.com>
Debugged-by: Adrian Lucrèce Céleste <adrianlucrececeleste@airmail.cc>
Debugged-by: Christian Nilsson <nikize@gmail.com>
Tested-by: Jordan Wright <jordan.m.wright@disney.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
23 months ago[build] Exclude selected directories from Secure Boot builds
Michael Brown [Mon, 18 Sep 2017 12:32:39 +0000 (13:32 +0100)] 
[build] Exclude selected directories from Secure Boot builds

When submitting binaries for UEFI Secure Boot signing, certain
known-dubious subsystems (such as 802.11 and NFS) must be excluded
from the build.  Mark the directories containing these subsystems as
insecure, and allow the build target to include an explicit "security
flag" (a literal "-sb" appended to the build platform) to exclude
these source directories from the build process.

For example:

  make bin-x86_64-efi-sb/ipxe.efi

will build iPXE with all code from the 802.11 and NFS subsystems
excluded from the build.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[efi] Continue to connect remaining handles after connection errors
Michael Brown [Wed, 13 Sep 2017 07:07:55 +0000 (10:07 +0300)] 
[efi] Continue to connect remaining handles after connection errors

Some UEFI BIOSes will deliberately break the implementation of
ConnectController() to return errors for devices that have been
"disabled" via the BIOS setup screen.  (As an added bonus, such BIOSes
may return garbage EFI_STATUS values such as 0xff.)

Work around these broken UEFI BIOSes by ignoring failures and
continuing to attempt to connect any remaining handles.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[exanic] Add PCI device ID for another X40 variant
Peter von Konigsmark [Thu, 7 Sep 2017 11:37:09 +0000 (12:37 +0100)] 
[exanic] Add PCI device ID for another X40 variant

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[exanic] Power up optical PHYs (if present)
Peter von Konigsmark [Tue, 5 Sep 2017 23:06:42 +0000 (00:06 +0100)] 
[exanic] Power up optical PHYs (if present)

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[dns] Ensure DNS names are NUL-terminated when used as diagnostic strings
Michael Brown [Thu, 7 Sep 2017 11:17:18 +0000 (12:17 +0100)] 
[dns] Ensure DNS names are NUL-terminated when used as diagnostic strings

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[efi] Match behaviour of SnpDxe for truncated received packets
Michael Brown [Wed, 6 Sep 2017 22:56:22 +0000 (23:56 +0100)] 
[efi] Match behaviour of SnpDxe for truncated received packets

The UEFI specification does not state whether or not a return value of
EFI_BUFFER_TOO_SMALL from the SNP Receive() method should follow the
usual EFI API behaviour of allowing the caller to retry the request
with an increased buffer size.

Examination of the SnpDxe driver in EDK2 suggests that Receive() will
just return the truncated packet (complete with any requested
link-layer header fields), so match this behaviour.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[efi] Check buffer length for packets retrieved via our SNP protocol
Michael Brown [Wed, 6 Sep 2017 22:18:29 +0000 (23:18 +0100)] 
[efi] Check buffer length for packets retrieved via our SNP protocol

We do not currently check the length of the caller's buffer for
received packets.  This creates a potential buffer overrun when iPXE
is being used via the SNP or UNDI protocols.

Fix by checking the buffer length and correctly returning the required
length and an EFI_BUFFER_TOO_SMALL error.

Reported-by: Paul McMillan <paul.mcmillan@oracle.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[dns] Report current DNS query as job progress status message
Michael Brown [Wed, 6 Sep 2017 10:46:13 +0000 (11:46 +0100)] 
[dns] Report current DNS query as job progress status message

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[resolv] Use pass-through interfaces for name resolution multiplexer
Michael Brown [Wed, 6 Sep 2017 10:43:22 +0000 (11:43 +0100)] 
[resolv] Use pass-through interfaces for name resolution multiplexer

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[netdevice] Add "hwaddr" setting
Michael Brown [Wed, 6 Sep 2017 09:49:22 +0000 (10:49 +0100)] 
[netdevice] Add "hwaddr" setting

Expose the underlying hardware address as a setting.  For IPoIB
devices, this provides scripts with access to the Infiniband GUID.

Requested-by: Allen, Benjamin S. <bsallen@alcf.anl.gov>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[peerdist] Gather and report peer statistics during download
Michael Brown [Tue, 5 Sep 2017 21:55:05 +0000 (22:55 +0100)] 
[peerdist] Gather and report peer statistics during download

Record and report the number of peers (calculated as the maximum
number of peers discovered for a block's segment at the time that the
block download is complete), and the percentage of blocks retrieved
from peers rather than from the origin server.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[monojob] Display job status message, if present
Michael Brown [Tue, 5 Sep 2017 21:53:10 +0000 (22:53 +0100)] 
[monojob] Display job status message, if present

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[downloader] Allow underlying downloads to provide detailed job progress
Michael Brown [Tue, 5 Sep 2017 21:53:49 +0000 (22:53 +0100)] 
[downloader] Allow underlying downloads to provide detailed job progress

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[job] Allow jobs to report an arbitrary status message
Michael Brown [Tue, 5 Sep 2017 21:52:35 +0000 (22:52 +0100)] 
[job] Allow jobs to report an arbitrary status message

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[monojob] Check for job progress only once per timer tick
Michael Brown [Tue, 5 Sep 2017 22:21:34 +0000 (23:21 +0100)] 
[monojob] Check for job progress only once per timer tick

Checking for job progress is essentially a user interface activity,
and can safely be performed only once per timer tick (as is already
done with checking for keypresses).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[netdevice] Cancel all pending transmissions on any transmit error
Michael Brown [Tue, 5 Sep 2017 11:21:11 +0000 (12:21 +0100)] 
[netdevice] Cancel all pending transmissions on any transmit error

Some external code (such as the UEFI UNDI driver for the Realtek USB
NIC on a Microsoft Surface Book) will block during transmission
attempts and can take several seconds to report a transmit error.  If
there is a large queue of pending transmissions, then the accumulated
time from a series of such failures can easily exceed the EFI watchdog
timeout, resulting in what appears to be a system lockup followed by a
reboot.

Work around this problem by immediately cancelling any pending
transmissions as soon as any transmit error occurs.

The only expected transmit error under normal operation is ENOBUFS
arising when the hardware transmit queue is full.  By definition, this
can happen only for drivers that do not utilise deferred
transmissions, and so this new behaviour will not affect these
drivers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[efi] Raise TPL when calling UNDI entry point
Michael Brown [Tue, 5 Sep 2017 09:48:41 +0000 (10:48 +0100)] 
[efi] Raise TPL when calling UNDI entry point

The SnpDxe driver raises the task priority level to TPL_CALLBACK when
calling the UNDI entry point.  This does not appear to be a documented
requirement, but we should probably match the behaviour of SnpDxe to
minimise surprises to third party code.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[linux] Impose receive quota on tap driver
Michael Brown [Mon, 4 Sep 2017 17:00:34 +0000 (18:00 +0100)] 
[linux] Impose receive quota on tap driver

The tap driver can retrieve a potentially unlimited number of packets
in a single poll.  This can lead to heap exhaustion under heavy load.

Fix by imposing an artificial receive quota (as already used in other
drivers without natural receive limits).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[malloc] Avoid false positive warnings from valgrind
Michael Brown [Mon, 4 Sep 2017 13:00:32 +0000 (14:00 +0100)] 
[malloc] Avoid false positive warnings from valgrind

Calling discard_cache() is likely to result in a call to
free_memblock(), which will call valgrind_make_blocks_noaccess()
before returning.  This causes valgrind to report an invalid read on
the next iteration through the loop in alloc_memblock().

Fix by explicitly calling valgrind_make_blocks_defined() after
discard_cache() returns.  Also call valgrind_make_blocks_noaccess()
before calling discard_cache(), to guard against free list corruption
while executing cache discarders.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[romprefix] Avoid unaligned accesses within ROM headers
Michael Brown [Wed, 30 Aug 2017 09:15:25 +0000 (10:15 +0100)] 
[romprefix] Avoid unaligned accesses within ROM headers

Ensure that all headers (PCI, UNDI, PnP, iPXE) are aligned to at least
four bytes, so that all accesses to header fields will be correctly
aligned even when reading directly from the expansion ROM BAR.

Reported-by: Peter von Konigsmark <peter@exablaze.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[intel] Add various PCI device IDs
Richard Moore [Tue, 22 Aug 2017 09:38:42 +0000 (10:38 +0100)] 
[intel] Add various PCI device IDs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[shell] Enable "shell" command even when BANNER_TIMEOUT is zero
Michael Brown [Tue, 1 Aug 2017 19:25:28 +0000 (20:25 +0100)] 
[shell] Enable "shell" command even when BANNER_TIMEOUT is zero

Setting BANNER_TIMEOUT to zero removes the only symbol reference to
shell.o, causing the "shell" command to become unavailable.

Add SHELL_CMD in config/general.h (enabled by default) which will
explicitly drag in shell.o regardless of the value of BANNER_TIMEOUT.

Reported-by: Julian Brost <julian@0x4a42.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[hyperv] Do not steal ownership from the Gen 2 UEFI firmware
Michael Brown [Fri, 28 Jul 2017 20:19:45 +0000 (21:19 +0100)] 
[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>
2 years ago[acpi] Fix spurious uninitialised-variable warning on some gcc versions
Michael Brown [Fri, 28 Jul 2017 19:19:31 +0000 (20:19 +0100)] 
[acpi] Fix spurious uninitialised-variable warning on some gcc versions

Reported-by: Christian Nilsson <nikize@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[acpi] Compute and check checksum for ACPI tables
Laurent Gourvénec [Thu, 27 Jul 2017 14:04:35 +0000 (16:04 +0200)] 
[acpi] Compute and check checksum for ACPI tables

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[build] Fix ARM32 EFI builds with current EDK2 headers
Michael Brown [Fri, 28 Jul 2017 14:40:44 +0000 (15:40 +0100)] 
[build] Fix ARM32 EFI builds with current EDK2 headers

EDK2 commit 6440385 ("MdePkg/Include: Add enumeration size checks to
Base.h") enforced the UEFI specification mandate that enums should
always be 32 bits.  This revealed a latent bug in iPXE, which does not
build with -fno-short-enums.

Fix by adding -fno-short-enums to CFLAGS for ARM32 EFI builds.

Reported-by: Benjamin S. Allen <bsallen@alcf.anl.gov>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[build] Fix use of inline assembly on GCC 4.8 ARM64 builds
Michael Brown [Fri, 28 Jul 2017 12:50:35 +0000 (13:50 +0100)] 
[build] Fix use of inline assembly on GCC 4.8 ARM64 builds

The inline assembly used in include/errno.h to generate the einfo
blocks requires the ability to generate an immediate constant with no
immediate-value prefix (such as the dollar sign for x86 assembly).

We currently achieve this via the undocumented "%c0" form of operand.
This causes an "invalid operand prefix" error on GCC 4.8 for ARM64
builds.

Fix by switching to the equally undocumented "%a0" form of operand,
which appears to work correctly on all tested versions of GCC.

Reported-by: Benjamin S. Allen <bsallen@alcf.anl.gov>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[build] Conditionalise use of -mabi=lp64 for ARM64 builds
Michael Brown [Fri, 28 Jul 2017 11:47:06 +0000 (12:47 +0100)] 
[build] Conditionalise use of -mabi=lp64 for ARM64 builds

The -mabi option was added in GCC 4.9.  Test for the existence of this
option to allow for building with earlier versions of GCC.

Reported-by: Benjamin S. Allen <bsallen@alcf.anl.gov>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[efi] Enumerate PCI BARs in same order as SnpDxe
Michael Brown [Fri, 21 Jul 2017 13:48:27 +0000 (14:48 +0100)] 
[efi] Enumerate PCI BARs in same order as SnpDxe

The UEFI specification has an implicit and demonstrably incorrect
requirement (in the Mem_IO() calling convention) that any UNDI network
device has at most one memory BAR and one I/O BAR.

Some UEFI platforms have been observed to report the existence of
non-existent additional I/O BARs, causing iPXE to select the wrong
BAR.  This problem does not affect the SnpDxe driver, since that
driver will always choose the lowest numbered existent BAR of each
type.

Adjust iPXE's behaviour to match that of SnpDxe, i.e. to always select
the lowest numbered BAR(s).

Debugged-by: Andreas Hammarskjöld <junior@2PintSoftware.com>
Debugged-by: Adklei <adklei@realtek.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[lan78xx] Add driver for Microchip LAN78xx USB Ethernet NICs ipxe-qemu-20170717-0600d3ae94-0 ipxe-qemu-release-v2.10.0
Michael Brown [Thu, 16 Jun 2016 14:06:25 +0000 (15:06 +0100)] 
[lan78xx] Add driver for Microchip LAN78xx USB Ethernet NICs

Originally-implemented-by: Ravi Hegde <ravi.hegde@microchip.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[smsc75xx] Expose functionality shared with LAN78xx devices
Michael Brown [Fri, 7 Jul 2017 16:25:37 +0000 (17:25 +0100)] 
[smsc75xx] Expose functionality shared with LAN78xx devices

The LAN78xx datapath is essentially identical to that of the SMSC75xx.
Expose the transmit, poll, and bulk IN endpoint operations to allow
for reuse by the LAN78xx driver.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[smscusb] Allow for alternative PHY register layouts
Michael Brown [Mon, 10 Jul 2017 11:38:39 +0000 (12:38 +0100)] 
[smscusb] Allow for alternative PHY register layouts

The LAN78xx PHY interrupt source and mask registers do not match those
used by the SMSC75xx and SMSC95xx.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[smscusb] Move non-inline register access functions to smscusb.c
Michael Brown [Mon, 10 Jul 2017 10:54:24 +0000 (11:54 +0100)] 
[smscusb] Move non-inline register access functions to smscusb.c

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[virtio] Support VIRTIO_NET_F_IOMMU_PLATFORM
Jason Wang [Mon, 10 Jul 2017 09:10:41 +0000 (17:10 +0800)] 
[virtio] Support VIRTIO_NET_F_IOMMU_PLATFORM

Since we don't enable IOMMU at all, we can then simply enable the
IOMMU support by claiming the support of VIRITO_F_IOMMU_PLATFORM.
This fixes booting failure when iommu_platform is set from qemu cli.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[smscusb] Add ability to read MAC address from OTP
Michael Brown [Fri, 7 Jul 2017 18:01:25 +0000 (19:01 +0100)] 
[smscusb] Add ability to read MAC address from OTP

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[smsc75xx] Use common SMSC USB device functionality
Michael Brown [Thu, 6 Jul 2017 16:10:31 +0000 (17:10 +0100)] 
[smsc75xx] Use common SMSC USB device functionality

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[smsc95xx] Use common SMSC USB device functionality
Michael Brown [Thu, 6 Jul 2017 16:25:14 +0000 (17:25 +0100)] 
[smsc95xx] Use common SMSC USB device functionality

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[smscusb] Abstract out common SMSC USB device functionality
Michael Brown [Thu, 6 Jul 2017 15:58:22 +0000 (16:58 +0100)] 
[smscusb] Abstract out common SMSC USB device functionality

The smsc75xx and smsc95xx drivers include a substantial amount of
identical functionality, varying only in the base address of register
sets.  Abstract out this common functionality to allow code to be
shared between the drivers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[intel] Add support for I219-V in 7th Gen Intel NUC
Jerone Young [Sun, 2 Jul 2017 22:23:17 +0000 (17:23 -0500)] 
[intel] Add support for I219-V in 7th Gen Intel NUC

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[tls] Support RFC5746 secure renegotiation
Michael Brown [Tue, 4 Jul 2017 11:51:29 +0000 (12:51 +0100)] 
[tls] Support RFC5746 secure renegotiation

Support renegotiation with servers supporting RFC5746.  This allows
for the use of per-directory client certificates.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[mucurses] Avoid potential division by zero
Michael Brown [Tue, 4 Jul 2017 11:51:53 +0000 (12:51 +0100)] 
[mucurses] Avoid potential division by zero

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[usb] Use non-zero language ID to retrieve strings
Michael Brown [Mon, 3 Jul 2017 12:38:55 +0000 (13:38 +0100)] 
[usb] Use non-zero language ID to retrieve strings

We currently use a zero language ID to retrieve strings such as the
ECM/NCM MAC address.  This works on most hardware devices, but is
known to fail on some software emulated CDC-NCM devices.

Fix by using the first supported language ID, falling back to English
(0x0409) if any error occurs when fetching the list of supported
languages.  This matches the behaviour of the Linux kernel.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[exanic] Add driver for Exablaze ExaNIC cards
Michael Brown [Tue, 20 Jun 2017 11:10:14 +0000 (12:10 +0100)] 
[exanic] Add driver for Exablaze ExaNIC cards

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[crypto] Expose pem_asn1() for use with non-image data
Michael Brown [Mon, 29 May 2017 16:29:20 +0000 (17:29 +0100)] 
[crypto] Expose pem_asn1() for use with non-image data

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[crypto] Provide asn1_built() to construct a cursor from a builder
Michael Brown [Tue, 13 Jun 2017 11:12:11 +0000 (12:12 +0100)] 
[crypto] Provide asn1_built() to construct a cursor from a builder

Our ASN.1 parsing code uses a struct asn1_cursor, while the object
construction code uses a struct asn1_builder.  These structures are
identical apart from the const modifier applied to the data pointer in
struct asn1_cursor.

Provide asn1_built() to safely typecast a struct asn1_builder to a
struct asn1_cursor, allowing constructed objects to be passed to
functions expecting a struct asn1_cursor.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[crypto] Expose asn1_grow()
Michael Brown [Tue, 13 Jun 2017 11:11:40 +0000 (12:11 +0100)] 
[crypto] Expose asn1_grow()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[crypto] Expose RSA_CTX_SIZE constant
Michael Brown [Tue, 13 Jun 2017 11:09:52 +0000 (12:09 +0100)] 
[crypto] Expose RSA_CTX_SIZE constant

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[cpuid] Allow input %ecx value to be specified
Michael Brown [Thu, 15 Jun 2017 13:50:20 +0000 (14:50 +0100)] 
[cpuid] Allow input %ecx value to be specified

For some CPUID leaves (e.g. %eax=0x00000004), the result depends on
the input value of %ecx.  Allow this subfunction number to be
specified as a parameter to the cpuid() wrapper.

The subfunction number is exposed via the ${cpuid/...} settings
mechanism using the syntax

  ${cpuid/<subfunction>.0x40.<register>.<function>}

e.g.

  ${cpuid/0.0x40.0.0x0000000b}
  ${cpuid/1.0x40.0.0x0000000b}

to retrieve the CPU topology information.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[ecm] Display invalid MAC address strings in debug messages
Michael Brown [Wed, 14 Jun 2017 16:40:05 +0000 (17:40 +0100)] 
[ecm] Display invalid MAC address strings in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[build] Use -no-pie on newer versions of gcc
Michael Brown [Wed, 14 Jun 2017 11:33:16 +0000 (12:33 +0100)] 
[build] Use -no-pie on newer versions of gcc

Some distributions patch gcc to generate position independent
executables by default.  We currently include a workaround to check
for this and to add -fno-PIE -nopie to CFLAGS if required.

Newer patched versions of gcc require -fno-PIE -no-pie instead.  Check
for both variants.

Reported-by: Nathan Rennie-Waldock <nathan.renniewaldock@gmail.com>
Originally-fixed-by: Markos Chandras <mchandras@suse.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[intel] Add INTEL_NO_PHY_RST for I219-V
Mika Tiainen [Tue, 30 May 2017 17:23:17 +0000 (20:23 +0300)] 
[intel] Add INTEL_NO_PHY_RST for I219-V

Fix booting on HP EliteBook 820 G3.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[usb] Allow for USB network devices with no interrupt endpoint
Michael Brown [Thu, 18 May 2017 14:18:25 +0000 (15:18 +0100)] 
[usb] Allow for USB network devices with no interrupt endpoint

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[hdprefix] Avoid attempts to read beyond the end of the disk
Michael Brown [Tue, 13 Jun 2017 12:16:26 +0000 (13:16 +0100)] 
[hdprefix] Avoid attempts to read beyond the end of the disk

When booting from a hard disk image (e.g. bin/ipxe.usb) within an
emulator such as QEMU, the disk may not exist beyond the end of the
image.  Limit all reads to the length of the image to avoid spurious
errors when loading the iPXE image.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[syslog] Handle backspace characters
Michael Brown [Tue, 13 Jun 2017 10:54:41 +0000 (11:54 +0100)] 
[syslog] Handle backspace characters

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[acpi] Expose ACPI tables via settings mechanism
Michael Brown [Tue, 23 May 2017 14:44:22 +0000 (15:44 +0100)] 
[acpi] Expose ACPI tables via settings mechanism

Allow values to be read from ACPI tables using the syntax

  ${acpi/<signature>.<index>.0.<offset>.<length>}

where <signature> is the ACPI table signature as a 32-bit hexadecimal
number (e.g. 0x41504093 for the 'APIC' signature on the MADT), <index>
is the index into the array of tables matching this signature,
<offset> is the byte offset within the table, and <length> is the
field length in bytes.

Numeric values are returned in reverse byte order, since ACPI numeric
values are usually little-endian.

For example:

  ${acpi/0x41504943.0.0.0.0}           - entire MADT table in raw hex
  ${acpi/0x41504943.0.0.0x0a.6:string} - MADT table OEM ID
  ${acpi/0x41504943.0.0.0x24.4:uint32} - local APIC address

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[efi] Provide access to ACPI tables
Michael Brown [Tue, 23 May 2017 17:32:31 +0000 (18:32 +0100)] 
[efi] Provide access to ACPI tables

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[acpi] Make acpi_find_rsdt() a per-platform method
Michael Brown [Mon, 22 May 2017 18:27:30 +0000 (19:27 +0100)] 
[acpi] Make acpi_find_rsdt() a per-platform method

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[settings] Extend numerical setting tags to 64 bits
Michael Brown [Tue, 16 May 2017 15:58:01 +0000 (16:58 +0100)] 
[settings] Extend numerical setting tags to 64 bits

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[tls] Keep cipherstream window open until TLS negotiation is complete
Michael Brown [Mon, 22 May 2017 12:17:23 +0000 (13:17 +0100)] 
[tls] Keep cipherstream window open until TLS negotiation is complete

When performing a SAN boot, the plainstream window size will be zero
(since this is the mechanism used internally to indicate that no data
should be fetched via the initial request).  This zero value currently
propagates to the advertised TCP window size, which prevents the TLS
negotiation from completing.

Fix by ensuring that the cipherstream window is held open until TLS
negotiation is complete, and only then falling back to passing through
the plainstream window size.

Reported-by: John Wigley <johnwigley#ipxe@acorna.co.uk>
Tested-by: John Wigley <johnwigley#ipxe@acorna.co.uk>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[efi] Prevent EFI code from being linked in to non-EFI builds
Michael Brown [Fri, 19 May 2017 11:21:18 +0000 (12:21 +0100)] 
[efi] Prevent EFI code from being linked in to non-EFI builds

Ensure that efi_systab is an undefined symbol in non-EFI builds.  In
particular, this prevents users from incorrectly enabling IMAGE_EFI in
a BIOS build of iPXE.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[xen] Provide 18 4kB receive buffers to work around xen-netback bug
Michael Brown [Fri, 19 May 2017 01:50:21 +0000 (02:50 +0100)] 
[xen] Provide 18 4kB receive buffers to work around xen-netback bug

The Xen network backend (xen-netback) suffered from a regression
between upstream Linux kernels 3.18 and 4.2 inclusive, which would
cause packet reception to fail unless at least 18 receive buffers were
available.  This bug was fixed in kernel commit 1d5d485 ("xen-netback:
require fewer guest Rx slots when not using GSO").

Work around this bug in affected versions of xen-netback by providing
the requisite 18 receive buffers.

Reported-by: Taylor Schneider <tschneider@live.com>
Tested-by: Taylor Schneider <tschneider@live.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[iscsi] Fix iBFT when no explicit initiator name setting exists
Michael Brown [Wed, 10 May 2017 14:30:51 +0000 (15:30 +0100)] 
[iscsi] Fix iBFT when no explicit initiator name setting exists

Commit 7cfdd76 ("[block] Describe all SAN devices via ACPI tables")
changed the definition of the iSCSI initiator IQN in the iBFT to
represent a common initiator IQN used for all iSCSI sessions, and
attempted to calculate this common initiator IQN by fetching the
common ${initiator-iqn} setting.

This fails when no explicit ${initiator-iqn} has been specified
(i.e. when an initiator IQN has instead been constructed from either
the hostname or system UUID), and results in an empty initiator IQN in
the iBFT.

Fix by using the initiator IQN of an arbitrary iSCSI session
present in the iBFT.

Debugged-by: Tal Aloni <tal.aloni.il@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[iscsi] Always send FirstBurstLength parameter
Michael Brown [Wed, 3 May 2017 12:01:11 +0000 (13:01 +0100)] 
[iscsi] Always send FirstBurstLength parameter

As of kernel 4.11, the LIO target will propose a value for
FirstBurstLength if the initiator did not do so.  This is entirely
redundant in our case, since FirstBurstLength is defined by RFC 3720
to be

  "Irrelevant when: ( InitialR2T=Yes and ImmediateData=No )"

and we already enforce both InitialR2T=Yes and ImmediateData=No in our
initial proposal.  However, LIO (arguably correctly) complains when we
do not respond to its redundant proposal of an already-irrelevant
value.

Fix by always proposing the default value for FirstBurstLength.

Debugged-by: Patrick Seeburger <info@8bit.de>
Tested-by: Patrick Seeburger <info@8bit.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[efi] Standardise PCI debug messages
Michael Brown [Mon, 1 May 2017 13:01:54 +0000 (14:01 +0100)] 
[efi] Standardise PCI debug messages

Use the PCI bus:dev.fn address in debug messages, falling back to the
EFI handle name only if we do not yet have enough information to
determine the bus:dev.fn address.

Include the vendor and device IDs in debug messages when no suitable
driver is found, to match the diagnostics available in a BIOS
environment.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[hyperv] Cope with Windows Server 2016 enlightenments
Michael Brown [Tue, 25 Apr 2017 13:13:22 +0000 (14:13 +0100)] 
[hyperv] Cope with Windows Server 2016 enlightenments

An "enlightened" external bootloader (such as Windows Server 2016's
winload.exe) may take ownership of the Hyper-V connection before all
INT 13 operations have been completed.  When this happens, all VMBus
devices are implicitly closed and we are left with a non-functional
network connection.

Detect when our Hyper-V connection has been lost (by checking the
SynIC message page MSR).  Reclaim ownership of the Hyper-V connection
and reestablish any VMBus devices, without disrupting any existing
iPXE state (such as IPv4 settings attached to the network device).

Windows Server 2016 will not cleanly take ownership of an active
Hyper-V connection.  Experimentation shows that we can quiesce by
resetting only the SynIC message page MSR; this results in a
successful SAN boot (on a Windows 2012 R2 physical host).  Choose to
quiesce by resetting (almost) all MSRs, in the hope that this will be
more robust against corner cases such as a stray synthetic interrupt
occurring during the handover.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[hyperv] Remove redundant return status code from mapping functions
Michael Brown [Fri, 28 Apr 2017 15:18:58 +0000 (16:18 +0100)] 
[hyperv] Remove redundant return status code from mapping functions

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[hyperv] Do not fail if guest OS ID MSR is already set
Michael Brown [Tue, 25 Apr 2017 12:33:52 +0000 (13:33 +0100)] 
[hyperv] Do not fail if guest OS ID MSR is already set

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 years ago[block] Provide abstraction to allow system to be quiesced
Michael Brown [Wed, 26 Apr 2017 19:02:23 +0000 (20:02 +0100)] 
[block] Provide abstraction to allow system to be quiesced

When performing a SAN boot via INT 13, there is no way for the
operating system to indicate that it has finished using the INT 13 SAN
device.  We therefore have no opportunity to clean up state before the
loaded operating system's native drivers take over.  This can cause
problems when booting Windows, which tends not to be forgiving of
unexpected system state.

Windows will typically write a flag to the SAN device as the last
action before transferring control to the native drivers.  We can use
this as a heuristic to bring the system to a quiescent state (without
performing a full shutdown); this provides us an opportunity to
temporarily clean up state that could otherwise prevent a successful
Windows boot.

Signed-off-by: Michael Brown <mcb30@ipxe.org>