]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: Disable PCI devices on removal
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 4 Aug 2014 08:41:52 +0000 (10:41 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Mon, 4 Aug 2014 15:58:18 +0000 (17:58 +0200)
Switch off any bus master, MMIO and PIO dispatching when removing a
device from a cell. Also try to suppress INTx signals (not all devices
may respect this).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/pci.c

index c8b4991be6007aea4314b1fe74c4c406ba04f6c9..c372e26908c355187c987a62312dcdb99a573f70 100644 (file)
@@ -20,6 +20,9 @@
 
 #define PCI_CONFIG_HEADER_SIZE         0x40
 
+#define PCI_CFG_COMMAND                        0x04
+# define PCI_CMD_INTX_OFF              (1 << 10)
+
 struct acpi_mcfg_alloc {
        u64 base_addr;
        u16 segment_num;
@@ -335,6 +338,8 @@ static void pci_remove_device(struct pci_device *device)
        printk("Removing PCI device %02x:%02x.%x from cell \"%s\"\n",
               PCI_BDF_PARAMS(device->info->bdf), device->cell->config->name);
        arch_pci_remove_device(device);
+       pci_write_config(device->info->bdf, PCI_CFG_COMMAND,
+                        PCI_CMD_INTX_OFF, 2);
 }
 
 int pci_cell_init(struct cell *cell)