History

KVM: Rework KVM_CAP_GUEST_MEMFD_MMAP into KVM_CAP_GUEST_MEMFD_FLAGS

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.

Sean Christopherson committed 1 year ago

Commit d2042d81 parent 034417c4 files · +19 −13Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/kvm.h+1−1
@@ -962,7 +962,7 @@ struct kvm_enable_cap { · 961 unmodified lines
962962 #define KVM_CAP_ARM_EL2_E2H0 241
963963 #define KVM_CAP_RISCV_MP_STATE_RESET 242
964964 #define KVM_CAP_ARM_CACHEABLE_PFNMAP_SUPPORTED 243
965−#define KVM_CAP_GUEST_MEMFD_MMAP 244
965+#define KVM_CAP_GUEST_MEMFD_FLAGS 244
966966
967967 struct kvm_irq_routing_irqchip {
968968 __u32 irqchip;