Skip to content

Commit

Permalink
OvmfPkg/CcExitLib: Drop special handling for Encrypted MMIO to APIC
Browse files Browse the repository at this point in the history
The current #VC handler guards against MMIO to addresses that are mapped
with the encryption bit set, but has an special exception for MMIO
accesses to the APIC base address so allow for early access during SEC.

Now that the SEC page table has the encryption bit cleared for the APIC
base address range, there is no longer any need for this special
handling. Go ahead and remove it.

Cc: Ard Biesheuvel <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Erdem Aktas <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Min Xu <[email protected]>
Cc: Tom Lendacky <[email protected]>
Signed-off-by: Michael Roth <[email protected]>
Reviewed-by: Gerd Hoffmann <[email protected]>
  • Loading branch information
mdroth authored and mergify[bot] committed May 2, 2024
1 parent f0ed194 commit fecf55a
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions OvmfPkg/Library/CcExitLib/CcExitVcHandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ UnsupportedExit (
Validate that the MMIO memory access is not to encrypted memory.
Examine the pagetable entry for the memory specified. MMIO should not be
performed against encrypted memory. MMIO to the APIC page is always allowed.
performed against encrypted memory.
@param[in] Ghcb Pointer to the Guest-Hypervisor Communication Block
@param[in] MemoryAddress Memory address to validate
Expand All @@ -118,16 +118,6 @@ ValidateMmioMemory (
{
MEM_ENCRYPT_SEV_ADDRESS_RANGE_STATE State;
GHCB_EVENT_INJECTION GpEvent;
UINTN Address;

//
// Allow APIC accesses (which will have the encryption bit set during
// SEC and PEI phases).
//
Address = MemoryAddress & ~(SIZE_4KB - 1);
if (Address == GetLocalApicBaseAddress ()) {
return 0;
}

State = MemEncryptSevGetAddressRangeState (
0,
Expand Down

0 comments on commit fecf55a

Please sign in to comment.