]> xenbits.xen.org Git - xenclient/ioemu.git/commitdiff
passthrough: don't call xc_deassign_device()
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 29 Apr 2009 15:28:37 +0000 (16:28 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 29 Apr 2009 15:28:37 +0000 (16:28 +0100)
This series of patches modify the order of resetting/deassigning
device.

I modify the order of resetting/deassigning device like below.

  When guest OS shutdowns or a device is hotremoved.
   1. Xend resets devices.
   2. Xend deassigns devices.

Because if devices are deassigned before the reset, dom0 memory may be
broken by DMA

This patch modifies ioemu not to call xc_deassign_device()

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
hw/pass-through.c

index 7bd2febb6919b57244e05a1b332abd475aef32c1..6a531371eed2cf89cca5f221d7d8a0b19ccdf7d2 100644 (file)
@@ -3972,13 +3972,6 @@ static int unregister_real_device(int slot)
     /* unregister real device's MMIO/PIO BARs */
     pt_unregister_regions(assigned_device);
 
-    /* deassign the dev to dom0 */
-    bdf |= (pci_dev->bus  & 0xff) << 16;
-    bdf |= (pci_dev->dev  & 0x1f) << 11;
-    bdf |= (pci_dev->func & 0x1f) << 8;
-    if ( (rc = xc_deassign_device(xc_handle, domid, bdf)) != 0)
-        PT_LOG("Error: Revoking the device failed! rc=%d\n", rc);
-
     /* mark this slot as free */
     php_dev->valid = 0;
     php_dev->pt_dev = NULL;