Rework the not-yet-released KVM_CAP_GUEST_MEMFD_MMAP into a more generic KVM_CAP_GUEST_MEMFD_FLAGS capability so that adding new flags doesn't require a new capability, and so that developers aren't tempted to bundle multiple flags into a single capability. Note, kvm_vm_ioctl_check_extension_generic() can only return a 32-bit value, but that limitation can be easily circumvented by adding e.g. KVM_CAP_GUEST_MEMFD_FLAGS2 in the unlikely event guest_memfd supports more than 32 flags.
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -962,7 +962,7 @@ struct kvm_enable_cap { · 961 unmodified lines | ||
| 962 | 962 | #define KVM_CAP_ARM_EL2_E2H0 241 |
| 963 | 963 | #define KVM_CAP_RISCV_MP_STATE_RESET 242 |
| 964 | 964 | #define KVM_CAP_ARM_CACHEABLE_PFNMAP_SUPPORTED 243 |
| 965 | −#define KVM_CAP_GUEST_MEMFD_MMAP 244 | |
| 965 | +#define KVM_CAP_GUEST_MEMFD_FLAGS 244 | |
| 966 | 966 | |
| 967 | 967 | struct kvm_irq_routing_irqchip { |
| 968 | 968 | __u32 irqchip; |