Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2322999rdb; Mon, 25 Dec 2023 06:02:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IE01KqP4+9P1BBz/zVBr6H9R+tcleBl0m5hBGfEZ74oK55WQ9g4eywsrQYCPZG7jFsnIUzB X-Received: by 2002:a05:6402:888:b0:554:ca00:287c with SMTP id e8-20020a056402088800b00554ca00287cmr1650220edy.61.1703512972924; Mon, 25 Dec 2023 06:02:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703512972; cv=none; d=google.com; s=arc-20160816; b=reM8p21gZxSGJITZSJZzfcTIAaG9eJNh0D8ig8uFxHrDmOVo0qE9aFhZjuDOzIG2r/ dny6vbGhMF6Eba2wpQl154lr265tmLYuu9sJmtDWUMXVORr1vNEHS8R+dd1p5v83PQNs 5OPjKtKN2Ey3siK86NK+tJqu9F2hNr4vEMCf9xxB5u1BB8WW0pTzzcz48RNW9I9Wi4K+ Deh9r2NwzGRi7/AStL51HxTBAeGaMZQu2AgIKG1bybI2j8De2m4ES2AEOigufCnKAMnK 56FjB0GUlueGUZ5LNazIUQkZwJ+96jDtbW0v6vimqYbU3SwF2pVZ149xWK8u3ZT6EE+I U7bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:feedback-id :dkim-signature:dkim-signature; bh=IQZdaZOFgePlDjDkaWM55EFDy1RVICtiSZWQjTh1img=; fh=iKxyr+20XwwdaAON2yI54zUgCC2+bZ1Sb5isVYSFh28=; b=hOqG8x+vBrjhnV75Pl+9XsR+w/aJaGECU0cmlTL+I6IChFFMMuxmfXwrXuxVuicfgQ ebJeeuIwUaFL5LlDmcKL43uNlnjsrO0T8x857Cadm7CGZCwpHBDZox2fFr8RsLGZ0FWl yjXhw6roOZrGIJHQVvQCuDxUuaJPiYxL+Vjv2/Dg1qdCabG+VuoqTb4d3QmU0+SCSB0q 1RoW1A+cNwmpf0SrAs4Cu+Ql6ZYzVZ2W2TB6ibfPredVJeiGllRz4rhx1yuL52DrrEZp AuPogVs5MOi6hOew2MY5lmDIiijJaTAooNNtkoNNS57CCqFXyJCNiVvKAk9SDl5+vC3B XcIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm3 header.b=Dvikz7Gr; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=c04IoSZA; spf=pass (google.com: domain of linux-kernel+bounces-11079-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11079-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 bl8-20020a056402210800b00554031a5085si4696040edb.684.2023.12.25.06.02.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Dec 2023 06:02:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11079-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=fm3 header.b=Dvikz7Gr; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=c04IoSZA; spf=pass (google.com: domain of linux-kernel+bounces-11079-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11079-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 9BA771F2273B for ; Mon, 25 Dec 2023 14:02:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35131524C1; Mon, 25 Dec 2023 14:02:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="Dvikz7Gr"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="c04IoSZA" X-Original-To: linux-kernel@vger.kernel.org Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (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 77D8D524B8 for ; Mon, 25 Dec 2023 14:02:41 +0000 (UTC) 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 compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id D59C73200564; Mon, 25 Dec 2023 09:02:39 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 25 Dec 2023 09:02:40 -0500 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=fm3; t=1703512959; x=1703599359; bh=IQZdaZOFgePlDjDkaWM55EFDy1RVICtiSZWQjTh1img=; b= Dvikz7Gr03DS87u4hqdUPf/K4YOgFuuoMzXZqBXsSO6C+eQNaVpmjpVEhOnvY83a tdfgsOB9teO4PjmLHpI43tjWRkzKvJqnVYGjOWxPTRhhc2T7vbN2GxuriLe7hwB5 vjFwrzohtoOxWvcv5IGpqdFMcdXMFUUGmpcok8yQqNN5IZSjnqywmVGBB5AjuRi4 4lDjB/MnfgiFE+gCwolmY6T6CeDpBy4O7egb3kl+KStOY25UIP8UPXuBXmgp6MCr ioDKIlG5AI+AaDIc6fXVIUpr0E+Mc0nNzrD7rF/PSgyIFFnLya0ARk5l/eu3CBca lgVfcI6qeXpOL2/TYxN56A== 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=fm2; t=1703512959; x= 1703599359; bh=IQZdaZOFgePlDjDkaWM55EFDy1RVICtiSZWQjTh1img=; b=c 04IoSZAueFjR/JRmMXgav+CBczXPe9E7+o9pmmuM8W2Oif75LXR4uYzsZ/iuGVSO 797rU5QfSGVztOt3aRjWMawf0ZirXh10ZripDThyZpIbr4KCFkFGeXg86pDuXb12 +UG4MS9ZXIyYp9IGSjY/MtFWTd9/cAGcGQzXLRBvAOWvq5ChtHjSeLOtJbyodRnH YO51xRZHu8mOb1DqSK0TGvAVgQic5rzOkjtnlzdkPT70i2Vwo1g5vXgluKkgG/83 DJvoPYzy9rz6/yyFIHtU1w7Bf8+qzEipbVLdFZWrxJ4daEJ13JuaNsa0FewJBGII xkQvkIxNY7kXUGtbdtoSQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddvfedgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepleeuffehheegleeuvdelgffhueekjeetueevuefhffdtgfeu hfeggfeukefffedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Dec 2023 09:02:36 -0500 (EST) Message-ID: Date: Mon, 25 Dec 2023 14:02:36 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] LoongArch: Let cores_io_master cover the largest NR_CPUS Content-Language: en-US To: Huacai Chen , maobibo Cc: loongson-kernel@lists.loongnix.cn, loongarch@lists.linux.dev, Xuefeng Li , Guo Ren , Xuerui Wang , linux-kernel@vger.kernel.org, Huacai Chen References: <20231225070002.1350705-1-chenhuacai@loongson.cn> <3db5c086-db9b-cb3a-5521-44f18cb55c4a@loongson.cn> From: Jiaxun Yang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2023/12/25 09:19, Huacai Chen 写道: > On Mon, Dec 25, 2023 at 5:13 PM maobibo wrote: >> >> >> >> On 2023/12/25 下午3:00, Huacai Chen wrote: >>> Now loongson_system_configuration::cores_io_master only covers 64 cpus, >>> if NR_CPUS > 64 there will be memory corruption. So let cores_io_master >>> cover the largest NR_CPUS (256). >>> >>> Signed-off-by: Huacai Chen >>> --- >>> arch/loongarch/include/asm/bootinfo.h | 4 ++-- >>> arch/loongarch/kernel/acpi.c | 2 +- >>> arch/loongarch/kernel/smp.c | 2 +- >>> 3 files changed, 4 insertions(+), 4 deletions(-) >>> >>> diff --git a/arch/loongarch/include/asm/bootinfo.h b/arch/loongarch/include/asm/bootinfo.h >>> index c60796869b2b..32fd0319594a 100644 >>> --- a/arch/loongarch/include/asm/bootinfo.h >>> +++ b/arch/loongarch/include/asm/bootinfo.h >>> @@ -30,7 +30,7 @@ struct loongson_system_configuration { >>> int boot_cpu_id; >>> int cores_per_node; >>> int cores_per_package; >>> - unsigned long cores_io_master; >>> + unsigned long cores_io_master[4]; >> Can the hardcoded 4 be defined something like this? >> DIV_ROUND_UP(CONFIG_NR_CPUS, sizeof(long)) > Can this be used to define arrays? I think DECLARE_BITMAP should work. See how are we dealing with cpumask_t: ``` typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; ``` Thanks - Jiaxun [...] > > Huacai