From: Thomas Gleixner <tglx@linutronix.de>
To: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Arjan van de Ven <arjan@linux.intel.com>,
x86@kernel.org, Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
Sparse Mailing-list <linux-sparse@vger.kernel.org>
Subject: Re: arch/x86/include/asm/processor.h:698:16: sparse: sparse: incorrect type in initializer (different address spaces)
Date: Sat, 02 Mar 2024 23:00:03 +0100 [thread overview]
Message-ID: <87le70uwf0.ffs@tglx> (raw)
In-Reply-To: <87sf18vdsq.ffs@tglx>
On Sat, Mar 02 2024 at 16:44, Thomas Gleixner wrote:
> On Sat, Mar 02 2024 at 12:37, Thomas Gleixner wrote:
> The below addresses _all_ percpu related sparse warnings except
> the ones in arch/x86/cpu/bugs.o but that's a sparse problem:
>
> The following is handled correctly:
>
> DECLARE_PER_CPU(u64, foo);
> this_cpu_read(foo);
>
> But this is not:
>
> DECLARE_PER_CPU(u64, foo);
> DEFINE_PER_CPU(u64, foo);
> this_cpu_read(foo);
>
> arch/x86/kernel/cpu/bugs.c:71:9: sparse: warning: incorrect type in initializer (different address spaces)
> arch/x86/kernel/cpu/bugs.c:71:9: sparse: expected void const [noderef] __percpu *__vpp_verify
> arch/x86/kernel/cpu/bugs.c:71:9: sparse: got unsigned long long *
>
> Commenting out the DEFINE_PER_CPU(u64, x86_spec_ctrl_current) in that
> file makes sparse happy, but that's obviously not a solution :)
Correction. I found the real issue:
DEFINE_PER_CPU(u64, x86_spec_ctrl_current);
EXPORT_SYMBOL_GPL(x86_spec_ctrl_current);
I had commented out both. But the real reason is the EXPORT_SYMBOL,
which obviously wants to be EXPORT_PER_CPU_SYMBOL_GPL...
So sparse was right. Nothing to see here.
Thanks,
tglx
next prev parent reply other threads:[~2024-03-02 22:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <202403020457.RCJoQ3ts-lkp@intel.com>
[not found] ` <87edctwr6y.ffs@tglx>
[not found] ` <87a5nhwpus.ffs@tglx>
[not found] ` <87y1b0vp8m.ffs@tglx>
2024-03-02 15:44 ` arch/x86/include/asm/processor.h:698:16: sparse: sparse: incorrect type in initializer (different address spaces) Thomas Gleixner
2024-03-02 22:00 ` Thomas Gleixner [this message]
2024-03-02 22:49 ` Linus Torvalds
2024-03-03 16:31 ` Thomas Gleixner
2024-03-03 19:03 ` Uros Bizjak
2024-03-03 20:10 ` Thomas Gleixner
2024-03-03 20:21 ` Uros Bizjak
2024-03-03 20:24 ` Uros Bizjak
2024-03-03 21:19 ` Uros Bizjak
2024-03-03 23:49 ` Thomas Gleixner
2024-03-04 5:42 ` Uros Bizjak
2024-03-04 7:07 ` Thomas Gleixner
2024-04-02 11:43 ` Uros Bizjak
2024-04-03 17:57 ` Nathan Chancellor
2024-04-04 6:56 ` Uros Bizjak
2024-04-29 21:30 ` [RFC PATCH] Use x86 named address spaces to catch "sparse: incorrect type in initializer (different address spaces)" __percpu errors Uros Bizjak
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=87le70uwf0.ffs@tglx \
--to=tglx@linutronix.de \
--cc=arjan@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=lkp@intel.com \
--cc=luc.vanoostenryck@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=x86@kernel.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).