public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: edk2-devel@lists.01.org
Cc: ard.biesheuvel@linaro.org, Jian J Wang <jian.j.wang@intel.com>,
	Hao Wu <hao.a.wu@intel.com>, Ray Ni <ray.ni@intel.com>,
	Star Zeng <star.zeng@intel.com>, Andrew Fish <afish@apple.com>,
	Laszlo Ersek <lersek@redhat.com>,
	Michael D Kinney <michael.d.kinney@intel.com>
Subject: [RFC PATCH] MdeModulePkg: add LockBoxNullLib for !IA32/X64 in .dsc
Date: Mon, 18 Mar 2019 14:56:25 +0000	[thread overview]
Message-ID: <20190318145625.29000-1-leif.lindholm@linaro.org> (raw)

Commit 05fd2a926833
("MdeModulePkg/NvmExpressPei: Consume S3StorageDeviceInitList LockBox")
added a dependency on LockBoxLib to NvmExpressPei, causing builds using
MdeModulePkg.dsc to fail on architectures other than IA32/X64 with
missing reference to
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode.

Add a resolution for LockBoxNullLib for ARM/AARCH64 to restore builds.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
---

Note: this patch hides the symptom, but this isn't really the fix I
would like to see.

The build error is caused by the chain of:
1) NvmExpressPei depending on LockBoxLib
2) LockBoxLib being mapped to SmmLockBoxPeiLib in [LibraryClasses.common.PEIM]
3) SmmLockBoxPeiLib depending on PcdDxeIplSwitchToLongMode
4) PcdDxeIplSwitchToLongMode being declared in
   [PcdsFeatureFlag.IA32, PcdsFeatureFlag.X64] in MdeModulePkg.dsc

Now, an alternative quick-fix would be to move the PEIM LockBoxLib mapping
into a [LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM]
section. But that would leave NvmExpressPei unbuildable on anything not
IA32/X64.

Another option would be to add default declaration (for all other
architectures) of FALSE for PcdDxeIplSwitchToLongMode in MdeModulePkg.dec,
but the current way this is expressed seems to treat this as an
architecture-specific feature (which it is).

What I believe would be the cleanest solution would be to abstract
NvmExpressPei to the point where it can function without the LockBoxLib.
But regardless, it does not look valid to me for something as
architecture-specific as MdeModulePkg/Library/SmmLockBoxLib/ to live under
.common sections in the .dsc. (And if this changes at some point, because we implement an ARM/AARCH64 equivalent based on StandaloneMmPkg, we will need
a major refactoring of that library anyway.)

/
    Leif

MdeModulePkg/MdeModulePkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 6cd1727a0d..6e27e9cb68 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -178,6 +178,7 @@ [LibraryClasses.common.MM_STANDALONE]
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
   ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
+  LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
 
   #
   # It is not possible to prevent ARM compiler calls to generic intrinsic functions.
-- 
2.11.0



             reply	other threads:[~2019-03-18 14:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 14:56 Leif Lindholm [this message]
2019-03-20 14:51 ` [RFC PATCH] MdeModulePkg: add LockBoxNullLib for !IA32/X64 in .dsc Laszlo Ersek
2019-03-20 15:41   ` Zeng, Star
2019-03-20 17:43   ` Leif Lindholm
2019-03-21  1:03     ` Zeng, Star
2019-03-21  3:27       ` Wu, Hao A
2019-03-22 18:13         ` Leif Lindholm
2019-03-25  2:17           ` Wu, Hao A
2019-03-26 19:43             ` Leif Lindholm
2019-03-27  1:00               ` Wu, Hao A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190318145625.29000-1-leif.lindholm@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox