]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'kvm-arm-for-4.8-take2' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Aug 2016 11:59:56 +0000 (13:59 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Aug 2016 11:59:56 +0000 (13:59 +0200)
KVM/ARM Changes for v4.8 - Take 2

Includes GSI routing support to go along with the new VGIC and a small fix that
has been cooking in -next for a while.

1  2 
Documentation/virtual/kvm/api.txt
include/linux/kvm_host.h
include/uapi/linux/kvm.h
virt/kvm/arm/vgic/vgic-init.c
virt/kvm/irqchip.c

index 5237e1b2fd66cf038e480d1710ae0bcd80a2edae,7a04216d727854ed5666c9816f0ac51cf203dedd..da3c395ed174b9b2424ef21d271727cc9d11341e
@@@ -1468,7 -1471,11 +1471,13 @@@ struct kvm_irq_routing_entry 
  #define KVM_IRQ_ROUTING_S390_ADAPTER 3
  #define KVM_IRQ_ROUTING_HV_SINT 4
  
- No flags are specified so far, the corresponding field must be set to zero.
+ flags:
 -- KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI
 -  routing entry type, specifies that the devid field contains
 -  a valid value.
++- KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI routing entry
++  type, specifies that the devid field contains a valid value.  The per-VM
++  KVM_CAP_MSI_DEVID capability advertises the requirement to provide
++  the device ID.  If this capability is not available, userspace should
++  never set the KVM_MSI_VALID_DEVID flag as the ioctl might fail.
+ - zero otherwise
  
  struct kvm_irq_routing_irqchip {
        __u32 irqchip;
@@@ -1479,13 -1486,19 +1488,20 @@@ struct kvm_irq_routing_msi 
        __u32 address_lo;
        __u32 address_hi;
        __u32 data;
-       __u32 pad;
+       union {
+               __u32 pad;
+               __u32 devid;
+       };
  };
  
 -devid: If KVM_MSI_VALID_DEVID is set, contains a unique device identifier
 -       for the device that wrote the MSI message.
 -       For PCI, this is usually a BFD identifier in the lower 16 bits.
++If KVM_MSI_VALID_DEVID is set, devid contains a unique device identifier
++for the device that wrote the MSI message.  For PCI, this is usually a
++BFD identifier in the lower 16 bits.
 -The per-VM KVM_CAP_MSI_DEVID capability advertises the requirement to
 -provide the device ID. If this capability is not set, userland cannot
 -rely on the kernel to allow the KVM_MSI_VALID_DEVID flag being set.
 +On x86, address_hi is ignored unless the KVM_X2APIC_API_USE_32BIT_IDS
 +feature of KVM_CAP_X2APIC_API capability is enabled.  If it is enabled,
 +address_hi bits 31-8 provide bits 31-8 of the destination id.  Bits 7-0 of
 +address_hi must be zero.
  
  struct kvm_irq_routing_s390_adapter {
        __u64 ind_addr;
@@@ -2199,18 -2197,14 +2215,18 @@@ struct kvm_msi 
        __u8  pad[12];
  };
  
--flags: KVM_MSI_VALID_DEVID: devid contains a valid value
--devid: If KVM_MSI_VALID_DEVID is set, contains a unique device identifier
--       for the device that wrote the MSI message.
--       For PCI, this is usually a BFD identifier in the lower 16 bits.
++flags: KVM_MSI_VALID_DEVID: devid contains a valid value.  The per-VM
++  KVM_CAP_MSI_DEVID capability advertises the requirement to provide
++  the device ID.  If this capability is not available, userspace
++  should never set the KVM_MSI_VALID_DEVID flag as the ioctl might fail.
  
--The per-VM KVM_CAP_MSI_DEVID capability advertises the need to provide
--the device ID. If this capability is not set, userland cannot rely on
--the kernel to allow the KVM_MSI_VALID_DEVID flag being set.
++If KVM_MSI_VALID_DEVID is set, devid contains a unique device identifier
++for the device that wrote the MSI message.  For PCI, this is usually a
++BFD identifier in the lower 16 bits.
 +
 +On x86, address_hi is ignored unless the KVM_CAP_X2APIC_API capability is
 +enabled.  If it is enabled, address_hi bits 31-8 provide bits 31-8 of the
 +destination id.  Bits 7-0 of address_hi must be zero.
  
  
  4.71 KVM_CREATE_PIT2
Simple merge
Simple merge
Simple merge
index df99e9c3b64d314dfee121b6bf6a753be10aeb9b,c6202199e5056372ae52b7ae096c950b90e01091..3bcc9990adf79eb9367a6fee61a7fd9683233a35
@@@ -208,15 -208,19 +209,19 @@@ int kvm_set_irq_routing(struct kvm *kvm
                        goto out;
  
                r = -EINVAL;
-               if (ue->flags) {
-                       kfree(e);
-                       goto out;
+               switch (ue->type) {
+               case KVM_IRQ_ROUTING_MSI:
+                       if (ue->flags & ~KVM_MSI_VALID_DEVID)
+                               goto free_entry;
+                       break;
+               default:
+                       if (ue->flags)
+                               goto free_entry;
+                       break;
                }
 -              r = setup_routing_entry(new, e, ue);
 +              r = setup_routing_entry(kvm, new, e, ue);
-               if (r) {
-                       kfree(e);
-                       goto out;
-               }
+               if (r)
+                       goto free_entry;
                ++ue;
        }