#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 Jun 17, 2020 at 1:55:11 AM by Jan Sommer <jan.sommer@…>

In 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 Jun 17, 2020 at 1:55:14 AM by Jan Sommer <jan.sommer@…>

In 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.