diff options
author | Tom Lendacky <thomas.lendacky@amd.com> | 2021-01-07 12:48:20 -0600 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-01-07 19:34:39 +0000 |
commit | 60b195d257ebf263cfd0d198ee2c4f84fd36f14c (patch) | |
tree | cc0baa4a6ff7c6363e17fba0b0ae673785827692 /OvmfPkg | |
parent | 31f5ebd6db0805cdcafb1312a91b60d14ff1ac24 (diff) | |
download | edk2-60b195d257ebf263cfd0d198ee2c4f84fd36f14c.tar.gz edk2-60b195d257ebf263cfd0d198ee2c4f84fd36f14c.tar.bz2 edk2-60b195d257ebf263cfd0d198ee2c4f84fd36f14c.zip |
OvmfPkg/MemEncryptSevLib: Coding style fixes in prep for SEC library
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
Creating an SEC version of the library requires renaming an existing file
which will result in the existing code failing ECC. Prior to renaming the
existing file, fix the coding style to avoid the ECC failure.
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Message-Id: <f765d867da4a703e0a0db35e26515a911482fd40.1610045305.git.thomas.lendacky@amd.com>
Diffstat (limited to 'OvmfPkg')
-rw-r--r-- | OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c index 6422bc53bd..3a5bab657b 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c @@ -192,7 +192,8 @@ Split2MPageTo4K ( {
PHYSICAL_ADDRESS PhysicalAddress4K;
UINTN IndexOfPageTableEntries;
- PAGE_TABLE_4K_ENTRY *PageTableEntry, *PageTableEntry1;
+ PAGE_TABLE_4K_ENTRY *PageTableEntry;
+ PAGE_TABLE_4K_ENTRY *PageTableEntry1;
UINT64 AddressEncMask;
PageTableEntry = AllocatePageTableMemory(1);
@@ -472,7 +473,7 @@ Split1GPageTo2M ( /**
Set or Clear the memory encryption bit
- @param[in] PagetablePoint Page table entry pointer (PTE).
+ @param[in, out] PageTablePointer Page table entry pointer (PTE).
@param[in] Mode Set or Clear encryption bit
**/
@@ -562,7 +563,6 @@ EnableReadOnlyPageWriteProtect ( @retval RETURN_UNSUPPORTED Setting the memory encyrption attribute
is not supported
**/
-
STATIC
RETURN_STATUS
EFIAPI
@@ -635,7 +635,7 @@ SetMemoryEncDec ( Status = EFI_SUCCESS;
- while (Length)
+ while (Length != 0)
{
//
// If Cr3BaseAddress is not specified then read the current CR3
@@ -683,7 +683,7 @@ SetMemoryEncDec ( // Valid 1GB page
// If we have at least 1GB to go, we can just update this entry
//
- if (!(PhysicalAddress & (BIT30 - 1)) && Length >= BIT30) {
+ if ((PhysicalAddress & (BIT30 - 1)) == 0 && Length >= BIT30) {
SetOrClearCBit(&PageDirectory1GEntry->Uint64, Mode);
DEBUG ((
DEBUG_VERBOSE,
@@ -744,7 +744,7 @@ SetMemoryEncDec ( // Valid 2MB page
// If we have at least 2MB left to go, we can just update this entry
//
- if (!(PhysicalAddress & (BIT21-1)) && Length >= BIT21) {
+ if ((PhysicalAddress & (BIT21-1)) == 0 && Length >= BIT21) {
SetOrClearCBit (&PageDirectory2MEntry->Uint64, Mode);
PhysicalAddress += BIT21;
Length -= BIT21;
|