From patchwork Tue Nov 17 09:40:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 56729 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1825927lbb; Tue, 17 Nov 2015 01:45:22 -0800 (PST) X-Received: by 10.31.54.7 with SMTP id d7mr2645006vka.134.1447753522578; Tue, 17 Nov 2015 01:45:22 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [50.57.142.19]) by mx.google.com with ESMTPS id p203si2018543vkp.169.2015.11.17.01.45.22 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Nov 2015 01:45:22 -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; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zyco2-0003l2-BS; Tue, 17 Nov 2015 09:44:06 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zyco0-0003j2-OS for xen-devel@lists.xen.org; Tue, 17 Nov 2015 09:44:04 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id 2C/55-02940-4E6FA465; Tue, 17 Nov 2015 09:44:04 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-10.tower-31.messagelabs.com!1447753443!4200351!1 X-Originating-IP: [74.125.82.45] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.19.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34101 invoked from network); 17 Nov 2015 09:44:03 -0000 Received: from mail-wm0-f45.google.com (HELO mail-wm0-f45.google.com) (74.125.82.45) by server-10.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Nov 2015 09:44:03 -0000 Received: by wmww144 with SMTP id w144so145592007wmw.1 for ; Tue, 17 Nov 2015 01:44:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NKudHueKni7+0C9nKEWb7tfv9fPk7NKOE7RKNPdSgQU=; b=vGiQ2KmAWe5SAmmEbrx7/4/sbUgSBieSD73RBaXdgE6PYBUkmtSiaV8hRO1KWT5ivw r6u7n8cROix53KM9+MLRGwVn9pmTINhu1Puy99oMoloGEn2f9BZtRv99MunwAQfi+bmo ugziBFwGzKbh+23I0Y9n5Fqg9Lu7VuvAmgzowdocW5LfRk3ugC/KDbbJCw5oAm9Uccm2 bsOwjGj+ks2y7hLsIo3fdGRIRWWw1cq1wsfvI6CgCEKgz5/yd1X6XUqjIp4CSwHSMHUU 3d+/BOJ1FS/+w12diBqBs37TbC+H8pEdgXEck3G/Bbvmj2HwcvlnVFhHECp9ljqeZV8O KTew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NKudHueKni7+0C9nKEWb7tfv9fPk7NKOE7RKNPdSgQU=; b=f/TOPVROJs87fa17sj5H9g37r0dCNxa91eIMwTX2v0XFN/TJH/KO0GlMMGaqLW7a6v Q7FAcDXVa4wqqtizlK75h39eFSlKxSusUfXqkcyIZRj3TG6vXdmrROADloe3rEXQf4Hm +OLbaOh9VPffizpobRKXpwdnWuF2wLJ6N4N28ayr85yxblcYDsoHgD+F0pOxE7ZBAI3+ YcxiRTJXsdGLxmbDtf3B33Tkj9hqCY5XZ4MNEsq6Z613jzhlY9XTj8m2Bj045nepQCKl TSrx51ChjUseBlsa0KPCxPIxB3KkmD1p/X0el6tCRpOK+iKQ9ERzZckr8o/qRJ1gf899 Apug== X-Gm-Message-State: ALoCoQk5vDUOP5V29rK34uDk46j2GKqqzPO5T5f67BAgwYsp+IS2DhjV1C/O9POD0ZCSsyldvVGR X-Received: by 10.195.12.67 with SMTP id eo3mr48006430wjd.158.1447753443010; Tue, 17 Nov 2015 01:44:03 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id l128sm22939166wmf.10.2015.11.17.01.44.00 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:44:02 -0800 (PST) From: shannon.zhao@linaro.org To: ian.campbell@citrix.com, stefano.stabellini@citrix.com, keir@xen.org, jbeulich@suse.com, andrew.cooper3@citrix.com, julien.grall@citrix.com, xen-devel@lists.xen.org Date: Tue, 17 Nov 2015 17:40:19 +0800 Message-Id: <1447753261-7552-21-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> References: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> Cc: mark.rutland@arm.com, hangaohuai@huawei.com, ard.biesheuvel@linaro.org, shannon.zhao@linaro.org, christoffer.dall@linaro.org, peter.huangpeng@huawei.com, david.vrabel@citrix.com, zhaoshenglong@huawei.com, linux-arm-kernel@lists.infradead.org, roger.pau@citrix.com Subject: [Xen-devel] [PATCH v3 20/62] 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: , MIME-Version: 1.0 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. Signed-off-by: Hanjun Guo Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao --- xen/arch/arm/arm64/smpboot.c | 7 ++++++- xen/arch/arm/psci.c | 30 +++++++++++++++++++++++------- xen/arch/arm/smpboot.c | 7 ++++++- 3 files changed, 35 insertions(+), 9 deletions(-) -- 2.1.0 _______________________________________________ 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..93cb6b3 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..dede0e1 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,9 @@ int __init psci_init_0_1(void) int ret; const struct dt_device_node *psci; + if ( !acpi_disabled ) + return -EINVAL; + psci = dt_find_compatible_node(NULL, NULL, "arm,psci"); if ( !psci ) return -EOPNOTSUPP; @@ -116,15 +120,24 @@ 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() ) + return -EINVAL; + } psci_ver = call_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0); @@ -148,6 +161,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 d115228..513f1f6 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