From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::243; helo=mail-it0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (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 0528B210C2D86 for ; Fri, 27 Jul 2018 05:12:50 -0700 (PDT) Received: by mail-it0-x243.google.com with SMTP id v71-v6so7046356itb.3 for ; Fri, 27 Jul 2018 05:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RY7jvsU8YPhtkcmuYZbEyLAEc0XxvfxPptfRQK33B+s=; b=JIyTZrZXNUCBTWy4kTfM3zZf29UF5r8C+muQ4tQGb8pJ5qsb3pvWPtYRQ7xP/Y+jxf 1qMhM+XrpC4zlnWUJ8gPOob3omgED7oK6wnkrg3q2rUjGdIz5CIw03/x9TartJHA54zs BORrps8Um8sFSnS/yuD35k1vgOpVMTvW+Xi2E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RY7jvsU8YPhtkcmuYZbEyLAEc0XxvfxPptfRQK33B+s=; b=Uk/K3fXGXnEc5XicyBaz8G7t9n3QZ2HG/WDNdSTXj7Wh7qO+1lTbJEZo3ZoCnHBJTw Cq22K80hluGqT9RBeJ9TNyolj8QnbRhT5IxY+tJTonUHRaM8IpTVj15AGMNpYk7WGKoG uJI+W1Th5aJApOkuMuZlV0We6DEBPF19qQ9vagWMT3JTrf3VBKmdOgLLsfkt5FNv3XTu BS/FfesvULNqdwqPvr8yVZUsl8SE8pvUQ0Y6SKoCFvPZNqW5tp9huaJKVY3cFLspNHAT lcsPXGnvBjLoPVEE/wQD+zOYdj5TnGcV6BdE4rNrCQN568jb/U/sLSt9AdslPhkaOuIc 0odw== X-Gm-Message-State: AOUpUlGyEevsaMmcTkePou2qxgyzvyyAJZyJF6zVNfnLAehApzb3UvCS Q4H/cF+4PxFd/ninllwc9xAfSUcR14H3Z1Xuv5KGjg== X-Google-Smtp-Source: AAOMgpefMWsrU9XLV2Ili5UM6QRinZOFnr+3SEaxDA1y/QO35LEeyg1SuFk/juhu0A2C4dpVkMcFQyl6iIhCaqLZJGg= X-Received: by 2002:a24:610d:: with SMTP id s13-v6mr5324085itc.68.1532693569909; Fri, 27 Jul 2018 05:12:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ac05:0:0:0:0:0 with HTTP; Fri, 27 Jul 2018 05:12:49 -0700 (PDT) In-Reply-To: References: <1532351961-17377-1-git-send-email-sumit.garg@linaro.org> <20180726073616.ut62js3w6lxsvrvf@holly.lan> <20180726075050.b6lnnj463phntuwi@holly.lan> From: Ard Biesheuvel Date: Fri, 27 Jul 2018 14:12:49 +0200 Message-ID: To: Sumit Garg Cc: Daniel Thompson , "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 12:12:51 -0000 Content-Type: text/plain; charset="UTF-8" On 27 July 2018 at 13:37, Sumit Garg wrote: > 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. > Indeed.