From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDA1FD6D231 for ; Wed, 27 Nov 2024 19:34:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yyq78bBs6QSFypU323KCfz+fCWQyP8KaKkGXbEcs2lo=; b=qlzY6qY+auPOMz qZJRp+EKoFMVad5mbtfsTw3PZ5Vo/Ahzx0XeOA+rZPrLqBMOM0QPeHpdYuN+Wja41uvpxziZjzFZJ Gv0kzzk0kfwCX7ZABDkO7SY5Gi0WI7DmxdpXttZECLlstFhUkJdTT/07Zo6fgR2bgTiKcXo/4M0ro oTBWydPPu+lbSU0Y10162XZxgKBatIdGug7/do3xCFhH+bO2eQ8o9/0NqajZmn9q1L34HvQ9foq95 O7BFW+YaB6+PWA2aLo8430yQDvv4eU2CQPkQztGc3z9CkEffNAUK7Y34nDDEPFtD+ljq0mYAu/g2C 3RsPxpxWn+blrv+ML1ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGNnh-0000000Dx3o-3Ufv; Wed, 27 Nov 2024 19:34:13 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGNlk-0000000DwhB-0X5k; Wed, 27 Nov 2024 19:32:13 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 25421A439F3; Wed, 27 Nov 2024 19:30:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BD69C4CED2; Wed, 27 Nov 2024 19:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732735930; bh=xrciW+EMhZ5UEofbJw9NwB4YNk6WJ7ZsUg3ugalAKtY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=X2BtrIqNGPOvV+49M5YnEnvMfq90m+ylhD7PzWNtlQWXRcWLiIC9o7ibIu7Z+6NCF kcXzlV4NXbHYexopnI8wyMqZtXl1aARG1Kv+1kHo2QdWtEH8r51A6kx0Z+b8YMEuGQ KkVWB5pfPFETZ3jygkOvTt1oTUJ7ox8ovqX6d1E+iA+5p2Dg3oRun7qGKNbz7lmsz9 P2yGA8boYanYTYFxQR6QsePoSp98SjRizDnHD/Y6HoJ2E4HX1u+AiXq7pnGqhQjajY UFL0t9n5dlc0Yh9Rql7BGoHCScG0i7PhlQ+71XDRGrapyLXfaRB16QrJ7c3W0qJT2C zsuLVCEMA8n/A== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tGNlf-00GLsr-Kw; Wed, 27 Nov 2024 19:32:07 +0000 Date: Wed, 27 Nov 2024 19:32:06 +0000 Message-ID: <867c8ov5ft.wl-maz@kernel.org> From: Marc Zyngier To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Alexander Gordeev , Andreas Larsson , Andrew Morton , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christophe Leroy , Dan Williams , Dave Hansen , David Hildenbrand , "David S. Miller" , Davidlohr Bueso , Greg Kroah-Hartman , Heiko Carstens , Huacai Chen , Ingo Molnar , Jiaxun Yang , John Paul Adrian Glaubitz , Jonathan Cameron , Jonathan Corbet , Michael Ellerman , Palmer Dabbelt , "Rafael J. Wysocki" , Rob Herring , Samuel Holland , Thomas Bogendoerfer , Thomas Gleixner , Vasily Gorbik , Will Deacon , Zi Yan , devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-cxl@vger.kernel.org, linux-doc@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, nvdimm@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org, Jonathan Cameron Subject: Re: [PATCH v4 24/26] arch_numa: switch over to numa_memblks In-Reply-To: <20240807064110.1003856-25-rppt@kernel.org> References: <20240807064110.1003856-1-rppt@kernel.org> <20240807064110.1003856-25-rppt@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: rppt@kernel.org, linux-kernel@vger.kernel.org, agordeev@linux.ibm.com, andreas@gaisler.com, akpm@linux-foundation.org, arnd@arndb.de, bp@alien8.de, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, dan.j.williams@intel.com, dave.hansen@linux.intel.com, david@redhat.com, davem@davemloft.net, dave@stgolabs.net, gregkh@linuxfoundation.org, hca@linux.ibm.com, chenhuacai@kernel.org, mingo@redhat.com, jiaxun.yang@flygoat.com, glaubitz@physik.fu-berlin.de, jonathan.cameron@huawei.com, corbet@lwn.net, mpe@ellerman.id.au, palmer@dabbelt.com, rafael@kernel.org, robh@kernel.org, samuel.holland@sifive.com, tsbogend@alpha.franken.de, tglx@linutronix.de, gor@linux.ibm.com, will@kernel.org, ziy@nvidia.com, devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-cxl@vger.kernel.org, linux-doc@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.k ernel.org, linux-sh@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, nvdimm@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org, Jonathan.Cameron@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241127_113212_293313_E0EA8184 X-CRM114-Status: GOOD ( 25.63 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi Mike, Sorry for reviving a rather old thread. On Wed, 07 Aug 2024 07:41:08 +0100, Mike Rapoport wrote: > > From: "Mike Rapoport (Microsoft)" > > Until now arch_numa was directly translating firmware NUMA information > to memblock. > > Using numa_memblks as an intermediate step has a few advantages: > * alignment with more battle tested x86 implementation > * availability of NUMA emulation > * maintaining node information for not yet populated memory > > Adjust a few places in numa_memblks to compile with 32-bit phys_addr_t > and replace current functionality related to numa_add_memblk() and > __node_distance() in arch_numa with the implementation based on > numa_memblks and add functions required by numa_emulation. > > Signed-off-by: Mike Rapoport (Microsoft) > Tested-by: Zi Yan # for x86_64 and arm64 > Reviewed-by: Jonathan Cameron > Tested-by: Jonathan Cameron [arm64 + CXL via QEMU] > Acked-by: Dan Williams > Acked-by: David Hildenbrand > --- > drivers/base/Kconfig | 1 + > drivers/base/arch_numa.c | 201 +++++++++++-------------------------- > include/asm-generic/numa.h | 6 +- > mm/numa_memblks.c | 17 ++-- > 4 files changed, 75 insertions(+), 150 deletions(-) > [...] > static int __init numa_register_nodes(void) > { > int nid; > - struct memblock_region *mblk; > - > - /* Check that valid nid is set to memblks */ > - for_each_mem_region(mblk) { > - int mblk_nid = memblock_get_region_node(mblk); > - phys_addr_t start = mblk->base; > - phys_addr_t end = mblk->base + mblk->size - 1; > - > - if (mblk_nid == NUMA_NO_NODE || mblk_nid >= MAX_NUMNODES) { > - pr_warn("Warning: invalid memblk node %d [mem %pap-%pap]\n", > - mblk_nid, &start, &end); > - return -EINVAL; > - } > - } > This hunk has the unfortunate side effect of killing my ThunderX extremely early at boot time, as this sorry excuse for a machine really relies on the kernel recognising that whatever NUMA information the FW offers is BS. Reverting this hunk restores happiness (sort of). FWIW, I've posted a patch with such revert at [1]. Thanks, M. [1] https://lore.kernel.org/r/20241127193000.3702637-1-maz@kernel.org -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv