From 3f3aecc4621d8ca2d1900ff2a6a458c276152404 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Wed, 5 Aug 2015 11:24:02 +0200 Subject: [PATCH] core: pci: Drop list of virtual devices No longer used. Signed-off-by: Jan Kiszka --- hypervisor/include/jailhouse/cell.h | 2 -- hypervisor/include/jailhouse/pci.h | 2 -- hypervisor/pci.c | 28 +++------------------------- 3 files changed, 3 insertions(+), 29 deletions(-) diff --git a/hypervisor/include/jailhouse/cell.h b/hypervisor/include/jailhouse/cell.h index d802402..1267c5a 100644 --- a/hypervisor/include/jailhouse/cell.h +++ b/hypervisor/include/jailhouse/cell.h @@ -58,8 +58,6 @@ struct cell { struct pci_device *pci_devices; /** List of PCI devices assigned to this cell that support MSI-X. */ struct pci_device *msix_device_list; - /** List of virtual PCI devices assigned to this cell. */ - struct pci_device *virtual_device_list; /** Lock protecting changes to mmio_locations, mmio_handlers, and * num_mmio_regions. */ diff --git a/hypervisor/include/jailhouse/pci.h b/hypervisor/include/jailhouse/pci.h index f511d50..63cd713 100644 --- a/hypervisor/include/jailhouse/pci.h +++ b/hypervisor/include/jailhouse/pci.h @@ -136,8 +136,6 @@ struct pci_device { union pci_msix_registers msix_registers; /** Next PCI device in this cell with MSI-X support. */ struct pci_device *next_msix_device; - /** Next virtual PCI device in this cell. */ - struct pci_device *next_virtual_device; /** ivshmem specific data. */ struct pci_ivshmem_endpoint *ivshmem_endpoint; /** Real MSI-X table. */ diff --git a/hypervisor/pci.c b/hypervisor/pci.c index ddc1033..fd74588 100644 --- a/hypervisor/pci.c +++ b/hypervisor/pci.c @@ -575,14 +575,6 @@ void pci_prepare_handover(void) } } -static int pci_add_virtual_device(struct cell *cell, struct pci_device *device) -{ - device->cell = cell; - device->next_virtual_device = cell->virtual_device_list; - cell->virtual_device_list = device; - return 0; -} - static int pci_add_physical_device(struct cell *cell, struct pci_device *device) { unsigned int n, pages, size = device->info->msix_region_size; @@ -638,19 +630,6 @@ error_remove_dev: return err; } -static void pci_remove_virtual_device(struct pci_device *device) -{ - struct pci_device *prev = device->cell->virtual_device_list; - - if (prev == device) { - device->cell->virtual_device_list = device->next_virtual_device; - } else { - while (prev->next_virtual_device != device) - prev = prev->next_virtual_device; - prev->next_virtual_device = device->next_virtual_device; - } -} - static void pci_remove_physical_device(struct pci_device *device) { unsigned int size = device->info->msix_region_size; @@ -723,9 +702,9 @@ int pci_cell_init(struct cell *cell) err = pci_ivshmem_init(cell, device); if (err) goto error; - err = pci_add_virtual_device(cell, device); - if (err) - goto error; + + device->cell = cell; + continue; } @@ -798,7 +777,6 @@ void pci_cell_exit(struct cell *cell) if (device->cell) { if (device->info->type == JAILHOUSE_PCI_TYPE_IVSHMEM) { pci_ivshmem_exit(device); - pci_remove_virtual_device(device); } else { pci_remove_physical_device(device); pci_return_device_to_root_cell(device); -- 2.39.2