Page MenuHomeFreeBSD

efirt: add hooks for diverging EFI implementations
ClosedPublic

Authored by royger on Fri, Feb 12, 4:02 PM.

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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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.Fri, Feb 12, 5:44 PM
sys/dev/efidev/efirt.c
567

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.Mon, Feb 15, 9:34 AM
This revision is now accepted and ready to land.Mon, Feb 15, 9:52 AM