Add missing barriers to Bakery Locks
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>
Wed, 8 Aug 2018 13:10:55 +0000 (14:10 +0100)
committerJeenu Viswambharan <jeenu.viswambharan@arm.com>
Wed, 5 Sep 2018 13:39:14 +0000 (14:39 +0100)
commit24dc97091532751ea810e99bd5a9be33514decf6
treef6fb168ca1b12b70fa378e4a4a9f002513ea9683
parente43422b734269d23f336e5ca3c05dedd8fd52901
Add missing barriers to Bakery Locks

With the current implementation, it's possible for a contender to
observe accesses in the Critical Section before acquiring or releasing
the lock. Insert fencing in the locking and release codes to prevent any
reorder.

Fixes ARM-software/tf-issues#609

Change-Id: I773b82aa41dd544a2d3dbacb9a4b42c9eb767bbb
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
lib/locks/bakery/bakery_lock_coherent.c
lib/locks/bakery/bakery_lock_normal.c