History

KVM: Add KVM_PRE_FAULT_MEMORY vcpu ioctl to pre-populate guest memory

Add a new ioctl KVM_PRE_FAULT_MEMORY in the KVM common code. It iterates on the memory range and calls the arch-specific function. The implementation is optional and enabled by a Kconfig symbol.

Isaku Yamahata committed 2 years ago

Commit bc1a5cd1 parent 9aed7a64 files · +78 −0Browse files

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

Unified · Split

include/uapi/linux/kvm.h+10−0
@@ -917,6 +917,7 @@ struct kvm_enable_cap { · 916 unmodified lines
917#define KVM_CAP_MEMORY_ATTRIBUTES 233917#define KVM_CAP_MEMORY_ATTRIBUTES 233
918#define KVM_CAP_GUEST_MEMFD 234918#define KVM_CAP_GUEST_MEMFD 234
919#define KVM_CAP_VM_TYPES 235919#define KVM_CAP_VM_TYPES 235
920#define KVM_CAP_PRE_FAULT_MEMORY 236
920 921
921struct kvm_irq_routing_irqchip {922struct kvm_irq_routing_irqchip {
922 __u32 irqchip;923 __u32 irqchip;
@@ -1548,4 +1549,13 @@ struct kvm_create_guest_memfd { · 625 unmodified lines
1548 __u64 reserved[6];1549 __u64 reserved[6];
1549};1550};
1550 1551
1552#define KVM_PRE_FAULT_MEMORY _IOWR(KVMIO, 0xd5, struct kvm_pre_fault_memory)
1553
1554struct kvm_pre_fault_memory {
1555 __u64 gpa;
1556 __u64 size;
1557 __u64 flags;
1558 __u64 padding[5];
1559};
1560
1551#endif /* __LINUX_KVM_H */1561#endif /* __LINUX_KVM_H */