Changeset 21c7e3a in rtems


Ignore:
Timestamp:
Jul 22, 2020, 12:41:51 PM (3 weeks ago)
Author:
Jan Sommer <jan.sommer@…>
Branches:
master
Children:
699f465c
Parents:
4444094d
git-author:
Jan Sommer <jan.sommer@…> (07/22/20 12:41:51)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/29/20 09:39:02)
Message:

i386: Fix possible race condition on first context restore

Make sure that the esp is restored before the eflags register.

When the init task is initially restored, system interrupts are activated when the
eflags register is loaded.
If the esp register still points to an address in the interrupt stack
area (from early system initlization) the ISR might overwrite its own
stack.

Closes #4031

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/i386/cpu_asm.S

    r4444094d r21c7e3a  
    8484        movl      I386_CONTEXT_CONTROL_ISR_DISPATCH_DISABLE(eax),ecx
    8585        movl      ecx,PER_CPU_ISR_DISPATCH_DISABLE(edx)
     86        movl      REG_ESP(eax),esp         /* restore stack pointer */
    8687        pushl     REG_EFLAGS(eax)          /* push eflags */
    8788        popf                               /* restore eflags */
    88         movl      REG_ESP(eax),esp         /* restore stack pointer */
    8989        movl      REG_EBP(eax),ebp         /* restore base pointer */
    9090        movl      REG_EBX(eax),ebx         /* restore ebx */
Note: See TracChangeset for help on using the changeset viewer.