public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Bret Barkelew" <bret@corthon.com>
To: devel@edk2.groups.io
Cc: Jian J Wang <jian.j.wang@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Dandan Bi <dandan.bi@intel.com>,
	Sean Brogan <sean.brogan@microsoft.com>
Subject: [PATCH v2 09/16] MdeModulePkg: Swap to MmuLib instead of Arm-specific lib
Date: Tue,  2 Nov 2021 13:17:41 -0700	[thread overview]
Message-ID: <20211102201748.1963-10-brbarkel@microsoft.com> (raw)
In-Reply-To: <20211102201748.1963-1-brbarkel@microsoft.com>

From: Bret Barkelew <brbarkel@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3651

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
---
 MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c | 4 ++--
 MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf        | 4 +---
 MdeModulePkg/MdeModulePkg.dsc                  | 3 +--
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c
index 6619a650661b..16c20930a662 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c
@@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include "DxeIpl.h"
 
-#include <Library/ArmMmuLib.h>
+#include <Library/MmuLib.h>
 
 /**
    Transfers control to DxeCore.
@@ -40,7 +40,7 @@ HandOffToDxeCore (
   ASSERT (BaseOfStack != NULL);
 
   if (PcdGetBool (PcdSetNxForStack)) {
-    Status = ArmSetMemoryRegionNoExec ((UINTN)BaseOfStack, STACK_SIZE);
+    Status = MmuSetAttributes ((UINTN)BaseOfStack, STACK_SIZE, EFI_MEMORY_XP);
     ASSERT_EFI_ERROR (Status);
   }
 
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
index 19b8a4c8aefa..3634d836548f 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
@@ -57,8 +57,6 @@ [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
 
-[Packages.ARM, Packages.AARCH64]
-  ArmPkg/ArmPkg.dec
 
 [LibraryClasses]
   PcdLib
@@ -77,7 +75,7 @@ [LibraryClasses]
   PerformanceLib
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
-  ArmMmuLib
+  MmuLib
 
 [Ppis]
   gEfiDxeIplPpiGuid                      ## PRODUCES
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index ab505f5bb2c6..20790145d5bf 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -103,6 +103,7 @@ [LibraryClasses]
   DisplayUpdateProgressLib|MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.inf
   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
   MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf
+  MmuLib|MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf
 
 [LibraryClasses.EBC.PEIM]
   IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
@@ -174,8 +175,6 @@ [LibraryClasses.common.MM_STANDALONE]
   MemLib|StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
-  ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
-  ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
   LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
 
   #
-- 
2.31.1.windows.1


  parent reply	other threads:[~2021-11-02 20:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 20:17 [PATCH v2 00/16] Un-siloing Arm common code Bret Barkelew
2021-11-02 20:17 ` [PATCH v2 01/16] ArmPkg/ArmMmuBaseLib: Disallow STANDALONE_MM Bret Barkelew
2021-11-02 20:17 ` [PATCH v2 02/16] ArmPkg/ArmMmuStandaloneMmLib: Update to match ArmMmuLib Bret Barkelew
2021-11-04 12:14   ` Leif Lindholm
2021-11-02 20:17 ` [PATCH v2 03/16] ArmPkg/StandaloneMmCoreEntryPoint: Swap to ArmMmuLib Bret Barkelew
2021-11-02 20:17 ` [PATCH v2 04/16] ArmPkg: Disavow StandaloneMmMmuLib. It's just ArmMmuLib Bret Barkelew
2021-11-02 20:17 ` [PATCH v2 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg Bret Barkelew
2021-11-04 12:16   ` Leif Lindholm
2021-11-02 20:17 ` [PATCH v2 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools Bret Barkelew
2021-11-02 20:17 ` [PATCH v2 07/16] ArmPkg and MdePkg: Move the AsmMacroIoLib from ArmPkg to MdePkg Bret Barkelew
2021-11-04 12:17   ` Leif Lindholm
2021-11-05  5:12     ` 回复: [edk2-devel] " gaoliming
2021-11-02 20:17 ` [PATCH v2 08/16] MdePkg: Create the MMU access lib to abstract memory protection settings Bret Barkelew
2021-11-02 20:17 ` Bret Barkelew [this message]
2021-11-02 20:17 ` [PATCH v2 10/16] StandaloneMmPkg: Switch to the MmuLib abstraction Bret Barkelew
2021-11-02 20:17 ` [PATCH v2 11/16] ArmPkg: Add Basic MMU Lib for Arm silicon Bret Barkelew
2021-11-04 12:43   ` Leif Lindholm
2021-11-10 20:39     ` Bret Barkelew
2021-11-02 20:17 ` [PATCH v2 12/16] ArmPkg: Move the StandaloneMmCpu driver to ArmPkg Bret Barkelew
2021-11-02 20:17 ` [PATCH v2 13/16] ArmPkg: Move the StandaloneMmCoreEntryPoint lib " Bret Barkelew
2021-11-02 20:17 ` [PATCH v2 14/16] ArmPkg/Library: Convert StandaloneMmCoreEntryPoint to Arm-only Bret Barkelew
2021-11-02 20:17 ` [PATCH v2 15/16] ArmPkg/ArmPkg.dsc: Resolve build errors resulting from package moves Bret Barkelew
2021-11-02 20:17 ` [PATCH v2 16/16] ArmPlatformPkg: " Bret Barkelew
2021-11-06  9:50   ` [edk2-devel] " Marvin Häuser
2021-11-08 19:25     ` [EXTERNAL] " Bret Barkelew

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=20211102201748.1963-10-brbarkel@microsoft.com \
    --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