The idea between capabilities and the KVM_CHECK_EXTENSION ioctl is that userspace can, at run-time, determine if a feature is supported or not. This allows KVM to being supporting a new feature with a new kernel version without any need to update user space. Unfortunately, since the definition of KVM_CAP_USER_NMI was guarded by #ifdef __KVM_HAVE_USER_NMI, such discovery still required a user space update. Therefore, unconditionally export KVM_CAP_USER_NMI and change the the typo in the comment for the IOCTL number definition as well.
Showing the changes to include/uapi/linux (1 of 1 file). Show all
Unified · Split
| @@ -654,9 +654,7 @@ struct kvm_ppc_smmu_info { · 653 unmodified lines | ||
| 654 | 654 | #endif |
| 655 | 655 | /* Bug in KVM_SET_USER_MEMORY_REGION fixed: */ |
| 656 | 656 | #define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21 |
| 657 | −#ifdef __KVM_HAVE_USER_NMI | |
| 658 | 657 | #define KVM_CAP_USER_NMI 22 |
| 659 | −#endif | |
| 660 | 658 | #ifdef __KVM_HAVE_GUEST_DEBUG |
| 661 | 659 | #define KVM_CAP_SET_GUEST_DEBUG 23 |
| 662 | 660 | #endif |
| @@ -1091,7 +1089,7 @@ struct kvm_s390_ucas_mapping { · 428 unmodified lines | ||
| 1091 | 1089 | #define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) |
| 1092 | 1090 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) |
| 1093 | 1091 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) |
| 1094 | −/* Available with KVM_CAP_NMI */ | |
| 1092 | +/* Available with KVM_CAP_USER_NMI */ | |
| 1095 | 1093 | #define KVM_NMI _IO(KVMIO, 0x9a) |
| 1096 | 1094 | /* Available with KVM_CAP_SET_GUEST_DEBUG */ |
| 1097 | 1095 | #define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) |