[Boost-bugs] [Boost C++ Libraries] #11362: smart_ptr spinlocks leads to livelock on ARM Cortex-A9 CPUs

Subject: [Boost-bugs] [Boost C++ Libraries] #11362: smart_ptr spinlocks leads to livelock on ARM Cortex-A9 CPUs
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-29 19:10:00


#11362: smart_ptr spinlocks leads to livelock on ARM Cortex-A9 CPUs
------------------------------+-----------------------
 Reporter: alex | Owner: pdimov
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: smart_ptr
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: arm spinlock |
------------------------------+-----------------------
 Spinlock used in smart_ptr for ARM architecture
 (smart_ptr/details/spinlock_gcc_arm.hpp) relies on swp/mcr instruction
 sequence or ldrex/strex/dmb depending on ARM version. Both these
 implementations are affected by an ARM issue described in errata 754327
 for ARM Cortex-A9 CPU.

 Suggested fix is to add "dmb" instruction to change spinlock::unlock()
 method:

     void unlock()
     {
         __asm__ __volatile__( BOOST_SP_ARM_BARRIER ::: "memory" );
         *const_cast< int volatile* >( &v_ ) = 0;
         __asm__ __volatile__( BOOST_SP_ARM_BARRIER ::: "memory" );
     }

 Second barrier was added as recommended workaround from ARM errata
 document.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11362>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC