From patchwork Thu Sep 21 20:00:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9964785 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 BF3F66020C for ; Thu, 21 Sep 2017 20:03:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B03DB205A4 for ; Thu, 21 Sep 2017 20:03:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4C3629698; Thu, 21 Sep 2017 20:03:29 +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 1A684205A4 for ; Thu, 21 Sep 2017 20:03:29 +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 1dv7ew-0007jj-HR; Thu, 21 Sep 2017 20:01:18 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dv7ev-0007jJ-SA for xen-devel@lists.xen.org; Thu, 21 Sep 2017 20:01:18 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id 8B/9C-02202-D8A14C95; Thu, 21 Sep 2017 20:01:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDKsWRWlGSWpSXmKPExsWSoc8YqNsjdST S4MBSHoslHxezODB6HN39mymAMYo1My8pvyKBNePEE6+CWSYVmxreszQwHtLoYuTkYBFoZJZ4 +ooDxGYUiJHYtKWTsYuRi0NIoJ9JYtfp34wgCSGBZIkLl8+xgthsAiYS6+afZwexRQSkJa59v gzWwCywk1Fi58ltzCAJYQEfiU0vO9kgNqhKvJn3DGwQr4CnRM+bDWBxCQE5iZvnOsHqOQW8JI 4vfswCscxTonn6GSaIekGJkzOfgMWZBSQkDr54wQzRqyjx4OAFsMUSAnMYJd5NOsEK0awusff 3G6giWYmjZ+ewQNi+EpfvrIeynzBJdDxSgWhuZpfo2t7JCJHQkXi65A/U1OdsEnPfnmSHSFhK fPzxA+rsAonJ8w8yQxRdYJWYcesPVEJGYtvznVANk1gldv/VgjgpQeLd/99MEA1dPBLPlh6Fc jrZJS7tm880gVF9FpJnZyF5dgEj0ypGjeLUorLUIl1DY72kosz0jJLcxMwcXUMDU73c1OLixP TUnMSkYr3k/NxNjMCUwAAEOxj/bfM8xCjJwaQkytu99HCkEF9SfkplRmJxRnxRaU5q8SFGGQ4 OJQle32VAOcGi1PTUirTMHGBygklLcPAoifAeBknzFhck5hZnpkOkTjHqcnTcvPuHSYglLz8v VUqcNwqkSACkKKM0D24ELFFeYpSVEuZlBDpKiKcgtSg3swRV/hWjOAejkjCvFsgUnsy8ErhNr 4COYAI6InvDAZAjShIRUlINjDzlV9+2qIdabNtir+DCetEqYZZpoCPru5rIEFfuO5MElt45r/ 0/pvMcD+8+d2aXb09/zDk7051/0d47ffcCIyc02s24nbwkfqGjev2LHxoXzy46fNz69pP2ykd GwQmvQr9kVUVGTdh5sl3A1s6yuUaGY0dYDP+DBfzXaic95Fmqrbsh44HBISWW4oxEQy3mouJE AB8orlyPAwAA X-Env-Sender: Volodymyr_Babchuk@epam.com X-Msg-Ref: server-16.tower-206.messagelabs.com!1506024075!92679205!1 X-Originating-IP: [104.47.1.81] 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 979 invoked from network); 21 Sep 2017 20:01:16 -0000 Received: from mail-ve1eur01on0081.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (104.47.1.81) by server-16.tower-206.messagelabs.com with AES256-SHA256 encrypted SMTP; 21 Sep 2017 20:01:16 -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=bF/pyQXmvN4+WGIM7gBcwR6QcMl5VU1s7Ksv75rPNik=; b=Rqw73eS6u8nzz8HcykodxdpVmav4MPyVtqwAHQabDkpOpmIaPvvsEUwz8Sp/APLf0g0mxkFZf186639zqJ4Lk6ABnUY8tXC/TOrerhlvaSrk26JCG8iwqKPtMvNW3yhWk/4pV5zLlBHcUvw7zmPjEGc8Qsq9jY/1dRe6vAanR1c= 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; Thu, 21 Sep 2017 20:01:12 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Thu, 21 Sep 2017 23:01:07 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Thu, 21 Sep 2017 23:00:02 +0300 Message-Id: <1506024004-8615-9-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: HE1PR0102CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:7:14::20) To VI1PR0301MB2142.eurprd03.prod.outlook.com (2603:10a6:800:26::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 674f0c11-932b-4a8f-1436-08d5012b82df X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:VI1PR0301MB2142; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0301MB2142; 3:f6+kH603VSt9UeqbPiWmjFISQ72rhFWk5WbtNm5HxqBa4NLZlYaVtWUKcEESO+88pYIPiIAPy7z8XNtqHqe/zQ26mvcNqvCLJwBn+G9m875tLSxt451hbdUOxmJ7wO4ka2tgcvqFJxJoe0KNx8LMp7ge8Eq5+Loi0+2HZ45blCoCp87UC7GvHaPtr9bQtxnaQH3k7exStJ+aVNJZ6dWDatTYJZJeyfESqJwn9R+RqRm/UuojvAVdYHTa6ioIPQGa; 25:lQBYQbfGvb7XVoYTnmdwN7T8sIkFFaDfX9v5TscUxTXheG5uls+hEOmVZxnjW9vxPdb7JHkiTlI363ULsAox9vM6I4EozfyMttsYnYfSY2jl8w+Xg5YQdIdbCMmjgrRxHoUa6KNcFdr0lty6/MBWCa448d/eUNYZNAfzGu/yQ+aB3sSap/ptac7Hgv5A/6e/6K721Ogmg4IQsJ7VIRYkc+grS7J5EA9y9f8EjKEDMJCHscW1sKzcAh521Vd//SB/+ls8VHfSuiqTOPH+/1mSs04knetfMEyvFLTz50Hm2QhkBaUd/RBrsSgzEqtGb7dUU/mGXpxez7/0HGiyMUg0Mg==; 31:mhZmZEbFkMRjjS6Ca/BLQVVec79hJjanIBxf/vQngpE9tdfFTPfLh9/Gtwxbfmt3RbY+xVHeKbjt+p3slmTW1gU6ax0BVphLWH1QvoCnv05NcYIeSTdCthRpBHFkBm9t1d6X0sHGsr3W204c2ZSjNXfFTsHw0id+dMCjXiofn2oKEhsOHCxYsojm+hrEnH41vHTrAKtQ2XF4BP09X+ye/Gbci+XPnOwWlIWZ7cINU28= X-MS-TrafficTypeDiagnostic: VI1PR0301MB2142: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0301MB2142; 20:cYaJ1TnWIQiBzWXKysXQtJPX6wx3n8qzJA7uLoNDhDwwTLCqaVwXHk+Osdk2aY6Sy6U7wh0MnIrOZ9+BQLkB19sJNW6WodvvQDfCA9gw7MPA2zsMlh02QuDMkjNgbIjcXTbMXDGZG93IXsB/Uk9aSGGUVsvuD4kGm+D57JGFptPuAiHIL9xRrPv2y65dj0ZG0Gp70cIDyq13RSrg/NMe5ATog4IVoKM4GIM+geYJH6qss+/IIMsfgmnWnftVKDiI2/dBD7j/KF+zUupltDRq6qjaKkaX55YsBcFH8BGzA1KsaxupGKrB2RJ7Wd93uLK/WMdTSrpRMXGh9mhsXAOUzOpSS1srwm9pFkvab5Mfuik4jWApuxdvR/0Cqmo+Fw3xztyShgG0MjeJqvHubHD5Avrl/HksEtKyuqGH8JA+3xN2LcwuJYljvRdJWC9hKOScvVignSxjQTlWZYl6yRuGuASD5Qaa4a5q2PD+TZGfGkMPXtFCC1hoXX2awqz7zqz6; 4:+Pmvv96uXdgHIgK71G1r6T/Pgn5ibP11emjgLckPU/cRCma+oTUTZiaWm5pioXvr8wkLu8vFstxhNemniwTvgZUazZXalVtHH3NFsYwbCaWuhxAqOS37HBuJ5U3S/17039CEbyd6+Uc7sVadNPybAtfd9/hmqgG3mKJBBCyJAoxWPH0EBkV2lHaoDvjuj1IlTemunZJdvlyM0hEG2hiqmqxLhKqi0sodU/mEo0xn58w6SrDkDR5SZCl23hbvYn4w59PWaVKy0/Fmf5jUMErAt4BTkYhFKvS4ltYTQHe+pSk= X-Exchange-Antispam-Report-Test: UriScan:(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)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123560025)(20161123562025)(20161123558100)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(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: 04371797A5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(189002)(199003)(316002)(2906002)(48376002)(86362001)(8656003)(50226002)(189998001)(101416001)(2361001)(33646002)(76176999)(5660300001)(50986999)(5003940100001)(106356001)(105586002)(2351001)(50466002)(305945005)(6666003)(42186006)(68736007)(122856001)(7736002)(81156014)(4326008)(36756003)(16586007)(8936002)(47776003)(66066001)(3846002)(53936002)(81166006)(8666007)(6916009)(2950100002)(80792005)(97736004)(54906003)(6116002)(72206003)(8676002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0301MB2142; 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; VI1PR0301MB2142; 23:nd0iuxk6D1KTz0T7XWuSHrvZaeq3U5NZDECw5Bs?= =?us-ascii?Q?w6wV52pIfH6qJYmD424HNDFVud6u4hj4AkSrOlEMbDHO8QZ/sRABwxs1Iohy?= =?us-ascii?Q?JJlJ9JBcfzVPXwlCdv5GDSKeGdfFqEP9u4fcPYQ/LoFMlTxPfqy+SuO2DR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pamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2017 20:01:12.6484 (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" , Julien Grall , Stefano Stabellini , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v6 08/10] arm: PSCI: use definitions provided by asm/smccc.h 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 smccc.h provides definitions to construct SMC call function number according to SMCCC. We don't need multiple definitions for one thing, and definitions in smccc.h are more generic than ones used in psci.h. So psci.h will only provide function codes, while whole SMC function identifier will be constructed using generic macros from smccc.h. Function psci_mode_check() in vsmc.c will be removed in a next patch, so there are no need to review it. I had to rework it, because PSCI_0_2_64BIT definition is dropped now. Signed-off-by: Volodymyr Babchuk --- * Fixed indentation for PSCI_0_2_FN32 * Please note that #define PSCI_0_2_FN_NATIVE was indented with tabs. I changed them to spaces, so patch looks weird. But I used the same tab-stop, so it should be fine in the resulting file. --- xen/arch/arm/platforms/seattle.c | 4 ++-- xen/arch/arm/psci.c | 10 +++++----- xen/arch/arm/vsmc.c | 4 ++-- xen/include/asm-arm/psci.h | 43 +++++++++++++++++++--------------------- 4 files changed, 29 insertions(+), 32 deletions(-) diff --git a/xen/arch/arm/platforms/seattle.c b/xen/arch/arm/platforms/seattle.c index 86dce91..22c0622 100644 --- a/xen/arch/arm/platforms/seattle.c +++ b/xen/arch/arm/platforms/seattle.c @@ -33,12 +33,12 @@ static const char * const seattle_dt_compat[] __initconst = */ static void seattle_system_reset(void) { - call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0); + call_smc(PSCI_0_2_FN32(SYSTEM_RESET), 0, 0, 0); } static void seattle_system_off(void) { - call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0); + call_smc(PSCI_0_2_FN32(SYSTEM_OFF), 0, 0, 0); } PLATFORM_START(seattle, "SEATTLE") diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c index 34ee97e..be4e8e6 100644 --- a/xen/arch/arm/psci.c +++ b/xen/arch/arm/psci.c @@ -31,9 +31,9 @@ * (native-width) function ID. */ #ifdef CONFIG_ARM_64 -#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN64_##name +#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN64(name) #else -#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN_##name +#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN32(name) #endif uint32_t psci_ver; @@ -48,13 +48,13 @@ int call_psci_cpu_on(int cpu) void call_psci_system_off(void) { if ( psci_ver > PSCI_VERSION(0, 1) ) - call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0); + call_smc(PSCI_0_2_FN32(SYSTEM_OFF), 0, 0, 0); } void call_psci_system_reset(void) { if ( psci_ver > PSCI_VERSION(0, 1) ) - call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0); + call_smc(PSCI_0_2_FN32(SYSTEM_RESET), 0, 0, 0); } int __init psci_is_smc_method(const struct dt_device_node *psci) @@ -144,7 +144,7 @@ int __init psci_init_0_2(void) } } - psci_ver = call_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0); + psci_ver = call_smc(PSCI_0_2_FN32(PSCI_VERSION), 0, 0, 0); /* For the moment, we only support PSCI 0.2 and PSCI 1.x */ if ( psci_ver != PSCI_VERSION(0, 2) && PSCI_VERSION_MAJOR(psci_ver) != 1 ) diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c index 6ab7c55..aa432b9 100644 --- a/xen/arch/arm/vsmc.c +++ b/xen/arch/arm/vsmc.c @@ -137,7 +137,7 @@ static bool handle_existing_apis(struct cpu_user_regs *regs) /* helper function for checking arm mode 32/64 bit */ static inline int psci_mode_check(struct domain *d, register_t fid) { - return !( is_64bit_domain(d)^( (fid & PSCI_0_2_64BIT) >> 30 ) ); + return is_64bit_domain(d) || !smccc_is_conv_64(fid); } /* PSCI 0.2 interface and other Standard Secure Calls */ @@ -145,7 +145,7 @@ static bool handle_sssc(struct cpu_user_regs *regs) { register_t fid = PSCI_ARG(regs, 0); - switch ( fid ) + switch ( smccc_get_fn(fid) ) { case PSCI_0_2_FN_PSCI_VERSION: perfc_incr(vpsci_version); diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h index be2458a..635ea5d 100644 --- a/xen/include/asm-arm/psci.h +++ b/xen/include/asm-arm/psci.h @@ -1,6 +1,8 @@ #ifndef __ASM_PSCI_H__ #define __ASM_PSCI_H__ +#include + /* PSCI return values (inclusive of all PSCI versions) */ #define PSCI_SUCCESS 0 #define PSCI_NOT_SUPPORTED -1 @@ -42,29 +44,24 @@ void do_psci_0_2_system_off(void); void do_psci_0_2_system_reset(void); /* PSCI v0.2 interface */ -#define PSCI_0_2_FN_BASE 0x84000000 -#define PSCI_0_2_FN(n) (PSCI_0_2_FN_BASE + (n)) -#define PSCI_0_2_64BIT 0x40000000 -#define PSCI_0_2_FN64_BASE \ - (PSCI_0_2_FN_BASE + PSCI_0_2_64BIT) -#define PSCI_0_2_FN64(n) (PSCI_0_2_FN64_BASE + (n)) - -#define PSCI_0_2_FN_PSCI_VERSION PSCI_0_2_FN(0) -#define PSCI_0_2_FN_CPU_SUSPEND PSCI_0_2_FN(1) -#define PSCI_0_2_FN_CPU_OFF PSCI_0_2_FN(2) -#define PSCI_0_2_FN_CPU_ON PSCI_0_2_FN(3) -#define PSCI_0_2_FN_AFFINITY_INFO PSCI_0_2_FN(4) -#define PSCI_0_2_FN_MIGRATE PSCI_0_2_FN(5) -#define PSCI_0_2_FN_MIGRATE_INFO_TYPE PSCI_0_2_FN(6) -#define PSCI_0_2_FN_MIGRATE_INFO_UP_CPU PSCI_0_2_FN(7) -#define PSCI_0_2_FN_SYSTEM_OFF PSCI_0_2_FN(8) -#define PSCI_0_2_FN_SYSTEM_RESET PSCI_0_2_FN(9) - -#define PSCI_0_2_FN64_CPU_SUSPEND PSCI_0_2_FN64(1) -#define PSCI_0_2_FN64_CPU_ON PSCI_0_2_FN64(3) -#define PSCI_0_2_FN64_AFFINITY_INFO PSCI_0_2_FN64(4) -#define PSCI_0_2_FN64_MIGRATE PSCI_0_2_FN64(5) -#define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU PSCI_0_2_FN64(7) +#define PSCI_0_2_FN32(name) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_CONV_32, \ + ARM_SMCCC_OWNER_STANDARD, \ + PSCI_0_2_FN_##name) +#define PSCI_0_2_FN64(name) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_CONV_64, \ + ARM_SMCCC_OWNER_STANDARD, \ + PSCI_0_2_FN_##name) +#define PSCI_0_2_FN_PSCI_VERSION 0 +#define PSCI_0_2_FN_CPU_SUSPEND 1 +#define PSCI_0_2_FN_CPU_OFF 2 +#define PSCI_0_2_FN_CPU_ON 3 +#define PSCI_0_2_FN_AFFINITY_INFO 4 +#define PSCI_0_2_FN_MIGRATE 5 +#define PSCI_0_2_FN_MIGRATE_INFO_TYPE 6 +#define PSCI_0_2_FN_MIGRATE_INFO_UP_CPU 7 +#define PSCI_0_2_FN_SYSTEM_OFF 8 +#define PSCI_0_2_FN_SYSTEM_RESET 9 /* PSCI v0.2 affinity level state returned by AFFINITY_INFO */ #define PSCI_0_2_AFFINITY_LEVEL_ON 0