From patchwork Thu Sep 21 19:59:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9964781 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 3343C6020C for ; Thu, 21 Sep 2017 20:03:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 253CB205A4 for ; Thu, 21 Sep 2017 20:03:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A0F6296A9; Thu, 21 Sep 2017 20:03:04 +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 94CBB205A4 for ; Thu, 21 Sep 2017 20:03:03 +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 1dv7ea-0007Xp-NC; Thu, 21 Sep 2017 20:00:56 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dv7eY-0007X8-TO for xen-devel@lists.xen.org; Thu, 21 Sep 2017 20:00:55 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 13/68-02224-67A14C95; Thu, 21 Sep 2017 20:00:54 +0000 X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com X-Msg-Ref: server-11.tower-31.messagelabs.com!1506024051!85010891!1 X-Originating-IP: [40.107.4.74] 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 59382 invoked from network); 21 Sep 2017 20:00:52 -0000 Received: from mail-eopbgr40074.outbound.protection.outlook.com (HELO EUR03-DB5-obe.outbound.protection.outlook.com) (40.107.4.74) by server-11.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 21 Sep 2017 20:00:52 -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=EwIWLKBIFHnmkdjCPosJIG9//SXLf/nD4jrjEskwA2c=; b=lok7YwFYNMPq/RT0wdCMsarDyyR3ka15LiQE1rxHfOxR6tsDC96yZfLf26Wvs4vycSoSQQlqhLMRUPLU/oU4Sy5rtrtiPQcEc0A0+1d9gB0sQFtcwoYVZwL+D6DUvu6nvo0fUDCqvNSXFq1BZJyZbT3Q9rNof46iGIAw41fttX0= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.56) by DB6PR0301MB2135.eurprd03.prod.outlook.com (2603:10a6:4:46::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Thu, 21 Sep 2017 20:00:48 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Thu, 21 Sep 2017 23:00:46 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Thu, 21 Sep 2017 22:59:59 +0300 Message-Id: <1506024004-8615-6-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506024004-8615-1-git-send-email-volodymyr_babchuk@epam.com> References: <1506024004-8615-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.56] X-ClientProxiedBy: DB6PR0801CA0052.eurprd08.prod.outlook.com (2603:10a6:4:2b::20) To DB6PR0301MB2135.eurprd03.prod.outlook.com (2603:10a6:4:46::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 312b5c2f-2de5-476e-0466-08d5012b74b6 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:DB6PR0301MB2135; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0301MB2135; 3:pridI/zWrb/niQiVbOqvdPAod53Hv+hWtyaRDyu25TDr0I8D4BffG369r3qeQjRQYjxr8iVltmHX04v5eDuNoihwn2Wyi52dUNz6wvXg/ogAD/P09B7VGtLPslp6n0/190tXjl3S7ey0vNCy1NhT2Xn8HpgDxSkiXu0yOQBrfZWU1kE0ZydSIIAs7ClJYGU4tbAEPM9i/8/RCSatd8Xu7pGWQJMSwBJjsyZSdyjL7jb8+3BdOxWeNcRAoqxizKKy; 25:Pd1VL5uu37uJclebSgax4fd+E0nsYz5PuYLVbjtClC5VSv/+sm55ZP/BAU6nqDdu3e72X5zT5wJgEFLeRsY50l95igTL+Q+TjD3pzCM6RfIIXuCBOy4a+Yu/psZPw5AKTz9PqgVKbdrDOR0zoVBvgkbEGBibwhWUHAiMIIp+M7IorwoVxevw0glSZyvb/yw2wNju0CLE+eg/ZybqKymNSjQgO3QmV31XcoxEQuWk1LAvsQsbaeh1Yz5x4P28t/zDc1dcmUjkbVwBlwsOXJzgbivOlkvNipRGXU1dQtSg/g3WPWxHlVhgCb0JEhTZDk0icCZqGUuLo5Sv4B75y7ki6w==; 31:7kzmKyvb7w8ykmie8xJia58FK/v3Bl/0zCMYb3OTJ467K3tPoO5hGdwNz753rkEED9bg3A6jcTW8gb1x2gWV2atCNQOon+fEevurR5+PjREpfFlOuqWJp2bFWG5hF8zOMgS45ti/kIQjwZnZugAKB00IQwsCw+JKSkVJU6qxigIhB91oyonvb9+8EGGnhJZJan4FrnlF8YIcufx8Mf1RETZ3zWFsRTefZHYgq/UnLhM= X-MS-TrafficTypeDiagnostic: DB6PR0301MB2135: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0301MB2135; 20:EMcea40zwpoTuaCCipHPx1yA+nDnHWu/KyXryNveVQIE1ixgA4KrN+AYtsKxRK+BjeH7dklD9lEASbx8DD3aWhskHpo10H4jC/dEBv3X4YkF9WVPvmj5rJ6+um/lhont0t4keia0QiZO1m+Bb/irCUP2cFhWz0WJO0KyZCUN7JUqQ3co6rANwmMFzrgIu0WIDDaaaCrci5k6G4UBmL9CtntwgNWhm9CAx0ef44idU5CKUSmBA20zRsd3FisyjIAB9Sd2t+mICoX9rPPijEYklytPWHzYx3Q/0wfoOyEf3sqY71pmN3FsaBPZEBUtxroL817B3JwRFzt68bsePg3UoTMiOESnu/hh7WLzv572Nt18D5xXRBX+wMBMEFAvkjtQY7gSEHY97pY7XiafQ44T1MylbcDZ3jMcuTQLyx6j8ywujC4tbyEGeyyt1CC90+AbMbDnEbJX84mni5B/YXULx6y/cecUtvkowJbSp4dKc5Ihjhwzy3QeOaII0lrjcm6Y; 4:+QSkEivRZ7mSY8LXFUyzg2F3159fJMCGmo4KEXaRpF3DoMC+FnKMpLqcj9pcS8khhQqQpax9rs0dL7LRiFWDF4QP5mAIr18l2R9/Cufv7Y2YhLsj/cV6GugSkdjg/Gz4YndsCijm7gmdkixqLUgeKUfRXpPAZqQrsC0hlOeH0Fdkwa6EuWhfOlzECxc750cga0m+CPQv+j613RQH7a2zNAs8dDhYKmTPL57bD8g8qA6CkdzRV0cM65BIltPgvCy2x+KLErz3kUmn5QgNPCBnZiChcQvSY+MK1H1dserGPN8yZ5EuJIAQAtRr2/nscQn3y3aF6nuTgSg3+ZHP5cwPzQ== 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)(10201501046)(100000703101)(100105400095)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0301MB2135; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0301MB2135; X-Forefront-PRVS: 04371797A5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(346002)(376002)(199003)(189002)(54906003)(3846002)(966005)(76176999)(80792005)(81156014)(97736004)(81166006)(7350300001)(101416001)(6916009)(2950100002)(6306002)(50986999)(347745004)(47776003)(53936002)(8666007)(2906002)(7416002)(50466002)(7736002)(42186006)(48376002)(50226002)(36756003)(4326008)(8656003)(66066001)(189998001)(6116002)(6666003)(8676002)(2351001)(316002)(16586007)(305945005)(106356001)(478600001)(72206003)(86362001)(5003940100001)(122856001)(2361001)(105586002)(33646002)(5660300001)(68736007)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0301MB2135; 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; DB6PR0301MB2135; 23:SJQmBkzeEjw/JPRmrW2s998yEOjwSJyozVFhqTS?= =?us-ascii?Q?oQbE1uI6ymQ2i+vgELRK6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CvNjD+3xmriI8ZZCD7IOEn0JuUhohQYrSQi2a7X4=; 7:HKQa58KllGQuxAtMkMEfMxLeznnxZiqDIIL10gbazRZIN830aL/y2pHosZ5JNNhnBWpROikGORsS6EI1VKWJaWVSmSWmh+vEG4mBAQFzTtvl47uIaHOKTRVEh6PVHKmrCoVJUhuRGD9RXNArd/9ryapG/y02cyVsXTvAIjCaruIEHMtFd+eZA9mRJV1u6EiakRcj7HiZv3lWFc83kUNgG7ic3/VpdS7uxwXlWQFmNi4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2017 20:00:48.7350 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0301MB2135 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 v6 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 Add generic definitions used in ARM SMC call convention. Those definitions was originaly 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 --- * Added reference to original code from the Linux Kernel --- 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 + */