powerpc/mm: Update PROTFAULT handling in the page fault path
With radix, we can get page fault with DSISR_PROTFAULT value set in case of PROT_NONE or autonuma mapping. The PROT_NONE case in handled by the vma check where we consider the access bad. For autonuma we should fall through and fixup the access mask correctly. Without this patch we trigger the WARN_ON() on radix. This code moves that WARN_ON() within a radix_enabled() check. I also moved the WARN_ON() outside the if condition making it apply for all type of faults (exec/write/read). It is also conditionalized for book3s, because BOOK3E can also get a PROTFAULT to handle the D/I cache sync. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
c21a493a2b
commit
18061c17c8
@@ -67,11 +67,13 @@ int copro_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
|
||||
if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
|
||||
goto out_unlock;
|
||||
/*
|
||||
* protfault should only happen due to us
|
||||
* mapping a region readonly temporarily. PROT_NONE
|
||||
* is also covered by the VMA check above.
|
||||
* PROT_NONE is covered by the VMA check above.
|
||||
* and hash should get a NOHPTE fault instead of
|
||||
* a PROTFAULT in case fixup is needed for things
|
||||
* like autonuma.
|
||||
*/
|
||||
WARN_ON_ONCE(dsisr & DSISR_PROTFAULT);
|
||||
if (!radix_enabled())
|
||||
WARN_ON_ONCE(dsisr & DSISR_PROTFAULT);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
Reference in New Issue
Block a user