Changeset 849d7418 in rtems


Ignore:
Timestamp:
Jul 22, 2020, 12:41:51 PM (3 weeks ago)
Author:
Jan Sommer <jan.sommer@…>
Branches:
5
Children:
5eb07731
Parents:
a1f9265c
git-author:
Jan Sommer <jan.sommer@…> (07/22/20 12:41:51)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/29/20 09:39:35)
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 #4030

File:
1 edited

Legend:

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

    ra1f9265c r849d7418  
    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.