Page MenuHomeFreeBSD

loader.efi: smbios: Favor the v3 (64-bit) entry point
ClosedPublic

Authored by olce on Mar 7 2025, 4:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 10, 9:41 AM
Unknown Object (File)
Tue, Apr 8, 12:08 AM
Unknown Object (File)
Mar 23 2025, 10:58 AM
Unknown Object (File)
Mar 17 2025, 10:15 AM
Unknown Object (File)
Mar 15 2025, 12:06 PM
Unknown Object (File)
Mar 14 2025, 8:39 PM
Unknown Object (File)
Mar 14 2025, 7:12 PM
Unknown Object (File)
Mar 14 2025, 3:31 PM
Subscribers

Details

Summary

Be consistent with what we are now doing with non-EFI boot (but with the
difference that EFI runs in 64-bit mode on 64-bit platforms, so there is
no restriction that the v3 entry point should be below 4GB).

Diff Detail

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

Event Timeline

olce requested review of this revision.Mar 7 2025, 4:57 PM

I'd be tempted to save an indentation level and do continue if this vendor table isn't SMBIOS*. But it's not a clear win, so I'm mentioning it passing for your consideration.

I'd also be tempted to remove the #if !arm ifdef, but that's clearly a different change. the original was there only for early-days u-boot UEFI which was a bit rough and not very standards conformant.

Thanks for all the cleanups.

stand/efi/loader/main.c
1193

Mayb

This revision is now accepted and ready to land.Mar 7 2025, 5:47 PM
markj added inline comments.
stand/efi/loader/main.c
1193

Not sure if I'm completing Warner's thought here, but the need to use __unused here suggests that the smbios search loop would be nice to keep in its own conditionally defined subroutine. That would make control flow a bit simpler too (just return as soon as we find a 64-bit EP).

In D49292#1123971, @imp wrote:

I'd be tempted to save an indentation level and do continue if this vendor table isn't SMBIOS*. But it's not a clear win, so I'm mentioning it passing for your consideration.

Besides removing an indentation level, I think it's a small win also in cognitive burden, as one can eliminate these cases in their mind when reading the rest of the loop. I'll do it.

I'd also be tempted to remove the #if !arm ifdef, but that's clearly a different change. the original was there only for early-days u-boot UEFI which was a bit rough and not very standards conformant.

Yes, a different change, and I have no hardware to test that on. I only have amd64 machines currently. But maybe it's possible to test such things with QEMU?

Thanks for all the cleanups.

No problem. Since I had to read the spec, I thought I'd take the opportunity to review what exists and make sure we are both quite flexible when possible but also quite conservative with respect to what is mandated.

olce added inline comments.
stand/efi/loader/main.c
1193

Indeed. I've moved this code to a separate routine.

This revision was automatically updated to reflect the committed changes.
olce marked an inline comment as done.