aboutsummaryrefslogtreecommitdiff
path: root/backends/hostmem-file.c
diff options
context:
space:
mode:
authorJing Liu <jing2.liu@intel.com>2023-09-25 22:14:05 -0400
committerCédric Le Goater <clg@redhat.com>2023-10-05 22:04:51 +0200
commitd9e6710d7d59c1f774bfb49f3b1c2b5ee06ed33e (patch)
treed1a664b2eb2db3dc4be50632a33dd8d901d712ec /backends/hostmem-file.c
parent45d85f6228117dbe01d3680f1ad834389f69012f (diff)
downloadqemu-d9e6710d7d59c1f774bfb49f3b1c2b5ee06ed33e.zip
qemu-d9e6710d7d59c1f774bfb49f3b1c2b5ee06ed33e.tar.gz
qemu-d9e6710d7d59c1f774bfb49f3b1c2b5ee06ed33e.tar.bz2
vfio/pci: enable vector on dynamic MSI-X allocation
The vector_use callback is used to enable vector that is unmasked in guest. The kernel used to only support static MSI-X allocation. When allocating a new interrupt using "static MSI-X allocation" kernels, QEMU first disables all previously allocated vectors and then re-allocates all including the new one. The nr_vectors of VFIOPCIDevice indicates that all vectors from 0 to nr_vectors are allocated (and may be enabled), which is used to loop all the possibly used vectors when e.g., disabling MSI-X interrupts. Extend the vector_use function to support dynamic MSI-X allocation when host supports the capability. QEMU therefore can individually allocate and enable a new interrupt without affecting others or causing interrupts lost during runtime. Utilize nr_vectors to calculate the upper bound of enabled vectors in dynamic MSI-X allocation mode since looping all msix_entries_nr is not efficient and unnecessary. Signed-off-by: Jing Liu <jing2.liu@intel.com> Tested-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'backends/hostmem-file.c')
0 files changed, 0 insertions, 0 deletions