diff options
author | Laszlo Ersek <lersek@redhat.com> | 2017-09-07 14:24:22 +0200 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2017-09-08 20:23:47 +0200 |
commit | 5659ec3fa91399903ba3b913c1dfae5de2bd7a53 (patch) | |
tree | 573a1cf8631ca02baa8b95cd35eb39ab06c97019 | |
parent | 6fb8ddd36bde45614b0a069528cdc97077835a74 (diff) | |
download | edk2-5659ec3fa91399903ba3b913c1dfae5de2bd7a53.zip edk2-5659ec3fa91399903ba3b913c1dfae5de2bd7a53.tar.gz edk2-5659ec3fa91399903ba3b913c1dfae5de2bd7a53.tar.bz2 |
OvmfPkg/VirtioBlkDxe: don't unmap VRING at ExitBootServices()
In one of the following patches, we'll change OvmfPkg/IoMmuDxe so that it
unmaps all existent bus master operations (CommonBuffer, Read, Write) at
ExitBootServices(), strictly after the individual device drivers abort
pending DMA on the devices they manage, in their own ExitBootServices()
notification functions.
In preparation, remove the explicit
VIRTIO_DEVICE_PROTOCOL.UnmapSharedBuffer() call from VirtioBlkExitBoot(),
originally added in commit 19165130470f ("OvmfPkg/VirtioBlkDxe: map VRING
using VirtioRingMap()", 2017-08-27).
Add a DEBUG message so we can observe the ordering between
VirtioBlkExitBoot() and the upcoming cleanup of mappings in
OvmfPkg/IoMmuDxe.
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
-rw-r--r-- | OvmfPkg/VirtioBlkDxe/VirtioBlk.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c index 5a63986..5559884 100644 --- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c +++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c @@ -1019,6 +1019,7 @@ VirtioBlkExitBoot ( {
VBLK_DEV *Dev;
+ DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));
//
// Reset the device. This causes the hypervisor to forget about the virtio
// ring.
@@ -1028,12 +1029,6 @@ VirtioBlkExitBoot ( //
Dev = Context;
Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
-
- //
- // Unmap the ring buffer so that hypervisor will not be able to get
- // readable data after device is reset.
- //
- Dev->VirtIo->UnmapSharedBuffer (Dev->VirtIo, Dev->RingMap);
}
/**
|