From patchwork Thu Aug 31 20:09:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9932793 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 E9E4960362 for ; Thu, 31 Aug 2017 20:12:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE8671FEB1 for ; Thu, 31 Aug 2017 20:12:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D17661FF1D; Thu, 31 Aug 2017 20:12: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.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 29B9E1FEB1 for ; Thu, 31 Aug 2017 20:12:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnVnH-0000Fn-9Q; Thu, 31 Aug 2017 20:10:27 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnVnG-0000EQ-AF for xen-devel@lists.xen.org; Thu, 31 Aug 2017 20:10:26 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id 21/23-02225-13D68A95; Thu, 31 Aug 2017 20:10:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNKsWRWlGSWpSXmKPExsWikc1kqGuQuyL S4P8FXYslHxezODB6HN39mymAMYo1My8pvyKBNePhtKMsBQ+UKs78+sDcwPhauouRi4NFoJFZ 4u+n5YxdjJwcjAIxEpu2dDKCJIQE+pgkvr7dzNzFyAHkJEvM2KUHUsMmYCKxbv55dhBbREBa4 trny2D1zAKnmSV2bz/DDJIQFrCVmPiqE2woi4CqxI2Nl9hA5vAKeEm8nqQIEpYQkJO4ea4TbD yngLdE18JgkLAQUMXEeZPZQGxeAUGJkzOfsIDYzAISEgdfvGCGaFWUmLppPRvIWgmByYwSz95 MYYJoVpfY+/sNVJGsxNGzc1ggbF+JqU+WsEM0XGWSaHi6jwXCaWaX6Om4CNWhI7F4xxEoezK7 xKLLjBC2l8SKWYeg7AKJqUfvM0M032CVWN38FmqFjMTDl+uYIOwjrBLTD1tDnJQg8e7/byaIh jW8ErOPzGGFcDrZJT4fvsk+gVFtFpJnZyF5dgEj0ypGjeLUorLUIl0jQ72kosz0jJLcxMwcXU MDY73c1OLixPTUnMSkYr3k/NxNjMCEUM/AwLiDsWev3yFGSQ4mJVHeav8VkUJ8SfkplRmJxRn xRaU5qcWHGGU4OJQkeG1zgHKCRanpqRVpmTnA1ASTluDgURLhXZkNlOYtLkjMLc5Mh0idYtTl uDd76xcmIZa8/LxUKXHenyBFAiBFGaV5cCNgafISo6yUMC8jAwODEE9BalFuZgmq/CtGcQ5GJ WGIS3gy80rgNr0COoIJ6IhYr6UgR5QkIqSkGhjXz2265z37//bre8W0dr899vhtSn8/00nWy8 GK1YnrbKexakRPmTD7Ubj2pC1iy51bZuw8Iipz7OoGrcP73Y2LD3NdncOV56LpmnwxUNKpPKD P5fJbszeSU043FjL89XXMO9kknahceHXSdO6qP6W5k2X6a6peP8nwt53qypKsxhI1/47RhxNK LMUZiYZazEXFiQCUpawVjgMAAA== X-Env-Sender: Volodymyr_Babchuk@epam.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1504210224!112408791!1 X-Originating-IP: [40.107.2.49] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 63350 invoked from network); 31 Aug 2017 20:10:24 -0000 Received: from mail-eopbgr20049.outbound.protection.outlook.com (HELO EUR02-VE1-obe.outbound.protection.outlook.com) (40.107.2.49) by server-14.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 31 Aug 2017 20:10:24 -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=jMR1E8Epx4A7Ag3IZcJA9xZoMeeOjJ8CZ0n2qmo0QkQ=; b=XGa0gfYLtQYVEzD/jciQFgPgRjjLJg5PmPGDWYq06WHc4sxtQZU3C1OqFwPCXO6oQ5ZRWtRh254m4VsKEL8bJAHHRiUh5t0/Vnm6psp5DwAokZ02oQZ+RQKTgW/fCvEAH3P5MUe3Zak9Q5YT++yPpAXDG0+09OLPZASmKwiSfYY= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.51) by HE1PR0301MB2137.eurprd03.prod.outlook.com (2603:10a6:3:21::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Thu, 31 Aug 2017 20:10:19 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Thu, 31 Aug 2017 23:10:15 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Thu, 31 Aug 2017 23:09:27 +0300 Message-Id: <1504210172-27234-6-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504210172-27234-1-git-send-email-volodymyr_babchuk@epam.com> References: <1504210172-27234-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.51] X-ClientProxiedBy: DB6PR02CA0014.eurprd02.prod.outlook.com (2603:10a6:6:15::27) To HE1PR0301MB2137.eurprd03.prod.outlook.com (2603:10a6:3:21::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7b55be1d-c86c-4ddc-69cd-08d4f0ac4eb5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HE1PR0301MB2137; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2137; 3:ioLM7kys71IhgDtru54coWmtUXfpTgQdCCxrIjLPnQWo8P7k55xNaZjhpsljnqCNakzBjTnmtu2jqMslK6IKxhsxbTlqAi8rOUex3Vlqhu9OK/OenHMgCsjSwitzQinhcm1YM77+MTLZvNvCc0GvTBTgccD9BMXlsLAIxlZ6Cmfwqi9eK7e/LA8iuZGOTfqMDxhPOYLxYnQ+ZRjRZlMXf8fEFAHomsEsnAWzZEe7VGjPU3T5uENGd586g44lROfq; 25:iE/8TpafDMu5nYK86pXhkeOz2gVAl1lalmyvbmNLxnmAJv01OOSJKpmp4WqAce+J+S7KeUz9wvdbOtqAcZ3Rg+lTl0sOL3hgYPlZyyh/6GMCKGRl54gQitkAkCAcurGhcs+YYVgoZFiHU7IBQ/U/dRMhRgfynLctLea6G6rqtFD6XWlQGIpKHwqlI26IH4ROk7DOxPlpo0mpr8KKz9BTwAokcj4yRfvl/9ZYKbUG17dTjxr4BgBpHVszHrcvIz4GYcTV1sHIMaiBMZhxhyOI4J+KURX3l2mW4mMf71t5BqP32P0AbY9/ahKn8Q99dD4maHmAJBFU8xP4cy7DgnZ22w==; 31:Gpw3sOx78aLRSIbi8Crgm/6oHRdmVkKhKVZ7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wU8cA0k9Y0vJ8FoE7rN9JUHVD2XiqhEitQQIpIdgVISMQ== X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(4114951738403); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0301MB2137; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0301MB2137; X-Forefront-PRVS: 04163EF38A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(199003)(189002)(2906002)(101416001)(305945005)(7416002)(110136004)(76176999)(50986999)(48376002)(8676002)(8656003)(81166006)(81156014)(50466002)(2351001)(36756003)(2361001)(72206003)(106356001)(105586002)(2950100002)(189998001)(5003940100001)(6916009)(966005)(47776003)(33646002)(5660300001)(6666003)(347745004)(478600001)(4326008)(50226002)(6116002)(3846002)(7350300001)(122856001)(97736004)(80792005)(7736002)(42186005)(68736007)(66066001)(8666007)(6306002)(53936002)(86362001)(54906002)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0301MB2137; 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; HE1PR0301MB2137; 23:DbBPVRmdmw9xKx9AVPZwI6/YoI570lQCC6pskdu?= =?us-ascii?Q?lmH42Axk5w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ppQtJ8=; 7:IF6TfdDU6nuRh7vBPU0HeBO8KC+JGhml5ggeCDUuFfedYemEGqJiuZ4xtLO6TpePu83/qfUFCoL9md88C02PraGcwEJO0FSRVCfhc23Y0R70JpEsaCV+lZYgCNVsdwUuG7CVickeMMiyTVJt46T6J+7icR4i4nDUCyr2O4nVViJTNFtfQh71X3jPBNbNbS6XlfN0QyOBuRYpUUAGii1UgzuyettobkcxJy5FSLeKaQw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 20:10:19.7103 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0301MB2137 Cc: "Edgar E . Iglesias" , Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v5 05/10] arm: add SMCCC protocol definitions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch adds generic definitions used in ARM SMC call convention. Those definitions was taken from linux header arm-smccc.h, extended and formatted according to XEN coding style. Some of the macros were converted to inlined functions to ease parsing. They can be used by both SMCCC clients (like PSCI) and by SMCCC servers (like vPSCI or upcoming generic SMCCC handler). Signed-off-by: Volodymyr Babchuk --- * Accessor macros were converted to inlined functions * ARM_SMCCC_SMC_{32,64} renamed to ARM_SMCCC_CONV_{32,64} * Fixed indentation for ARM_SMCCC_CALL_VAL --- xen/include/asm-arm/smccc.h | 105 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 xen/include/asm-arm/smccc.h diff --git a/xen/include/asm-arm/smccc.h b/xen/include/asm-arm/smccc.h new file mode 100644 index 0000000..f543dea --- /dev/null +++ b/xen/include/asm-arm/smccc.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2015, Linaro Limited + * Copyright (c) 2017, EPAM Systems + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __ASM_ARM_SMCCC_H__ +#define __ASM_ARM_SMCCC_H__ + +/* + * This file provides common defines for ARM SMC Calling Convention as + * specified in + * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html + */ + +#define ARM_SMCCC_STD_CALL 0U +#define ARM_SMCCC_FAST_CALL 1U +#define ARM_SMCCC_TYPE_SHIFT 31 + +#define ARM_SMCCC_CONV_32 0U +#define ARM_SMCCC_CONV_64 1U +#define ARM_SMCCC_CONV_SHIFT 30 + +#define ARM_SMCCC_OWNER_MASK 0x3FU +#define ARM_SMCCC_OWNER_SHIFT 24 + +#define ARM_SMCCC_FUNC_MASK 0xFFFFU + +/* Check if this is fast call. */ +static inline bool smccc_is_fast_call(register_t funcid) +{ + return funcid & (ARM_SMCCC_FAST_CALL << ARM_SMCCC_TYPE_SHIFT); +} + +/* Chek if this is 64-bit call. */ +static inline bool smccc_is_conv_64(register_t funcid) +{ + return funcid & (ARM_SMCCC_CONV_64 << ARM_SMCCC_CONV_SHIFT); +} + +/* Get function number from function identifier. */ +static inline uint32_t smccc_get_fn(register_t funcid) +{ + return funcid & ARM_SMCCC_FUNC_MASK; +} + +/* Get service owner number from function identifier. */ +static inline uint32_t smccc_get_owner(register_t funcid) +{ + return (funcid >> ARM_SMCCC_OWNER_SHIFT) & ARM_SMCCC_OWNER_MASK; +} + +/* + * Construct function identifier from call type (fast or standard), + * calling convention (32 or 64 bit), service owner and function number. + */ +#define ARM_SMCCC_CALL_VAL(type, calling_convention, owner, func_num) \ + (((type) << ARM_SMCCC_TYPE_SHIFT) | \ + ((calling_convention) << ARM_SMCCC_CONV_SHIFT) | \ + (((owner) & ARM_SMCCC_OWNER_MASK) << ARM_SMCCC_OWNER_SHIFT) | \ + (func_num)) + +/* List of known service owners */ +#define ARM_SMCCC_OWNER_ARCH 0 +#define ARM_SMCCC_OWNER_CPU 1 +#define ARM_SMCCC_OWNER_SIP 2 +#define ARM_SMCCC_OWNER_OEM 3 +#define ARM_SMCCC_OWNER_STANDARD 4 +#define ARM_SMCCC_OWNER_HYPERVISOR 5 +#define ARM_SMCCC_OWNER_TRUSTED_APP 48 +#define ARM_SMCCC_OWNER_TRUSTED_APP_END 49 +#define ARM_SMCCC_OWNER_TRUSTED_OS 50 +#define ARM_SMCCC_OWNER_TRUSTED_OS_END 63 + +/* List of generic function numbers */ +#define ARM_SMCCC_FUNC_CALL_COUNT 0xFF00 +#define ARM_SMCCC_FUNC_CALL_UID 0xFF01 +#define ARM_SMCCC_FUNC_CALL_REVISION 0xFF03 + +/* Only one error code defined in SMCCC */ +#define ARM_SMCCC_ERR_UNKNOWN_FUNCTION (-1) + +/* SMCCC function identifier range which is reserved for existing APIs */ +#define ARM_SMCCC_RESERVED_RANGE_START 0x0 +#define ARM_SMCCC_RESERVED_RANGE_END 0x0100FFFF + +#endif /* __ASM_ARM_SMCCC_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End:b + */