Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp838725ybs; Sun, 24 May 2020 23:54:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNbWsMQUJcda8QrkXUlomjBYt2q8ZSNIoAWOv1hktm/Y4VWueALWfl+1QafBjTX6UX0HIT X-Received: by 2002:a05:6402:a41:: with SMTP id bt1mr13459601edb.151.1590389644870; Sun, 24 May 2020 23:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590389644; cv=none; d=google.com; s=arc-20160816; b=CmhYJOOFC+nvQ8v3vYVBUG0zZxCfA1LQax9pAyBJE+d3ZBLDKzMdJXo9XHIffVTPcD XJzY83JdI2oNJS+2l9jqn4S7VHd4W8e0mfACiwJkN5Log9jlf2yQfzThbQ9cUKquy3Q0 HPBzH1qyQVh1njnXFIRuiQOqIxxXAn7dgJke0FWe1qmg0tTn0ViXflktp4PBHvb/r8IC CAah8I5SfWgP3qq58HJNjHWKGNA9AcJXmCCdVgpCaPbbE6q+uqURuUdFU/8bGSDNxrda HKcPSbSOyAG9EbkMIu4OyBgkgGfLxdJyURQD91BW0S1FRifItgWJe9Sj1p3lSbCTkJgi waYg== 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=NLMRtJrXxF/KIRzWVXOQPJWRHqdMyNwc6DMD7m4ZeeQ=; b=izVdDMAcrZIsokyhBxhltVUALE1kD+sMSsbidIbeo0gIq/k0/OCqaZSp629UubeqdB kRzY1UCTN/yb5IaFgmqwSgbHhFxhAFmb0r8aJM8eygxn1+Z0PoF44APcPbnoq4Fn4rh3 suZDJ96RoSj5Eqr2Hf1Y89l3Adlu0woxptp52u+Pg6mGdviggqV0cUFWkZ4Wiyq+HklD mpAuG75A51+bkhe7weEReUgIAdbbdUeSr7s2idSorryg7DBACkQGN+Am5jsjMLie+T2k kZv/H1NnUYuN+gAd40c51ja+q5YfJNUL5HQv8VKku6CQKCuA4AFi48tDkljV/4pkFTCw RnEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wOotrqX2; 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 k16si9673619edk.162.2020.05.24.23.53.41; Sun, 24 May 2020 23:54:04 -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=wOotrqX2; 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 S2388935AbgEYGu7 (ORCPT + 99 others); Mon, 25 May 2020 02:50:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388487AbgEYGu7 (ORCPT ); Mon, 25 May 2020 02:50:59 -0400 Received: from mail-yb1-xb41.google.com (mail-yb1-xb41.google.com [IPv6:2607:f8b0:4864:20::b41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52F87C05BD43 for ; Sun, 24 May 2020 23:50:58 -0700 (PDT) Received: by mail-yb1-xb41.google.com with SMTP id s21so2189980ybe.5 for ; Sun, 24 May 2020 23:50:58 -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=NLMRtJrXxF/KIRzWVXOQPJWRHqdMyNwc6DMD7m4ZeeQ=; b=wOotrqX2ldR8fNeNoc1dIZNlAxcy18iSOAwS6u2D9eXMPH37ZAuhxXV2tTOg5IFD4Q qwuJamEkdNglQRvP3aSxwpCQTgTtrua0T59Sd+eAKqooq0VD2DAQuQVA6Ty4osplIkMA FtXb1sIUrxczDyWkP04izFLZtDouDF2K/V5xuRpF7p9GsiZXPLzvDRQR8lBTCJrgAam4 Zojqid9RoiGr3iVMLBghA6fGKqHc/YF2Kys4IHLNMVmxM9HJuDruSO702XgvAtiLxrZG ullbczLDSH3cgnxrHjcp93f64zeAZpXnlXAVbWARUSF/UowJ2wbZ3HpuluuQ5RVOy+X+ UZtQ== 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=NLMRtJrXxF/KIRzWVXOQPJWRHqdMyNwc6DMD7m4ZeeQ=; b=Ax62gSEt/g6htTXqaZYp7623A4Gzkbzetn2ZCavWmt6xCxomw/8BZc8oWPxDgGRQZd TYhHkisat4Sd/EeUhhuGEp7hvAxI2GF9uqNALS1CCsg3xd/BlnkXW4LmwV+6si9yCqi9 N0ybH8M/IXlrKs6bGoqbivEarpjlPLYEdBy8ZMwtxn+H4pIrLps69+kkR9nDZ6y9QpSN KDRsnBcQafvDKubkgeunSedrXyyM9wR3oBSgCcRe5PVuCON/uK0wG6X62GQs+BvkJdyP PMUvT43yl63jg+WSKgfa1qeUPplmVOePffaoCJKCwM2euoH6vatk0+79efIVM30IvGZd cHhA== X-Gm-Message-State: AOAM533Evb87pgG2iKp+By6nn1pFVXgWsbPvh2pKPP+Bw/X3HoUjZcH9 B+rGvfs1ORQuxvJ1YHQ4cYmdcy7ODdUyTtbYGCtlTg== X-Received: by 2002:a25:209:: with SMTP id 9mr29888792ybc.153.1590389457134; Sun, 24 May 2020 23:50:57 -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> In-Reply-To: <20200522200346.GB150221@linux.intel.com> From: Maxim Uvarov Date: Mon, 25 May 2020 09:50:46 +0300 Message-ID: Subject: Re: [PATCHv2 2/2] tpm_ftpm_tee: register driver on TEE bus To: Jarkko Sakkinen Cc: Linux Kernel Mailing List , "tee-dev @ lists . linaro . org" , peterhuewe@gmx.de, jgg@ziepe.ca, Greg Kroah-Hartman , Jens Wiklander , linux-integrity@vger.kernel.org, Arnd Bergmann , Sumit Garg 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 Fri, 22 May 2020 at 23:03, Jarkko Sakkinen wrote: > > On Fri, May 22, 2020 at 10:29:44PM +0300, Maxim Uvarov wrote: > > On Fri, 22 May 2020 at 20:15, Jarkko Sakkinen > > wrote: > > > > > > On Thu, May 21, 2020 at 09:47:43AM +0300, Maxim Uvarov wrote: > > > > Register driver on TEE bus. module tee registers bus, > > > > > > "on the TEE bus" > > > > > > "The module tee" > > > > > > > and module optee calls optee_enumerate_devices() to scan > > > > all devices on the bus. Trusted Application for this driver > > > > > > Looking at drivers/tee, it shows that tee and optee are in fact the same > > > module as opposed to what your commit message says. > > > > > > > In the current kernel it's 2 different modules. > > > > > > can be Early TA's (can be compiled into optee-os). In that > > > > case it will be on OPTEE bus before linux booting. Also > > > > optee-suplicant application is needed to be loaded between > > > > OPTEE module and ftpm module to maintain functionality > > > > for fTPM driver. > > > > > > Why is this needed and why things worked before having this? > > > > > > > Before these changes user space has to drive boot sequence. I.e. tee > > and optee modules loads, then application tee-supplicant has to start > > and only then module ftpm can be loaded. The reason for that is > > storage services are implemented in userspace and driver needs them. > > Is the TPM implementation uploaded to TEE from user space and or what > storage are we talking about? Not sure how these storage services > connect to the TPM. > > /Jarkko 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. Maxim.