From patchwork Tue Oct 10 15:52:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9996667 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 AF0A560216 for ; Tue, 10 Oct 2017 16:00:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F05B92872A for ; Tue, 10 Oct 2017 16:00:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EECAD2868B; Tue, 10 Oct 2017 16:00:12 +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 C611E286AE for ; Tue, 10 Oct 2017 16:00:07 +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 1e1wuk-0003Yj-A3; Tue, 10 Oct 2017 15:57:50 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1wui-0003X1-Qa for xen-devel@lists.xen.org; Tue, 10 Oct 2017 15:57:49 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id 00/5E-29911-CFDECD95; Tue, 10 Oct 2017 15:57:48 +0000 X-Brightm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Ref: server-10.tower-27.messagelabs.com!1507651066!87810734!1 X-Originating-IP: [40.107.3.56] 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 33281 invoked from network); 10 Oct 2017 15:57:46 -0000 Received: from mail-eopbgr30056.outbound.protection.outlook.com (HELO EUR03-AM5-obe.outbound.protection.outlook.com) (40.107.3.56) by server-10.tower-27.messagelabs.com with AES256-SHA256 encrypted SMTP; 10 Oct 2017 15:57:46 -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=FuJcuaKag1e2lqr2Mf26PmKdo+mQus5gfXy5iJZxcbE=; b=D3AtH6LoDvfEyvGPXJbtvatm+RfMqP9JWVZvyTQna269L6CMMZKxkeK+3sWOcK4Z1jxtAmOBCz2HMgjgwY9Up8ZbaPj+coXyuzIvTr6u266DgTkHx2Cs0gXy1+6wnjtXhG0qi6uLMnk2+HZCKdogZ3v1GvENic1ZeHJKsJAfx4w= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.56) by DB6PR0301MB2133.eurprd03.prod.outlook.com (2603:10a6:4:46::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:44 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Tue, 10 Oct 2017 18:57:40 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Tue, 10 Oct 2017 18:52:49 +0300 Message-Id: <1507650771-16631-10-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: VI1PR08CA0220.eurprd08.prod.outlook.com (2603:10a6:802:15::29) To DB6PR0301MB2133.eurprd03.prod.outlook.com (2603:10a6:4:46::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33366ba7-8be7-4fc0-39c0-08d50ff7a548 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DB6PR0301MB2133; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0301MB2133; 3:2sqO5Hxq/vvfeSb4fw1Dm8ipf3dpD6Xk8S9zEXgA5KBEfKruLvNj5EaB6+jsq88YWrvcuuJbMwcFIP9HGCnqfxvIFCg6cPrmUjLuRpidfQmSFPl9TifstG+x1o3SSYDCXAyyV6tGdJYrhmyJj7kcZgMJ74+r7BYDvTJgJ5qdptG71E9qEpAZGaFo88JyJUKZ6qUnZdxSCnlOJ+qE1dWrRz6NT0gfwfNnlDPDGSW5nKAB/uwJkK78wNIKXetWN7S5; 25:mJQOF41v8eaaFT0GFVhWrYu2hpf3/SY73biw07kb53mo4nI5RnjrtyCkiFL3cf4WCXi+K3IqtpJjGxrMt8JpCeS8O3Q3I8xRCvag4jhZRXIcSlC5FcT47KoQ/B4zIxjJGlnzJNHoHMHeS5lxnXsOdGCmY5TjECUmEgh+55FenscjtNwOM9hccunv4RsZh/ZHctQy5yv/XPFmfxs/yNjyoaJZUSJEcUXsYN4JsGafzGQ47veHt9SPxTwOSfIc2gTy7C/C+Ulmxl6zHRPn3pIrzzhKHOG+qyYYRGEqrqvLye7jMrzmmXVXC9ZCcJsA0r3uPea1/Llj1fIIpvaRgr/zyQ==; 31:bf0r7/aBqxWy29Bg92gklV+Ix4VELmJ17nxHLHo73bVWgG8d2PWQIW8jK52MLshcxEU7jMhrgNvZV0Mu8gtnWJpCV8UF5Gu4FGHIWFCt1bosX3la1fC4C5O8Z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: 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)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0301MB2133; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0301MB2133; X-Forefront-PRVS: 04569283F9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(189002)(199003)(6916009)(575784001)(50986999)(66066001)(2950100002)(76176999)(106356001)(5003940100001)(47776003)(305945005)(105586002)(8676002)(33646002)(7736002)(4326008)(101416001)(2351001)(81166006)(189998001)(2906002)(8936002)(72206003)(86362001)(36756003)(81156014)(97736004)(8656003)(80792005)(68736007)(6116002)(3846002)(2361001)(54906003)(478600001)(5660300001)(42186006)(50466002)(316002)(48376002)(16586007)(122856001)(53936002)(8666007)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0301MB2133; 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; DB6PR0301MB2133; 23:4/iaH9MZlbK8ZAvdTFTBB/YwFavQ171SHPyaQRA?= =?us-ascii?Q?dVQWkExMM1Cx/lZ5MPGajSiSLhBGDHiVXmQCc/h7EHH/0mTGU9HugFQ/7p1Y?= =?us-ascii?Q?5+lWBIWQtCwarnhjuyrtYZ+gA50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SYbVjPcQ3k0LaryRQ3hCpJiWAU9ynEnZRn1qFo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2017 15:57:44.1324 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0301MB2133 Cc: "Edgar E . Iglesias" , Julien Grall , Stefano Stabellini , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v8 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 --- 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 b20ba6f..fd31e0b 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 = (uint32_t)get_user_reg(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