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  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]
Date:   Fri, 8 Feb 2019 14:56:57 -0800
From:   Atish Patra <atish.patra@....com>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     "linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
        Patrick Stählin <me@...ki.ch>,
        Albert Ou <aou@...s.berkeley.edu>,
        Damien Le Moal <Damien.LeMoal@....com>,
        Jason Cooper <jason@...edaemon.net>,
        Alan Kao <alankao@...estech.com>,
        Dmitriy Cherkasov <dmitriy@...-tech.org>,
        Anup Patel <anup@...infault.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Zong Li <zongbox@...il.com>,
        Palmer Dabbelt <palmer@...ive.com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Andreas Schwab <schwab@...e.de>,
        Marc Zyngier <marc.zyngier@....com>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [v3 PATCH 2/8] RISC-V: Move cpuid to hartid mapping to SMP.

On 2/8/19 1:03 AM, Christoph Hellwig wrote:
> On Thu, Feb 07, 2019 at 05:51:15PM -0800, Atish Patra wrote:
>> Currently, logical CPU id to physical hartid mapping is
>> defined for both smp and non-smp configurations. This
>> is not required as we need this only for smp configuration.
>> The mapping function can define directly boot_cpu_hartid
>> for non-smp use case.
> 
> Please use up your available 72 chars for the changelog.  (probably also
> in other patches).
> 

Sorry. I will fix all patches to use 72 chars.

>>
>> The reverse mapping function i.e. hartid to cpuid can be called
>> for any valid but not booted harts. So it should return default
>> cpu 0 only if it is a boot hartid.
>>
>> Signed-off-by: Atish Patra <atish.patra@....com>
>> Reviewed-by: Anup Patel <anup@...infault.org>
>> ---
>>   arch/riscv/include/asm/smp.h | 14 +++++++++++---
>>   arch/riscv/kernel/setup.c    |  9 ---------
>>   arch/riscv/kernel/smp.c      |  9 +++++++++
>>   3 files changed, 20 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h
>> index 41aa73b4..21fd2d75 100644
>> --- a/arch/riscv/include/asm/smp.h
>> +++ b/arch/riscv/include/asm/smp.h
>> @@ -22,12 +22,13 @@
>>   /*
>>    * Mapping between linux logical cpu index and hartid.
>>    */
>> -extern unsigned long __cpuid_to_hartid_map[NR_CPUS];
>> -#define cpuid_to_hartid_map(cpu)    __cpuid_to_hartid_map[cpu]
>>   
>> +extern unsigned long boot_cpu_hartid;
>>   struct seq_file;
> 
> We usually try to keep forward declatations at the top of the file.
> 
> Can you add the new external declaration below the forward one?
> 
Sure.

Regards,
Atish
> Otherwise looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@....de>
> 

Powered by blists - more mailing lists