[Bug 1813] New: SMP code: shared variable access

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Fri Jun 10 11:28:02 UTC 2011


https://www.rtems.org/bugzilla/show_bug.cgi?id=1813

           Summary: SMP code: shared variable access
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: cpukit
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: marta.rybczynska at kalray.eu
                CC: frederic.brault at kalray.eu


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:
1. All accesses to _Per_CPU_Information use the proper locks.
2. 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.

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list