summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* [etherfabric] Avoid use of sleep() in driver codeMichael Brown2016-03-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [3c5x9] Avoid use of sleep() in driver codeMichael Brown2016-03-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Allow default drive to be specified via "san-drive" settingMichael Brown2016-03-223-15/+31
| | | | | | | | | | | The DHCP option 175.189 has been defined (by us) since 2006 as containing the drive number to be used for a SAN boot, but has never been automatically used as such by iPXE. Use this option (if specified) to override the default SAN drive number. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Allow drive to be hooked using the natural drive numberMichael Brown2016-03-223-7/+13
| | | | | | | Interpret the maximum drive number (0xff for hard disks, 0x7f for floppy disks) as meaning "use natural drive number". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [gdb] Add support for x86_64Michael Brown2016-03-228-225/+477
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Do not use "objcopy -O binary" for objects with relocation recordsMichael Brown2016-03-211-4/+8
| | | | | | | | | | | | | | | | | | | | The mbr.bin and usbdisk.bin standalone blobs are currently generated using "objcopy -O binary", which does not process relocation records. For the i386 build, this does not matter since the section start address is zero and so the ".rel" relocation records are effectively no-ops anyway. For the x86_64 build, the ".rela" relocation records are not no-ops, since the addend is included as part of the relocation record (rather than inline). Using "objcopy -O binary" will silently discard the relocation records, with the result that all symbols are effectively given a value of zero. Fix by using "ld --oformat binary" instead of "objcopy -O binary" to generate mbr.bin and usbdisk.bin. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Allow drivers to override the eIPoIB LEMACMichael Brown2016-03-212-0/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Allocate space for GRH on UD queue pairsMichael Brown2016-03-212-16/+55
| | | | | | | As with the previous commit (for Hermon), allocate a separate ring buffer to hold received GRHs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Allocate space for GRH on UD queue pairsMichael Brown2016-03-212-12/+47
| | | | | | | | | | | | | | | | | | | | | | | | | The Infiniband specification (volume 1, section 11.4.1.2 "Post Receive Request") notes that for UD QPs, the GRH will be placed in the first 40 bytes of the receive buffer if present. (If no GRH is present, which is normal, then the first 40 bytes of the receive buffer will be unused.) Mellanox hardware performs this placement automatically: other headers will be stripped (and their values returned via the CQE), but the first 40 bytes of the data buffer will be consumed by the (probably non-existent) GRH. This does not fit neatly into iPXE's internal abstraction, which expects the data buffer to represent just the data payload with the addresses from the GRH (if present) passed as additional parameters to ib_complete_recv(). The end result of this discrepancy is that attempts to receive full-sized 2048-byte IPoIB packets on Mellanox hardware will fail. Fix by allocating a separate ring buffer to hold the received GRHs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Allow trusted certificates to be stored in non-volatile optionsMichael Brown2016-03-201-3/+7
| | | | | | | | | | | | | | | | | | | The intention of the existing code (as documented in its own comments) is that it should be possible to override the list of trusted root certificates using a "trust" setting held in non-volatile stored options. However, the rootcert_init() function currently executes before any devices have been probed, and so will not be able to retrieve any such non-volatile stored options. Fix by executing rootcert_init() only after devices have been probed. Since startup functions may be executed multiple times (unlike initialisation functions), add an explicit flag to preserve the property that rootcert_init() should run only once. As before, if an explicit root of trust is specified at build time, then any runtime "trust" setting will be ignored. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [qib7322] Add missing iounmap()Michael Brown2016-03-201-1/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linda] Add missing iounmap()Michael Brown2016-03-201-1/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Add missing iounmap()Michael Brown2016-03-201-10/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Add missing iounmap()Michael Brown2016-03-201-22/+20Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Allow external code to identify IPoIB network devicesMichael Brown2016-03-202-0/+19
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Allow container_of() to be used on volatile pointersMichael Brown2016-03-181-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Move architecture-independent EFI prefixes to interface/efiMichael Brown2016-03-172-0/+0
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Move i386-specific tests to arch/i386/testsMichael Brown2016-03-175-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xen] Use generic test_and_clear_bit() functionMichael Brown2016-03-162-19/+14Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Use generic set_bit() functionMichael Brown2016-03-163-48/+3Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bitops] Add generic atomic bit test, set, and clear functionsMichael Brown2016-03-164-0/+216
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pseudobit] Rename bitops.h to pseudobit.hMichael Brown2016-03-163-10/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Remove long-obsolete header fileMichael Brown2016-03-161-27/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide access to files stored on EFI filesystemsMichael Brown2016-03-145-0/+581
| | | | | | | | | | | | | | | | | | | | | | | | | | Provide access to local files via the "file://" URI scheme. There are three syntaxes: - An opaque URI with a relative path (e.g. "file:script.ipxe"). This will be interpreted as a path relative to the iPXE binary. - A hierarchical URI with a non-network absolute path (e.g. "file:/boot/script.ipxe"). This will be interpreted as a path relative to the root of the filesystem from which the iPXE binary was loaded. - A hierarchical URI with a network path in which the authority is a volume label (e.g. "file://bootdisk/script.ipxe"). This will be interpreted as a path relative to the root of the filesystem with the specified volume label. Note that the potentially desirable shell mappings (e.g. "fs0:" and "blk0:") are concepts internal to the UEFI shell binary, and do not seem to be exposed in any way to external executables. The old EFI_SHELL_PROTOCOL (which did provide access to these mappings) is no longer installed by current versions of the UEFI shell. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Support "file:" URIs describing relative pathsMichael Brown2016-03-142-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Support URIs containing only scheme and path componentsMichael Brown2016-03-132-3/+33
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add processor binding headers for ARM and AArch64Michael Brown2016-03-133-0/+329
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Update to current EDK2 headersMichael Brown2016-03-1313-42/+123
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Accept CROSS= as a synonym for CROSS_COMPILE=Michael Brown2016-03-131-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow assembler section type character to vary by architectureMichael Brown2016-03-137-8/+29
| | | | | | | | | | | | | | | On some architectures (such as ARM) the "@" character is used as a comment delimiter. A section type argument such as "@progbits" therefore becomes "%progbits". This is further complicated by the fact that the "%" character has special meaning for inline assembly when input or output operands are used, in which cases "@progbits" becomes "%%progbits". Allow the section type character(s) to be defined via Makefile variables. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Centralise architecture-independent EFI Makefile and linker scriptMichael Brown2016-03-123-43/+49
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Remove x86-specific inline assemblyMichael Brown2016-03-121-27/+9Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [3c595] Fix compilation when "char" is unsigned by defaultMichael Brown2016-03-121-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [serial] Add missing #include <string.h>Michael Brown2016-03-121-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add missing #include <string.h>Michael Brown2016-03-121-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [qib7322] Use standard readq() and writeq() implementationsMichael Brown2016-03-121-26/+8Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linda] Use standard readq() and writeq() implementationsMichael Brown2016-03-121-26/+8Star
| | | | | | | | | This driver is the original source of the current readq() and writeq() implementations for 32-bit iPXE. Switch to using the now-centralised definitions, to avoid including architecture-specific code in an otherwise architecture-independent driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Do not unconditionally preserve flags across virt_call()Michael Brown2016-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 196f0f2 ("[librm] Convert prot_call() to a real-mode near call") introduced a regression in which any deliberate modification to the low 16 bits of the CPU flags (in struct i386_all_regs) would be overwritten with the original flags value at the time of entry to prot_call(). The regression arose because the alignment requirements of the protected-mode stack necessitated the insertion of two bytes of padding immediately below the prot_call() return address. The solution chosen was to extend the existing "pushfl / popfl" pair to "pushfw;pushfl / popfl;popfw". The extra "pushfw / popfw" appears at first glance to be a no-op, but fails to take into account the fact that the flags restored by popfl may have been deliberately modified by the protected-mode function. Fix by replacing "pushfw / popfw" with "pushw %ss / popw %ss". While %ss does appear within struct i386_all_regs, any modification to the stored value has always been ignored by prot_call() anyway. The most visible symptom of this regression was that SAN booting would fail since every INT 13 call would be chained to the original INT 13 vector. Reported-by: Vishvananda Ishaya <vishvananda@gmail.com> Reported-by: Jamie Thompson <forum.ipxe@jamie-thompson.co.uk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arp] Validate length of ARP packetMichael Brown2016-03-122-0/+17
| | | | | | | | | | | | There is no practical way to generate an underlength ARP packet since an ARP packet is always padded up to the minimum Ethernet frame length (or dropped by the receiving Ethernet hardware if incorrectly padded), but the absence of an explicit check causes warnings from some analysis tools. Fix by adding an explicit check on the I/O buffer length. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pixbuf] Check for unsigned integer overflow on multiplicationMichael Brown2016-03-121-0/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Allow for zero-length ASN.1 cursorsMichael Brown2016-03-112-14/+14
| | | | | | | | | | | | | The assumption in asn1_type() that an ASN.1 cursor will always contain a type byte is incorrect. A cursor that has been cleanly invalidated via asn1_invalidate_cursor() will contain a type byte, but there are other ways in which to arrive at a zero-length cursor. Fix by explicitly checking the cursor length in asn1_type(). This allows asn1_invalidate_cursor() to be reduced to simply zeroing the length field. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tls] Avoid potential out-of-bound reads in length fieldsMichael Brown2016-03-111-44/+67
| | | | | | | | | | | | | | | | | | Many TLS records contain variable-length fields. We currently validate the overall record length, but do so only after reading the length of the variable-length field. If the record is too short to even contain the length field, then we may read uninitialised data from beyond the end of the record. This is harmless in practice (since the subsequent overall record length check would fail regardless of the value read from the uninitialised length field), but causes warnings from some analysis tools. Fix by validating that the overall record length is sufficient to contain the length field before reading from the length field. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Work around broken GetFontInfo() implementationsMichael Brown2016-03-101-16/+38
| | | | | | | | | | Several UEFI platforms are known to return EFI_NOT_FOUND when asked to retrieve the system default font information via GetFontInfo(). Work around these broken platforms by iterating over the glyphs to find the maximum height used by a printable character. Originally-fixed-by: Jonathan Dieter <jdieter@lesbg.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xsigo] Add support for Xsigo virtual Ethernet (XVE) EoIB devicesMichael Brown2016-03-095-0/+2269
| | | | | | | | | Add support for EoIB devices as implemented by Xsigo. Based on the public (but out-of-tree) Linux kernel drivers at https://oss.oracle.com/git/?p=linux-uek.git;a=log;h=v4.1.12-32.2.1 Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eoib] Support non-FullMember gateway devicesMichael Brown2016-03-092-2/+120
| | | | | | | | | | | | | Some EoIB implementations utilise an EoIB-to-Ethernet gateway device that does not perform a FullMember join to the multicast group for the EoIB broadcast domain. This has various exciting side-effects, such as requiring every EoIB node to send every broadcast packet twice. As an added bonus, the gateway may also break the EoIB MAC address to GID mapping protocol by sending Ethernet-sourced packets from the wrong QPN. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eoib] Allow the multicast group to be forcefully createdMichael Brown2016-03-092-2/+23
| | | | | | | | | | | | | Some EoIB implementations require each individual EoIB node to create the multicast group for the EoIB broadcast domain. It is left as an exercise for the interested reader to determine how such an implementation might ever allow the parameters of such a multicast group to be changed without requiring a simultaneous upgrade of every driver on every operating system on every machine currently attached to the fabric. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eoib] Silently ignore EoIB heartbeat packetsMichael Brown2016-03-091-0/+45
| | | | | | | | | | | Some EoIB implementations transmit a vendor-proprietary heartbeat packet on the same multicast group used to provide the EoIB broadcast domain. Silently ignore these heartbeat packets, to avoid cluttering up the network interface error statistics. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eoib] Add Ethernet over Infiniband (EoIB) driverMichael Brown2016-03-093-0/+815
| | | | | | | | | | | | | | | | | | | | EoIB is a fairly simple protocol in which raw Ethernet frames (excluding the CRC) are encapsulated within Infiniband Unreliable Datagrams, with a four-byte fixed EoIB header (which conveys no actual information). The Ethernet broadcast domain is provided by a multicast group, similar to the IPoIB IPv4 multicast group. The mapping from Ethernet MAC addresses to Infiniband address vectors is achieved by snooping incoming traffic and building a peer cache which can then be used to map a MAC address into a port GID. The address vector is completed using a path record lookup, as for IPoIB. Note that this requires every packet to include a GRH. Add basic support for EoIB devices. This driver is substantially derived from the IPoIB driver. There is currently no mechanism for automatically creating EoIB devices. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Make IPoIB support configurable at build timeMichael Brown2016-03-093-3/+13
| | | | | | | Add a build configuration option VNIC_IPOIB to control whether or not IPoIB support is included for Infiniband devices. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ifmgmt] Include human-readable error message for configuration failureMichael Brown2016-03-081-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>