Home
last modified time | relevance | path

Searched refs:vbasedev (Results 1 – 18 of 18) sorted by relevance

/openbmc/qemu/hw/vfio/
H A Dmigration.c107 static void vfio_migration_send_event(VFIODevice *vbasedev) in vfio_migration_send_event() argument
109 VFIOMigration *migration = vbasedev->migration; in vfio_migration_send_event()
110 DeviceState *dev = vbasedev->dev; in vfio_migration_send_event()
114 if (!vbasedev->migration_events) { in vfio_migration_send_event()
118 g_assert(vbasedev->ops->vfio_get_object); in vfio_migration_send_event()
119 obj = vbasedev->ops->vfio_get_object(vbasedev); in vfio_migration_send_event()
127 static void vfio_migration_set_device_state(VFIODevice *vbasedev, in vfio_migration_set_device_state() argument
130 VFIOMigration *migration = vbasedev->migration; in vfio_migration_set_device_state()
132 trace_vfio_migration_set_device_state(vbasedev->name, in vfio_migration_set_device_state()
136 vfio_migration_send_event(vbasedev); in vfio_migration_set_device_state()
[all …]
H A Diommufd.c53 static bool iommufd_cdev_kvm_device_add(VFIODevice *vbasedev, Error **errp) in iommufd_cdev_kvm_device_add() argument
55 return !vfio_kvm_device_add_fd(vbasedev->fd, errp); in iommufd_cdev_kvm_device_add()
58 static void iommufd_cdev_kvm_device_del(VFIODevice *vbasedev) in iommufd_cdev_kvm_device_del() argument
62 if (vfio_kvm_device_del_fd(vbasedev->fd, &err)) { in iommufd_cdev_kvm_device_del()
67 static bool iommufd_cdev_connect_and_bind(VFIODevice *vbasedev, Error **errp) in iommufd_cdev_connect_and_bind() argument
69 IOMMUFDBackend *iommufd = vbasedev->iommufd; in iommufd_cdev_connect_and_bind()
84 if (!iommufd_cdev_kvm_device_add(vbasedev, errp)) { in iommufd_cdev_connect_and_bind()
90 if (ioctl(vbasedev->fd, VFIO_DEVICE_BIND_IOMMUFD, &bind)) { in iommufd_cdev_connect_and_bind()
92 vbasedev->fd, bind.iommufd); in iommufd_cdev_connect_and_bind()
96 vbasedev->devid = bind.out_devid; in iommufd_cdev_connect_and_bind()
[all …]
H A Dplatform.c57 static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev, in vfio_init_intp() argument
62 container_of(vbasedev, VFIOPlatformDevice, vbasedev); in vfio_init_intp()
115 VFIODevice *vbasedev = &intp->vdev->vbasedev; in vfio_set_trigger_eventfd() local
121 if (!vfio_set_irq_signaling(vbasedev, intp->pin, 0, in vfio_set_trigger_eventfd()
123 error_reportf_err(err, VFIO_MSG_PREFIX, vbasedev->name); in vfio_set_trigger_eventfd()
150 for (i = 0; i < vdev->vbasedev.num_regions; i++) { in vfio_mmap_set_enabled()
285 static void vfio_platform_eoi(VFIODevice *vbasedev) in vfio_platform_eoi() argument
289 container_of(vbasedev, VFIOPlatformDevice, vbasedev); in vfio_platform_eoi()
303 vfio_unmask_single_irqindex(vbasedev, intp->pin); in vfio_platform_eoi()
355 VFIODevice *vbasedev = &intp->vdev->vbasedev; in vfio_set_resample_eventfd() local
[all …]
H A Dhelpers.c36 void vfio_disable_irqindex(VFIODevice *vbasedev, int index) in vfio_disable_irqindex() argument
46 ioctl(vbasedev->fd, VFIO_DEVICE_SET_IRQS, &irq_set); in vfio_disable_irqindex()
49 void vfio_unmask_single_irqindex(VFIODevice *vbasedev, int index) in vfio_unmask_single_irqindex() argument
59 ioctl(vbasedev->fd, VFIO_DEVICE_SET_IRQS, &irq_set); in vfio_unmask_single_irqindex()
62 void vfio_mask_single_irqindex(VFIODevice *vbasedev, int index) in vfio_mask_single_irqindex() argument
72 ioctl(vbasedev->fd, VFIO_DEVICE_SET_IRQS, &irq_set); in vfio_mask_single_irqindex()
89 static const char *index_to_str(VFIODevice *vbasedev, int index) in index_to_str() argument
91 if (vbasedev->type != VFIO_DEVICE_TYPE_PCI) { in index_to_str()
111 bool vfio_set_irq_signaling(VFIODevice *vbasedev, int index, int subindex, in vfio_set_irq_signaling() argument
131 if (!ioctl(vbasedev->fd, VFIO_DEVICE_SET_IRQS, irq_set)) { in vfio_set_irq_signaling()
[all …]
H A Dpci.c93 trace_vfio_intx_interrupt(vdev->vbasedev.name, 'A' + vdev->intx.pin); in vfio_intx_interrupt()
104 static void vfio_intx_eoi(VFIODevice *vbasedev) in vfio_intx_eoi() argument
106 VFIOPCIDevice *vdev = container_of(vbasedev, VFIOPCIDevice, vbasedev); in vfio_intx_eoi()
112 trace_vfio_intx_eoi(vbasedev->name); in vfio_intx_eoi()
116 vfio_unmask_single_irqindex(vbasedev, VFIO_PCI_INTX_IRQ_INDEX); in vfio_intx_eoi()
132 vfio_mask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX); in vfio_intx_enable_kvm()
150 if (!vfio_set_irq_signaling(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX, 0, in vfio_intx_enable_kvm()
158 vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX); in vfio_intx_enable_kvm()
162 trace_vfio_intx_enable_kvm(vdev->vbasedev.name); in vfio_intx_enable_kvm()
173 vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX); in vfio_intx_enable_kvm()
[all …]
H A Dcommon.c69 VFIODevice *vbasedev; in vfio_mig_active() local
75 QLIST_FOREACH(vbasedev, &vfio_device_list, global_next) { in vfio_mig_active()
76 if (vbasedev->migration_blocker) { in vfio_mig_active()
92 VFIODevice *vbasedev; in vfio_multiple_devices_migration_is_supported() local
96 QLIST_FOREACH(vbasedev, &vfio_device_list, global_next) { in vfio_multiple_devices_migration_is_supported()
97 if (vbasedev->migration) { in vfio_multiple_devices_migration_is_supported()
100 if (!(vbasedev->migration->mig_flags & VFIO_MIGRATION_P2P)) { in vfio_multiple_devices_migration_is_supported()
109 int vfio_block_multiple_devices_migration(VFIODevice *vbasedev, Error **errp) in vfio_block_multiple_devices_migration() argument
117 if (vbasedev->enable_migration == ON_OFF_AUTO_ON) { in vfio_block_multiple_devices_migration()
145 bool vfio_viommu_preset(VFIODevice *vbasedev) in vfio_viommu_preset() argument
[all …]
H A Dcontainer.c802 VFIODevice *vbasedev, Error **errp) in vfio_get_device() argument
830 if (vbasedev->ram_block_discard_allowed != in vfio_get_device()
845 vbasedev->fd = fd; in vfio_get_device()
846 vbasedev->group = group; in vfio_get_device()
847 QLIST_INSERT_HEAD(&group->device_list, vbasedev, next); in vfio_get_device()
849 vbasedev->num_irqs = info->num_irqs; in vfio_get_device()
850 vbasedev->num_regions = info->num_regions; in vfio_get_device()
851 vbasedev->flags = info->flags; in vfio_get_device()
855 vbasedev->reset_works = !!(info->flags & VFIO_DEVICE_FLAGS_RESET); in vfio_get_device()
860 static void vfio_put_base_device(VFIODevice *vbasedev) in vfio_put_base_device() argument
[all …]
H A Digd.c154 ret = pread(vdev->vbasedev.fd, pdev->config + list[i].offset, in vfio_pci_igd_copy()
186 trace_vfio_pci_igd_host_bridge_enabled(vdev->vbasedev.name); in vfio_pci_igd_host_init()
250 trace_vfio_pci_igd_lpc_bridge_enabled(vdev->vbasedev.name); in type_init()
343 trace_vfio_pci_igd_bar4_write(vdev->vbasedev.name, in vfio_igd_quirk_data_write()
545 "devices at address 1f.0", vdev->vbasedev.name); in vfio_probe_igd_bar4_quirk()
557 "try SandyBridge or newer", vdev->vbasedev.name); in vfio_probe_igd_bar4_quirk()
566 ret = vfio_get_region_info(&vdev->vbasedev, in vfio_probe_igd_bar4_quirk()
570 vdev->vbasedev.name); in vfio_probe_igd_bar4_quirk()
580 "legacy mode disabled", vdev->vbasedev.name); in vfio_probe_igd_bar4_quirk()
589 ret = vfio_get_dev_region_info(&vdev->vbasedev, in vfio_probe_igd_bar4_quirk()
[all …]
H A Dap.c159 VFIODevice *vbasedev = &vapdev->vdev; in vfio_ap_realize() local
161 if (!vfio_device_get_name(vbasedev, errp)) { in vfio_ap_realize()
165 if (!vfio_attach_device(vbasedev->name, vbasedev, in vfio_ap_realize()
181 error_prepend(errp, VFIO_MSG_PREFIX, vbasedev->name); in vfio_ap_realize()
182 g_free(vbasedev->name); in vfio_ap_realize()
223 VFIODevice *vbasedev = &vapdev->vdev; in vfio_ap_instance_init() local
231 vfio_device_init(vbasedev, VFIO_DEVICE_TYPE_AP, &vfio_ap_ops, in vfio_ap_instance_init()
235 vbasedev->mdev = true; in vfio_ap_instance_init()
H A Dpci-quirks.c56 trace_vfio_quirk_rom_in_denylist(vdev->vbasedev.name, in vfio_opt_rom_in_denylist()
131 trace_vfio_quirk_generic_window_address_write(vdev->vbasedev.name, in vfio_generic_window_quirk_address_write()
157 trace_vfio_quirk_generic_window_data_read(vdev->vbasedev.name, in vfio_generic_window_quirk_data_read()
172 trace_vfio_quirk_generic_window_data_write(vdev->vbasedev.name, in vfio_generic_window_quirk_data_write()
213 trace_vfio_quirk_generic_mirror_read(vdev->vbasedev.name, in vfio_generic_quirk_mirror_read()
226 trace_vfio_quirk_generic_mirror_write(vdev->vbasedev.name, in vfio_generic_quirk_mirror_write()
262 trace_vfio_quirk_ati_3c3_read(vdev->vbasedev.name, data); in vfio_ati_3c3_quirk_read()
305 if (ioctl(vdev->vbasedev.fd, VFIO_DEVICE_IOEVENTFD, &vfio_ioeventfd)) { in vfio_ioeventfd_exit()
392 ioeventfd->vfio = !ioctl(vdev->vbasedev.fd, in vfio_ioeventfd_init()
432 trace_vfio_quirk_ati_3c3_probe(vdev->vbasedev.name); in vfio_vga_probe_ati_3c3_quirk()
[all …]
H A Ddisplay.c44 int fd = vdev->vbasedev.fd; in vfio_display_edid_link_up()
61 int fd = vdev->vbasedev.fd; in vfio_display_edid_update()
130 int fd = vdev->vbasedev.fd; in vfio_display_edid_init()
133 ret = vfio_get_dev_region_info(&vdev->vbasedev, in vfio_display_edid_init()
222 ret = ioctl(vdev->vbasedev.fd, VFIO_DEVICE_QUERY_GFX_PLANE, &plane); in vfio_display_get_dmabuf()
242 fd = ioctl(vdev->vbasedev.fd, VFIO_DEVICE_GET_GFX_DMABUF, &plane.dmabuf_id); in vfio_display_get_dmabuf()
413 ret = ioctl(vdev->vbasedev.fd, VFIO_DEVICE_QUERY_GFX_PLANE, &plane); in vfio_display_region_update()
449 ret = vfio_region_setup(OBJECT(vdev), &vdev->vbasedev, in vfio_display_region_update()
525 ret = ioctl(vdev->vbasedev.fd, VFIO_DEVICE_QUERY_GFX_PLANE, &probe); in vfio_display_probe()
533 ret = ioctl(vdev->vbasedev.fd, VFIO_DEVICE_QUERY_GFX_PLANE, &probe); in vfio_display_probe()
H A Dccw.c580 VFIODevice *vbasedev = &vcdev->vdev; in vfio_ccw_realize() local
590 if (!vfio_device_get_name(vbasedev, errp)) { in vfio_ccw_realize()
594 if (!vfio_attach_device(cdev->mdevid, vbasedev, in vfio_ccw_realize()
631 vfio_detach_device(vbasedev); in vfio_ccw_realize()
633 g_free(vbasedev->name); in vfio_ccw_realize()
677 VFIODevice *vbasedev = &vcdev->vdev; in vfio_ccw_instance_init() local
680 vbasedev->mdev = true; in vfio_ccw_instance_init()
690 vfio_device_init(vbasedev, VFIO_DEVICE_TYPE_CCW, &vfio_ccw_ops, in vfio_ccw_instance_init()
H A Dpci.h124 VFIODevice vbasedev; member
/openbmc/qemu/include/hw/vfio/
H A Dvfio-common.h54 struct VFIODevice *vbasedev; member
65 struct VFIODevice *vbasedev; member
232 void vfio_disable_irqindex(VFIODevice *vbasedev, int index);
233 void vfio_unmask_single_irqindex(VFIODevice *vbasedev, int index);
234 void vfio_mask_single_irqindex(VFIODevice *vbasedev, int index);
235 bool vfio_set_irq_signaling(VFIODevice *vbasedev, int index, int subindex,
241 int vfio_region_setup(Object *obj, VFIODevice *vbasedev, VFIORegion *region,
250 bool vfio_device_is_mdev(VFIODevice *vbasedev);
251 bool vfio_device_hiod_realize(VFIODevice *vbasedev, Error **errp);
252 bool vfio_attach_device(char *name, VFIODevice *vbasedev,
[all …]
H A Dvfio-container-base.h119 bool (*attach_device)(const char *name, VFIODevice *vbasedev,
121 void (*detach_device)(VFIODevice *vbasedev);
155 int (*pci_hot_reset)(VFIODevice *vbasedev, bool single);
H A Dvfio-platform.h52 VFIODevice vbasedev; /* not a QOM object */ member
/openbmc/qemu/hw/core/
H A Dsysbus-fdt.c224 VFIODevice *vbasedev = &vdev->vbasedev; in add_calxeda_midway_xgmac_fdt_node() local
228 vbasedev->name, mmio_base); in add_calxeda_midway_xgmac_fdt_node()
237 reg_attr = g_new(uint32_t, vbasedev->num_regions * 2); in add_calxeda_midway_xgmac_fdt_node()
238 for (i = 0; i < vbasedev->num_regions; i++) { in add_calxeda_midway_xgmac_fdt_node()
245 vbasedev->num_regions * 2 * sizeof(uint32_t)); in add_calxeda_midway_xgmac_fdt_node()
247 irq_attr = g_new(uint32_t, vbasedev->num_irqs * 3); in add_calxeda_midway_xgmac_fdt_node()
248 for (i = 0; i < vbasedev->num_irqs; i++) { in add_calxeda_midway_xgmac_fdt_node()
256 irq_attr, vbasedev->num_irqs * 3 * sizeof(uint32_t)); in add_calxeda_midway_xgmac_fdt_node()
295 VFIODevice *vbasedev = &vdev->vbasedev; in add_amd_xgbe_fdt_node() local
309 dt_name = sysfs_to_dt_name(vbasedev->name); in add_amd_xgbe_fdt_node()
[all …]
/openbmc/qemu/hw/s390x/
H A Ds390-pci-vfio.c69 if (!vpdev->vbasedev.group) { in s390_pci_start_dma_count()
73 id = vpdev->vbasedev.group->container->fd; in s390_pci_start_dma_count()
117 trace_s390_pci_clp_cap(vpci->vbasedev.name, in s390_pci_read_base()
155 trace_s390_pci_clp_cap(vpci->vbasedev.name, in get_host_fh()
182 trace_s390_pci_clp_cap(vpci->vbasedev.name, in s390_pci_read_group()
205 trace_s390_pci_clp_cap(vpci->vbasedev.name, in s390_pci_read_group()
254 trace_s390_pci_clp_cap(vpci->vbasedev.name, in s390_pci_read_util()
261 trace_s390_pci_clp_cap_size(vpci->vbasedev.name, cap->size, in s390_pci_read_util()
281 trace_s390_pci_clp_cap(vpci->vbasedev.name, in s390_pci_read_pfip()
288 trace_s390_pci_clp_cap_size(vpci->vbasedev.name, cap->size, in s390_pci_read_pfip()
[all …]