Pushed as edc718521e..d85e4251ce -----Original Message----- From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Oram, Isaac W Sent: Monday, August 8, 2022 12:22 PM To: devel@edk2.groups.io; benjamin.doro...@gmail.com Cc: Chaganty, Rangasai V <rangasai.v.chaga...@intel.com>; Desimone, Nathaniel L <nathaniel.l.desim...@intel.com>; Sinha, Ankit <ankit.si...@intel.com>; Gao, Liming <gaolim...@byosoft.com.cn>; Dong, Eric <eric.d...@intel.com> Subject: Re: [edk2-devel] [PATCH v1 1/3] AcpiDebugFeaturePkg: Included modules are mutually exclusive
Reviewed-by: Isaac Oram <isaac.w.o...@intel.com> -----Original Message----- From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Benjamin Doron Sent: Monday, July 25, 2022 10:12 AM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V <rangasai.v.chaga...@intel.com>; Oram, Isaac W <isaac.w.o...@intel.com>; Desimone, Nathaniel L <nathaniel.l.desim...@intel.com>; Sinha, Ankit <ankit.si...@intel.com>; Gao, Liming <gaolim...@byosoft.com.cn>; Dong, Eric <eric.d...@intel.com> Subject: [edk2-devel] [PATCH v1 1/3] AcpiDebugFeaturePkg: Included modules are mutually exclusive The DXE and SMM versions of AcpiDebug perform the same task and are therefore mutually exclusive. Including both modules results in a duplicate ACPI table, resulting in the feature not working at all. Therefore, add a new PCD to determine which module will be included. Now, either version successfully write to the debug buffer. Cc: Sai Chaganty <rangasai.v.chaga...@intel.com> Cc: Isaac Oram <isaac.w.o...@intel.com> Cc: Nate DeSimone <nathaniel.l.desim...@intel.com> Cc: Ankit Sinha <ankit.si...@intel.com> Cc: Liming Gao <gaolim...@byosoft.com.cn> Cc: Eric Dong <eric.d...@intel.com> Signed-off-by: Benjamin Doron <benjamin.doro...@gmail.com> --- Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 1 + Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc | 1 + Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c | 4 ++++ Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec | 1 + Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc | 3 +++ Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf | 7 +++++-- 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc index 28530b8c674b..908fe4d1f7a9 100644 --- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc @@ -48,6 +48,7 @@ # Debugging features # gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable |TRUE+ gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion |FALSE gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable |TRUE gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable |TRUE gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable |TRUEdiff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc index e214175edaf7..d59e3e61b9b9 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc +++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc @@ -59,6 +59,7 @@ # [PcdsFeatureFlag] gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable |FALSE+ gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion |FALSE gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable |FALSE gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable |FALSE gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable |FALSEdiff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c index 4caeffc7dec9..0b28e2f7a6d5 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiD +++ ebug.c @@ -483,6 +483,10 @@ InitializeAcpiDebugSmm ( EFI_SMM_BASE2_PROTOCOL *SmmBase2; BOOLEAN InSmm; + if (!PcdGetBool (PcdAcpiDebugFeatureActive)) {+ return EFI_SUCCESS;+ }+ Status = gBS->LocateProtocol (&gEfiSmmBase2ProtocolGuid, NULL, (VOID **) &SmmBase2); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) {diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec index 915923100731..1a290bab29d9 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.d +++ ec @@ -28,6 +28,7 @@ [PcdsFeatureFlag] gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable|FALSE|BOOLEAN|0xA0000001+ gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion|FALSE|BOOLEAN|0xA0000002 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] ## This PCD specifies the ACPI debug message buffer size.diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc index f5b8bacee039..684549bbdd78 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeat +++ ure.dsc @@ -54,5 +54,8 @@ # in the package build. # Add components here that should be included in the package build.+!if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion == FALSE AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf+!else AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf+!endifdiff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf index 855826292cb5..e904a2f8fbf2 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fd +++ f @@ -7,5 +7,8 @@ # ## -INF RuleOverride = DRIVER_ACPITABLE AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf-INF RuleOverride = DRIVER_ACPITABLE AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf+!if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion == FALSE+ INF RuleOverride = DRIVER_ACPITABLE AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf+!else+ INF RuleOverride = DRIVER_ACPITABLE AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf+!endif-- 2.36.1 -=-=-=-=-=-= Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91815): https://edk2.groups.io/g/devel/message/91815 Mute This Topic: https://groups.io/mt/92609642/1492418 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [isaac.w.o...@intel.com] -=-=-=-=-=-= -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92216): https://edk2.groups.io/g/devel/message/92216 Mute This Topic: https://groups.io/mt/92609642/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-