MdeModulePkg/DxeCore: Not update RtCode in MemAttrTable after EndOfDxe

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.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Jiewen Yao 2017-11-24 09:21:54 +08:00
parent 8a2e1a9d54
commit 4a723ed258
1 changed files with 13 additions and 0 deletions

View File

@ -62,6 +62,8 @@ EFI_LOCK mPropertiesTableLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_NOTI
BOOLEAN mPropertiesTableEnable; BOOLEAN mPropertiesTableEnable;
BOOLEAN mPropertiesTableEndOfDxe = FALSE;
// //
// Below functions are for MemoryMap // 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%x\n", RuntimeImage));
DEBUG ((EFI_D_VERBOSE, "InsertImageRecord - 0x%016lx - 0x%016lx\n", (EFI_PHYSICAL_ADDRESS)(UINTN)RuntimeImage->ImageBase, RuntimeImage->ImageSize)); 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)); ImageRecord = AllocatePool (sizeof(*ImageRecord));
if (ImageRecord == NULL) { if (ImageRecord == NULL) {
return ; return ;
@ -1296,6 +1303,11 @@ RemoveImageRecord (
DEBUG ((EFI_D_VERBOSE, "RemoveImageRecord - 0x%x\n", RuntimeImage)); 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)); 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); ImageRecord = FindImageRecord ((EFI_PHYSICAL_ADDRESS)(UINTN)RuntimeImage->ImageBase, RuntimeImage->ImageSize);
if (ImageRecord == NULL) { if (ImageRecord == NULL) {
DEBUG ((EFI_D_ERROR, "!!!!!!!! ImageRecord not found !!!!!!!!\n")); DEBUG ((EFI_D_ERROR, "!!!!!!!! ImageRecord not found !!!!!!!!\n"));
@ -1333,6 +1345,7 @@ InstallPropertiesTable (
VOID *Context VOID *Context
) )
{ {
mPropertiesTableEndOfDxe = TRUE;
if (PcdGetBool (PcdPropertiesTableEnable)) { if (PcdGetBool (PcdPropertiesTableEnable)) {
EFI_STATUS Status; EFI_STATUS Status;