[xtensa-cvscommit] linux/arch/xtensa/kernel handlers.S,1.4,1.5
Brought to you by:
zankel
|
From: <joe...@us...> - 2002-10-22 17:59:49
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory usw-pr-cvs1:/tmp/cvs-serv11036/arch/xtensa/kernel
Modified Files:
handlers.S
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: handlers.S
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/handlers.S,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** handlers.S 22 Sep 2002 21:18:02 -0000 1.4
--- handlers.S 22 Oct 2002 17:59:43 -0000 1.5
***************
*** 1996,1999 ****
--- 1996,2000 ----
{
struct task_struct *tsk = current;
+ struct mm_struct *mm = tsk->mm;
unsigned long vpnval;
pgd_t *pgd;
***************
*** 2012,2033 ****
movi a2, kernelsp
s32i a3, a0, MISS_SAVE_A3
- l32i a2, a2, 0 // a2 <-- kernel sp
s32i a4, a0, MISS_SAVE_A4
s32i a5, a0, MISS_SAVE_A5
! /* 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);
- */
! srli a2, a2, _CURRENT_SHIFT
! slli a2, a2, _CURRENT_SHIFT // a2 <-- 'current' or 'tsk'
! rsr a3, EXCVADDR
! l32i a2, a2, TASK_MM
_PGD_OFFSET a2, a3
_PMD_OFFSET a2, addr // empty macro, 2nd parm is optimized away
!
/* We want to map the page of PTEs into the Page Table, but if
* the task doesn't yet have a mapping for the region, just
--- 2013,2045 ----
movi a2, kernelsp
s32i a3, a0, MISS_SAVE_A3
s32i a4, a0, MISS_SAVE_A4
+ l32i a4, a2, 0 // a4 <-- kernel sp
s32i a5, a0, MISS_SAVE_A5
! /* 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);
! */
!
! srli a4, a4, _CURRENT_SHIFT
! slli a4, a4, _CURRENT_SHIFT // a4 <-- 'current' or 'tsk'
! rsr a3, EXCVADDR // a3 <-- fault address
! l32i a2, a4, TASK_MM // a2 <-- tsk->mm
! beqz a2, vmalloc_case // branch on rare vmalloc case
! 4:
_PGD_OFFSET a2, a3
_PMD_OFFSET a2, addr // empty macro, 2nd parm is optimized away
!
/* We want to map the page of PTEs into the Page Table, but if
* the task doesn't yet have a mapping for the region, just
***************
*** 2106,2109 ****
--- 2118,2125 ----
xsr a1, EXCSAVE_1
rfde
+
+ vmalloc_case:
+ l32i a2, a4, TASK_ACTIVE_MM // a2 <-- tsk->active_mm
+ j 4b
|