summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* [dhcp] Allow for variable encapsulation of architecture-specific optionsMichael Brown2016-07-047-45/+39Star
| | | | | | | | | | | | | DHCPv4 and DHCPv6 share some values in common for the architecture- specific options (such as the client system architecture type), but use different encapsulations: DHCPv4 has a single byte for the option length while DHCPv6 has a 16-bit field for the option length. Move the containing DHCP_OPTION() and related wrappers from the individual dhcp_arch.h files to dhcp.c, thus allowing for the architecture-specific values to be reused in dhcpv6.c. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Disable interrupts on the PIC before starting NBPMichael Brown2016-07-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | Some BIOSes (observed with an HP Gen9) seem to spuriously enable interrupts at the PIC. This causes problems with NBPs such as GRUB which use the UNDI API (thereby enabling interrupts on the NIC) without first hooking an interrupt service routine. In this situation, the interrupt will end up being handled by the default BIOS ISR, which will typically just send an EOI and return. Since nothing in this handler causes the NIC to deassert the interrupt, this will result in an interrupt storm. Entertainingly, some BIOSes are immune to this problem because the default ISR sends the EOI only to the slave PIC; this effectively disables the interrupt. Work around this problem by disabling the interrupt on the PIC before invoking the PXE NBP. An NBP that expects to make use of interrupts will need to be configuring the PIC anyway, so it is probably safe to assume that it will explicitly reenable the interrupt. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Do not enable interrupts when printing to the consoleMichael Brown2016-07-031-14/+4Star
| | | | | | | | There seems to be no reason for the sti/cli pair used around each call to INT 10. Remove these instructions, so that printing debug messages from within an ISR does not temporarily reenable interrupts. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Fix uninitialised data in HII IFR structuresMichael Brown2016-06-291-0/+1
| | | | | | | | | | | | | | The HII IFR structures are allocated via realloc() rather than zalloc(), and so are not automatically zeroed. This results in the presence of uninitialised and invalid data, causing crashes elsewhere in the UEFI firmware. Fix by explicitly zeroing the newly allocated portion of any IFR structure in efi_ifr_op(). Debugged-by: Laszlo Ersek <lersek@redhat.com> Debugged-by: Gary Lin <glin@suse.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [thunderx] Fix compilation with older versions of gccMichael Brown2016-06-221-2/+2
| | | | | | | Remove redundant duplicate typedef which causes a build failure on older gcc versions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Do not copy garbage bytes into SNP device path MAC addressMichael Brown2016-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | The SNP device path includes the network device's MAC address within the MAC_ADDR_DEVICE_PATH.MacAddress field. We check that the link-layer address will fit within this field, and then perform the copy using the length of the destination buffer. At 32 bytes, the MacAddress field is actually larger than the current maximum iPXE link-layer address. The copy therefore overflows the source buffer, resulting in trailing garbage bytes being appended to the device path's MacAddress. This is invisible in debug messages, since the DevicePathToText protocol will render only the length implied by the interface type. Fix by copying only the actual length of the link-layer address (which we have already verified will not overflow the destination buffer). Debugged-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Report failures to stop the EFI timer tick eventMichael Brown2016-06-201-2/+16
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smsc75xx] Allow up to 100ms for reset to completeMichael Brown2016-06-202-11/+16
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Fix virtio-pci loggingLadi Prosek2016-06-201-7/+7
| | | | | | | | | iPXE debug logging doesn't support %u. This commit replaces it with %d in virtio-pci debug format strings. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Renumber virtio_pci_region flagsLadi Prosek2016-06-201-3/+3
| | | | | | | | | | | | | Some of the regions may end up being unmapped, either because they are optional or because the attempt to map them has failed. Region types starting at 0 didn't make it easy to test for this condition. This commit bumps all valid region types up by 1 with 0 having the implicit 'unmapped' meaning. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [thunderx] Retrieve base MAC address via EFI_THUNDER_CONFIG_PROTOCOLMichael Brown2016-06-182-1/+250
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Include VLAN in SNP device path if applicableMichael Brown2016-06-181-2/+15
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add PCI device ID for another I219-LMChristian Nilsson2016-06-161-0/+1
| | | | | Tested-by: Kuniyasu Suzaki <k.suzaki@aist.go.jp> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [thunderx] Fix channel configuration for VNICs 1-7Michael Brown2016-06-151-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [thunderx] Add driver for Cavium ThunderX SoC NICsMichael Brown2016-06-133-0/+2618
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "ntp" commandMichael Brown2016-06-135-0/+156
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ntp] Add simple NTP clientMichael Brown2016-06-133-0/+385
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [time] Allow system clock to be adjusted at runtimeMichael Brown2016-06-133-3/+19
| | | | | | | | | | Provide a mechanism to allow an arbitrary adjustment to be applied to all subsequent calls to time(). Note that the underlying clock source (e.g. the RTC clock) will not be changed; only the time as reported within iPXE will be affected. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Add missing memory barrierLeendert van Doorn2016-06-131-0/+2
| | | | | | | | | ARM64 has a weaker memory order model than x86. The missing memory barrier caused phy initialization notification to be delayed beyond the link-wait timeout (15 secs). Signed-off-by: Leendert van Doorn <leendert@paramecium.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Send TCP keepalives on idle established connectionsMichael Brown2016-06-132-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | In some circumstances, intermediate devices may lose state in a way that temporarily prevents the successful delivery of packets from a TCP peer. For example, a firewall may drop a NAT forwarding table entry. Since iPXE spends most of its time downloading files (and hence purely receiving data, sending only TCP ACKs), this can easily happen in a situation in which there is no reason for iPXE's TCP stack to generate any retransmissions. The temporary loss of connectivity can therefore effectively become permanent. Work around this problem by sending TCP keepalives after a period of inactivity on an established connection. TCP keepalives usually send a single garbage byte in sequence number space that has already been ACKed by the peer. Since we do not need to elicit a response from the peer, we instead send pure ACKs (with no garbage data) in order to keep the transmit code path simple. Originally-implemented-by: Ladi Prosek <lprosek@redhat.com> Debugged-by: Ladi Prosek <lprosek@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Fix address truncation bug on 64-bit machinesLeendert van Doorn2016-06-102-2/+2
| | | | | Signed-off-by: Leendert van Doorn <leendert@paramecium.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Accept headers with no whitespace following the colonMichael Brown2016-06-091-2/+6
| | | | | Reported-by: Raphael Cohn <raphael.cohn@stormmq.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Support systems with multiple PCI root bridgesMichael Brown2016-06-099-42/+160
| | | | | | | | | Extend the 16-bit PCI bus:dev.fn address to a 32-bit seg:bus:dev.fn address, assuming a segment value of zero in contexts where multiple segments are unsupported by the underlying data structures (e.g. in the iBFT or BOFM tables). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Always use a non-zero seed for the (non-crypto) RNGMichael Brown2016-06-091-0/+2
| | | | | | | | | | | | | | The non-cryptographic RNG implemented by random() has the property that a seed value of zero will result in a generated sequence of all-zero values. This situation can arise if currticks() returns zero at start of day. Work around this problem by falling back to a fixed non-zero seed if necessary. This has no effect on the separate DRBG used by cryptographic code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Remove nested "my" declarationVinson Lee2016-06-031-1/+1
| | | | | | | | | | Fix build error with perl >= 5.23.2: Can't redeclare "my" in "my" at ./util/parserom.pl line 160 Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Expose DHCP packets via the Apple NetBoot protocolMichael Brown2016-05-295-3/+145
| | | | | | | | Mac OS X uses non-standard EFI protocols to obtain the DHCP packets from the UEFI firmware. Originally-implemented-by: Michael Kuron <m.kuron@gmx.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Fix definitions for x86_64 and EFI BC client architecturesMichael Brown2016-05-261-4/+4
| | | | | | | | | | | | | | | There has been a longstanding disagreement between RFC4578 and the IANA "Processor Architecture Types" registry. RFC4578 section 2.1 defines type 7 as "EFI BC" and type 9 as "EFI x86-64"; the IANA registry quotes RFC4578 as its source but has these values erroneously swapped. The EDK2 codebase uses the IANA values. As of March 2016, RFC4578 has been modified by an errata to match the values as recorded in the IANA registry. Fix our definitions to match the consensus values. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arm] Use correct DHCP client architecture valuesMichael Brown2016-05-263-2/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [axge] Add driver for ASIX 10/100/1000 USB Ethernet NICsMichael Brown2016-05-263-0/+973
| | | | | | | Add driver for the AX88178A (USB2) and AX88179 (USB3) 10/100/1000 Ethernet NICs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Work around broken UEFI keyboard driversMichael Brown2016-05-261-2/+7
| | | | | | | | | | | | Some UEFI keyboard drivers are blissfully unaware of the existence of either Ctrl key, and will report "Ctrl-<key>" as just "<key>". This breaks substantial portions of the iPXE user interface. Work around these broken UEFI drivers by allowing "ESC <key>" to be used as a substitute for "Ctrl-<key>". Tested-by: Dreamcat4 <dreamcat4@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Ignore unrecognised "Connection" header tokensMichael Brown2016-05-251-13/+11Star
| | | | | | | | | | Some HTTP/2 servers send the header "Connection: upgrade, close". This currently causes iPXE to fail due to the unrecognised "upgrade" token. Fix by ignoring any unrecognised tokens in the "Connection" header. Reported-by: Ján ONDREJ (SAL) <ondrejj@salstar.sk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lotest] Add option to use broadcast packets for loopback testingMichael Brown2016-05-233-6/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Fix failure path in register_netdev()Michael Brown2016-05-231-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Extend numerical setting tags to "unsigned long"Michael Brown2016-05-203-4/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Add support for PCI Enhanced AllocationMichael Brown2016-05-204-0/+221
| | | | | | | Some embedded devices have immovable BARs, which are described via a PCI Enhanced Allocation capability. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Work around broken HP EliteBook 745 G3 PXE ROMMichael Brown2016-05-131-0/+2
| | | | | | Reported-by: Arturino Mazzei <mazzeia@hotmail.com> Tested-by: Arturino Mazzei <mazzeia@hotmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ath9k] Fix buffer overrun for ar9287Christian Hesse2016-05-121-4/+3Star
| | | | | | | | This backport is from linux kernel upstream commit 83d6f1f ("ath9k: fix buffer overrun for ar9287"). Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arm] Use CNTVCT_EL0 as profiling timestampMichael Brown2016-05-121-3/+1Star
| | | | | | | | | | | | The raw cycle counter at PMCCNTR_EL0 works in qemu but seems to always read as zero on physical hardware (tested on Juno r1 and Cavium ThunderX), even after ensuring that PMCR_EL0.E and PMCNTENSET_EL0.C are both enabled. Use CNTVCT_EL0 instead; this seems to count at a lower resolution (tens of CPU cycles), but is usable for profiling. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Guard against GetStatus() failing to return a NULL TX bufferMichael Brown2016-05-121-0/+1
| | | | | | | | | | | | | | | The UEFI specification requires the EFI_SIMPLE_NETWORK_PROTOCOL GetStatus() method to set TxBuf to NULL if there are no transmit buffers to recycle. Some implementations (observed with Lan9118Dxe in EDK2) fill in TxBuf only when there is a transmit buffer to recycle, which leads to large numbers of "spurious TX completion" errors. Work around this problem by initialising TxBuf to NULL before calling the GetStatus() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arm] Add optimised TCP/IP checksumming for 64-bit ARMMichael Brown2016-05-113-0/+190
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arm] Add optimised string functions for 64-bit ARMMichael Brown2016-05-113-0/+355
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Avoid implicit assumptions about potentially-optimised memcpy()Michael Brown2016-05-091-1/+1
| | | | | | | | Do not assume that an architecture-specific optimised memcpy() will have the same properties as generic_memcpy() in terms of handling overlapping regions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow for building with older versions of elf.h system headerMichael Brown2016-05-091-0/+22
| | | | | Reported-by: Ahmad Mahagna <ahmhad@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arm] Add support for 64-bit ARM (Aarch64)Michael Brown2016-05-0821-15/+1055
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arm] Split out 32-bit-specific code to arch/arm32Michael Brown2016-05-0820-38/+54
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arm] Avoid instruction references to symbols defined via ".equ"Michael Brown2016-05-081-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | When building for 64-bit ARM, some symbol references may be resolved via an "adrp" instruction (to obtain the start of the 4kB page containing the symbol) and a separate 12-bit offset. For example (taken from the GNU assembler documentation): adrp x0, foo ldr x0, [x0, #:lo12:foo] We occasionally refer to symbols defined via mechanisms that are not directly visible to gcc. For example: extern char some_magic_symbol[]; __asm__ ( ".equ some_magic_symbol, some_magic_expression" ); The subsequent use of the ":lo12:" prefix on such magically-defined symbols triggers an assertion failure in the assembler. This problem seems to affect only "private_key_len" in the current codebase. Fix by storing this value as static data; this avoids the need to provide the value as a literal within the instruction stream, and so avoids the problematic use of the ":lo12:" prefix. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arm] Add support for 32-bit ARMMichael Brown2016-05-0643-49/+1879
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bitops] Fix typo in test caseMichael Brown2016-05-061-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libgcc] Provide __divmoddi4()Michael Brown2016-05-064-31/+28Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legacy] Fix building with GCC 6Michael Brown2016-05-041-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>