<div dir="ltr">Thank you for taking the time and energy to do this. It <div><br></div><div>Did your patch comments close <a href="https://devel.rtems.org/ticket/3335">https://devel.rtems.org/ticket/3335</a>? </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 31, 2020 at 9:23 AM Jan Sommer <<a href="mailto:jan.sommer@dlr.de">jan.sommer@dlr.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
Here is a patch set which should enable SMP again for the pc386-based BSPs (mainly tested with pc686).<br>
So far I only tested it with qemu. Tests on real hardware are pending.<br>
To me it looks like there are no regressions for the standard non-SMP version of the BSP, but it is difficult to say for sure.<br>
Subsequent runs of the testsuite with a current master build already produce different numbers of failed/timeout/invalid tests.<br>
<br>
However, even with the patch set applied the amount of passed tests continues to range from 550-557 and the failed/timeout/invalid tests seem to be generally the same.<br>
Regarding smptests, the current status with qemu-4.2.0 and 4 cores looks like this:<br>
<br>
Passed:        55<br>
Failed:         1<br>
User Input:     0<br>
Expected Fail:  0<br>
Indeterminate:  0<br>
Benchmark:      0<br>
Timeout:        2<br>
Invalid:        1<br>
Wrong Version:  0<br>
Wrong Build:    0<br>
Wrong Tools:    0<br>
-----------------<br>
Total:         59<br>
Failures:<br>
 smpatomic01.exe<br>
Timeouts:<br>
 smpclock01.exe<br>
 smpopenmp01.exe<br>
Invalid:<br>
 smpfatal09.exe<br>
<br>
Some details on the missing tests:<br>
-----------------------------------<br>
smpfatal09: This test actually does pass, but because the fatal error handler is executed before the console is initialized, no output is produced.<br>
<br>
smpclock01.exe: Here CPU0 disables its local interrupts and waits for a barrier release of CPU1. This means it doesn't handle timer interrupts anymore and doesn't send corresponding IPIs to other CPUs.<br>
At the same time CPU1 is waiting for a timer event before releasing the barrier. Any hints how to resolve this are very welcome.<br>
<br>
smpatomic01: This test seems very large and a bit complicated to me. I will have a look at it next, but any suggestions are welcome. It fails with this information:<br>
] === atomic or/and test case ===<br>
] worker 0 value: 1<br>
] worker 1 value: 0<br>
] atomic value: expected = 1, actual = 1<br>
] ../../../../../../smp-refex-rtems/c/src/../../testsuites/smptests/smpatomic01/init.c: 404 n - s < LONG_MAX<br>
] <br>
] *** FATAL ***<br>
<br>
smpopenmp01: I don't know more about openmp then what is on wikipedia. It has currently a low priority for me.<br>
<br>
Some details regarding the patch set:<br>
-------------------------------------<br>
<br>
- The first 3 commits are basically cleaning the original start16.S to be used for starting the application processors only and updating the general bring up infrastructure.<br>
- The next 2 commits are updating the low level context switch and isr handling in assembly. I used the ARM implementation as a template and tried to stay comparably close to it.<br>
- The last 4 commits are smaller changes made after debugging certain test cases.<br>
<br>
<br>
My next step would be to test the SMP functionality on HW. My goal would be to get the final revision published as part of the RTEMS5 release.<br>
If you would like to see any logs from a testsuite run with certain parameters, just tell me.<br>
<br>
Best regards,<br>
<br>
    Jan<br>
<br>
<br>
<br>
Jan Sommer (9):<br>
  bsp/pc386: Fix Makefile for building with SMP<br>
  bsp/pc386: Turn start16.S into a startAP.S<br>
  bsp/pc386: Update GDT to work for SMP<br>
  bsp/pc386: Update context switch and restore<br>
  bsp/pc386: Define interrupt stack frame for smp<br>
  bsps/pc386: Fix Clock_isr for SMP<br>
  bsps/pc386: Separate smp API functions. Makes smpfatal08 link<br>
  smpsignal01: Change state before sending the signal<br>
  bsp/pc386: Disable interrupt nesting for job handler<br>
<br>
 bsps/i386/include/bsp/smp-imps.h                   |   3 +<br>
 bsps/i386/pc386/clock/ckinit.c                     |   2 +-<br>
 bsps/i386/pc386/include/bsp.h                      |   7 +<br>
 bsps/i386/pc386/include/bsp/tblsizes.h             |   8 +-<br>
 bsps/i386/pc386/start/bspsmp.c                     |  43 ++++<br>
 bsps/i386/pc386/start/getcpuid.c                   |  22 --<br>
 bsps/i386/pc386/start/ldsegs.S                     |   4 +-<br>
 bsps/i386/pc386/start/smp-imps.c                   |  79 ++++---<br>
 bsps/i386/pc386/start/start16.S                    | 254 ---------------------<br>
 bsps/i386/pc386/start/startAP.S                    | 118 ++++++++++<br>
 bsps/i386/shared/irq/irq_asm.S                     | 102 +++++----<br>
 c/src/lib/libbsp/i386/pc386/Makefile.am            |   8 +-<br>
 cpukit/score/cpu/i386/cpu_asm.S                    |  74 ++++--<br>
 cpukit/score/cpu/i386/include/rtems/asm.h          |  26 +++<br>
 cpukit/score/cpu/i386/include/rtems/score/cpu.h    |  32 +--<br>
 .../score/cpu/i386/include/rtems/score/cpuimpl.h   |   2 +<br>
 testsuites/smptests/smpsignal01/init.c             |   2 +-<br>
 17 files changed, 382 insertions(+), 404 deletions(-)<br>
 create mode 100644 bsps/i386/pc386/start/bspsmp.c<br>
 delete mode 100644 bsps/i386/pc386/start/getcpuid.c<br>
 delete mode 100644 bsps/i386/pc386/start/start16.S<br>
 create mode 100644 bsps/i386/pc386/start/startAP.S<br>
<br>
-- <br>
2.12.3<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>