Opened on 06/10/11 at 10:28:01
Last modified on 04/01/14 at 11:18:04
#1813 closed defect (invalid)
SMP code: shared variable access
Reported by: | Marta Rybczynska | Owned by: | Joel Sherrill |
---|---|---|---|
Priority: | normal | Milestone: | 4.11 |
Component: | score | Version: | 4.11 |
Severity: | normal | Keywords: | |
Cc: | sebastian.huber@…, gedare@…, fred@… | Blocked By: | |
Blocking: |
Description
In the code submitted as PR 1796/cpukit, for instance in cpukit/score/src/smp.c: _SMP_Request_other_cores_to_perform_first_context_switch there are accesses to shared variables not protected by any locks. This will not work on an architecture without coherent caches.
There are two possible options to resolve the problem:
- All accesses to _Per_CPU_Information use the proper locks.
- Read accesses use a special BSP function like bsp_smp_read_int() which provides the right access method. Additionally, all such accesses made to _Per_CPU_Information should cast _Per_CPU_Information to volatile. Forgotten volatile will easily lead to hard to debug bugs, so a separate function may be better also for this reason.
I can provide a patch when the decision is made.
Change History (3)
comment:1 Changed on 06/12/11 at 17:57:18 by Gedare Bloom
Cc: | giddyup44@… added |
---|
comment:2 Changed on 04/01/14 at 11:18:04 by Sebastian Huber
Resolution: | → invalid |
---|---|
Status: | new → closed, sebastian.huber@embedded-brains.de |
comment:3 Changed on 11/24/14 at 18:58:28 by Gedare Bloom
Version: | HEAD → 4.11 |
---|
Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11
Note: See
TracTickets for help on using
tickets.
This problem no longer exists in the current SMP code.