From patchwork Sat Jan 23 09:20:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 60241 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp352252lbb; Sat, 23 Jan 2016 01:24:48 -0800 (PST) X-Received: by 10.194.22.101 with SMTP id c5mr8450115wjf.151.1453541082720; Sat, 23 Jan 2016 01:24:42 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [50.57.142.19]) by mx.google.com with ESMTPS id b126si9917171wmh.108.2016.01.23.01.24.42 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 23 Jan 2016 01:24:42 -0800 (PST) Received-SPF: neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=50.57.142.19; Authentication-Results: mx.google.com; spf=neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aMuPJ-0007g8-NK; Sat, 23 Jan 2016 09:22:57 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aMuPI-0007fg-Op for xen-devel@lists.xen.org; Sat, 23 Jan 2016 09:22:56 +0000 Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id 21/0B-08977-07643A65; Sat, 23 Jan 2016 09:22:56 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-14.tower-21.messagelabs.com!1453540969!11684420!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 33685 invoked from network); 23 Jan 2016 09:22:54 -0000 Received: from szxga02-in.huawei.com (HELO szxga02-in.huawei.com) (119.145.14.65) by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 23 Jan 2016 09:22:54 -0000 Received: from 172.24.1.47 (EHLO szxeml427-hub.china.huawei.com) ([172.24.1.47]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DAK81958; Sat, 23 Jan 2016 17:22:26 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml427-hub.china.huawei.com (10.82.67.182) with Microsoft SMTP Server id 14.3.235.1; Sat, 23 Jan 2016 17:22:17 +0800 From: Shannon Zhao To: Date: Sat, 23 Jan 2016 17:20:01 +0800 Message-ID: <1453540813-15764-10-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1453540813-15764-1-git-send-email-zhaoshenglong@huawei.com> References: <1453540813-15764-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.0A090202.56A34652.0116, 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: 4b5e125ee8573957416980e0feb5dec1 Cc: ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, peter.huangpeng@huawei.com, julien.grall@citrix.com, stefano.stabellini@citrix.com, shannon.zhao@linaro.org Subject: [Xen-devel] [PATCH v4 09/21] arm/acpi: Add ACPI support for SMP initialization X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org 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 --- 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(-) -- 2.0.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel 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