If an enclave is used by multiple applications and makes an ocall,
which application will get the ocall?
I would hope it is the one who owns the stack which made the containing ecall?. Would that be a safe assumption?
Besides an answer, a reference would also be appreciated.
AFAIK one single enclave "instance" cannot be shared by various applications. By saying this, I mean that, using the SGX SDK, an application cannot make an ECALL to an enclave that it has not created. Trying to do so will cause an SGX_ERROR_INVALID_ENCLAVE error.