| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
The EFI_PROPERTIES_TABLE has been deprecated in the UEFI specification.
It is now replaced by the EFI_MEMORY_ATTRIBUTES_TABLE, which provides
a new header and data format for describing memory region attributes.
Reviewed by: imp
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49998
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Start using efi_guid_t instead of struct uuid in the ioctl
definitions. These are binarily the same, but have different
structure definitions. EFI prefers this form, and to allow more
sharing with EDK2, make this slight addition.
I've not really defined new IOCTLs for this. They are the same
size, but I have defined new function.
Also fix in-kernel uses of uuid to efi_guid_t for anything related to
ioctl.
Sponsored by: Netflix
Reviewed by: tsoome, kib
Differential Revision: https://reviews.freebsd.org/D50057
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So, while struct uuid and EFI_GUID are quite similar (they are the same
size, they have the same binary representation, etc), they aren not
identical. Speciifcally, the UUID and GUID defines are slightly
different and can't be swapped one for the other. Start to use EFI_GUID
for all EFI tables. This will allow increased sharing with the boot
laoder that already uses EDK2 variants as well as using the possibility
to use the EDK2 headers we've already imported more easily.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D50037
|
|
|
|
|
|
|
|
|
| |
PR: 285797
Reported and tested by: Bakul Shah <bakul@iitbombay.org>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D49592
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The way we got the kernel metadata pointer was by calling
preload_search_by_type with one of the following three: "elf kernel",
"elf32 kernel" and "elf64 kernel". Which one(s) we used wasn't
consistent though. Sometimes we would only try "elf kernel", and other
times we would try one of the latter two if the first failed. However,
the loader only ever sets "elf kernel" as the kernel type.
Now, the kmdp is a global, preload_kmdp, and it's initialized using
preload_initkmdp in machdep.c (or machdep_boot.c on arm/64).
preload_initkmdp takes a single boolean argument that tells us whether
not finding the kmdp is fatal or not.
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1394
|
|
|
|
|
|
| |
When calling EFI RT methods through no fault path.
MFC after: 1 week
|
|
|
|
| |
Fixes: a03957a706a0 ("efirt: mark dynamic region executing the RT code with the TDP_EFIRT flag")
|
|
|
|
|
|
|
| |
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D47694
|
|
|
|
|
| |
Reviewed by: imp, kib, andrew, markj
Differential Revision: https://reviews.freebsd.org/D41576
|
|
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
|
|
|
|
|
| |
Reviewed by: kib
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36714
|
|
|
|
|
|
|
|
|
|
| |
Use the correct page size macro when checking if an address is with
the EFI runtime map. This would previously work correctly when the
page size is 4k. With a larger page size it may incorrectly detect
memory as within the map when it's not.
Reported by: imp
Sponsored by: Innovate UK
|
|
|
|
|
|
| |
Otherwise KMSAN may report false positives.
Sponsored by: The FreeBSD Foundation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make it work, but change the interface to be safe for non-root users. In
particular, right now interface only works for the tables which can be
minimally parsed by kernel to determine the table size. Then, userspace can
query the table size, after that it provides a buffer of needed size
and kernel copies out just table to userspace.
Main advantage is that user no longer need to be able to read /dev/mem,
the disadvantage is the need to have minimal parsers aware of the table
types. Right now the parsers are implemented for ESRT and PROP tables.
Future extension of the present interface might be a return of only
the table physical address, in case kernel does not have suitable
parser yet. Then, a privileged user could read the table from /dev/mem.
This extension, which logically equivalent to the old (non-worked)
EFIIOC_GET_TABLE variant, is not implemented until needed.
Submitted by: Pavel Balaev <pavel.balaev@3mdeb.com>
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D30104
|
|
|
|
|
|
|
|
|
|
| |
It is defined as a uint64_t in the UEFI spec. As it's not used as a
pointer by the kernel follow this and define it as the same in the
kernel.
Reviewed by: kib, manu, imp
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D29759
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a set of hooks for MI EFI public functions, so that a new
implementation can be done. This will be used to implement the Xen PV
EFI interface that's used when running FreeBSD as a Xen dom0 from UEFI
firmware. Also make the efi_status_to_errno non-static since it will
be used to evaluate status return values from the PV interface.
No functional change indented.
Sponsored by: Citrix Systems R&D
Reviewed by: kib, imp
Differential revision: https://reviews.freebsd.org/D28620
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each entry actually stores a native pointer, not a uint64_t quantity. While
we're here, go ahead and export the pointer as-is rather than converting it
to KVA. This may be more useful as consumers can map /dev/mem and observe
the entry.
For reference, see: sys/contrib/edk2/Include/Uefi/UefiSpec.h
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27669
|
|
|
|
|
|
|
|
| |
This fixes an insta-panic when EFIIOC_GET_TABLE is used.
Reviewed by: imp (earlier version), kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27669
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.
Mark all obvious cases as MPSAFE. All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT
Approved by: kib (mentor, blanket)
Commented by: kib, gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D23718
Notes:
svn path=/head/; revision=358333
|
|
|
|
|
|
|
|
|
|
| |
efi_arch_enter() returned an error.
Submitted: Jan Martin Mikkelsen <janm@transactionware.com>
MFC after: 1 week
Notes:
svn path=/head/; revision=348541
|
|
|
|
|
|
|
|
|
|
| |
PR: maybe related to 233998 (inconclusive at this time)
Submitted by: byuu <byuu AT tutanota.com> (previous version)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D18506
Notes:
svn path=/head/; revision=342108
|
|
|
|
|
|
|
|
|
|
| |
Reported by: cem from Coverity
Sponsored by: The FreeBSD Foundation
MFC after: 6 days
Approved by: re (gjb)
Notes:
svn path=/head/; revision=338461
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This appeared to be required to have EFI RT support and EFI RTC
enabled by default, because there are too many reports of faulting
calls on many different machines. The knob is added to leave the
exceptions unhandled to allow to debug the actual bugs.
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (rgrimes)
Differential revision: https://reviews.freebsd.org/D16972
Notes:
svn path=/head/; revision=338437
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (rgrimes)
Differential revision: https://reviews.freebsd.org/D16972
Notes:
svn path=/head/; revision=338433
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
efi_enter here was needed because efi_runtime dereference causes a fault
outside of EFI context, due to runtime table living in runtime service
space. This may cause problems early in boot, though, so instead access it
by converting paddr to KVA for access.
While here, remove the other direct PHYS_TO_DMAP calls and the explicit DMAP
requirement from efidev.
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16591
Notes:
svn path=/head/; revision=337331
|
|
|
|
|
|
|
|
|
|
|
| |
The latter matches the rest of the tree better [0]. The UPDATING entry has
been updated to reflect this, and the new tunable is now documented in
loader(8) [1].
Reported by: imp [0], Shawn Webb [1]
Notes:
svn path=/head/; revision=336924
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Leading up to enabling EFIRT in GENERIC, allow runtime services to be
disabled with a new tunable: efi.rt_disabled. This makes it so that EFIRT
can be disabled easily in case we run into some buggy UEFI implementation
and fail to boot.
Discussed with: imp, kib
MFC after: 1 week
Notes:
svn path=/head/; revision=336919
|
|
|
|
|
|
|
|
|
| |
There's no real annotation for it, so it's not immediately obvious to the
unfamiliar that these pointers are to locations in the EFI runtime map
unlike the system table pointer immediately above them.
Notes:
svn path=/head/; revision=331413
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On amd64, efi_enter calls fpu_kern_enter(). This may not be called until
fpuinitstate has been invoked, resulting in a kernel panic with
efirt_load="YES" in loader.conf(5).
Move fpuinitstate a little earlier in SI_SUB_DRIVERS so that we can squeeze
efirt between it and efirtc at SI_SUB_DRIVERS, SI_ORDER_ANY. efidev must be
after efirt and doesn't really need to be at SI_SUB_DEVFS, so drop it at
SI_SUB_DRIVER, SI_ORDER_ANY.
The not immediately obvious dependency of fpuinitstate by efirt has been
noted in both places.
Discussed with: kib, andrew
Reported by: Jakob Alvermark <jakob@alvermark.net>
X-MFC-With: r330868
Notes:
svn path=/head/; revision=331365
|
|
|
|
|
|
|
|
|
|
|
| |
pointer. This may be within the EFI address space and not the FreeBSD
kernel address space.
X-MFC-With: r330868
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=331361
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The U-Boot efi runtime service expects us to set the address map before
calling any runtime services. It will then remap a few functions to their
runtime version. One of these is the gettime function. If we call into
this without having set a runtime map we get a page fault.
Add a check to see if this is valid in efi_init() so we don't try to use
the possibly invalid pointer.
Reviewed by: imp, kevans (both previous version)
X-MFC-With: r330868
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14759
Notes:
svn path=/head/; revision=331241
|
|
|
|
| |
Notes:
svn path=/head/; revision=330844
|
|
|
|
|
|
|
|
|
|
| |
As noted in the comment, UEFI spec claims the capabilities pointer is
optional, but some implementations will choke and attempt to dereference it
without checking. This specific problem was found on a Lenovo Thinkpad X220
that would panic in efirtc_identify.
Notes:
svn path=/head/; revision=330843
|
|
|
|
| |
Notes:
svn path=/head/; revision=330257
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
No implementation of fpu_kern_enter() can fail, and it was causing needless
error checking boilerplate and confusion. Change the return code to void to
match reality.
(This trivial change took nine days to land because of the commit hook on
sys/dev/random. Please consider removing the hook or otherwise lowering the
bar -- secteam never seems to have free time to review patches.)
Reported by: Lachlan McIlroy <Lachlan.McIlroy AT isilon.com>
Reviewed by: delphij
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14380
Notes:
svn path=/head/; revision=329878
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
kernel by PHYS_TO_DMAP() as previously present on amd64, arm64, riscv, and
powerpc64. This introduces a new MI macro (PMAP_HAS_DMAP) that can be
evaluated at runtime to determine if the architecture has a direct map;
if it does not (or does) unconditionally and PMAP_HAS_DMAP is either 0 or
1, the compiler can remove the conditional logic.
As part of this, implement PHYS_TO_DMAP() on sparc64 and mips64, which had
similar things but spelled differently. 32-bit MIPS has a partial direct-map
that maps poorly to this concept and is unchanged.
Reviewed by: kib
Suggestions from: marius, alc, kib
Runtime tested on: amd64, powerpc64, powerpc, mips64
Notes:
svn path=/head/; revision=328168
|
|
machine independent parts of the existing code to a new file that can be
shared between amd64 and arm64.
Reviewed by: kib (previous version), imp
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12434
Notes:
svn path=/head/; revision=324177
|