MdeModulePkg/PiSmmCore: AllocatePool should use MemoryType.
PiSmmCore supports page level protection based upon the Memory Type (EfiRuntimeServicesCode/EfiRuntimeServicesData) and PE image. However, the Memory Type information is ignored in AllocatePool(). If a caller calls AllocatePool with EfiRuntimeServicesCode, the final memory is still allocated as EfiRuntimeServicesData. This patch supports AllocatePool with EfiRuntimeServicesCode. Cc: Jeff Fan <jeff.fan@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
@@ -1109,8 +1109,9 @@ extern LIST_ENTRY mSmmMemoryMap;
|
||||
#define MAX_POOL_INDEX (MAX_POOL_SHIFT - MIN_POOL_SHIFT + 1)
|
||||
|
||||
typedef struct {
|
||||
UINTN Size;
|
||||
BOOLEAN Available;
|
||||
UINTN Size;
|
||||
BOOLEAN Available;
|
||||
EFI_MEMORY_TYPE Type;
|
||||
} POOL_HEADER;
|
||||
|
||||
typedef struct {
|
||||
@@ -1118,6 +1119,12 @@ typedef struct {
|
||||
LIST_ENTRY Link;
|
||||
} FREE_POOL_HEADER;
|
||||
|
||||
extern LIST_ENTRY mSmmPoolLists[MAX_POOL_INDEX];
|
||||
typedef enum {
|
||||
SmmPoolTypeCode,
|
||||
SmmPoolTypeData,
|
||||
SmmPoolTypeMax,
|
||||
} SMM_POOL_TYPE;
|
||||
|
||||
extern LIST_ENTRY mSmmPoolLists[SmmPoolTypeMax][MAX_POOL_INDEX];
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user