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: <CAMuHMdWcJuBv94pQ-1Bf7QAb6e3=AjSz7GBFCPLqiCJ0CjXjqA@mail.gmail.com>
Date:   Sat, 30 Jan 2021 11:37:57 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Jan Henrik Weinstock <jan.weinstock@...h-aachen.de>
Cc:     Jonas Bonn <jonas@...thpole.se>,
        Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>,
        Stafford Horne <shorne@...il.com>,
        Openrisc <openrisc@...ts.librecores.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] openrisc: use device tree to determine present cpus

Hi Jan,

On Fri, Jan 29, 2021 at 7:34 PM Jan Henrik Weinstock
<jan.weinstock@...h-aachen.de> wrote:
> This patch proposes to use the device tree to determine the present cpus
> instead of assuming all CONFIG_NRCPUS are actually present in the system.
>
> Signed-off-by: Jan Henrik Weinstock <jan.weinstock@...h-aachen.de>

Thanks for your patch!

> --- a/arch/openrisc/kernel/smp.c
> +++ b/arch/openrisc/kernel/smp.c

> @@ -68,14 +69,25 @@ void __init smp_init_cpus(void)
>
>   void __init smp_prepare_cpus(unsigned int max_cpus)
>   {
> -       int i;
> +       u32 cpu_id;
> +       struct device_node *cpu, *cpus;
>
>         /*
>          * Initialise the present map, which describes the set of CPUs
>          * actually populated at the present time.
>          */
> -       for (i = 0; i < max_cpus; i++)
> -               set_cpu_present(i, true);
> +       cpus = of_find_node_by_path("/cpus");
> +       for_each_child_of_node(cpus, cpu) {

for_each_of_cpu_node()?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ