Re: [BUG] (alpha) kernel thread panics due to stale PTBR settings in 2.3.47

From: Richard Henderson (rth@twiddle.net)
Date: Fri Mar 03 2000 - 21:32:05 EST

  • Next message: Alan Cox: "Re: trident driver"

    On Fri, Feb 25, 2000 at 02:46:16PM -0500, Dave Anderson wrote:
    > The problem was due to the disconnect between the active_mm pgd
    > value and what's actually stored in the kernel task's ptbr value --
    > which is what gets loaded into the PTBR register with each alpha
    > context switch.

    Yes, I can see the potential for a problem there.

    > I note that in 2.3.47, the problem looked to have been addressed by
    > the addition of the enter_lazy_tlb() call in schedule():
    >
    > if (!mm) {
    > if (next->active_mm) BUG();
    > next->active_mm = oldmm;
    > atomic_inc(&oldmm->mm_count);
    > +++ enter_lazy_tlb(oldmm, next, this_cpu);
    > }
    >
    > Unfortunately the alpha enter_lazy_tlb() doesn't do anything:

    I don't know if enter_lazy_tlb is appropriate. It is used in
    two contexts: getting ready to swap context (eg that one) and
    not planning on swapping context any time soon (eg start_lazy_tlb).

    But perhaps there's no issue at all with the later, since the
    "host" process can't really die without some sort of swpctx.

    Try this.

    r~

    --- mmu_context.h.orig Fri Mar 3 18:28:58 2000
    +++ mmu_context.h Fri Mar 3 18:29:49 2000
    @@ -22,11 +22,6 @@
     #include <asm/io.h>
     #endif
     
    -static inline void
    -enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
    -{
    -}
    -
     extern inline unsigned long
     __reload_thread(struct thread_struct *pcb)
     {
    @@ -221,6 +216,12 @@ extern inline void
     destroy_context(struct mm_struct *mm)
     {
             /* Nothing to do. */
    +}
    +
    +static inline void
    +enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
    +{
    + tsk->thread.ptbr = ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT;
     }
     
     #ifdef __MMU_EXTERN_INLINE

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Fri Mar 03 2000 - 22:25:29 EST