Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#3335 new defect

i386 context switching for SMP is incomplete

Reported by: Amaan Cheval Owned by:
Priority: normal Milestone:
Component: arch/i386 Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

i386 targets do not define a usable CPU_Interrupt_frame struct, which the SMP thread-dispatch docs say is the temporary per-processor stack mentioned in this excerpt:

The context-switch is performed with interrupts enabled. During the transition from the executing to the heir thread neither the stack of the executing nor the heir thread must be used during interrupt processing. For this purpose a temporary per-processor stack is set up which may be used by the interrupt prologue before the stack is switched to the interrupt stack.

The code needs to set that temporary stack up, but doesn't currently, for i386.

Some relevant discussion occured in this thread on the devel mailing list too.

Change History (2)

comment:1 Changed on 06/17/20 at 01:55:11 by Jan Sommer <jan.sommer@…>

In [changeset:"f99b1f02b0a9a3457336949e086b863561d0fb76/rtems" f99b1f0/rtems]:

bsp/pc386: Turn start16.S into a startAP.S

start16.S is now only used for SMP configurations to start the
application processors.

This commit removes all unnecessary parts for this job,
i.e. video conssole initalisation, A20 gate activation
and all non-AP related code.

Update #3335

comment:2 Changed on 06/17/20 at 01:55:14 by Jan Sommer <jan.sommer@…>

In [changeset:"85d6a760f57e6f53c72cf8d15be20e3e4eaf4734/rtems" 85d6a760/rtems]:

bsp/pc386: Update GDT to work for SMP

Create a GS segment in the GDT for each processor for storing TLS.
This makes the GDT in startAP.S obsolete as all processors now share the
same GDT, which is passed to each AP at startup.

The correct segment for each processor is calculated in cpu_asm.S.

Update #3335

Note: See TracTickets for help on using tickets.