From patchwork Fri Oct 13 19:32:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 10005769 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 C6A44602B3 for ; Fri, 13 Oct 2017 19:35:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B92152913F for ; Fri, 13 Oct 2017 19:35:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC90629148; Fri, 13 Oct 2017 19:35:31 +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=ham 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 62D942913F for ; Fri, 13 Oct 2017 19:35:31 +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=639NAzfOs5UsciIAZmeak3m542hA9Ss51sroeIVeygw=; b=QOIxwDbYIQe52M 8+VLGdOF2nGk+JVEQh0TTk/ThOH4uFnK43ZwHjsH+GVXQC24fJdvc3iapfv3oiDEE+Nd+1G6U8yTp bVzsO5FNPJluOuKYV7CPo9ZLdEcY5LrQHgcPJ3TgV0Ci7SdWPR6ZWDnR269gVAIW7bcDP8+QhWIMI w2N9HLCG7yU53cysuVfGSP2+T+hzUBvJD4MzJ5HWDpyXDfJJ2sJU9YBZ83QiDgRKCvIhNzesjIH/y 2D9oe/q3vPfDHquQ0g+bBNeBzaAvwVCEC9nMNM1WSnMZBbPy3dV7sMv4ROItE5/BL37ZskT040Vkq NuehbrScvkzgdOu2EIiA==; 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 1e35jg-0008It-B7; Fri, 13 Oct 2017 19:35:08 +0000 Received: from mail-am5eur02on060b.outbound.protection.outlook.com ([2a01:111:f400:fe07::60b] helo=EUR02-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e35iN-0006mn-22 for linux-arm-kernel@lists.infradead.org; Fri, 13 Oct 2017 19:33:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=EPAM.onmicrosoft.com; s=selector1-epam-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QMbX6CBw2MXVPF3hUPNIGlGkIP8pWT77YzJInpsqJVo=; b=kMfNjyBrF6Is4HJNU7DOz9frnQg+pyoMvx3ztGQMxdO6FMICTw7WtZALrJ9WnuA4Yml6Qlu7SqqUucGxlMgJlZNdEQ5FP4i+1yetSm2AoKdcKs6M2+mzdVZy2payTLqkIYrngSRZUiVHfUfwkjUGrF85ACdUcv8oRo/RhVHi5so= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.52) by HE1PR0301MB2140.eurprd03.prod.outlook.com (2603:10a6:3:21::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 13 Oct 2017 19:33:21 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Fri, 13 Oct 2017 22:33:16 +0300 From: Volodymyr Babchuk To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org, Jens Wiklander Subject: [PATCH v1 03/14] tee: shm: add accessors for buffer size and page offset Date: Fri, 13 Oct 2017 22:32:33 +0300 Message-Id: <1507923164-12796-4-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507923164-12796-1-git-send-email-volodymyr_babchuk@epam.com> References: <1506621851-6929-1-git-send-email-volodymyr_babchuk@epam.com> <1507923164-12796-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.52] X-ClientProxiedBy: LO2P265CA0060.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:60::24) To HE1PR0301MB2140.eurprd03.prod.outlook.com (2603:10a6:3:21::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d328848b-50fa-419a-aa64-08d5127143a5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:HE1PR0301MB2140; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2140; 3:v+XFWYcpWNJGmNrHx1AlRGPaFSbxNUPXt/l95+jVpeUaD6/QuSJORFnEJwYXydhlH+FHFFs6y3ouVP/kHPUB6zglR8ynKO5GTUuxyRFIbBlWu9bl0y4kgohpFflChc0bkeMcWWh9YWuZvUH66qCtJ63ane9u0JmDHT5YHo/I+qN3mGTPXkGu3UHWaG3OP4EnQ8z+gilyc03zgQMqAMgyUL36EmQQE5QMv+SAxp5452/X4ntb153+H2sDtcFIzO8X; 25:4oHilsBABIApr+23YoMzwsaihkh8l5Twfz8MWyJKfcInLEmcoqV7/NsxSKx6e4Eug4Rrxpni+T/fpT8LE1qAcsD0no6XSUgMYR7eANodnwf3yQD9ZnFpyPxcwbsy5a0xzrygKqeb9ekg7RKTqnxQPws+qaKeIliSOJW+6RiL5Rp9lp/Us+Tw4lsQ8pfuKlmatYQzAu5Vm5kvVC3FWFcRhTx1IuvgvxNV+DZN4nFlVRAqn89X1/Ud45idTXVnaVIZ1aJx7gXg9QBicHlsCi3TaXQH8M+FdhC0ItcWSj61g3+FEtPoIjVaN583625IJg3vKAi2W6Hbi55mYgio+m54Aw==; 31:78he4Lu5hwxkUidabbQjixBUz2nB9G22rR7aUSQHLr93226mk9YB/xbabgLJM4NTfRqAm6fTf4WE/CTCYN3eXedFUGILB3r8bOW8jp8/J+IjbOTVUVjP9A48SJWgsJ5FlR2CIzHNZ3/Q0wFLuZjeLSbS3mwkaYavuH6JPH4tv0GdqMXRk4FqbuimwzS7PiCcZdNiNMm/PSUZHXf/b3cw9QJDkphx+4h2RHCLRT7YJYA= X-MS-TrafficTypeDiagnostic: HE1PR0301MB2140: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Volodymyr_Babchuk@epam.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2140; 20:fdnWCZ6O+hp2ubsNx5uX4gAGlK8QibDsWTpLzad49lhwKNfr4T20b6H0ELyCXpS7hbxA8j5kumEE/c0NxsHDPXb7t4tFkDABAU4vtosgqcSlnJ4TAiZXwuba/nU91qnnsqQWlh4nyKpKlLWz0117pnt70skCwWiQu1Vb57RllbO8FYIdMJ8Hm5wEL0oG5Hd2x+PFR1WtWrJRWtjYeXhSS4fofR1b9StSLpSDa4JCbW3cTl+RlqqGHC6iMDcreBerIMoCWQfNtuxRFF8P9+pvFPVDjqxk58CcnKZFF5ZPQQztfzfv6y9F2UniuxFngdBFv5827ozOPEqeUrEjpuL1dcko3Iezo5bCGF8a1sfLMjhsuD9rkNrnGC7w3YNPCrDHdSaQvAaJqpdx/2ImrkYul5SDs5SkaQbrQd7DfuPKGEmNd4PSE6HR3/fikW1udp6Qm0c/NSr8mcBdG3ZfBd+zT4tPfzC/wFYUMs5eDE752NxiruyGU7W7cl3mQZPL4lAy; 4:yDH5SxeoiDc0+l+zdnqlO2pUlDuTUBNVS1QI0c4smv0meqMOIbjOzJc+zzCG95YPHO2MlsXzZ1sfCOXso3rFyweGwPb50wNgVwhxKBrj9O1X2A/ha3VbCkD05GXjsucaCqfjAtRp4wSlAnxy80v4PrIpXz/dlFlBQrAm/AE/XA4r5zQjbIBDuIv3sCfJe2OmLK6oM9uKzZ/s4SBAtgZ/Htl7oJQ6fMatwbx3pKkCuN3jzur5Z2WBcx20uDXb6tbk X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6041248)(20161123560025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0301MB2140; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0301MB2140; X-Forefront-PRVS: 04599F3534 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(189002)(199003)(50226002)(6666003)(36756003)(33646002)(122856001)(53936002)(16586007)(80792005)(42186006)(6916009)(2950100002)(39060400002)(97736004)(5660300001)(8936002)(5003940100001)(86362001)(50466002)(48376002)(2906002)(72206003)(66066001)(478600001)(81166006)(81156014)(3846002)(7736002)(76176999)(101416001)(50986999)(4326008)(6116002)(305945005)(106356001)(47776003)(105586002)(316002)(107886003)(8676002)(189998001)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0301MB2140; H:EPUAKYIW2556.kyiv.epam.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; HE1PR0301MB2140; 23:1auJ4C+bDKT2jpHPyq+bb1BSykfXLLOXptstBSg?= =?us-ascii?Q?N3gCkcSYQMjKRimKNzInMe7MKsdaqhnd08okZd8PdTbn+vjBTuiVd+a2xGBY?= =?us-ascii?Q?xAhgD2uX6+jrPVWsU/0mGqYx04AGPqfZf3sZuBeoXBBekU/PuqmlcyxZKOY5?= =?us-ascii?Q?fVX+5MUXWrDUUYIg+mR6HN9UqyVY2TGs+6O2eX6f6LG9U0qbhFoBa1JnNzFl?= =?us-ascii?Q?UE6sBOjJkz8wwrrxBDprRkOLIhJJi39ixpehv1zomgRVXyRyc6lhbx9fVUk2?= =?us-ascii?Q?h6ngqKV2KSZJFWzyrnSB5HV34aanYKkZ59KIxPh3WAMKcOsSEVd+wsnUsW7W?= =?us-ascii?Q?ptgmlyfIZDuqBJbiT3a+wtB/1HZ/A2Z4XIrnvlNyx0sC+wy9GEsbg+JE0cPy?= =?us-ascii?Q?aphSwp4ezAFZdYFBoGXcmkGygzCF66ky+NrejhCC+qEwup5hP07/DvX6H6Si?= =?us-ascii?Q?pxsIOTOuGU5QUf/jxG7oFnll3/QZXClBxrCHIoT9cettzUw8uR7yqbeVQ/+S?= =?us-ascii?Q?wzGnT/DhC0DxuI8XpmWRMNi92TR7u4mgWfko91xMWViuTAMq//Bs+EHyDTzF?= =?us-ascii?Q?e4XLBos6NtS7j/hiRx0UJoaN7VKYyTlob8nvHP9boexJeRWwSPpjsnxYTTfj?= =?us-ascii?Q?N56CXpTeCzF/BjigPRSrLVj0awOl9TskCstrstNA0l3yxvn7rcIwFgKyszt8?= =?us-ascii?Q?pxXuqiQtXfuDqQ/Jz/HgRYAAI1aHw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/fr4up0PydLpTqQjRfXB0t5hpZBA3Okwl7zsU030ytaJhjX3rg/8x1M=; 7:oCpzfiv5myneWYjLupgYHD5qIAyXJrwiwvDbK+Wcq7uWKAop/1YvuSN9P3BYTsio+MzRdgy7rBGyb9g7IBE+77uIYrY3CdfNaTXy5p8ia4WOOwyA1PMji43/OM1Yla//+TRY06PZ4Jt93YKWkRxs46KAE7w7k+VD4SZvirs+4lHJqdy5ztS8e+p28hq7GmEKgQdAwzUqt5ZtlrjbZ+whUkDMeaubHjPLket7PyCZId0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2017 19:33:21.1765 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0301MB2140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171013_123348_035469_181928EB X-CRM114-Status: UNSURE ( 7.31 ) X-CRM114-Notice: Please train this message. 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 These two function will be needed for shared memory registration in OP-TEE Signed-off-by: Volodymyr Babchuk --- include/linux/tee_drv.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h index 70b9c73..0d7f2a5 100644 --- a/include/linux/tee_drv.h +++ b/include/linux/tee_drv.h @@ -384,6 +384,26 @@ void *tee_shm_get_va(struct tee_shm *shm, size_t offs); int tee_shm_get_pa(struct tee_shm *shm, size_t offs, phys_addr_t *pa); /** + * tee_shm_get_size() - Get size of shared memory buffer + * @shm: Shared memory handle + * @returns size of shared memory + */ +static inline size_t tee_shm_get_size(struct tee_shm *shm) +{ + return shm->size; +} + +/** + * tee_shm_get_page_offset() - Get shared buffer offset from page start + * @shm: Shared memory handle + * @returns page offset of shared buffer + */ +static inline size_t tee_shm_get_page_offset(struct tee_shm *shm) +{ + return shm->offset; +} + +/** * tee_shm_get_id() - Get id of a shared memory object * @shm: Shared memory handle * @returns id