]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/VirtioGpuDxe: don't unmap VRING & BackingStore 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:53 +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() calls from VirtioGpuExitBoot(),
originally added in commit 9bc5026c19a5 ("OvmfPkg/VirtioGpuDxe: map VRING
for bus master common buffer operation", 2017-08-26) and commit
f10ae923665f ("OvmfPkg/VirtioGpuDxe: map backing store to bus master
device address", 2017-08-26).

Add a DEBUG message so we can observe the ordering between
VirtioGpuExitBoot() 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/VirtioGpuDxe/Commands.c

index 6e70b1c33f6508a800107578dc33dcaf8cb3d53c..6ce21976c9183d735893eef37bd1cb09833517fa 100644 (file)
@@ -353,30 +353,9 @@ VirtioGpuExitBoot (
 {\r
   VGPU_DEV *VgpuDev;\r
 \r
 {\r
   VGPU_DEV *VgpuDev;\r
 \r
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));\r
   VgpuDev = Context;\r
   VgpuDev->VirtIo->SetDeviceStatus (VgpuDev->VirtIo, 0);\r
   VgpuDev = Context;\r
   VgpuDev->VirtIo->SetDeviceStatus (VgpuDev->VirtIo, 0);\r
-\r
-  //\r
-  // If VirtioGpuDriverBindingStart() and VirtioGpuDriverBindingStop() have\r
-  // been called thus far in such a sequence that right now our (sole) child\r
-  // handle exists -- with the GOP on it standing for head (scanout) #0 --,\r
-  // then we have to unmap the current video mode's backing store.\r
-  //\r
-  if (VgpuDev->Child != NULL) {\r
-    //\r
-    // The current video mode is guaranteed to have a valid and mapped backing\r
-    // store, due to the first Gop.SetMode() call, made internally in\r
-    // InitVgpuGop().\r
-    //\r
-    ASSERT (VgpuDev->Child->BackingStore != NULL);\r
-\r
-    VgpuDev->VirtIo->UnmapSharedBuffer (\r
-                       VgpuDev->VirtIo,\r
-                       VgpuDev->Child->BackingStoreMap\r
-                       );\r
-  }\r
-\r
-  VgpuDev->VirtIo->UnmapSharedBuffer (VgpuDev->VirtIo, VgpuDev->RingMap);\r
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r