Skip to content

efi_loader: add EFI_PARTITION_INFO_PROTOCOL support

Javier Martinez Canillas u-boot 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 0 repliesNew
  2. v24 patches 8 repliesSuperseded
  3. v13 patches 14 repliesSuperseded

Changes in v3 from the cover letter

- Add ifdef guards for {EFI,DOS}_PARTITION being disabled (Ilias Apalodimas).
- Fix build in -next due missing part_efi.h header include (Ilias Apalodimas).
- Rebase on top of -next (Ilias Apalodimas).

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4disk: efi: Move logic to get a GPT entry into a helper functiondisk/part_efi.c+40 -270 replies
2/4disk: efi: expose the part_get_gpt_pte() helper functiondisk/part_efi.c include/part.h+15 -10 replies
3/4efi_loader: disk: add EFI_PARTITION_INFO_PROTOCOL supportinclude/part_efi.h lib/efi_loader/efi_disk.c+57 -20 replies
4/4efi_selftest: Add basic partition info check to block io testlib/efi_selftest/efi_selftest_block_device.c+30 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchIlias Apalodimas
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/4] efi_loader: add EFI_PARTITION_INFO_PROTOCOL support

This patch series implements support for the EFI_PARTITION_INFO_PROTOCOL, to provide cached partition information for GPT partition types.

The EFI specification mentions that the protocol can understand legacy MBR partition types, but that's for backward compatibility and not implemented by this series. It can be added as a follow-up if needed, to make it fully compliant with the spec.

Patch #1 moves the logic to get a GPT partition table entry to a helper part_get_gpt_pte() function.

Patch #2 exposes that helper function to be used by the efi_loader.

Patch #3 implements the actual protocol support using the mentioned helper to get the GPT partitions table entries.

Patch #4 extends the existing block io EFI selftest to also check for some cached data provided by the partition info protocol.

This is a v3 of the series, the v2 can be found here:

https://lists.denx.de/pipermail/u-boot/2025-June/592550.html

The EFI_PARTITION_INFO_PROTOCOL implementation is added unconditionally, because the u-boot-size-test.sh reports the code increase is negligible:

./u-boot-size-test.sh qemu_arm64_lwip --all
...
01: Merge patch series "list.h/treewide: get rid of no-op prefetch()"
02: disk: efi: Move logic to get a GPT entry into a helper function
03: disk: efi: expose the part_get_gpt_pte() helper function
04: efi_loader: disk: add EFI_PARTITION_INFO_PROTOCOL support
05: efi_selftest: Add basic partition info check to block io test
5 0 0 /5 qemu_arm64_lwip
Completed: 5 total built, 5 newly), duration 0:01:57, rate 0.04 /tmp/qemu_arm64_lwip/add-efi-part-info-proto-v3/boards.cfg is up to date. Nothing to do. Summary of 5 commits for 1 boards (1 thread, 8 jobs per thread)
01: Merge patch series "list.h/treewide: get rid of no-op prefetch()"
02: disk: efi: Move logic to get a GPT entry into a helper function
aarch64: (for 1/1 boards) all -64.0 text -64.0
qemu_arm64_lwip: all -64 text -64
u-boot: add: 0/0, grow: 0/-1 bytes: 0/-72 (-72)
function old new delta
part_get_info_efi 468 396 -72
03: disk: efi: expose the part_get_gpt_pte() helper function
aarch64: (for 1/1 boards) all +32.0 text +32.0
qemu_arm64_lwip: all +32 text +32
u-boot: add: 1/0, grow: 0/-1 bytes: 200/-164 (36)
function old new delta
part_get_gpt_pte - 200 +200
part_get_info_efi 396 232 -164
04: efi_loader: disk: add EFI_PARTITION_INFO_PROTOCOL support
aarch64: (for 1/1 boards) all +176.0 rodata +16.0 text +160.0
qemu_arm64_lwip: all +176 rodata +16 text +160
u-boot: add: 0/0, grow: 1/0 bytes: 148/0 (148)
function old new delta
static.efi_disk_add_dev 636 784 +148
05: efi_selftest: Add basic partition info check to block io test
aarch64: (for 1/1 boards) all +531.0 rodata +179.0 text +352.0
qemu_arm64_lwip: all +531 rodata +179 text +352
u-boot: add: 1/0, grow: 1/0 bytes: 384/0 (384)
function old new delta
execute 36428 36796 +368
partition_info_guid - 16 +16
(no errors to report)

Changes in v3:
- Add ifdef guards for {EFI,DOS}_PARTITION being disabled (Ilias Apalodimas).
- Fix build in -next due missing part_efi.h header include (Ilias Apalodimas).
- Rebase on top of -next (Ilias Apalodimas).

Changes in v2:
- Add a test for the EFI partition information protocol (Tom Rini).

Javier Martinez Canillas (4):
disk: efi: Move logic to get a GPT entry into a helper function
disk: efi: expose the part_get_gpt_pte() helper function
efi_loader: disk: add EFI_PARTITION_INFO_PROTOCOL support
efi_selftest: Add basic partition info check to block io test

 disk/part_efi.c                              | 67 ++++++++++++--------
 include/part.h                               | 14 ++++
 include/part_efi.h                           | 20 ++++++
 lib/efi_loader/efi_disk.c                    | 39 +++++++++++-
 lib/efi_selftest/efi_selftest_block_device.c | 30 +++++++++
 5 files changed, 141 insertions(+), 29 deletions(-)
Signature · 4 lines
2.49.0

base-commit: ce2a7fcbd565d55b1d3fdc0e68edd50a21eca7d4
branch: add-efi-part-info-proto-v3