From patchwork Wed Nov 29 12:48:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 10082081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC04C6020B for ; Wed, 29 Nov 2017 12:52:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF4D629759 for ; Wed, 29 Nov 2017 12:52:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C45DF2976C; Wed, 29 Nov 2017 12:52:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3217D29759 for ; Wed, 29 Nov 2017 12:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nAGsRdt8UnLyHP/hLFvpRAiCwXxr1POKJf3q5WkcDmk=; b=pLPwRjeWISh5pp 8b1/MECWIVMKRRVQg/Ha3qn+Vh2+zDCNfEOZ6ygwyi+qKSH9I4zq5Z0/scmXWgL6k3+DoTrELbSpw GLr6H86wowZTS+vQWc17CErTlQNMJqWayFZ2CsetpOPGfGFaCPRUOVmqfMhlQdBTM1bM7iMDOb0kA LRBlC98c06m1O7Zszcai3GbeyLThi44M1qJs3O9X924omDZHFPNV2aqVILNb2pKaFHW0mAlXekTjm aHvMbYmTnLl54H/ZHktXa51AJuMJj/epNwHzR+PMtrI3n1PHCXs3j7eOYH17vvMGRtkB23gsrQsTI cB2SexZFmrZkxDWpVO8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eK1qt-0007IW-BT; Wed, 29 Nov 2017 12:52:35 +0000 Received: from mail-he1eur01on0071.outbound.protection.outlook.com ([104.47.0.71] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eK1oJ-0004F8-2e for linux-arm-kernel@lists.infradead.org; Wed, 29 Nov 2017 12:50:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5z5VJsrEfsr4/Bt+mFRHVF398eSnFSmtujNX90XtaQI=; b=DV1HkH7p24j3mDGhr/SLJpLxy3tnd3vhqHsET+AbPIsCk0KemEOvVkXbao23gOjuaJCMQTf6xuDMvDKi68fZeiRoovCLFPhtI7nmgXRiCaiF3eiCkjpuxxG0ZBAs2cPbE90dr9J0DxL7I7YeApiJod4LN4USftY7zfTrgb4+Q50= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Volodymyr_Babchuk@epam.com; Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.56) by DB5PR03MB1766.eurprd03.prod.outlook.com (2a01:111:e400:c580::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Wed, 29 Nov 2017 12:49:31 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Wed, 29 Nov 2017 14:49:28 +0200 From: Volodymyr Babchuk To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org, Jens Wiklander Subject: [RESEND PATCH v2 07/14] tee: optee: add shared buffer registration functions Date: Wed, 29 Nov 2017 14:48:31 +0200 Message-Id: <1511959718-5421-8-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511959718-5421-1-git-send-email-volodymyr_babchuk@epam.com> References: <1507923164-12796-1-git-send-email-volodymyr_babchuk@epam.com> <1511959718-5421-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.56] X-ClientProxiedBy: AM0PR0102CA0054.eurprd01.prod.exchangelabs.com (2603:10a6:208::31) To DB5PR03MB1766.eurprd03.prod.outlook.com (2a01:111:e400:c580::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4588f8b8-450c-4fe4-07df-08d53727a2ff X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:DB5PR03MB1766; X-Microsoft-Exchange-Diagnostics: 1; DB5PR03MB1766; 3:qDu2OWjHYfIQ8SZQxisDkYaDNOcUuMXElpwvqSOLuigPsDD3WEm1L9Lhpx7xJlI6SbTyCZOL74pQ7OO8HsQqyaf80kYQT9mtDtrO0yHreNVouC2aMELsYFkvYt/F+BBumBLjcaay7FKpOwsKahNuaEDVpFM6VDX1Rr7Q9mjueZEP/5zykJP1ZfcIK/dzlhRh5FLlBlUrUo41IzFUv4LU1oB1bd4hN0JOBt0WDyUX9Hc0lWIrnP36Vl5xL4n6mjrQ; 25:kaZYtnxOxTm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ac+r0oguus8EtCzBVs3XXPm9P7MADvtvmM35ZrEvQGLGzTcO8zeG4D1LoUKS12itK86UNeUGR15U2x4WowDDuYDEOLT; 4:Hc5FNYWLPUyJs612n0WO+7lHdAEMkSaNgpFfxwskEbVt85pdh7pfDmCR3YQAWtCNU/Y8Cfbqk5aaOaWMhpYf4402Tmn6qsR1L/MI4ygAgQdI/+Q+ih+n1FnUzW3/lSXNBxtePybefH7plvBgsLfGbO8in0pjmNmY7c7VXGeeE8jh1BFzSVyPWQAG5FsEZZCeJ6IscW7Ze1XlcbpDXeypIQw4hC8RHErmTPrfgTh0B1ETe+g5NhkzhV1of+hF75TdidmefkjFLPgzPwkpYaWKiw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(3231022)(93006095)(93001095)(10201501046)(6041248)(20161123564025)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB5PR03MB1766; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DB5PR03MB1766; X-Forefront-PRVS: 05066DEDBB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6009001)(366004)(346002)(376002)(199003)(189002)(51416003)(80792005)(36756003)(50466002)(106356001)(33646002)(50986999)(105586002)(76176999)(39060400002)(72206003)(478600001)(107886003)(52116002)(4326008)(66066001)(55236003)(101416001)(53936002)(122856001)(16586007)(316002)(42186006)(48376002)(47776003)(8936002)(5660300001)(6666003)(6916009)(2950100002)(189998001)(6116002)(2906002)(3846002)(68736007)(50226002)(8676002)(7736002)(305945005)(97736004)(86362001)(81156014)(81166006)(217873001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR03MB1766; H:EPUAKYIW2556.kyiv.epam.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: epam.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB5PR03MB1766; 23:RArZO/EwnjRJMKnD5O2R0mYkNPckXF6w/8nkHTCCO?= =?us-ascii?Q?1gfrZLhuDqw1vVyd9m0Z1yia1L/PSif+NNI6YibS3AMm8yFi6lU4VOEQCaMd?= =?us-ascii?Q?IBvaO7Xv0VYv44CnsWvbjy0dxSCY651SJAtH4ABmwX5fqRPIkw5MUZmeoqQU?= =?us-ascii?Q?FFO9KtXVuzQxXuo5hmKoPZAL8LRSik8yJU9VTJ1Q4JyHi1MeUFKjk1Ewf22s?= =?us-ascii?Q?dPA7PLeyYRd3lr4YPPy6U3h4l3pibM1S5u2bI3s/nq1gwEiSzjlRAebunKsD?= =?us-ascii?Q?yDoopqjfa3tQSHvwnTLrxGEiKoyyZZimCXATGqk8R3sLj40iAmeLEoEipk+H?= =?us-ascii?Q?x1Rg2u8yoI9I02o8f3+lKJVTw9zLE1NAy7ZDFlWS2vU67wMr2HNx/Qdhyo/u?= =?us-ascii?Q?Ak3cWsAuZGxe1wVWI5EEw73/+F2iNe8xxBcFlD+B+A8Viz20opjxjAKTYM2t?= =?us-ascii?Q?4lKhrpeUScTFN9jZzrPUd1w+0S4A5VWAeqh6wrk6vsThONPIxPjMFQwWMItR?= =?us-ascii?Q?7f+7tjhvNcfLE0XcTu3NjY8wpHEJpUKe2FyvKA9rIH9lFCD48Je0ZCsZ3ORB?= =?us-ascii?Q?OHgASwX5b4Sg6GtpgcD1llvxh7IPcHGirEbiIwvrRbRXf+t1nynDN1dbHZeY?= =?us-ascii?Q?0EPPtbFr/DcdPGIfoSK1EBFQpE1LgacLyAD5kaifTzpP4AEjpUnt13Gzbcrz?= =?us-ascii?Q?OdkKQHbhZgndKYpFdsHo3VKW35U3ty1uULLEfvLRKZLVLnHGnzUvrsy/F98G?= =?us-ascii?Q?0Q4oQMuxtUyG5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oaV5fiitFj255sTV06P1ibHdjDgKiDBaDYseoSwC9Zua9IH/QZvsiSumTNjxTr2Zch53yf2vjaXE5jdXff91a/AIWbbN6ke5DAjwjTU+8/ColekopGlgaFJ95///8u4=; 24:btFY2pXrvvmUXUWnL9foHeOPMpAFiQ5eQSAAQb3ii/WWUlmTLQM4Ciq+ku8rgPUblEus14QUz2rwuT3/bn+wiApjj1eS7SuOd0AZYV4F7aE=; 7:b0I0o9yu6wQGnPVNmqvarUhjzH4f/k/ONy5+IALvLrOaN2SUxFTBQeth0+xvd/ytaz0d5ZWRPUR8ko+6slW2k211tzs0RFJZA4UccKjTqaadacuVYN4GrZc67Uo8pR3zvZSZfi19UciRJ/EAavF0FfkUUdKACb48J2tNMlDjTgiqOO4zaR47P/A7+43AEr6AoYYxgXtM9ta4oIJILs12GRlvZ3TV0v9M/qG8a1Cz5YSCyMKwVmtxPmHc1q6xLwbe SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2017 12:49:31.5199 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4588f8b8-450c-4fe4-07df-08d53727a2ff X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR03MB1766 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_044955_631482_1AF32D12 X-CRM114-Status: GOOD ( 13.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Volodymyr Babchuk , volodymyr_babchuk@epam.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Volodymyr Babchuk This change adds ops for shm_(un)register functions in tee interface. Client application can use these functions to (un)register an own shared buffer in OP-TEE address space. This allows zero copy data sharing between Normal and Secure Worlds. Please note that while those functions were added to optee code, it does not report to userspace that those functions are available. OP-TEE code does not set TEE_GEN_CAP_REG_MEM flag. This flag will be enabled only after all other features of dynamic shared memory will be implemented in subsequent patches. Of course user can ignore presence of TEE_GEN_CAP_REG_MEM flag and try do call those functions. This is okay, driver will register shared buffer in OP-TEE, but any attempts to use this shared buffer will fail. Signed-off-by: Volodymyr Babchuk --- drivers/tee/optee/call.c | 69 +++++++++++++++++++++++++++++++++++++++ drivers/tee/optee/core.c | 2 ++ drivers/tee/optee/optee_private.h | 4 +++ 3 files changed, 75 insertions(+) diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c index 4db52fe..89116a0 100644 --- a/drivers/tee/optee/call.c +++ b/drivers/tee/optee/call.c @@ -533,3 +533,72 @@ void optee_free_pages_list(void *list, size_t num_entries) free_pages_exact(list, get_pages_list_size(num_entries)); } +int optee_shm_register(struct tee_context *ctx, struct tee_shm *shm, + struct page **pages, size_t num_pages) +{ + struct tee_shm *shm_arg = NULL; + struct optee_msg_arg *msg_arg; + u64 *pages_list; + phys_addr_t msg_parg; + int rc = 0; + + if (!num_pages) + return -EINVAL; + + pages_list = optee_allocate_pages_list(num_pages); + if (!pages_list) + return -ENOMEM; + + shm_arg = get_msg_arg(ctx, 1, &msg_arg, &msg_parg); + if (IS_ERR(shm_arg)) { + rc = PTR_ERR(shm_arg); + goto out; + } + + optee_fill_pages_list(pages_list, pages, num_pages, + tee_shm_get_page_offset(shm)); + + msg_arg->cmd = OPTEE_MSG_CMD_REGISTER_SHM; + msg_arg->params->attr = OPTEE_MSG_ATTR_TYPE_TMEM_OUTPUT | + OPTEE_MSG_ATTR_NONCONTIG; + msg_arg->params->u.tmem.shm_ref = (unsigned long)shm; + msg_arg->params->u.tmem.size = tee_shm_get_size(shm); + /* + * In the least bits of msg_arg->params->u.tmem.buf_ptr we + * store buffer offset from 4k page, as described in OP-TEE ABI. + */ + msg_arg->params->u.tmem.buf_ptr = virt_to_phys(pages_list) | + (tee_shm_get_page_offset(shm) & (OPTEE_MSG_NONCONTIG_PAGE_SIZE - 1)); + + if (optee_do_call_with_arg(ctx, msg_parg) || + msg_arg->ret != TEEC_SUCCESS) + rc = -EINVAL; + + tee_shm_free(shm_arg); +out: + optee_free_pages_list(pages_list, num_pages); + return rc; +} + +int optee_shm_unregister(struct tee_context *ctx, struct tee_shm *shm) +{ + struct tee_shm *shm_arg; + struct optee_msg_arg *msg_arg; + phys_addr_t msg_parg; + int rc = 0; + + shm_arg = get_msg_arg(ctx, 1, &msg_arg, &msg_parg); + if (IS_ERR(shm_arg)) + return PTR_ERR(shm_arg); + + msg_arg->cmd = OPTEE_MSG_CMD_UNREGISTER_SHM; + + msg_arg->params[0].attr = OPTEE_MSG_ATTR_TYPE_RMEM_INPUT; + msg_arg->params[0].u.rmem.shm_ref = (unsigned long)shm; + + if (optee_do_call_with_arg(ctx, msg_parg) || + msg_arg->ret != TEEC_SUCCESS) + rc = -EINVAL; + tee_shm_free(shm_arg); + return rc; +} diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 7952357..4d448bf 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -267,6 +267,8 @@ static const struct tee_driver_ops optee_ops = { .close_session = optee_close_session, .invoke_func = optee_invoke_func, .cancel_req = optee_cancel_req, + .shm_register = optee_shm_register, + .shm_unregister = optee_shm_unregister, }; static const struct tee_desc optee_desc = { diff --git a/drivers/tee/optee/optee_private.h b/drivers/tee/optee/optee_private.h index b63213d..d7bc77d 100644 --- a/drivers/tee/optee/optee_private.h +++ b/drivers/tee/optee/optee_private.h @@ -160,6 +160,10 @@ int optee_cancel_req(struct tee_context *ctx, u32 cancel_id, u32 session); void optee_enable_shm_cache(struct optee *optee); void optee_disable_shm_cache(struct optee *optee); +int optee_shm_register(struct tee_context *ctx, struct tee_shm *shm, + struct page **pages, size_t num_pages); +int optee_shm_unregister(struct tee_context *ctx, struct tee_shm *shm); + int optee_from_msg_param(struct tee_param *params, size_t num_params, const struct optee_msg_param *msg_params); int optee_to_msg_param(struct optee_msg_param *msg_params, size_t num_params,