diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-10-14 05:22:53 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:23:17 -0500 |
commit | 7c90705bf2a373aa238661bdb6446f27299ef489 (patch) | |
tree | d3d00b4413b0d33254d53bbb3285be82444494d9 /arch/x86/kvm/mmu.c | |
parent | 631bc4878220932fe67fc46fc7cf7cccdb1ec597 (diff) |
KVM: Inject asynchronous page fault into a PV guest if page is swapped out.
Send async page fault to a PV guest if it accesses swapped out memory.
Guest will choose another task to run upon receiving the fault.
Allow async page fault injection only when guest is in user mode since
otherwise guest may be in non-sleepable context and will not be able
to reschedule.
Vcpu will be halted if guest will fault on the same page again or if
vcpu executes kernel code.
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 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index b2c60986a7ce..64f90db369fb 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -2592,6 +2592,7 @@ static int nonpaging_page_fault(struct kvm_vcpu *vcpu, gva_t gva, | |||
2592 | int kvm_arch_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn) | 2592 | int kvm_arch_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn) |
2593 | { | 2593 | { |
2594 | struct kvm_arch_async_pf arch; | 2594 | struct kvm_arch_async_pf arch; |
2595 | arch.token = (vcpu->arch.apf.id++ << 12) | vcpu->vcpu_id; | ||
2595 | arch.gfn = gfn; | 2596 | arch.gfn = gfn; |
2596 | 2597 | ||
2597 | return kvm_setup_async_pf(vcpu, gva, gfn, &arch); | 2598 | return kvm_setup_async_pf(vcpu, gva, gfn, &arch); |