From: Hao Wu <hao.a.wu@intel.com>
To: edk2-devel@lists.01.org
Cc: Jiewen Yao <jiewen.yao@intel.com>, Star Zeng <star.zeng@intel.com>
Subject: [PATCH 6/6] MdeModulePkg/DxeCore: Not update RtCode in MemAttrTable after EndOfDxe
Date: Fri, 20 Jul 2018 13:26:26 +0800 [thread overview]
Message-ID: <20180720052626.24932-7-hao.a.wu@intel.com> (raw)
In-Reply-To: <20180720052626.24932-1-hao.a.wu@intel.com>
From: Jiewen Yao <jiewen.yao@intel.com>
We want to provide precise info in MemAttribTable
to both OS and SMM, and SMM only gets the info at EndOfDxe.
So we do not update RtCode entry in EndOfDxe.
The impact is that if 3rd part OPROM is runtime, it cannot be executed
at UEFI runtime phase.
Currently, we do not see compatibility issue, because the only runtime
OPROM we found before in UNDI, and UEFI OS will not use UNDI interface
in OS.
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
---
MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
index a84507df95..a96d442fbc 100644
--- a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
+++ b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
@@ -62,6 +62,8 @@ EFI_LOCK mPropertiesTableLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_NOTI
BOOLEAN mPropertiesTableEnable;
+BOOLEAN mPropertiesTableEndOfDxe = FALSE;
+
//
// Below functions are for MemoryMap
//
@@ -1079,6 +1081,11 @@ InsertImageRecord (
DEBUG ((EFI_D_VERBOSE, "InsertImageRecord - 0x%x\n", RuntimeImage));
DEBUG ((EFI_D_VERBOSE, "InsertImageRecord - 0x%016lx - 0x%016lx\n", (EFI_PHYSICAL_ADDRESS)(UINTN)RuntimeImage->ImageBase, RuntimeImage->ImageSize));
+ if (mPropertiesTableEndOfDxe) {
+ DEBUG ((DEBUG_INFO, "Do not insert runtime image record after EndOfDxe\n"));
+ return ;
+ }
+
ImageRecord = AllocatePool (sizeof(*ImageRecord));
if (ImageRecord == NULL) {
return ;
@@ -1296,6 +1303,11 @@ RemoveImageRecord (
DEBUG ((EFI_D_VERBOSE, "RemoveImageRecord - 0x%x\n", RuntimeImage));
DEBUG ((EFI_D_VERBOSE, "RemoveImageRecord - 0x%016lx - 0x%016lx\n", (EFI_PHYSICAL_ADDRESS)(UINTN)RuntimeImage->ImageBase, RuntimeImage->ImageSize));
+ if (mPropertiesTableEndOfDxe) {
+ DEBUG ((DEBUG_INFO, "Do not remove runtime image record after EndOfDxe\n"));
+ return ;
+ }
+
ImageRecord = FindImageRecord ((EFI_PHYSICAL_ADDRESS)(UINTN)RuntimeImage->ImageBase, RuntimeImage->ImageSize);
if (ImageRecord == NULL) {
DEBUG ((EFI_D_ERROR, "!!!!!!!! ImageRecord not found !!!!!!!!\n"));
@@ -1333,6 +1345,7 @@ InstallPropertiesTable (
VOID *Context
)
{
+ mPropertiesTableEndOfDxe = TRUE;
if (PcdGetBool (PcdPropertiesTableEnable)) {
EFI_STATUS Status;
--
2.16.2.windows.1
next prev parent reply other threads:[~2018-07-20 5:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-20 5:26 [PATCH 0/6] Check untested memory and EFI_MEMORY_RO Hao Wu
2018-07-20 5:26 ` [PATCH 1/6] MdePkg/SmmMemLib: Check for untested memory in GCD Hao Wu
2018-07-20 5:26 ` [PATCH 2/6] UefiCpuPkg/PiSmmCpu: " Hao Wu
2018-07-20 5:26 ` [PATCH 3/6] MdeModulePkg/DxeCore: Install UEFI mem attrib table at EndOfDxe Hao Wu
2018-07-20 5:26 ` [PATCH 4/6] MdePkg/SmmMemLib: Check EFI_MEMORY_RO in UEFI mem attrib table Hao Wu
2018-07-20 5:26 ` [PATCH 5/6] UefiCpuPkg/PiSmmCpu: Check EFI_RUNTIME_RO " Hao Wu
2018-07-20 5:26 ` Hao Wu [this message]
2018-07-23 0:47 ` [PATCH 0/6] Check untested memory and EFI_MEMORY_RO Zeng, Star
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=20180720052626.24932-7-hao.a.wu@intel.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