| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
| |
We need to extend the -Wno-format hack to yet another Makefile to cope
with %S meaning (CHAR16 *) not (wchar_t *) in the context of the EFI
boot loaders.
Sponsored by: Netflix
Notes:
svn path=/head/; revision=323261
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Rename boot1's wcslen to ucs2len, which we can't use in userland
because wchar in userland is unsigned, not short. Move it into
efichar.c. Also spell '* 2' as '* sizeof(efi_char)' and add 1 for the
trailing NUL to transition the FreeBSD boot env vars to being NUL
terminated on the same line...
Sponsored by: Netflix
Notes:
svn path=/head/; revision=323258
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FreeBSD loader expects to have mmsz variable set by bootloader.
U-Boot behaviour is that if buffer size is not big enough to keep
whole memory map, assign the smallest correct buffer size to sz
and return error.
In other words U-Boot assumes that nobody will need mmsz value when buffer
is not filled with memory map, which is not true, so calculated pages value
was too big to allocate.
Solution: Simply assign default value to mmsz.
Submitted by: Patryk Duda <pdk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D12194
Notes:
svn path=/head/; revision=323174
|
| |
|
|
|
|
|
|
|
|
|
| |
Turns out, they are subtly different. I'll refactor anew in the future
if it's worth it then.
Sponsored by: Netflix
Reported by: Tomoaki AOKI-san
Notes:
svn path=/head/; revision=323131
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Record the file path for boot1.efi as the UEFI environemnt variable
FreeBSDBootVarGUID:Boot1Path. Record the device this came from as
FreeBSDBootVarGUID:Boot1Dev. While later stages of the boot may be
able to guess these values by retrieving UEFIGlobal:BootCurrent and
groveling through the correct UEFIGlobal:BootXXXX, this provides
certanty in the face of behavior from any part of the boot loader
chain that might "guess" what to do next. These env variables are
volatile and will disappear on reboot.
Sponsored by: Netflix
Notes:
svn path=/head/; revision=323065
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the FreeBSD UEFI boot protocol, boot1.efi exits back to UEFI if it
can't boot the image for most reasons (so that further items in the
EFI boot manger list can be tried). Rename panic to efi_panic, make it
static and give it an extra status argument. Exit back to UEFI with
that status argument so the next loader can be tried.
Use malloc/free exclusively instead of mixing malloc/free and
AllocatePool/FreePool. The code is smaller.
Sponsored by: Netflix
Notes:
svn path=/head/; revision=323064
|
| |
|
|
|
|
|
|
|
|
|
| |
Print the device that boot1.efi was loaded from. Print the path as
well (since it isn't included in DeviceHandle). Move block where we do
this earlier so all the block handle code is now together.
Sponsored by: Netflix
Notes:
svn path=/head/; revision=323063
|
| |
|
|
|
|
|
|
|
| |
Make efichar.c routines available to libefi as well as
libefivar. Define LIBEFI when building so we can conditionally include
stand.h vs the normal userland stuff.
Notes:
svn path=/head/; revision=323062
|
| |
|
|
|
|
|
|
|
|
|
| |
Use efi_devpath_match instead of device_paths_match. They are
functionally the same. Remove device_paths_match from boot1.c and call
efi_devpath_match instead.
Sponsored by: Netflix
Notes:
svn path=/head/; revision=322941
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Kill our own hand-rolled (and somewhat flawed) devpath_str in favor of
the recently added efi_devpath_str in libefi. This gives us much
better names at the expense of not being able to debug on EFI 1.2
machines (since the UEFI protocol efi_devpath_str depends on was added
in UEFI 2.0). However, this isn't the first thing that requires newer
than EFI 1.2, so it's quite possible that this doesn't change the
universe of machines we can EFI boot from. This will now give us the
full UEFI path, even for devices we don't yet know about. More
importantly, it gives us the full HD(...) part of the path, which is
sufficient by itself to locate disks that follow the rules (dd one
disk (but not partition) to another still needs the rest of the path
to disambiguate, but that isn't following the rules that require every
GPT table to have globally unique GUIDs for every partion).
This also has the side effect of shrinking boot1.efi by ~3k.
Sponsored by: Netflix
Notes:
svn path=/head/; revision=322939
|
| |
|
|
|
|
|
|
|
|
|
| |
Add libefi to the list of libraries we'll link in. Move EFI table
definitions back to libefi so we don't have drift between the two
efi_main routines.
Sponsored by: Netflix
Notes:
svn path=/head/; revision=322938
|
| |
|
|
|
|
|
|
|
| |
when MK_ZFS is true.
Sponsored by: Netflix
Notes:
svn path=/head/; revision=322933
|
| |
|
|
|
|
|
| |
Sponsored by: Netflix
Notes:
svn path=/head/; revision=322932
|
| |
|
|
|
|
|
|
|
|
| |
Make the return type of efi_main uniform. Declare the Exit() function
as not returning. Move efi_main's declaration to the proper header.
Sponsored by: Netflix
Notes:
svn path=/head/; revision=322931
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Move the efi_main routine out of libefi into sys/boot/efi/loader.
Since boot1 has its own efi_main routine, this effectively prevents
boot1 from linking with libefi. By moving it out, we can share code
better (though though some refactoring with boot1's efi_main and
loader.efi's efi_main is definitely in order).
Sponsored by: Netflix
Notes:
svn path=/head/; revision=322930
|
| |
|
|
|
|
|
|
|
|
| |
i386 and amd64. Not enabled on ARMs, those are lacking timer routines.
MFC after: 2 moths
Sponsored by: Sippy Software, Inc.
Notes:
svn path=/head/; revision=322896
|
| |
|
|
| |
Notes:
svn path=/head/; revision=322593
|
| |
|
|
| |
Notes:
svn path=/head/; revision=322592
|
| |
|
|
|
|
|
|
|
|
| |
There are two missing comments marked as XXX in trap.c, fix this.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D12035
Notes:
svn path=/head/; revision=322542
|
| |
|
|
|
|
|
|
|
|
|
|
| |
libefi/time.c is mix of different styles, this update does cleanup.
Also fix 0 versus NULL, and zero the tv structure for case we get error
from UEFI firmware.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D11861
Notes:
svn path=/head/; revision=322074
|
| |
|
|
|
|
|
|
|
|
|
| |
This patch moves code necessary for the fmtdev functionality from
loader to libefi, allowing other applications to make use of it
Submitted by: Eric McCorkle
Differential Revision: https://reviews.freebsd.org/D11862
Notes:
svn path=/head/; revision=322056
|
| |
|
|
|
|
|
|
|
|
|
| |
This patch adds additional EFI utility functions to convert errno
values to EFI_STATUS errors, as well as EFI times to UNIX times.
Submitted by: Eric McCorkle
Differential Revision: https://reviews.freebsd.org/D11858
Notes:
svn path=/head/; revision=322040
|
| |
|
|
|
|
|
|
|
|
|
| |
This patch moves some EFI ZFS functions from loader to libefi,
allowing them to be used by anything that links against libefi.
Submitted by: Eric McCorkle
Differential Revision: https://reviews.freebsd.org/D11855
Notes:
svn path=/head/; revision=322039
|
| |
|
|
|
|
|
|
|
|
|
| |
This patch adds definitions and utility code for creating EFI drivers
using the EFI_DRIVER_BINDING_PROTOCOL.
Submitted by: Eric McCorkle
Differential Revision: https://reviews.freebsd.org/D11852
Notes:
svn path=/head/; revision=322038
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
this to be too restrictive. We need to have both broadcast and unicast
enabled for loader to work. Set them in all cases to ensure this is true.
This allows the Cavium ThunderX 2s in the netperf cluster to netboot using
a USB NIC.
PR: 221001
Reviewed by: emaste, tsoome
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11732
Notes:
svn path=/head/; revision=321621
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clang 5.0.0 got better warnings about print format strings using %zd,
and this leads to the following -Werror warning on e.g. arm:
sys/boot/efi/boot1/zfs_module.c:186:18: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
"(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status));
^~~~~~~~~~
Fix this by casting off_t arguments to intmax_t, and using %jd instead.
Reviewed by: tsoome
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11678
Notes:
svn path=/head/; revision=321305
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes an integer underflow in efipart_realstrategy, which causes
crashes when an I/O operation's start point is after the end of the disk.
This can happen when trying to detect filesystems on very small disks.
This can occur if a BIOS freebsd-boot partition exists on a system when the
EFI loader is being used.
PR: 219000
Submitted by: Eric McCorkle <eric@metricspace.net>
Reviewed by: cem (previous version), tsoome (previous version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10559
Notes:
svn path=/head/; revision=320553
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By default LLD links with relocations disallowed against readonly
sections (e.g., .text), but the 32-bit ARM EFI & uboot boot bits require
such relocations. -znotext is either ignored as an unknown -z option
(in-tree lld 2.17.50) or is already the default (GNU ld or GNU gold from
ports) so we can just add it unconditionally to allow building with LLD.
This is similar to the change in r320179 for the kernel link.
Sponsored by: The FreeBSD Foundation
Notes:
svn path=/head/; revision=320547
|
| |
|
|
|
|
|
|
|
| |
for lld to link laoder.efi and boot1.efi.
Reported by: emaste
Notes:
svn path=/head/; revision=320482
|
| |
|
|
|
|
|
|
|
|
| |
The smbios code does a lot of unaligned access, since we don't really
care about smbios info on ARM (not all board expose information and those
who does don't expose useful ones) disable smbios for this arch (at least
for now).
Notes:
svn path=/head/; revision=320304
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The EFI memory descriptor 64-bit aligns PhysicalStart on both 32- and
64-bit platforms. Make the padding explicit for i386 EFI.
Submitted by: Siva Mahadevan <smahadevan@freebsdfoundation.org>
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11301
Notes:
svn path=/head/; revision=320234
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since buildenv exports SYSROOT all of these uses will now look in
WORLDTMP by default.
sys/boot/efi/loader/Makefile
A LIBSTAND hack is no longer required for buildenv.
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=320122
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement simple chain loader in loader; this update does add chain command,
taking device or file as argument to load and start new boot loader.
In case of BIOS, the chain will read the boot block to address 0000:7c00 and
jumps on it. In case of UEFI, the chain command is to be used with efi
application, typically stored in EFI System Partition.
The update also does add simple menu entry, if the variable chain_disk is set.
The value of the variable chain_disk is used as argument for chain loading.
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D5992
Notes:
svn path=/head/; revision=320011
|
| |
|
|
|
|
|
| |
MFC after: 1 week
Notes:
svn path=/head/; revision=318193
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current read from network is working from up to down - we have some
protocol needing the data from the network, so we build the buffer space
for that protocol, add the extra space for headers and pass this buffer
down to be filled by nif get call in hope, we have guessed the incoming
packet size right. Amazingly enough this approach mostly does work, but
not always...
So, this update does work from down to up - we allocate buffer (based
on MTU or frame size info), fill it up, and pass on for upper layers.
The obvious problem is that when we should free the buffer - if at all.
In the current implementation the upper layer will free the packet on error
or when the packet is no longer needed.
While working on the issue, the additional issue did pop up - the bios
implementation does not have generic get/put interface but is using pxe
udpsend/udpreceive instead. So the udp calls are gone and undi interface
is implemented instead. Which in turn means slight other changes as we
do not need to have duplicated pxe implementation and can just use dev_net.
To align packet content, the actual read from nic is using shifted buffer by
ETHER_ALIGN (2).
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D10232
Notes:
svn path=/head/; revision=317887
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current reboot command in efi/loader/main.c is passing extra data with
ResetSystem, however, UEFI spec 2.6, page 265 does state:
"ResetData is only valid if ResetStatus is something other than EFI_SUCCESS
unless the ResetType is EfiResetPlatformSpecific where a minimum amount of
ResetData is always required."
Therefore we should use DataSize 0 and ResetData NULL - those are two last
arguments for the call.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D10562
Notes:
svn path=/head/; revision=317652
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The work to make it possible to avoid bcache via using F_NORA modifier did
miss the fact that not all loader platforms are using the bcache, and so
it is possible the modifier is not cleared, as bcache strategy function is
not used.
For fix, we make sure the checks are dont with masked flag.
This patch does fix boot for platforms which do not use bcache.
Reported by: emaste
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D10422
Notes:
svn path=/head/; revision=317097
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the zfs probe cleanup, the mistake did slip in the probe code;
instead of reading the pool GUID for the actual boot device (partition),
we read GUID for first found pool from the boot disk.
This will break the case when there are both zfs pool and ufs on the boot
disk, and the ufs is used for boot, not zfs.
Reviewed by: smh
Differential Revision: https://reviews.freebsd.org/D10359
Notes:
svn path=/head/; revision=316704
|
| |
|
|
|
|
|
|
|
| |
GCC 6.3 is unable to trace all code paths that lead to
this variable being left uninitialized and correlate that
to function return values.
Notes:
svn path=/head/; revision=316628
|
| |
|
|
|
|
|
|
|
|
|
| |
GNU GCC does does recognise it as a valid option and we already
use -mgeneral-regs-only that has the desired effect.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D10306
Notes:
svn path=/head/; revision=316625
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current zfs reader is only checking first label from each device, however,
we do have 4 labels on device and we should check all 4 to be protected
against disk failures and incomplete label updates.
The difficulty is about the fact that 2 label copies are in front of the
pool data, and 2 are at the end, which means, we have to know the size of
the pool data area.
Since we have now the mechanism from common/disk.c to use the partition
information, it does help us in this task; however, there are still some
corner cases.
Namely, if the pool is created without partition, directly on the disk,
and firmware will give us the wrong size for the disk, we only can check
the first two label copies.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D10203
Notes:
svn path=/head/; revision=316585
|
| |
|
|
|
|
|
|
| |
Reported by: Graham Perrin, JT Pennington <q5sys@bsdnow.tv>
Sponsored by: ScaleEngine Inc.
Notes:
svn path=/head/; revision=316436
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current efi_zfs_probe() is overcomplicated and can be made
simpler. Still we need to pick up the device handle for our boot
disk first, because the ESP does not have to be the first partition on the
disk.
Once we do have the handle for boot disk, we probe that disk with
pointer for pool GUID.
Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D10198
Notes:
svn path=/head/; revision=316280
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While testing 32bit UEFI OVMF (which has bug about how the disk size
is presented), I did witness the errors from blkio->ReadBlocks().
It became apparent we can not entirely trust UEFI interfaces either,
so additional checks are needed.
So we use disk_ioctl(DIOCGMEDIASIZE) for disks, with fallback of
Media->LastBlock for other media.
In addition, we need to check if there is media present.
+ small fixes for error printout, and avoiding multiple blk * 512.
Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D10197
Notes:
svn path=/head/; revision=316279
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
than 4.2.1
self_reloc.c doesn't initialize `rel` in all cases in the C code, however, the value
might be initialized properly on the stack in the assembly code.
For right now (because this doesn't seem to be breaking anything and my initializing
the stack value could break something since it's called from assembly code) disable
the warning for self_reloc.c. More investigation should be done to determine the
appropriate response to this warning (either intialize the value or find a smarter
way to deal with the warning).
A long MFC timeout is being set for this change to allow a better solution for the
issue to be developed in that time period.
MFC after: 2 months
Reported by: Jenkins (FreeBSD-head-amd64-gcc job)
Tested with: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc)
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=316119
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
`-Wno-missing-variable-declarations` is a clang-specific flag,
so gcc (not 4.2.1, in particular 6.3.0 in my case) dies when
it's passed the flag.
X-MFC with: r304321
Reported by: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc)
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=316110
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is a better pattern to follow when creating the bootloaders and doing
the relevant space checks to make sure that the sizes aren't exceeded (and
thus, copy-pasting is a bit less error prone).
MFC after: 3 days
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=316109
|
| |
|
|
|
|
|
|
|
|
|
| |
They're already defined in libstand.h
MFC after: 1 week
Reported by: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc)
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=316103
|
| |
|
|
|
|
|
|
|
| |
about not having this flag ld.lld fails to link without it.
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=315452
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As we provide the disk size verification and correction via disk_ioctl
and disk state provided by disk_open(), we can not share the partition
state in disk_devdesc structure. Also the sharing does make a lot of sense
with ufs, as only one partition is open at any given time, but zfs pools
do keep the disk devices open.
To make sure we do get the correct information about the open device,
just remove the cache.
Reviewed by: allanjude, smh
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D9757
Notes:
svn path=/head/; revision=315408
|