KVM: x86: Implement kvm_arch_vcpu_pre_fault_memory()
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 11 Jun 2024 07:57:58 +0000 (03:57 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 12 Jul 2024 15:17:47 +0000 (11:17 -0400)
commit6e01b7601dfed61bcccd8c386c5084fc0d53d20b
tree89d18c832d4be497ceac0499e2406233cb507de6
parent58ef24699bcddfe3de0963c8f74ccf641ffe87f0
KVM: x86: Implement kvm_arch_vcpu_pre_fault_memory()

Wire KVM_PRE_FAULT_MEMORY ioctl to kvm_mmu_do_page_fault() to populate guest
memory.  It can be called right after KVM_CREATE_VCPU creates a vCPU,
since at that point kvm_mmu_create() and kvm_init_mmu() are called and
the vCPU is ready to invoke the KVM page fault handler.

The helper function kvm_tdp_map_page() takes care of the logic to
process RET_PF_* return values and convert them to success or errno.

Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Message-ID: <9b866a0ae7147f96571c439e75429a03dcb659b6.1712785629.git.isaku.yamahata@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/Kconfig
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/x86.c