lkml.org 
[lkml]   [2023]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] LoongArch: Let cores_io_master cover the largest NR_CPUS
From


在 2023/12/25 09:19, Huacai Chen 写道:
> 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?

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

\
 
 \ /
  Last update: 2023-12-25 15:03    [W:0.063 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site