qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 8c37fa: vfio-pci, ppc64/spapr: Reorder group-


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 8c37fa: vfio-pci, ppc64/spapr: Reorder group-to-container ...
Date: Tue, 18 Jul 2017 09:54:09 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 8c37faa475f35d158622422788fe8e5aef3118e1
      
https://github.com/qemu/qemu/commit/8c37faa475f35d158622422788fe8e5aef3118e1
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2017-07-17 (Mon, 17 Jul 2017)

  Changed paths:
    M hw/vfio/common.c

  Log Message:
  -----------
  vfio-pci, ppc64/spapr: Reorder group-to-container attaching

At the moment VFIO PCI device initialization works as follows:
vfio_realize
        vfio_get_group
                vfio_connect_container
                        register memory listeners (1)
                        update QEMU groups lists
                vfio_kvm_device_add_group

Then (example for pseries) the machine reset hook triggers region_add()
for all regions where listeners from (1) are listening:

ppc_spapr_reset
        spapr_phb_reset
                spapr_tce_table_enable
                        memory_region_add_subregion
                                vfio_listener_region_add
                                        vfio_spapr_create_window

This scheme works fine until we need to handle VFIO PCI device hotplug
and we want to enable PPC64/sPAPR in-kernel TCE acceleration on,
i.e. after PCI hotplug we need a place to call
ioctl(vfio_kvm_device_fd, KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE).
Since the ioctl needs a LIOBN fd (from sPAPRTCETable) and a IOMMU group fd
(from VFIOGroup), vfio_listener_region_add() seems to be the only place
for this ioctl().

However this only works during boot time because the machine reset
happens strictly after all devices are finalized. When hotplug happens,
vfio_listener_region_add() is called when a memory listener is registered
but when this happens:
1. new group is not added to the container->group_list yet;
2. VFIO KVM device is unaware of the new IOMMU group.

This moves bits around to have all necessary VFIO infrastructure
in place for both initial startup and hotplug cases.

[aw: ie, register vfio groups with kvm prior to memory listener
registration such that kvm-vfio pseudo device ioctls are available
during the region_add callback]

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 9d836fc552cce747a0946473726ff25262130351
      
https://github.com/qemu/qemu/commit/9d836fc552cce747a0946473726ff25262130351
  Author: Peter Maydell <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M hw/vfio/common.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20170717.0' 
into staging

VFIO fixes 2017-07-17

 - Init re-order to better support hot-add on SPAR (Alexey Kardashevskiy)

# gpg: Signature made Mon 17 Jul 2017 21:33:01 BST
# gpg:                using RSA key 0x239B9B6E3BB08B22
# gpg: Good signature from "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"
# Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22

* remotes/awilliam/tags/vfio-updates-20170717.0:
  vfio-pci, ppc64/spapr: Reorder group-to-container attaching

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/368e708b4c95...9d836fc552cc

reply via email to

[Prev in Thread] Current Thread [Next in Thread]