diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-04-07 12:10:03 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-04-07 12:10:03 -0400 |
commit | 7f22b45d66b8e603e2e85e78f209531779f8b1cc (patch) | |
tree | 6abed0cec23ed9c6bb5a1e3dbfd15b4345fa9b62 /Documentation | |
parent | bf0fb67cf957fc8ecfaaa2819b7d6a0f795e2ef2 (diff) | |
parent | 816c7667ea97c61884e014cfeedaede5b67b0e58 (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.txt | 117 | ||||
-rw-r--r-- | Documentation/virtual/kvm/devices/s390_flic.txt | 3 |
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. | |||
2861 | Note: If any architecturally invalid key value is found in the given data then | 2861 | Note: If any architecturally invalid key value is found in the given data then |
2862 | the ioctl will return -EINVAL. | 2862 | the ioctl will return -EINVAL. |
2863 | 2863 | ||
2864 | 4.92 KVM_S390_IRQ | ||
2865 | |||
2866 | Capability: KVM_CAP_S390_INJECT_IRQ | ||
2867 | Architectures: s390 | ||
2868 | Type: vcpu ioctl | ||
2869 | Parameters: struct kvm_s390_irq (in) | ||
2870 | Returns: 0 on success, -1 on error | ||
2871 | Errors: | ||
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 | |||
2881 | Allows to inject an interrupt to the guest. | ||
2882 | |||
2883 | Using struct kvm_s390_irq as a parameter allows | ||
2884 | to inject additional payload which is not | ||
2885 | possible via KVM_S390_INTERRUPT. | ||
2886 | |||
2887 | Interrupt parameters are passed via kvm_s390_irq: | ||
2888 | |||
2889 | struct 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 | |||
2904 | type can be one of the following: | ||
2905 | |||
2906 | KVM_S390_SIGP_STOP - sigp stop; parameter in .stop | ||
2907 | KVM_S390_PROGRAM_INT - program check; parameters in .pgm | ||
2908 | KVM_S390_SIGP_SET_PREFIX - sigp set prefix; parameters in .prefix | ||
2909 | KVM_S390_RESTART - restart; no parameters | ||
2910 | KVM_S390_INT_CLOCK_COMP - clock comparator interrupt; no parameters | ||
2911 | KVM_S390_INT_CPU_TIMER - CPU timer interrupt; no parameters | ||
2912 | KVM_S390_INT_EMERGENCY - sigp emergency; parameters in .emerg | ||
2913 | KVM_S390_INT_EXTERNAL_CALL - sigp external call; parameters in .extcall | ||
2914 | KVM_S390_MCHK - machine check interrupt; parameters in .mchk | ||
2915 | |||
2916 | |||
2917 | Note that the vcpu ioctl is asynchronous to vcpu execution. | ||
2918 | |||
2919 | 4.94 KVM_S390_GET_IRQ_STATE | ||
2920 | |||
2921 | Capability: KVM_CAP_S390_IRQ_STATE | ||
2922 | Architectures: s390 | ||
2923 | Type: vcpu ioctl | ||
2924 | Parameters: struct kvm_s390_irq_state (out) | ||
2925 | Returns: >= 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 | |||
2930 | This ioctl allows userspace to retrieve the complete state of all currently | ||
2931 | pending interrupts in a single buffer. Use cases include migration | ||
2932 | and introspection. The parameter structure contains the address of a | ||
2933 | userspace buffer and its length: | ||
2934 | |||
2935 | struct kvm_s390_irq_state { | ||
2936 | __u64 buf; | ||
2937 | __u32 flags; | ||
2938 | __u32 len; | ||
2939 | __u32 reserved[4]; | ||
2940 | }; | ||
2941 | |||
2942 | Userspace passes in the above struct and for each pending interrupt a | ||
2943 | struct kvm_s390_irq is copied to the provided buffer. | ||
2944 | |||
2945 | If -ENOBUFS is returned the buffer provided was too small and userspace | ||
2946 | may retry with a bigger buffer. | ||
2947 | |||
2948 | 4.95 KVM_S390_SET_IRQ_STATE | ||
2949 | |||
2950 | Capability: KVM_CAP_S390_IRQ_STATE | ||
2951 | Architectures: s390 | ||
2952 | Type: vcpu ioctl | ||
2953 | Parameters: struct kvm_s390_irq_state (in) | ||
2954 | Returns: 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 | |||
2961 | This ioctl allows userspace to set the complete state of all cpu-local | ||
2962 | interrupts currently pending for the vcpu. It is intended for restoring | ||
2963 | interrupt state after a migration. The input parameter is a userspace buffer | ||
2964 | containing a struct kvm_s390_irq_state: | ||
2965 | |||
2966 | struct kvm_s390_irq_state { | ||
2967 | __u64 buf; | ||
2968 | __u32 len; | ||
2969 | __u32 pad; | ||
2970 | }; | ||
2971 | |||
2972 | The userspace memory referenced by buf contains a struct kvm_s390_irq | ||
2973 | for each interrupt to be injected into the guest. | ||
2974 | If one of the interrupts could not be injected for some reason the | ||
2975 | ioctl aborts. | ||
2976 | |||
2977 | len must be a multiple of sizeof(struct kvm_s390_irq). It must be > 0 | ||
2978 | and it must not exceed (max_vcpus + 32) * sizeof(struct kvm_s390_irq), | ||
2979 | which is the maximum number of possibly pending cpu-local interrupts. | ||
2980 | |||
2864 | 5. The kvm_run structure | 2981 | 5. 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 |