fv_read_section_efiapi: adjust data pointer - #1747
Conversation
✅ QEMU Validation PassedAll QEMU validation jobs completed successfully.
Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/32204217293 Boot Time to EFI Shell
Dependencies
This comment was automatically generated by the Patina QEMU PR Validation Post workflow. |
|
I accidentally clicked the copilot review button and now I'm not sure how to get it to stop, my apologies. |
fe73b13 to
ddde1a0
Compare
809618a to
0a68363
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- when FV section type EFI_SECTION_FREEFORM_SUBTYPE_GUID then the section content includes: 1) Section Header (4 Bytes) 2) Subtype GUID (16 Bytes) 3) Data payload (N Bytes) - read section function currently returns data pointer as section_start + sizeof(section_header) + sizeof(guid) - the correct data pointer would be section_start + sizeof(section_header) Signed-off-by: Oleg Ilyasov <olegi@ami.com>
- Fix the data pointer for several FV section types: Compression, GuidDefined, Version, FreeFormSubtypeGuid. - Add helper type_specific_header_bytes function onto the SectionHeader type for: 1) serialization - type-specific header is inserted between common header and the data 2) PI compliance - ReadSection should return type-specific header + content - Test: replace hardcoded data with size_of GUID Signed-off-by: Oleg Ilyasov <olegi@ami.com>
0a68363 to
52d448c
Compare
|
@olegilyasov, are you okay if this PR is squashed as a single commit? We can merge either way, but if you'd like separate commits, they'll need to be refactored so later commits are additive, and the changes are more logically grouped. |
Single commit is totally fine, thank you. |
Description
The fix changes fv_read_section_efiapi so FREEFORM_SUBTYPE_GUID returns the subtype GUID header bytes followed by the payload, instead of returning only the payload.
How This Was Tested
Added test_fv_read_section_freeform_subtype_returns_guid_plus_payload
Integration Instructions
N/A