diff options
-rw-r--r-- | drivers/kvm/kvm_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index cd0557954e50..36a458f13ec4 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -2285,7 +2285,6 @@ static struct page *kvm_vcpu_nopage(struct vm_area_struct *vma, | |||
2285 | unsigned long pgoff; | 2285 | unsigned long pgoff; |
2286 | struct page *page; | 2286 | struct page *page; |
2287 | 2287 | ||
2288 | *type = VM_FAULT_MINOR; | ||
2289 | pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; | 2288 | pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; |
2290 | if (pgoff == 0) | 2289 | if (pgoff == 0) |
2291 | page = virt_to_page(vcpu->run); | 2290 | page = virt_to_page(vcpu->run); |
@@ -2294,6 +2293,9 @@ static struct page *kvm_vcpu_nopage(struct vm_area_struct *vma, | |||
2294 | else | 2293 | else |
2295 | return NOPAGE_SIGBUS; | 2294 | return NOPAGE_SIGBUS; |
2296 | get_page(page); | 2295 | get_page(page); |
2296 | if (type != NULL) | ||
2297 | *type = VM_FAULT_MINOR; | ||
2298 | |||
2297 | return page; | 2299 | return page; |
2298 | } | 2300 | } |
2299 | 2301 | ||
@@ -2768,12 +2770,14 @@ static struct page *kvm_vm_nopage(struct vm_area_struct *vma, | |||
2768 | unsigned long pgoff; | 2770 | unsigned long pgoff; |
2769 | struct page *page; | 2771 | struct page *page; |
2770 | 2772 | ||
2771 | *type = VM_FAULT_MINOR; | ||
2772 | pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; | 2773 | pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; |
2773 | page = gfn_to_page(kvm, pgoff); | 2774 | page = gfn_to_page(kvm, pgoff); |
2774 | if (!page) | 2775 | if (!page) |
2775 | return NOPAGE_SIGBUS; | 2776 | return NOPAGE_SIGBUS; |
2776 | get_page(page); | 2777 | get_page(page); |
2778 | if (type != NULL) | ||
2779 | *type = VM_FAULT_MINOR; | ||
2780 | |||
2777 | return page; | 2781 | return page; |
2778 | } | 2782 | } |
2779 | 2783 | ||