From patchwork Fri Feb 26 06:22:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8431881 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 389669F52D for ; Fri, 26 Feb 2016 06:26:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4938E203A1 for ; Fri, 26 Feb 2016 06:26:52 +0000 (UTC) Received: from lists.xen.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.kernel.org (Postfix) with ESMTPS id 48F1C2039C for ; Fri, 26 Feb 2016 06:26:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aZBpL-0006Jx-HJ; Fri, 26 Feb 2016 06:24:35 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aZBpJ-0006FB-Uq for xen-devel@lists.xen.org; Fri, 26 Feb 2016 06:24:34 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id 72/3F-03883-1AFEFC65; Fri, 26 Feb 2016 06:24:33 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-12.tower-206.messagelabs.com!1456467866!25140560!1 X-Originating-IP: [58.251.152.64] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19531 invoked from network); 26 Feb 2016 06:24:31 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (58.251.152.64) by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 26 Feb 2016 06:24:31 -0000 Received: from 172.24.1.47 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.1.47]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DFG21607; Fri, 26 Feb 2016 14:24:09 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.235.1; Fri, 26 Feb 2016 14:23:55 +0800 From: Shannon Zhao To: Date: Fri, 26 Feb 2016 14:22:47 +0800 Message-ID: <1456467780-8476-10-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1456467780-8476-1-git-send-email-zhaoshenglong@huawei.com> References: <1456467780-8476-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.56CFEF8A.008B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: dd186e7b469bd2900a1b2880c1ba93cc Cc: peter.huangpeng@huawei.com, stefano.stabellini@citrix.com, ian.campbell@citrix.com, shannon.zhao@linaro.org Subject: [Xen-devel] [PATCH v5 09/22] arm/acpi: Add ACPI support for SMP initialization 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shannon Zhao ACPI 5.1 only has two explicit methods to boot up SMP, PSCI and Parking protocol, but the Parking protocol is only specified for ARMv7 now, so make PSCI as the only way for the SMP boot protocol before some updates for the ACPI spec or the Parking protocol spec. ACPI only supports PSCI 0.2+, since prior to PSCI 0.2 function IDs are not well-defined. Signed-off-by: Hanjun Guo Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- V4: explain why only support PSCI 0.2+ and print an error message for PSCI 0.1 and SMC not present --- xen/arch/arm/arm64/smpboot.c | 7 ++++++- xen/arch/arm/psci.c | 35 ++++++++++++++++++++++++++++------- xen/arch/arm/smpboot.c | 7 ++++++- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c index 7928f69..4fd0ac6 100644 --- a/xen/arch/arm/arm64/smpboot.c +++ b/xen/arch/arm/arm64/smpboot.c @@ -7,6 +7,7 @@ #include #include #include +#include struct smp_enable_ops { int (*prepare_cpu)(int); @@ -96,7 +97,11 @@ static int __init dt_arch_cpu_init(int cpu, struct dt_device_node *dn) int __init arch_cpu_init(int cpu, struct dt_device_node *dn) { - return dt_arch_cpu_init(cpu, dn); + if ( acpi_disabled ) + return dt_arch_cpu_init(cpu, dn); + else + /* acpi only supports psci at present */ + return smp_psci_init(cpu); } int __init arch_cpu_up(int cpu) diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c index d800cb6..7966b5e 100644 --- a/xen/arch/arm/psci.c +++ b/xen/arch/arm/psci.c @@ -22,6 +22,7 @@ #include #include #include +#include /* * While a 64-bit OS can make calls with SMC32 calling conventions, for @@ -86,6 +87,12 @@ int __init psci_init_0_1(void) int ret; const struct dt_device_node *psci; + if ( !acpi_disabled ) + { + printk("PSCI 0.1 is not supported when using ACPI\n"); + return -EINVAL; + } + psci = dt_find_compatible_node(NULL, NULL, "arm,psci"); if ( !psci ) return -EOPNOTSUPP; @@ -116,15 +123,26 @@ int __init psci_init_0_2(void) { /* sentinel */ }, }; int ret; - const struct dt_device_node *psci; - psci = dt_find_matching_node(NULL, psci_ids); - if ( !psci ) - return -EOPNOTSUPP; + if ( acpi_disabled ) + { + const struct dt_device_node *psci; - ret = psci_is_smc_method(psci); - if ( ret ) - return -EINVAL; + psci = dt_find_matching_node(NULL, psci_ids); + if ( !psci ) + return -EOPNOTSUPP; + + ret = psci_is_smc_method(psci); + if ( ret ) + return -EINVAL; + } + else + { + if ( acpi_psci_hvc_present() ) { + printk("PSCI conduit must be SMC, but is HVC\n"); + return -EINVAL; + } + } psci_ver = call_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0); @@ -148,6 +166,9 @@ int __init psci_init(void) { int ret; + if ( !acpi_disabled && !acpi_psci_present() ) + return -EOPNOTSUPP; + ret = psci_init_0_2(); if ( ret ) ret = psci_init_0_1(); diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index b6119d1..c5109bf 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -31,6 +31,7 @@ #include #include #include +#include cpumask_t cpu_online_map; cpumask_t cpu_present_map; @@ -247,7 +248,11 @@ void __init smp_init_cpus(void) return; } - dt_smp_init_cpus(); + if ( acpi_disabled ) + dt_smp_init_cpus(); + else + acpi_smp_init_cpus(); + } int __init