Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp635103lqp; Wed, 22 May 2024 15:12:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXWNMqv7TBfbNA6OtV4bOAcM3ZHBscBGTLNEDM/GtgFcQNASOHtVuy2GR7YxSWinZ38N/1DkQ+7uIOnECAriSkhTwBQxHmHKPb2OKLvNg== X-Google-Smtp-Source: AGHT+IGSfDiMKAN03308XgYkpSh1WKZf5qxu13GiojB4xwFkd7Dvx8ZMjj9GrPqeCcH5dF8iPUMh X-Received: by 2002:a50:cd55:0:b0:572:67d9:6c3b with SMTP id 4fb4d7f45d1cf-57832c3414amr2735817a12.26.1716415963777; Wed, 22 May 2024 15:12:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716415963; cv=pass; d=google.com; s=arc-20160816; b=qNCVT2wBkjiNDS2Tzn7Cql/ts2Hhd56yJfPZ08gxo4BP2V9WtL0a16EBJ8rwcsFtaC FpShg7HMgZn7EhBDvbParPGzgHYaS2qlnxHU68TNjLuZBY/1q0Ywb/YdbAB7YEsC/yMy Zqgkz79bu3QiOVTKLMAJqYm/wfxF66T0crUsB9sOSoiTZFn957ndPuqwpukc8AeiUgEb gxewqk0zJR7yHou2WZWzo8bTPa1UHxoOq4m/pSgtWmxVpok/EXlmPvmxl4VynhfPzhBJ lj/65qwTNGOJ/OkC1wDXvThBQNIeZ9HqYAeg1qbDUoMutoUYAIHCkHxlVdcrGRfXn2NE 1kUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:feedback-id:dkim-signature:dkim-signature; bh=FkzvYbbtwbTq/IMNI6fnNl25+bgGMeKMwC6fOZkXiYQ=; fh=dDGKIMcG3H+q3nWvOlO7AA2IrGQ/jjD28aNw+O4OeK0=; b=CYOwimyglZbgF5r2TWOP+pmTjeWa6bA/ce8me3qPyX0uweCVno3w2KVAUlSYaztm8m p6XQnRBg2apikzZKrAnzwKRvGMDA1dpULF9G2CHjtEYRTxBxst51tHivrhdoEUuPMZD0 i7pBdQMr8d1K+HPmUybS1LEY2FP9KJYFcJG07tDVQ/XMrqn2A0ta2mi4KUA9QkoiJS4y Vr/BOua8PZBNxniMzec6sHqNNyveM/7DQDOzjFY9jf8rLjqB1FzvEC/wtzBGzjW37gD2 lWO4D9YuhZbfitrW0K0p0+nfNnqH501DMCs+OwNUUKc09wdZdTe2EdiY80UcMDH5ZOHv k2AQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=yLv6Zc1C; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="eb/UX+9g"; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-186760-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186760-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5780a3dd4e0si3655898a12.242.2024.05.22.15.12.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 15:12:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186760-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=yLv6Zc1C; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="eb/UX+9g"; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-186760-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186760-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7B4A01F225FB for ; Wed, 22 May 2024 22:02:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4243F1474CB; Wed, 22 May 2024 22:02:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="yLv6Zc1C"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="eb/UX+9g" Received: from wfout1-smtp.messagingengine.com (wfout1-smtp.messagingengine.com [64.147.123.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C51E0145FEA; Wed, 22 May 2024 22:02:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.144 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716415348; cv=none; b=TJ7u1yNld6rlJA5r7zQIewiyXIkDRVfNGQ44+4hxSnOwNTqMSZOwn3/G1VdknmlfprTZFepI1vEFm5N6NW1HtwV1qVeu4kC+Cq8D2u1DJ4+csXL2mbS7vQngDQgSTBtOp2g1MS4Jf58/uYw0doH2oCyxb117jJ1kRsOwphZEChQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716415348; c=relaxed/simple; bh=bV5a8vIs5ZyqDK7Cv5/U4BfY0cbpI8aMAyoT7FuVxIU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iUnvVXsbDPi+IgIyF3gyAkUa9ARxXRVe6ZSkX035MhiAhLLAlmh1brr/dlPXegFuUvICJPyw3v6qiP7f760KmmtuSBCaeN4TMxJyJaXPBgbu8G4sgot0Aplc4oFoHksy4kb/c03971f+8bXTV9u4FEGpz5OkPNefd1/Oa7cbvHI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com; spf=pass smtp.mailfrom=flygoat.com; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b=yLv6Zc1C; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=eb/UX+9g; arc=none smtp.client-ip=64.147.123.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flygoat.com Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.west.internal (Postfix) with ESMTP id F1C5C1C0015C; Wed, 22 May 2024 18:02:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 22 May 2024 18:02:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1716415345; x=1716501745; bh=FkzvYbbtwbTq/IMNI6fnNl25+bgGMeKMwC6fOZkXiYQ=; b= yLv6Zc1CrvK0e6hDMvGwqAe9LREkNt3ezKRFs1f53rCgNVvkigIWykcKrgsngHbK 3Z7u9f/PGbbehU+8ZC2g63ZGOPyoBFfxB9RPhNs4rAtD5PTrpelUjNzPsWOJsJjb CHOIOs65ykVpEvlg+gbpYKfxZVmfzCzH8nsJZUXzZdtTqiwQpF76Mtdg+H/KXfNh KybSMudHQqEiZtZTVXCJPVhq2lc/9UF7KpXM11weRgSWvGXGJ+ifEufFTl5Stsfk J5rcjVKX8ErgI30Lo+coKavpf30HoS7OC2h+j9hIbxxP8Vlpz6FY7nKwswgf5PC7 BestVd4xWTEqZUO5TKzKow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1716415345; x= 1716501745; bh=FkzvYbbtwbTq/IMNI6fnNl25+bgGMeKMwC6fOZkXiYQ=; b=e b/UX+9gHdH3XgGWYyfE+YH1vtrwMLlFXebfqhNi7yNed4JwOdKHfHsPKJSm4SnJ5 oOOnoq0a4BxJsbk+pmP9YuS6QFoRt6/A4RiL+RmG1ZKmvO1xs9tMxrP6dK3+EZud OcP7+g/pLXTDSc2EOIcSv/uVV32zcwjQAX1ND75JKpiZkzfC/zVS4Pj2QOHuIlo7 HDXn+77EC64qy6XRwX3VtGsiRxBt+WUbLP5NWwACqT6wYilWh7yFyCicDIDEI3H+ QIg9p2bUxvGrwuQSb82bs4NDgEhXPLKpACjAzwxj6iFBA0DkqzmXIBP0JsYi0HKq Ox3OAM32zSU2ImC2klqYA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeihedgtdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepvdekiefhfeevkeeuveetfeelffekgedugefhtdduudeghfeu veegffegudekjeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 May 2024 18:02:24 -0400 (EDT) From: Jiaxun Yang Date: Wed, 22 May 2024 23:02:18 +0100 Subject: [PATCH v3 2/4] LoongArch: smp: Add all CPUs enabled by fdt to NUMA node 0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240522-loongarch-booting-fixes-v3-2-25e77a8fc86e@flygoat.com> References: <20240522-loongarch-booting-fixes-v3-0-25e77a8fc86e@flygoat.com> In-Reply-To: <20240522-loongarch-booting-fixes-v3-0-25e77a8fc86e@flygoat.com> To: Huacai Chen , Binbin Zhou Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, Jiaxun Yang , stable@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1531; i=jiaxun.yang@flygoat.com; h=from:subject:message-id; bh=bV5a8vIs5ZyqDK7Cv5/U4BfY0cbpI8aMAyoT7FuVxIU=; b=owGbwMvMwCXmXMhTe71c8zDjabUkhjS/7Jylzhde9yt3RJXxCgo7TjN2sLr/ZI6r7OHIX5Fnr joolhR2lLIwiHExyIopsoQIKPVtaLy44PqDrD8wc1iZQIYwcHEKwE2exfDfV+QYU/OpOyW3uKrf nnpnNaEiemr2+7qtCn8/qtnNL9z0kpHhnNbPi//PcX/tWBIQXevZ0hKrdrvUVkB2/u1fasXqbeX cAA== X-Developer-Key: i=jiaxun.yang@flygoat.com; a=openpgp; fpr=980379BEFEBFBF477EA04EF9C111949073FC0F67 NUMA enabled kernel on FDT based machine fails to boot because CPUs are all in NUMA_NO_NODE and mm subsystem won't accept that. Fix by adding them to default NUMA node at FDT parsing phase and move numa_add_cpu(0) to a later point. Cc: stable@vger.kernel.org Fixes: 88d4d957edc7 ("LoongArch: Add FDT booting support from efi system table") Signed-off-by: Jiaxun Yang --- v3: Move numa_add_cpu(0) to a later point to ensure per_cpu is ready. --- arch/loongarch/kernel/smp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/loongarch/kernel/smp.c b/arch/loongarch/kernel/smp.c index 0dfe2388ef41..1436d2465939 100644 --- a/arch/loongarch/kernel/smp.c +++ b/arch/loongarch/kernel/smp.c @@ -273,7 +273,6 @@ static void __init fdt_smp_setup(void) if (cpuid == loongson_sysconf.boot_cpu_id) { cpu = 0; - numa_add_cpu(cpu); } else { cpu = cpumask_next_zero(-1, cpu_present_mask); } @@ -283,6 +282,9 @@ static void __init fdt_smp_setup(void) set_cpu_present(cpu, true); __cpu_number_map[cpuid] = cpu; __cpu_logical_map[cpu] = cpuid; + + early_numa_add_cpu(cpu, 0); + set_cpuid_to_node(cpuid, 0); } loongson_sysconf.nr_cpus = num_processors; @@ -468,6 +470,7 @@ void smp_prepare_boot_cpu(void) set_cpu_possible(0, true); set_cpu_online(0, true); set_my_cpu_offset(per_cpu_offset(0)); + numa_add_cpu(0); rr_node = first_node(node_online_map); for_each_possible_cpu(cpu) { -- 2.43.0