/openbmc/qemu/hw/vfio/ |
H A D | migration.c | 119 obj = vbasedev->ops->vfio_get_object(vbasedev); in vfio_migration_send_event() 265 if (vbasedev->ops && vbasedev->ops->vfio_save_config) { in vfio_save_device_config_state() 266 ret = vbasedev->ops->vfio_save_config(vbasedev, f, errp); in vfio_save_device_config_state() 288 if (vbasedev->ops && vbasedev->ops->vfio_load_config) { in vfio_load_device_config_state() 291 ret = vbasedev->ops->vfio_load_config(vbasedev, f); in vfio_load_device_config_state() 851 VFIODevice *vbasedev = migration->vbasedev; in vfio_migration_state_notifier() local 926 obj = vbasedev->ops->vfio_get_object(vbasedev); in vfio_migration_init() 943 migration->vbasedev = vbasedev; in vfio_migration_init() 948 vbasedev->dirty_pages_supported = vfio_dma_logging_supported(vbasedev); in vfio_migration_init() 965 vbasedev->dev, vfio_vmstate_change, prepare_cb, vbasedev); in vfio_migration_init() [all …]
|
H A D | iommufd.c | 98 vbasedev->fd, vbasedev->devid); in iommufd_cdev_connect_and_bind() 252 iommufd, vbasedev->name, vbasedev->fd, id); in iommufd_cdev_attach_ioas_hwpt() 344 vbasedev->hwpt = hwpt; in iommufd_cdev_autodomains_get() 364 vbasedev->hwpt = NULL; in iommufd_cdev_autodomains_put() 394 if (vbasedev->hwpt) { in iommufd_cdev_detach_container() 588 vbasedev->group = 0; in iommufd_cdev_attach() 597 trace_iommufd_cdev_device_info(vbasedev->name, devfd, vbasedev->num_irqs, in iommufd_cdev_attach() 598 vbasedev->num_regions, vbasedev->flags); in iommufd_cdev_attach() 611 close(vbasedev->fd); in iommufd_cdev_attach() 636 close(vbasedev->fd); in iommufd_cdev_detach() [all …]
|
H A D | platform.c | 62 container_of(vbasedev, VFIOPlatformDevice, vbasedev); in vfio_init_intp() 115 VFIODevice *vbasedev = &intp->vdev->vbasedev; in vfio_set_trigger_eventfd() local 289 container_of(vbasedev, VFIOPlatformDevice, vbasedev); in vfio_platform_eoi() 355 VFIODevice *vbasedev = &intp->vdev->vbasedev; in vfio_set_resample_eventfd() local 449 container_of(vbasedev, VFIOPlatformDevice, vbasedev); in vfio_populate_device() 532 if (vbasedev->fd < 0 && vbasedev->sysfsdev) { in vfio_base_device_init() 534 vbasedev->name = g_path_get_basename(vbasedev->sysfsdev); in vfio_base_device_init() 536 if (!vbasedev->name || strchr(vbasedev->name, '/')) { in vfio_base_device_init() 549 if (!vfio_attach_device(vbasedev->name, vbasedev, in vfio_base_device_init() 575 VFIODevice *vbasedev = &vdev->vbasedev; in vfio_platform_realize() local [all …]
|
H A D | helpers.c | 155 VFIODevice *vbasedev = region->vbasedev; in vfio_region_write() local 198 vbasedev->ops->vfio_eoi(vbasedev); in vfio_region_write() 205 VFIODevice *vbasedev = region->vbasedev; in vfio_region_read() local 241 vbasedev->ops->vfio_eoi(vbasedev); in vfio_region_read() 354 region->vbasedev = vbasedev; in vfio_region_setup() 620 vbasedev->name = g_path_get_basename(vbasedev->sysfsdev); in vfio_device_get_name() 632 vbasedev->name = g_strdup_printf("VFIO_FD%d", vbasedev->fd); in vfio_device_get_name() 648 vbasedev->fd = fd; in vfio_device_set_fd() 655 vbasedev->ops = ops; in vfio_device_init() 656 vbasedev->dev = dev; in vfio_device_init() [all …]
|
H A D | pci.c | 106 VFIOPCIDevice *vdev = container_of(vbasedev, VFIOPCIDevice, vbasedev); in vfio_intx_eoi() 2513 VFIODevice *vbasedev = &vdev->vbasedev; in vfio_pci_hot_reset() local 2668 VFIODevice *vbasedev = &vdev->vbasedev; in vfio_populate_vga() local 2733 VFIODevice *vbasedev = &vdev->vbasedev; in vfio_populate_device() local 2965 VFIODevice *vbasedev = &vdev->vbasedev; in vfio_realize() local 2970 if (vbasedev->fd < 0 && !vbasedev->sysfsdev) { in vfio_realize() 2997 vbasedev->mdev = vfio_device_is_mdev(vbasedev); in vfio_realize() 2999 trace_vfio_mdev(vbasedev->name, vbasedev->mdev); in vfio_realize() 3001 if (vbasedev->ram_block_discard_allowed && !vbasedev->mdev) { in vfio_realize() 3273 VFIODevice *vbasedev = &vdev->vbasedev; in vfio_exitfn() local [all …]
|
H A D | common.c | 69 VFIODevice *vbasedev; in vfio_mig_active() local 92 VFIODevice *vbasedev; in vfio_multiple_devices_migration_is_supported() local 175 VFIODevice *vbasedev; in vfio_devices_all_dirty_tracking() local 199 VFIODevice *vbasedev; in vfio_devices_all_device_dirty_tracking() local 220 VFIODevice *vbasedev; in vfio_devices_all_running_and_mig_active() local 820 VFIODevice *vbasedev; in vfio_section_is_vfio_pci() local 829 pcidev = container_of(vbasedev, VFIOPCIDevice, vbasedev); in vfio_section_is_vfio_pci() 1400 vbasedev->ops->vfio_compute_needs_reset(vbasedev); in vfio_reset_handler() 1405 if (vbasedev->dev->realized && vbasedev->needs_reset) { in vfio_reset_handler() 1406 vbasedev->ops->vfio_hot_reset_multi(vbasedev); in vfio_reset_handler() [all …]
|
H A D | igd.c | 325 trace_vfio_pci_igd_bar4_write(vdev->vbasedev.name, in vfio_igd_quirk_data_write() 426 ret = vfio_get_region_info(&vdev->vbasedev, in vfio_probe_igd_bar4_quirk() 430 vdev->vbasedev.name); in vfio_probe_igd_bar4_quirk() 449 ret = vfio_get_dev_region_info(&vdev->vbasedev, in vfio_probe_igd_bar4_quirk() 458 ret = vfio_get_dev_region_info(&vdev->vbasedev, in vfio_probe_igd_bar4_quirk() 467 ret = vfio_get_dev_region_info(&vdev->vbasedev, in vfio_probe_igd_bar4_quirk() 586 if (pread(vdev->vbasedev.fd, &cmd_orig, sizeof(cmd_orig), in vfio_probe_igd_bar4_quirk() 589 vdev->vbasedev.name); in vfio_probe_igd_bar4_quirk() 594 if (pwrite(vdev->vbasedev.fd, &cmd, sizeof(cmd), in vfio_probe_igd_bar4_quirk() 597 vdev->vbasedev.name); in vfio_probe_igd_bar4_quirk() [all …]
|
H A D | container.c | 845 vbasedev->fd = fd; in vfio_get_device() 846 vbasedev->group = group; in vfio_get_device() 851 vbasedev->flags = info->flags; in vfio_get_device() 862 if (!vbasedev->group) { in vfio_put_base_device() 865 QLIST_REMOVE(vbasedev, next); in vfio_put_base_device() 866 vbasedev->group = NULL; in vfio_put_base_device() 868 close(vbasedev->fd); in vfio_put_base_device() 939 vbasedev->bcontainer = bcontainer; in vfio_legacy_attach_device() 952 vbasedev->bcontainer = NULL; in vfio_legacy_detach_device() 954 vfio_put_base_device(vbasedev); in vfio_legacy_detach_device() [all …]
|
H A D | ap.c | 159 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 D | pci-quirks.c | 213 trace_vfio_quirk_generic_mirror_read(vdev->vbasedev.name, in vfio_generic_quirk_mirror_read() 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() 484 trace_vfio_quirk_ati_bar4_probe(vdev->vbasedev.name); in vfio_probe_ati_bar4_quirk() 516 trace_vfio_quirk_ati_bar2_probe(vdev->vbasedev.name); in vfio_probe_ati_bar2_quirk() 1159 trace_vfio_quirk_rtl8168_probe(vdev->vbasedev.name); in vfio_probe_rtl8168_bar2_quirk() 1178 ret = pread(vdev->vbasedev.fd, vdev->igd_opregion, in vfio_pci_igd_opregion_init() 1390 if (vdev->vbasedev.reset_works) { in vfio_radeon_reset() 1571 ret = pread(vdev->vbasedev.fd, &tmp, 1, in vfio_add_nv_gpudirect_cap() 1645 ret = pread(vdev->vbasedev.fd, membar_phys, 16, in vfio_add_vmd_shadow_cap() [all …]
|
H A D | display.c | 44 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 D | ccw.c | 580 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() 676 VFIODevice *vbasedev = &vcdev->vdev; in vfio_ccw_instance_init() local 679 vbasedev->mdev = true; in vfio_ccw_instance_init() 689 vfio_device_init(vbasedev, VFIO_DEVICE_TYPE_CCW, &vfio_ccw_ops, in vfio_ccw_instance_init()
|
H A D | pci.h | 124 VFIODevice vbasedev; member
|
/openbmc/qemu/include/hw/vfio/ |
H A D | vfio-common.h | 54 struct VFIODevice *vbasedev; member 65 struct VFIODevice *vbasedev; member 229 void vfio_disable_irqindex(VFIODevice *vbasedev, int index); 247 bool vfio_device_is_mdev(VFIODevice *vbasedev); 249 bool vfio_attach_device(char *name, VFIODevice *vbasedev, 251 void vfio_detach_device(VFIODevice *vbasedev); 270 bool vfio_viommu_preset(VFIODevice *vbasedev); 273 bool vfio_device_state_is_running(VFIODevice *vbasedev); 274 bool vfio_device_state_is_precopy(VFIODevice *vbasedev); 277 int vfio_get_region_info(VFIODevice *vbasedev, int index, [all …]
|
H A D | vfio-container-base.h | 119 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 D | vfio-platform.h | 52 VFIODevice vbasedev; /* not a QOM object */ member
|
/openbmc/qemu/hw/core/ |
H A D | sysbus-fdt.c | 224 VFIODevice *vbasedev = &vdev->vbasedev; in add_calxeda_midway_xgmac_fdt_node() local 238 for (i = 0; i < vbasedev->num_regions; i++) { 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() 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() 312 __func__, vbasedev->name); in add_amd_xgbe_fdt_node() 331 if (vbasedev->num_regions != 5) { in add_amd_xgbe_fdt_node() 376 for (i = 0; i < vbasedev->num_regions; i++) { in add_amd_xgbe_fdt_node() 385 irq_attr = g_new(uint32_t, vbasedev->num_irqs * 3); in add_amd_xgbe_fdt_node() [all …]
|
/openbmc/qemu/hw/s390x/ |
H A D | s390-pci-vfio.c | 69 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 …]
|