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

2711 Commits

Author SHA1 Message Date
Michael Brown 621101c36a [romprefix] Further sanity checks for the PCI 3 runtime segment address
This extends the sanity checks on the runtime segment address provided
in %bx, first implemented in commit 5600955.

We now allow the ROM to be placed anywhere above a000:0000 (rather
than c000:0000, as before), since this is the region allowed by the
PCI 3 spec.  If the BIOS asks us to place the runtime image such that
it would overlap with the init-time image (which is explicitly
prohibited by the PCI 3 spec), then we assume that the BIOS is faulty
and ignore the provided runtime segment address.

Testing on a SuperMicro BIOS providing overlapping segment addresses
shows that ignoring the provided runtime segment address is safe to do
in these circumstances.
2008-10-29 01:16:52 +00:00
Michael Brown 1bc2adea9a [phantom] Add CLP settings interface
This interface provides access to firmware settings (e.g. MAC address)
that will apply to all drivers loaded for the duration of the current
system boot.
2008-10-28 18:49:58 +00:00
Michael Brown 664f4cf365 [phantom] Unhalt/halt all PEGs during driver startup/shutdown
A hardware bug means that reads through the expansion ROM BAR can
return corrupted data if the PEGs are running.  This breaks platforms
that re-read the expansion ROM after invoking gPXE code, such as IBM
blade servers.

Halt PEGs during driver shutdown, and unhalt PEGs during driver
startup if we detect that this is not the first startup since
power-on.
2008-10-28 18:47:44 +00:00
Michael Brown df033de24f [phantom] Add line count limit to phantom_dmesg()
The Phantom firmware debug logs can be extremely long, so add the
ability to restrict the output to the last N lines.
2008-10-28 18:47:00 +00:00
Michael Brown 7a4c129af7 [ioapi] Fix broken implementation of insX() in the x86 I/O API 2008-10-27 00:29:16 +00:00
Michael Brown 3fe6bede74 [uri] Avoid interpreting DOS-style path names as opaque URIs
A DOS-style full path name such as "C:\Program Files\tftpboot\nbp.0"
satisfies the syntax requirements for a URI with a scheme of "C" and
an opaque portion of "\Program Files\tftpboot\nbp.0".

Add a check in parse_uri() to ignore schemes that are apparently only
a single character long; this avoids interpreting DOS-style paths in
this way, and shouldn't affect any practical URI scheme.
2008-10-24 04:08:43 +01:00
Michael Brown d4c8273569 [phantom] Change register space abstraction to match other drivers
Most other Phantom drivers define a register space in terms of a 64M
virtual address space.  While this doesn't map in any meaningful way
to the actual addresses used on the latest cards, it makes maintenance
easier if we do the same.
2008-10-24 03:52:17 +01:00
Michael Brown bcc70d6b99 [pcbios] Guard against register corruption in INT 15,e820 implementations
Someone at Dell must have a full-time job designing ways to screw up
implementations of INT 15,e820.  This latest gem is courtesy of a Dell
Xanadu system, which arbitrarily decides to obliterate the contents of
%esi.

Preserve %esi, %edi and %ebp across calls to INT 15,e820, in case
someone tries a variation on this trick in future.
2008-10-23 04:20:45 +01:00
Michael Brown 612f4e7a99 [settings] Avoid returning uninitialised data on error in fetch_xxx_setting()
Callers (e.g. usr/autoboot.c) may not check the return values from
fetch_xxx_setting(), assuming that in error cases the returned setting
value will be "empty" (for some sensible value of "empty").

In particular, if the DHCP server did not specify a next-server
address, this would result in gPXE using uninitialised data for the
TFTP server IP address.
2008-10-22 22:07:13 +01:00
Michael Brown cbf9003d66 [tftp] Add EUNIQ_xx values to differentiate the many EINVAL errors 2008-10-21 23:00:13 +01:00
Michael Brown 85f09b5fc0 [tg3] Add PCI ID for BCM5786
Contributed by Steve Cayford <cayfo001@umn.edu>
2008-10-21 22:31:10 +01:00
Michael Brown 22979c511e [contrib] Add patch to enable writable ROM images in bochs
Some of the gPXE romprefix.S code attempts to write to the ROM image,
as allowed by the PCI spec.  We do gracefully handle the case of
read-only ROM images (for ISA ROMs and for normal bochs/qemu
operation), but it can be handy to be able to use bochs to debug the
code paths that depend on writable ROM images.
2008-10-21 20:49:10 +01:00
Michael Brown d9c38d14d6 [build] Fix building on FreeBSD
FreeBSD requires the object format to be specified as elf_i386_fbsd,
rather than elf_i386.

Based on a patch from Eygene Ryabinkin <rea-fbsd@codelabs.ru>
2008-10-17 18:24:04 +01:00
Michael Brown 5600955bdd [romprefix] Sanity-check the runtime segment address for PCI 3
Some PCI 3 BIOSes seem to provide a garbage value in %bx, which should
contain the runtime segment address.  Perform a basic sanity check: we
reject the segment if it is below the start of option ROM space.  If
the sanity check fails, we assume that the BIOS was not expecting us
to be a PCI 3 ROM, and we just leave our image in situ.
2008-10-17 18:12:24 +01:00
Michael Brown 7982e79d3c [build] Use ".bss.*" names for uninitialised-data sections
The section name seems to have significance for some versions of
binutils.

There is no way to instruct gcc that sections such as .bss16 contain
uninitialised data; it will emit them with contents explicitly set to
zero.  We therefore have to rely on the linker script to force these
sections to become uninitialised-data sections.  We do this by marking
them as NOLOAD; this seems to be the closest semantic equivalent in the
linker script language.

However, this gets ignored by some versions of ld (including 2.17 as
shipped with Debian Etch), which mark the resulting sections with
(CONTENTS,ALLOC,LOAD,DATA).  Combined with the fact that this version of
ld seems to ignore the specified LMA for these sections, this means that
they end up overlapping other sections, and so parts of .prefix (for
example) get obliterated by .data16's bss section.

Rename the .bss sections from .section_bss to .bss.section; this seems to
cause these versions of ld to treat them as uninitialised data.
2008-10-17 03:12:11 +01:00
Michael Brown 04f3206581 [build] Fix building on Ubuntu 8.04
Not fully understood, but it seems that the LMA of bss sections matters
for some newer binutils builds.  Force all bss sections to have an LMA
at the end of the file, so that they don't interfere with other
sections.

The symptom was that objcopy -O binary -j .zinfo would extract the
.zinfo section from bin/xxx.tmp as a blob of the correct length, but
with zero contents.  This would then cause the [ZBIN] stage of the
build to fail.

Also explicitly state that .zinfo(.*) sections have @progbits, in case
some future assembler or linker variant decides to omit them.
2008-10-17 01:55:58 +01:00
Michael Brown 58dd6e04c5 [etherfabric] Merge changes from vendor tree
Also clean up minor errors in the use of debug macros.
2008-10-17 01:51:41 +01:00
Eduardo Habkost 744b98d273 virtio-net: Fix kick/wait logic
The virtnet_transmit() logic for waiting the packet to be transmitted is
reversed: we can't wait the packet to be transmitted if we didn't kick()
the ring yet. The vring_more_used() while loop logic is reversed also,
that explains why the code works today.

The current code risks trying to free a buffer from the used ring
when none was available, that will happen most times because KVM
doesn't handle the packet immediately on kick(). Luckily it was working
because it was unlikely to have a buffer still queued for transmit when
virtnet_transmit() was called.

Also, adds a BUG_ON() to vring_get_buf(), to catch cases where we try
to free a buffer from the used ring when there was none available.

Patch for Etherboot. gPXE has the same problem on the code, but I hadn't
a chance to test gPXE using virtio-net yet.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2008-10-16 20:32:56 +01:00
Michael Brown c99b16c974 [efi] Add basic implementation of EFI SIMPLE_NETWORK_PROTOCOL
This implementation is tested and working, but not currently tied in
to the EFI build.
2008-10-16 05:38:23 +01:00
Michael Brown 3a505dfc35 [netdevice] Change link-layer push() and pull() methods to take raw types
EFI requires us to be able to specify the source address for
individual transmitted packets, and to be able to extract the
destination address on received packets.

Take advantage of this to rationalise the push() and pull() methods so
that push() takes a (dest,source,proto) tuple and pull() returns a
(dest,source,proto) tuple.
2008-10-16 05:13:40 +01:00
Michael Brown 6b9cc25556 [netdevice] Split multicast hashing out into an mc_hash method
Multicast hashing is an ugly overlap between network and link layers.
EFI requires us to provide access to this functionality, so move it
out of ipv4.c and expose it as a method of the link layer.
2008-10-16 05:12:56 +01:00
Michael Brown 832668105e [netdevice] Add maximum packet length as a net device property
Currently this length is set at device allocation time, and is never
changed.
2008-10-16 05:11:47 +01:00
Michael Brown 64e5ca0582 [efi] Fix linker script for ld 2.17.50.0.9
Some versions of ld choke on the "AT ( _xxx_lma )" in efi.lds with an
error saying "nonconstant expression for load base".  Since these were
only explicitly setting the LMA to the address that it would have had
anyway, they can be safely omitted.
2008-10-13 10:41:38 +01:00
Michael Brown 81d92c6d34 [efi] Add EFI image format and basic runtime environment
We have EFI APIs for CPU I/O, PCI I/O, timers, console I/O, user
access and user memory allocation.

EFI executables are created using the vanilla GNU toolchain, with the
EXE header handcrafted in assembly and relocations generated by a
custom efilink utility.
2008-10-13 10:24:14 +01:00
Michael Brown 54c024e0af [sanboot] Quick and dirty hack to make SAN boot protocols selectable 2008-10-13 10:05:51 +01:00
Michael Brown d4e152e766 [config] Make the default image type selection platform-dependent 2008-10-13 09:37:51 +01:00
Michael Brown 07e8f18f33 [monojob] Release reference on completed job
monojob_wait() was holding a reference to the completed job, meaning that
various objects would not be freed until the next job was plugged in to
the monojob interface.
2008-10-13 05:34:08 +01:00
Michael Brown 831e4cfc27 [umalloc] Formalise the user memory allocation API 2008-10-13 05:33:14 +01:00
Michael Brown 6554b79ff9 [uaccess] Formalise the uaccess API
The userptr_t is now the fundamental type that gets used for conversions.
For example, virt_to_phys() is implemented in terms of virt_to_user() and
user_to_phys().
2008-10-13 04:10:34 +01:00
Michael Brown 667819becc [timer] Remove now-obsolete references to TIMER_BIOS and TIMER_RDTSC 2008-10-13 00:23:18 +01:00
Michael Brown c0835339d0 [nap] Formalise the CPU sleeping API 2008-10-12 23:36:53 +01:00
Michael Brown 658c6dba59 [monojob] Allow for extremely slow system timers
The EFI timer runs at one tick per second, so using ">" rather than ">="
results in a two-second gap between dots.
2008-10-12 21:30:37 +01:00
Michael Brown 16f1e35775 [timer] Formalise the timer API
We now have two implementations for the timer API: one using the
time-of-day counter at 40:70 and one using RDTSC.  Both make use of
timer2_udelay().
2008-10-12 20:22:02 +01:00
Michael Brown e6f276ece3 [process] Add DBG2() messages to help track down frozen processes 2008-10-12 15:11:29 +01:00
Michael Brown f945d6d201 [retry] Use a separate flag to indicate that a retry timer is running
Using start==0 to indicate a stopped timer is dangerous, because 0 is a
valid value for the current tick counter.
2008-10-12 15:11:20 +01:00
Michael Brown 941b4c2adb [commands] Fix config command to accept zero arguments 2008-10-12 15:11:10 +01:00
Michael Brown 8a4ccebec9 [pci] Formalise the PCI I/O API 2008-10-12 12:54:12 +01:00
Michael Brown fd67452807 [legacy] Add missing #include <gpxe/io.h> 2008-10-12 12:52:56 +01:00
Michael Brown e226a8d8d9 [phantom] Add missing #include <gpxe/io.h> 2008-10-12 12:52:47 +01:00
Michael Brown 8c7deba349 [config] Split console configuration out to config/console.h 2008-10-12 02:30:31 +01:00
Michael Brown aef6d0df5c [ioapi] Absorb virt_to_phys() and phys_to_virt() into the I/O API 2008-10-12 02:15:34 +01:00
Michael Brown 992bbf309c [i386] Remove obsolete functions from virtaddr.h
The copy_{to,from}_phys() functions were obsoleted long ago by
copy_{to,from}_user().

relocate_to() also disappeared some time ago.
2008-10-12 02:14:26 +01:00
Michael Brown 8e38669d54 [rtl8139] Add missing #include <string.h> 2008-10-12 02:14:16 +01:00
Michael Brown a1e11a6beb [natsemi] Add missing #include <string.h> 2008-10-12 02:14:10 +01:00
Michael Brown 1641b5d39b [e1000] Add missing #include <string.h> 2008-10-12 02:14:05 +01:00
Michael Brown ee2df1d6d6 [ioapi] Remove old io.h file and switch all users over to <gpxe/io.h> 2008-10-12 01:06:27 +01:00
Michael Brown 8956a36be5 [ioapi] Formalise the I/O API as used in i386-pcbios 2008-10-12 01:03:17 +01:00
Michael Brown b40b4f2dbf [cs89x0] Simplify obscure loop syntax 2008-10-12 00:54:58 +01:00
Michael Brown 0b5c39d167 [e1000] Fix dubious syntax in e1000 I/O wrapper macros 2008-10-12 00:54:44 +01:00
Michael Brown 2e812235f4 [makefile] Add -Wformat-nonliteral as an extra warning category
-Wformat-nonliteral is not enabled by -Wall and needs to be explicitly
 specified.

Modified the few files that use nonliteral format strings to work with
this new setting in place.

Inspired by a patch from Carl Karsten <carl@personnelware.com> and an
identical patch from Rorschach <r0rschach@lavabit.com>.
2008-10-10 18:41:24 +01:00