]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
driver: add/remove virtual PCI devices to/from root-cell
authorHenning Schild <henning.schild@siemens.com>
Mon, 24 Nov 2014 17:54:09 +0000 (18:54 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Wed, 26 Nov 2014 18:15:12 +0000 (19:15 +0100)
Introduce a new PCI device class and make Linux discover these virtual
PCI devices on enable and remove them on disable.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver.c
hypervisor/include/jailhouse/cell-config.h

index cb76370f55882a1cc2be89a1fb84235e6bd144d7..ec2d619d9787ff314aaf8b236f9a3d903608dc34 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -611,6 +611,9 @@ static int jailhouse_enable(struct jailhouse_system __user *arg)
                goto error_free_cell;
        }
 
+       jailhouse_pci_do_all_devices(root_cell, JAILHOUSE_PCI_TYPE_IVSHMEM,
+                                    JAILHOUSE_PCI_ACTION_ADD);
+
        release_firmware(hypervisor);
 
        enabled = true;
@@ -699,6 +702,9 @@ static int jailhouse_disable(void)
                cpu_clear(cpu, offlined_cpus);
        }
 
+       jailhouse_pci_do_all_devices(root_cell, JAILHOUSE_PCI_TYPE_IVSHMEM,
+                                    JAILHOUSE_PCI_ACTION_DEL);
+
        list_for_each_entry_safe(cell, tmp, &cells, entry)
                delete_cell(cell);
        enabled = false;
index 23145b828f8ac95a0d61446dc84279b9ba48decb..bf32cf9fb72a06334ab9ec12a7ec2f0bba7d572f 100644 (file)
@@ -60,6 +60,7 @@ struct jailhouse_irqchip {
 
 #define JAILHOUSE_PCI_TYPE_DEVICE      0x01
 #define JAILHOUSE_PCI_TYPE_BRIDGE      0x02
+#define JAILHOUSE_PCI_TYPE_IVSHMEM     0x03
 
 struct jailhouse_pci_device {
        __u8 type;