diff options
author | Jean-Philippe Brucker <jean-philippe@linaro.org> | 2023-06-28 12:23:31 +0100 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2023-07-06 15:31:22 +0100 |
commit | 3a36d3410e993094575e7bb5c387a297856cfb1c (patch) | |
tree | 53af285ee535461e0dd20dd3948899ff5c5906a0 | |
parent | 3b1cdcf9e78f7d36f0cca805c4172bba53779b69 (diff) | |
download | kvmtool-3a36d3410e993094575e7bb5c387a297856cfb1c.tar.gz |
vfio/pci: Initialize MSI vectors unmasked
MSI vectors can be masked and unmasked individually when using the MSI-X
capability, or when the classic MSI capability supports Per-Vector
Masking. At the moment we incorrectly initialize the guest's view of the
vectors (virt_state) as masked, so when using a MSI capability without
Per-Vector Masking, the vectors are never unmasked and MSIs don't work.
Initialize them unmasked instead.
Since VFIO doesn't support per-vector masking we implement it by
disconnecting the irqfd, and keep track of it with the vector's
phys_state. Initially the irqfd is not connected so phys_state is
masked.
Reported-by: Vivek Gautam <vivek.gautam@arm.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Link: https://lore.kernel.org/r/20230628112331.453904-3-jean-philippe@linaro.org
Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r-- | vfio/pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1182,7 +1182,7 @@ static int vfio_pci_init_msis(struct kvm *kvm, struct vfio_device *vdev, entry = &msis->entries[i]; entry->gsi = -1; entry->eventfd = -1; - msi_set_masked(entry->virt_state, true); + msi_set_masked(entry->virt_state, false); msi_set_masked(entry->phys_state, true); eventfds[i] = -1; } |