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.
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -917,6 +917,7 @@ struct kvm_enable_cap { · 916 unmodified lines | ||
| 917 | 917 | #define KVM_CAP_MEMORY_ATTRIBUTES 233 |
| 918 | 918 | #define KVM_CAP_GUEST_MEMFD 234 |
| 919 | 919 | #define KVM_CAP_VM_TYPES 235 |
| 920 | +#define KVM_CAP_PRE_FAULT_MEMORY 236 | |
| 920 | 921 | |
| 921 | 922 | struct kvm_irq_routing_irqchip { |
| 922 | 923 | __u32 irqchip; |
| @@ -1548,4 +1549,13 @@ struct kvm_create_guest_memfd { · 625 unmodified lines | ||
| 1548 | 1549 | __u64 reserved[6]; |
| 1549 | 1550 | }; |
| 1550 | 1551 | |
| 1552 | +#define KVM_PRE_FAULT_MEMORY _IOWR(KVMIO, 0xd5, struct kvm_pre_fault_memory) | |
| 1553 | + | |
| 1554 | +struct kvm_pre_fault_memory { | |
| 1555 | + __u64 gpa; | |
| 1556 | + __u64 size; | |
| 1557 | + __u64 flags; | |
| 1558 | + __u64 padding[5]; | |
| 1559 | +}; | |
| 1560 | + | |
| 1551 | 1561 | #endif /* __LINUX_KVM_H */ |