diff options
author | Laszlo Ersek <lersek@redhat.com> | 2017-08-02 15:13:15 +0200 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2017-08-05 01:31:53 +0200 |
commit | e130229c0aea069f44fc942e585733b435680a35 (patch) | |
tree | 93d9a341b0a0c94e8b4a385bd462f3aaded1a66c /IntelFspPkg/Library | |
parent | bc1c2e49acbc8ccaf9f1b4f0c93470b4791539dc (diff) | |
download | edk2-e130229c0aea069f44fc942e585733b435680a35.tar.gz |
OvmfPkg/IoMmuDxe: rework setup of "MapInfo->PlainTextAddress" in Map()
There are three issues with the current calculations:
- The initial logic that sets up "DmaMemoryTop" and "AllocateType" checks
for the BusMasterCommonBuffer64 operation in two places. The inner check
for BusMasterCommonBuffer64 will never evaluate to TRUE however, because
the outer check excludes BusMasterCommonBuffer64.
- In order to lower "DmaMemoryTop" to (SIZE_4GB - 1), the outer check
requires that the encrypted (original) buffer cross the 4GB mark. This
is wrong: for BusMasterRead[64] and BusMasterWrite[64] operations, we
unconditionally need a bounce buffer (a decrypted memory area), and for
the 32-bit variants, "DmaMemoryTop" should be lowered regardless of the
location of the original (encrypted) buffer.
- The current logic would be hard to extend for the in-place decryption
that we'll implement in the next patch.
Therefore rework the "MapInfo->PlainTextAddress" setup. No functional
changes beyond said bugfixes.
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>
Diffstat (limited to 'IntelFspPkg/Library')
0 files changed, 0 insertions, 0 deletions