Merge branch 'kvm-ppc-next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus...
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 3 Mar 2016 13:35:44 +0000 (14:35 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 3 Mar 2016 13:36:07 +0000 (14:36 +0100)
The highlights are:

* Enable VFIO device on PowerPC, from David Gibson
* Optimizations to speed up IPIs between vcpus in HV KVM,
  from Suresh Warrier (who is also Suresh E. Warrier)
* In-kernel handling of IOMMU hypercalls, and support for dynamic DMA
  windows (DDW), from Alexey Kardashevskiy.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1  2 
Documentation/virtual/kvm/api.txt
include/uapi/linux/kvm.h

@@@ -3035,6 -3035,63 +3035,63 @@@ Returns: 0 on success, -1 on erro
  
  Queues an SMI on the thread's vcpu.
  
+ 4.97 KVM_CAP_PPC_MULTITCE
+ Capability: KVM_CAP_PPC_MULTITCE
+ Architectures: ppc
+ Type: vm
+ This capability means the kernel is capable of handling hypercalls
+ H_PUT_TCE_INDIRECT and H_STUFF_TCE without passing those into the user
+ space. This significantly accelerates DMA operations for PPC KVM guests.
+ User space should expect that its handlers for these hypercalls
+ are not going to be called if user space previously registered LIOBN
+ in KVM (via KVM_CREATE_SPAPR_TCE or similar calls).
+ In order to enable H_PUT_TCE_INDIRECT and H_STUFF_TCE use in the guest,
+ user space might have to advertise it for the guest. For example,
+ IBM pSeries (sPAPR) guest starts using them if "hcall-multi-tce" is
+ present in the "ibm,hypertas-functions" device-tree property.
+ The hypercalls mentioned above may or may not be processed successfully
+ in the kernel based fast path. If they can not be handled by the kernel,
+ they will get passed on to user space. So user space still has to have
+ an implementation for these despite the in kernel acceleration.
+ This capability is always enabled.
+ 4.98 KVM_CREATE_SPAPR_TCE_64
+ Capability: KVM_CAP_SPAPR_TCE_64
+ Architectures: powerpc
+ Type: vm ioctl
+ Parameters: struct kvm_create_spapr_tce_64 (in)
+ Returns: file descriptor for manipulating the created TCE table
+ This is an extension for KVM_CAP_SPAPR_TCE which only supports 32bit
+ windows, described in 4.62 KVM_CREATE_SPAPR_TCE
+ This capability uses extended struct in ioctl interface:
+ /* for KVM_CAP_SPAPR_TCE_64 */
+ struct kvm_create_spapr_tce_64 {
+       __u64 liobn;
+       __u32 page_shift;
+       __u32 flags;
+       __u64 offset;   /* in pages */
+       __u64 size;     /* in pages */
+ };
+ The aim of extension is to support an additional bigger DMA window with
+ a variable page size.
+ KVM_CREATE_SPAPR_TCE_64 receives a 64bit window size, an IOMMU page shift and
+ a bus offset of the corresponding DMA window, @size and @offset are numbers
+ of IOMMU pages.
+ @flags are not used at the moment.
+ The rest of functionality is identical to KVM_CREATE_SPAPR_TCE.
  5. The kvm_run structure
  ------------------------
  
@@@ -3339,7 -3396,6 +3396,7 @@@ EOI was received
  
                struct kvm_hyperv_exit {
  #define KVM_EXIT_HYPERV_SYNIC          1
 +#define KVM_EXIT_HYPERV_HCALL          2
                        __u32 type;
                        union {
                                struct {
                                        __u64 evt_page;
                                        __u64 msg_page;
                                } synic;
 +                              struct {
 +                                      __u64 input;
 +                                      __u64 result;
 +                                      __u64 params[2];
 +                              } hcall;
                        } u;
                };
                /* KVM_EXIT_HYPERV */
diff --combined include/uapi/linux/kvm.h
@@@ -157,7 -157,6 +157,7 @@@ struct kvm_s390_skeys 
  
  struct kvm_hyperv_exit {
  #define KVM_EXIT_HYPERV_SYNIC          1
 +#define KVM_EXIT_HYPERV_HCALL          2
        __u32 type;
        union {
                struct {
                        __u64 evt_page;
                        __u64 msg_page;
                } synic;
 +              struct {
 +                      __u64 input;
 +                      __u64 result;
 +                      __u64 params[2];
 +              } hcall;
        } u;
  };
  
@@@ -547,13 -541,7 +547,13 @@@ struct kvm_s390_pgm_info 
        __u8 exc_access_id;
        __u8 per_access_id;
        __u8 op_access_id;
 -      __u8 pad[3];
 +#define KVM_S390_PGM_FLAGS_ILC_VALID  0x01
 +#define KVM_S390_PGM_FLAGS_ILC_0      0x02
 +#define KVM_S390_PGM_FLAGS_ILC_1      0x04
 +#define KVM_S390_PGM_FLAGS_ILC_MASK   0x06
 +#define KVM_S390_PGM_FLAGS_NO_REWIND  0x08
 +      __u8 flags;
 +      __u8 pad[2];
  };
  
  struct kvm_s390_prefix_info {
@@@ -862,6 -850,7 +862,7 @@@ struct kvm_ppc_smmu_info 
  #define KVM_CAP_IOEVENTFD_ANY_LENGTH 122
  #define KVM_CAP_HYPERV_SYNIC 123
  #define KVM_CAP_S390_RI 124
+ #define KVM_CAP_SPAPR_TCE_64 125
  
  #ifdef KVM_CAP_IRQ_ROUTING
  
@@@ -1154,6 -1143,8 +1155,8 @@@ struct kvm_s390_ucas_mapping 
  /* Available with KVM_CAP_PPC_ALLOC_HTAB */
  #define KVM_PPC_ALLOCATE_HTAB   _IOWR(KVMIO, 0xa7, __u32)
  #define KVM_CREATE_SPAPR_TCE    _IOW(KVMIO,  0xa8, struct kvm_create_spapr_tce)
+ #define KVM_CREATE_SPAPR_TCE_64         _IOW(KVMIO,  0xa8, \
+                                      struct kvm_create_spapr_tce_64)
  /* Available with KVM_CAP_RMA */
  #define KVM_ALLOCATE_RMA        _IOR(KVMIO,  0xa9, struct kvm_allocate_rma)
  /* Available with KVM_CAP_PPC_HTAB_FD */