On Thu, Jul 26, 2018 at 02:12:04PM +0530, Sumit Garg wrote: > On Thu, 26 Jul 2018 at 13:20, Daniel Thompson <daniel.thomp...@linaro.org> > wrote: > > I guess it could implement a secure monitor call to provide it. In > > fact I find it a rather pleasing approach. However I think it still loops > > us round to pretty much the same question as before. Does TF-A "protec > > " a normal world that makes an SMC to an OP-TEE that isn't there by > > failing the call in a nice way? > > TF-A returns SMC call for OP-TEE as unknown (error code: -1 in "x0" > register) if OP-TEE is not present.
Be careful here; you can't use an arbitrary SMC since that could be implemented by another trusted OS (with a completely different meaning). Assuming you know the system provides SMCCC, you can use the "Call UID Query" in the trusted OS range, and check that returned value matches OP-TEE's UID. i.e uid = smccc_uid_query(OPTEE_RANGE); if (uid == OPTEEE_SMCCC_UID) { [ OP-TEE present ] } else { [ unknown/no trusted OS present ] } Thanks, Mark. _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel