ipxe.git
8 hours ago[efi] Do not attempt EFI_USB_IO_PROTOCOL transfers during shutdown master github/master
Michael Brown [Sun, 15 Sep 2019 09:40:23 +0000 (10:40 +0100)] 
[efi] Do not attempt EFI_USB_IO_PROTOCOL transfers during shutdown

On at least some platforms (observed with a Raspberry Pi), any attempt
to perform USB transfers via EFI_USB_IO_PROTOCOL during EFI shutdown
will lock up the system.  This is quite probably due to the already
documented failure of all EFI timers when ExitBootServices() is
called: see e.g. commit 5cf5ffea2 "[efi] Work around temporal anomaly
encountered during ExitBootServices()".

Work around this problem by refusing to poll endpoints if shutdown is
in progress, and by immediately failing any attempts to enqueue new
transfers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
9 hours ago[efi] Report failed control transfers as expected by the USB core
Michael Brown [Sun, 15 Sep 2019 09:25:46 +0000 (10:25 +0100)] 
[efi] Report failed control transfers as expected by the USB core

The USB core reuses the I/O buffer space occupied by the USB setup
packet to hold the completion status for message transfers, assuming
that the message() method will always strip the setup packet before
returning.  This assumption is correct for all of the hardware
controller drivers (XHCI, EHCI, and UHCI), since these drivers are
able to enqueue the transfer as a separate action from waiting for the
transfer to complete.

The EFI_USB_IO_PROTOCOL does not allow us to separate actions in this
way: there is only a single blocking method that both enqueues and
waits for completion.  Our usbio driver therefore currently defers
stripping the setup packet until the control endpoint is polled.

This causes a bug if a message transfer is enqueued but never polled
and is subsequently cancelled, since the cancellation will be reported
with the I/O buffer still containing the setup packet.  This breaks
the assumption that the setup packet has been stripped, and triggers
an assertion failure in usb_control_complete().

Fix by always stripping the setup packet in usbio_endpoint_message(),
and adjusting usbio_control_poll() to match.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 weeks ago[golan] Fix address-of-pointer bug for multicast attach/detach
Michael Brown [Sat, 17 Aug 2019 16:51:18 +0000 (17:51 +0100)] 
[golan] Fix address-of-pointer bug for multicast attach/detach

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 weeks ago[ethernet] Avoid false positive Coverity warning
Michael Brown [Sat, 17 Aug 2019 16:30:09 +0000 (17:30 +0100)] 
[ethernet] Avoid false positive Coverity warning

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 weeks ago[coverity] Override assumptions about wcrtomb() and hmac_init()
Michael Brown [Sat, 17 Aug 2019 16:18:54 +0000 (17:18 +0100)] 
[coverity] Override assumptions about wcrtomb() and hmac_init()

Newer versions of Coverity use built-in models for wcrtomb() and
hmac_init() that are capable of returning errors, and reports defects
due to code failing to check for these errors.  The actual iPXE
implementations are simpler than Coverity's models and can never
return errors, so these defects are false positives.

Fix by overriding Coverity's built-in models for these functions.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 weeks ago[crypto] Profile the various stages of modular multiplication
Michael Brown [Sat, 17 Aug 2019 00:24:04 +0000 (01:24 +0100)] 
[crypto] Profile the various stages of modular multiplication

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 weeks ago[crypto] Drag in configured digestInfo prefixes for any use of RSA
Michael Brown [Sat, 17 Aug 2019 00:18:34 +0000 (01:18 +0100)] 
[crypto] Drag in configured digestInfo prefixes for any use of RSA

Ensure that the configured RSA digestInfo prefixes are included in any
build that includes rsa.o (rather than relying on x509.o or tls.o also
being present in the final binary).

This allows the RSA self-tests to be run in isolation.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 weeks ago[tls] Add missing call to tls_tx_resume() when restarting negotiation
Michael Brown [Fri, 16 Aug 2019 21:40:19 +0000 (22:40 +0100)] 
[tls] Add missing call to tls_tx_resume() when restarting negotiation

The restart of negotiation triggered by a HelloRequest currently does
not call tls_tx_resume() and so may end up leaving the connection in
an idle state in which the pending ClientHello is never sent.

Fix by calling tls_tx_resume() as part of tls_restart(), since the
call to tls_tx_resume() logically belongs alongside the code that sets
bits in tls->tx_pending.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 weeks ago[peerdist] Limit number of concurrent raw block downloads
Michael Brown [Fri, 16 Aug 2019 20:42:49 +0000 (21:42 +0100)] 
[peerdist] Limit number of concurrent raw block downloads

Raw block downloads are expensive if the origin server uses HTTPS,
since each concurrent download will require local TLS resources
(including potentially large received encrypted data buffers).

Raw block downloads may also be prohibitively slow to initiate when
the origin server is using HTTPS and client certificates.  Origin
servers for PeerDist downloads are likely to be running IIS, which has
a bug that breaks session resumption and requires each connection to
go through the full client certificate verification.

Limit the total number of concurrent raw block downloads to ameliorate
these problems.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 weeks ago[peerdist] Start block download timers from within opener methods
Michael Brown [Fri, 16 Aug 2019 20:23:55 +0000 (21:23 +0100)] 
[peerdist] Start block download timers from within opener methods

Move the responsibility for starting the block download timers from
peerblk_expired() to peerblk_raw_open() and peerblk_retrieval_open(),
in preparation for adding the ability to defer calls to
peerblk_raw_open() via a block download queue.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 weeks ago[process] Add PROC_INIT() for initialising static processes
Michael Brown [Fri, 16 Aug 2019 20:20:05 +0000 (21:20 +0100)] 
[process] Add PROC_INIT() for initialising static processes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 weeks ago[build] Add predefined shortcut for Raspberry Pi builds
Michael Brown [Fri, 2 Aug 2019 10:57:35 +0000 (11:57 +0100)] 
[build] Add predefined shortcut for Raspberry Pi builds

Add a build shortcut "rpi", allowing for e.g.

  make CONFIG=rpi CROSS=aarch64-linux-gnu- bin-arm64-efi/rpi.efi

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 weeks ago[build] Move predefined all-drivers build shortcut to Makefile
Michael Brown [Fri, 2 Aug 2019 10:00:43 +0000 (11:00 +0100)] 
[build] Move predefined all-drivers build shortcut to Makefile

The (very approximate) split between Makefile.housekeeping and
Makefile is that the former provides mechanism and the latter provides
policy.

Provide a section within Makefile as a home for predefined build
shortcuts such as the existing all-drivers build.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
7 weeks ago[build] Do not apply WORKAROUND_CFLAGS for host compiler
Michael Brown [Mon, 22 Jul 2019 13:51:28 +0000 (14:51 +0100)] 
[build] Do not apply WORKAROUND_CFLAGS for host compiler

The WORKAROUND_CFLAGS list is constructed based on running tests on
the target compiler, and the results may not be valid for the host
compiler.

The only relevant workaround required for the host compiler is
-Wno-stringop-truncation, which is needed to avoid a spurious compiler
warning for a totally correct usage of strncpy() in util/elf2efi.c.

Duplicating the workaround tests for the host compiler is messy, as is
conditionally applying __attribute__((nonstring)).  Fix instead by
disapplying WORKAROUND_CFLAGS for the host compiler, and using
memcpy() with an explicitly calculated length instead of strncpy() in
util/elf2efi.c.

Reported-by: Ignat Korchagin <ignat@cloudflare.com>
Reported-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
7 weeks ago[build] Workaround compilation error with gcc 9.1
Valentine Barshak [Mon, 22 Jul 2019 09:47:50 +0000 (10:47 +0100)] 
[build] Workaround compilation error with gcc 9.1

Compiling with gcc 9.1 generates lots of "taking address of packed
member of ... may result in an unaligned pointer value" warnings.

Some of these warnings are genuine, and indicate correctly that parts
of iPXE currently require the CPU (or runtime environment) to support
unaligned accesses.  For example: the TCP/IP receive data path will
attempt to access 32-bit fields that may not be aligned to a 32-bit
boundary.

Other warnings are either spurious (such as when the pointer is to a
variable-length byte array, which can have no alignment requirement
anyway) or unhelpful (such as when the pointer is used solely to
provide a debug colour value for the DBGC() macro).

There appears to be no easy way to silence the spurious warnings.
Since the ability to perform unaligned accesses is already a
requirement for iPXE, work around the problem by silencing this class
of warnings.

Signed-off-by: Valentine Barshak <gvaxon@gmail.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
7 weeks ago[build] Fix "'%s' directive argument is null" error
Valentine Barshak [Sun, 9 Jun 2019 10:30:11 +0000 (13:30 +0300)] 
[build] Fix "'%s' directive argument is null" error

Use '%p' directive, and print handle's address if the address is null
and the handle doesn't have a name.  This fixes the following
compilation error:

  interface/efi/efi_debug.c:334:3: error: '%s' directive
  argument is null [-Werror=format-overflow=]

Signed-off-by: Valentine Barshak <gvaxon@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
8 weeks ago[smscusb] Fetch MAC from device tree for Raspberry Pi Model B+
Michael Brown [Fri, 19 Jul 2019 18:15:33 +0000 (19:15 +0100)] 
[smscusb] Fetch MAC from device tree for Raspberry Pi Model B+

Signed-off-by: Michael Brown <mcb30@ipxe.org>
8 weeks ago[build] Add named configuration for Raspberry Pi
Michael Brown [Fri, 19 Jul 2019 16:45:22 +0000 (17:45 +0100)] 
[build] Add named configuration for Raspberry Pi

Signed-off-by: Michael Brown <mcb30@ipxe.org>
8 weeks ago[smsc95xx] Fetch MAC from device tree for Raspberry Pi
Michael Brown [Fri, 19 Jul 2019 16:43:39 +0000 (17:43 +0100)] 
[smsc95xx] Fetch MAC from device tree for Raspberry Pi

Signed-off-by: Michael Brown <mcb30@ipxe.org>
8 weeks ago[efi] Register a device tree if provided by the platform firmware
Michael Brown [Fri, 19 Jul 2019 16:42:12 +0000 (17:42 +0100)] 
[efi] Register a device tree if provided by the platform firmware

Signed-off-by: Michael Brown <mcb30@ipxe.org>
8 weeks ago[fdt] Add ability to parse a MAC address from a flattened device tree
Michael Brown [Fri, 19 Jul 2019 16:35:39 +0000 (17:35 +0100)] 
[fdt] Add ability to parse a MAC address from a flattened device tree

The Raspberry Pi NIC has no EEPROM to hold the MAC address.  The
platform firmware (e.g. UEFI or U-Boot) will typically obtain the MAC
address from the VideoCore firmware and add it to the device tree,
which is then made available to subsequent programs such as iPXE or
the Linux kernel.

Add the ability to parse a flattened device tree and to extract the
MAC address.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 months ago[efi] Return only registered EFI devices from efidev_parent()
Michael Brown [Mon, 15 Jul 2019 11:49:47 +0000 (12:49 +0100)] 
[efi] Return only registered EFI devices from efidev_parent()

efidev_parent() currently assumes that any device with BUS_TYPE_EFI is
part of a struct efi_device.  This assumption is not valid, since the
code in efi_device_info() may also create a device with BUS_TYPE_EFI.

Fix by searching through the list of registered EFI devices when
looking for a match, instead of relying on the bus type value.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 months ago[arm] Provide dummy implementations for {in,out}[s]{b,w,l}
Michael Brown [Sun, 14 Jul 2019 14:27:01 +0000 (15:27 +0100)] 
[arm] Provide dummy implementations for {in,out}[s]{b,w,l}

It is currently not possible to build the all-drivers iPXE binaries
for ARM, since there is no implementation for inb(), outb(), etc.

There is no common standard for accessing I/O space on ARM platforms,
and there are almost no ARM-compatible peripherals that actually
require I/O space accesses.

Provide dummy implementations that behave as though no device is
present (i.e. ignore writes, return all bits high for reads).  This is
sufficient to allow the all-drivers binaries to link, and should cause
drivers to behave as though no I/O space peripherals are present in
the system.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2 months ago[build] Fix use of inline assembly on GCC 8 ARM64 builds
Michael Brown [Sun, 14 Jul 2019 13:05:48 +0000 (14:05 +0100)] 
[build] Fix use of inline assembly on GCC 8 ARM64 builds

Commit 1a7746603 ("[build] Fix use of inline assembly on GCC 4.8 ARM64
builds") switched from using "%c0" to "%a0" in order to avoid an
"invalid operand prefix" error on the ARM64 version of GCC 4.8.

It appears that the ARM64 version of GCC 8 now produces an "invalid
address mode" error for the "%a0" form, but is happy with the original
"%c0" form.

Switch back to using the "%c0" form, on the assumption that the
requirement for "%a0" was a temporary aberration.

Originally-fixed-by: John L. Jolly <jjolly@suse.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[golan] Add various new PCI device IDs
Mohammed [Thu, 2 May 2019 10:00:18 +0000 (11:00 +0100)] 
[golan] Add various new PCI device IDs

Signed-off-by: Mohammed <mohammedt@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Add driver for Intel 40 Gigabit Ethernet NIC virtual functions
Michael Brown [Wed, 24 Apr 2019 16:15:49 +0000 (17:15 +0100)] 
[intelxl] Add driver for Intel 40 Gigabit Ethernet NIC virtual functions

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Choose to operate in non-PXE mode
Michael Brown [Wed, 24 Apr 2019 21:11:14 +0000 (22:11 +0100)] 
[intelxl] Choose to operate in non-PXE mode

The physical function defaults to operating in "PXE mode" after a
power-on reset.  In this mode, receive descriptors are fetched and
written back as single descriptors.  In normal (non-PXE mode)
operation, receive descriptors are fetched and written back only as
complete cachelines unless an interrupt is raised.

There is no way to return to PXE mode from non-PXE mode, and there is
no way for the virtual function driver to operate in PXE mode.

Choose to operate in non-PXE mode.  This requires us to trick the
hardware into believing that it is raising an interrupt, so that it
will not defer writing back receive descriptors until a complete
cacheline (i.e. four packets) have been consumed.  We do so by
configuring the hardware to use MSI-X with a dummy target location in
place of the usual APIC register.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Expose functions required by virtual function driver
Michael Brown [Wed, 24 Apr 2019 13:38:43 +0000 (14:38 +0100)] 
[intelxl] Expose functions required by virtual function driver

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Allow for arbitrary placement of interrupt control register
Michael Brown [Wed, 24 Apr 2019 16:11:31 +0000 (17:11 +0100)] 
[intelxl] Allow for arbitrary placement of interrupt control register

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Split out ring creation from context programming
Michael Brown [Wed, 24 Apr 2019 15:47:16 +0000 (16:47 +0100)] 
[intelxl] Split out ring creation from context programming

The virtual function driver will use the same transmit and receive
descriptor ring structures, but will not itself construct and program
the ring context.  Split out ring creation and destruction from the
programming of the ring context, to allow code to be shared between
physical and virtual function drivers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Allow for arbitrary placement of ring tail registers
Michael Brown [Wed, 24 Apr 2019 15:36:24 +0000 (16:36 +0100)] 
[intelxl] Allow for arbitrary placement of ring tail registers

The virtual function transmit and receive ring tail register offsets
do not match those of the physical function.  Allow the tail register
offsets to be specified separately.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Use 32-byte receive descriptors
Michael Brown [Wed, 24 Apr 2019 15:25:47 +0000 (16:25 +0100)] 
[intelxl] Use 32-byte receive descriptors

The physical function driver does not allow the virtual function to
request the use of 16-byte receive descriptors.  Switch to using
32-byte receive descriptors.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Provide a mechanism for handling "send to VF" events
Michael Brown [Wed, 24 Apr 2019 12:09:43 +0000 (13:09 +0100)] 
[intelxl] Provide a mechanism for handling "send to VF" events

Provide a weak stub function for handling the "send to VF" event used
for communications between the physical and virtual function drivers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Allow admin cookie to hold extended opcode and return code
Michael Brown [Wed, 24 Apr 2019 12:00:12 +0000 (13:00 +0100)] 
[intelxl] Allow admin cookie to hold extended opcode and return code

The "send to PF" and "send to VF" admin queue descriptors (ab)use the
cookie field to hold the extended opcode and return code values.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Allow admin queues to be reinitialised
Michael Brown [Wed, 24 Apr 2019 11:45:37 +0000 (12:45 +0100)] 
[intelxl] Allow admin queues to be reinitialised

A virtual function reset is triggered via an admin queue command and
will reset the admin queue configuration registers.  Allow the admin
queues to be reinitialised after such a reset, without requiring the
overhead (and potential failure paths) of freeing and reallocating the
queues.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Use one admin queue buffer per admin queue descriptor
Michael Brown [Wed, 24 Apr 2019 11:18:12 +0000 (12:18 +0100)] 
[intelxl] Use one admin queue buffer per admin queue descriptor

We currently use a single data buffer shared between all admin queue
descriptors.  This works for the physical function driver since we
have at most one command in progress and only a single event (which
does not use a data buffer).

The communication path between the physical and virtual function
drivers uses the event data buffer, and there is no way to prevent a
solicited event (i.e. a response to a request) from being overwritten
by an unsolicited event (e.g. a link status change).

Provide individual data buffers for each admin event queue descriptor
(and for each admin command queue descriptor, for the sake of
consistency).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Allow for virtual function admin queue register maps
Michael Brown [Fri, 22 Mar 2019 15:04:12 +0000 (15:04 +0000)] 
[intelxl] Allow for virtual function admin queue register maps

The register map for the virtual functions appears to have been
constructed using a random number generator.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[intelxl] Use VLAN tag in receive descriptor if present
Michael Brown [Sat, 27 Apr 2019 19:21:22 +0000 (20:21 +0100)] 
[intelxl] Use VLAN tag in receive descriptor if present

The physical function driver does not allow the virtual function to
request that VLAN tags are left unstripped.  Extract and use the VLAN
tag from the receive descriptor if present.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[vlan] Provide vlan_netdev_rx() and vlan_netdev_rx_err()
Michael Brown [Sat, 27 Apr 2019 19:12:01 +0000 (20:12 +0100)] 
[vlan] Provide vlan_netdev_rx() and vlan_netdev_rx_err()

The Hermon driver uses vlan_find() to identify the appropriate VLAN
device for packets that are received with the VLAN tag already
stripped out by the hardware.  Generalise this capability and expose
it for use by other network card drivers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
4 months ago[pci] Add support for PCI MSI-X interrupts
Michael Brown [Mon, 22 Apr 2019 13:43:23 +0000 (14:43 +0100)] 
[pci] Add support for PCI MSI-X interrupts

The Intel 40 Gigabit Ethernet virtual functions support only MSI-X
interrupts, and will write back completed interrupt descriptors only
when the device attempts to raise an interrupt (or when a complete
cacheline of receive descriptors has been completed).

We cannot actually use MSI-X interrupts within iPXE, since we never
have ownership of the APIC.  However, an MSI-X interrupt is
fundamentally just a DMA write of a single dword to an arbitrary
address.  We can therefore configure the device to "raise" an
interrupt by writing a meaningless value to an otherwise unused memory
location: this is sufficient to trigger the receive descriptor
writeback logic.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 months ago[intel] Add PCI ID for I219-V and -LM 6 to 9
Christian Nilsson [Thu, 14 Feb 2019 21:21:55 +0000 (22:21 +0100)] 
[intel] Add PCI ID for I219-V and -LM 6 to 9

Signed-off-by: Christian Nilsson <nikize@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 months ago[ocsp] Accept response certID with missing hashAlgorithm parameters
Michael Brown [Sun, 10 Mar 2019 17:58:56 +0000 (17:58 +0000)] 
[ocsp] Accept response certID with missing hashAlgorithm parameters

One of the design goals of ASN.1 DER is to provide a canonical
serialization of a data structure, thereby allowing for equality of
values to be tested by simply comparing the serialized bytes.

Some OCSP servers will modify the request certID to omit the optional
(and null) "parameters" portion of the hashAlgorithm.  This is
arguably legal but breaks the ability to perform a straightforward
bitwise comparison on the entire certID field between request and
response.

Fix by comparing the OID-identified hashAlgorithm separately from the
remaining certID fields.

Originally-fixed-by: Thilo Fromm <Thilo@kinvolk.io>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 months ago[tcp] Display "connecting" status until connection is established
Michael Brown [Sun, 10 Mar 2019 17:29:06 +0000 (17:29 +0000)] 
[tcp] Display "connecting" status until connection is established

Provide increased visibility into the progress of TCP connections by
displaying an explicit "connecting" status message while waiting for
the TCP handshake to complete.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 months ago[tls] Display validator messages only while validation is in progress
Michael Brown [Sun, 10 Mar 2019 17:27:33 +0000 (17:27 +0000)] 
[tls] Display validator messages only while validation is in progress

Allow the cipherstream to report progress status messages during
connection establishment.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 months ago[tls] Display cross-certificate and OCSP status messages
Michael Brown [Thu, 7 Mar 2019 15:23:19 +0000 (15:23 +0000)] 
[tls] Display cross-certificate and OCSP status messages

TLS connections will almost always create background connections to
perform cross-signed certificate downloads and OCSP checks.  There is
currently no direct visibility into which checks are taking place,
which makes troubleshooting difficult in the absence of either a
packet capture or a debug build.

Use the job progress message buffer to report the current cross-signed
certificate download or OCSP status check, where applicable.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 months ago[crypto] Use x509_name() in validator debug messages
Michael Brown [Thu, 7 Mar 2019 13:47:30 +0000 (13:47 +0000)] 
[crypto] Use x509_name() in validator debug messages

Display a human-readable certificate name in validator debug messages
wherever possible.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 months ago[tls] Support stateless session resumption
Michael Brown [Wed, 6 Mar 2019 15:02:02 +0000 (15:02 +0000)] 
[tls] Support stateless session resumption

Add support for RFC5077 session ticket extensions to allow for
stateless TLS session resumption.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 months ago[tls] Fix incorrectly duplicated error number
Michael Brown [Thu, 21 Feb 2019 23:50:11 +0000 (23:50 +0000)] 
[tls] Fix incorrectly duplicated error number

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 months ago[tls] Support stateful session resumption
Michael Brown [Thu, 21 Feb 2019 11:32:25 +0000 (11:32 +0000)] 
[tls] Support stateful session resumption

Record the session ID (if any) provided by the server and attempt to
reuse it for any concurrent connections to the same server.

If multiple connections are initiated concurrently (e.g. when using
PeerDist) then defer sending the ClientHello for all but the first
connection, to allow time for the first connection to potentially
obtain a session ID (and thereby speed up the negotiation for all
remaining connections).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 months ago[efi] Blacklist the Dell Ip4ConfigDxe driver
Michael Brown [Tue, 19 Feb 2019 18:47:12 +0000 (18:47 +0000)] 
[efi] Blacklist the Dell Ip4ConfigDxe driver

On a Dell OptiPlex 7010, calling DisconnectController() on the LOM
device handle will lock up the system.  Debugging shows that execution
is trapped in an infinite loop that is somehow trying to reconnect
drivers (without going via ConnectController()).

The problem can be reproduced in the UEFI shell with no iPXE code
present, by using the "disconnect" command.  Experimentation shows
that the only fix is to unload (rather than just disconnect) the
"Ip4ConfigDxe" driver.

Add the concept of a blacklist of UEFI drivers that will be
automatically unloaded when iPXE runs as an application, and add the
Dell Ip4ConfigDxe driver to this blacklist.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
7 months ago[init] Show startup and shutdown function names in debug messages
Michael Brown [Fri, 25 Jan 2019 14:53:43 +0000 (14:53 +0000)] 
[init] Show startup and shutdown function names in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
7 months ago[util] Add support for EFI ROM images ipxe-qemu-20190122-de4565cbe7-0
Petr Borsodi [Wed, 16 Jan 2019 16:37:58 +0000 (17:37 +0100)] 
[util] Add support for EFI ROM images

The Option::ROM module recognizes and checks EFI header of image.  The
disrom.pl utility dumps this header if is present.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
7 months ago[util] Improve processing of ROM images in Option::ROM
Petr Borsodi [Wed, 16 Jan 2019 16:37:57 +0000 (17:37 +0100)] 
[util] Improve processing of ROM images in Option::ROM

The Option::ROM module now compares the Code Type in the PCIR header
to 0x00 (PC-AT) in order to check the presence of other header types
(PnP, UNDI, iPXE, etc).  The validity of these headers are checked not
only by offset, but by range and signature checks also.  The image
checksum and initial size also depends on Code Type.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
7 months ago[zbin] Fix compiler warning with GCC 9
Michael Brown [Mon, 21 Jan 2019 11:17:04 +0000 (11:17 +0000)] 
[zbin] Fix compiler warning with GCC 9

GCC 9 warns that abs() may truncate its signed long argument.  Fix by
using labs() instead.

Reported-by: Martin Liška <mliska@suse.cz>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
7 months ago[libc] Fix strcmp()/strncmp() to return proper values
Aaron Young [Wed, 9 Jan 2019 19:35:39 +0000 (11:35 -0800)] 
[libc] Fix strcmp()/strncmp() to return proper values

Fix strcmp() and strncmp() to return proper standard positive/negative
values for unequal strings.  Current implementation is backwards
(i.e. the functions are returning negative when should be positive and
vice-versa).

Currently all consumers of these functions only check the return value
for ==0 or !=0 and so we can safely change the implementation without
breaking things.

Signed-off-by: Aaron Young <Aaron.Young@oracle.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
7 months ago[efi] Fix error handling path in efi_snp_probe
Ignat Korchagin [Fri, 4 Jan 2019 19:20:28 +0000 (19:20 +0000)] 
[efi] Fix error handling path in efi_snp_probe

Current (simplified):

1. InstallMultipleProtocolInterfaces
       if err goto err_install_protocol_interface;
2. OpenProtocol(efi_nii_protocol_guid)
       if err goto err_open_nii;
3. OpenProtocol(efi_nii31_protocol_guid)
       if err goto err_open_nii31;
4. efi_child_add
       if err goto err_efi_child_add;
...
err_efi_child_add:
   CloseProtocol(efi_nii_protocol_guid) <= should be efi_nii31_protocol_guid
err_open_nii: <= should be err_open_nii31
   CloseProtocol(efi_nii31_protocol_guid) <= should be efi_nii_protocol_guid
err_open_nii31: <= should be err_open_nii
   UninstallMultipleProtocolInterfaces

Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
7 months ago[pci] Correct invalid base-class/sub-class/prog-if order in PCIR
Petr Borsodi [Tue, 15 Jan 2019 13:06:19 +0000 (13:06 +0000)] 
[pci] Correct invalid base-class/sub-class/prog-if order in PCIR

PCI Configuration Space contains fields prog-if at the offset 0x09,
sub-class at the offset 0x0a and base-class at the offset 0x0b (it
respects little endian).  PCIR structure uses these fields in the same
order.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 months ago[build] Handle R_X86_64_PLT32 from binutils 2.31
Christian Hesse [Sat, 25 Aug 2018 11:53:08 +0000 (13:53 +0200)] 
[build] Handle R_X86_64_PLT32 from binutils 2.31

Starting from binutils 2.31.0 (commit bd7ab16b) x86-64 assembler
generates R_X86_64_PLT32 instead of R_X86_64_PC32.

Acked-by: John Jolly <jjolly@suse.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
12 months ago[sfc] Add support for X25xx adapters
Martin Habets [Mon, 18 Jun 2018 10:41:38 +0000 (11:41 +0100)] 
[sfc] Add support for X25xx adapters

The first adapters in this family are X2522-10, X2522-25, X2541 and
X2542.

These no longer use PCI BAR 0 for I/O, but use that for memory.  In
other words, BAR 2 on SFN8xxx adapters now becomes BAR 0.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 months ago[intelxl] Add driver for Intel 40 Gigabit Ethernet NICs
Michael Brown [Sun, 8 Jul 2018 15:41:12 +0000 (16:41 +0100)] 
[intelxl] Add driver for Intel 40 Gigabit Ethernet NICs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 months ago[ethernet] Use standard 1500 byte MTU unless explicitly overridden
Michael Brown [Tue, 17 Jul 2018 11:01:30 +0000 (12:01 +0100)] 
[ethernet] Use standard 1500 byte MTU unless explicitly overridden

Devices that support jumbo frames will currently default to the
largest possible MTU.  This assumption is valid for virtual adapters
such as virtio-net, where the MTU must have been configured by a
system administrator, but is unsafe in the general case of a physical
adapter.

Default to the standard Ethernet MTU, unless explicitly overridden
either by the driver or via the ${netX/mtu} setting.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
14 months ago[rndis] Clean up error handling path in register_rndis()
Michael Brown [Mon, 9 Jul 2018 09:35:57 +0000 (10:35 +0100)] 
[rndis] Clean up error handling path in register_rndis()

Avoid calling rndis_halt() and rndis->op->close() twice if the call to
register_netdev() fails.

Reported-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
14 months ago[build] Use positive-form tests when checking for supported warnings
Michael Brown [Sun, 8 Jul 2018 17:12:43 +0000 (18:12 +0100)] 
[build] Use positive-form tests when checking for supported warnings

Some versions of gcc seem to silently accept an attempt to disable an
unrecognised warning (e.g. via -Wno-stringop-truncation) but will then
report the unrecognised warning if any other error occurs during the
build, resulting in a potentially misleading error message.

Avoid this potential confusion by using the positive-form tests in
order to determine the workaround CFLAGS.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
14 months ago[vmbus] Do not expect version in version_response
Roman Kagan [Sat, 9 Jun 2018 14:53:31 +0000 (17:53 +0300)] 
[vmbus] Do not expect version in version_response

The definition of version_response channel message in Linux doesn't
include version field, so the upcoming VMBus implementation in QEMU
doesn't set it either.  Neither Windows nor Linux had any problem with
this.

The check against this field is redundant because the message is the
response to initiate_contact message containing the specific version
requested, so the response with version_supported=true is unambiguous.

Drop this check and don't rely on the field to be present in the
message.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
14 months ago[rndis] Register netdev with MAC filled
Roman Kagan [Fri, 1 Jun 2018 06:59:01 +0000 (09:59 +0300)] 
[rndis] Register netdev with MAC filled

register_netdev expects ->hw_addr and ->ll_addr to be already filled,
so move it towards the end of register_rndis, after the respective
fields have been successfully queried from the underlying device.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
14 months ago[efi] Exclude link-layer header length from MaxPacketSize
Rob Taglang [Fri, 27 Apr 2018 18:19:07 +0000 (14:19 -0400)] 
[efi] Exclude link-layer header length from MaxPacketSize

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
14 months ago[intelx] Add support for Intel X552 NIC
Steven Haber [Thu, 10 May 2018 23:12:32 +0000 (16:12 -0700)] 
[intelx] Add support for Intel X552 NIC

Signed-off-by: Michael Brown <mcb30@ipxe.org>
14 months ago[build] Disable gcc stringop-truncation warnings
Bruce Rogers [Tue, 24 Apr 2018 14:47:32 +0000 (08:47 -0600)] 
[build] Disable gcc stringop-truncation warnings

The gcc 8 compiler introduces a warning for certain string
manipulation functions, flagging usages which _may_ not be intended.
An audit of the iPXE sources indicates all usages of strncat and
strncpy are as intended, so the warnings currently issued are not
helpful, especially if warnings are considered errors.

Fix by detecting gcc's support for -Wno-stringop-truncation and, if
detected, using that option to avoid the warning.

Signed-off-by: Bruce Rogers <brogers@suse.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Also-fixed-by: Christian Hesse <list@eworm.de>
Also-fixed-by: Roman Kagan <rkagan@virtuozzo.com>
Also-fixed-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
Also-fixed-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
15 months ago[http] Work around stateful authentication schemes
Michael Brown [Mon, 14 May 2018 10:16:34 +0000 (11:16 +0100)] 
[http] Work around stateful authentication schemes

As pointedly documented in RFC7230 section 2.3, HTTP is a stateless
protocol: each request message can be understood in isolation from any
other requests or responses.  Various authentication schemes such as
NTLM break this fundamental property of HTTP and rely on the same TCP
connection being reused.

Work around these broken authentication schemes by ensuring that the
most recently pooled connection is reused for the subsequent
authentication retry.

Reported-by: Andreas Hammarskjöld <junior@2PintSoftware.com>
Tested-by: Andreas Hammarskjöld <junior@2PintSoftware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
16 months ago[icplus] Add driver for IC+ network card
Sylvie Barlow [Fri, 20 Apr 2018 13:10:26 +0000 (14:10 +0100)] 
[icplus] Add driver for IC+ network card

Signed-off-by: Sylvie Barlow <sylvie.c.barlow@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
16 months ago[mii] Add bit-bashing interface
Sylvie Barlow [Fri, 20 Apr 2018 12:58:40 +0000 (13:58 +0100)] 
[mii] Add bit-bashing interface

Signed-off-by: Sylvie Barlow <sylvie.c.barlow@gmail.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
16 months ago[mii] Add mii_find()
Sylvie Barlow [Fri, 20 Apr 2018 12:37:20 +0000 (13:37 +0100)] 
[mii] Add mii_find()

Add the function mii_find() in order to locate the PHY address.

Signed-off-by: Sylvie Barlow <sylvie.c.barlow@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
16 months ago[mii] Fix typo in parameter name
Michael Brown [Fri, 20 Apr 2018 12:25:46 +0000 (13:25 +0100)] 
[mii] Fix typo in parameter name

Signed-off-by: Michael Brown <mcb30@ipxe.org>
16 months ago[tcp] Add missing packed attribute on struct tcp_header
Michael Brown [Thu, 19 Apr 2018 16:32:07 +0000 (17:32 +0100)] 
[tcp] Add missing packed attribute on struct tcp_header

Debugged-by: Mark Rutland <mark.rutland@arm.com>
Debugged-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
16 months ago[mii] Separate concepts of MII interface and MII device
Michael Brown [Thu, 19 Apr 2018 11:38:55 +0000 (12:38 +0100)] 
[mii] Separate concepts of MII interface and MII device

We currently have no generic concept of a PHY address, since all
existing implementations simply hardcode the PHY address within the
MII access methods.

A bit-bashing MII interface will need to be provided with an explicit
PHY address in order to generate the correct waveform.  Allow for this
by separating out the concept of a MII device (i.e. a specific PHY
address attached to a particular MII interface).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
16 months ago[velocity] Fix usage of mii_read() and mii_write()
Michael Brown [Thu, 19 Apr 2018 11:36:16 +0000 (12:36 +0100)] 
[velocity] Fix usage of mii_read() and mii_write()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
16 months ago[rhine] Fix usage of mii_read()
Michael Brown [Thu, 19 Apr 2018 11:34:08 +0000 (12:34 +0100)] 
[rhine] Fix usage of mii_read()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
16 months ago[undi] Include subsystem IDs in broken interrupt device check
Michael Brown [Wed, 18 Apr 2018 15:38:36 +0000 (16:38 +0100)] 
[undi] Include subsystem IDs in broken interrupt device check

Allow the subsystem IDs to be used when checking for PXE stacks with
broken interrupt support.

Suggested-by: Levi Hsieh <Levi.Hsieh@dell.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[intelx] Add PCI_ROM entry for Intel X553 NIC
Rob Taglang [Thu, 5 Apr 2018 18:47:23 +0000 (14:47 -0400)] 
[intelx] Add PCI_ROM entry for Intel X553 NIC

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[efi] Add support for R_ARM_REL32 relocations
Heinrich Schuchardt [Tue, 27 Mar 2018 17:07:38 +0000 (19:07 +0200)] 
[efi] Add support for R_ARM_REL32 relocations

The relocation type R_ARM_REL32 is generated when building
bin-arm32-efi/snp.efi using gcc 6.3 and ld 2.28.

R_ARM_REL32 is a program counter (PC) relative 32 bit relocation so we
can ignore it like all other PC relative relocations.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[efi] Do not raise TPL within EFI_DRIVER_BINDING_PROTOCOL.Supported()
Michael Brown [Mon, 26 Mar 2018 11:10:09 +0000 (12:10 +0100)] 
[efi] Do not raise TPL within EFI_DRIVER_BINDING_PROTOCOL.Supported()

When booting some versions of the UEFI shell, our driver binding
protocol's Supported() entry point is called at TPL_NOTIFY for no
discernible reason.  Attempting to raise to TPL_CALLBACK triggers an
immediate assertion failure in the firmware.

Since our Supported() method can run at any TPL, fix by simply not
attempting to raise the TPL within this method.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[efi] Release SNP devices before starting SAN boot image
Michael Brown [Mon, 26 Mar 2018 10:31:41 +0000 (11:31 +0100)] 
[efi] Release SNP devices before starting SAN boot image

Release SNP devices to allow the SAN booted image to use our
EFI_SIMPLE_NETWORK_PROTOCOL instance, and to ensure that the image is
started at TPL_APPLICATION.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[tls] Ensure that window change is propagated to plainstream interface
Michael Brown [Sat, 24 Mar 2018 21:44:09 +0000 (21:44 +0000)] 
[tls] Ensure that window change is propagated to plainstream interface

The cipherstream xfer_window_changed() message is used to retrigger
the TLS transmit state machine.  If the transmit state machine is
idle, then the window change message will not be propagated to the
plainstream interface.  This can potentially cause the plainstream
interface peer (e.g. httpcore) to block waiting for a window change
message that will never arrive.

Fix by ensuring that the window change message is propagated to the
plainstream interface if the transmit state machine is idle.  (If the
transmit state machine is not idle then the plainstream window will be
zero anyway.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[tls] Rename tls_session to tls_connection
Michael Brown [Thu, 22 Mar 2018 16:10:46 +0000 (18:10 +0200)] 
[tls] Rename tls_session to tls_connection

In TLS terminology a session conceptually spans multiple individual
connections, and essentially represents the stored cryptographic state
(master secret and cipher suite) required to establish communication
without going through the certificate and key exchange handshakes.

Rename tls_session to tls_connection in order to make the name
tls_session available to represent the session state.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[list] Add list_is_first_entry() and list_is_last_entry()
Michael Brown [Sat, 24 Mar 2018 21:26:19 +0000 (21:26 +0000)] 
[list] Add list_is_first_entry() and list_is_last_entry()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[tls] Ensure received data list is initialised before calling tls_free()
Michael Brown [Fri, 23 Mar 2018 11:07:29 +0000 (11:07 +0000)] 
[tls] Ensure received data list is initialised before calling tls_free()

A failure in tls_generate_random() will result in a call to ref_put()
before the received data list has been initialised, which will cause
free_tls() to attempt to traverse an uninitialised list.

Fix by ensuring that all fields referenced by free_tls() are
initialised before any of the potential failure paths.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[util] Support reversed sort ordering when generating NIC list
Robin Smidsrød [Wed, 21 Mar 2018 15:08:58 +0000 (17:08 +0200)] 
[util] Support reversed sort ordering when generating NIC list

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[librm] Ensure that inline code symbols are unique
Michael Brown [Wed, 21 Mar 2018 14:47:33 +0000 (16:47 +0200)] 
[librm] Ensure that inline code symbols are unique

Commit 6149e0a ("[librm] Provide symbols for inline code placed into
other sections") may cause build failures due to duplicate label names
if the compiler chooses to duplicate inline assembly code.

Fix by using the "%=" special format string to include a
guaranteed-unique number within the label name.

The "%=" will be expanded only if constraints exist for the inline
assembly.  This fix therefore requires that all REAL_CODE() fragments
use a (possibly empty) constraint list.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[librm] Provide symbols for inline code placed into other sections
Michael Brown [Wed, 21 Mar 2018 12:39:18 +0000 (14:39 +0200)] 
[librm] Provide symbols for inline code placed into other sections

Provide symbols constructed from the object name and line number for
code fragments placed into alternative sections, such as inline
REAL_CODE() assembly placed into .text16.  This simplifies the
debugging task of finding the source code corresponding to a given
instruction pointer.

Note that we cannot use __FUNCTION__ since it is not a preprocessor
macro and so cannot be concatenated with string literals.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[undi] Treat invalid IRQ numbers as non-fatal errors
Michael Brown [Wed, 21 Mar 2018 08:28:05 +0000 (10:28 +0200)] 
[undi] Treat invalid IRQ numbers as non-fatal errors

If the underlying PXE stack reports an invalid IRQ number (above
IRQ_MAX), treat this as equivalent to an empty IRQ number and fall
back to using polling mode.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[build] Prevent use of MMX and SSE registers
Michael Brown [Tue, 20 Mar 2018 19:34:46 +0000 (21:34 +0200)] 
[build] Prevent use of MMX and SSE registers

The existence of MMX and SSE is required by the System V x86_64 ABI
and so is assumed by gcc, but these registers are not preserved by our
own interrupt handlers and are unlikely to be preserved by other
context switch handlers in a boot firmware environment.

Explicitly prevent gcc from using MMX or SSE registers to avoid
potential problems due to silent register corruption.

We must remove the %xmm0-%xmm5 clobbers from the x86_64 version of
hv_call() since otherwise gcc will complain about unknown register
names.  Theoretically, we should probably add code to explicitly
preserve the %xmm0-%xmm5 registers across a hypercall, in order to
guarantee to external code that these registers remain unchanged.  In
practice this is difficult since SSE registers are disabled by
default: for background information see commits 71560d1 ("[librm]
Preserve FPU, MMX and SSE state across calls to virt_call()") and
dd9a14d ("[librm] Conditionalize the workaround for the Tivoli VMM's
SSE garbling").

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[rng] Use fixed-point calculations for min-entropy quantities
Michael Brown [Tue, 20 Mar 2018 18:42:39 +0000 (20:42 +0200)] 
[rng] Use fixed-point calculations for min-entropy quantities

We currently perform various min-entropy calculations using build-time
floating-point arithmetic.  No floating-point code ends up in the
final binary, since the results are eventually converted to integers
and asserted to be compile-time constants.

Though this mechanism is undoubtedly cute, it inhibits us from using
"-mno-sse" to prevent the use of SSE registers by the compiler.

Fix by using fixed-point arithmetic instead.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[golan] Set log_max_qp to 1
Ameer Mahagneh [Tue, 20 Mar 2018 15:55:04 +0000 (17:55 +0200)] 
[golan] Set log_max_qp to 1

This is required to work around a bug in some firmware versions.

Signed-off-by: Ameer Mahagneh <ameerm@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[time] Add support for the ACPI power management timer
Michael Brown [Tue, 20 Mar 2018 15:26:49 +0000 (17:26 +0200)] 
[time] Add support for the ACPI power management timer

Allow the ACPI power management timer to be used if enabled via
TIMER_ACPI in config/timer.h.  This provides an alternative timer on
systems where the standard 8254 PIT is unavailable or unreliable.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[efi] Provide Map_Mem() and associated UNDI callbacks
Michael Brown [Tue, 20 Mar 2018 11:22:30 +0000 (13:22 +0200)] 
[efi] Provide Map_Mem() and associated UNDI callbacks

Some drivers are known to call the optional Map_Mem() callback without
first checking that the callback exists.  Provide a usable basic
implementation of Map_Mem() along with the other callbacks that become
mandatory if Map_Mem() is provided.

Note that in theory the PCI I/O protocol is allowed to require
multiple calls to Map(), with each call handling only a subset of the
overall mapped range.  However, the reference implementation in EDK2
assumes that a single Map() will always suffice, so we can probably
make the same simplifying assumption here.

Tested with the Intel E3522X2.EFI driver (which, incidentally, fails
to cleanly remove one of its mappings).

Originally-implemented-by: Maor Dickman <maord@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[lacp] Check the partner's own state when checking for blocked links
Michael Brown [Mon, 19 Mar 2018 13:47:39 +0000 (15:47 +0200)] 
[lacp] Check the partner's own state when checking for blocked links

The blocked link test in eth_slow_lacp_rx() is performed before the
actor TLV is copied to the partner TLV, and so must test the actor
state field rather than the partner state field.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[ocsp] Allow OCSP checks to be disabled
Michael Brown [Sun, 18 Mar 2018 20:27:49 +0000 (22:27 +0200)] 
[ocsp] Allow OCSP checks to be disabled

Some CAs provide non-functional OCSP servers, and some clients are
forced to operate on networks without access to the OCSP servers.
Allow the user to explicitly disable the use of OCSP checks by
undefining OCSP_CHECK in config/crypto.h.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[ocsp] Centralise test for whether or not an OCSP check is required
Michael Brown [Sun, 18 Mar 2018 20:21:49 +0000 (22:21 +0200)] 
[ocsp] Centralise test for whether or not an OCSP check is required

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[profile] Prevent potential division by zero
Michael Brown [Sun, 18 Mar 2018 16:36:58 +0000 (18:36 +0200)] 
[profile] Prevent potential division by zero

Limit the profile sample count to INT_MAX to avoid both signed
overflow and a potential division by zero when updating the stored
mean value.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 months ago[tftp] Prevent potential division by zero
Michael Brown [Sun, 18 Mar 2018 15:43:11 +0000 (17:43 +0200)] 
[tftp] Prevent potential division by zero

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