Page MenuHomeFreeBSD

efidev: add support for memory attribute
ClosedPublic

Authored by aokblast on Apr 24 2025, 12:42 PM.
Tags
None
Referenced Files
F134126479: D49998.diff
Fri, Oct 31, 12:03 AM
Unknown Object (File)
Wed, Oct 29, 5:08 AM
Unknown Object (File)
Sun, Oct 26, 4:21 AM
Unknown Object (File)
Sat, Oct 25, 6:52 PM
Unknown Object (File)
Sat, Oct 25, 11:11 AM
Unknown Object (File)
Fri, Oct 24, 4:27 AM
Unknown Object (File)
Sun, Oct 19, 12:44 PM
Unknown Object (File)
Wed, Oct 15, 6:59 AM
Subscribers

Details

Summary

The EFI_PROPERTIES_TABLE of EFI is deprecated.
The suggested table is EFI_MEMORY_ATTRIBUTES_TABLE that has a
new header and data format

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 63698
Build 60582: arc lint + arc unit

Event Timeline

Do you have docs for this new table?
And I'm uneasy about this being an enum, but I have to think about that a bit more.

In D49998#1140497, @imp wrote:

Do you have docs for this new table?
And I'm uneasy about this being an enum, but I have to think about that a bit more.

Is the documentation from UEFI forum enough for you? https://uefi.org/specs/UEFI/2.10/04_EFI_System_Table.html

When you search the EFI_PROPERTIES_TABLE, it will tell you this table is deprecated and recommend you to switch to MEMORY_ATTRIBUTE.

Both my intel ultra framework laptop and zen5 desktop don't have EFI_PROPERTIES_TABLE now.

This looks good to me. Maybe you can commit it now that you have a commit bit.
I'd had it in my queue to commit when I had some time, but I've checked on what I was worried about now and I'm good.
I don't know what your mentor arrangement is, but hopefully you can commit this before too long...

This revision is now accepted and ready to land.Jul 19 2025, 4:48 AM

Thanks! I will do some format check before I add my mentor. BTW, should we print efi_memory_descriptor in efitable.c? I am not sure what is the original purpose of the properties table even after reviewing the commit message and log.

I'm unsure of its purpose as well. The only improvement I can see here is to print the actual attribute entires maybe? You just print the headers here.

Print information of the efi_memory_descriptor

This revision now requires review to proceed.Jul 19 2025, 8:02 PM

I try to make it works on my AMD 7000 series Framework laptop. However, it seems that this laptop has neither this table nor the original properties table.

Besides, I made a mistake on the descriptor_size. This member records the size of a single descriptor instead of the total size of the descriptors. Which means the total size is descriptor_size * num_ents. Fixed it inside the kernel.

usr.sbin/efitable/efitable.8
60 ↗(On Diff #158793)

memory should go in the middle for alphabetical organization

I will do all modification after my mentors (LiWen and markj) comments together.

sys/dev/efidev/efirt.c
463

M_WAITOK allocations always succeed, don't check them for NULL.

485

Same here.

Actually, what's the purpose of copying all of the table entries here? You are just immediately freeing the buffer below.

usr.sbin/efitable/efitable.c
269

Remove unnecessary malloc and reorder man page

Approved (one style nit is inline)

usr.sbin/efitable/efitable.c
270
This revision is now accepted and ready to land.Jul 21 2025, 1:52 PM

Same style comment, but this looks good now.

This revision was automatically updated to reflect the committed changes.