From: Xi Ruoyao <xry111@xry111.site>
To: Huacai Chen <chenhuacai@kernel.org>, maobibo <maobibo@loongson.cn>
Cc: loongson-kernel@lists.loongnix.cn, loongarch@lists.linux.dev,
Xuefeng Li <lixuefeng@loongson.cn>, Guo Ren <guoren@kernel.org>,
Xuerui Wang <kernel@xen0n.name>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
linux-kernel@vger.kernel.org,
Huacai Chen <chenhuacai@loongson.cn>
Subject: Re: [PATCH] LoongArch: Let cores_io_master cover the largest NR_CPUS
Date: Mon, 25 Dec 2023 19:11:19 +0800 [thread overview]
Message-ID: <61b95cfbcf7b812348b543189ce7f4539c082ccd.camel@xry111.site> (raw)
In-Reply-To: <CAAhV-H5Rs4BGKHZrA5bxSh0=4uhPx7vbVwBXtdtfU4hemN2QjA@mail.gmail.com>
On Mon, 2023-12-25 at 17:19 +0800, Huacai Chen wrote:
> On Mon, Dec 25, 2023 at 5:13 PM maobibo <maobibo@loongson.cn> 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 <chenhuacai@loongson.cn>
> > > ---
> > > 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?
Yes, it's basically just expanded to (((CONFIG_NR_CPUS) + (sizeof(long))
- 1) / (sizeof(long)). Per the C standard (C99 section 6.6 p6) it's an
integer constant expression and can be used as array size.
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
next prev parent reply other threads:[~2023-12-25 11:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-25 7:00 Huacai Chen
2023-12-25 9:13 ` maobibo
2023-12-25 9:19 ` Huacai Chen
2023-12-25 11:11 ` Xi Ruoyao [this message]
2023-12-25 14:02 ` Jiaxun Yang
2023-12-27 1:09 ` maobibo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=61b95cfbcf7b812348b543189ce7f4539c082ccd.camel@xry111.site \
--to=xry111@xry111.site \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=guoren@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=loongarch@lists.linux.dev \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=maobibo@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®