@vbabka The reason I'm contacting is that for a new implementation the best approach would be to make the state of the TPM parametrized instead of holding it inside the implementation.
So the use case would be e.g. SGX enclave:
1. Pass a state blob from untrusted OS to with the TPM command to the enclave.
2. Enclave processes the TPM command, encrypts the state blob and returns it back to the caller.
Global state in the current implementations is IMHO the biggest problem so it would be a loss to get yet another implementation with such. Stateless software TPM would be sort of universal across various TEE's.