On Fri, Mar 06, 2015 at 11:53:44AM +0100, Jean-michel DELORME wrote:
TEE_IOC_SHM_FREE seems not necessary, if we consider that the SHM is by construction a fd-derived object.
So, you are saying that having a single TEE_IOC_SHM is enough and that you could similarly to cmd, just provide another parameter telling what type of shared memory operation it is?
If a generic TEE_IOC_CMD is defined to support the create context, open session, invoke command .. what is the need to have a specific TEE_IOC_SHM_ALLOC command.
I believe that shared memory management is something that is suitable to have in the generic driver. Me and Jens had a rather long discussion about this. We discussed a few alternatives and design choices. - Specific driver tells what kind of memory it needs when registering to the generic driver. For example, I believe you have some range limits for shared memory in LX? This is an example of information that could be provided when registering. - We talked about having the possibility to register so that shared memory could be handled in the specific driver in case a certain driver have special needs. However we didn't believe that this was something that was likely to happen. - We talked about having all shared memory handling done by the specific driver, but then we also thought that the generic driver would be almost pointless(*) and then we're back to square one.
(*) Meaning that we're only looking at this from an OP-TEE point of view. Javier and Valentin have been and are providing more use cases for us.
Regards, jm