aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-04-07 12:10:03 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2015-04-07 12:10:03 -0400
commit7f22b45d66b8e603e2e85e78f209531779f8b1cc (patch)
tree6abed0cec23ed9c6bb5a1e3dbfd15b4345fa9b62 /Documentation
parentbf0fb67cf957fc8ecfaaa2819b7d6a0f795e2ef2 (diff)
parent816c7667ea97c61884e014cfeedaede5b67b0e58 (diff)
Merge tag 'kvm-s390-next-20150331' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
Features and fixes for 4.1 (kvm/next) 1. Assorted changes 1.1 allow more feature bits for the guest 1.2 Store breaking event address on program interrupts 2. Interrupt handling rework 2.1 Fix copy_to_user while holding a spinlock (cc stable) 2.2 Rework floating interrupts to follow the priorities 2.3 Allow to inject all local interrupts via new ioctl 2.4 allow to get/set the full local irq state, e.g. for migration and introspection
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/virtual/kvm/api.txt117
-rw-r--r--Documentation/virtual/kvm/devices/s390_flic.txt3
2 files changed, 120 insertions, 0 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index 57d25fdd3d7e..bc9f6fe44e27 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -2861,6 +2861,123 @@ single frame starting at start_gfn for count frames.
2861Note: If any architecturally invalid key value is found in the given data then 2861Note: If any architecturally invalid key value is found in the given data then
2862the ioctl will return -EINVAL. 2862the ioctl will return -EINVAL.
2863 2863
28644.92 KVM_S390_IRQ
2865
2866Capability: KVM_CAP_S390_INJECT_IRQ
2867Architectures: s390
2868Type: vcpu ioctl
2869Parameters: struct kvm_s390_irq (in)
2870Returns: 0 on success, -1 on error
2871Errors:
2872 EINVAL: interrupt type is invalid
2873 type is KVM_S390_SIGP_STOP and flag parameter is invalid value
2874 type is KVM_S390_INT_EXTERNAL_CALL and code is bigger
2875 than the maximum of VCPUs
2876 EBUSY: type is KVM_S390_SIGP_SET_PREFIX and vcpu is not stopped
2877 type is KVM_S390_SIGP_STOP and a stop irq is already pending
2878 type is KVM_S390_INT_EXTERNAL_CALL and an external call interrupt
2879 is already pending
2880
2881Allows to inject an interrupt to the guest.
2882
2883Using struct kvm_s390_irq as a parameter allows
2884to inject additional payload which is not
2885possible via KVM_S390_INTERRUPT.
2886
2887Interrupt parameters are passed via kvm_s390_irq:
2888
2889struct kvm_s390_irq {
2890 __u64 type;
2891 union {
2892 struct kvm_s390_io_info io;
2893 struct kvm_s390_ext_info ext;
2894 struct kvm_s390_pgm_info pgm;
2895 struct kvm_s390_emerg_info emerg;
2896 struct kvm_s390_extcall_info extcall;
2897 struct kvm_s390_prefix_info prefix;
2898 struct kvm_s390_stop_info stop;
2899 struct kvm_s390_mchk_info mchk;
2900 char reserved[64];
2901 } u;
2902};
2903
2904type can be one of the following:
2905
2906KVM_S390_SIGP_STOP - sigp stop; parameter in .stop
2907KVM_S390_PROGRAM_INT - program check; parameters in .pgm
2908KVM_S390_SIGP_SET_PREFIX - sigp set prefix; parameters in .prefix
2909KVM_S390_RESTART - restart; no parameters
2910KVM_S390_INT_CLOCK_COMP - clock comparator interrupt; no parameters
2911KVM_S390_INT_CPU_TIMER - CPU timer interrupt; no parameters
2912KVM_S390_INT_EMERGENCY - sigp emergency; parameters in .emerg
2913KVM_S390_INT_EXTERNAL_CALL - sigp external call; parameters in .extcall
2914KVM_S390_MCHK - machine check interrupt; parameters in .mchk
2915
2916
2917Note that the vcpu ioctl is asynchronous to vcpu execution.
2918
29194.94 KVM_S390_GET_IRQ_STATE
2920
2921Capability: KVM_CAP_S390_IRQ_STATE
2922Architectures: s390
2923Type: vcpu ioctl
2924Parameters: struct kvm_s390_irq_state (out)
2925Returns: >= number of bytes copied into buffer,
2926 -EINVAL if buffer size is 0,
2927 -ENOBUFS if buffer size is too small to fit all pending interrupts,
2928 -EFAULT if the buffer address was invalid
2929
2930This ioctl allows userspace to retrieve the complete state of all currently
2931pending interrupts in a single buffer. Use cases include migration
2932and introspection. The parameter structure contains the address of a
2933userspace buffer and its length:
2934
2935struct kvm_s390_irq_state {
2936 __u64 buf;
2937 __u32 flags;
2938 __u32 len;
2939 __u32 reserved[4];
2940};
2941
2942Userspace passes in the above struct and for each pending interrupt a
2943struct kvm_s390_irq is copied to the provided buffer.
2944
2945If -ENOBUFS is returned the buffer provided was too small and userspace
2946may retry with a bigger buffer.
2947
29484.95 KVM_S390_SET_IRQ_STATE
2949
2950Capability: KVM_CAP_S390_IRQ_STATE
2951Architectures: s390
2952Type: vcpu ioctl
2953Parameters: struct kvm_s390_irq_state (in)
2954Returns: 0 on success,
2955 -EFAULT if the buffer address was invalid,
2956 -EINVAL for an invalid buffer length (see below),
2957 -EBUSY if there were already interrupts pending,
2958 errors occurring when actually injecting the
2959 interrupt. See KVM_S390_IRQ.
2960
2961This ioctl allows userspace to set the complete state of all cpu-local
2962interrupts currently pending for the vcpu. It is intended for restoring
2963interrupt state after a migration. The input parameter is a userspace buffer
2964containing a struct kvm_s390_irq_state:
2965
2966struct kvm_s390_irq_state {
2967 __u64 buf;
2968 __u32 len;
2969 __u32 pad;
2970};
2971
2972The userspace memory referenced by buf contains a struct kvm_s390_irq
2973for each interrupt to be injected into the guest.
2974If one of the interrupts could not be injected for some reason the
2975ioctl aborts.
2976
2977len must be a multiple of sizeof(struct kvm_s390_irq). It must be > 0
2978and it must not exceed (max_vcpus + 32) * sizeof(struct kvm_s390_irq),
2979which is the maximum number of possibly pending cpu-local interrupts.
2980
28645. The kvm_run structure 29815. The kvm_run structure
2865------------------------ 2982------------------------
2866 2983
diff --git a/Documentation/virtual/kvm/devices/s390_flic.txt b/Documentation/virtual/kvm/devices/s390_flic.txt
index 4ceef53164b0..d1ad9d5cae46 100644
--- a/Documentation/virtual/kvm/devices/s390_flic.txt
+++ b/Documentation/virtual/kvm/devices/s390_flic.txt
@@ -27,6 +27,9 @@ Groups:
27 Copies all floating interrupts into a buffer provided by userspace. 27 Copies all floating interrupts into a buffer provided by userspace.
28 When the buffer is too small it returns -ENOMEM, which is the indication 28 When the buffer is too small it returns -ENOMEM, which is the indication
29 for userspace to try again with a bigger buffer. 29 for userspace to try again with a bigger buffer.
30 -ENOBUFS is returned when the allocation of a kernelspace buffer has
31 failed.
32 -EFAULT is returned when copying data to userspace failed.
30 All interrupts remain pending, i.e. are not deleted from the list of 33 All interrupts remain pending, i.e. are not deleted from the list of
31 currently pending interrupts. 34 currently pending interrupts.
32 attr->addr contains the userspace address of the buffer into which all 35 attr->addr contains the userspace address of the buffer into which all