Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: arm/arm64: Fix bug in advertising KVM_CAP_MSI_DEVID capability

Commit 0e4e82f154e3 ("KVM: arm64: vgic-its: Enable ITS emulation as
a virtual MSI controller") tried to advertise KVM_CAP_MSI_DEVID, but
the code logic was not updating the dist->msis_require_devid field
correctly. If hypervisor tool creates the ITS device after VGIC
initialization then we don't advertise KVM_CAP_MSI_DEVID capability.

Update the field msis_require_devid to true inside vgic_its_create()
to fix the issue.

Fixes: 0e4e82f154e3 ("vgic-its: Enable ITS emulation as a virtual MSI controller")
Signed-off-by: Shanker Donthineni <shankerd@codeaurora.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

authored by

Shanker Donthineni and committed by
Marc Zyngier
79962a5c 5771a8c0

+1 -3
-3
virt/kvm/arm/vgic/vgic-init.c
··· 285 285 if (ret) 286 286 goto out; 287 287 288 - if (vgic_has_its(kvm)) 289 - dist->msis_require_devid = true; 290 - 291 288 kvm_for_each_vcpu(i, vcpu, kvm) 292 289 kvm_vgic_vcpu_enable(vcpu); 293 290
+1
virt/kvm/arm/vgic/vgic-its.c
··· 1598 1598 INIT_LIST_HEAD(&its->device_list); 1599 1599 INIT_LIST_HEAD(&its->collection_list); 1600 1600 1601 + dev->kvm->arch.vgic.msis_require_devid = true; 1601 1602 dev->kvm->arch.vgic.has_its = true; 1602 1603 its->enabled = false; 1603 1604 its->dev = dev;