Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CFG_CONCURRENT_SINGLE_INSTANCE_TA #1915

Merged
merged 1 commit into from
Nov 13, 2017

Conversation

jforissier
Copy link
Contributor

Commit 2b07dcb ("core: avoid deadlocks caused by single-instance
TA") introduces a lock that allows only one single instance TA to be
executing at any time. While it does address the risk of deadlock that
can arise when several single instance TAs call each other, it also
puts a serious performance limitation on multi-core platforms, which
could otherwise execute several unrelated single instance TAs
simultaneously.

This commit makes the single instance lock optional. By setting
CFG_CONCURRENT_SINGLE_INSTANCE_TA=y, the lock is disabled and TAs are
allowed to run concurrently. In the future, we may implement a deadlock
detection algorithm; in the meantime, this simple solution should be
enough to cover the current use cases.

Signed-off-by: Jerome Forissier jerome.forissier@linaro.org
Tested-by: Jerome Forissier jerome.forissier@linaro.org (HiKey960)
CC: Zeng Tao prime.zeng@hisilicon.com

@jenswi-linaro
Copy link
Contributor

Acked-by: Jens Wiklander <jens.wiklander@linaro.org>

@etienne-lms
Copy link
Contributor

Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Change is OK but I wonder if this feature could be TA related, through a TA_FLAG_SINGLE_INSTANCE_CONCURRENCY so that TA can explicitly claim this non-protection.

@jforissier
Copy link
Contributor Author

@etienne-lms a TA flag would certainly be doable but would be more complex (what should be the rules when mixing TAs that have the flag with TAs that don't have it?). I'm not sure it's worth the trouble.

Commit 2b07dcb ("core: avoid deadlocks caused by single-instance
TA") introduces a lock that allows only one single instance TA to be
executing at any time. While it does address the risk of deadlock that
can arise when several single instance TAs call each other, it also
puts a serious performance limitation on multi-core platforms, which
could otherwise execute several unrelated single instance TAs
simultaneously.

This commit makes the single instance lock optional. By setting
CFG_CONCURRENT_SINGLE_INSTANCE_TA=y, the lock is disabled and TAs are
allowed to run concurrently. In the future, we may implement a deadlock
detection algorithm; in the meantime, this simple solution should be
enough to cover the current use cases.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
CC: Zeng Tao <prime.zeng@hisilicon.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
@jforissier jforissier force-pushed the concurrent-single-instance-ta branch from aa44284 to c13364e Compare November 13, 2017 15:35
@jforissier jforissier merged commit daeea03 into OP-TEE:master Nov 13, 2017
@jforissier jforissier deleted the concurrent-single-instance-ta branch November 13, 2017 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants