forked from tianocore/edk2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OvmfPkg: IommuDxe: Provide support for mapping BusMasterCommonBuffer …
…operation The current implementation was making assumption that AllocateBuffer() returns a buffer with C-bit cleared. Hence when we were asked to Map() with BusMasterCommonBuffer, we do not change the C-bit on host buffer. In previous patch, we changed the AllocateBuffer() to not clear C-bit during allocation. The patch adds support for handling the BusMasterCommonBuffer operations when SEV is active. A typical DMA Bus master Common Operation follows the below step: 1. Client calls AllocateBuffer() to allocate a common buffer 2. Client fill some data in common buffer (optional) 3. Client calls Map() with BusMasterCommonBuffer 4. Programs the DMA bus master with the device address returned by Map() 5. The common buffer can now be accessed equally by the processor and the DMA bus master. 6. Client calls Unmap() 7. Client calls FreeBuffer() In order to handle steps tianocore#2 (in which common buffer may contain data), we perform in-place encryption to ensure that device address returned by the Map() contains the correct data after we clear the C-bit during Map(). In my measurement I do not see any noticable perform degradation when performing in-place encryption/decryption on common buffer. Suggested-by: Laszlo Ersek <[email protected]> Contributed-under: TianoCore Contribution Agreement 1.0 Cc: Laszlo Ersek <[email protected]> Cc: Jordan Justen <[email protected]> Signed-off-by: Brijesh Singh <[email protected]>
- Loading branch information
Showing
1 changed file
with
158 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters