From patchwork Wed Jun 16 10:36:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 461384 Delivered-To: patches@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp487101jae; Wed, 16 Jun 2021 03:37:09 -0700 (PDT) X-Received: by 2002:a19:c4b:: with SMTP id 72mr3205285lfm.15.1623839829581; Wed, 16 Jun 2021 03:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623839829; cv=none; d=google.com; s=arc-20160816; b=ic/bzTnNxbdelGyogh9M1Oa97z+E/kfVzT+6j+DmCREmVwEjp0WjWMd7t8l49PUX7H Af+FSjncFYB/eAEkiAg+KjksubS+nVNVVtXtMTlmjd/g6nTLb/yJwQJEcWzblRMK1FX2 dGZvvJVdLewt13WUD+N++mKaHSbUgIK43lH02F3L7TU8GoPQfnZRDMceRIAzYftoiXHD Av1cKlRIxiuRGuNT5ecPVfH9lj4dguZkC7hJknZ6KkG7M78U1DzIIbRRDNfdWcNqXHyd 6F7jGtzt5SE3OpNlnOYYwj4z1K/eCK9bGWwhe8pwchc2NV6UyC5phH6LAtsyW79aqp1/ KTnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=b7VdJEU0rTTCUa4ZBdIREuYAtQWfk2gNqxWTeP8ttgw=; b=IwHGspyx9fFZtY/JaAxZVGirWwA3r6LVPE0kQhkK0L/qq2Hju/XHGjOovp8Qi3HDis Rwbsqn3lu3/87RrUfGpXqX9HvC3xQIpnnv9MJYIVTlLOeGgFGXo1QedmozNJU7T+C1V/ kYTcLDjbZsKZaNPitxeZPyjxFRLeMPvUzBofCEHRhRRC4HhFb2D9bC8wRE8RsaFrb5II ZUknsvUhkGzfzKxuUuLINIk4KOCnTt815PmOvLcohA15r29f00JlsBTny6CLUn7gwzOk SB13r9NJBSiPlX3eshkN7ZKdcKg8KJRfhCSU4A55Rk5QkLlpmb4Ie/X1/GjQaTo56TiX MLjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZCXHnYHl; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id c26sor788415ljn.48.2021.06.16.03.37.09 for (Google Transport Security); Wed, 16 Jun 2021 03:37:09 -0700 (PDT) Received-SPF: pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZCXHnYHl; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=b7VdJEU0rTTCUa4ZBdIREuYAtQWfk2gNqxWTeP8ttgw=; b=ZCXHnYHl+0AT+7BONvro4DzCy5ufAcHrcQX5ytJG5jo+OfOYC3ZyS22kRtBvFGR8kR fbOx99+CnWCfYPAMjsFgZ3oBeWCc+ItYMdF+ypiJdbIjojGGYCfF7awql7UXOrL7cZ66 P5j+dgyzgI+hY2thlTOaLefCptLQb2t1TeJsz72zP/5+hnVbQm3lh+Vepiso6RpK7yWh U8CjmwONzsPvLT5dU3EVeFjcR+83aDowkE8UH/eQC18qF3NKrje9u+xFsAv5EgtBZ8kb yns8QOxPP8d3eaQ9oc+saGGzMqd0OpVj5ZxbEaI+sPhkhFLuD2DYmG5OokafLPrwwnLg nAeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=b7VdJEU0rTTCUa4ZBdIREuYAtQWfk2gNqxWTeP8ttgw=; b=jAp6q89OqTv7mlTmH6j2E1qbC53kOI762UzC1TF7LET9MIOAWzRw9BE1oQ22WAnPBI BYo6KyCFxUjIngg2ddIv1obquzuHZsrOhzKq10zoka9MaOetWH+XxOcWWFl6jvLUIdDq gdc4Y4QQEyB8R3P2uzkkqy/BYCAG3rOG7Ena+H01GyXdXgq3ySnvw3m20+GVh+c2mBnM y5w3cYtbBFbxRw7kVEUFQlJm2uUgmgEC0CO5HfseRO54UorZGhkZ3Y5gxY3u+4XZsLiU M1KKir9LF0PSYKaL4K/NfgrHhTkFek/vYYyBVsAe3Uz3LomlVl1AGzC++eAsDhZE9oqF PrUg== X-Gm-Message-State: AOAM530mwefIPMlD2DsjobCNuR1RZORfOOZqg0N/SpV2/xXdr+PU7BgE lNu8m3DujkpDA5K7AY4KwTwKdOZ0 X-Google-Smtp-Source: ABdhPJwLU5RpnLUnL4Junjt28owZW8zzr9JX42D48ieAQPbH8IWYa7EBR9wbPUnGFtbb9a9ZGvvYqg== X-Received: by 2002:a2e:b170:: with SMTP id a16mr3889189ljm.67.1623839829193; Wed, 16 Jun 2021 03:37:09 -0700 (PDT) Return-Path: Received: from jade.urgonet (h-79-136-85-3.A175.priv.bahnhof.se. [79.136.85.3]) by smtp.gmail.com with ESMTPSA id m17sm205621lfh.288.2021.06.16.03.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 03:37:08 -0700 (PDT) From: Jens Wiklander To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, op-tee@lists.trustedfirmware.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org Cc: Jerome Forissier , Etienne Carriere , Sumit Garg , Vincent Guittot , Rob Herring , Jonathan Corbet , Ard Biesheuvel , Marc Zyngier , Jens Wiklander Subject: [PATCH v2 0/7] Asynchronous notifications from secure world Date: Wed, 16 Jun 2021 12:36:42 +0200 Message-Id: <20210616103649.2662395-1-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Hi all, This adds support for asynchronous notifications from OP-TEE in secure world to the OP-TEE driver. This allows a design with a top half and bottom half type of driver where the top half runs in secure interrupt context and a notifications tells normal world to schedule a yielding call to do the bottom half processing. An interrupt is used to notify the driver that there are asynchronous notifications pending. v2: * Added documentation * Converted optee bindings to json-schema and added interrupt property * Configure notification interrupt from DT instead of getting it from secure world, suggested by Ard Biesheuvel . Thanks, Jens Jens Wiklander (7): docs: staging/tee.rst: add a section on OP-TEE notifications dt-bindings: arm: Convert optee binding to json-schema dt-bindings: arm: optee: add interrupt property tee: fix put order in teedev_close_context() tee: add tee_dev_open_helper() primitive optee: separate notification functions optee: add asynchronous notifications .../bindings/arm/firmware/linaro,optee-tz.txt | 31 --- .../arm/firmware/linaro,optee-tz.yaml | 57 +++++ Documentation/staging/tee.rst | 27 +++ drivers/tee/optee/Makefile | 1 + drivers/tee/optee/call.c | 27 +++ drivers/tee/optee/core.c | 87 +++++-- drivers/tee/optee/notif.c | 226 ++++++++++++++++++ drivers/tee/optee/optee_msg.h | 9 + drivers/tee/optee/optee_private.h | 23 +- drivers/tee/optee/optee_rpc_cmd.h | 31 +-- drivers/tee/optee/optee_smc.h | 75 +++++- drivers/tee/optee/rpc.c | 73 +----- drivers/tee/tee_core.c | 37 ++- include/linux/tee_drv.h | 27 +++ 14 files changed, 576 insertions(+), 155 deletions(-) delete mode 100644 Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.txt create mode 100644 Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml create mode 100644 drivers/tee/optee/notif.c -- 2.31.1