Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3113206rdb; Tue, 26 Dec 2023 17:10:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhyJSDwr1KzYmGavxSUTHLLPvXh8oH1Jyxxa9V/buHiNZaRyzyVkgkpLsYc4opq09zVxD4 X-Received: by 2002:a05:6871:3a07:b0:1fb:75a:de5f with SMTP id pu7-20020a0568713a0700b001fb075ade5fmr9601754oac.77.1703639450995; Tue, 26 Dec 2023 17:10:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703639450; cv=none; d=google.com; s=arc-20160816; b=TlJ7vafEH4HiN+2HjZgrz8JdbxunazEfBibIpnMeXxG+8wJwwYOPffyh61pw7twOxR bQrqu0I8M+W+ps98bgy/NzPDMlmd+ROb1SByyTcvezQVvIBO7UOxms/tVhT+rP0V/rjz v41PVYmvDgM8YEqpPZ/0GvDo7HbmfwgYtkYVc0nmv9Cvwpv7Z09E+8gVKciagCxmY4e6 9DUNW2dBEhM7cNlw6jj+bLnnzz42csfq0oP2L0kOyS/cRo1QScVxzjE1q5tkMi5o6Og7 dHQo2y8YV93GvDJ03UxcPWdC005i2TAxuh062aAuc9R3kdL60/lVs+PYO4dRSY+ouX0s ixPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:from:references:cc:to:subject; bh=2fzGtzYgvUXmOyC9wMXV9h6uKZcaR8IRUjlIVw/AccQ=; fh=qF+JU3VURtdMgedVePDvQ/HoI/WuOVzFO/IMhWiZBTE=; b=hwNOLZj+RThomCK/CXfm3U15sWdIzkczwkmzcV9qeYgSYlFZpkvgNzR+S2V1TZoYoJ wPPq85GXW2IcD4cskldPUN2C0uoHiVXT5grQx8aSAaa66dOQOX2y4u1QGDI9NlysV9oE EFM00a+o9aaFe9vuita40Y+LMHBYwXR/GE37rHoXyrJfJ20uDdHCJjlTmHEPhRAjapuK n2rzssN7CHEZzVnXy2hJOQSfJYueZARMWhzJ8xsDfj8MSN3MVUw8QBSH/jMHSiVC1zYj NKdarL/S5Vnk43eoVItBcRuYoXwEKyulkr7eCvs6C6HN0SGW9tKtcBdKF18zmyJECRfV 7foA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-11753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11753-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bn4-20020a056a02030400b005ce12225e6bsi5201596pgb.210.2023.12.26.17.10.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 17:10:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-11753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11753-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C507EB22357 for ; Wed, 27 Dec 2023 01:10:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 427CD33F1; Wed, 27 Dec 2023 01:10:22 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 546EA290B for ; Wed, 27 Dec 2023 01:10:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.20.42.173]) by gateway (Coremail) with SMTP id _____8DxGOh3eYtlKuMEAA--.751S3; Wed, 27 Dec 2023 09:10:15 +0800 (CST) Received: from [10.20.42.173] (unknown [10.20.42.173]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx6r10eYtlkhsMAA--.15386S3; Wed, 27 Dec 2023 09:10:14 +0800 (CST) Subject: Re: [PATCH] LoongArch: Let cores_io_master cover the largest NR_CPUS To: Jiaxun Yang , Huacai Chen 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: maobibo Message-ID: Date: Wed, 27 Dec 2023 09:09:57 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CM-TRANSID:AQAAf8Dx6r10eYtlkhsMAA--.15386S3 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj93XoW7CFy3XF1rtrykZw4kAFWfCrX_yoW8AF43pr 4vvFykGFWrGrn3Ga1jq34UCryYyr1DG3WqqF42ga48GrZFv3WqqF4jgryq9F1DZa1rtF10 qw1fKw1avF4UAwcCm3Z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en 写道: >> 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; > ``` Yeap, that will be better. Regards Bibo Mao > > Thanks > - Jiaxun > [...] > >> >> Huacai