From patchwork Wed Oct 4 21:00:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9985469 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 A9BA1602B8 for ; Wed, 4 Oct 2017 21:04:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AA1427E5A for ; Wed, 4 Oct 2017 21:04:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F59C28BCC; Wed, 4 Oct 2017 21:04:20 +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 06DB727E5A for ; Wed, 4 Oct 2017 21:04:20 +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 1dzqo0-0008RT-8O; Wed, 04 Oct 2017 21:02:12 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzqny-0008QK-Rr for xen-devel@lists.xen.org; Wed, 04 Oct 2017 21:02:11 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id 32/A3-03616-25C45D95; Wed, 04 Oct 2017 21:02:10 +0000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server-9.tower-27.messagelabs.com!1507150928!120035226!1 X-Originating-IP: [40.107.0.69] 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 32464 invoked from network); 4 Oct 2017 21:02:08 -0000 Received: from mail-eopbgr00069.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.107.0.69) by server-9.tower-27.messagelabs.com with AES256-SHA256 encrypted SMTP; 4 Oct 2017 21:02:08 -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=GoRH8F51KvYQRZyKHAXfK11fzPZY1xExqdl/lAKmWNE=; b=S6Odvp19BZh12mKloiZOjyW/wguAJcfhkqvhbPt+pRhWYd1M42jqmPvBMAJJSC/EGFt7tKRzJ++MQCIhtzxIFX8YKP5cfg/QtzRav79M4HgsdX6jzU/5I3hJB/TMq/2xUwrKEzsFyBl5TyPzHJp5zh4dzc3caJUMd6gx01w13Io= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.53) 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.77.7; Wed, 4 Oct 2017 21:02:06 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Thu, 05 Oct 2017 00:02:01 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Thu, 5 Oct 2017 00:00:25 +0300 Message-Id: <1507150827-7858-10-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: VI1PR0501CA0013.eurprd05.prod.outlook.com (2603:10a6:800:92::23) To DB6PR0301MB2135.eurprd03.prod.outlook.com (2603:10a6:4:46::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0a16ea90-1ff8-4559-28bc-08d50b6b2bc2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DB6PR0301MB2135; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0301MB2135; 3:6z1iKLyjkncU4r02QCenTqOOF9c1GjTEO6oOgYWWw1/YhNKYN1nJOc6ljGrzOM1fvlxWNzXuPUM8CaVTv40oAi3/+pcOKZOzsEM2L+rjYax96PP8X2y79BvMXKEYNZLq0hi55JoCuR5/goG7sQ11fCKVewoJyEkB2TLrwbnp5aXUYp4+06uY5rRcIfbBfQ8pK612n+iABNqHplxbQUPHJxOnpbsLf9ZPRdFWJiiB1EVJKv5lalLGwdthOeq6gguX; 25:CR7ExxxzB+WfiX3OmzsPQW7XwzpJxwnCBUeY4ZGrtpVUOOQUOd9lfj3jG3FBmZdj77c/GTMyv3YmhWwb56DfR0V9wySG2AB857Pe6D2fJlPt2l6l/x99IYjYSouTmt5qsJ8BzeQEjzwGuWDjTYA79cU7qNQzsZaz/8CRti2sfSAF7vAim9dVKORNW6mEYtXDUS0w92Bh2BD49Wr/BTnMLqj3VYA7hOnlIzTEzWdnHzC/ShnpRvxEwqBa/81Isq1bCxPzczWLMHqbtH4mO5IIoPZVh4mOccFj24sehY2MRgZDthCt2PU/DAOHYaPJvIzG9v38dwsHwyrf5rargcGeRQ==; 31:Dh/r8eF0Dxw33IaAIhmNabx4T7WG8weQry9Z3wvbbeYK68OVeVII55/XbRvWAOu6x9kCCvOk169JdrDRAM9UgBotBaYPu2e3RZq2CeYmJj82unmB68P7PD8ixKjgDRdLQhnKc1mJOZ4QMHIVhk5Yi21OumodIvjdkDi5DEirzQK4NhgH1P5tJflzeMaVSgsr6SZdHfFg0mTMdKF1i1SqiPiugCxEhA7C0Mr/QpCNQJ4= X-MS-TrafficTypeDiagnostic: DB6PR0301MB2135: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0301MB2135; 20:OT/UKnJiJEK1ydSy1r3liUaLZwl9MPP0e/vkW3vUksaoJrmxXDi5XSITM8vYmzxh5BsMuQx4bcS90L7UXyAeko3UXsU12SL0tSjASaWnhLJ+GQQTJU5MLO2bc5hjGze6G2Tg8S9LEyOLUgtJUpMHI0APfMOB5UrXeCKUpPVMzcVIDv9imP9RYS8jfUNpfoUH8LUWW6yHaEzOYG24yKnVAwlNTHA9ePFSZlstgBsIxWxDyvI0GEjF71ZT0q6P9ipfToqLs4ixIqZkgADCPUiQKDAN0irZBw7hN/E/9sXgBcfwo2+PB4edcerilvQUPdYDd95BaguWP1ab4y0pXJOi2nUiSnhU9HUY/xFUz/jUHTCDMQXqriaT9BTxGD73hAsCmRJi00qEPjbBVfEQm6Jsng78H0fIJ76kmGdMA0C3yA/XNmCIq3mt8B6NLkQFiue1mNrLh03rh2OjZ9rQD0uL+bLI1IYKroY/O9tDHC7nBJfveINkz3utqp9Ih19TSi9U; 4:MwUpjUxliNF23fpDa83Qbu9r/gsaIcTnsMZYU6si94cpw+OJi79to8dWTeaXQfyIlSkKj6O+3jOXaKw8xa+0jUKM/X1J5cVc99jrjZciqG+t6kYYEMuSn3C2Oeu7Xi47ZrHa2APqvURy6G/CzrJUs9Wfhr6A+HQRfPQJNmuvEY09wKgEGuxbi98CltoHq2JRojbK0OjOuPRmRHSZl+HdO+vWMwmjVaD7IB1dbWBjFbpPLUVJ9O/6DGh93fQYnU3YhHusngxQLVdZ3gTMFyizBsBeyFii91vitLoqPo+K+1o= 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)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6041248)(20161123562025)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(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: 0450A714CB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(189002)(199003)(47776003)(7736002)(50226002)(3846002)(6116002)(72206003)(478600001)(101416001)(66066001)(76176999)(81166006)(81156014)(50986999)(5003940100001)(122856001)(2361001)(97736004)(8656003)(8936002)(48376002)(2351001)(305945005)(80792005)(36756003)(6666003)(189998001)(50466002)(33646002)(5660300001)(2950100002)(105586002)(6916009)(42186006)(8666007)(53936002)(316002)(68736007)(2906002)(16586007)(86362001)(54906003)(4326008)(106356001)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0301MB2135; 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; DB6PR0301MB2135; 23:D9xvVfFTcamzRW8wT9iDFNnon/nmf5tfi/+l8Tf?= =?us-ascii?Q?GLuSxA/q35eZ1z5K6XopPQPRQDzMYAwuupjwRVHPBpv/apgHhhd9Q+HDVCN/?= =?us-ascii?Q?C+zeTHDWj1wZJOLMCHLAw7PXNUW3Rr5/mzz0IBjlV5g7JwF4MbUsrO1gcFy5?= =?us-ascii?Q?kidyE6SCwp4Q0QFOAHyoE+ctHSqU4SrTNYmDN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ata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2017 21:02:06.0406 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0301MB2135 Cc: "Edgar E . Iglesias" , Julien Grall , Stefano Stabellini , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v7 09/11] 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 Acked-by: Julien Grall --- * Fixed indentation for #define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN64(name) and #define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN32(name) --- 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..1508a3b 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 9dc41b4..77fc915 100644 --- a/xen/arch/arm/vsmc.c +++ b/xen/arch/arm/vsmc.c @@ -138,7 +138,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, uint32_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 */ @@ -146,7 +146,7 @@ static bool handle_sssc(struct cpu_user_regs *regs) { uint32_t fid = PSCI_ARG32(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