History log of /freebsd-current/sys/sys/efi.h
Revision Date Author Comments
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 3f3ad565 26-Apr-2023 Johannes Totz <jo@bruelltuete.com>

Expose EFI wake time API

Reviewed by: kib
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36714


# ecb167da 05-Oct-2022 Warner Losh <imp@FreeBSD.org>

efi: Add linux memory reserve table defniitions

There is some hardware which can't be completely reset to release the
memory it is using(so far only the GICv3 on arm has fit this
bill). Since that meory needs to be reserved by the OS for that
hardware's later use of it, create defines for code that will parse that
memory table. Otherise the system may allocate the memory for block I/O,
network packets, etc which will lead to memory corruption.

When booting via Linux's kexec protocol, it will add this table to the
EFI systbl's cfgtbl array. While the mechanism to pass 'configuration'
is standardized, these specific tables are not documented except in the
Linux source. Include comments gleened from its study.

Sponsored by: Netflix


# 74704a26 26-Aug-2022 Warner Losh <imp@FreeBSD.org>

efi: Create a define for memory descriptor version

For true EFI platforms, the EFI BIOS will return version 1 (since no
other version is defined as of this commit). However, for environments
that wish to create an EFI memory mapping table that aren't actually
EFI, we need to know this. Add EFI_MEMORY_DESCRIPTOR_VERSION for this
constant.

Sponsored by: Netflix


# d12d651f 01-Jul-2021 Pavel Balaev <pavel.balaev@3mdeb.com>

EFI RT: resurrect EFIIOC_GET_TABLE

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


# c78ad207 14-Apr-2021 Andrew Turner <andrew@FreeBSD.org>

Switch the EFI virtual address to a uint64_t

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


# 571a1a64 18-Apr-2021 Warner Losh <imp@FreeBSD.org>

Minor style tidy: if( -> if (

Fix a few 'if(' to be 'if (' in a few places, per style(9) and
overwhelming usage in the rest of the kernel / tree.

MFC After: 3 days
Sponsored by: Netflix


# a29bff7a 07-Apr-2021 Greg V <greg@unrelenting.technology>

smbios: support getting address from EFI

On some systems (e.g. Lenovo ThinkPad X240, Apple MacBookPro12,1)
the SMBIOS entry point is not found in the <0xFFFFF space.

Follow the SMBIOS spec and use the EFI Configuration Table for
locating the entry point on EFI systems.

Reviewed by: rpokala, dab
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D29276


# 27d39026 11-Feb-2021 Roger Pau Monné <royger@FreeBSD.org>

efirt: add hooks for diverging EFI implementations

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


# ee938b20 27-Dec-2020 Kyle Evans <kevans@FreeBSD.org>

kern: efirt: correct configuration table entry size

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


# 26649bb5 14-Dec-2018 Conrad Meyer <cem@FreeBSD.org>

efirt: When present, attempt to use EFI runtime services to shutdown

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


# 50cd0be7 02-Sep-2018 Konstantin Belousov <kib@FreeBSD.org>

Catch exceptions during EFI RT calls on amd64.

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


# 3395e43a 04-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

efirt: Don't enter EFI context early, convert addrs to KVA instead

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


# 35e313cf 01-Mar-2018 Ian Lepore <ian@FreeBSD.org>

Add a function to retrieve the EFI realtime clock capabilities.


# 0e73a619 01-Oct-2017 Andrew Turner <andrew@FreeBSD.org>

To prepare for adding EFI runtime services support on arm64 move the
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


# 5e6f40bd 20-Jul-2017 Ryan Libby <rlibby@FreeBSD.org>

efi: restrict visibility of EFIABI_ATTR-declared functions

In-tree gcc (4.2) doesn't understand __attribute__((ms_abi))
(EFIABI_ATTR). Avoid declaring functions with that attribute when the
compiler is detected to be gcc < 4.4.

Reviewed by: kib, imp (previous version)
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11636


# e4b9ff3a 16-Oct-2016 Konstantin Belousov <kib@FreeBSD.org>

Do not try to create /dev/efi device node before devfs is initialized.
Split efirt.ko initialization into early stage where runtime services
KPI environment is created, to be used e.g. for RTC, and the later
devfs node creation stage, per module.

Switch the efi device to use make_dev_s(9) instead of make_dev(9). At
least, this gracefully handles the duplicated device name issue.

Remove ARGSUSED comment from efidev_ioctl(), all unused arguments are
annotated with __unused attribute.

Reported by: ambrisko, O. Hartmann <ohartman@zedat.fu-berlin.de>
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks


# f79d484d 11-Oct-2016 Warner Losh <imp@FreeBSD.org>

Create /dev/efidev to provide an ioctl interface to
userland. It supports userland interfaces to UEFI Runtime Services. This is
indended to the the MI portion of EFI RuntimeServices support.

Differential Revision: https://reviews.freebsd.org/D8128
Reviewed by: kib@, wblock@, Ganael Laplanche


# bd0892ff 21-Sep-2016 Konstantin Belousov <kib@FreeBSD.org>

Rename efi_systbl to efi_systbl_phys, the variable contains the
physical address of the EFI System Table. Add _KERNEL guard around
its declaration in sys/efi.h.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 559a7b20 21-Sep-2016 Konstantin Belousov <kib@FreeBSD.org>

Add a way for the architecture to specify the calling ABI for methods
in the EFI Runtime Services Table. On amd64, the calling conventions
are MS.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 944e0bab 18-Sep-2016 Konstantin Belousov <kib@FreeBSD.org>

Consolidate four efi_next_descriptor() definitions.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# fb112f72 24-Jul-2016 Alexander Motin <mav@FreeBSD.org>

Add more UEFI/e820 memory types from latest specifications.

This is only cosmetics.

MFC after: 2 weeks


# 2fca0f2d 19-Dec-2015 Warner Losh <imp@FreeBSD.org>

Save the physical address passed into the kernel of the UEFI system
table.


# e7d939bd 06-Jul-2014 Marcel Moolenaar <marcel@FreeBSD.org>

Remove ia64.

This includes:
o All directories named *ia64*
o All files named *ia64*
o All ia64-specific code guarded by __ia64__
o All ia64-specific makefile logic
o Mention of ia64 in comments and documentation

This excludes:
o Everything under contrib/
o Everything under crypto/
o sys/xen/interface
o sys/sys/elf_common.h

Discussed at: BSDcan


# 35d75b30 27-Mar-2014 Ed Maste <emaste@FreeBSD.org>

Move ia64 efi.h to sys in preparation for amd64 UEFI support

Prototypes specific to ia64 have been left in this file for now, under
__ia64__, rather than moving them to a new header under sys/ia64.
I anticipate that (some of) the corresponding functions will be shared
by the amd64, arm64, i386, and ia64 architectures, and we can adjust
this as EFI support on other than ia64 continues to develop.

Sponsored by: The FreeBSD Foundation