david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

5795 Commits

Author SHA1 Message Date
Michael Brown cc8824ad4e [libc] Print "<NULL>" for wide-character NULL strings
The existing code intends to print NULL strings as "<NULL>" (for the
sake of debug messages), but the logic is incorrect when handling
wide-character strings.  Fix the logic and add applicable unit tests.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-04-12 11:53:06 +01:00
Michael Brown 320488d0f9 [test] Update snprintf_ok() to use okx()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-04-12 11:45:58 +01:00
Michael Brown 597521ef53 [qib7322] Validate payload length
There is no way for the hardware to give us an invalid length in the
LRH, since it must have parsed this length field in order to perform
header splitting.  However, this is difficult to prove conclusively.

Add an unnecessary length check to explicitly reject any packets
larger than the posted receive I/O buffer.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-30 07:31:51 +01:00
Michael Brown c9af896314 [linda] Validate payload length
There is no way for the hardware to give us an invalid length in the
LRH, since it must have parsed this length field in order to perform
header splitting.  However, this is difficult to prove conclusively.

Add an unnecessary length check to explicitly reject any packets
larger than the posted receive I/O buffer.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-30 07:27:09 +01:00
Michael Brown 70509e6a03 [netdevice] Return ENOENT for an unknown bus type
It is possible for the preloaded UNDI device to end up with no
specified bus type, since it may not be recognised as either a PCI or
an ISAPnP device.  This will result in a bus type value of zero, which
currently results in NULL being treated as a string pointer by
netdev_fetch_bustype().

Fix by returning ENOENT if an unknown bus type is specified.

Reported-by: Todd Stansell <todd@stansell.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-29 20:59:30 +01:00
Christian Nilsson ef1c4b1c90 [intel] Add PCI device ID for another I219-V
Signed-off-by: Christian Nilsson <nikize@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-29 19:53:20 +01:00
Michael Brown 97c3f6e55a [iscsi] Include DHCP server address in iBFT
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-29 19:38:18 +01:00
Michael Brown f8e1678b84 [crypto] Allow cross-certificate source to be configured at build time
Provide a build option CROSSCERT in config/crypto.h to allow the
default cross-signed certificate source to be configured at build
time.  The ${crosscert} setting may still be used to reconfigure the
cross-signed certificate source at runtime.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-24 19:25:03 +00:00
Michael Brown c4e8c40227 [prefix] Use CRC32 to verify each block prior to decompression
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-24 16:52:26 +00:00
Christian Hesse 05027a7a12 [golan] Fix build error on some versions of gcc
Some versions of gcc complain that "'__bswap_variable_32' is static
but used in inline function 'golan_check_rc_and_cmd_status' which is
not static".

Fix by making golan_check_rc_and_cmd_status() a static inline.

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-23 05:59:44 +00:00
Wissam Shoukair 0a20373a2f [golan] Add Connect-IB, ConnectX-4 and ConnectX-4 Lx (Infiniband) support
Signed-off-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22 17:55:55 +00:00
Michael Brown 3df598849b [pxe] Implicitly open network device in PXENV_UDP_OPEN
Some end-user configurations have been observed in which the first NBP
(such as GRUB2) uses the UNDI API and then transfers control to a
second NBP (such as pxelinux) which uses the UDP API.  The first NBP
closes the network device using PXENV_UNDI_CLOSE, which renders the
UDP API unable to transmit or receive packets.

The correct behaviour under these circumstances is (as often) simply
not documented by the PXE specification.  Testing with the Intel PXE
stack suggests that PXENV_UDP_OPEN will implicitly reopen the network
device if necessary, so match this behaviour.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22 17:33:21 +00:00
Michael Brown ee3122bc54 [libc] Make sleep() interruptible
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22 16:18:42 +00:00
Michael Brown 860d5904fb [arbel] Fix received packet length
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22 16:11:58 +00:00
Michael Brown 3ad028cf1c [hermon] Fix received packet length
Debugged-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22 16:09:18 +00:00
Michael Brown 59bae324c0 [etherfabric] Avoid use of sleep() in driver code
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22 15:19:25 +00:00
Michael Brown c640b954cd [3c5x9] Avoid use of sleep() in driver code
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22 15:14:07 +00:00
Michael Brown c32b07b81b [int13] Allow default drive to be specified via "san-drive" setting
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>
2016-03-22 09:55:09 +00:00
Michael Brown ab5b3abbba [int13] Allow drive to be hooked using the natural drive number
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>
2016-03-22 09:55:09 +00:00
Michael Brown 311a5732c8 [gdb] Add support for x86_64
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22 08:44:32 +00:00
Michael Brown 1afcccd5fd [build] Do not use "objcopy -O binary" for objects with relocation records
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>
2016-03-21 17:49:58 +00:00
Michael Brown 173c0c2536 [infiniband] Allow drivers to override the eIPoIB LEMAC
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-21 09:30:42 +00:00
Michael Brown 57c63047e3 [arbel] Allocate space for GRH on UD queue pairs
As with the previous commit (for Hermon), allocate a separate ring
buffer to hold received GRHs.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-21 08:55:02 +00:00
Michael Brown e84c917f39 [hermon] Allocate space for GRH on UD queue pairs
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>
2016-03-21 08:18:15 +00:00
Michael Brown 0141ea3a77 [crypto] Allow trusted certificates to be stored in non-volatile options
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>
2016-03-20 17:26:09 +00:00
Michael Brown 4a861cc61c [qib7322] Add missing iounmap()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-20 14:55:18 +00:00
Michael Brown bea9ee2397 [linda] Add missing iounmap()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-20 14:54:08 +00:00
Michael Brown 692324905e [arbel] Add missing iounmap()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-20 14:52:01 +00:00
Michael Brown e2cdbd51a8 [hermon] Add missing iounmap()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-20 14:46:40 +00:00
Michael Brown 750a2efeb2 [ipoib] Allow external code to identify IPoIB network devices
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-20 09:22:55 +00:00
Michael Brown ef0297b527 [libc] Allow container_of() to be used on volatile pointers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-18 08:18:31 +00:00
Michael Brown 04ef198d2f [efi] Move architecture-independent EFI prefixes to interface/efi
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-17 14:51:14 +00:00
Michael Brown dbc9e591a5 [test] Move i386-specific tests to arch/i386/tests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-17 14:32:00 +00:00
Michael Brown c14971bf88 [xen] Use generic test_and_clear_bit() function
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-16 22:46:05 +00:00
Michael Brown 9bab13a772 [hyperv] Use generic set_bit() function
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-16 22:33:41 +00:00
Michael Brown c867b5ab1f [bitops] Add generic atomic bit test, set, and clear functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-16 22:33:40 +00:00
Michael Brown 2246a6b274 [pseudobit] Rename bitops.h to pseudobit.h
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-16 17:03:33 +00:00
Michael Brown 36fbc3f4bd [build] Remove long-obsolete header file
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-16 16:53:16 +00:00
Michael Brown 9913a405ea [efi] Provide access to files stored on EFI filesystems
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>
2016-03-14 21:11:01 +00:00
Michael Brown 75496817c2 [uri] Support "file:" URIs describing relative paths
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-14 18:03:13 +00:00
Michael Brown 17c1488a44 [uri] Support URIs containing only scheme and path components
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-13 14:51:15 +00:00
Michael Brown 11ccfb67fa [efi] Add processor binding headers for ARM and AArch64
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-13 11:54:33 +00:00
Michael Brown 24415a3eee [efi] Update to current EDK2 headers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-13 11:47:30 +00:00
Michael Brown 0d29cf2a4d [build] Accept CROSS= as a synonym for CROSS_COMPILE=
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-13 11:32:54 +00:00
Michael Brown 1f65ed53da [build] Allow assembler section type character to vary by architecture
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>
2016-03-13 11:20:53 +00:00
Michael Brown a8037ee131 [efi] Centralise architecture-independent EFI Makefile and linker script
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-12 21:47:13 +00:00
Michael Brown 86f96a40f4 [tg3] Remove x86-specific inline assembly
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-12 21:15:43 +00:00
Michael Brown 7e78cdddc8 [3c595] Fix compilation when "char" is unsigned by default
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-12 18:06:47 +00:00
Michael Brown 3c84178003 [serial] Add missing #include <string.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-12 18:02:20 +00:00
Michael Brown 9eff4284bd [test] Add missing #include <string.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-12 17:55:38 +00:00