Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753040AbbDQHwK (ORCPT ); Fri, 17 Apr 2015 03:52:10 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:33691 "EHLO mail-la0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751812AbbDQHwB (ORCPT ); Fri, 17 Apr 2015 03:52:01 -0400 From: Jens Wiklander To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman , javier@javigon.com Cc: Herbert Xu , tpmdd-devel@lists.sourceforge.net, valentin.manea@huawei.com, jean-michel.delorme@st.com, emmanuel.michel@st.com, Jens Wiklander Subject: [RFC PATCH 0/2] generic TEE subsystem Date: Fri, 17 Apr 2015 09:50:55 +0200 Message-Id: <1429257057-7935-1-git-send-email-jens.wiklander@linaro.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4292 Lines: 97 Hi, This patch set introduces a generic TEE subsystem. The TEE subssytem will be able contain drivers for various TEE implementations. A TEE (Trusted Execution Environment) is a trusted OS running in some secure environment, for example, TrustZone on ARM cpus, or a separate secure co-processor etc. Regarding use cases, TrustZone has traditionally been used for offloading secure tasks to the secure world. Examples include banking applications, Digital Rights Management (DRM), or specific secure solutions. This TEE subsystem can serve a TEE driver for a Global Platform compliant TEE, but it's not limited to only Global Platform TEEs. One reason why I'm doing this to be able to get an OP-TEE (https://github.com/OP-TEE/optee_os) driver upstream. The first patch brings in the generic TEE subsystem which helps when writing a driver for a specific TEE, for example, OP-TEE. The second patch is a mostly stubbed OP-TEE driver which shows briefly how a specific TEE driver uses the subsystem to register etc. I've tested this with a more complete OP-TEE driver, but I don't want to post that yet in the current shape. I will submit a complete OP-TEE driver when it's ready. Javier is also working on a driver for another TEE so we will soon have at least two TEE drivers under the TEE subsystem. Questions: * Where should we put this in the tree? I'm proposing drivers/tee and include/linux/tee here. Another place could be drivers/firmware/tee. I don't have a strong opinion on either place. * What should we have in the .compatible field in FDT for the OP-TEE driver? I'm proposing "optee,optee-tz" as OP-TEE doesn't really have a vendor. OP-TEE isn't limited to TrustZone, it can run in other environments too so "optee-tz" could be a way of keeping different options apart. I need advice here. * Who will maintain this? I'm willing to do it together with Javier. This patch set has been prepared in cooperation with Javier González who proposed "Generic TrustZone Driver in Linux Kernel" patches 28 Nov 2014, https://lwn.net/Articles/623380/ . We've since then changed the scope to TEE instead of TrustZone. We have discussed the design on tee-dev@lists.linaro.org (archive at https://lists.linaro.org/pipermail/tee-dev/) with people from other companies, including Valentin Manea , Emmanuel MICHEL , Jean-michel DELORME , and Joakim Bech . Our main concern has been to agree on something that is generic enough to support many different TEEs while still keeping the interface together. Regards, Jens Jens Wiklander (2): tee: generic TEE subsystem tee: add OP-TEE driver Documentation/ioctl/ioctl-number.txt | 1 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/tee/Kconfig | 18 ++ drivers/tee/Makefile | 4 + drivers/tee/optee/Kconfig | 7 + drivers/tee/optee/Makefile | 2 + drivers/tee/optee/core.c | 192 ++++++++++++++++++++ drivers/tee/tee.c | 253 +++++++++++++++++++++++++++ drivers/tee/tee_private.h | 64 +++++++ drivers/tee/tee_shm.c | 330 +++++++++++++++++++++++++++++++++++ drivers/tee/tee_shm_pool.c | 246 ++++++++++++++++++++++++++ include/linux/tee/tee.h | 180 +++++++++++++++++++ include/linux/tee/tee_drv.h | 271 ++++++++++++++++++++++++++++ 14 files changed, 1571 insertions(+) create mode 100644 drivers/tee/Kconfig create mode 100644 drivers/tee/Makefile create mode 100644 drivers/tee/optee/Kconfig create mode 100644 drivers/tee/optee/Makefile create mode 100644 drivers/tee/optee/core.c create mode 100644 drivers/tee/tee.c create mode 100644 drivers/tee/tee_private.h create mode 100644 drivers/tee/tee_shm.c create mode 100644 drivers/tee/tee_shm_pool.c create mode 100644 include/linux/tee/tee.h create mode 100644 include/linux/tee/tee_drv.h -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/