@@ -73,12 +73,22 @@ 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))
return -EINVAL;
- route.msi.address_lo = msi->address_lo;
- route.msi.address_hi = msi->address_hi;
- route.msi.data = msi->data;
+ if (msi->flags & KVM_MSI_VALID_DEVID) {
+ route.type = KVM_IRQ_ROUTING_EXTENDED_MSI;
+ route.ext_msi.address_lo = msi->address_lo;
+ route.ext_msi.address_hi = msi->address_hi;
+ route.ext_msi.data = msi->data;
+ route.ext_msi.devid= msi->devid;
+ }
+ else {
+ route.type = KVM_IRQ_ROUTING_MSI;
+ route.msi.address_lo = msi->address_lo;
+ route.msi.address_hi = msi->address_hi;
+ route.msi.data = msi->data;
+ }
return kvm_set_msi(&route, kvm, KVM_USERSPACE_IRQ_SOURCE_ID, 1, false);
}
on ARM, a devid field is conveyed in kvm_msi struct. Let's choose the rooting type and struct according to its availability and fill the corresponding struct. Also remove the flag check now this latter can be non null. Signed-off-by: Eric Auger <eric.auger@linaro.org> --- virt/kvm/irqchip.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)