| /qemu/hw/pci/ |
| A D | pcie_port.c | 131 int devfn; in pcie_find_port_by_pn() local 133 for (devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) { in pcie_find_port_by_pn() 134 PCIDevice *d = bus->devices[devfn]; in pcie_find_port_by_pn() 157 int devfn; in pcie_find_port_first() local 159 for (devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) { in pcie_find_port_first() 160 PCIDevice *d = bus->devices[devfn]; in pcie_find_port_first() 177 int devfn; in pcie_count_ds_ports() local 179 for (devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) { in pcie_count_ds_ports() 180 PCIDevice *d = bus->devices[devfn]; in pcie_count_ds_ports()
|
| A D | pci.c | 1192 PCI_SLOT(devfn), PCI_FUNC(devfn), name); in do_pci_register_device() 1197 PCI_SLOT(devfn), PCI_FUNC(devfn), name, in do_pci_register_device() 1218 pci_dev->devfn = devfn; in do_pci_register_device() 1824 int devfn; in pci_for_each_device_under_bus_reverse() local 1826 for (devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) { in pci_for_each_device_under_bus_reverse() 1848 int devfn; in pci_for_each_device_under_bus() local 1850 for(devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) { in pci_for_each_device_under_bus() 2696 int devfn = dev->devfn; in pci_device_get_iommu_bus_devfn() local 2730 devfn = parent->devfn; in pci_device_get_iommu_bus_devfn() 2738 assert(0 <= devfn && devfn < PCI_DEVFN_MAX); in pci_device_get_iommu_bus_devfn() [all …]
|
| A D | pcie_sriov.c | 23 static PCIDevice *register_vf(PCIDevice *pf, int devfn, 147 PCIDevice *dev = pci_new(devfn, name); in register_vf() 175 int32_t devfn = dev->devfn + vf_offset; in register_vfs() local 185 trace_sriov_register_vfs(dev->name, PCI_SLOT(dev->devfn), in register_vfs() 186 PCI_FUNC(dev->devfn), num_vfs); in register_vfs() 188 dev->exp.sriov_pf.vf[i] = register_vf(dev, devfn, in register_vfs() 194 devfn += vf_stride; in register_vfs() 204 trace_sriov_unregister_vfs(dev->name, PCI_SLOT(dev->devfn), in unregister_vfs() 205 PCI_FUNC(dev->devfn), num_vfs); in unregister_vfs() 234 trace_sriov_config_write(dev->name, PCI_SLOT(dev->devfn), in pcie_sriov_config_write() [all …]
|
| A D | pci-qmp-cmds.c | 116 info->slot = PCI_SLOT(dev->devfn); in qmp_query_pci_device() 117 info->function = PCI_FUNC(dev->devfn); in qmp_query_pci_device() 161 int devfn; in qmp_query_pci_devices() local 163 for (devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) { in qmp_query_pci_devices() 164 dev = bus->devices[devfn]; in qmp_query_pci_devices()
|
| A D | pci_host.c | 52 uint8_t devfn = addr >> 8; in pci_dev_find_by_addr() local 54 return pci_find_device(bus, bus_num, devfn); in pci_dev_find_by_addr() 94 PCI_SLOT(pci_dev->devfn), in pci_host_config_write_common() 95 PCI_FUNC(pci_dev->devfn), addr, val); in pci_host_config_write_common() 120 PCI_SLOT(pci_dev->devfn), in pci_host_config_read_common() 121 PCI_FUNC(pci_dev->devfn), addr, ret); in pci_host_config_read_common()
|
| /qemu/tests/qtest/libqos/ |
| A D | pci-pc.c | 77 static uint8_t qpci_pc_config_readb(QPCIBus *bus, int devfn, uint8_t offset) in qpci_pc_config_readb() argument 79 qtest_outl(bus->qts, 0xcf8, (1U << 31) | (devfn << 8) | offset); in qpci_pc_config_readb() 83 static uint16_t qpci_pc_config_readw(QPCIBus *bus, int devfn, uint8_t offset) in qpci_pc_config_readw() argument 85 qtest_outl(bus->qts, 0xcf8, (1U << 31) | (devfn << 8) | offset); in qpci_pc_config_readw() 89 static uint32_t qpci_pc_config_readl(QPCIBus *bus, int devfn, uint8_t offset) in qpci_pc_config_readl() argument 91 qtest_outl(bus->qts, 0xcf8, (1U << 31) | (devfn << 8) | offset); in qpci_pc_config_readl() 95 static void qpci_pc_config_writeb(QPCIBus *bus, int devfn, uint8_t offset, uint8_t value) in qpci_pc_config_writeb() argument 97 qtest_outl(bus->qts, 0xcf8, (1U << 31) | (devfn << 8) | offset); in qpci_pc_config_writeb() 101 static void qpci_pc_config_writew(QPCIBus *bus, int devfn, uint8_t offset, uint16_t value) in qpci_pc_config_writew() argument 103 qtest_outl(bus->qts, 0xcf8, (1U << 31) | (devfn << 8) | offset); in qpci_pc_config_writew() [all …]
|
| A D | pci.h | 40 uint8_t (*config_readb)(QPCIBus *bus, int devfn, uint8_t offset); 41 uint16_t (*config_readw)(QPCIBus *bus, int devfn, uint8_t offset); 42 uint32_t (*config_readl)(QPCIBus *bus, int devfn, uint8_t offset); 44 void (*config_writeb)(QPCIBus *bus, int devfn, 46 void (*config_writew)(QPCIBus *bus, int devfn, 48 void (*config_writel)(QPCIBus *bus, int devfn, 67 int devfn; member 74 uint32_t devfn; member 80 void (*func)(QPCIDevice *dev, int devfn, void *data), 82 QPCIDevice *qpci_device_find(QPCIBus *bus, int devfn);
|
| A D | generic-pcihost.c | 109 static uint8_t qpci_generic_config_readb(QPCIBus *bus, int devfn, uint8_t offset) in qpci_generic_config_readb() argument 112 uint64_t addr = gbus->ecam_alloc_ptr + ((0 << 20) | (devfn << 12) | offset); in qpci_generic_config_readb() 119 static uint16_t qpci_generic_config_readw(QPCIBus *bus, int devfn, uint8_t offset) in qpci_generic_config_readw() argument 122 uint64_t addr = gbus->ecam_alloc_ptr + ((0 << 20) | (devfn << 12) | offset); in qpci_generic_config_readw() 129 static uint32_t qpci_generic_config_readl(QPCIBus *bus, int devfn, uint8_t offset) in qpci_generic_config_readl() argument 132 uint64_t addr = gbus->ecam_alloc_ptr + ((0 << 20) | (devfn << 12) | offset); in qpci_generic_config_readl() 140 qpci_generic_config_writeb(QPCIBus *bus, int devfn, uint8_t offset, uint8_t value) in qpci_generic_config_writeb() argument 143 uint64_t addr = gbus->ecam_alloc_ptr + ((0 << 20) | (devfn << 12) | offset); in qpci_generic_config_writeb() 149 qpci_generic_config_writew(QPCIBus *bus, int devfn, uint8_t offset, uint16_t value) in qpci_generic_config_writew() argument 152 uint64_t addr = gbus->ecam_alloc_ptr + ((0 << 20) | (devfn << 12) | offset); in qpci_generic_config_writew() [all …]
|
| A D | pci-spapr.c | 87 static uint8_t qpci_spapr_config_readb(QPCIBus *bus, int devfn, uint8_t offset) in qpci_spapr_config_readb() argument 90 uint32_t config_addr = (devfn << 8) | offset; in qpci_spapr_config_readb() 95 static uint16_t qpci_spapr_config_readw(QPCIBus *bus, int devfn, uint8_t offset) in qpci_spapr_config_readw() argument 98 uint32_t config_addr = (devfn << 8) | offset; in qpci_spapr_config_readw() 106 uint32_t config_addr = (devfn << 8) | offset; in qpci_spapr_config_readl() 111 static void qpci_spapr_config_writeb(QPCIBus *bus, int devfn, uint8_t offset, in qpci_spapr_config_writeb() argument 115 uint32_t config_addr = (devfn << 8) | offset; in qpci_spapr_config_writeb() 120 static void qpci_spapr_config_writew(QPCIBus *bus, int devfn, uint8_t offset, in qpci_spapr_config_writew() argument 124 uint32_t config_addr = (devfn << 8) | offset; in qpci_spapr_config_writew() 129 static void qpci_spapr_config_writel(QPCIBus *bus, int devfn, uint8_t offset, in qpci_spapr_config_writel() argument [all …]
|
| A D | pci.c | 70 static void qpci_device_set(QPCIDevice *dev, QPCIBus *bus, int devfn) in qpci_device_set() argument 75 dev->devfn = devfn; in qpci_device_set() 78 QPCIDevice *qpci_device_find(QPCIBus *bus, int devfn) in qpci_device_find() argument 83 qpci_device_set(dev, bus, devfn); in qpci_device_find() 97 qpci_device_set(dev, bus, addr->devfn); in qpci_device_init() 370 return dev->bus->config_readb(dev->bus, dev->devfn, offset); in qpci_config_readb() 375 return dev->bus->config_readw(dev->bus, dev->devfn, offset); in qpci_config_readw() 380 return dev->bus->config_readl(dev->bus, dev->devfn, offset); in qpci_config_readl() 386 dev->bus->config_writeb(dev->bus, dev->devfn, offset, value); in qpci_config_writeb() 391 dev->bus->config_writew(dev->bus, dev->devfn, offset, value); in qpci_config_writew() [all …]
|
| /qemu/include/hw/xen/interface/ |
| A D | physdev.h | 153 int devfn; member 177 uint8_t devfn; member 187 uint8_t devfn; member 196 uint8_t devfn; member 201 uint8_t devfn; member 275 uint8_t devfn; member 279 uint8_t devfn; member 303 uint8_t devfn; member
|
| /qemu/tests/qtest/fuzz/ |
| A D | i440fx_fuzz.c | 103 int devfn; in pciconfig_fuzz_qos() member 111 bus->config_writeb(bus, a.devfn, a.offset, (uint8_t)a.value); in pciconfig_fuzz_qos() 114 bus->config_writew(bus, a.devfn, a.offset, (uint16_t)a.value); in pciconfig_fuzz_qos() 117 bus->config_writel(bus, a.devfn, a.offset, (uint32_t)a.value); in pciconfig_fuzz_qos() 120 bus->config_readb(bus, a.devfn, a.offset); in pciconfig_fuzz_qos() 123 bus->config_readw(bus, a.devfn, a.offset); in pciconfig_fuzz_qos() 126 bus->config_readl(bus, a.devfn, a.offset); in pciconfig_fuzz_qos()
|
| /qemu/include/hw/pci/ |
| A D | pci.h | 17 #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) argument 18 #define PCI_FUNC(devfn) ((devfn) & 0x07) argument 19 #define PCI_BUILD_BDF(bus, devfn) (((bus) << 8) | (devfn)) argument 363 PCIDevice *pci_find_device(PCIBus *bus, int bus_num, uint8_t devfn); 390 AddressSpace * (*get_address_space)(PCIBus *bus, void *opaque, int devfn); 409 bool (*set_iommu_device)(PCIBus *bus, void *opaque, int devfn, 422 void (*unset_iommu_device)(PCIBus *bus, void *opaque, int devfn); 650 PCIDevice *pci_new_multifunction(int devfn, const char *name); 651 PCIDevice *pci_new(int devfn, const char *name); 654 PCIDevice *pci_create_simple_multifunction(PCIBus *bus, int devfn, [all …]
|
| /qemu/include/hw/i386/ |
| A D | intel_iommu.h | 40 #define VTD_PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) argument 41 #define VTD_PCI_FUNC(devfn) ((devfn) & 0x07) argument 99 uint8_t devfn; member 323 int devfn, unsigned int pasid);
|
| /qemu/hw/i386/ |
| A D | intel_iommu.c | 60 uint8_t devfn; member 67 uint8_t devfn; member 270 return (key1->bus == key2->bus) && (key1->devfn == key2->devfn); in vtd_hiod_equal() 2136 (vtd_as->devfn & mask) == (devfn & mask)) { in vtd_context_device_invalidate() 3794 .devfn = devfn, in vtd_find_add_as() 3805 new_key->devfn = devfn; in vtd_find_add_as() 3819 vtd_dev_as->devfn = (uint8_t)devfn; in vtd_find_add_as() 3927 .devfn = devfn, in vtd_dev_set_iommu_device() 3948 new_key->devfn = devfn; in vtd_dev_set_iommu_device() 3963 .devfn = devfn, in vtd_dev_unset_iommu_device() [all …]
|
| A D | acpi-build.c | 464 int32_t devfn = PCI_DEVFN(slot, 0); in build_append_pcihp_notify_entry() local 475 if (PCI_FUNC(devfn)) { in is_devfn_ignored_generic() 491 PCIDevice *pdev = bus->devices[devfn]; in is_devfn_ignored_hotplug() 502 if (PCI_FUNC(devfn) || in is_devfn_ignored_hotplug() 512 int devfn; in build_append_pcihp_slots() local 522 for (devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) { in build_append_pcihp_slots() 523 int slot = PCI_SLOT(devfn); in build_append_pcihp_slots() 530 if (bus->devices[devfn]) { in build_append_pcihp_slots() 562 int devfn; in build_append_pci_bus_devices() local 565 for (devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) { in build_append_pci_bus_devices() [all …]
|
| /qemu/hw/virtio/ |
| A D | virtio-iommu.c | 74 uint8_t devfn; member 180 uint8_t bus_n, devfn; in virtio_iommu_mr() local 187 devfn = sid & (PCI_DEVFN_MAX - 1); in virtio_iommu_mr() 419 sdev = sbus->pbdev[devfn]; in virtio_iommu_find_add_as() 428 sdev->devfn = devfn; in virtio_iommu_find_add_as() 476 return (key1->bus == key2->bus) && (key1->devfn == key2->devfn); in hiod_equal() 496 .devfn = devfn, in get_host_iommu_device() 549 sdev = sbus->pbdev[devfn]; in virtio_iommu_set_host_iova_ranges() 579 sdev = sbus->pbdev[devfn]; in virtio_iommu_unset_host_iova_ranges() 674 new_key->devfn = devfn; in virtio_iommu_set_iommu_device() [all …]
|
| /qemu/hw/acpi/ |
| A D | pci.c | 153 int32_t devfn; in build_acpi_generic_initiator() local 176 devfn = object_property_get_uint(o, "addr", &error_fatal); in build_acpi_generic_initiator() 178 assert(devfn >= 0 && devfn < PCI_DEVFN_MAX); in build_acpi_generic_initiator() 180 build_srat_pci_generic_initiator(table_data, gi->node, 0, bus, devfn); in build_acpi_generic_initiator()
|
| A D | pcihp.c | 202 if (PCI_SLOT(dev->devfn) == slot) { in acpi_pcihp_eject_slot() 248 int slot = PCI_SLOT(pdev->devfn); in acpi_pcihp_update_hotplug_bus() 289 int slot = PCI_SLOT(pdev->devfn); in acpi_pcihp_device_plug_cb() 332 trace_acpi_pci_unplug(PCI_SLOT(pdev->devfn), in acpi_pcihp_device_unplug_cb() 343 int slot = PCI_SLOT(pdev->devfn); in acpi_pcihp_device_unplug_request_cb() 465 if (PCI_SLOT(dev->devfn) == slot) { in pci_write()
|
| /qemu/hw/riscv/ |
| A D | riscv-iommu-pci.c | 94 pci_dev_bus_num(dev), PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); in riscv_iommu_pci_realize() 131 pci_bus_num(pci_get_bus(dev)), PCI_SLOT(dev->devfn), in riscv_iommu_pci_realize() 132 PCI_FUNC(dev->devfn)); in riscv_iommu_pci_realize()
|
| /qemu/hw/remote/ |
| A D | iommu.c | 40 void *opaque, int devfn) in remote_iommu_find_add_as() argument 47 elem = g_hash_table_lookup(iommu->elem_by_devfn, INT2VOIDP(devfn)); in remote_iommu_find_add_as() 51 g_hash_table_insert(iommu->elem_by_devfn, INT2VOIDP(devfn), elem); in remote_iommu_find_add_as()
|
| /qemu/hw/s390x/ |
| A D | s390-pci-bus.c | 602 int devfn) in s390_pci_get_iommu() argument 614 iommu = table->iommu[PCI_SLOT(devfn)]; in s390_pci_get_iommu() 620 PCI_SLOT(devfn), in s390_pci_get_iommu() 621 PCI_FUNC(devfn)); in s390_pci_get_iommu() 624 PCI_SLOT(devfn), in s390_pci_get_iommu() 625 PCI_FUNC(devfn)); in s390_pci_get_iommu() 630 table->iommu[PCI_SLOT(devfn)] = iommu; in s390_pci_get_iommu() 745 table->iommu[PCI_SLOT(devfn)] = NULL; in s390_pci_iommu_free() 1167 int32_t devfn; in s390_pcihost_unplug() local 1175 devfn = pci_dev->devfn; in s390_pcihost_unplug() [all …]
|
| /qemu/include/hw/xen/ |
| A D | xen_native.h | 443 PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn)); in xen_map_pcidev() 446 PCI_SLOT(pci_dev->devfn), in xen_map_pcidev() 447 PCI_FUNC(pci_dev->devfn)); in xen_map_pcidev() 459 PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn)); in xen_unmap_pcidev() 462 PCI_SLOT(pci_dev->devfn), in xen_unmap_pcidev() 463 PCI_FUNC(pci_dev->devfn)); in xen_unmap_pcidev()
|
| /qemu/ui/ |
| A D | util.c | 44 PCI_SLOT(pci->devfn), PCI_FUNC(pci->devfn)); in append_pci_address()
|
| /qemu/hw/pci-host/ |
| A D | pnv_phb3.c | 33 uint8_t bus, devfn; in pnv_phb3_find_cfg_dev() local 39 devfn = (addr >> 44) & 0xff; in pnv_phb3_find_cfg_dev() 41 return pci_find_device(pci->bus, bus, devfn); in pnv_phb3_find_cfg_dev() 719 addr += 2 * ((bus_num << 8) | ds->devfn); in pnv_phb3_resolve_pe() 730 phb3_error(ds->phb, "RTE for RID 0x%x invalid (%04x", ds->devfn, rte); in pnv_phb3_resolve_pe() 858 ds->bus, pci_bus_num(ds->bus), ds->devfn); in pnv_phb3_translate_iommu() 916 ds->bus, pci_bus_num(ds->bus), ds->devfn); in pnv_phb3_msi_write() 938 static AddressSpace *pnv_phb3_dma_iommu(PCIBus *bus, void *opaque, int devfn) in pnv_phb3_dma_iommu() argument 944 if (ds->bus == bus && ds->devfn == devfn) { in pnv_phb3_dma_iommu() 952 ds->devfn = devfn; in pnv_phb3_dma_iommu()
|