From patchwork Fri Oct 14 15:42:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 9376993 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8378D60779 for ; Fri, 14 Oct 2016 15:44:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 745712A783 for ; Fri, 14 Oct 2016 15:44:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68C0C2A785; Fri, 14 Oct 2016 15:44:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 76B892A784 for ; Fri, 14 Oct 2016 15:43:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bv4co-0003ZE-Cj; Fri, 14 Oct 2016 15:42:22 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bv4cf-0003Up-56 for linux-arm-kernel@lists.infradead.org; Fri, 14 Oct 2016 15:42:17 +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 1C77516; Fri, 14 Oct 2016 08:41:52 -0700 (PDT) Received: from red-moon (red-moon.cambridge.arm.com [10.1.206.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 891653F318; Fri, 14 Oct 2016 08:41:50 -0700 (PDT) Date: Fri, 14 Oct 2016 16:42:31 +0100 From: Lorenzo Pieralisi To: Laszlo Ersek Subject: Re: aarch64 ACPI boot regressed by commit 7ba5f605f3a0 ("arm64/numa: remove the limitation that cpu0 must bind to node0") Message-ID: <20161014154231.GA4411@red-moon> References: <4a64cd93-5ead-aad6-1057-f42224d65b43@redhat.com> <20161014080524.4hm2b4p373r7rhel@hawk.localdomain> <04f22a79-301b-f05b-033d-c7a24c9f4084@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161014_084213_252411_C56E807B X-CRM114-Status: GOOD ( 16.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Huang , Andrew Jones , Ard Biesheuvel , Will Deacon , main kernel list , Hanjun Guo , Zhen Lei , linux-arm-kernel@lists.infradead.org, Shannon Zhao Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Oct 14, 2016 at 05:27:58PM +0200, Laszlo Ersek wrote: > On 10/14/16 17:01, Laszlo Ersek wrote: > > > Maybe the code I > > tried to analyze in this email was never *meant* to associate CPU#0 with > > any NUMA node at all (not even node 0); instead, other code -- for > > example code removed by 7ba5f605f3a0 -- was meant to perform that > > association. > > Staring a bit more at the code, this looks very likely; in acpi_map_gic_cpu_interface() we have > > > /* Check if GICC structure of boot CPU is available in the MADT */ > > if (cpu_logical_map(0) == hwid) { > > if (bootcpu_valid) { > > pr_err("duplicate boot CPU MPIDR: 0x%llx in MADT\n", > > hwid); > > return; > > } > > bootcpu_valid = true; > > return; > > } > > which means that this callback function (for parsing the GICC > structures in the MADT) expects to find the boot processor as well. > > Upon finding the boot processor, we set bootcpu_valid to true, and > that's it -- no association with any NUMA node, and no incrementing of > "cpu_count". Yes, because that's to check the MADT contains the boot cpu hwid. Does this help (compile tested only) ? -- >8 -- Tested-by: Laszlo Ersek Reported-by: Laszlo Ersek diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index d3f151c..8507703 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -544,6 +544,7 @@ static int __init smp_cpu_setup(int cpu) return; } bootcpu_valid = true; + early_map_cpu_to_node(0, acpi_numa_get_nid(0, hwid)); return; }