]> xenbits.xensource.com Git - people/julieng/boot-wrapper-aarch64.git/commit
Replace exclusive accesses with a bakery lock
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Thu, 10 Dec 2015 19:24:59 +0000 (19:24 +0000)
committerMark Rutland <mark.rutland@arm.com>
Wed, 15 Jun 2016 09:27:35 +0000 (10:27 +0100)
commit50eb940341fe22e2a3e36d9d8d06ad40b8b961f0
tree6e30e03142b34331126aa307076309ce54558efe
parent5714dbb8b62ac25f336e5256dcc2fd8fe7c37b1b
Replace exclusive accesses with a bakery lock

The commit prepares the removal of the MMU identity map, which was only
used for exclusive accesses (ldxr/stxr) in psci_cpu_on.

Instead of relying on exclusives, we assume that when stage-1
translation is disabled, all EL3 memory accesses have Device type, with
non-gathering and non-reordering attributes. This guarantees single-copy
atomicity of aligned halfword accesses, as per the ARM ARM.

We can thus switch to a less constrained (albeit bulkier) locking
mechanism. This patch implements Lamport's bakery lock, which doesn't
rely on atomic compare-and-swap primitives.

For bisectability, we remove the call to switch_to_idmap here.
Otherwise, the assertions made by the bakery lock code, regarding order
of accesses, are invalid. The rest of the code will be removed in a
subsequent patch.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Makefile.am
arch/aarch64/include/asm/psci.h [deleted file]
arch/aarch64/psci.S
bakery_lock.c [new file with mode: 0644]
include/bakery_lock.h [new file with mode: 0644]
include/compiler.h
include/cpu.h
include/psci.h
psci.c