From patchwork Thu Apr 7 10:59:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 65288 Delivered-To: patch@linaro.org Received: by 10.112.43.237 with SMTP id z13csp3290lbl; Thu, 7 Apr 2016 04:01:28 -0700 (PDT) X-Received: by 10.55.79.17 with SMTP id d17mr2621204qkb.56.1460026886317; Thu, 07 Apr 2016 04:01:26 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id e3si5465472qhd.6.2016.04.07.04.01.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Apr 2016 04:01:26 -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 1ao7fT-0003j7-7a; Thu, 07 Apr 2016 11:00:07 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ao7fR-0003eN-TM for xen-devel@lists.xen.org; Thu, 07 Apr 2016 11:00:06 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id 18/6D-23864-5BD36075; Thu, 07 Apr 2016 11:00:05 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTXeLLVu 4wd3L6hZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8avFe/YC5p5K75uu8PewNjD1cXIxSEksIlR 4vLB7SwQzmlGiRVPD7J3MXJysAloStz5/IkJxBYRkJa49vkyI4jNLBAlsX5TNyuILSyQInFgW SNYnEVAVWLm1r9gcV4BF4krr86CzZEQkJM4eWwyUJyDg1PAVeLTvQCQsBBQyavGmSwTGLkXMD KsYtQoTi0qSy3SNTTWSyrKTM8oyU3MzNE1NDDWy00tLk5MT81JTCrWS87P3cQI9C8DEOxg3Lb d8xCjJAeTkijvWSm2cCG+pPyUyozE4oz4otKc1OJDjDIcHEoSvJNsgHKCRanpqRVpmTnAQINJ S3DwKInw/gNJ8xYXJOYWZ6ZDpE4xKkqJ8+4HSQiAJDJK8+DaYMF9iVFWSpiXEegQIZ6C1KLcz BJU+VeM4hyMSsK8/SBTeDLzSuCmvwJazAS0+AI/2OKSRISUVAOj5qaZd5MyvomI37BcNOH3LZ scL7eXbY/EtNZvWSh1Ns6LX2uJ39mlrMyPt/MlbLkpmrHbt/PDuUulDjdqP3dL+96JkFFe8/z Ru3ft0w5X5Gy+XzVxR9XtamftsCCG4sfSTJZbKiZITO8/HWiYOjtMP9n5kmh54wne+brX/jKI fLpY/v1Vu+xUJZbijERDLeai4kQAinfwAWkCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1460026804!16772829!1 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 14332 invoked from network); 7 Apr 2016 11:00:04 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-12.tower-31.messagelabs.com with SMTP; 7 Apr 2016 11:00:04 -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 B2AAA406; Thu, 7 Apr 2016 03:58:52 -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 171D53F25E; Thu, 7 Apr 2016 04:00:02 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 7 Apr 2016 11:59:53 +0100 Message-Id: <1460026796-10899-3-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460026796-10899-1-git-send-email-julien.grall@arm.com> References: <1460026796-10899-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, shannon.zhao@linaro.org Subject: [Xen-devel] [for-4.7 2/5] xen/arm: acpi: The boot CPU does not always match the first entry in the MADT 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" Since the ACPI 6.0 errata document [1], the first entry in the MADT does not have to correspond to the boot CPU. Introduce a new variable to know if a MADT entry matching the boot CPU is found. Furthermore, it's not necessary to check if the MPIDR is duplicated for the boot CPU. So the rest of the function can be skipped. [1] 1380 Unnecessary restrictions to FW vendors in ordering of GIC structures in MADT Signed-off-by: Julien Grall --- xen/arch/arm/acpi/boot.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c index 859aa86..2a71660 100644 --- a/xen/arch/arm/acpi/boot.c +++ b/xen/arch/arm/acpi/boot.c @@ -37,7 +37,8 @@ #include /* Processors with enabled flag and sane MPIDR */ -static unsigned int enabled_cpus; +static unsigned int enabled_cpus = 1; +static bool __initdata bootcpu_valid; /* total number of cpus in this system */ static unsigned int __initdata total_cpus; @@ -71,10 +72,15 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor) } /* Check if GICC structure of boot CPU is available in the MADT */ - if ( (enabled_cpus == 0) && (cpu_logical_map(0) != mpidr) ) + if ( cpu_logical_map(0) == mpidr ) { - printk("Firmware bug, invalid CPU MPIDR for cpu0: 0x%"PRIx64" in MADT\n", - mpidr); + if ( bootcpu_valid ) + { + printk("Firmware bug, duplicate boot CPU MPIDR: 0x%"PRIx64" in MADT\n", + mpidr); + return; + } + bootcpu_valid = true; return; }