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:c08::242; helo=mail-ua0-x242.google.com; envelope-from=sumit.garg@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ua0-x242.google.com (mail-ua0-x242.google.com [IPv6:2607:f8b0:400c:c08::242]) (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 5BED8210C2D7D for ; Fri, 27 Jul 2018 04:38:09 -0700 (PDT) Received: by mail-ua0-x242.google.com with SMTP id c12-v6so3127904uan.3 for ; Fri, 27 Jul 2018 04:38:08 -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=DMnDYxQE4RrbhfTYERLmv381IX7T7FkOTTgVJwl1LEA=; b=fWZLKW+w21FsLCS4TfLm6e7RE3pxN3zkmxwEB5wP/sYXOeJ/GTXXh42Fwil84bta9/ USEZ5f9quBr0/lZpMHkSSVRFYMllrRZrn1l+s7ZdY8sgU4ewMtasmXS18I+bv3yMmqn/ 8nFsw0G5g+tjsjUNK2iaQsAKkPrihedLiOG7o= 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=DMnDYxQE4RrbhfTYERLmv381IX7T7FkOTTgVJwl1LEA=; b=JcuC+IjLYbrq2+IkTT0HG+CTIZom3U8KeI9hFevw2H647rSRQGU78b5g9wuWBGSLRC Y3MkigP3SSGwH3ZLYyCoH6+BJ9JkvyIUurBAxymT+oS+d2WY6EJEPN5ellYO4sgYBZA3 /3whscxzF39XyN58J95t/iOtc/S4tx+W7J7klWYkK1UMJnq1tKAvqCQH2WvuhnAs0CQZ TDsSWLAmqvAhlo2KYxfv8oadpncPU3agxxPUnfbkLBN9wZxLkhiFCoT7N8N+kfwv53D1 qH4cN6cdSXIIiDdJsA0Pa5g/xALmkR6OJ68/InkO37UD2aJIupy8CNhpJF1LdLNKBnyZ tQlQ== X-Gm-Message-State: AOUpUlHm9fGIcL/Tr2IhOvTms+BlVX3LS1SQx5aKE2IygNw3xWmizjuo rh/p/+TGtMxHBjluHKt5tDrOWKpRGbT7PQ46J4/P8g== X-Google-Smtp-Source: AAOMgpdKuRAKMM7bKHG0aVECrGzh5hF7glHJb5y8PmlVcOiVvCCzDbqPkr/KuhsfEgMOLXutZOnvtLYYSlhhxYEnxNw= X-Received: by 2002:ab0:1aab:: with SMTP id j43-v6mr4376272uai.78.1532691487554; Fri, 27 Jul 2018 04:38:07 -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> In-Reply-To: From: Sumit Garg Date: Fri, 27 Jul 2018 17:07:56 +0530 Message-ID: To: Daniel Thompson Cc: Ard Biesheuvel , edk2-devel@lists.01.org, Patch Tracking , Leif Lindholm 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 11:38:09 -0000 Content-Type: text/plain; charset="UTF-8" On Fri, 27 Jul 2018 at 16:40, Daniel Thompson wrote: > > On 26/07/18 09:42, Sumit Garg wrote: > > On Thu, 26 Jul 2018 at 13:20, Daniel Thompson > > wrote: > >> > >> On Thu, Jul 26, 2018 at 09:39:37AM +0200, Ard Biesheuvel wrote: > >>> On 26 July 2018 at 09:36, Daniel Thompson wrote: > >>>> On Wed, Jul 25, 2018 at 12:04:58PM +0200, Ard Biesheuvel wrote: > >>>>> On 23 July 2018 at 15:19, Sumit Garg wrote: > >>>>>> OP-TEE is optional on Developerbox controlled via SCP firmware. To check > >>>>>> if we need to delete OP-TEE DT node, we use DRAM1 region info as SCP > >>>>>> firmware conditionally carves out Secure memory from DRAM1 region. > >>>>>> > >>>>>> Cc: Ard Biesheuvel > >>>>>> Cc: Leif Lindholm > >>>>>> Contributed-under: TianoCore Contribution Agreement 1.1 > >>>>>> Signed-off-by: Sumit Garg > >>>>>> --- > >>>>>> > >>>>> > >>>>> As discussed on IRC, i am not a fan of inferring the presence of > >>>>> OP-TEE from the base/size values of the first DRAM region. > >>>>> > >>>>> Please refer to the existing PCIe code how to read a GPIO in PEI and > >>>>> set a dynamic PCD accordingly, so you can use its value in > >>>>> PlatformDxe. > >>>> > >>>> For Trusted Firmware I asked Sumit to look for the OP-TEE memory carve > >>>> out rather than looking at the switches. This was based on concerns > >>>> about version skew (new C-A53 firmware, old SCP firmware[1]), in particular > >>>> if TF-A jumps to an OP-TEE that isn't actually loaded the system will > >>>> fail in a not very transparent way (especially if the user hasn't found > >>>> the debug UART behind the back panel yet). > >>>> > >>>> What is the consequence of passing a DT with OP-TEE present if one is > >>>> not actually present? Do we at least get as far as bringing up the > >>>> framebuffer before things explode? > >>>> > > > > If we pass a DT with OP-TEE and OP-TEE not present, Linux TEE generic > > driver exits gracefully giving following message: > > > > [ 1.976021] optee: probing for conduit method from DT. > > [ 1.976033] optee: api uid mismatch > > That certainly means we can be pretty relaxed about version skew of > normal world components (since nothing bad happens if thinks get skewed). > > > >>> Is there any way we can let OP-TEE supply a DT overlay? > >> > >> 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. > > It is possible to experiment with getting EDK2 to detect OP-TEE using > SMC? This would be fully generic and presumably be the first step in > having an EFI OP-TEE driver. > Agree. I will try to detect OP-TEE version via SMC call. If SMC unknown is returned, then we say OP-TEE is not present and remove corresponding DT node. So I think this EFI OP-TEE driver makes more sense in edk2 rather than edk2-platforms. -Sumit