[xtensa-cvscommit] linux/arch/xtensa/mm mmu.c,1.2,1.3
Brought to you by:
zankel
|
From: <joe...@us...> - 2002-10-22 17:59:49
|
Update of /cvsroot/xtensa/linux/arch/xtensa/mm
In directory usw-pr-cvs1:/tmp/cvs-serv11036/arch/xtensa/mm
Modified Files:
mmu.c
Log Message:
The 2nd-level miss handlers overlooked a rare case where current->mm might be NULL and they should use current->active_mm instead. See the inline comments for details.
This fixes the board crash manifested by 'apachectl stop'.
Index: mmu.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/mm/mmu.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mmu.c 18 Oct 2002 21:57:27 -0000 1.2
--- mmu.c 22 Oct 2002 17:59:46 -0000 1.3
***************
*** 160,163 ****
--- 160,164 ----
{
struct task_struct *tsk = current;
+ struct mm_struct *mm = tsk->mm;
unsigned long vpnval;
pgd_t *pgd;
***************
*** 166,173 ****
pte_t pteval;
! /* We need to map the page of PTEs for the user task. Find
! * the pointer to that page. */
! pgd = pgd_offset (tsk->mm, regs->excvaddr);
pmd = pmd_offset (pgd, regs->excvaddr);
--- 167,183 ----
pte_t pteval;
! /* We need to map the page of PTEs for the user task. Find *
! * the pointer to that page. Also, it's possible for tsk->mm
! * to be NULL while tsk->active_mm is nonzero if we faulted on
! * a vmalloc address. In that rare case, we must use
! * active_mm instead to avoid a fault in this handler. See
! *
! * http://mail.nl.linux.org/linux-mm/2002-08/msg00258.html
! * (or search Internet on "mm vs. active_mm")
! */
! if (!mm)
! mm = tsk->active_mm;
! pgd = pgd_offset (mm, regs->excvaddr);
pmd = pmd_offset (pgd, regs->excvaddr);
***************
*** 185,197 ****
pmdval = __pmd((unsigned long)exception_pte_table);
- #if 0 /* XTFIXME: Remove this old code after a while.. [JET, 25 Mar 2002] */
- /* convert regs->excvaddr to relative offset into page-table pages */
- vpnval = (regs->excvaddr / PAGE_SIZE) * sizeof(pte_t);
- vpnval += PGTABLE_START; /* convert to absolute, virtual address */
- vpnval &= PAGE_MASK; /* convert to top of page-table page */
- #else
/* read ptevaddr and convert to top of page-table page */
vpnval = read_ptevaddr_register() & PAGE_MASK;
- #endif
vpnval += WIRED_WAY_FOR_PAGE_TABLE; /* add way number for 'wdtlb' insn */
pteval = mk_pte (virt_to_page(pmd_val(pmdval)), PAGE_KERNEL);
--- 195,200 ----
|