Page MenuHomeFreeBSD

LinuxKPI: Implement efi_enabled(EFI_BOOT)
ClosedPublic

Authored by wulf on Dec 6 2021, 11:59 AM.
Tags
None
Referenced Files
F109925857: D33300.diff
Tue, Feb 11, 7:57 AM
Unknown Object (File)
Sat, Feb 1, 2:01 AM
Unknown Object (File)
Fri, Jan 24, 9:09 PM
Unknown Object (File)
Dec 28 2024, 5:50 AM
Unknown Object (File)
Dec 12 2024, 5:31 AM
Unknown Object (File)
Dec 5 2024, 2:08 AM
Unknown Object (File)
Sep 26 2024, 3:12 AM
Unknown Object (File)
Sep 24 2024, 10:33 PM

Details

Summary

efi_enabled(EFI_BOOT) returns true if machine was booted from EFI
Used by drm-kmod and some unported drm drivers like hyperv

MFC after: 1 week

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43186
Build 40074: arc lint + arc unit

Event Timeline

wulf requested review of this revision.Dec 6 2021, 11:59 AM
sys/compat/linuxkpi/common/include/linux/efi.h
58

Is it possible to catch this compile time with a static assert, CTASSERT() or _Static_assert() ?

Add _Static_assert wrapper for compile-time argument checking

This revision is now accepted and ready to land.Dec 6 2021, 12:55 PM
sys/compat/linuxkpi/common/include/linux/efi.h
56

I thought we had a more direct EFI enabled variable these days....

bool efi_boot;

in machdep.c. Is there some reason that wasn't used? We use the above to search it out early in boot, why not use the cached result?

bz added inline comments.
sys/compat/linuxkpi/common/include/linux/efi.h
30

_BSD_LKPI_ is a new one to me; can that be _LINUXKPI_ ?

sys/compat/linuxkpi/common/include/linux/efi.h
30

It must be _LINUX_EFI_H_. I will fix it.

56

efi_boot is defined on amd64 only while MODINFOMD_EFI_MAP exists on every platform which is able to boot from EFI

Use cached efi_boot value on amd64

This revision now requires review to proceed.Dec 6 2021, 10:48 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 10 2022, 7:51 PM
This revision was automatically updated to reflect the committed changes.