Page MenuHomeFreeBSD

efirt: add hooks for diverging EFI implementations
ClosedPublic

Authored by royger on Feb 12 2021, 4:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 23, 2:16 AM
Unknown Object (File)
Tue, May 14, 11:26 AM
Unknown Object (File)
Sat, Apr 27, 7:42 PM
Unknown Object (File)
Sat, Apr 27, 7:42 PM
Unknown Object (File)
Sat, Apr 27, 7:42 PM
Unknown Object (File)
Sat, Apr 27, 7:42 PM
Unknown Object (File)
Sat, Apr 27, 7:29 PM
Unknown Object (File)
Apr 26 2024, 2:43 AM
Subscribers

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

For the reference, the user of this new interface is at: https://reviews.freebsd.org/D28621

Seems fine. The log could be a little clearer that FreeBSD needs to implement the EFI interfaces for pvefi, but if you can't make it clearer both the code and commit message are OK. And a comment where suggested would give the reader the proper context for the 'why' which wasn't immediately obvious to me.

sys/sys/efi.h
182–201

Might make sense to add that we either call the real efi firmware, or virtualize it for VMs in some kind of comment here.

This revision is now accepted and ready to land.Feb 12 2021, 5:44 PM
sys/dev/efidev/efirt.c
568

Should this be const.

I prefer to have this structure static, and use const struct efi_ops *active_efi_ops or such for calls, initialized at boot or module load.

  • Add comment in efi_ops struct to describe the intended usage.
  • Introduce active_efi_ops as a pointer to the currently in-use efi_ops.
This revision now requires review to proceed.Feb 15 2021, 9:34 AM
This revision is now accepted and ready to land.Feb 15 2021, 9:52 AM