From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::241; helo=mail-wm0-x241.google.com; envelope-from=daniel.thompson@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::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 A6DE4210C2D7D for ; Fri, 27 Jul 2018 04:10:18 -0700 (PDT) Received: by mail-wm0-x241.google.com with SMTP id o18-v6so5099420wmc.0 for ; Fri, 27 Jul 2018 04:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=KiGbBeMC+sr5R/izgRw1FhuecEwlhDkVXJECkgjLCZw=; b=eCp1aF0K+95H2sATDt7hCVLSOfajH2AhR75daCjGr6bGW9coAp4JxovLdeAF29Wq// IiJ9bDZU84+PyvudAaKOkbDAFeBDDm9jHTeOCCF4GCSWzOG1+jnMJZKZ//29JRw8XFjL hCWiSCS80nFjPxoudn2YNqAMGMETbVTin1vm4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KiGbBeMC+sr5R/izgRw1FhuecEwlhDkVXJECkgjLCZw=; b=sQWBVrCIpO0L46c+/jyhNgBPjecZ6gyjcTkNuBK0aZAFgXF46LER4PqIaPvPjJZJFT v8syEkl4c1x5EbHEKwoJ6R6qytCHl1/X/clHYk9oHuLxmjhWrLihFQuuoJ9PMUdDEbLv LSSHsV5uMzR6fLV+iJPh7NpY+/kz5rJuO+egLiMNnHNUMgeYnbx+Y3jbOI4C8jFnvqrj odN3FccnFewCHCdJQb66w2f9cBc9A2R3QK6V0SqT/g4qbbwMk6AnNNGIhTt2LYGWL9A8 opSoecuc8iEGvdto3Btuhit2EdSdSgwc+UBioBOTT1Robg3K1+EqDfNjt8ILIUNPFyDp /C6w== X-Gm-Message-State: AOUpUlEg7z3ytdF0d1K6WLFe6F44pM1yy0OAN6VHUatKv2XdNddu+lqk v67BIZh1e81DgwXKXkQvSooq4g== X-Google-Smtp-Source: AAOMgpcOwCWs1CmmCOTc+RP6dkhhtCOgVssSABM/Ur3cmom+qeFzUHeU/nGrigEnJmUIyCjYv4OJDg== X-Received: by 2002:a1c:ca0f:: with SMTP id a15-v6mr3873604wmg.102.1532689816436; Fri, 27 Jul 2018 04:10:16 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.googlemail.com with ESMTPSA id 68-v6sm1964160wmi.31.2018.07.27.04.10.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 04:10:15 -0700 (PDT) To: Sumit Garg Cc: Ard Biesheuvel , edk2-devel@lists.01.org, Patch Tracking , Leif Lindholm References: <1532351961-17377-1-git-send-email-sumit.garg@linaro.org> <20180726073616.ut62js3w6lxsvrvf@holly.lan> <20180726075050.b6lnnj463phntuwi@holly.lan> From: Daniel Thompson Message-ID: Date: Fri, 27 Jul 2018 12:10:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: 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:10:19 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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. Daniel.