Skip to content

[major] patina_dxe_core: Remove v1_resource_descriptor_support feature - #1834

Closed
Javagedes wants to merge 1 commit into
OpenDevicePartnership:majorfrom
Javagedes:personal/joeyvagedes/drop-hob-feature-flag
Closed

Javagedes wants to merge 1 commit into
OpenDevicePartnership:majorfrom
Javagedes:personal/joeyvagedes/drop-hob-feature-flag

Conversation

@Javagedes

@Javagedes Javagedes commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

This commit removes the v1_resource_descriptor_support feature in favor of a MemoryInfo trait configuration to select the correct policy. It is expected that features in rust are additive. This feature is not. It swaps functionality and thus is not appropriate as a feature.

It was confirmed that during code optimization, the non-selected path was optimized out of the build, even on debug builds.

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

How This Was Tested

N/A

Integration Instructions

A platform with v1_resource_descriptor_hob_support feature enabled should update their platform's MemoryInfo trait implementation as follows:

use patina_dxe_core::{MemoryInfo, ResourceDescriptorHobPolicy};

struct Platform;

impl MemoryInfo for Platform {
    const RESOURCE_DESCRIPTOR_HOB_POLICY: ResourceDescriptorHobPolicy =
        ResourceDescriptorHobPolicy::V1;
}

This commit removes the `v1_resource_descriptor_support` feature in
favor of a MemoryInfo trait configuration to select the correct policy.

It was confirmed that during code optimization, the non-selected path
was optimized out of the build, even on debug builds.
@Javagedes
Javagedes requested a review from os-d October 1, 2026 17:15
@github-actions github-actions Bot added impact:breaking-change Requires integration attention impact:non-functional Does not have a functional impact impact:testing Affects testing type:documentation Improvements or additions to documentation labels Oct 1, 2026
@Javagedes Javagedes linked an issue Oct 1, 2026 that may be closed by this pull request
@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@makubacki

Copy link
Copy Markdown
Collaborator

The plan was to drop the feature soon (PI spec publication with V2 definition came out in July, edk2 code definitions in progress). Are you not concerned that this codifies long-term support for the "feature" which will make it more difficult to remove later?

@Javagedes

Copy link
Copy Markdown
Contributor Author

The plan was to drop the feature soon (PI spec publication with V2 definition came out in July, edk2 code definitions in progress). Are you not concerned that this codifies long-term support for the "feature" which will make it more difficult to remove later?

v1_resource_descriptor_support is marked in our documentation as a way to support an easy transition from EDK II. Even once support is added to EDK II, it is unlikely platforms will quickly replace their V1 functions with V2 functions in Platform PEI code.

If our intent is to remove the feature once V2 is available in EDK II regardless of that, then I agree this PR is probably not necessary and can be closed

Though I think it sets a good example of how we should allow core-level functionality configuration.

@os-d

os-d commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

I do think that the main reason we wanted this feature was before edk2 support was added, because for non-Mu platforms, this provided a significant challenge to onboarding. With edk2 support coming in soon, I would also be inclined to leave it as a feature and then deprecate the feature. New platform onboarding will be easier; any code that is not producing a V2 HOB can be updated in the platform as a temporary step until any partner code is updated, with partners having an easy path to update and the PI spec being pointed at to say this is why.

@Javagedes Javagedes changed the title patina_dxe_core: Remove v1_resource_descriptor_support feature [major] patina_dxe_core: Remove v1_resource_descriptor_support feature Oct 1, 2026
@makubacki

Copy link
Copy Markdown
Collaborator

I was looking at the v1 vs v2 code separated by the feature flag yesterday (because of the test issue with the feature enabled) and got the impression it's intentionally a little clumsy (not using unified code that acts on a v1/v2 discriminant) to make it cleaner to drop the v1 code when the feature was dropped.

The additive feature argument stands, but in the bigger picture, I'm hesitant about the disruption of dropping the feature now, for another path that puts v1 support on a long-term trajectory, if the plan remains to drop it soon anyway.

Will leave it to others on whether the tradeoff is worth it.

v1_resource_descriptor_support = []
# All non-std features to test in CI
ci_features = ["compatibility_mode_allowed", "confidential_compute", "debugger_reload", "unstable-device-path", "v1_resource_descriptor_support"]
ci_features = ["compatibility_mode_allowed", "confidential_compute", "debugger_reload", "unstable-device-path"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we envision dropping support for V1 in the future? If so, the feature is nice because it keeps the code isolated and easily removed by definitions and I would say keep it. If we intend on keeping this, then I think this change is reasonable.

@Javagedes

Copy link
Copy Markdown
Contributor Author

I'm fine with closing this PR for this feature since we will drop it.

But It still stands that I'm not a fan that we have a way to configure the core via feature flags and via changes to the PlatformInfo trait. I think we should investigate pushing all configuration through the trait.

This PR shows that the optimizer is smart enough to optimize out non-selected options when set only once at the top level trait. Even the enum used in this example had V1 variant optimized away when V2 was selected (and vise versa).

@Javagedes Javagedes closed this Oct 1, 2026
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:non-functional Does not have a functional impact impact:testing Affects testing type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: make v1_resource_descriptor_support feature additive

4 participants