MdeModulePkg: Added PcdEnableUserSpace.

This commit is contained in:
Mikhail Krichanov 2024-09-02 12:15:38 +03:00
parent 046dcae0e7
commit 13706cfb07
4 changed files with 21 additions and 8 deletions

View File

@ -217,6 +217,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdFwVolDxeMaxEncapsulationDepth ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFwVolDxeMaxEncapsulationDepth ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdImageLargeAddressLoad ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdImageLargeAddressLoad ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdEnableUserSpace ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdDebugRaisePropertyMask ## CONSUMES gEfiMdePkgTokenSpaceGuid.PcdDebugRaisePropertyMask ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdImageProtectionPolicy ## CONSUMES gEfiMdePkgTokenSpaceGuid.PcdImageProtectionPolicy ## CONSUMES
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase ## CONSUMES gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase ## CONSUMES

View File

@ -236,6 +236,7 @@ ProtectUefiImage (
// //
// CPU ARCH present. Update memory attribute directly. // CPU ARCH present. Update memory attribute directly.
// //
if (PcdGetBool (PcdEnableUserSpace)) {
if (AsciiStrStr (PdbPointer, "Fat") != NULL) { if (AsciiStrStr (PdbPointer, "Fat") != NULL) {
SetUefiImageProtectionAttributes (ImageRecord, TRUE); SetUefiImageProtectionAttributes (ImageRecord, TRUE);
*IsUserImage = TRUE; *IsUserImage = TRUE;
@ -247,6 +248,10 @@ ProtectUefiImage (
SetUefiImageProtectionAttributes (ImageRecord, FALSE); SetUefiImageProtectionAttributes (ImageRecord, FALSE);
*IsUserImage = FALSE; *IsUserImage = FALSE;
} }
} else {
SetUefiImageProtectionAttributes (ImageRecord, FALSE);
*IsUserImage = FALSE;
}
} }
Finish: Finish:

View File

@ -1204,6 +1204,12 @@
# @Prompt Defines the page allocation for the MM communication buffer; default is 128 pages (512KB). # @Prompt Defines the page allocation for the MM communication buffer; default is 128 pages (512KB).
gEfiMdeModulePkgTokenSpaceGuid.PcdMmCommBufferPages|128|UINT32|0x30001061 gEfiMdeModulePkgTokenSpaceGuid.PcdMmCommBufferPages|128|UINT32|0x30001061
## Indicates whether some DXE drivers will be loaded in user memory.
# TRUE - Some DXE drivers will be loaded in user memory.<BR>
# FALSE - All DXE drivers will be loaded in supervisor memory.<BR>
# @Prompt Enable User Space.
gEfiMdeModulePkgTokenSpaceGuid.PcdEnableUserSpace|FALSE|BOOLEAN|0x30001062
[PcdsFixedAtBuild, PcdsPatchableInModule] [PcdsFixedAtBuild, PcdsPatchableInModule]
## Dynamic type PCD can be registered callback function for Pcd setting action. ## Dynamic type PCD can be registered callback function for Pcd setting action.
# PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function

View File

@ -628,6 +628,7 @@
gEfiMdePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x00000003 gEfiMdePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x00000003
!endif !endif
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|TRUE
gEfiMdeModulePkgTokenSpaceGuid.PcdEnableUserSpace|TRUE
# #
# Firmware volume supports UE, and may require PE. # Firmware volume supports UE, and may require PE.