From patchwork Mon Apr 11 13:33:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 65517 Delivered-To: patch@linaro.org Received: by 10.112.43.237 with SMTP id z13csp1477290lbl; Mon, 11 Apr 2016 06:35:29 -0700 (PDT) X-Received: by 10.159.40.9 with SMTP id c9mr11503143uac.146.1460381715559; Mon, 11 Apr 2016 06:35:15 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 5si5856658vkm.46.2016.04.11.06.35.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Apr 2016 06:35:15 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 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.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apbyP-0004ws-Id; Mon, 11 Apr 2016 13:33:49 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apbyO-0004wQ-By for xen-devel@lists.xen.org; Mon, 11 Apr 2016 13:33:48 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id BB/9F-19343-BB7AB075; Mon, 11 Apr 2016 13:33:47 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRWlGSWpSXmKPExsVysyfVTXf3cu5 wg5sP2S2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oyFC08xFdzhqXjbfZmxgfE/ZxcjF4eQwCZG ibvz1rFDOKcZJTpWLWTuYuTkYBPQlLjz+RMTiC0iIC1x7fNlRhCbWSBKYv2mblYQW1ggVqLv7 j2wehYBVYl365eygdi8As4SjWtms4DYEgJyEiePTQar5xRwkVh4/hOQzQG0zFmieVbwBEbuBY wMqxjVi1OLylKLdM30kooy0zNKchMzc3QNDYz1clOLixPTU3MSk4r1kvNzNzECvVvPwMC4g/F Km/MhRkkOJiVR3p3zucOF+JLyUyozEosz4otKc1KLDzHKcHAoSfDWLAPKCRalpqdWpGXmAMMM Ji3BwaMkwjsPJM1bXJCYW5yZDpE6xagoJc7bBJIQAElklObBtcFC+xKjrJQwLyMDA4MQT0FqU W5mCar8K0ZxDkYlYd50kCk8mXklcNNfAS1mAlr87B8nyOKSRISUVAOjju7M1E0aUVNaJkmxX+ uIEVn2sy9m93PHhXEnOJ7dKtqi7df9SdLtjMHv22VpAawZLs7q22V++HhPtlkYdDsk0phXf/F 1y+MSWev/eDI8Z+Q9ECj+dqn5G/6KDG21TSKz67U+aGq38Iu9+fvw1+Z5Two5Xr8xrTwU+G1D Sw/v+WUPVzMkXJ+vxFKckWioxVxUnAgAT+GhXGgCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-10.tower-31.messagelabs.com!1460381625!33499926!2 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1796 invoked from network); 11 Apr 2016 13:33:46 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-10.tower-31.messagelabs.com with SMTP; 11 Apr 2016 13:33:46 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C17FB46B; Mon, 11 Apr 2016 06:32:33 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.215.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E5CA63F21A; Mon, 11 Apr 2016 06:33:45 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 11 Apr 2016 14:33:36 +0100 Message-Id: <1460381617-5786-5-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460381617-5786-1-git-send-email-julien.grall@arm.com> References: <1460381617-5786-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, shannon.zhao@linaro.org Subject: [Xen-devel] [for-4.7 v2 4/5] xen/arm: acpi: Remove uncessary check in acpi_map_gic_cpu_interface 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" This part of the code will never be executed when the entry corresponds to the boot CPU. Also print an error message rather when arch_cpu_init has failed. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini Reviewed-by: Shannon Zhao --- Changes in v2: - Add Stefano's and Shannon's reviewed-by --- xen/arch/arm/acpi/boot.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c index a952efd..f3d8e7c 100644 --- a/xen/arch/arm/acpi/boot.c +++ b/xen/arch/arm/acpi/boot.c @@ -51,6 +51,7 @@ static void __init acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor) { int i; + int rc; u64 mpidr = processor->arm_mpidr & MPIDR_HWID_MASK; bool_t enabled = !!(processor->flags & ACPI_MADT_ENABLED); @@ -102,16 +103,16 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor) if ( !acpi_psci_present() ) return; - /* CPU 0 was already initialized */ - if ( enabled_cpus ) + if ( (rc = arch_cpu_init(enabled_cpus, NULL)) < 0 ) { - if ( arch_cpu_init(enabled_cpus, NULL) < 0 ) - return; - - /* map the logical cpu id to cpu MPIDR */ - cpu_logical_map(enabled_cpus) = mpidr; + printk("cpu%d: init failed (0x%"PRIx64" MPIDR): %d\n", + enabled_cpus, mpidr, rc); + return; } + /* map the logical cpu id to cpu MPIDR */ + cpu_logical_map(enabled_cpus) = mpidr; + enabled_cpus++; }