From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
<linux-kernel@vger.kernel.org>,
Guenter Roeck <linux@roeck-us.net>, <linuxarm@huawei.com>
Subject: Re: [PATCH v2] cpu: mark cpu_possible_mask as __ro_after_init
Date: Wed, 27 Mar 2024 18:10:53 +0000 [thread overview]
Message-ID: <20240327181053.0000481d@Huawei.com> (raw)
In-Reply-To: <11d7a34f-909b-4923-a15f-d32015463c35@p183>
On Thu, 22 Feb 2024 14:19:35 +0300
Alexey Dobriyan <adobriyan@gmail.com> wrote:
> cpu_possible_mask is by definition "cpus which could be hotplugged without
> reboot". It's a property which is fixed after kernel enumerates hardware
> configuration.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Causes a crash in this path (via CPU HP testing on qemu)
Pretending to be an AMD Genoa, but I doubt that matters.
topology_hotplug_apic()
-> topo_set_cpuids()
--> set_cpu_possible(cpu, true);
It should be already set, but the code doesn't check that.
Various possible fixes. Probably easiest is to pass in a
bool hotplug to topo_set_cpuids() so we don't set the
possible value if it's coming from hotplug calls.
I can spin a patch, but it will next week probably.
Jonathan
> ---
>
> v2: fix parisc compilation
>
> kernel/cpu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -3107,10 +3107,10 @@ const DECLARE_BITMAP(cpu_all_bits, NR_CPUS) = CPU_BITS_ALL;
> EXPORT_SYMBOL(cpu_all_bits);
>
> #ifdef CONFIG_INIT_ALL_POSSIBLE
> -struct cpumask __cpu_possible_mask __read_mostly
> +struct cpumask __cpu_possible_mask __ro_after_init
> = {CPU_BITS_ALL};
> #else
> -struct cpumask __cpu_possible_mask __read_mostly;
> +struct cpumask __cpu_possible_mask __ro_after_init;
> #endif
> EXPORT_SYMBOL(__cpu_possible_mask);
>
next prev parent reply other threads:[~2024-03-27 18:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 10:01 [PATCH] cpu: mark cpu_possible_mask as __ro_after_init Alexey Dobriyan
2024-02-19 17:16 ` [tip: smp/core] cpu: Mark " tip-bot2 for Alexey Dobriyan
2024-02-22 6:00 ` [PATCH] cpu: mark " Guenter Roeck
2024-02-22 10:26 ` Alexey Dobriyan
2024-02-22 11:19 ` [PATCH v2] " Alexey Dobriyan
2024-03-27 18:10 ` Jonathan Cameron [this message]
2024-03-27 18:36 ` Guenter Roeck
2024-04-03 13:43 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240327181053.0000481d@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=adobriyan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=linuxarm@huawei.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox