diff options
author | Gleb Natapov | 2010-10-17 18:13:42 +0200 |
---|---|---|
committer | Avi Kivity | 2011-01-12 10:23:06 +0100 |
commit | 56028d0861e48f7cc9c573d79f2d8a0a933a2bba (patch) | |
tree | fa42d19f235c585c6514337a26db9641780ac759 /virt/kvm/async_pf.c | |
parent | KVM: Halt vcpu if page it tries to access is swapped out (diff) | |
download | kernel-qcow2-linux-56028d0861e48f7cc9c573d79f2d8a0a933a2bba.tar.gz kernel-qcow2-linux-56028d0861e48f7cc9c573d79f2d8a0a933a2bba.tar.xz kernel-qcow2-linux-56028d0861e48f7cc9c573d79f2d8a0a933a2bba.zip |
KVM: Retry fault before vmentry
When page is swapped in it is mapped into guest memory only after guest
tries to access it again and generate another fault. To save this fault
we can map it immediately since we know that guest is going to access
the page. Do it only when tdp is enabled for now. Shadow paging case is
more complicated. CR[034] and EFER registers should be switched before
doing mapping and then switched back.
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/async_pf.c')
-rw-r--r-- | virt/kvm/async_pf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/async_pf.c b/virt/kvm/async_pf.c index 857d63431cb7..e97eae965a4c 100644 --- a/virt/kvm/async_pf.c +++ b/virt/kvm/async_pf.c @@ -132,6 +132,8 @@ void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu) list_del(&work->link); spin_unlock(&vcpu->async_pf.lock); + if (work->page) + kvm_arch_async_page_ready(vcpu, work); kvm_arch_async_page_present(vcpu, work); list_del(&work->queue); |