summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/IoMmuDxe
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2017-08-02 11:26:42 +0200
committerLaszlo Ersek <lersek@redhat.com>2017-08-05 01:31:52 +0200
commitdc194ce36d04d3c99234f5c6e37ebe987758db4c (patch)
tree84eadd9e8203e2bb4b8c82097e96cb023f718329 /OvmfPkg/IoMmuDxe
parent812568fb871fc4fe5a6dd4f8c3fd624da449cf4d (diff)
downloadedk2-dc194ce36d04d3c99234f5c6e37ebe987758db4c.tar.gz
edk2-dc194ce36d04d3c99234f5c6e37ebe987758db4c.tar.bz2
edk2-dc194ce36d04d3c99234f5c6e37ebe987758db4c.zip
OvmfPkg/IoMmuDxe: rename DeviceAddress to PlainTextAddress in MAP_INFO
In this particular IOMMU driver, "DeviceAddress" is just as accessible to the CPU as "HostAddress", the difference is that the area pointed-to by the former is plain-text and accessible to the hypervisor. Rename "DeviceAddress" to "PlainTextAddress" in MAP_INFO. 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> Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> 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>
Diffstat (limited to 'OvmfPkg/IoMmuDxe')
-rw-r--r--OvmfPkg/IoMmuDxe/AmdSevIoMmu.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c
index edef0f41ee..fcb7bcfaec 100644
--- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c
+++ b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c
@@ -25,7 +25,7 @@ typedef struct {
UINTN NumberOfBytes;
UINTN NumberOfPages;
EFI_PHYSICAL_ADDRESS HostAddress;
- EFI_PHYSICAL_ADDRESS DeviceAddress;
+ EFI_PHYSICAL_ADDRESS PlainTextAddress;
} MAP_INFO;
#define NO_MAPPING (VOID *) (UINTN) -1
@@ -145,7 +145,7 @@ IoMmuMap (
MapInfo->NumberOfBytes = *NumberOfBytes;
MapInfo->NumberOfPages = EFI_SIZE_TO_PAGES (MapInfo->NumberOfBytes);
MapInfo->HostAddress = PhysicalAddress;
- MapInfo->DeviceAddress = DmaMemoryTop;
+ MapInfo->PlainTextAddress = DmaMemoryTop;
//
// Allocate a buffer to map the transfer to.
@@ -154,7 +154,7 @@ IoMmuMap (
AllocateType,
EfiBootServicesData,
MapInfo->NumberOfPages,
- &MapInfo->DeviceAddress
+ &MapInfo->PlainTextAddress
);
if (EFI_ERROR (Status)) {
FreePool (MapInfo);
@@ -167,7 +167,7 @@ IoMmuMap (
//
Status = MemEncryptSevClearPageEncMask (
0,
- MapInfo->DeviceAddress,
+ MapInfo->PlainTextAddress,
MapInfo->NumberOfPages,
TRUE
);
@@ -181,7 +181,7 @@ IoMmuMap (
if (Operation == EdkiiIoMmuOperationBusMasterRead ||
Operation == EdkiiIoMmuOperationBusMasterRead64) {
CopyMem (
- (VOID *) (UINTN) MapInfo->DeviceAddress,
+ (VOID *) (UINTN) MapInfo->PlainTextAddress,
(VOID *) (UINTN) MapInfo->HostAddress,
MapInfo->NumberOfBytes
);
@@ -190,7 +190,7 @@ IoMmuMap (
//
// The DeviceAddress is the address of the maped buffer below 4GB
//
- *DeviceAddress = MapInfo->DeviceAddress;
+ *DeviceAddress = MapInfo->PlainTextAddress;
//
// Return a pointer to the MAP_INFO structure in Mapping
@@ -199,9 +199,9 @@ IoMmuMap (
DEBUG ((
DEBUG_VERBOSE,
- "%a Device 0x%Lx Host 0x%Lx Pages 0x%Lx Bytes 0x%Lx\n",
+ "%a PlainText 0x%Lx Host 0x%Lx Pages 0x%Lx Bytes 0x%Lx\n",
__FUNCTION__,
- MapInfo->DeviceAddress,
+ MapInfo->PlainTextAddress,
MapInfo->HostAddress,
MapInfo->NumberOfPages,
MapInfo->NumberOfBytes
@@ -256,16 +256,16 @@ IoMmuUnmap (
MapInfo->Operation == EdkiiIoMmuOperationBusMasterWrite64) {
CopyMem (
(VOID *) (UINTN) MapInfo->HostAddress,
- (VOID *) (UINTN) MapInfo->DeviceAddress,
+ (VOID *) (UINTN) MapInfo->PlainTextAddress,
MapInfo->NumberOfBytes
);
}
DEBUG ((
DEBUG_VERBOSE,
- "%a Device 0x%Lx Host 0x%Lx Pages 0x%Lx Bytes 0x%Lx\n",
+ "%a PlainText 0x%Lx Host 0x%Lx Pages 0x%Lx Bytes 0x%Lx\n",
__FUNCTION__,
- MapInfo->DeviceAddress,
+ MapInfo->PlainTextAddress,
MapInfo->HostAddress,
MapInfo->NumberOfPages,
MapInfo->NumberOfBytes
@@ -275,7 +275,7 @@ IoMmuUnmap (
//
Status = MemEncryptSevSetPageEncMask (
0,
- MapInfo->DeviceAddress,
+ MapInfo->PlainTextAddress,
MapInfo->NumberOfPages,
TRUE
);
@@ -284,7 +284,7 @@ IoMmuUnmap (
//
// Free the mapped buffer and the MAP_INFO structure.
//
- gBS->FreePages (MapInfo->DeviceAddress, MapInfo->NumberOfPages);
+ gBS->FreePages (MapInfo->PlainTextAddress, MapInfo->NumberOfPages);
FreePool (Mapping);
return EFI_SUCCESS;
}