lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 20 Apr 2021 10:16:24 +0800
From:   Youling Tang <tangyouling@...ngson.cn>
To:     Jiaxun Yang <jiaxun.yang@...goat.com>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc:     linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jinyang He <hejinyang@...ngson.cn>
Subject: Re: [PATCH] MIPS: Fix cmdline "mem=" parameter parsing

Hi, Jiaxun

On 04/20/2021 09:05 AM, Jiaxun Yang wrote:
>
> 在 2021/4/19 18:50, Youling Tang 写道:
>> This problem may only occur on NUMA platforms. When machine start 
>> with the
>> "mem=" parameter on Loongson64, it cannot boot. When parsing the "mem="
>> parameter, first remove all RAM, and then add memory through 
>> memblock_add(),
>> which causes the newly added memory to be located on MAX_NUMNODES.
>>
>> The solution is to add the current "mem=" parameter range to the 
>> memory area
>> of the corresponding node, instead of adding all of it to the 
>> MAX_NUMNODES
>> node area. Get the node number corresponding to the "mem=" parameter 
>> range
>> through pa_to_nid(), and then add it to the corresponding node through
>> memblock_add_node().
>>
>> Signed-off-by: Jinyang He <hejinyang@...ngson.cn>
>> Signed-off-by: Youling Tang <tangyouling@...ngson.cn>
>> ---
>>   arch/mips/kernel/setup.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
>> index 279be01..b86e241 100644
>> --- a/arch/mips/kernel/setup.c
>> +++ b/arch/mips/kernel/setup.c
>> @@ -359,7 +359,7 @@ static int __init early_parse_mem(char *p)
>>       if (*p == '@')
>>           start = memparse(p + 1, &p);
>>   -    memblock_add(start, size);
>> +    memblock_add_node(start, size, pa_to_nid(start));
>
> pa_to_nid is not available for all platforms.
>
Thanks for your correction.

pa_to_nid() only has actual definitions in mach-ip27 and mach-loongson64 
(only
for NUMA platform).

In arch/mips/include/asm/mmzone.h:
#ifndef pa_to_nid
#define pa_to_nid(addr) 0
#endif

So only need #include <asm/mmzone.h> to solve the "error: implicit 
declaration
of function'pa_to_nid'" compilation error.

Thanks,
Youling
>
> Thanks.
>
> - Jiaxun
>
>>         return 0;
>>   }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ