-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename EDKII_PEI_MP_SERVICES2_PPI to EFI_PEI_MP_SERVICES2_PPI #10775
base: master
Are you sure you want to change the base?
Conversation
PR can not be merged due to conflict. Please rebase and resubmit |
e6b9dad
to
55550fd
Compare
Thank you for starting this cleanup. I am wondering if we should keep an alias of the EDK II PPI structure and EDK II GUID to allow downstream consumers time to migrate from the EDK II names to the EFI names. |
55550fd
to
3898c20
Compare
3898c20
to
96a8469
Compare
@mdkinney Sure, the header and the PPI GUID have now been retained for backwards compatibility. |
96a8469
to
3e87d0b
Compare
@@ -151,8 +151,6 @@ | |||
# | |||
|
|||
[Ppis] | |||
gEdkiiPeiMpServices2PpiGuid = { 0x5cb9cb3d, 0x31a4, 0x480c, { 0x94, 0x98, 0x29, 0xd2, 0x69, 0xba, 0xcf, 0xba}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is removed, how could it maintain backwards compatibility for the code still consuming this GUID ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is, since the PPI GUID has been moved to MdePkg.dec as gEfiPeiMpServices2PpiGuid.
Having the same GUID here with a diffrent name will lead to a build error.
I don't believe it is possible to have an alias or Conditional Processing in DEC.
Is there a way around this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is removed, how could it maintain backwards compatibility for the code still consuming this GUID ?
The PR changed the PPI name which already breaks the backward compatibility:)
I thought we would maintain it through typedef and two Guid Name pointing to same GUID value for a while.
- @mdkinney for comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The EDK II GUID and the EFI GUID should never have used the same GUID value. I think that is a bug in the PI Spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GUID has existed in PI Spec since the 1.8 version (Released on Mar 03, 2023) and in edk2 since the edk2-stable201908 tag.
We would have to sacrifice backwards compatibility in either PI Spec or edk2. Or find a way to have two GUID Names pointing to the same GUID value in DEC files.
CC: @felixpgithub
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to generate a build warning for builds that are using the EDK II prefixed names so all consumers know to update and we can remove the EDK II names as quickly as possible?
Given that build warnings are fatal these days anyway, this will break the build for those consumers.
So what we might do instead is declare the EDKII aliases conditionally, based on a pre-processor #define. That gives out-of-tree platforms an easy way to fix the broken build (adding the -D
option to the compiler command line) when they upgrade, and this also serves as a natural opt-in to the deprecation and subsequent removal of those definitions. (i.e., setting the -D
option implies an acknowledgement of the deprecation).
[For the GUID in particular, we could force a build error if the -D
option is not set by conditionally emitting a declaration of gEdkiiPeiMpServices2PpiGuid
into the PPI header with a conflicting type, considering that #ifdefs don't work in .DEC files]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That matches what we have done in the past for the unsafe string functions using the define DISABLE_NEW_DEPRECATED_INTERFACES
. Though I notice that has been removed from code but is still in many DSC files.
So suggestion is to remove MpServices.h from UefiCpuPkg. Add MpServices.h to MdePkg following PI spec and add something like #ifdef ENABLE_DEPRECATED_EDKII_MP_SERVICES around EDK II typedef and GUID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ardbiesheuvel @mdkinney Thank you for your comments.
MpServices2.h has been removed from UefiCpuPkg and the instance in MdePkg has been modified for conditional backwards compatibility.
Also I believe it will be worth it to leave DISABLE_NEW_DEPRECATED_INTERFACES in the DSC files for now.
In UEFI 2.10A specification there are a bunch of items which were removed. These are definitions and interfaces which were deprecated in earlier versions of the spec and have been removed now.
Some of them are :
- gEfiDeviceIoProtocolGuid
- gEfiUgaIoProtocolGuid
- gEfiUgaDrawProtocolGuid
- gEfiScsiPassThruProtocolGuid
- EFI_VARIABLE_AUTHENTICATION
- EFI_IP4_CONFIG_PROTOCOL
- EFI_DRIVER_CONFIGURATION_PROTOCOL
- EFI_DRIVER_DIAGNOSTICS_PROTOCOL
- EFI_COMPONENT_NAME_PROTOCOL
I was thinking of creating a PR which will remove some of these and wrap up the others in DISABLE_NEW_DEPRECATED_INTERFACES.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend a new define name be used for this and the define name should include the name/version of the spec the items were deprecated. That way, a platform can choose which deprecated items to keep or not based in spec name/version. This also makes it easier to review platform DSC file for these types of defines.
For example, for UEFI 2.10, we could use a define name such as ENABLE_UEFI_2_10_DEPRECATED_INTERFACES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it @mdkinney. Thank you!
3e87d0b
to
aaa2788
Compare
aaa2788
to
a848e25
Compare
a848e25
to
2af0bb6
Compare
2af0bb6
to
5fac6c9
Compare
Please ensure that no platform gets broken even temporarily when only some of the patches are applied in the order you are presenting them here. Generally, that means the following when renaming and/or moving something
|
5fac6c9
to
29d5949
Compare
@ardbiesheuvel The commits have been re-ordered. |
#define gEdkiiPeiMpServices2PpiGuid gEfiPeiMpServices2PpiGuid | ||
|
||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order for this series to be bisectable, these declarations should be combined with the first patch, and the same patch should remove the original header file from UefiCpuPkg. Only the #ifdef/#endif should be added at the very end of the series.
Otherwise, there will be ambiguity around which set of declarations are visible when compiling code that depends on both MdePkg and UefiCpuPkg.
Doing so will break code that relies on UefiCpuPkg but not on MdePkg, but the assumption is that such code does not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that these declarations should be combined with the first patch. But if the same patch should remove the original header file from UefiCpuPkg, that would mean that MdePkg changes and UefiCpuPkg would be going into the same commit.
And I believe cross-package commits are not permitted in edk2.
We could avoid this, if we bank on the assumption there there would be no code that relies on UefiCpuPkg but not on MdePkg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that these declarations should be combined with the first patch. But if the same patch should remove the original header file from UefiCpuPkg, that would mean that MdePkg changes and UefiCpuPkg would be going into the same commit.
And I believe cross-package commits are not permitted in edk2.
It is permitted in exceptional cases.
We could avoid this, if we bank on the assumption there there would be no code that relies on UefiCpuPkg but not on MdePkg.
That still means that the new header file that you introduce, which has the same base name, must provide both the old and the new PPI, without relying on any #defines.
So
- patch
#1
adds the new header in MdePkg, with backward-compatible aliases defined unconditionally - patch
#2
removes the old header - patches
#3
-#(n-1)
update the in-tree users - patch
#n
adds the #ifdef conditionals around the backward-compatible aliases.
How does that sound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds Good @ardbiesheuvel. The commits have been changed accordingly.
EFI_PEI_MP_SERVICES2_PPI has been added to MdePkg. This PPI earlier existed as EDKII_PEI_MP_SERVICES2_PPI in UefiCpuPkg. EDKII_PEI_MP_SERVICES2_PPI structure and PPI GUID are provided as references for backwards compatibility. Signed-off-by: Sachin Ganesh <[email protected]>
EDKII_PEI_MP_SERVICES2_PPI has been renamed to EFI_PEI_MP_SERVICES2_PPI and moved to MdePkg. The related header and PPI GUID has been removed from UefiCpuPkg Signed-off-by: Sachin Ganesh <[email protected]>
EDKII_PEI_MP_SERVICES2_PPI has been renamed to EFI_PEI_MP_SERVICES2_PPI and moved to MdePkg. Relevant changes have been made here. Signed-off-by: Sachin Ganesh <[email protected]>
EDKII_PEI_MP_SERVICES2_PPI has been renamed to EFI_PEI_MP_SERVICES2_PPI and moved to MdePkg. Relevant changes have been made here. Signed-off-by: Sachin Ganesh <[email protected]>
EDKII_PEI_MP_SERVICES2_PPI has been renamed to EFI_PEI_MP_SERVICES2_PPI and moved to MdePkg. Relevant changes have been made here. Signed-off-by: Sachin Ganesh <[email protected]>
EDKII_PEI_MP_SERVICES2_PPI has been renamed to EFI_PEI_MP_SERVICES2_PPI and moved to MdePkg. Relevant changes have been made here. Signed-off-by: Sachin Ganesh <[email protected]>
EDKII_PEI_MP_SERVICES2_PPI has been renamed to EFI_PEI_MP_SERVICES2_PPI and moved to MdePkg. Relevant changes have been made here. Signed-off-by: Sachin Ganesh <[email protected]>
EDKII_PEI_MP_SERVICES2_PPI has been renamed to EFI_PEI_MP_SERVICES2_PPI and moved to MdePkg. Relevant changes have been made here. Signed-off-by: Sachin Ganesh <[email protected]>
EDKII_PEI_MP_SERVICES2_PPI has been renamed to EFI_PEI_MP_SERVICES2_PPI and moved to MdePkg. EDKII_PEI_MP_SERVICES2_PPI structure and PPI GUID are provided as backward compatible references. These references have been wrapped under a conditional to aid with its eventual removal. To enable, define ENABLE_DEPRECATED_EDKII_MP_SERVICES2. Signed-off-by: Sachin Ganesh <[email protected]>
29d5949
to
2489b3a
Compare
Description
EDKII_PEI_MP_SERVICES2_PPI was introduced in https://mantis.uefi.org/mantis/view.php?id=2160
As per the naming conventions of the PI specification, it should be renamed to EFI_PEI_MP_SERVICES2_PPI.
The PI specification correction has been submitted in this mantis ticket: https://mantis.uefi.org/mantis/view.php?id=2500
How This Was Tested
Integration Instructions
Multi Processor Services 2 PPI consumers have to use the PPI structure EFI_PEI_MP_SERVICES2_PPI present in MdePkg/Include/Ppi/MpServices2.h and PPI GUID gEfiPeiMpServices2PpiGuid from MdePkg.