diff options
author | Laszlo Ersek <lersek@redhat.com> | 2018-03-01 17:31:44 +0100 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2018-03-06 13:30:30 +0100 |
commit | 61a044c6c15f5806a30ff23409ba5287d9d07163 (patch) | |
tree | 028384126c251dabd3ad2005e7d9472385496187 /OvmfPkg/Include | |
parent | cd66bd73169fd8cd094887febab03a196d1bd996 (diff) | |
download | edk2-61a044c6c15f5806a30ff23409ba5287d9d07163.tar.gz edk2-61a044c6c15f5806a30ff23409ba5287d9d07163.tar.bz2 edk2-61a044c6c15f5806a30ff23409ba5287d9d07163.zip |
OvmfPkg/MemEncryptSevLib: find pages of initial SMRAM save state map
In the next three patches, we're going to modify three modules under
OvmfPkg. When OVMF is built with -D SMM_REQUIRE and runs in an SEV guest,
each affected module will have to know the page range that covers the
initial (pre-SMBASE relocation) SMRAM save state map. Add a helper
function to MemEncryptSevLib that calculates the "base address" and
"number of pages" constants for this page range.
(In a RELEASE build -- i.e., with assertions disabled and optimization
enabled --, the helper function can be compiled to store two constants
determined at compile time.)
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Diffstat (limited to 'OvmfPkg/Include')
-rw-r--r-- | OvmfPkg/Include/Library/MemEncryptSevLib.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/OvmfPkg/Include/Library/MemEncryptSevLib.h b/OvmfPkg/Include/Library/MemEncryptSevLib.h index e5ebb44018..1e2ec8641d 100644 --- a/OvmfPkg/Include/Library/MemEncryptSevLib.h +++ b/OvmfPkg/Include/Library/MemEncryptSevLib.h @@ -86,4 +86,27 @@ MemEncryptSevSetPageEncMask ( IN UINTN NumPages,
IN BOOLEAN Flush
);
+
+
+/**
+ Locate the page range that covers the initial (pre-SMBASE-relocation) SMRAM
+ Save State Map.
+
+ @param[out] BaseAddress The base address of the lowest-address page that
+ covers the initial SMRAM Save State Map.
+
+ @param[out] NumberOfPages The number of pages in the page range that covers
+ the initial SMRAM Save State Map.
+
+ @retval RETURN_SUCCESS BaseAddress and NumberOfPages have been set on
+ output.
+
+ @retval RETURN_UNSUPPORTED SMM is unavailable.
+**/
+RETURN_STATUS
+EFIAPI
+MemEncryptSevLocateInitialSmramSaveStateMapPages (
+ OUT UINTN *BaseAddress,
+ OUT UINTN *NumberOfPages
+ );
#endif // _MEM_ENCRYPT_SEV_LIB_H_
|