commit | 78155888b8f44478dd78b9af2f1e0eb255e7dfb4 | [log] [tgz] |
---|---|---|
author | Jerome Forissier <jerome@forissier.org> | Fri Sep 27 13:33:59 2019 +0200 |
committer | Jérôme Forissier <jerome@forissier.org> | Wed Oct 02 17:06:15 2019 +0200 |
tree | 7386af03050a0db495ab04f3f7b7b83af8cb4968 | |
parent | a2087649ca68f259e980594f536ea3ff19c4bbe3 [diff] |
core: tadb.c: get rid of atomic reference counting This commit changes the way the tadb_db global variable is protected against concurrent access on creation and deletion. Instead of using an atomic reference counter (struct refcount) and a mutex, only the mutex is used and taken unconditionally. The reference count becomes a global integer protected by the same mutex. Using a struct refcount was apparently an optimization to avoid taking the lock unless actual creation or deletion of the tadb_db was needed. Unfortunately this implementation was causing occasional crashes of the TEE core (easily reproducible on HiKey running 'xtest 1013' in a loop). The new implementation is simpler and appears to be rock solid with no measurable difference in performance. Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
This git contains source code for the secure side implementation of OP-TEE project.
All official OP-TEE documentation has moved to http://optee.readthedocs.io.
// OP-TEE core maintainers