From: Yury Norov <yury.norov@gmail.com>
To: Andrew Jones <ajones@ventanamicro.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
lkp@lists.01.org, lkp@intel.com,
Linux Memory Management List <linux-mm@kvack.org>,
linux-kernel@vger.kernel.org
Subject: Re: [oliver.sang@intel.com: [cpumask] b9a7ecc71f: WARNING:at_include/linux/cpumask.h:#__is_kernel_percpu_address]
Date: Tue, 11 Oct 2022 10:16:01 -0700 [thread overview]
Message-ID: <Y0Wk0WD6CL4aFEIi@yury-laptop> (raw)
In-Reply-To: <20221011170949.upxk3tcfcwnkytwm@kamzik>
> Hi Yury,
>
> I just wanted to report that the warning fires when doing
> 'cat /proc/cpuinfo' on at least x86 and riscv. I don't think
> those are false positives. I'm guessing a patch should be
> something like the following diff. If you haven't already
> addressed this and I'm not off in left field, then I guess
> we should integrate it into your series.
>
> Thanks,
> drew
Hi Andrew,
Can you please send it as a patch with a description?
>
> diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c
> index 4aa8cd749441..4c5dfa230d4b 100644
> --- a/arch/riscv/kernel/cpu.c
> +++ b/arch/riscv/kernel/cpu.c
> @@ -166,9 +166,12 @@ static void print_mmu(struct seq_file *f)
>
> static void *c_start(struct seq_file *m, loff_t *pos)
> {
> - *pos = cpumask_next(*pos - 1, cpu_online_mask);
> - if ((*pos) < nr_cpu_ids)
> - return (void *)(uintptr_t)(1 + *pos);
> + if (*pos < nr_cpu_ids) {
> + *pos = cpumask_next(*pos - 1, cpu_online_mask);
> + if ((*pos) < nr_cpu_ids)
Braces around *pos are not needed.
> + return (void *)(uintptr_t)(1 + *pos);
> + }
> +
> return NULL;
> }
>
> diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
> index 099b6f0d96bd..2ea614e78e28 100644
> --- a/arch/x86/kernel/cpu/proc.c
> +++ b/arch/x86/kernel/cpu/proc.c
> @@ -153,9 +153,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
>
> static void *c_start(struct seq_file *m, loff_t *pos)
> {
> - *pos = cpumask_next(*pos - 1, cpu_online_mask);
> - if ((*pos) < nr_cpu_ids)
> - return &cpu_data(*pos);
> + if (*pos < nr_cpu_ids) {
> + *pos = cpumask_next(*pos - 1, cpu_online_mask);
> + if ((*pos) < nr_cpu_ids)
Here too.
Thanks,
Yury
> + return &cpu_data(*pos);
> + }
> +
> return NULL;
> }
>
> >
> > > I suspect that to avoid any automation noise, you should just rebase
> > > so that the fixes come first. Otherwise we'll end up wasting a lot of
> > > time on the noise.
> > >
> > > This is not that different from introducing new buil;d-time warnings:
> > > the things they point out need to be fixed before the warning can be
> > > integrated, or it causes bisection problems.
> >
> > OK, I'll reorder the patches. Thanks for your help.
> >
next prev parent reply other threads:[~2022-10-11 17:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-01 1:49 [oliver.sang@intel.com: [cpumask] b9a7ecc71f: WARNING:at_include/linux/cpumask.h:#__is_kernel_percpu_address] Yury Norov
2022-10-01 16:20 ` Linus Torvalds
2022-10-01 17:16 ` Yury Norov
2022-10-11 17:09 ` Andrew Jones
2022-10-11 17:16 ` Yury Norov [this message]
2022-10-11 17:21 ` Andrew Jones
2022-10-11 17:23 ` Yury Norov
2022-10-11 18:04 ` Andrew Jones
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=Y0Wk0WD6CL4aFEIi@yury-laptop \
--to=yury.norov@gmail.com \
--cc=ajones@ventanamicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=lkp@lists.01.org \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).