History log of /src/sys/dev/efidev/efirt.c (Results 1 – 25 of 135)
Revision Date Author Comments
# f840492b 19-Jul-2025 ShengYi Hung <aokblast@FreeBSD.org>

efidev: add support for memory attribute

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 an

efidev: add support for memory attribute

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

show more ...


# 20a860ae 01-May-2025 Warner Losh <imp@FreeBSD.org>

efi: Move to using efi_guid_t in ioctl definitions

Start using efi_guid_t instead of struct uuid in the ioctl
definitions. These are binarily the same, but have different
structure definitions. EFI

efi: Move to using efi_guid_t in ioctl definitions

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

show more ...


# 6366114c 01-May-2025 Warner Losh <imp@FreeBSD.org>

efi: Use EDK2 EFI_GUID instead of sturct uuid

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. S

efi: Use EDK2 EFI_GUID instead of sturct uuid

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

show more ...


# fd748c7d 31-Mar-2025 Konstantin Belousov <kib@FreeBSD.org>

efirt: add a tunable to disable printing faults during EFIRT calls

PR: 285797
Reported and tested by: Bakul Shah <bakul@iitbombay.org>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC af

efirt: add a tunable to disable printing faults during EFIRT calls

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

show more ...


# b72ae900 22-Aug-2024 Ahmad Khalifa <ahmadkhalifa570@gmail.com>

sys: make the kernel metadata pointer global

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

sys: make the kernel metadata pointer global

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

show more ...


# 3e8f4a30 21-Dec-2024 Ahmad Khalifa <ahmadkhalifa570@gmail.com>

efirt: use correct ABI for runtime EFI functions

When calling EFI RT methods through no fault path.

MFC after: 1 week


# 07593d13 22-Nov-2024 Mark Johnston <markj@FreeBSD.org>

efirt: Fix the TDP_EFIRT assertion

Fixes: a03957a706a0 ("efirt: mark dynamic region executing the RT code with the TDP_EFIRT flag")


# a03957a7 21-Nov-2024 Konstantin Belousov <kib@FreeBSD.org>

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/

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

show more ...


# 8173fa60 25-Aug-2023 John Baldwin <jhb@FreeBSD.org>

efirt: Move comment about fpu_kern_enter to where it is called

Reviewed by: imp, kib, andrew, markj
Differential Revision: https://reviews.freebsd.org/D41576


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\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


# 643e14d0 09-Sep-2022 Andrew Turner <andrew@FreeBSD.org>

Use the correct size when checking an EFI address

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

Use the correct size when checking an EFI address

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

show more ...


# eec892a8 07-Sep-2021 Mark Johnston <markj@FreeBSD.org>

efirt: Mark buffers filled out by EFI firmware as initialized

Otherwise KMSAN may report false positives.

Sponsored by: The FreeBSD Foundation


# 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

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

show more ...


# 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

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

show more ...


# 27d39026 12-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 inter

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

show more ...


# 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 converti

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

show more ...


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

kern: efirt: enter runtime environment to deref efi_cfgtbl

This fixes an insta-panic when EFIIOC_GET_TABLE is used.

Reviewed by: imp (earlier version), kib
MFC after: 1 week
Differential Revision:

kern: efirt: enter runtime environment to deref efi_cfgtbl

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

show more ...


# 75dfc66c 27-Feb-2020 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r358269 through r358399.


# 7029da5c 26-Feb-2020 Pawel Biernacki <kaktus@FreeBSD.org>

Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly mark

Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)

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

show more ...


# 0269ae4c 06-Jun-2019 Alan Somers <asomers@FreeBSD.org>

MFHead @348740

Sponsored by: The FreeBSD Foundation


# b5c45a3e 03-Jun-2019 Konstantin Belousov <kib@FreeBSD.org>

efirt efi_enter(): Release acquired locks and restore FPU ownership if
efi_arch_enter() returned an error.

Submitted: Jan Martin Mikkelsen <janm@transactionware.com>
MFC after: 1 week


# 26649bb5 15-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

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

show more ...


# 3af64f03 11-Sep-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r338392 through r338594.


# 8e6e1ba8 04-Sep-2018 Konstantin Belousov <kib@FreeBSD.org>

Assign to correct structure members.

Reported by: cem from Coverity
Sponsored by: The FreeBSD Foundation
MFC after: 6 days
Approved by: re (gjb)


123456