From 1532e5d5ed393154abdd88fad41f99decae98cb4 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Thu, 1 Mar 2018 15:15:39 +0100 Subject: [PATCH] OvmfPkg/MemEncryptSevLib: clean up InternalMemEncryptSevSetMemoryDecrypted() decl The declaration and the definition(s) of the function should have identical leading comments and/or identical parameter lists. Document the "Cr3BaseAddress" parameter, and correct several parameter references. Replace a "set" reference to the C-bit with a "clear" reference. Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Tested-by: Brijesh Singh Reviewed-by: Brijesh Singh --- .../BaseMemEncryptSevLib/X64/VirtualMemory.c | 6 ++++-- .../BaseMemEncryptSevLib/X64/VirtualMemory.h | 14 ++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c index aed9212762..3f7704801c 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c @@ -826,8 +826,10 @@ Done: /** This function clears memory encryption bit for the memory region specified by - PhysicalAddress and length from the current page table context. + PhysicalAddress and Length from the current page table context. + @param[in] Cr3BaseAddress Cr3 Base Address (if zero then use + current CR3) @param[in] PhysicalAddress The physical address that is the start address of a memory region. @param[in] Length The length of memory region @@ -837,7 +839,7 @@ Done: @retval RETURN_SUCCESS The attributes were cleared for the memory region. @retval RETURN_INVALID_PARAMETER Number of pages is zero. - @retval RETURN_UNSUPPORTED Setting the memory encyrption attribute + @retval RETURN_UNSUPPORTED Clearing the memory encyrption attribute is not supported **/ RETURN_STATUS diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h index 7dd1bbe0eb..646a9781d0 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h @@ -188,8 +188,10 @@ typedef struct { /** This function clears memory encryption bit for the memory region specified by - PhysicalAddress and length from the current page table context. + PhysicalAddress and Length from the current page table context. + @param[in] Cr3BaseAddress Cr3 Base Address (if zero then use + current CR3) @param[in] PhysicalAddress The physical address that is the start address of a memory region. @param[in] Length The length of memory region @@ -199,16 +201,16 @@ typedef struct { @retval RETURN_SUCCESS The attributes were cleared for the memory region. @retval RETURN_INVALID_PARAMETER Number of pages is zero. - @retval RETURN_UNSUPPORTED Setting the memory encyrption attribute + @retval RETURN_UNSUPPORTED Clearing the memory encyrption attribute is not supported **/ RETURN_STATUS EFIAPI InternalMemEncryptSevSetMemoryDecrypted ( - IN PHYSICAL_ADDRESS Cr3BaseAddress, - IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINT64 Length, - IN BOOLEAN CacheFlush + IN PHYSICAL_ADDRESS Cr3BaseAddress, + IN PHYSICAL_ADDRESS PhysicalAddress, + IN UINTN Length, + IN BOOLEAN Flush ); /**