public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms][PATCH v1 1/2] AcpiDebugFeaturePkg: Included modules are mutually exclusive
@ 2021-09-02 17:37 Benjamin Doron
  2021-09-02 17:37 ` [edk2-platforms][PATCH v1 2/2] UserAuthFeaturePkg: Included DXE versions " Benjamin Doron
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Doron @ 2021-09-02 17:37 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Eric Dong, Liming Gao, Nate DeSimone

The DXE and SMM versions of AcpiDebug perform the same functions, and
are therefore mutually exclusive. Including both modules results in a
duplicate ACPI table, resulting in the feature not working at all.

Therefore, we 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: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nate DeSimone <nathaniel.l.desimone@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       | 4 +++-
 6 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
index 0c7a29cc75ae..e9fabaade16f 100644
--- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
@@ -45,6 +45,7 @@
 ################################################################################
 [PcdsFeatureFlag]
   gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable            |TRUE
+  gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion                     |FALSE
   gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable                      |TRUE
   gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable                |TRUE
   gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable                          |TRUE
diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
index ad248de80087..3a6556cb0936 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
@@ -33,6 +33,7 @@
 #
 [PcdsFeatureFlag]
   gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable            |FALSE
+  gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion                     |FALSE
   gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable                      |FALSE
   gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable                |FALSE
   gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable                          |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 c3bd89fe2b9d..94e894d211ef 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 856222a53d2a..ca2d86080c26 100644
--- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
+++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
@@ -109,8 +109,11 @@
   # in the package build.
 
   # Add components here that should be included in the package build.
+!if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion == FALSE
   Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf
+!else
   Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf
+!endif
 
 ###################################################################################################
 #
diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf
index bbd6eca87b0c..e2ff3907a702 100644
--- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf
@@ -6,6 +6,8 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
-
+!if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion == FALSE
   INF RuleOverride = DRIVER_ACPITABLE Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf
+!else
   INF RuleOverride = DRIVER_ACPITABLE Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf
+!endif
-- 
2.31.1


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

* [edk2-platforms][PATCH v1 2/2] UserAuthFeaturePkg: Included DXE versions are mutually exclusive
  2021-09-02 17:37 [edk2-platforms][PATCH v1 1/2] AcpiDebugFeaturePkg: Included modules are mutually exclusive Benjamin Doron
@ 2021-09-02 17:37 ` Benjamin Doron
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Doron @ 2021-09-02 17:37 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Liming Gao, Dandan Bi

Versions of the DXE module perform nearly identical functions, and are
therefore mutually exclusive. Including both modules results in at least
a duplicate HII package and possibly an "already started" assert.

Therefore, we add a new PCD to determine which module will be included.
However, now a second bug can be seen: version 2 does not challenge for
the password. An RSC handler to hook UiApp entry is probably needed, as
in version 1.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@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/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf      | 4 +++-
 Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc | 3 +++
 Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec      | 3 ++-
 5 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
index e9fabaade16f..aabde1a3b417 100644
--- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
@@ -52,6 +52,7 @@
   gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable                  |TRUE
   gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable            |TRUE
   gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable    |TRUE
+  gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1                        |FALSE
   gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable                      |TRUE
   gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable                              |FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable                |FALSE
diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
index 3a6556cb0936..47df12e7a751 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
@@ -40,5 +40,6 @@
   gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable                  |FALSE
   gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable            |FALSE
   gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable    |FALSE
+  gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1                        |FALSE
   gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable                      |FALSE
   gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable                              |FALSE
diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
index f0b33aa44c9f..a3af61bfb70f 100644
--- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
@@ -6,7 +6,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
-
+!if gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1 == TRUE
   INF UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
+!else
   INF UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
+!endif
   INF UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
index d4f7a5ed2311..9b8c5ca63cd5 100644
--- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
+++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
@@ -125,8 +125,11 @@
   UserInterface/UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf
 
   # Add components here that should be included in the package build.
+!if gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1 == TRUE
   UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
+!else
   UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
+!endif
   UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
 
 ###################################################################################################
diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec
index a9174edd5486..209a0ba6a6c7 100644
--- a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec
+++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec
@@ -38,8 +38,9 @@
   gUserAuthenticationGuid = { 0xee24a7f7, 0x606b, 0x4724, { 0xb3, 0xc9, 0xf5, 0xae, 0x4a, 0x3b, 0x81, 0x65}}
 
 [PcdsFeatureFlag]
-  ## This PCD specifies whether StatusCode is reported via USB3 Serial port.
+  ## This PCD specifies whether user authentication feature is enabled.
   gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable|FALSE|BOOLEAN|0xA0000001
+  gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1|FALSE|BOOLEAN|0xA0000002
 
 [PcdsFixedAtBuild,PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
   ## Indicate whether the password is cleared.
-- 
2.31.1


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

end of thread, other threads:[~2021-09-02 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-02 17:37 [edk2-platforms][PATCH v1 1/2] AcpiDebugFeaturePkg: Included modules are mutually exclusive Benjamin Doron
2021-09-02 17:37 ` [edk2-platforms][PATCH v1 2/2] UserAuthFeaturePkg: Included DXE versions " Benjamin Doron

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