]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/VirtioRngDxe: don't unmap VRING at ExitBootServices()
authorLaszlo Ersek <lersek@redhat.com>
Thu, 7 Sep 2017 12:24:22 +0000 (14:24 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Fri, 8 Sep 2017 18:23:56 +0000 (20:23 +0200)
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 VirtioRngExitBoot(),
originally added in commit 0a568ccbcbd1 ("OvmfPkg/VirtioRngDxe: map host
address to device address", 2017-08-23).

Add a DEBUG message so we can observe the ordering between
VirtioRngExitBoot() 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>
OvmfPkg/VirtioRngDxe/VirtioRng.c

index 80380bcdf8bf9bec35cb556db4b4fbf185c5a57a..3c733ea4db6666b8a7e29dfd5be42cd1ee3e7bfb 100644 (file)
@@ -435,6 +435,7 @@ VirtioRngExitBoot (
 {\r
   VIRTIO_RNG_DEV *Dev;\r
 \r
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));\r
   //\r
   // Reset the device. This causes the hypervisor to forget about the virtio\r
   // ring.\r
@@ -444,12 +445,6 @@ VirtioRngExitBoot (
   //\r
   Dev = Context;\r
   Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);\r
-\r
-  //\r
-  // Unmap the ring buffer so that hypervisor will not be able to get readable\r
-  // data after device reset.\r
-  //\r
-  Dev->VirtIo->UnmapSharedBuffer (Dev->VirtIo, Dev->RingMap);\r
 }\r
 \r
 \r