OvmfPkg/IoMmuDxe: rename HostAddress to CryptedAddress in MAP_INFO

As a continuation of the last patch, clarify that the area pointed-to by
"HostAddress" is encrypted and hidden from the hypervisor.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
This commit is contained in:
Laszlo Ersek 2017-08-02 11:34:18 +02:00
parent dc194ce36d
commit c7ef2ed274

View File

@ -24,7 +24,7 @@ typedef struct {
EDKII_IOMMU_OPERATION Operation; EDKII_IOMMU_OPERATION Operation;
UINTN NumberOfBytes; UINTN NumberOfBytes;
UINTN NumberOfPages; UINTN NumberOfPages;
EFI_PHYSICAL_ADDRESS HostAddress; EFI_PHYSICAL_ADDRESS CryptedAddress;
EFI_PHYSICAL_ADDRESS PlainTextAddress; EFI_PHYSICAL_ADDRESS PlainTextAddress;
} MAP_INFO; } MAP_INFO;
@ -144,7 +144,7 @@ IoMmuMap (
MapInfo->Operation = Operation; MapInfo->Operation = Operation;
MapInfo->NumberOfBytes = *NumberOfBytes; MapInfo->NumberOfBytes = *NumberOfBytes;
MapInfo->NumberOfPages = EFI_SIZE_TO_PAGES (MapInfo->NumberOfBytes); MapInfo->NumberOfPages = EFI_SIZE_TO_PAGES (MapInfo->NumberOfBytes);
MapInfo->HostAddress = PhysicalAddress; MapInfo->CryptedAddress = PhysicalAddress;
MapInfo->PlainTextAddress = DmaMemoryTop; MapInfo->PlainTextAddress = DmaMemoryTop;
// //
@ -182,7 +182,7 @@ IoMmuMap (
Operation == EdkiiIoMmuOperationBusMasterRead64) { Operation == EdkiiIoMmuOperationBusMasterRead64) {
CopyMem ( CopyMem (
(VOID *) (UINTN) MapInfo->PlainTextAddress, (VOID *) (UINTN) MapInfo->PlainTextAddress,
(VOID *) (UINTN) MapInfo->HostAddress, (VOID *) (UINTN) MapInfo->CryptedAddress,
MapInfo->NumberOfBytes MapInfo->NumberOfBytes
); );
} }
@ -199,10 +199,10 @@ IoMmuMap (
DEBUG (( DEBUG ((
DEBUG_VERBOSE, DEBUG_VERBOSE,
"%a PlainText 0x%Lx Host 0x%Lx Pages 0x%Lx Bytes 0x%Lx\n", "%a PlainText 0x%Lx Crypted 0x%Lx Pages 0x%Lx Bytes 0x%Lx\n",
__FUNCTION__, __FUNCTION__,
MapInfo->PlainTextAddress, MapInfo->PlainTextAddress,
MapInfo->HostAddress, MapInfo->CryptedAddress,
MapInfo->NumberOfPages, MapInfo->NumberOfPages,
MapInfo->NumberOfBytes MapInfo->NumberOfBytes
)); ));
@ -255,7 +255,7 @@ IoMmuUnmap (
if (MapInfo->Operation == EdkiiIoMmuOperationBusMasterWrite || if (MapInfo->Operation == EdkiiIoMmuOperationBusMasterWrite ||
MapInfo->Operation == EdkiiIoMmuOperationBusMasterWrite64) { MapInfo->Operation == EdkiiIoMmuOperationBusMasterWrite64) {
CopyMem ( CopyMem (
(VOID *) (UINTN) MapInfo->HostAddress, (VOID *) (UINTN) MapInfo->CryptedAddress,
(VOID *) (UINTN) MapInfo->PlainTextAddress, (VOID *) (UINTN) MapInfo->PlainTextAddress,
MapInfo->NumberOfBytes MapInfo->NumberOfBytes
); );
@ -263,10 +263,10 @@ IoMmuUnmap (
DEBUG (( DEBUG ((
DEBUG_VERBOSE, DEBUG_VERBOSE,
"%a PlainText 0x%Lx Host 0x%Lx Pages 0x%Lx Bytes 0x%Lx\n", "%a PlainText 0x%Lx Crypted 0x%Lx Pages 0x%Lx Bytes 0x%Lx\n",
__FUNCTION__, __FUNCTION__,
MapInfo->PlainTextAddress, MapInfo->PlainTextAddress,
MapInfo->HostAddress, MapInfo->CryptedAddress,
MapInfo->NumberOfPages, MapInfo->NumberOfPages,
MapInfo->NumberOfBytes MapInfo->NumberOfBytes
)); ));