public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 1/3] AcpiDebugFeaturePkg: Included modules are mutually exclusive
@ 2022-07-25 17:12 Benjamin Doron
  2022-07-25 17:12 ` [PATCH v1 2/3] UserAuthFeaturePkg: Included DXE versions " Benjamin Doron
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Benjamin Doron @ 2022-07-25 17:12 UTC (permalink / raw)
  To: devel
  Cc: Sai Chaganty, Isaac Oram, Nate DeSimone, Ankit Sinha, Liming Gao,
	Eric Dong

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.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Benjamin Doron <benjamin.doron00@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              |TRUE
diff --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              |FALSE
diff --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/AcpiDebug.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.dec
@@ -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/AcpiDebugFeature.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
+!endif
diff --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.fdf
@@ -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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-08-16 21:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-25 17:12 [PATCH v1 1/3] AcpiDebugFeaturePkg: Included modules are mutually exclusive Benjamin Doron
2022-07-25 17:12 ` [PATCH v1 2/3] UserAuthFeaturePkg: Included DXE versions " Benjamin Doron
2022-08-08 22:51   ` Oram, Isaac W
2022-08-09 17:09     ` Benjamin Doron
2022-08-16 21:26       ` Oram, Isaac W
2022-07-25 17:12 ` [PATCH v1 3/3] LogoFeaturePkg,BoardModulePkg: Set existing logo as BGRT Benjamin Doron
2022-08-09 17:51   ` Oram, Isaac W
2022-08-08 19:21 ` [edk2-devel] [PATCH v1 1/3] AcpiDebugFeaturePkg: Included modules are mutually exclusive Oram, Isaac W
     [not found] ` <170974F020AA914C.7247@groups.io>
2022-08-08 19:26   ` Oram, Isaac W

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox