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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR04MB58168FE99AA058FB79A0650EE7400@BYAPR04MB5816.namprd04.prod.outlook.com>
Date:   Tue, 19 Mar 2019 23:58:10 +0000
From:   Damien Le Moal <Damien.LeMoal@....com>
To:     Atish Patra <Atish.Patra@....com>,
        "linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>
CC:     Albert Ou <aou@...s.berkeley.edu>, Andreas Schwab <schwab@...e.de>,
        Anup Patel <anup@...infault.org>,
        Dmitriy Cherkasov <dmitriy@...-tech.org>,
        Johan Hovold <johan@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Palmer Dabbelt <palmer@...ive.com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Anup Patel <Anup.Patel@....com>
Subject: Re: [v1 PATCH 4/4] RISC-V: Support nr_cpus command line option.

On 2019/03/20 8:56, Damien Le Moal wrote:
> On 2019/03/20 7:20, Atish Patra wrote:
>> If nr_cpus command line option is set, maximum possible cpu should be
>> set to that value.
>>
>> Signed-off-by: Atish Patra <atish.patra@....com>
>> ---
>>  arch/riscv/kernel/smpboot.c | 10 +++++++++-
>>  1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c
>> index 609475c5..a8fe590c 100644
>> --- a/arch/riscv/kernel/smpboot.c
>> +++ b/arch/riscv/kernel/smpboot.c
>> @@ -86,11 +86,19 @@ void __init setup_smp(void)
>>  		}
>>  
>>  		cpuid_to_hartid_map(cpuid) = hart;
>> -		set_cpu_possible(cpuid, true);
> 
> This looks weird: the code being changed does not match what patch 3/4 did.

Arg... Ignore this one. My bad. Morning here, I need more coffee :)

> 
>>  		cpuid++;
>>  	}
>>  
>>  	BUG_ON(!found_boot_cpu);
>> +
>> +	if (cpuid > nr_cpu_ids)
>> +		pr_warn("Total number of cpus [%d] are greater than configured via nr_cpus [%d]\n",
> 
> "The total number of cpus [%d] is greater than nr_cpus option value [%d]\n"
> 
>> +			cpuid, nr_cpu_ids);
>> +
>> +	for (cpuid = 1; cpuid < nr_cpu_ids; cpuid++) {
>> +		if (cpuid_to_hartid_map(cpuid) != INVALID_HARTID)
>> +			set_cpu_possible(cpuid, true);
>> +	}
>>  }
>>  
>>  int __cpu_up(unsigned int cpu, struct task_struct *tidle)
>>
> 
> 


-- 
Damien Le Moal
Western Digital Research

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ