Repository navigation
Conversation
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.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
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? |
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. |
|
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. |
v1_resource_descriptor_support featurev1_resource_descriptor_support feature
|
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"] |
There was a problem hiding this comment.
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.
|
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 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). |
Description
This commit removes the
v1_resource_descriptor_supportfeature 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.
How This Was Tested
N/A
Integration Instructions
A platform with
v1_resource_descriptor_hob_supportfeature enabled should update their platform'sMemoryInfotrait implementation as follows: