MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe: Add support for PCD PcdPteMemoryEncryptionAddressOrMask
This PCD holds the address mask for page table entries when memory encryption is enabled on AMD processors supporting the Secure Encrypted Virtualization (SEV) feature. This module updates the under-4GB page tables configured by the S3-Resume code in UefiCpuPkg/Universal/Acpi/S3Resume2Pei. The mask is saved at module start (ScriptExecute.c), and applied when tables are expanded on-demand by page-faults above 4GB's (SetIdtEntry.c). CC: Jeff Fan <jeff.fan@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Brijesh Singh <brijesh.singh@amd.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leo Duran <leo.duran@amd.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
in the entry point. The functionality is to interpret and restore the S3 boot script
|
||||
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
@@ -23,6 +24,7 @@ EFI_GUID mBootScriptExecutorImageGuid = {
|
||||
};
|
||||
|
||||
BOOLEAN mPage1GSupport = FALSE;
|
||||
UINT64 mAddressEncMask = 0;
|
||||
|
||||
/**
|
||||
Entry function of Boot script exector. This function will be executed in
|
||||
@@ -407,6 +409,11 @@ BootScriptExecutorEntryPoint (
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Make sure AddressEncMask is contained to smallest supported address field.
|
||||
//
|
||||
mAddressEncMask = PcdGet64 (PcdPteMemoryEncryptionAddressOrMask) & PAGING_1G_ADDRESS_MASK_64;
|
||||
|
||||
//
|
||||
// Test if the gEfiCallerIdGuid of this image is already installed. if not, the entry
|
||||
// point is loaded by DXE code which is the first time loaded. or else, it is already
|
||||
|
Reference in New Issue
Block a user