// SPDX-License-Identifier: GPL-2.0-or-later /* * CoProcessor (SPU/AFU) mm fault handler * * (C) Copyright IBM Deutschland Entwicklung GmbH 2007 * * Author: Arnd Bergmann <arndb@de.ibm.com> * Author: Jeremy Kerr <jk@ozlabs.org>
*/ #include <linux/sched.h> #include <linux/mm.h> #include <linux/export.h> #include <asm/reg.h> #include <asm/copro.h>
/* * This ought to be kept in sync with the powerpc specific do_page_fault * function. Currently, there are a few corner cases that we haven't had * to handle fortunately.
*/ int copro_handle_mm_fault(struct mm_struct *mm, unsignedlong ea, unsignedlong dsisr, vm_fault_t *flt)
{ struct vm_area_struct *vma; unsignedlong is_write; int ret;
if (mm == NULL) return -EFAULT;
if (mm->pgd == NULL) return -EFAULT;
vma = lock_mm_and_find_vma(mm, ea, NULL); if (!vma) return -EFAULT;
ret = -EFAULT;
is_write = dsisr & DSISR_ISSTORE; if (is_write) { if (!(vma->vm_flags & VM_WRITE)) goto out_unlock;
} else { if (!(vma->vm_flags & (VM_READ | VM_EXEC))) goto out_unlock; /* * 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.
*/ if (!radix_enabled())
WARN_ON_ONCE(dsisr & DSISR_PROTFAULT);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.