public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* KVM: attempt async pf only if address is contained in vma
@ 2010-10-18 22:24 Marcelo Tosatti
  2010-10-19 11:05 ` Gleb Natapov
  0 siblings, 1 reply; 5+ messages in thread
From: Marcelo Tosatti @ 2010-10-18 22:24 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: kvm


Only attempt async pagefault if address is contained within vma.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 5d57ec9..a9cfbd2 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -996,8 +996,9 @@ static pfn_t hva_to_pfn(struct kvm *kvm, unsigned long addr, bool atomic,
 
 		if (vma == NULL || addr < vma->vm_start ||
 		    !(vma->vm_flags & VM_PFNMAP)) {
-			if (async && !(vma->vm_flags & VM_PFNMAP) &&
-			    (vma->vm_flags & VM_WRITE))
+			if (async && vma && !(vma->vm_flags & VM_PFNMAP) &&
+			    (vma->vm_flags & VM_WRITE) &&
+			    addr >= vma->vm_start)
 				*async = true;
 			up_read(&current->mm->mmap_sem);
 return_fault_page:

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-10-19 13:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-18 22:24 KVM: attempt async pf only if address is contained in vma Marcelo Tosatti
2010-10-19 11:05 ` Gleb Natapov
2010-10-19 12:17   ` Gleb Natapov
2010-10-19 13:14     ` Marcelo Tosatti
2010-10-19 13:15       ` Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox