summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [build] Construct full version number automatically from git revisionv1.20.1Michael Brown2020-01-021-2/+15
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [snp] Set EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST bit as per UEFI specIgnat Korchagin2019-12-161-1/+2
| | | | | | | | | | According to UEFI specification 2.8 p 24.1 we must set the EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST bit in the "Disable" mask, when "ResetMCastFilter" is TRUE. Signed-off-by: Ignat Korchagin <ignat@cloudflare.com> Split-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [snp] Try promiscuous multicast receive filter if the regular one failsIgnat Korchagin2019-12-161-0/+3
| | | | | | | | | | | | | | | Currently, if the SNP driver for whatever reason fails to enable receive filters for multicast frames, it falls back to enabling just unicast and broadcast filters. This breaks some IPv6 functionality as the network card does not respond to neighbour solicitation requests. Some cards refuse to enable EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, but do support enabling EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST, so try it before falling back to just unicast+broadcast. Signed-off-by: Ignat Korchagin <ignat@cloudflare.com> Split-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [peerdist] Allow for the use of a hosted cache serverMichael Brown2019-12-161-4/+65
| | | | | | | | | | | | | Allow a PeerDist hosted cache server to be specified via the ${peerhost} setting, e.g.: # Use 192.168.0.1 as hosted cache server set peerhost 192.168.0.1 Note that this simply treats the hosted cache server as a permanently discovered peer for all segments. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [peerdist] Allow PeerDist to be globally enabled or disabledMichael Brown2019-12-131-0/+38
| | | | | | | | | | Allow the use of PeerDist content encoding to be enabled or disabled via the ${peerdist} setting, e.g.: # Disable PeerDist set peerdist 0 Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lan78xx] Always enable automatic speed and duplex detectionMichael Brown2019-09-292-0/+14
| | | | | | | | | | | | On devices with no EEPROM or OTP, the MAC_CR register defaults to not using automatic link speed detection, with the result that no packets are successfully sent or received. Fix by always enabling automatic speed and duplex detection, since iPXE provides no mechanism for manual configuration of either link speed or duplex. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Do not attempt EFI_USB_IO_PROTOCOL transfers during shutdownMichael Brown2019-09-151-0/+8
| | | | | | | | | | | | | | | 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>
* [efi] Report failed control transfers as expected by the USB coreMichael Brown2019-09-151-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [golan] Fix address-of-pointer bug for multicast attach/detachMichael Brown2019-08-171-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ethernet] Avoid false positive Coverity warningMichael Brown2019-08-171-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [coverity] Override assumptions about wcrtomb() and hmac_init()Michael Brown2019-08-171-0/+8
| | | | | | | | | | | | 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>
* [crypto] Profile the various stages of modular multiplicationMichael Brown2019-08-171-0/+29
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Drag in configured digestInfo prefixes for any use of RSAMichael Brown2019-08-171-0/+6
| | | | | | | | | | 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>
* [tls] Add missing call to tls_tx_resume() when restarting negotiationMichael Brown2019-08-161-22/+24
| | | | | | | | | | | | 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>
* [peerdist] Limit number of concurrent raw block downloadsMichael Brown2019-08-162-3/+155
| | | | | | | | | | | | | | | | | 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>
* [peerdist] Start block download timers from within opener methodsMichael Brown2019-08-161-7/+9
| | | | | | | | | 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>
* [process] Add PROC_INIT() for initialising static processesMichael Brown2019-08-161-5/+13
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Add predefined shortcut for Raspberry Pi buildsMichael Brown2019-08-021-0/+4
| | | | | | | | 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>
* [build] Move predefined all-drivers build shortcut to MakefileMichael Brown2019-08-022-5/+9
| | | | | | | | | | | 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>
* [build] Do not apply WORKAROUND_CFLAGS for host compilerMichael Brown2019-07-222-2/+6
| | | | | | | | | | | | | | | | | | | | 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>
* [build] Workaround compilation error with gcc 9.1Valentine Barshak2019-07-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [build] Fix "'%s' directive argument is null" errorValentine Barshak2019-07-221-2/+1Star
| | | | | | | | | | | | 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>
* [smscusb] Fetch MAC from device tree for Raspberry Pi Model B+Michael Brown2019-07-194-29/+41
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Add named configuration for Raspberry PiMichael Brown2019-07-198-0/+13
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smsc95xx] Fetch MAC from device tree for Raspberry PiMichael Brown2019-07-191-0/+31
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Register a device tree if provided by the platform firmwareMichael Brown2019-07-193-0/+74
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fdt] Add ability to parse a MAC address from a flattened device treeMichael Brown2019-07-195-0/+643
| | | | | | | | | | | | | 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>
* [efi] Return only registered EFI devices from efidev_parent()Michael Brown2019-07-151-3/+6
| | | | | | | | | | | 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>
* [arm] Provide dummy implementations for {in,out}[s]{b,w,l}Michael Brown2019-07-141-18/+59
| | | | | | | | | | | | | | | | | 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>
* [build] Fix use of inline assembly on GCC 8 ARM64 buildsMichael Brown2019-07-141-2/+2
| | | | | | | | | | | | | | | | 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>
* [golan] Add various new PCI device IDsMohammed2019-05-021-0/+3
| | | | | Signed-off-by: Mohammed <mohammedt@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intelxl] Add driver for Intel 40 Gigabit Ethernet NIC virtual functionsMichael Brown2019-04-274-2/+989
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intelxl] Choose to operate in non-PXE modeMichael Brown2019-04-272-28/+155
| | | | | | | | | | | | | | | | | | | | 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>
* [intelxl] Expose functions required by virtual function driverMichael Brown2019-04-272-17/+32
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intelxl] Allow for arbitrary placement of interrupt control registerMichael Brown2019-04-272-12/+11Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intelxl] Split out ring creation from context programmingMichael Brown2019-04-271-28/+76
| | | | | | | | | | 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>
* [intelxl] Allow for arbitrary placement of ring tail registersMichael Brown2019-04-272-7/+9
| | | | | | | | 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>
* [intelxl] Use 32-byte receive descriptorsMichael Brown2019-04-272-23/+42
| | | | | | | | 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>
* [intelxl] Provide a mechanism for handling "send to VF" eventsMichael Brown2019-04-272-0/+28
| | | | | | | 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>
* [intelxl] Allow admin cookie to hold extended opcode and return codeMichael Brown2019-04-272-7/+16
| | | | | | | 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>
* [intelxl] Allow admin queues to be reinitialisedMichael Brown2019-04-271-41/+85
| | | | | | | | | | 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>
* [intelxl] Use one admin queue buffer per admin queue descriptorMichael Brown2019-04-272-118/+197
| | | | | | | | | | | | | | | | | | 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>
* [intelxl] Allow for virtual function admin queue register mapsMichael Brown2019-04-272-21/+59
| | | | | | | 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>
* [intelxl] Use VLAN tag in receive descriptor if presentMichael Brown2019-04-272-3/+19
| | | | | | | | 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>
* [vlan] Provide vlan_netdev_rx() and vlan_netdev_rx_err()Michael Brown2019-04-274-22/+85
| | | | | | | | | 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>
* [pci] Add support for PCI MSI-X interruptsMichael Brown2019-04-244-0/+340
| | | | | | | | | | | | | | | | | 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>
* [intel] Add PCI ID for I219-V and -LM 6 to 9HEADmasterChristian Nilsson2019-03-181-0/+8
| | | | | Signed-off-by: Christian Nilsson <nikize@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ocsp] Accept response certID with missing hashAlgorithm parametersMichael Brown2019-03-102-14/+32
| | | | | | | | | | | | | | | | | | 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>
* [tcp] Display "connecting" status until connection is establishedMichael Brown2019-03-101-0/+21
| | | | | | | | 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>
* [tls] Display validator messages only while validation is in progressMichael Brown2019-03-102-3/+11
| | | | | | | Allow the cipherstream to report progress status messages during connection establishment. Signed-off-by: Michael Brown <mcb30@ipxe.org>