Skip to content

Commit

Permalink
KVM: irqchip: Convey devid to kvm_set_msi
Browse files Browse the repository at this point in the history
on ARM, a devid field is populated in kvm_msi struct in case the
flag is set to KVM_MSI_VALID_DEVID. Let's propagate both flags and
devid field in kvm_kernel_irq_routing_entry.

Signed-off-by: Eric Auger <[email protected]>
Reviewed-by: Andre Przywara <[email protected]>
Acked-by: Christoffer Dall <[email protected]>
Acked-by: Radim Krčmář <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
  • Loading branch information
eauger authored and Marc Zyngier committed Jul 22, 2016
1 parent 0455e72 commit ebe9152
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion virt/kvm/irqchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi)
{
struct kvm_kernel_irq_routing_entry route;

if (!irqchip_in_kernel(kvm) || msi->flags != 0)
if (!irqchip_in_kernel(kvm) || (msi->flags & ~KVM_MSI_VALID_DEVID))
return -EINVAL;

route.msi.address_lo = msi->address_lo;
route.msi.address_hi = msi->address_hi;
route.msi.data = msi->data;
route.msi.flags = msi->flags;
route.msi.devid = msi->devid;

return kvm_set_msi(&route, kvm, KVM_USERSPACE_IRQ_SOURCE_ID, 1, false);
}
Expand Down

0 comments on commit ebe9152

Please sign in to comment.