Skip to content

[Bug]: Question for patina::pi::hob::Hob #1748

Description

@yangrongwei

Is there an existing issue for this?

  • I have searched existing issues

Current Behavior

https://github.com/OpenDevicePartnership/patina/blob/main/sdk/patina/src/pi/hob.rs

Hob Said

/// Union of all the possible HOB Types.
///
#[derive(Clone, Debug)]
pub enum Hob<'a> {

But it is not true. The MemoryPool and Unused are not covered.

Expected Behavior

The enum Hob and its iterator should support iterating through all HOBs intuitively.

SHOULD: Review or document the Hob::Misc design.

Per the spec and my understanding, HOB is an open design, and all HOBs share a common header. Binding to a generic header is more intuitive than using a heterogeneous integer representation. If we agree with this, the code should be refactored.

If we do not accept this, it would be better to add documentation explaining the rationale and the associated trade-offs.

Steps To Reproduce

Added a C-based CheckHobApp and rust-based chk-hob source code and checked logs.

Comparing the aaa and bbb, see the difference.

BTW, I know I can adjust the rust example to accommodate and hack the current Patina HOB behavior. I just want to say that current Hob::Misc is counterintuitive.

CheckHobApp.c.txt
chk-hob.rs.txt

aaa-by-EDK2-CheckHobApp.txt
bbb-by-Rust-chk-hob.txt

Build Environment

- OS(s): Windows 11
- Targets Impacted:

Version Information

Tag: v23.0.2

Urgency

Low

Are you going to fix this?

Someone else needs to fix it

Do you need maintainer feedback?

Maintainer feedback requested

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type:bugSomething isn't workingurgency:lowLittle to no impact

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions