Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp380455pxb; Thu, 26 Aug 2021 05:31:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqSX0rgKbh4deXBA1SJ89VjeGBHEqcpPNRGkqATp/Qkrx3Hbto+FYgdqoltX5e8CIWIWZE X-Received: by 2002:a02:cb05:: with SMTP id j5mr3344366jap.94.1629981112855; Thu, 26 Aug 2021 05:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629981112; cv=none; d=google.com; s=arc-20160816; b=RyhXSzU/ALZtP6SnpXIbF70ck0ysr/weBFfMpnIxYCzdtyhqhd2CcFmz0UKJnt7kCf 8OEB//SmeHrfrwJmJh+gCx+3gDk84zGSbxqXjXJtVk5cnBKF1IJy6ghZBZSav0AA28XT 9I0Q83TA9Qftnf5QsQIfzQ0xZo4BFAfIo1rZM5b0djKFcOiM5yOJ82KUfjO7IPSQ3qX3 4E06cxqKnfP3zzp/p0bCjMHHRJ1IZZhCuBhoxJLJb4fPTwKLvHR2AzFymBS4HuCG1h9X 2+5fXYjnAbIEmv9Ph9YvVvF0pW1q8Nv/AV1q1YDinhxAUjm+RpDsaOenOQaCDELGSXBu FiNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=phwK6HApLhy3x/6hExSzTZ7ylEqvksp6SGMj/MzgDCA=; b=DBH/RE31WX5Smx3ZzWnoRcNgmahtnhjxrtkkIgP29+nrkZhFi6bUi2dfRoXBNuRt1h g9MQgmVL+AWTdlL2257uvcv54VhSnEouZSpbeFKkrGFv7YHYq6TuHm5cRofOWI/LC0Ki +upnXzXND6FUXu54hEaF/VVXbIvEZt0P4uboisrFPsBFSYeltWOgpIs6ZcmApHJqTOle UWl20X9b2MElcFLXGaNFKQuk5NswyU6Dpj9kPTV+CHrqfUGC8UXNFDFOGirnQP1Ie7A1 ARmSvyRPIPPBqcbe+iV6Y3aoUY4NJSprlCdV9huYbRB8ubLZBHhx/K5+DWbuMvr9oouB hnLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tzP45EWP; 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 t11si2566792jal.119.2021.08.26.05.31.39; Thu, 26 Aug 2021 05:31:52 -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=tzP45EWP; 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 S240894AbhHZMba (ORCPT + 99 others); Thu, 26 Aug 2021 08:31:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240725AbhHZMb3 (ORCPT ); Thu, 26 Aug 2021 08:31:29 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D770CC0613CF for ; Thu, 26 Aug 2021 05:30:41 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id f2so4846843ljn.1 for ; Thu, 26 Aug 2021 05:30:41 -0700 (PDT) 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=phwK6HApLhy3x/6hExSzTZ7ylEqvksp6SGMj/MzgDCA=; b=tzP45EWP9X1pw46yUJS9KMtpNLka8QQPWnUvXAqr2pvOJwQVd2+4wPYsOMIQhbF2Ha jvM0cW+7Mby5WK+nZMt1RqnIB31Tb34UM6fFs0cDUKdRSA8qeTBY8WEfha1BSQ6i3Yis Ny5dzlAm61y9JIcRNV2v6ar5JnWmpQRGTTFbKItrD4h3/tBYcMMHVNtfJI6C9muVObBU P6rMrnvHJsyL/lcIQWlIu2jYwPHtIDoFmZ1E6cU0leR69asJhRRTvygvFWzorAtNwEPu nvuoCPduYHp9FdqlibZPrKJhnQdL4ijNy1dNWtffktOuO4bLNWvtXbv63C8IwNvEeBvw ub2A== 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=phwK6HApLhy3x/6hExSzTZ7ylEqvksp6SGMj/MzgDCA=; b=LLofB5oep42asxKdyYA2nGv2/ijXmIKDUF5bOinQAre8vOIgH1sF/gYMBe9wwDgcuL jUrUYDkIcBnkqzW2hGTRP8uRrqwzAhiJuxfdWDxpEhT4poBGFet/NiRG/0A+LiNoiIAe e3bhn9j1foMcyXbEpeXTmnLm7islPebhEnCgUGWf8+jv7t5whVQdwy5gbG6VRFe87eVt NT2iJhGbg+xC7H4WN+y2J79XnLZTh+vbcjOghOlIphhNgjJpEImn56Qw/egigybydbl5 YGTYkgVxE0bZUVWBHgug6p0VEvqAaDesbZqX1eJJyCJ9075ZoPxdgtx/xz7oX1CsgJXE 3vrw== X-Gm-Message-State: AOAM533gyJiYdWZ8aakKK9VIQIPykiQ6WECgzlQBBQ7J6EQ9LivBldVq ZHIuaPbVcwYF6o/qjzlhrlBbD+w9DMQFBQ== X-Received: by 2002:a2e:a595:: with SMTP id m21mr2790949ljp.399.1629981040078; Thu, 26 Aug 2021 05:30:40 -0700 (PDT) Received: from jade.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id j21sm332283ljh.87.2021.08.26.05.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 05:30:39 -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 v5 0/6] Asynchronous notifications from secure world Date: Thu, 26 Aug 2021 14:30:26 +0200 Message-Id: <20210826123032.1732926-1-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 edge-triggered interrupt is used to notify the driver that there are asynchronous notifications pending. The documentation and DT bindings patches are now well reviewed, but the patches with code would do with some more attention. v4->v5: * Rebased on v5.14-rc7 * Updated documentation to clarify that one interrupt may represent multiple notifications as requested. * Applied Marc's and Rob's tags v3->v4: * Clarfied the expected type of interrypt is edge-triggered, both in the normal documentation and in the DT bindings as requested. v2->v3: * Rebased on v5.14-rc2 which made the patch "dt-bindings: arm: Convert optee binding to json-schema" from the V2 patch set obsolete. * Applied Ard's Acked-by on "optee: add asynchronous notifications" v1->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 (6): docs: staging/tee.rst: add a section on OP-TEE notifications 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 .../arm/firmware/linaro,optee-tz.yaml | 7 + Documentation/staging/tee.rst | 30 +++ 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 +++ 13 files changed, 529 insertions(+), 124 deletions(-) create mode 100644 drivers/tee/optee/notif.c -- 2.31.1