]> git.ipfire.org Git - thirdparty/ipxe.git/log
thirdparty/ipxe.git
13 years ago[contrib] Fix rom-o-matic git version number issues
Floris Bos [Mon, 23 Jul 2012 13:09:21 +0000 (15:09 +0200)] 
[contrib] Fix rom-o-matic git version number issues

Fixes issue in which git version number is not displayed on startup
when iPXE is built through rom-o-matic.

Remove special characters from filename generated by rom-o-matic (so
that you get "ipxe-1.0.0+c3b4-undionly.kkpxe" instead of
"ipxe-1.0.0+ (c3b4)-undionly.kkpxe")

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[contrib] Fix rom-o-matic build (add new LOG_LEVEL constant)
Floris Bos [Mon, 23 Jul 2012 00:39:44 +0000 (02:39 +0200)] 
[contrib] Fix rom-o-matic build (add new LOG_LEVEL constant)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[epic100] Fix wrong field used as rx packet length
Alexey [Thu, 24 May 2012 19:41:40 +0000 (22:41 +0300)] 
[epic100] Fix wrong field used as rx packet length

Datasheet pp. 41-42 defines 'rx packet length' as upper word of
'status' dword field of the receive descriptor table.

  http://www.smsc.com/media/Downloads_Archive/discontinued/83c171.pdf

Tested on SMC EtherPower II.

Signed-off-by: Alexey Smazhenko <darkover@corbina.com.ua>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[legal] Update FSF mailing address in GPL licence texts
Michael Brown [Fri, 20 Jul 2012 18:55:45 +0000 (19:55 +0100)] 
[legal] Update FSF mailing address in GPL licence texts

Suggested-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[qib7322] Fix compiler warning on gcc 4.7
Michael Brown [Fri, 20 Jul 2012 18:18:50 +0000 (19:18 +0100)] 
[qib7322] Fix compiler warning on gcc 4.7

Originally-fixed-by: Christian Hesse <list@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[isa] Avoid spurious compiler warning on gcc 4.7
Michael Brown [Fri, 20 Jul 2012 17:32:58 +0000 (18:32 +0100)] 
[isa] Avoid spurious compiler warning on gcc 4.7

gcc 4.7 produces a spurious warning about an array subscript being out
of bounds.  Use a pointer dereference instead of an array lookup to
inhibit this spurious warning.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[build] Include git commit within version string when available
Michael Brown [Fri, 20 Jul 2012 17:06:15 +0000 (18:06 +0100)] 
[build] Include git commit within version string when available

Originally-implemented-by: Christian Hesse <list@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[image] Automatically free autobooted images
Michael Brown [Fri, 20 Jul 2012 11:37:16 +0000 (12:37 +0100)] 
[image] Automatically free autobooted images

Simplify the process of booting by ensuring that old images are not
left registered after an unsuccessful autoboot attempt.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[image] Add "--replace" option
Michael Brown [Fri, 20 Jul 2012 11:36:41 +0000 (12:36 +0100)] 
[image] Add "--replace" option

Expose image tail-recursion to iPXE scripts via the "--replace"
option.  This functions similarly to exec() under Unix: the
currently-executing script is replaced with the new image (as opposed
to running the new image as a subroutine).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[image] Add "--autofree" option
Michael Brown [Fri, 20 Jul 2012 09:37:24 +0000 (10:37 +0100)] 
[image] Add "--autofree" option

Allow images to be automatically freed after execution completes
(successfully or otherwise).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[libc] Add missing wchar.h header
Michael Brown [Thu, 19 Jul 2012 16:19:26 +0000 (17:19 +0100)] 
[libc] Add missing wchar.h header

Commit 58ed3b1 ("[libc] Add support for "%lc" and "%ls" format
specifiers") was missing a file.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[skel] Add missing iounmap()
Michael Brown [Thu, 19 Jul 2012 16:10:28 +0000 (17:10 +0100)] 
[skel] Add missing iounmap()

Reported-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[myson] Add missing iounmap()
Michael Brown [Thu, 19 Jul 2012 16:10:28 +0000 (17:10 +0100)] 
[myson] Add missing iounmap()

Reported-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[natsemi] Add missing iounmap()
Michael Brown [Thu, 19 Jul 2012 16:10:28 +0000 (17:10 +0100)] 
[natsemi] Add missing iounmap()

Reported-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[realtek] Add missing iounmap()
Michael Brown [Thu, 19 Jul 2012 16:10:28 +0000 (17:10 +0100)] 
[realtek] Add missing iounmap()

Reported-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[intel] Add missing iounmap()
Michael Brown [Thu, 19 Jul 2012 16:10:28 +0000 (17:10 +0100)] 
[intel] Add missing iounmap()

Reported-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[libc] Add support for "%lc" and "%ls" format specifiers
Michael Brown [Thu, 19 Jul 2012 12:57:17 +0000 (13:57 +0100)] 
[libc] Add support for "%lc" and "%ls" format specifiers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[efi] Add EFI_LOAD_FILE_PROTOCOL header
Michael Brown [Thu, 19 Jul 2012 09:21:50 +0000 (10:21 +0100)] 
[efi] Add EFI_LOAD_FILE_PROTOCOL header

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[efi] Update to current EDK2 headers
Michael Brown [Thu, 19 Jul 2012 09:19:55 +0000 (10:19 +0100)] 
[efi] Update to current EDK2 headers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[efi] Standardise #include guard in ipxe_download.h
Michael Brown [Thu, 19 Jul 2012 09:08:50 +0000 (10:08 +0100)] 
[efi] Standardise #include guard in ipxe_download.h

The script include/ipxe/efi/import.pl relies on a particular format
for the #include guard in order to detect EFI headers that are not
imported.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[pxeprefix] Ignore errors from PXENV_FILE_CMDLINE
Michael Brown [Wed, 18 Jul 2012 17:18:28 +0000 (18:18 +0100)] 
[pxeprefix] Ignore errors from PXENV_FILE_CMDLINE

PXENV_FILE_CMDLINE is an iPXE extension, and will not be supported by
most PXE stacks.  Do not report any errors to the user, since in
almost all cases the error will mean simply "not loaded by iPXE".

Reported-by: Patrick Domack <patrickdk@patrickdk.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[efi] Default to using raw x86 I/O
Michael Brown [Tue, 17 Jul 2012 20:28:24 +0000 (21:28 +0100)] 
[efi] Default to using raw x86 I/O

The EFI_CPU_IO_PROTOCOL is not available on all EFI platforms.  In
particular, it is not available under OVMF, as used for qemu.

Since the EFI_CPU_IO_PROTOCOL is an abomination of unnecessary
complexity, banish it and use raw I/O instead.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[ioapi] Generalise i386 raw I/O API to x86
Michael Brown [Tue, 17 Jul 2012 19:53:25 +0000 (20:53 +0100)] 
[ioapi] Generalise i386 raw I/O API to x86

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[b44] Eliminate call to get_memmap()
Michael Brown [Tue, 17 Jul 2012 20:20:50 +0000 (21:20 +0100)] 
[b44] Eliminate call to get_memmap()

get_memmap() is not available under all runtime environments.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[pxe] Reopen network device if NBP exits
Michael Brown [Thu, 12 Jul 2012 15:04:41 +0000 (16:04 +0100)] 
[pxe] Reopen network device if NBP exits

Attempt to restore the network device to the state it was in prior to
calling the NBP.  This simplifies the task of taking follow-up action
in an iPXE script.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[settings] Expose exit status of failed command via ${errno}
Michael Brown [Thu, 12 Jul 2012 14:28:37 +0000 (15:28 +0100)] 
[settings] Expose exit status of failed command via ${errno}

Allow scripts to report errors in more detail by exposing the most
recent error via the ${errno} setting.  For example:

    chain ${filename} || goto failed
    ...
    :failed
    imgfree http://192.168.0.1/ipxe_error.php?error=${errno}

Note that ${errno} is valid only immediately after executing a failed
command.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[cmdline] Store exit status of failed command in errno
Michael Brown [Thu, 12 Jul 2012 14:28:09 +0000 (15:28 +0100)] 
[cmdline] Store exit status of failed command in errno

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[pxeprefix] Fetch command line (if any) via PXENV_FILE_CMDLINE
Michael Brown [Wed, 11 Jul 2012 20:26:53 +0000 (21:26 +0100)] 
[pxeprefix] Fetch command line (if any) via PXENV_FILE_CMDLINE

Use PXENV_FILE_CMDLINE to retrieve the command line (if any) provided
by the invoking PXE stack.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[pxe] Add PXENV_FILE_CMDLINE API call
Michael Brown [Wed, 11 Jul 2012 17:16:13 +0000 (18:16 +0100)] 
[pxe] Add PXENV_FILE_CMDLINE API call

Allow a PXE NBP to obtain its command line (if any) via the new PXE
API call PXENV_FILE_CMDLINE.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[pxeprefix] Place temporary stack after iPXE binary
Michael Brown [Tue, 10 Jul 2012 15:10:49 +0000 (16:10 +0100)] 
[pxeprefix] Place temporary stack after iPXE binary

Some BIOSes (observed on a Supermicro system with an AMI BIOS) seem to
use the area immediately below 0x7c00 to store data related to the
boot process.  This data is currently liable to be overwritten by the
temporary stack used while decompressing and installing iPXE.

Try to avoid any such problems by placing the temporary stack
immediately after the loaded iPXE binary.  Any memory used by the
stack could then potentially have been overwritten anyway by a larger
binary.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[intel] Explicitly enable descriptor queues
Michael Brown [Tue, 10 Jul 2012 09:52:56 +0000 (10:52 +0100)] 
[intel] Explicitly enable descriptor queues

On i350 the datasheet contradicts itself in stating that the default
value of RXDCTL.ENABLE for queue zero is both set (according to the
"Receive Initialization" section) and unset (according to the "Receive
Descriptor Control - RXDCTL" section).  Empirical evidence suggests
that the default value is unset.

Explicitly enable both transmit and receive queues to avoid any
ambiguity.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[intel] Refill receive ring only after enabling receiver
Michael Brown [Tue, 10 Jul 2012 08:32:58 +0000 (09:32 +0100)] 
[intel] Refill receive ring only after enabling receiver

On 82576 (and probably others), the datasheet states that "the tail
register of the queue (RDT[n]) should not be bumped until the queue is
enabled".  There is some confusion over exactly what constitutes
"enabled": the initialisation blurb says that we should "poll the
RXDCTL register until the ENABLE bit is set", while the description
for the RXDCTL register says that the ENABLE bit is set by default
(for queue zero).  Empirical evidence suggests that the ENABLE bit
reads as set immediately after writing to RCTL.EN, and so polling is
not necessary.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[bzimage] Update setup_move_size only for protocol versions 2.00 and 2.01
Michael Brown [Mon, 9 Jul 2012 19:26:40 +0000 (20:26 +0100)] 
[bzimage] Update setup_move_size only for protocol versions 2.00 and 2.01

The setup_move_size field is not defined in protocol versions earlier
than 2.00 (and is obsolete in versions later than 2.01).  In binaries
using versions earlier than 2.00, the relevant location is likely to
contain executable code.

Interestingly, this bug has been present since support for pre-2.00
protocol versions was added in 2009, and has been unexpectedly
modifying the memtest86+ code fragment:

mov $0x92, %dx
inb %dx, %al

Fortuitously, the modification exactly overwrote the value loaded into
%dx, and so the net effect was limited to causing Fast Gate A20
detection to always fail.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[tcp] Increase maximum window size to 256kB
Michael Brown [Sun, 8 Jul 2012 16:54:07 +0000 (17:54 +0100)] 
[tcp] Increase maximum window size to 256kB

A window size of 256kB should be sufficient to allow for
full-bandwidth transfers over a Gigabit LAN, and for acceptable
transfer speeds over other typical links.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[malloc] Increase heap size to 512kB
Michael Brown [Sun, 8 Jul 2012 16:20:25 +0000 (17:20 +0100)] 
[malloc] Increase heap size to 512kB

The maximum TCP throughput is fundamentally limited by the amount of
available receive buffer space.  Increase the heap size from 128kB to
512kB to allow the use of larger TCP windows.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[tcp] Truncate TCP window to prevent future packet discards
Michael Brown [Sun, 8 Jul 2012 15:51:21 +0000 (16:51 +0100)] 
[tcp] Truncate TCP window to prevent future packet discards

Whenever memory pressure causes a queued packet to be discarded (and
so retransmitted), reduce the maximum TCP window to a size that would
have prevented the discard.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[arp] Try to avoid discarding ARP cache entries
Michael Brown [Mon, 9 Jul 2012 08:55:26 +0000 (09:55 +0100)] 
[arp] Try to avoid discarding ARP cache entries

Discarding the active ARP cache entry in the middle of a download will
substantially disrupt the TCP stream.  Try to minimise any such
disruption by treating ARP cache entries as expensive, and discarding
them only when nothing else is available to discard.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[malloc] Discard cached items less aggressively
Michael Brown [Mon, 9 Jul 2012 08:54:24 +0000 (09:54 +0100)] 
[malloc] Discard cached items less aggressively

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[iobuf] Allocate I/O buffer descriptor separately to conserve aligned memory
Michael Brown [Sun, 8 Jul 2012 16:14:08 +0000 (17:14 +0100)] 
[iobuf] Allocate I/O buffer descriptor separately to conserve aligned memory

I/O buffers are allocated on aligned boundaries.  The I/O buffer
descriptor (the struct io_buffer) is currently attached to the end of
the I/O buffer.  When the size of the buffer is close to its
alignment, this can waste large amounts of aligned memory.

For example, a network card using 2048-byte receive buffers will end
up allocating 2072 bytes on a 2048-byte boundary.  This effectively
wastes 50% of the available memory.

Improve the situation by allocating the descriptor separately from the
main I/O buffer if inline allocation would cause the total allocated
size to cross the alignment boundary.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[netdevice] Process all received packets in net_poll()
Michael Brown [Sun, 1 Jul 2012 21:47:06 +0000 (22:47 +0100)] 
[netdevice] Process all received packets in net_poll()

The current logic is to process at most one received packet per call
to net_poll(), on the basis that refilling the hardware descriptor
ring should be delayed as little as possible.  However, this limits
the rate at which packets can be processed and ultimately ends up
adding latency which, in turn, limits the achievable throughput.

With temporary modifications in place to essentially remove all
resource constraints (heap size increased to 16MB, RX descriptor ring
increased to 64 descriptors) and a TCP window size of 1MB, the
throughput on a gigabit (i.e. 119MBps) network can be observed to fall
off exponentially from around 115MBps to around 75MBps.  Changing
net_poll() to process all received packets results in a steady
119MBps throughput.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[cmdline] Do not ignore empty initial arguments in concat_args()
Michael Brown [Wed, 4 Jul 2012 12:37:08 +0000 (13:37 +0100)] 
[cmdline] Do not ignore empty initial arguments in concat_args()

Reported-by: Oliver Rath <rath@mglug.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[util] Avoid compiler warning on gcc 4.6
Michael Brown [Tue, 3 Jul 2012 17:47:50 +0000 (18:47 +0100)] 
[util] Avoid compiler warning on gcc 4.6

Commit 196751c ("[build] Enable warnings when building utilities")
revealed a previously hidden compiler warning in util/nrv2b.c
regarding an out-of-bounds array subscript in the code

    #if defined(SWD_BEST_OFF)
        if (s->best_pos[2] == 0)
            s->best_pos[2] = key + 1;
    #endif

where best_pos[] is defined by

    #define SWD_BEST_OFF 1

    #if defined(SWD_BEST_OFF)
        unsigned int best_off[ SWD_BEST_OFF ];
        unsigned int best_pos[ SWD_BEST_OFF ];
    #endif

With SWD_BEST_OFF set to 1, it can be proven that all code paths
referring to s->best_off[] and s->best_pos[] will never be executed,
with the exception of the two lines above.  Since these two lines
alone can have no effect on execution, we can safely undefine
SWD_BEST_OFF.

Verified by comparing md5sums of bin/undionly.kpxe before and after
the change.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[menu] Truncate menu title when necessary
Christian Hesse [Tue, 3 Jul 2012 13:12:47 +0000 (14:12 +0100)] 
[menu] Truncate menu title when necessary

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[arp] Prevent ARP cache entries from being deleted mid-transmission
Michael Brown [Sun, 1 Jul 2012 17:24:15 +0000 (18:24 +0100)] 
[arp] Prevent ARP cache entries from being deleted mid-transmission

Each ARP cache entry maintains a transmission queue, which is sent out
as soon as the link-layer address is known.  If multiple packets are
queued, then it is possible for memory pressure to cause the ARP cache
discarder to be invoked during transmission of the first packet, which
may cause the ARP cache entry to be deleted before the second packet
can be sent.  This results in an invalid pointer dereference.

Avoid this problem by reference-counting ARP cache entries and
ensuring that an extra reference is held while processing the
transmission queue, and by using list_first_entry() rather than
list_for_each_entry_safe() to traverse the queue.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[tcp] Avoid potential NULL pointer dereference
Michael Brown [Sat, 30 Jun 2012 18:02:36 +0000 (19:02 +0100)] 
[tcp] Avoid potential NULL pointer dereference

Commit ea61075 ("[tcp] Add support for TCP window scaling") introduced
a potential NULL pointer dereference by referring to the connection's
send window scale before checking whether or not the connection is
known.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[tcp] Use a zero window size for RST packets
Michael Brown [Sat, 30 Jun 2012 17:59:09 +0000 (18:59 +0100)] 
[tcp] Use a zero window size for RST packets

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[iobuf] Relax alignment requirement for small I/O buffers
Michael Brown [Fri, 29 Jun 2012 15:07:12 +0000 (16:07 +0100)] 
[iobuf] Relax alignment requirement for small I/O buffers

iPXE currently aligns all I/O buffers on a 2kB boundary.  This is
overkill for transmitted packets, which are typically much smaller
than 2kB.

Align I/O buffers on their own size.  This reduces the alignment
requirement for small buffers, while preserving the guarantee that I/O
buffers will never cross boundaries that might cause problems for some
DMA engines.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[tls] Request a maximum fragment length of 2048 bytes
Michael Brown [Fri, 29 Jun 2012 14:28:15 +0000 (15:28 +0100)] 
[tls] Request a maximum fragment length of 2048 bytes

The default maximum plaintext fragment length for TLS is 16kB, which
is a substantial amount of memory for iPXE to have to allocate for a
temporary decryption buffer.

Reduce the memory footprint of TLS connections by requesting a maximum
fragment length of 2kB.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[tcp] Add support for TCP window scaling
Michael Brown [Fri, 29 Jun 2012 13:30:18 +0000 (14:30 +0100)] 
[tcp] Add support for TCP window scaling

The maximum unscaled TCP window (64kB) implies a maximum bandwidth of
around 300kB/s on a WAN link with an RTT of 200ms.  Add support for
the TCP window scaling option to remove this upper limit.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[undi] Align the received frame payload for faster processing
Michael Brown [Fri, 29 Jun 2012 00:03:38 +0000 (01:03 +0100)] 
[undi] Align the received frame payload for faster processing

The undinet driver always has to make a copy of the received frame
into an I/O buffer.  Align this copy sensibly so that subsequent
operations are as fast as possible.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[monojob] Check for keypresses only once per timer tick
Michael Brown [Thu, 28 Jun 2012 11:27:43 +0000 (12:27 +0100)] 
[monojob] Check for keypresses only once per timer tick

Checking for keypresses takes a non-negligible amount of time, and
measurably affects our RTT.  Minimise the impact by checking for
keypresses only once per timer tick.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[tcpip] Add faster algorithm for calculating the TCP/IP checksum
Michael Brown [Tue, 26 Jun 2012 16:19:18 +0000 (17:19 +0100)] 
[tcpip] Add faster algorithm for calculating the TCP/IP checksum

The generic TCP/IP checksum implementation requires approximately 10
CPU clocks per byte (as measured using the TSC).  Improve this to
approximately 0.5 CPU clocks per byte by using "lodsl ; adcl" in an
unrolled loop.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[test] Add self-tests for TCP/IP checksum calculation
Michael Brown [Tue, 26 Jun 2012 13:49:26 +0000 (14:49 +0100)] 
[test] Add self-tests for TCP/IP checksum calculation

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[tcpip] Allow for architecture-specific TCP/IP checksum routines
Michael Brown [Wed, 27 Jun 2012 11:02:58 +0000 (12:02 +0100)] 
[tcpip] Allow for architecture-specific TCP/IP checksum routines

Calculating the TCP/IP checksum on received packets accounts for a
substantial fraction of the response latency.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[libc] Simplify memcpy() implementation
Michael Brown [Tue, 26 Jun 2012 11:42:24 +0000 (12:42 +0100)] 
[libc] Simplify memcpy() implementation

The "rep" prefix can be used with an iteration count of zero, which
allows the variable-length memcpy() to be implemented without using
any conditional jumps.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[test] Add memcpy() self-tests
Michael Brown [Tue, 26 Jun 2012 11:42:19 +0000 (12:42 +0100)] 
[test] Add memcpy() self-tests

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[cmdline] Increase resolution of "time" command
Michael Brown [Tue, 26 Jun 2012 11:42:06 +0000 (12:42 +0100)] 
[cmdline] Increase resolution of "time" command

A reasonably large (512MB) file transferred via HTTP over Gigabit
Ethernet should complete in around 4.6 seconds.  Increase the
resolution of the "time" command to tenths of a second, to allow such
transfers to be meaningfully measured.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[realtek] Add missing cpu_to_le16()
Michael Brown [Thu, 14 Jun 2012 11:54:04 +0000 (12:54 +0100)] 
[realtek] Add missing cpu_to_le16()

Reported-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[ui] Allow colours to be configured via config/colour.h
Christian Hesse [Wed, 27 Jun 2012 17:39:46 +0000 (18:39 +0100)] 
[ui] Allow colours to be configured via config/colour.h

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[ui] Change "login" colours to match other UIs
Michael Brown [Wed, 27 Jun 2012 17:01:33 +0000 (18:01 +0100)] 
[ui] Change "login" colours to match other UIs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[sky2] Fix invalid memory access
Valentine Barshak [Sat, 2 Jun 2012 13:38:00 +0000 (17:38 +0400)] 
[sky2] Fix invalid memory access

Use hw pointer in PCI driver data as expected by sky2_remove().

Signed-off-by: Valentine Barshak <gvaxon@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[syslog] Include hostname within syslog messages where possible
Michael Brown [Wed, 20 Jun 2012 13:39:33 +0000 (14:39 +0100)] 
[syslog] Include hostname within syslog messages where possible

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[settings] Move "domain" setting from dns.c to settings.c
Michael Brown [Wed, 20 Jun 2012 13:38:22 +0000 (14:38 +0100)] 
[settings] Move "domain" setting from dns.c to settings.c

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[crypto] Allow an error margin on X.509 certificate validity periods
Michael Brown [Wed, 20 Jun 2012 11:15:42 +0000 (12:15 +0100)] 
[crypto] Allow an error margin on X.509 certificate validity periods

iPXE has no concept of the local time zone, mainly because there is no
viable way to obtain time zone information in the absence of local
state.  This causes potential problems with newly-issued certificates
and certificates that are about to expire.

Avoid such problems by allowing an error margin of around 12 hours on
certificate validity periods, similar to the error margin already
allowed for OCSP response timestamps.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[dhcp] Request broadcast responses when we already have an IPv4 address
Michael Brown [Wed, 20 Jun 2012 10:56:43 +0000 (11:56 +0100)] 
[dhcp] Request broadcast responses when we already have an IPv4 address

FCoE requires the use of multiple local unicast link-layer addresses.
To avoid the complexity of managing multiple addresses, iPXE operates
in promiscuous mode.  As a consequence, any unicast packets with
non-matching IPv4 addresses are rejected at the IPv4 layer (rather
than at the link layer).

This can cause problems when issuing a second DHCP request: if the
address chosen by the DHCP server does not match the existing address,
then the DHCP response will itself be rejected.

Fix by requesting a broadcast response from the DHCP server if the
network interface already has any IPv4 addresses.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[romprefix] Treat 0xffffffff as an error return from PMM
Michael Brown [Tue, 19 Jun 2012 17:54:22 +0000 (18:54 +0100)] 
[romprefix] Treat 0xffffffff as an error return from PMM

PMM defines the return code 0xffffffff as meaning "unsupported
function".  It's hard to imagine a PMM BIOS that doesn't support
pmmAllocate(), but apparently such things do exist.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[util] Update mergerom.pl to handle .mrom images
Michael Brown [Mon, 11 Jun 2012 18:27:23 +0000 (19:27 +0100)] 
[util] Update mergerom.pl to handle .mrom images

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[romprefix] Allow .mrom image to be placed anywhere within the BAR
Michael Brown [Sun, 10 Jun 2012 18:01:20 +0000 (19:01 +0100)] 
[romprefix] Allow .mrom image to be placed anywhere within the BAR

A .mrom image currently assumes that it is the first image within the
expansion ROM BAR, which may not be correct when multiple images are
present.

Fix by scanning through the BAR until we locate an image matching our
build ID.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[romprefix] Add a dummy ROM header to cover the .mrom payload
Michael Brown [Sun, 10 Jun 2012 17:25:26 +0000 (18:25 +0100)] 
[romprefix] Add a dummy ROM header to cover the .mrom payload

The header of a .mrom image declares its length to be only a few
kilobytes; the remainder is accessed via a sideband mechanism.  This
makes it difficult to append an additional ROM image, such as an EFI
ROM.

Add a second, dummy ROM header covering the payload portion of the
.mrom image, allowing consumers to locate any appended ROM images in
the usual way.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[util] Rewrite catrom.pl to use Option::ROM library
Michael Brown [Mon, 11 Jun 2012 00:42:33 +0000 (01:42 +0100)] 
[util] Rewrite catrom.pl to use Option::ROM library

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[util] Allow Option::ROM to access multiple ROM images
Michael Brown [Sun, 10 Jun 2012 17:23:24 +0000 (18:23 +0100)] 
[util] Allow Option::ROM to access multiple ROM images

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[cmdline] Use "cpuid --ext" instead of "cpuid --amd"
Michael Brown [Tue, 12 Jun 2012 10:32:24 +0000 (11:32 +0100)] 
[cmdline] Use "cpuid --ext" instead of "cpuid --amd"

Avoid potential confusion in the documentation by using a
vendor-neutral name for the extended (AMD-defined) feature set.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[cmdline] Add "sync" command
Michael Brown [Sat, 9 Jun 2012 18:00:04 +0000 (19:00 +0100)] 
[cmdline] Add "sync" command

Add "sync" command (loosely based on the Unix "sync"), which will wait
for any pending operations to complete.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[tls] Mark security negotiation as a pending operation
Michael Brown [Sat, 9 Jun 2012 17:58:54 +0000 (18:58 +0100)] 
[tls] Mark security negotiation as a pending operation

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[tcp] Mark any unacknowledged transmission as a pending operation
Michael Brown [Sat, 9 Jun 2012 17:56:07 +0000 (18:56 +0100)] 
[tcp] Mark any unacknowledged transmission as a pending operation

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[pending] Add concept of "pending operations"
Michael Brown [Sat, 9 Jun 2012 17:48:09 +0000 (18:48 +0100)] 
[pending] Add concept of "pending operations"

iPXE is fundamentally asynchronous in operation: some operations
continue in the background even after the foreground has continued to
a new task.  For example, the closing FIN/ACK exchanges of a TCP
connection will take place in the background after an HTTP download
has completed.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[cmdline] Add "cpuid" command
Michael Brown [Wed, 6 Jun 2012 15:08:24 +0000 (16:08 +0100)] 
[cmdline] Add "cpuid" command

Allow x86 CPU feature flags (such as support for 64-bit mode) to be
checked using the "cpuid" command.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[contrib] Update bochsrc.txt to latest version of bochs
Michael Brown [Wed, 6 Jun 2012 19:37:53 +0000 (20:37 +0100)] 
[contrib] Update bochsrc.txt to latest version of bochs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[build] Merge i386 and x86_64 versions of errfile.h
Michael Brown [Wed, 6 Jun 2012 14:21:34 +0000 (15:21 +0100)] 
[build] Merge i386 and x86_64 versions of errfile.h

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[crypto] Fix unused-but-set variable warning
Michael Brown [Wed, 23 May 2012 22:48:12 +0000 (23:48 +0100)] 
[crypto] Fix unused-but-set variable warning

Reported-by: Brandon Penglase <bpenglase-ipxe@spaceservices.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[http] Add support for Digest authentication
Michael Brown [Tue, 22 May 2012 22:10:59 +0000 (23:10 +0100)] 
[http] Add support for Digest authentication

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[http] Provide credentials only when requested by server
Michael Brown [Tue, 22 May 2012 11:32:28 +0000 (12:32 +0100)] 
[http] Provide credentials only when requested by server

Provide HTTP Basic authentication credentials only in response to a
401 Unauthorized response from the server.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[http] Split construction of Authorization header out of http_step()
Michael Brown [Tue, 22 May 2012 13:14:35 +0000 (14:14 +0100)] 
[http] Split construction of Authorization header out of http_step()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[http] Defer processing response code until after receiving all headers
Michael Brown [Tue, 22 May 2012 11:23:34 +0000 (12:23 +0100)] 
[http] Defer processing response code until after receiving all headers

Some headers can modify the meaning of the response code.  For
example, a WWW-Authenticate header can change the interpretation of a
401 Unauthorized response from "Access denied" to "Please
authenticate".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[http] Reopen connections when server does not keep connection alive
Michael Brown [Tue, 22 May 2012 10:17:50 +0000 (11:17 +0100)] 
[http] Reopen connections when server does not keep connection alive

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[crypto] Rename KEY= to PRIVKEY= and "key" to "privkey"
Michael Brown [Tue, 22 May 2012 00:09:34 +0000 (01:09 +0100)] 
[crypto] Rename KEY= to PRIVKEY= and "key" to "privkey"

The setting name "key" conflicts with the setting name "key" already
in use by the 802.11 code.  Resolve the conflict by renaming the newer
setting to "privkey".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[crypto] Require OCSP check if certificate provides an OCSP URI
Michael Brown [Mon, 21 May 2012 23:53:44 +0000 (00:53 +0100)] 
[crypto] Require OCSP check if certificate provides an OCSP URI

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[crypto] Automatically perform OCSP checks when applicable
Michael Brown [Sun, 20 May 2012 15:46:00 +0000 (16:46 +0100)] 
[crypto] Automatically perform OCSP checks when applicable

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[image] Allow "imgtrust" to automatically download cross-signed certificates
Michael Brown [Mon, 21 May 2012 23:45:31 +0000 (00:45 +0100)] 
[image] Allow "imgtrust" to automatically download cross-signed certificates

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[monojob] Allow monojob to be completely silent
Michael Brown [Mon, 21 May 2012 23:44:49 +0000 (00:44 +0100)] 
[monojob] Allow monojob to be completely silent

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[crypto] Construct OCSP check URI
Michael Brown [Sun, 20 May 2012 14:54:03 +0000 (15:54 +0100)] 
[crypto] Construct OCSP check URI

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[crypto] Fix margin of error for OCSP checks
Michael Brown [Mon, 21 May 2012 22:00:46 +0000 (23:00 +0100)] 
[crypto] Fix margin of error for OCSP checks

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[crypto] Return a NULL OCSP check if construction fails
Michael Brown [Mon, 21 May 2012 22:01:29 +0000 (23:01 +0100)] 
[crypto] Return a NULL OCSP check if construction fails

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[crypto] Return a NULL X.509 certificate if construction fails
Michael Brown [Mon, 21 May 2012 22:00:08 +0000 (23:00 +0100)] 
[crypto] Return a NULL X.509 certificate if construction fails

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[crypto] Accept UTCTime/GeneralizedTime with no "seconds" field
Michael Brown [Mon, 21 May 2012 22:20:03 +0000 (23:20 +0100)] 
[crypto] Accept UTCTime/GeneralizedTime with no "seconds" field

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[test] Add self-tests for base64
Michael Brown [Sun, 20 May 2012 16:10:23 +0000 (17:10 +0100)] 
[test] Add self-tests for base64

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[base64] Avoid overrunning input data buffer
Michael Brown [Sun, 20 May 2012 15:38:57 +0000 (16:38 +0100)] 
[base64] Avoid overrunning input data buffer

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[efi] Work around platforms which choke on EFI_PCI_DEVICE_ENABLE
Michael Brown [Wed, 16 May 2012 18:04:33 +0000 (19:04 +0100)] 
[efi] Work around platforms which choke on EFI_PCI_DEVICE_ENABLE

EFI_PCI_DEVICE_ENABLE is a list of the standard attributes that must
be enabled for a PCI device to function: I/O cycles, memory cycles,
and bus-mastering.  We currently call EFI_PCI_IO_PROTOCOL::Attribute()
with the parameter EFI_PCI_DEVICE_ENABLE to enable a PCI device.  This
should translate to a single write to PCI configuration space.

Simplicity is not a virtue within the UEFI world.  Some platforms will
'helpfully' report an error if EFI_PCI_DEVICE_ENABLE is used on a
device that doesn't actually support all three of the relevant
attributes.  For example, if a PCI device provides only memory-mapped
accesses (and so hardwires the I/O enable bit to zero), then using
EFI_PCI_DEVICE_ENABLE on such a platform will result in an
EFI_UNSUPPORTED error.

There is no plausible use case in which it is useful for the platform
to return an error in this way, and doing so makes it impossible to
distinguish genuine errors from noise.

Work around this broken behaviour by attempting to enable the three
attributes individually, and ignoring any errors.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[iscsi] Report SCSI response only when applicable
Michael Brown [Wed, 16 May 2012 09:50:56 +0000 (10:50 +0100)] 
[iscsi] Report SCSI response only when applicable

iSCSI generally includes a full SCSI response only when an error
occurs.  iscsi_scsi_done() currently passes the NULL response through
to scsi_response(), which ends up causing scsicmd_response() to
dereference a NULL pointer.

Fix by calling scsi_response() only if we have a non-NULL response.

Reported-by: Brendon Walsh <brendonwalsh@niamu.com>
Tested-by: Brendon Walsh <brendonwalsh@niamu.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
13 years ago[test] Add self-tests for OCSP
Michael Brown [Mon, 14 May 2012 17:25:00 +0000 (18:25 +0100)] 
[test] Add self-tests for OCSP

Add self-tests for OCSP using test vectors generated with the openssl
tools.

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