Changeset 38f5e61 in rtems


Ignore:
Timestamp:
Jul 10, 2008, 9:29:27 PM (11 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.10, 4.11, 4.9, master
Children:
8bac485
Parents:
055173d
Message:

2008-07-10 Till Straumann <strauman@…>

  • new-exceptions/bspsupport/ppc_exc.S: must disable interrupts prior to restoring SRRs (thanks to Sebastian Huber)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc.S

    r055173d r38f5e61  
    272272        /* decrement ISR nest level;
    273273         * disable all interrupts.
     274         * (Disabling IRQs here is not necessary if we
     275         * use the stack-switching strategy which tests
     276         * if we are alreay on the ISR-stack as opposed
     277         * to test the nesting level; see ppc_exc_asm_macros.h)
    274278         */
    275279        lwz             r4,  ppc_exc_msr_irq_mask@sdarel(r13)
     
    366370        mtcr    r4
    367371
     372        /* Must disable interrupts prior to restoring SSRs.
     373         * Here's a scenario discovered by Sebastian Huber:
     374         *  1) CE happens between writing to SRR and RFI
     375         *  2) CE handler does something which requires a task switch
     376         *  3) CE wrapper returns and determines that task switch
     377     *     is OK since EE lock is not held, dispatch-disable level
     378         *     is zero etc.
     379         *  4) switch to other task enables EE
     380         *  5) eventually, switch back to task interrupted by 1)
     381         *  6) RFI happens but SRR contents have been clobbered.
     382         */
     383        lwz             r4,  ppc_exc_msr_irq_mask@sdarel(r13)
     384        mfmsr   r5
     385        andc    r4, r5, r4
     386        mtmsr   r4
     387
    368388        /* restore SRR and stack */
    369389        lwz             r4,  SRR0_FRAME_OFFSET(r1)
Note: See TracChangeset for help on using the changeset viewer.