History log of /freebsd-11.0-release/sys/boot/efi/loader/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
303975 11-Aug-2016 gjb

Copy stable/11@r303970 to releng/11.0 as part of the 11.0-RELEASE
cycle.

Prune svn:mergeinfo from the new branch, and rename it to RC1.

Update __FreeBSD_version.

Use the quarterly branch for the default FreeBSD.conf pkg(8) repo and
the dvd1.iso packages population.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


301306 04-Jun-2016 andrew

Use the UEFI event timer to update the time on arm and arm64. The current
code uses the GetTime function from the Runtime Service, however this has
been shown to not return a useable time on many arm64 UEFI implementations.

Reviewed by: jhb, smh
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D6709


300810 26-May-2016 jhb

Fix unit number of EFI net interfaces and ignore psuedo network interfaces.

In r277943, the efinet_match() routine was changed to use an off by one
when matching network interfaces. The effect was that using "net1"
actually used the device attached to "net0".

Digging into the hardware that needed this workaround more, I found that
UEFI was creating two simple network protocol devices for each physical
NIC. The first device was a "raw" Ethernet device and the second device
was a "IP" device that used the IP protocol on top of the underlying
"raw" device. The PXE code in the firmware used the "IP" device to pull
across the loader.efi, so currdev was set to "net1" when booting from the
physical interface "net0". (The loaded image's device handle referenced
the "IP" device that "net1" claimed.)

However, the IP device isn't suitable for doing raw packet I/O (and the
current code to open devices exclusively actually turns the "IP" devices
off on these systems).

To fix, change the efinet driver to only attach to "raw" devices. This
is determined by fetching the DEVICE_PATH for each handle which supports
the simple network protocol and examining the last node in the path. If
the last node in the path is a MAC address, the device is assumed to be
a "raw" device and is added as a 'netX' device. If the last node is not
a MAC address, the device is ignored.

However, this causes a new problem as the device handle associated with
the loaded image no longer matches any of the handles enumerated by
efinet for systems that load the image via the "IP" device. To handle
this case, expand the logic that resolves currdev from the loaded image
in main(). First, the existing logic of looking for a handle that
matches the loaded image's handle is tried. If that fails, the device
path of the handle that loaded the loaded image is fetched via
efi_lookup_image_devpath(). This device path is then walked from the
end up to the beginning using efi_handle_lookup() to fetch the handle
associated with a path. If the handle is found and is a known handle,
then that is used as currdev. The effect for machines that load the
image via the "IP" device is that the first lookup fails (the handle
for the "IP" device isn't claimed by efinet), but walking up the
image's device path finds the handle of the raw MAC device which is used
as currdev.

With these fixes in place, the hack to subtract 1 from the unit can now
be removed, so that setting currdev to 'net0' actually uses 'net0'.

PR: 202097
Tested by: ambrisko
Sponsored by: Cisco Systems


300789 26-May-2016 jhb

Remove second copy of the -Wno-format band-aid for printf %S.


300634 25-May-2016 cem

efi loader: Match format string to EFI_ERROR_CODE()

Silence a format specifier warning.

Sponsored by: EMC / Isilon Storage Division


300330 20-May-2016 imp

Large improvements to efi-show (though some weird problems
linger). We now print only printable characters for the
values and we print ascii strings as strings.


300329 20-May-2016 imp

Implement efi-set and efi-unset


300328 20-May-2016 imp

Cleanup to use %S.


300216 19-May-2016 imp

Fix logic error so UEFI variables are reported correctly
without error at the end.


300150 18-May-2016 pfg

Minor spelling fixes.


300117 18-May-2016 imp

Fix several instances where the boot loader ignored pager_output
return value when it could return 1 (indicating we should stop).
Fix a few instances of pager_open() / pager_close() not being called.
Actually use these routines for the environment variable printing code
I just committed.


300116 18-May-2016 imp

Fix build breakage on arm64 by papering over the problem. We implement
a slightly non-standard %S that's more useful in the UEFI environment,
so ignore printf errors. There's no good cast to use. We'll need to
revisit this in the future.


300081 17-May-2016 imp

Implement UEFI set environment variable, as well as exporting the EFI
version. This is also scriptable, though additional scripting will be
needed.

Differential Review: https://reviews.freebsd.org/D4494
MFC After: 3 days


298826 30-Apr-2016 pfg

sys/boot: spelling fixes in comments.

No functional change.


298309 19-Apr-2016 pfg

sys/boot: use our nitems() macro when it is available through param.h.

No functional change, only trivial cases are done in this sweep,

Discussed in: freebsd-current


298230 18-Apr-2016 allanjude

A new implementation of the loader block cache

The block cache implementation in loader has proven to be almost useless, and in worst case even slowing down the disk reads due to insufficient cache size and extra memory copy.
Also the current cache implementation does not cache reads from CDs, or work with zfs built on top of multiple disks.
Instead of an LRU, this code uses a simple hash (O(1) read from cache), and instead of a single global cache, a separate cache per block device.
The cache also implements limited read-ahead to increase performance.
To simplify read ahead management, the read ahead will not wrap over bcache end, so in worst case, single block physical read will be performed to fill the last block in bcache.

Booting from a virtual CD over IPMI:
0ms latency, before: 27 second, after: 7 seconds
60ms latency, before: over 12 minutes, after: under 5 minutes.

Submitted by: Toomas Soome <tsoome@me.com>
Reviewed by: delphij (previous version), emaste (previous version)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D4713


297954 14-Apr-2016 imp

Deprecate using hints.acpi.0.rsdp to communicate the RSDP to the
system. This uses the hints mechnanism. This mostly works today
because when there's no static hints (the default), this value can be
fetched from the hint. When there is a static hints file, the hint
passed from the boot loader to the kernel is ignored, but for the BIOS
case we're able to find it anyway. However, with UEFI, the fallback
doesn't work, so we get a panic instead.

Switch to acpi.rsdp and use TUNABLE_ULONG_FETCH instead. Continue to
generate the old values to allow for transitions. In addition, fall
back to the old method if the new method isn't present.

Add comments about all this.

Differential Revision: https://reviews.freebsd.org/D5866


296769 12-Mar-2016 emaste

boot/efi: Prefer nm to objdump

Both objdump and nm are equally capable of reporting undefined symbols.

This gets us a step closer to building without binutils as we have an nm
implementation from ELF Tool Chain.

Reviewed by: bdrewery
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5613


296706 11-Mar-2016 bdrewery

Add more .NOMETA missed in r291320

Sponsored by: EMC / Isilon Storage Division


295989 24-Feb-2016 bdrewery

DIRDEPS_BUILD: Regenerate without local dependencies.

These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by: EMC / Isilon Storage Division


295842 20-Feb-2016 andrew

Add a missing call to dev_cleanup from the arm64 loader.efi.

Sponsored by: ABT Systems Ltd


295420 09-Feb-2016 andrew

Ensure the bss is aligned to a 4-byte address as we use 4-byte aligned
stores to clear it.

While here reduce the alignment of the data from 4k to 16 byte aligned.
This should be more than enough, without wasting too much space.

Sponsored by: ABT Systems Ltd


295408 08-Feb-2016 imp

Implement -P for boot loader. It's a bit easier to implement here than
in boot1, like is normally done. When a keyboard appears in the UEFI
device tree, assume -D -h, just like on a BIOS boot.

# It is unclear if an ACPI keyboard appearing in the tree means there's
# a real keyboard or not. A USB keyboard doesn't seem to appear unless
# it is really there.

Differential Revision: https://reviews.freebsd.org/D5223


294767 26-Jan-2016 imp

Parse the command line arguments, and do it before we initialize the
console so it can be changed by the command line arguments.

Differential Revision: https://reviews.freebsd.org/D5038


294073 15-Jan-2016 allanjude

Connect the ZFS boot environment menu to the UEFI loader

MFC after: 3 days
Sponsored by: ScaleEngine Inc.


294068 15-Jan-2016 smh

Add EFI ZFS boot support

This builds on the modular EFI loader support added r294060 adding a
module to provide ZFS boot support on EFI systems.

It should be noted that EFI uses a fixed size memory block for all
allocations performed by the loader so it may be necessary to tune this
size.

For example when building an image which uses mfs_root e.g. mfsbsd, adding
the following to /etc/make.conf would be needed to prevent EFI from running
out of memory when loading the mfs_root image.
EFI_STAGING_SIZE=128

Submitted by: Eric McCorkle
MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay


294060 15-Jan-2016 smh

Modularise EFI boot loader

Make EFI boot loader modular in preparation for adding ZFS support.

This is a partial commit of the D4515.

Submitted by: Eric McCorkle
Reviewed by: emaste (in part)
MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D4515


294029 14-Jan-2016 smh

Only build EFI components on supported compilers

As the in-tree GCC does not support __attribute__((ms_abi)) EFI can only
be built with Clang.

The EFI loader and boot1 validated this, but unused libefi was still built
causing issues under GCC after warnings where enabled by r293724.

Disable building all of EFI when the selected compiler is GCC.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay


293724 12-Jan-2016 smh

Enable warnings in EFI boot code

Set WARNS if not set for EFI boot code and fix the issues highlighted by
setting it.

Most components are set to WARNS level 6 with few being left at lower
levels due to the amount of changes needed to fix at higher levels.

Error types fixed:
* Missing / invalid casts
* Missing inner structs
* Unused vars
* Missing static for internal only funcs
* Missing prototypes
* Alignment changes
* Use of uninitialised vars
* Unknown pragma (intrinsic)
* Missing types etc due to missing includes
* printf formatting types

Reviewed by: emaste (in part)
MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D4839


293274 06-Jan-2016 smh

style(9) fixes for EFI boot

Fix some style(9) nits for EFI boot code, no functional changes.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay


293245 06-Jan-2016 emaste

loader.efi style(9) cleanup

Submitted by: smh


293244 06-Jan-2016 emaste

Introduce and use new EFI_ERROR_CODE macro for EFI errors

Submitted by: smh
MFC after: 1 week


293233 06-Jan-2016 emaste

loader.efi: add terminal emulation support

This is based on the vidconsole implementation.

Submitted by: Toomas Soome <tsoome@me.com>
Reviewed by: adrian
MFC after: 2 weeks
Relnotes: Yes
Differential Revision: https://reviews.freebsd.org/D4797


293165 04-Jan-2016 emaste

loader.efi: support non-contiguous console modes

Submitted by: Toomas Soome <tsoome@me.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4760


292584 22-Dec-2015 ian

Set env vars from values on the efi loader command line.

Examine each cmdline arg and if it contains an '=' convert it to ascii and
pass it to putenv(). This allows var=value settings to come in on the
command line.

This will allow overriding dhcp server-provided data in loader(8), as
discussed in PR 202098

PR: 202098
Differential Revision: https://reviews.freebsd.org/D4561


292563 21-Dec-2015 emaste

loader.efi: strip trailing whitespace

Sponsored by: The FreeBSD Foundation


292515 20-Dec-2015 emaste

loader.efi: refresh size in GetMemoryMap retry loop

If ExitBootServices fails due to a changed efi_mapkey then GetMemoryMap
must be called again. In this case it is also possible for the memory
map to grow, so repeat the initial GetMemoryMap call to fetch the new
size.

Also roll bi_add_efi_data_and_exit into bi_load_efi_data as there's no
need for it to be a separate function.

PR: 202455
Reported by: Berislav Purgar <bpurgar@gmail.com>
Tested by: Berislav Purgar <bpurgar@gmail.com>
Reviewed by: kib
MFC after: 1 week
MFC with: r292338
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4621


292471 19-Dec-2015 imp

Pass the UEFI system table into the kernel from the boot loader via
the FW_HANDLE metadata item. The kernel can get the rest of what it
needs from this.


292442 18-Dec-2015 emaste

loader.efi: show EFI error number, not full status value

EFI return values set the high bit to indicate an error. The log
messages changed here are printed only in the case of an error,
so including the error bit is redundant. Also switch to decimal to
match the error definitions (in sys/boot/efi/include/efierr.h).

MFC after: 1 week
Sponsored by: The FreeBSD Foundation


292338 16-Dec-2015 emaste

UEFI: combine GetMemoryMap and ExitBootServices and retry on error

The EFI memory map may change before or during the first
ExitBootServices call. In that case ExitBootServices returns an error,
and GetMemoryMap and ExitBootServices must be retried.

Glue together calls to GetMemoryMap(), ExitBootServices() and storage of
(now up-to-date) MODINFOMD_EFI_MAP metadata within a single function.

That new function - bi_add_efi_data_and_exit() - uses space previously
allocated in bi_load_efi_data() to store the memory map (it will fail if
that space is too short). It handles re-calling GetMemoryMap() once to
update the map key if necessary. Finally, if ExitBootServices() is
successful, it stores the memory map and its header as MODINFOMD_EFI_MAP
metadata.

ExitBootServices() calls are now done earlier, from within arch-
independent bi_load() code.

PR: 202455
Submitted by: Ganael LAPLANCHE
Reviewed by: kib
MFC after: 2 weeks
Relnotes: Yes
Differential Revision: https://reviews.freebsd.org/D4296


291563 01-Dec-2015 bdrewery

META MODE: Update dependencies with 'the-lot' and add missing directories.

This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so. A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR. These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package. The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by: EMC / Isilon Storage Division


288372 29-Sep-2015 jhb

Use EFI page size constants instead of hardcoding 4096.

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3692


287934 17-Sep-2015 jhb

The EFI boot loader allocates a single chunk of contiguous memory to
hold the kernel, modules, and any other loaded data. This memory block
is relocated to the kernel's expected location during the transfer of
control from the loader to the kernel.

The GENERIC kernel on amd64 has recently grown such that a kernel + zfs.ko
no longer fits in the default staging size. Bump the default size from
32MB to 48MB to provide more breathing room.

PR: 201679
Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3666


287930 17-Sep-2015 jhb

Various small cleanups to EFI loader Makefiles.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D3641


287538 07-Sep-2015 marcel

As expected, things aren't as simple as hoped. Consequently, we have
no option but to use the smbios information to fill in the blanks.
It's a good thing UGA is a protocol of the past and GOP has all the
info we need.

Anyway, the logic has been tweaked a little to get the easier bits
of information up front. This includes the resolution and the frame
buffer address. Then we look at the smbios information and define
expected values as well as the missing bits (frame buffer offset and
stride). If the values obtained match the expect values, we fill in
the blanks and return. Otherwise we use the existing detection logic
to figure it out.

Rename the environment variables from uga_framebuffer abd uga_stride
to hw.efifb.address and hw.efifb.stride. The latter names are more
in line with other variable names.

We currently have hardcoded settings for:
1. Mid-2007 iMac (iMac7,1)
2. Late-2007 MacBook (MacBook3,1)


287489 05-Sep-2015 marcel

Auto-detect the UGA frame buffer and stride on a MacBook. We're
striking a delicate balance between exhaustive searching and
banking on assumptions. The environment variables can be used
as a fall-back anyway. With this change, all known and tested
Macs with only UGA should have a working console out of the
box... for now...


287475 05-Sep-2015 marcel

My MacBook has UGA only, but we fail to detect any changes
in the frame buffer when we flip pixels. Allow the detection
to be bypassed by setting the uga_framebuffer and uga_stride
variables. The kernel console works fine even when we can't
detect pixel changes in the frame buffer, which indicates
that the problem could be with reading from the frame buffer
and not writing to it.


287422 03-Sep-2015 marcel

For UGA, the frame buffer address obtained by scanning the
PCI BARs does not necessarily correspond to the upper-left
most pixel. Scan the frame buffer for which byte changed
when changing the pixel at (0,0).

Use the same technique to determine the stride. Except for
changing the pixel at (0,0), we change the pixel at (0,1).

PR: 202730
Tested by: hartzell (at) alerce.com


287365 01-Sep-2015 andrew

Install the forth bits on arm64. For now limit it to just arm64 as on x86
these should have been installed as part of the regular loader.


287317 31-Aug-2015 marcel

Add support for the UGA draw protocol. This includes adding a
command called 'uga' to show whether UGA is implemented by the
firmware and what the settings are. It also includes filling
the efi_fb structure from the UGA information when GOP isn't
implemented by the firmware.

Since UGA does not provide information about the stride, we
set the stride to the horizontal resolution. This is likely
not correct and we should determine the stride by trial and
error. For now, this should show something on the console
rather than nothing.

Refactor this file to maximize code reuse.

PR: 202730


287299 30-Aug-2015 marcel

Add a gop command to help diagnose VT efifb problems. The gop
command has the following sub-commands:
list - list all possible modes (paged)
get - return the current mode
set <mode> - set the current mode to <mode>


284266 11-Jun-2015 andrew

Pass the ACPI table pointer to the arm64 kernel from loader.efi.

Sponsored by: The FreeBSD Foundation


282896 14-May-2015 andrew

Remove OUTPUT_FORMAT from theARM EFI linker script, it breaks building
for big-endian arm.


282728 10-May-2015 ian

Don't check the return value from self_reloc(), it can't fail and doesn't
return a value.

Despite what I said in my prior commit, it turns out this one platform
was checking the return value from the old self-reloc code (which returned
a hard-coded 0).


282727 10-May-2015 ian

The self-relocation code is not efi-specific, move it to boot/common.

The function was defined as taking 4 parameters and returning EFI_STATUS,
but all existing callers (in asm code) passed only two parameters and don't
use the return value. The function signature now matches that usage, and
doesn't refer to efi-specific types.

Parameters and variables now use the cannonical typenames set up by elf.h
(Elf_Word, Elf_Addr, etc) instead of raw C types. Hopefully this will
prevent suprises as new platforms come along and use this code.

The function was renamed from _reloc() to self_reloc() to emphasize its
difference from the other elf relocation code found in boot/common.

Differential Revision: https://reviews.freebsd.org/D2490


282477 05-May-2015 andrew

Add FDT to the list of known GUIDs.


282474 05-May-2015 andrew

Disable the use of floating-point and vector registers in the loader. They
need the vfp unit to be enabled which may not be the case.


282470 05-May-2015 andrew

When cross-building ${LIBSTAND} may be set to the host copy. Point to the
version built with the toolchain.

Differential Revision: https://reviews.freebsd.org/D2312
Submitted by: jhb


281527 14-Apr-2015 andrew

* Remove the wfi when the efi loader returns, it's unneeded and is not
available on older designs.
* Enable the efi loader on arm


281526 14-Apr-2015 andrew

Add support for arm64 to loader.efi and boot1.efi

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation


281524 14-Apr-2015 andrew

Use MACHINE in the efi loader when it is what we mean, it may not be the
same as MACHINE_CPUARCH, it just happened to be the case the architectures
this code currently supports.

Sponsored by: The FreeBSD Foundation


281496 13-Apr-2015 andrew

Create the correct symlinks for the machine directory, and only create the
x86 symlink on i386 and amd64. Before this incorrect symlinks were being
created on armi and i386.

Differential Revision: https://reviews.freebsd.org/D2283
Reviewed by: emaste, imp
Sponsored by: The FreeBSD Foundation


281435 11-Apr-2015 andrew

Add fdt support to the arm loader.efi


281434 11-Apr-2015 andrew

Only add -fPIC to CFLAGS and -Wl,-znocombreloc to LDFLAGS on x86, they
shouldn't be used on arm.


281433 11-Apr-2015 andrew

Move reloc.c to the top level Makefile as it has become generic.


281431 11-Apr-2015 andrew

Update the arm efi ldscript to generate a valid efi binary


281377 10-Apr-2015 emaste

Add build support for i386 loader.efi

Kernel changes are required for this to be useful but this will allow
others to experiment.

Differential Revision: https://reviews.freebsd.org/D2276


281376 10-Apr-2015 emaste

Limit EFI framebuffer metadata to amd64 for now

The i386 loader.efi does not yet exist. Avoid dealing with vt and
framebuffer issues there until the initial bootstrapping is done.


281357 10-Apr-2015 andrew

Port the EFI reloc codeto work on arm64. This used the rela relocation
table so wiill need the addend included in the relocation calculation.

Sponsored by: The FreeBSD Foundation


281322 09-Apr-2015 emaste

Remove EOL whitespace from i386 EFI loader source


281237 07-Apr-2015 emaste

EFI: use common reloc.c for all architectures

Much of this file is common to the architectures we support, so share
an implementation by adding a little #ifdef-ery.

Differential Revision: https://reviews.freebsd.org/D2241
Reviewed by: imp
Sponsored by: The FreeBSD Foundation


281156 06-Apr-2015 andrew

Add support to the efi boot1 and loader for 32-bit ARM. This will be used
by the future qemu virt support.

Differential Revision: https://reviews.freebsd.org/D2238
Reviewed by: emaste


281138 06-Apr-2015 rpaulo

SMBIOS support for EFI.

MFC after: 1 week


281114 05-Apr-2015 andrew

Add FDT support to loader.efi. This will be used on arm and arm64.

Differential Revision: https://reviews.freebsd.org/D2219


281061 04-Apr-2015 rpaulo

loader/EFI: improve the help of the 'mode' command.


281022 03-Apr-2015 andrew

Only enable the efi framebuffer on x86 for now


281021 03-Apr-2015 andrew

Only include machine/specialreg.h on x86


281020 03-Apr-2015 andrew

Only enable comconsole and nullconsole on x86.


281000 02-Apr-2015 emaste

Move i386/efi files to new home in efi/loader/arch/i386

This was not (and still is not) connected to the build, but the EFI
loader is in the process of being built for other than amd64 so these
files ought to live in their eventual MD location.


280950 01-Apr-2015 andrew

Move the efi loaders to be under sys/boot/efi. This will help us add
support for booting arm and arm64 from UEFI.

Differential Revision: https://reviews.freebsd.org/D2164
Reviewed by: emaste, imp (previous version)
Sponsored by: The FreeBSD Foundation