From patchwork Wed Oct 4 21:00:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9985463 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 983A0602B8 for ; Wed, 4 Oct 2017 21:04:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8815628C22 for ; Wed, 4 Oct 2017 21:04:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C58228C24; Wed, 4 Oct 2017 21:04:01 +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 CB91E28C22 for ; Wed, 4 Oct 2017 21:04:00 +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 1dzqnh-0008GK-Cc; Wed, 04 Oct 2017 21:01:53 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzqnf-0008FY-Os for xen-devel@lists.xen.org; Wed, 04 Oct 2017 21:01:51 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 27/04-02224-E3C45D95; Wed, 04 Oct 2017 21:01:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA1WSfUgTcRjH+93d3GVenNPyyZfMYSiSki0iyCB 6I60gCiorytOubbTb1t2MSVA2TXSWJWXmtBKMNCuhVlRI+UIvztBZWajRm/SHWogjrXDSutup 2e+v58fn+32e7wMPiatsAeEka7WwvJExqAMCifjDRELi6i1v05c6S1JWXvPUEGvQpmeNXmwb2 qPQGzNN1gyFrsfzBTM3qa0n3aV4LuqOsKNAkqBP4vAxv5+wo9kkovfB3XtFSAIq+jQGrvstmA RUdBZcdhcqpDqAXg4NV91KqQ6lI+Ddjzd+A07fwKHBXoJLIIReDUNN434RQS+GuqF2/wSKToX PBSP+pkAvhN7OIr9+Np0GNbfzkTwsFU55upCsDwZXxVe/F6cBWgYGRD0pemPgYn2ONBfocgTv +34RsjcOHnu/43L/KHjWUUXI9VZwFo0pZEM1gtpGaWXpk6eEC57+SccSePS6QymD80r48sank EEa1DlakVybYcBTO9mqSwGuysrJfSJhrK1MKdcdCnA6M+RMGTDs805qblHw2GeVzUVKuNL9RH kOxTlm7OqYsWs1wupRnMDyR1k+UZOUyeu1OgvH6A2JyUs1SRwrCIyWNTCZQlKWibuLxEuYJb6 HKG90bStaQGLqeRRsfpuumptpOpijYwTdAT7bwAqtKJIk1UCNpIksmGe1rPWQ3iCe0xQGMkgd SpklTAlmhhP0Whm1Iw05eqZnAiMLez9MYCrCaDKy4WHUuCSlJaku2zjdaOo0X6Oo8BAKidFUQ WaW5/SW//kQCiOROoRKkLIG6Y2W6XlDYhRMjFJl65aiWJh/KDwXxbZneDlu/8Re0DAKyFkRm/ xCPWwrHMxe1Li7+NurTiw3OsYWqD9+iWs69lzTfCcmPj7s5S5fPxTXtNkdfUd+/yz4vPEmV+r evj7yz4M077z55U/tLUE1y6IrGoeBV+1rnuMwutJXbfh0/8Tw4I7rqrKzyZEFKTv59E4Nsa73 hZoQdExyAs4LzF/Mbi1hlQMAAA== X-Env-Sender: Volodymyr_Babchuk@epam.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1507150909!114714900!1 X-Originating-IP: [40.107.4.42] 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 34332 invoked from network); 4 Oct 2017 21:01:49 -0000 Received: from mail-eopbgr40042.outbound.protection.outlook.com (HELO EUR03-DB5-obe.outbound.protection.outlook.com) (40.107.4.42) by server-5.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 4 Oct 2017 21:01:49 -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=iwM8wrZ1jfj7IIoFNpna3ZL9EiPioBZEsilLu1pWdO1tkhINsrcUb0SRp1CpQFdqixbX8qk7+mc+XeDlvtuvXkkf+8x57O50nnW6+j1/BoqxTaHFaA5dXWPHR7PN/IX8hHFiwtMRKKiQD8Sw2RnCFdGCQu1158p2B0lnCEoCubs= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.53) by HE1PR0301MB2138.eurprd03.prod.outlook.com (2603:10a6:3:21::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 4 Oct 2017 21:01:45 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Thu, 05 Oct 2017 00:01:41 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Thu, 5 Oct 2017 00:00:22 +0300 Message-Id: <1507150827-7858-7-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507150827-7858-1-git-send-email-volodymyr_babchuk@epam.com> References: <1507150827-7858-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.53] X-ClientProxiedBy: AM5PR0701CA0006.eurprd07.prod.outlook.com (2603:10a6:203:51::16) To HE1PR0301MB2138.eurprd03.prod.outlook.com (2603:10a6:3:21::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 64d3d9d3-4d42-48e9-e069-08d50b6b1fb7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:HE1PR0301MB2138; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2138; 3:tvK4Fy+pMpTCZ6ZxaqEZFqjdBFJkZ9KxvH2LqQWAGcIvRHgemSfjEsvq3Co7PmN4OcNf7WK1SQzRvDu9WN8Yf+xbxRX9uUoZLnmk/AIEbJXwEkJ0acMfsS34KMRx5gRO+5GPF7LujKwUfoKWThk599aNamxnDjU86Y57RTa5jPvsIaCjxo8/MtnDLGALNy1XRxT8R/8x481WhsQcCK+it6JzLb3GaLBoh3zM8rY892YINKOITTMQPFzxofE6gYkg; 25:qwg5y2C21JN32UYRHXa1qB9hSoSAZPZxVBf+JFnyPXKLEtd27WwQRJDd11qdB3e+rF9ZlRkYHTEg3UaEQW89+WKhGDHwCD2kZLhTW6tE/EjjaaFOv9hnOhkO+XcgCFjlO8SjKtIAgmEo37zVJEdW064d1kQZk3NAPiYpfzI0HPdyh90+k1JlRDGJJjf/chYQeejZahveQmuy0bD7eZp51NJHqoGw2K1vRj/Szc+wedeFnKxj/aRTRFcRGgWcJr9t8MHL1mHrAsVsFS9NF27rz84f7Zji3EOHqEiOd3drxo7n0D6VDMCZuwQQWdwMp8zv09o5l8HuMxdx4rkEWRtBLw==; 31:YJKpascZZFrcxwnnkesdqXBPsB6ga9qMAqsOl+V4mYWJXR3JxkdKKZ6p8fqBd/4BrNkfqUp0kY5OM8CpZp4osdsIFFh0uNktMklRs6crAaWxvzG7gOC0gpTq1Of/ITSwtz8QDrZlttBkz/5kj3BS8IHmhk0zFU4buP2z46Aey43SrKm5K9h+5kzshg83i8OEj/R5FIreJPr0Bm3Pu2lwjROg5liYoGtErLX2TnOB8NU= X-MS-TrafficTypeDiagnostic: HE1PR0301MB2138: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2138; 20:CjsCG26v15C0v7SoCkd64kBPNU+yVUJHeNw/Ig4IvdxNGjSMuIS9GTWssk61eMAfIWp8oEY5wBXUi2iCIxOLhz+fO6rHQNW2Zs3mgbY4aQyvVi88KnRU+z/BPHSTm7J/jTJLInrbIjzFpUZZB31z8m0P053flhdOLnVwINtR2HXtnKI5GLGJQYk6PFUKm1S3BuMjR5yKOZrZa/Brb731+He2lwwiNWQ/lf8lxC0xsOCYZWwGRQq8O0yqbPiZoAuhFCrrUDbEb52BhQyv+iPWbB7CCDc5qTY4SYJerkrq5WFSsVXCfr19ryLmIiFaLNt7fIMkmUdosZZzwju13wg5AbdyoOaX6B4hBdxn+/7Dpng+aD2d5atvJzljMn28JEKsZZIRU4CsqOTjxLALgmr6g3c5+m/2jRlle3z5zKmPFSIxjE28b0duOhpBYbkwQFZ7bDL1UYT5AJiU2ObGd1N+vD0Zr0Sru0DhzVfx/FSBx+j7TSwjr+ZEtcoGm4MiSiY4; 4:dKcD7/sIhvzhDuDp+s39I1cQ76Lugs/CnQYFFKKWUMrXviHj5k5OORo8ifxqbJt8YcilPbRJHheS+MUQwkLG7tb77MXVEAjBhEb45TwNl/f/U6m1r030phEnHHlJfUa0v2LSl5652VNBXDhqPjbQmUBxgzXcB8N9jViRfzdosP53EMrGeMMF9kvPf5g2g1gWWekJY4J8icqMRWsnt0rjoWXIhl9sG4f6obNBt/b1hxkxLleQxJvVR/HLEnYwyr3BJ7VopkRtOm0cnCPvPfMuwlwwenzeYmLcztEHwonfPs8SxWg/zaVn3KmNK4hWkofKu3CRjGErB5yVUUpXNB3pdg== 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)(5005006)(8121501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0301MB2138; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0301MB2138; X-Forefront-PRVS: 0450A714CB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(189002)(199003)(305945005)(316002)(5003940100001)(42186006)(53936002)(2906002)(54906003)(347745004)(47776003)(122856001)(2351001)(97736004)(7736002)(68736007)(33646002)(36756003)(76176999)(101416001)(2361001)(8936002)(50986999)(6306002)(189998001)(2950100002)(106356001)(50226002)(6666003)(86362001)(6116002)(105586002)(3846002)(16586007)(6916009)(8656003)(4326008)(7416002)(50466002)(5660300001)(72206003)(8676002)(48376002)(966005)(81166006)(478600001)(81156014)(8666007)(66066001)(80792005)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0301MB2138; 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; HE1PR0301MB2138; 23:71/Zv765nw5l8P6hvxhUAtOQ0TTYzHUfCd97oE0?= =?us-ascii?Q?zR9BRA1RpZ4pYSGM3ee5PwMUq4o5yreVxA5+x0yuo+N/cet5aV+0ghxQCRiX?= =?us-ascii?Q?dxJTwL577/tXTtveCw7/b0pwG2IQ+FX+U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kgiLM7O93g9qwJb1N2HHJgnFtViSgvmkB84rTCUUChxMu/IlCqhcEFW2WbkSql0yfnb9by1lonE/bEkVlt2z6gzNdRF0wUgGOi8ZelT5VGLQxOww0QDdeU2Qd2T7xL1E0A2nczo/PgjgPdFBs9cPhjjUTAF9TJk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2017 21:01:45.5124 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0301MB2138 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 v7 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 + */