From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400c:c05::241; helo=mail-vk0-x241.google.com; envelope-from=sumit.garg@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-vk0-x241.google.com (mail-vk0-x241.google.com [IPv6:2607:f8b0:400c:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2630A210C2D94 for ; Fri, 27 Jul 2018 07:29:55 -0700 (PDT) Received: by mail-vk0-x241.google.com with SMTP id y70-v6so2531094vkc.0 for ; Fri, 27 Jul 2018 07:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6Mu50i/9a2OuKgPcnUMfXbxy86y8RffdrWnb/IQNHg8=; b=JOknhnucDCd3GxVwToY8K7rYiI+SeERbzeVz7hENLr98iSvqMLF0SgrfGBnnLfiFGl Y4fDV6OcVyDfgdMOBL9S6a7B9jIiuYoHBxPmXDOrX9bWHd5YHsgAsiDmNCfx40iAa72d piOkE3MGpEZJFoZswbwwJMmor24sqp1eKBLs4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6Mu50i/9a2OuKgPcnUMfXbxy86y8RffdrWnb/IQNHg8=; b=FkjBrfjbWaYXK8xG+G3WmGd+Wc6xc+XOYM3DjceqrVa1z61bJ46jz2cr9wOXKg3BrX qIfNTa+mQlzvjObQXgvBrh5AG8rs/D9EQJLvz+i2YKTkbnJrBb0zGjlrmhIG3kuMjYfB HYHJWCQeiPKYrX8+WakP38kR5zYHv0eLtQa4Aaox2BruTUFUsVgiCYcy9ZNzp+NeGGbD F796r9XgjOwmsI2yOpYJ1T9kGAdLEBbnwp+vFwQrFM4TYGS81JBGxiwFdecjLF69B25q ahs9a6jL3wR333ZlLyArg957vKUmkk8wLhRlH0nqf+dX2ip6Xd6Rq1CrGk7Z3MtbHHsc NHSA== X-Gm-Message-State: AOUpUlEtiBZgF1ChEaStrhxjb+Dgyv36qQPG7YRpF/gX/ttLT8GsL6fT ewG7xCgq3N2/WUkK5PeiZwCQqP5KvcK55LRMI9/6VQ== X-Google-Smtp-Source: AAOMgpdRMlfjaDl0U87dCOBnVVi3KPW28EYHgk/A8l0RrtvTypG+T49I63hPrQe3yaGG//Rkye5ev9/ZprHqPk1ht4g= X-Received: by 2002:a1f:ec02:: with SMTP id k2-v6mr4294819vkh.81.1532701794722; Fri, 27 Jul 2018 07:29:54 -0700 (PDT) MIME-Version: 1.0 References: <1532351961-17377-1-git-send-email-sumit.garg@linaro.org> <20180726073616.ut62js3w6lxsvrvf@holly.lan> <20180726075050.b6lnnj463phntuwi@holly.lan> <20180727124911.xcjqzwjvdkcfextm@lakrids.cambridge.arm.com> In-Reply-To: <20180727124911.xcjqzwjvdkcfextm@lakrids.cambridge.arm.com> From: Sumit Garg Date: Fri, 27 Jul 2018 19:59:42 +0530 Message-ID: To: mark.rutland@arm.com Cc: Daniel Thompson , edk2-devel@lists.01.org, Patch Tracking Subject: Re: [PATCH edk2-platforms v2 1/1] Silicon/SynQuacer: add optional OP-TEE DT node X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2018 14:29:56 -0000 Content-Type: text/plain; charset="UTF-8" On Fri, 27 Jul 2018 at 18:19, Mark Rutland wrote: > > On Thu, Jul 26, 2018 at 02:12:04PM +0530, Sumit Garg wrote: > > On Thu, 26 Jul 2018 at 13:20, Daniel Thompson 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 for this useful suggestion. Will try to use it. -Sumit > Thanks, > Mark.