Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp256761ybm; Thu, 28 May 2020 22:34:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfiFXniApWRSmp2ebEjD22knFSClHtIys0/oZQJi9f3v7JprxfXeD8Vw7HndzbfDQ/1gT6 X-Received: by 2002:a17:906:f2d9:: with SMTP id gz25mr6571989ejb.467.1590730445272; Thu, 28 May 2020 22:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590730445; cv=none; d=google.com; s=arc-20160816; b=zo232hbfe+5P/CZqVjWbUOR5yRmWLM4VldkWAIIwlcozXV2mCdCIrugRDYGcGEIyFS iO0kvmEG2OIVEtciL2qN5NenKJzY/YkCDotJYibNSqIRqFnFjzgFzDrNn7cYYy+kGWMU rVCxqGd6W0mt5yrldvirVqz4aJA2KiSUBQK6cLrySRkTt4fVqmUm/+ZoqWTJqW4+epMe URd1UE6+z+IcQqSu3p2xCIYqi3GJHRoaGOECSutVchOrJbQflklLs2M5ECDvQa2K4kS1 YxXClks2zL6s6rBtkrYTMCUHwBC0N+85cjbCBxRNpWPE92UJtSWDL0FrvNnirsi2bXI3 +oLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BtB2LFCwGlcL1VaxzIrehfNf8TpYkOn5N85lj//StkI=; b=bLZrPoN+BYz2wf4nwd8mqc1nA2hzAIaB0hPEmIVqdIwT5QJIzAxBPYNYMpp+qq4RrW vmPdVsO1Pw8PgaF6k9YMjU7u1EWkkurW6h373wyZndGQ4uiCbM9OQQ42m0l3blBDyDe+ JkmZzhoXRHXBVmlYMygYIcnE5iIJILg9l4zV1wxqe0eeUL4JRovmryrdTDI9WBWN1PhZ Yt1CzyTf8IiWDCWZFolv9pV0jA+HFOjH17Kgb95DeAOCOxSsSlucAc9As4MZGE7Ooboa aolDyb5jUXxn18Y3TriNVoIWKpjA2Etfpw8d2pPa9+J3vNn/2h8bv+XwHdpPOpZBEXcL Mk+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tfdUS3VW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s24si5053765ejz.736.2020.05.28.22.33.41; Thu, 28 May 2020 22:34:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tfdUS3VW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725920AbgE2F2v (ORCPT + 99 others); Fri, 29 May 2020 01:28:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbgE2F2u (ORCPT ); Fri, 29 May 2020 01:28:50 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C1E0C08C5C8 for ; Thu, 28 May 2020 22:28:49 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id s1so1061249ljo.0 for ; Thu, 28 May 2020 22:28:49 -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=BtB2LFCwGlcL1VaxzIrehfNf8TpYkOn5N85lj//StkI=; b=tfdUS3VW/pKmUDBp2mr5coRHksBW07+ShUkPGrNp5uPuYE8H1H/xc8uNd4p8tvycPE bIydIJWamMeEoiCsJ5Q8qNS0xC+M8kKtaqWoMI4gzV+x9w9fIIPFkS/VvEB9rCj/SBMq 1KVHWLWqc71LcusNdMXyr+XwiXcs4S+RdsvIGl4i+9oIEvL9wsLiJuPC/rS4upckvWAy pI/HDpJpiO2qdojnN7208WImc3NKD1tgKWWI8lIftxFMu1BcrYlDWrQ6KRvtP43xO5jz tn6a0bz7zI+guhFvX3YeP5icO6TIilBHLsnDeOSSPP/fUqNmOrDWSRCouZrFuBkqOj7U IQfg== 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=BtB2LFCwGlcL1VaxzIrehfNf8TpYkOn5N85lj//StkI=; b=mZ625vwylh1U+VgiSScPIzGFkUO5/OXpLtktLtOht127xnd1hDsbQ1evHmUsjqtRYE peJbHgiN/n2fitgJ+R1dAsYwxfa7SiJPAA7EPntRRcXlI5OE1hbdKWuVTzASuryGZSuP Ms+1TcmCLYGa9cuBYWVTv0FPgII77ypViPxN7p5yYmY5j2Xus87CWwr66xGs9aiIQMg3 dBeRujJ/T8MarnlInCarvgC8M0UqhmJoghr+40TzPSjs/LJso2XH5smo9mGWB9959a3X iua1WDrMItktv3R727XrufvER9YZG3sUWDJ0RscmLRAJx3YaV9k4gRZskml+uUSkhUh1 JIgg== X-Gm-Message-State: AOAM5304OjU4/j0mrAx+DxgiCq4NBFjIJj823nPo+KMgP3o8zszqdLOJ xrYthlL7axXE8nMF9XyOzisY5EEBcBFEVdWB6bF6Sw== X-Received: by 2002:a2e:8006:: with SMTP id j6mr2931003ljg.256.1590730127309; Thu, 28 May 2020 22:28:47 -0700 (PDT) MIME-Version: 1.0 References: <20200521064743.4769-1-maxim.uvarov@linaro.org> <20200521064743.4769-4-maxim.uvarov@linaro.org> <20200522171451.GD10319@linux.intel.com> <20200522200346.GB150221@linux.intel.com> <81c59da1dc2a255c58e7e338f30285e68b4664d6.camel@linux.intel.com> <20200528101150.GA156014@jade> In-Reply-To: <20200528101150.GA156014@jade> From: Sumit Garg Date: Fri, 29 May 2020 10:58:35 +0530 Message-ID: Subject: Re: [PATCHv2 2/2] tpm_ftpm_tee: register driver on TEE bus To: Jens Wiklander Cc: Maxim Uvarov , Jarkko Sakkinen , Linux Kernel Mailing List , "tee-dev @ lists . linaro . org" , peterhuewe@gmx.de, Jason Gunthorpe , Greg Kroah-Hartman , linux-integrity@vger.kernel.org, Arnd Bergmann Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 28 May 2020 at 15:41, Jens Wiklander wrote: > > On Thu, May 28, 2020 at 11:08:18AM +0300, Maxim Uvarov wrote: > > On Wed, 27 May 2020 at 22:42, Jarkko Sakkinen > > wrote: > > > > > > On Mon, 2020-05-25 at 09:50 +0300, Maxim Uvarov wrote: > > > > Jakko, > > > > tee-supplicant application provides state machine over callbacks with > > > > RPC messages. > > > > https://github.com/OP-TEE/optee_client/blob/master/tee-supplicant/src/tee_supplicant.c#L614 > > > > It also allocates shm. Without running tee-supplicant > > > > tee_client_open_session() will fail. > > > > optee_open_session()->get_msg_arg()->tee_shm_alloc()->... > > > > Optee team wanted to remove some dependencies from tee-supplicant with > > > > moving code > > > > to the kernel. But for now I think that should be out of the scope of > > > > current patches due to > > > > they fix driver initialization on tee bus without breaking current > > > > functionality. > > > > > > So what is the role in high-level for tee-supplicant? Why does it > > > exist? No time to dive into code unfortunately. > > > > > > > Original implementation for tee-supplicant does several things: > > 1. allocate shm > > 2. load ta from user space (fs file) > > 3. emulate rpmb > > 4. also there are some ftrace and socket functions which I did not use. > > > > As I I understand, current implementation uses tee-supplicant and it's > > library as > > API from user land to Trusted OS. > > > > Some docs can be found here: > > https://optee.readthedocs.io/en/latest/architecture/index.html > > > > > > > > > These kernel commits do not explain in simple terms enough how all > > > of these entities connect with each other, if you don't have that > > > understanding beforehand. > > > > > > > Yes, that is true. But I think it's something new and good docs will > > be some time later. > > There's already some in Documentation/tee.txt, but it will get outdated > if we don't update it when we architectural changes like this. It's a > pity we missed updating it with the introduction of the bus. It seems a > good time to do it now so it easier to follow what's done. Agree, let me try to update documentation for TEE bus. Will share it as a separate patch. -Sumit > > Cheers, > Jens > > > > > > /Jarkko > > > > > > > Regards, > > Maxim.