mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 08:04:07 +02:00
OvmfPkg/BaseMemEncryptSevLib: break DEBUG calls to multiple lines
None of the DEBUG macro invocations in SetMemoryEncDec() fit on a single line. Break them to multiple lines, for (a) conforming to the coding style spec, (b) easier modification in later patches. 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> Reviewed-by: Brijesh Singh <brijesh.singh@amd.com> Tested-by: Brijesh Singh <brijesh.singh@amd.com>
This commit is contained in:
parent
70063aecde
commit
6692af92b1
@ -286,18 +286,26 @@ SetMemoryEncDec (
|
|||||||
PageMapLevel4Entry = (VOID*) (Cr3BaseAddress & ~PgTableMask);
|
PageMapLevel4Entry = (VOID*) (Cr3BaseAddress & ~PgTableMask);
|
||||||
PageMapLevel4Entry += PML4_OFFSET(PhysicalAddress);
|
PageMapLevel4Entry += PML4_OFFSET(PhysicalAddress);
|
||||||
if (!PageMapLevel4Entry->Bits.Present) {
|
if (!PageMapLevel4Entry->Bits.Present) {
|
||||||
DEBUG ((DEBUG_WARN,
|
DEBUG ((
|
||||||
"%a:%a ERROR bad PML4 for %lx\n", gEfiCallerBaseName, __FUNCTION__,
|
DEBUG_WARN,
|
||||||
PhysicalAddress));
|
"%a:%a ERROR bad PML4 for %lx\n",
|
||||||
|
gEfiCallerBaseName,
|
||||||
|
__FUNCTION__,
|
||||||
|
PhysicalAddress
|
||||||
|
));
|
||||||
return RETURN_NO_MAPPING;
|
return RETURN_NO_MAPPING;
|
||||||
}
|
}
|
||||||
|
|
||||||
PageDirectory1GEntry = (VOID*) ((PageMapLevel4Entry->Bits.PageTableBaseAddress<<12) & ~PgTableMask);
|
PageDirectory1GEntry = (VOID*) ((PageMapLevel4Entry->Bits.PageTableBaseAddress<<12) & ~PgTableMask);
|
||||||
PageDirectory1GEntry += PDP_OFFSET(PhysicalAddress);
|
PageDirectory1GEntry += PDP_OFFSET(PhysicalAddress);
|
||||||
if (!PageDirectory1GEntry->Bits.Present) {
|
if (!PageDirectory1GEntry->Bits.Present) {
|
||||||
DEBUG ((DEBUG_WARN,
|
DEBUG ((
|
||||||
"%a:%a ERROR bad PDPE for %lx\n", gEfiCallerBaseName,
|
DEBUG_WARN,
|
||||||
__FUNCTION__, PhysicalAddress));
|
"%a:%a ERROR bad PDPE for %lx\n",
|
||||||
|
gEfiCallerBaseName,
|
||||||
|
__FUNCTION__,
|
||||||
|
PhysicalAddress
|
||||||
|
));
|
||||||
return RETURN_NO_MAPPING;
|
return RETURN_NO_MAPPING;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,17 +319,25 @@ SetMemoryEncDec (
|
|||||||
//
|
//
|
||||||
if (!(PhysicalAddress & (BIT30 - 1)) && Length >= BIT30) {
|
if (!(PhysicalAddress & (BIT30 - 1)) && Length >= BIT30) {
|
||||||
SetOrClearCBit(&PageDirectory1GEntry->Uint64, Mode);
|
SetOrClearCBit(&PageDirectory1GEntry->Uint64, Mode);
|
||||||
DEBUG ((DEBUG_VERBOSE,
|
DEBUG ((
|
||||||
"%a:%a Updated 1GB entry for %lx\n", gEfiCallerBaseName,
|
DEBUG_VERBOSE,
|
||||||
__FUNCTION__, PhysicalAddress));
|
"%a:%a Updated 1GB entry for %lx\n",
|
||||||
|
gEfiCallerBaseName,
|
||||||
|
__FUNCTION__,
|
||||||
|
PhysicalAddress
|
||||||
|
));
|
||||||
PhysicalAddress += BIT30;
|
PhysicalAddress += BIT30;
|
||||||
Length -= BIT30;
|
Length -= BIT30;
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// We must split the page
|
// We must split the page
|
||||||
//
|
//
|
||||||
DEBUG ((DEBUG_VERBOSE,
|
DEBUG ((
|
||||||
"%a:%a Spliting 1GB page\n", gEfiCallerBaseName, __FUNCTION__));
|
DEBUG_VERBOSE,
|
||||||
|
"%a:%a Spliting 1GB page\n",
|
||||||
|
gEfiCallerBaseName,
|
||||||
|
__FUNCTION__
|
||||||
|
));
|
||||||
Split1GPageTo2M(((UINT64)PageDirectory1GEntry->Bits.PageTableBaseAddress)<<30, (UINT64*) PageDirectory1GEntry, 0, 0);
|
Split1GPageTo2M(((UINT64)PageDirectory1GEntry->Bits.PageTableBaseAddress)<<30, (UINT64*) PageDirectory1GEntry, 0, 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -333,9 +349,13 @@ SetMemoryEncDec (
|
|||||||
PageDirectory2MEntry = (VOID*) ((PageUpperDirectoryPointerEntry->Bits.PageTableBaseAddress<<12) & ~PgTableMask);
|
PageDirectory2MEntry = (VOID*) ((PageUpperDirectoryPointerEntry->Bits.PageTableBaseAddress<<12) & ~PgTableMask);
|
||||||
PageDirectory2MEntry += PDE_OFFSET(PhysicalAddress);
|
PageDirectory2MEntry += PDE_OFFSET(PhysicalAddress);
|
||||||
if (!PageDirectory2MEntry->Bits.Present) {
|
if (!PageDirectory2MEntry->Bits.Present) {
|
||||||
DEBUG ((DEBUG_WARN,
|
DEBUG ((
|
||||||
"%a:%a ERROR bad PDE for %lx\n", gEfiCallerBaseName, __FUNCTION__,
|
DEBUG_WARN,
|
||||||
PhysicalAddress));
|
"%a:%a ERROR bad PDE for %lx\n",
|
||||||
|
gEfiCallerBaseName,
|
||||||
|
__FUNCTION__,
|
||||||
|
PhysicalAddress
|
||||||
|
));
|
||||||
return RETURN_NO_MAPPING;
|
return RETURN_NO_MAPPING;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -354,9 +374,13 @@ SetMemoryEncDec (
|
|||||||
//
|
//
|
||||||
// We must split up this page into 4K pages
|
// We must split up this page into 4K pages
|
||||||
//
|
//
|
||||||
DEBUG ((DEBUG_VERBOSE,
|
DEBUG ((
|
||||||
"%a:%a Spliting 2MB page at %lx\n", gEfiCallerBaseName,__FUNCTION__,
|
DEBUG_VERBOSE,
|
||||||
PhysicalAddress));
|
"%a:%a Spliting 2MB page at %lx\n",
|
||||||
|
gEfiCallerBaseName,
|
||||||
|
__FUNCTION__,
|
||||||
|
PhysicalAddress
|
||||||
|
));
|
||||||
Split2MPageTo4K (((UINT64)PageDirectory2MEntry->Bits.PageTableBaseAddress) << 21, (UINT64*) PageDirectory2MEntry, 0, 0);
|
Split2MPageTo4K (((UINT64)PageDirectory2MEntry->Bits.PageTableBaseAddress) << 21, (UINT64*) PageDirectory2MEntry, 0, 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -365,9 +389,13 @@ SetMemoryEncDec (
|
|||||||
PageTableEntry = (VOID*) (PageDirectoryPointerEntry->Bits.PageTableBaseAddress<<12 & ~PgTableMask);
|
PageTableEntry = (VOID*) (PageDirectoryPointerEntry->Bits.PageTableBaseAddress<<12 & ~PgTableMask);
|
||||||
PageTableEntry += PTE_OFFSET(PhysicalAddress);
|
PageTableEntry += PTE_OFFSET(PhysicalAddress);
|
||||||
if (!PageTableEntry->Bits.Present) {
|
if (!PageTableEntry->Bits.Present) {
|
||||||
DEBUG ((DEBUG_WARN,
|
DEBUG ((
|
||||||
"%a:%a ERROR bad PTE for %lx\n", gEfiCallerBaseName,
|
DEBUG_WARN,
|
||||||
__FUNCTION__, PhysicalAddress));
|
"%a:%a ERROR bad PTE for %lx\n",
|
||||||
|
gEfiCallerBaseName,
|
||||||
|
__FUNCTION__,
|
||||||
|
PhysicalAddress
|
||||||
|
));
|
||||||
return RETURN_NO_MAPPING;
|
return RETURN_NO_MAPPING;
|
||||||
}
|
}
|
||||||
SetOrClearCBit (&PageTableEntry->Uint64, Mode);
|
SetOrClearCBit (&PageTableEntry->Uint64, Mode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user