Skip to content

[major] Make FromHob::parse fallible - #1839

Merged
makubacki merged 1 commit into
OpenDevicePartnership:majorfrom
makubacki:major_perf_config_hob_panic_to_dbg_assert
Oct 6, 2026
Merged

makubacki merged 1 commit into
OpenDevicePartnership:majorfrom
makubacki:major_perf_config_hob_panic_to_dbg_assert

Conversation

@makubacki

@makubacki makubacki commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Previously, FromHob::parse panicked on malformed guided HOB payloads.

Since HOBs are input data outside the DXE Core's (and component's) control, HOB parsing is naturally a fallible operation and treating it as such allows more robust HOB parsing and reduces the inclination to treat malformed HOBs as fatal errors.

Therefore, FromHob::parse now returns Result<Self, HobParseError>.

A HOB that fails to parse is logged and not registered, so components that depend on it are not dispatched.

Code that implemented FromHob is updated accordingly.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

  • cargo make all
  • Q35 boot to EFI shell with component dispatch

Integration Instructions

This is a breaking change because of the update to the parse method signature in the FromHob trait. Trait implementations will need to be updated to use the new method return value (as shown in examples in this commit).

Previously, `FromHob::parse` panicked on malformed guided HOB payloads.

Since HOBs are input data outside the DXE Core's (and component's)
control, HOB parsing is naturally a fallible operation and treating
it as such allows more robust HOB parsing and reduces the inclination
to treat malformed HOBs as fatal errors.

Therefore, `FromHob::parse` now returns `Result<Self, HobParseError>`.

A HOB that fails to parse is logged and not registered, so components
that depend on it are not dispatched.

Code that implemented FromHob is updated accordingly.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
@makubacki makubacki self-assigned this Oct 5, 2026
@github-actions github-actions Bot added impact:non-functional Does not have a functional impact impact:breaking-change Requires integration attention impact:testing Affects testing type:documentation Improvements or additions to documentation labels Oct 5, 2026
@makubacki makubacki removed the impact:non-functional Does not have a functional impact label Oct 5, 2026
@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sdk/patina/src/component/hob.rs 90.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@patina-automation

Copy link
Copy Markdown
Contributor

ℹ️ QEMU Validation Skipped - Unsupported Target Branch

The Patina QEMU PR validation workflow did not run because the PR targets an unsupported branch.

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/37388766757

Note: Previous results are available in this comment's edit history.

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@makubacki
makubacki merged commit 0f762ba into OpenDevicePartnership:major Oct 6, 2026
12 checks passed
makubacki added a commit that referenced this pull request Oct 9, 2026
Previously, `FromHob::parse` panicked on malformed guided HOB payloads.

Since HOBs are input data outside the DXE Core's (and component's)
control, HOB parsing is naturally a fallible operation and treating it
as such allows more robust HOB parsing and reduces the inclination to
treat malformed HOBs as fatal errors.

Therefore, `FromHob::parse` now returns `Result<Self, HobParseError>`.

A HOB that fails to parse is logged and not registered, so components
that depend on it are not dispatched.

Code that implemented `FromHob` is updated accordingly.

- [x] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [x] Includes tests?
- [x] Includes documentation?

- `cargo make all`
- Q35 boot to EFI shell with component dispatch

This is a breaking change because of the update to the `parse` method
signature in the `FromHob` trait. Trait implementations will need to be
updated to use the new method return value (as shown in examples in this
commit).

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
makubacki added a commit that referenced this pull request Oct 13, 2026
Previously, `FromHob::parse` panicked on malformed guided HOB payloads.

Since HOBs are input data outside the DXE Core's (and component's)
control, HOB parsing is naturally a fallible operation and treating it
as such allows more robust HOB parsing and reduces the inclination to
treat malformed HOBs as fatal errors.

Therefore, `FromHob::parse` now returns `Result<Self, HobParseError>`.

A HOB that fails to parse is logged and not registered, so components
that depend on it are not dispatched.

Code that implemented `FromHob` is updated accordingly.

- [x] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [x] Includes tests?
- [x] Includes documentation?

- `cargo make all`
- Q35 boot to EFI shell with component dispatch

This is a breaking change because of the update to the `parse` method
signature in the `FromHob` trait. Trait implementations will need to be
updated to use the new method return value (as shown in examples in this
commit).

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
makubacki added a commit that referenced this pull request Oct 13, 2026
Previously, `FromHob::parse` panicked on malformed guided HOB payloads.

Since HOBs are input data outside the DXE Core's (and component's)
control, HOB parsing is naturally a fallible operation and treating it
as such allows more robust HOB parsing and reduces the inclination to
treat malformed HOBs as fatal errors.

Therefore, `FromHob::parse` now returns `Result<Self, HobParseError>`.

A HOB that fails to parse is logged and not registered, so components
that depend on it are not dispatched.

Code that implemented `FromHob` is updated accordingly.

- [x] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [x] Includes tests?
- [x] Includes documentation?

- `cargo make all`
- Q35 boot to EFI shell with component dispatch

This is a breaking change because of the update to the `parse` method
signature in the `FromHob` trait. Trait implementations will need to be
updated to use the new method return value (as shown in examples in this
commit).

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
makubacki added a commit that referenced this pull request Oct 13, 2026
Previously, `FromHob::parse` panicked on malformed guided HOB payloads.

Since HOBs are input data outside the DXE Core's (and component's)
control, HOB parsing is naturally a fallible operation and treating it
as such allows more robust HOB parsing and reduces the inclination to
treat malformed HOBs as fatal errors.

Therefore, `FromHob::parse` now returns `Result<Self, HobParseError>`.

A HOB that fails to parse is logged and not registered, so components
that depend on it are not dispatched.

Code that implemented `FromHob` is updated accordingly.

- [x] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [x] Includes tests?
- [x] Includes documentation?

- `cargo make all`
- Q35 boot to EFI shell with component dispatch

This is a breaking change because of the update to the `parse` method
signature in the `FromHob` trait. Trait implementations will need to be
updated to use the new method return value (as shown in examples in this
commit).

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:breaking-change Requires integration attention impact:testing Affects testing type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants