|
@@ -772,11 +772,13 @@ out_unlock:
|
|
|
pte_free(mm, pgtable);
|
|
pte_free(mm, pgtable);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-vm_fault_t vmf_insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,
|
|
|
|
|
- pmd_t *pmd, pfn_t pfn, bool write)
|
|
|
|
|
|
|
+vm_fault_t vmf_insert_pfn_pmd(struct vm_fault *vmf, pfn_t pfn, bool write)
|
|
|
{
|
|
{
|
|
|
|
|
+ unsigned long addr = vmf->address & PMD_MASK;
|
|
|
|
|
+ struct vm_area_struct *vma = vmf->vma;
|
|
|
pgprot_t pgprot = vma->vm_page_prot;
|
|
pgprot_t pgprot = vma->vm_page_prot;
|
|
|
pgtable_t pgtable = NULL;
|
|
pgtable_t pgtable = NULL;
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
* If we had pmd_special, we could avoid all these restrictions,
|
|
* If we had pmd_special, we could avoid all these restrictions,
|
|
|
* but we need to be consistent with PTEs and architectures that
|
|
* but we need to be consistent with PTEs and architectures that
|
|
@@ -799,7 +801,7 @@ vm_fault_t vmf_insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,
|
|
|
|
|
|
|
|
track_pfn_insert(vma, &pgprot, pfn);
|
|
track_pfn_insert(vma, &pgprot, pfn);
|
|
|
|
|
|
|
|
- insert_pfn_pmd(vma, addr, pmd, pfn, pgprot, write, pgtable);
|
|
|
|
|
|
|
+ insert_pfn_pmd(vma, addr, vmf->pmd, pfn, pgprot, write, pgtable);
|
|
|
return VM_FAULT_NOPAGE;
|
|
return VM_FAULT_NOPAGE;
|
|
|
}
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(vmf_insert_pfn_pmd);
|
|
EXPORT_SYMBOL_GPL(vmf_insert_pfn_pmd);
|
|
@@ -848,10 +850,12 @@ out_unlock:
|
|
|
spin_unlock(ptl);
|
|
spin_unlock(ptl);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-vm_fault_t vmf_insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
|
|
|
|
|
- pud_t *pud, pfn_t pfn, bool write)
|
|
|
|
|
|
|
+vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, pfn_t pfn, bool write)
|
|
|
{
|
|
{
|
|
|
|
|
+ unsigned long addr = vmf->address & PUD_MASK;
|
|
|
|
|
+ struct vm_area_struct *vma = vmf->vma;
|
|
|
pgprot_t pgprot = vma->vm_page_prot;
|
|
pgprot_t pgprot = vma->vm_page_prot;
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
* If we had pud_special, we could avoid all these restrictions,
|
|
* If we had pud_special, we could avoid all these restrictions,
|
|
|
* but we need to be consistent with PTEs and architectures that
|
|
* but we need to be consistent with PTEs and architectures that
|
|
@@ -868,7 +872,7 @@ vm_fault_t vmf_insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
|
|
|
|
|
|
|
|
track_pfn_insert(vma, &pgprot, pfn);
|
|
track_pfn_insert(vma, &pgprot, pfn);
|
|
|
|
|
|
|
|
- insert_pfn_pud(vma, addr, pud, pfn, pgprot, write);
|
|
|
|
|
|
|
+ insert_pfn_pud(vma, addr, vmf->pud, pfn, pgprot, write);
|
|
|
return VM_FAULT_NOPAGE;
|
|
return VM_FAULT_NOPAGE;
|
|
|
}
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(vmf_insert_pfn_pud);
|
|
EXPORT_SYMBOL_GPL(vmf_insert_pfn_pud);
|