From patchwork Tue Oct 10 15:52:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9996663 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 4113160216 for ; Tue, 10 Oct 2017 15:59:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3262128684 for ; Tue, 10 Oct 2017 15:59:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 271B228689; Tue, 10 Oct 2017 15:59:49 +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 92A3528684 for ; Tue, 10 Oct 2017 15:59:48 +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 1e1wuQ-0003Qb-Cr; Tue, 10 Oct 2017 15:57:30 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1wuO-0003Q0-VX for xen-devel@lists.xen.org; Tue, 10 Oct 2017 15:57:29 +0000 Received: from [193.109.254.147] by server-8.bemta-6.messagelabs.com id 2C/8D-13910-8EDECD95; Tue, 10 Oct 2017 15:57:28 +0000 X-Br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msg-Ref: server-15.tower-27.messagelabs.com!1507651046!58152930!1 X-Originating-IP: [40.107.5.73] X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6341 invoked from network); 10 Oct 2017 15:57:26 -0000 Received: from mail-eopbgr50073.outbound.protection.outlook.com (HELO EUR03-VE1-obe.outbound.protection.outlook.com) (40.107.5.73) by server-15.tower-27.messagelabs.com with AES256-SHA256 encrypted SMTP; 10 Oct 2017 15:57:26 -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=JcvHWhZdgxjgwph1h33FYDLVFkdyNdH3rHQ9zU1yHeM=; b=VgD1LVchSxsUo/phzo+uYStg6q7syGUh4gp6pGypmuVf0vpUjXy9XtiGpjLRfmt1ZX+WHGx1gGzUlX19UL3mtEN8faftFEYItx/7VobxXn8pfvZTsF8KmaIhS6Qy/NDsfOht+XFgYpuTT3riwvq9UVvZg4TsUB8fR+Zp8Kk49zY= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.56) by VI1PR0301MB2142.eurprd03.prod.outlook.com (2603:10a6:800:26::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 10 Oct 2017 15:57:23 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Tue, 10 Oct 2017 18:57:18 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Tue, 10 Oct 2017 18:52:46 +0300 Message-Id: <1507650771-16631-7-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507650771-16631-1-git-send-email-volodymyr_babchuk@epam.com> References: <1507650771-16631-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.56] X-ClientProxiedBy: VI1PR0501CA0016.eurprd05.prod.outlook.com (2603:10a6:800:92::26) To VI1PR0301MB2142.eurprd03.prod.outlook.com (2603:10a6:800:26::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4896a75-de7f-42aa-4b10-08d50ff798b9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:VI1PR0301MB2142; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0301MB2142; 3:eMC420IW3UT0TIKGk4kprp1C19qXUVNWNcJw89p8EcMlXjqPDjqXX/gIbdOthRWumvxPRTCJAvqhs45Fx8RhALEnI1G4ahgikIcmCplWMtZlt6v3i6jdR+zgCTfe8DYSDJowqQp5YlvgtxJVz4nglSg3TYHr8wbOimCL8oX0MY4klozpr95TNLarWrADpj7+6lu2as06rkNB7+WkOkHI3SBp7ujSavklRZbJlHchN0KxP1zpuQ+3RqyUn/dXnpEo; 25:xV6wUvSHBvKF9krmwFI0T42sNf/dbnGoCJpPLvPXVsO2v2BiIEbKyU7sufcpVQp9T2Dw2+HxDL2i1nX1Pv3NBFREtctiRVYzPuoBF3IMusNsie+uLj+wCUkzlhSjJvdbFUHxlLS5wLD7ElQq6W7HqogIxidxmooFCyQbJ8ZX0Sn2GJvTXqH/HiYc4vyK8FWAYys8Fm+8tA/ElEgkZXaq4Dqt06aksXai63YuynyIdwTPrX27aIJqvMM61sxhdbP1SjRmvpiNl0zqI9Uy++yHDumLCBZNJCIDZS6ZNGFJUjhG1gwiN/x5EjCuerMk1P8YkB6axiRSdEnzbk2PauLkOw==; 31:NLcynkeFEczPxic8VdZ6I5afjU9HQ1JC8MYLcHnjZHqt31mLW89E/nUzU6YYlMxttghsGND8sQbjh1Mqn+m1KjS5GQqXRapzRbwdo7Fwmb8+RoLYba0Ca5qwoIYufOfCFbwB5ZoYnAjbjqFX+QaOhc1t75qu8pbNUkzXD4SGqcekKs4tfJ5K0jNVM3XMJBhR11iZ9Lbmmb/gtuvCPCzHjvRPWeN1/fr4czYY7P/nPPY= X-MS-TrafficTypeDiagnostic: VI1PR0301MB2142: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0301MB2142; 20:BxrNujYlkFN9+hDIfn6tXhoe75K0D1cpfp4kUeV7BvDFn1FcG2tczr2TJTNrq/S2BJtrZqllim+VbTtmub2Abpt2AbCjaKCaouMvInEwqT3AfwCFcdrxhXvjUkDvaJ0XUCr7lWwwQ7CYsBkT6i06mOKaLIdcq7n6enj7Hk44BnuZkbx6ogTqCRCxlHLpDguPb7GcWn1J1dLjKMQY6MAeGQnTpNUDcxhVMNNGO0+kqTxys0qtnh+tUmJ5OJnPYPafK87OsImUUOMwh1yR+SxAvoF5oChYL9KaJHIvC0Ea6PYz67G/kPQSgSKU2EkjKbokvJlmxJk6Soew4WuicT5j8fRbgvkiJJ3ZExyXHZvZK18Bu0ps+docOY/m1HI9Ol+iieRahnN+IXeXhMH3tmb5F9zZpMHRjbXziB7HUe7pTIqBEE9gD7Wk3OLB/2ppiJTzs5FZXPm8LxQftMzb/P0v9fH8XtbASMzAbxRI5gtfP4U8B4r5Y6MYKKl9J4aEBeAW; 4:YPMJngj78NTxLnpY2NMwCvfXmHOq+AsGOkn0jk5A4i7g30XWbWiPy5Ja874ZdEo/zCqT++CIRhkXIEsQS/K7gMt4vjWJZBl8nWmc0suGWOrz398pg8yJ0WeZqEZBxIYzNSkf4QOwOueoiFYkFbro/9bBehccJRxzcQsCPdPAm9BLrcwetrjEbnISyO5hmGeVox2y2xz5yZGbA3IDVRyCk+ieWphk7LtRi9fxZL//st9D6qp1lEe8Fh0MC1N2aAokILWYFBB63pP+NpS0RyfrjiNNf6fg3+Rxz5D8bXrAbfQnHBemNNUVN/V5lGrYTEhBoxWdqQT8Cu9D0SI/p2533w== 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)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123558100)(20161123564025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0301MB2142; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0301MB2142; X-Forefront-PRVS: 04569283F9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(199003)(189002)(33646002)(105586002)(2361001)(47776003)(4326008)(7416002)(50986999)(5003940100001)(76176999)(50226002)(305945005)(8656003)(7736002)(8666007)(5660300001)(478600001)(101416001)(8676002)(42186006)(16586007)(122856001)(53936002)(54906003)(6306002)(36756003)(68736007)(189998001)(97736004)(50466002)(81156014)(81166006)(347745004)(106356001)(80792005)(6116002)(316002)(2906002)(86362001)(3846002)(6666003)(2950100002)(966005)(72206003)(48376002)(6916009)(8936002)(66066001)(2351001)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0301MB2142; 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; VI1PR0301MB2142; 23:54cHlKzJ4ZrAGGGeiXXOwC2IciZH7N6xeufe5BL?= =?us-ascii?Q?cz/zMn+N8p6xJKasgKNAzC2jIJBr5UcQ/CgupwNHC9k3T8SvoB09l+7mGcUw?= =?us-ascii?Q?wiyNn6DTqrVEFRwfAhubYrEnUX+hACm0T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V8NghFqZz+g8Q7DIQpoo7COgcoqLQ+BPAAMIgwHnFnQs1RlUdv+HAGwjQBfYRo0oLVH3JZaVy/G25IgYbZ768lPf900GrvzcSlqhBras4/9VQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2017 15:57:23.0474 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB2142 Cc: "Edgar E . Iglesias" , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v8 06/11] 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 Add generic definitions used in ARM SMC call convention. Those definitions was originally added to Linux kernel as include/linux/arm-smccc.h by commit 98dd64f34f47 ("ARM: 8478/2: arm/arm64: add arm-smccc") I extended them 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 Acked-by: Julien Grall --- 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 + */