* [PATCH] sparse doesn't support indirect_branch attribute
@ 2018-02-27 19:48 Matthew Wilcox
2018-02-27 20:18 ` Randy Dunlap
0 siblings, 1 reply; 9+ messages in thread
From: Matthew Wilcox @ 2018-02-27 19:48 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
Don't use __attribute__((indirect_branch)) if we're compiling with
sparse.
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index e2c7f4369eff..b6be4cc25e9d 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -93,7 +93,7 @@
#define __weak __attribute__((weak))
#define __alias(symbol) __attribute__((alias(#symbol)))
-#ifdef RETPOLINE
+#if defined(RETPOLINE) && !defined(__CHECKER__)
#define __noretpoline __attribute__((indirect_branch("keep")))
#endif
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] sparse doesn't support indirect_branch attribute
2018-02-27 19:48 [PATCH] sparse doesn't support indirect_branch attribute Matthew Wilcox
@ 2018-02-27 20:18 ` Randy Dunlap
2018-02-27 22:12 ` Linus Torvalds
0 siblings, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2018-02-27 20:18 UTC (permalink / raw)
To: Matthew Wilcox, Linus Torvalds; +Cc: linux-kernel
On 02/27/2018 11:48 AM, Matthew Wilcox wrote:
>
> Don't use __attribute__((indirect_branch)) if we're compiling with
> sparse.
>
> Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
>
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index e2c7f4369eff..b6be4cc25e9d 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -93,7 +93,7 @@
> #define __weak __attribute__((weak))
> #define __alias(symbol) __attribute__((alias(#symbol)))
>
> -#ifdef RETPOLINE
> +#if defined(RETPOLINE) && !defined(__CHECKER__)
> #define __noretpoline __attribute__((indirect_branch("keep")))
> #endif
>
>
I don't mind the patch, but I did send a patch for this attribute on Feb. 13, 2018,
to the sparse mailing list.
--
~Randy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] sparse doesn't support indirect_branch attribute
2018-02-27 20:18 ` Randy Dunlap
@ 2018-02-27 22:12 ` Linus Torvalds
2018-02-27 22:30 ` Randy Dunlap
2018-02-27 22:36 ` Luc Van Oostenryck
0 siblings, 2 replies; 9+ messages in thread
From: Linus Torvalds @ 2018-02-27 22:12 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Matthew Wilcox, Linux Kernel Mailing List
On Tue, Feb 27, 2018 at 12:18 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>
> I don't mind the patch, but I did send a patch for this attribute on Feb. 13, 2018,
> to the sparse mailing list.
I think the sparse plan is to just stop warning about unknown
attributes, because it doesn't really help users (at most it's a note
to a sparse developer).
But sparse doesn't have the same regular releases the kernel has. Oh well.
Linus
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] sparse doesn't support indirect_branch attribute
2018-02-27 22:12 ` Linus Torvalds
@ 2018-02-27 22:30 ` Randy Dunlap
2018-02-27 22:32 ` Linus Torvalds
2018-02-27 22:36 ` Luc Van Oostenryck
1 sibling, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2018-02-27 22:30 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Matthew Wilcox, Linux Kernel Mailing List
On 02/27/2018 02:12 PM, Linus Torvalds wrote:
> On Tue, Feb 27, 2018 at 12:18 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> I don't mind the patch, but I did send a patch for this attribute on Feb. 13, 2018,
>> to the sparse mailing list.
>
> I think the sparse plan is to just stop warning about unknown
> attributes, because it doesn't really help users (at most it's a note
> to a sparse developer).
Yes, there are sparse discussions about that.
There is also a kernel kbuild patch from Luc that Masahiro has also merged that
does -Wno-unknown-attributes (or however that is spelled).
> But sparse doesn't have the same regular releases the kernel has. Oh well.
Right.
--
~Randy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] sparse doesn't support indirect_branch attribute
2018-02-27 22:30 ` Randy Dunlap
@ 2018-02-27 22:32 ` Linus Torvalds
0 siblings, 0 replies; 9+ messages in thread
From: Linus Torvalds @ 2018-02-27 22:32 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Matthew Wilcox, Linux Kernel Mailing List
On Tue, Feb 27, 2018 at 2:30 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>
> There is also a kernel kbuild patch from Luc that Masahiro has also merged that
> does -Wno-unknown-attributes (or however that is spelled).
That's probably a better interim workaround.
Linus
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] sparse doesn't support indirect_branch attribute
2018-02-27 22:12 ` Linus Torvalds
2018-02-27 22:30 ` Randy Dunlap
@ 2018-02-27 22:36 ` Luc Van Oostenryck
2018-02-28 1:30 ` Masahiro Yamada
1 sibling, 1 reply; 9+ messages in thread
From: Luc Van Oostenryck @ 2018-02-27 22:36 UTC (permalink / raw)
To: Linus Torvalds
Cc: Randy Dunlap, Matthew Wilcox, Linux Kernel Mailing List, Masahiro Yamada
On Tue, Feb 27, 2018 at 02:12:28PM -0800, Linus Torvalds wrote:
> On Tue, Feb 27, 2018 at 12:18 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> >
> > I don't mind the patch, but I did send a patch for this attribute on Feb. 13, 2018,
> > to the sparse mailing list.
>
> I think the sparse plan is to just stop warning about unknown
> attributes, because it doesn't really help users (at most it's a note
> to a sparse developer).
>
> But sparse doesn't have the same regular releases the kernel has. Oh well.
To compensate this, I sent a patch to use '-Wno-unknown-attribute' for kernel
builds. Masahiro Yamada has already taken it to the linux-kbuild tree.
I'm not sure if it's planned for the next -rc or for 4.17, though.
-- Luc Van Oostenryck
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] sparse doesn't support indirect_branch attribute
2018-02-27 22:36 ` Luc Van Oostenryck
@ 2018-02-28 1:30 ` Masahiro Yamada
2018-03-01 10:06 ` Luc Van Oostenryck
0 siblings, 1 reply; 9+ messages in thread
From: Masahiro Yamada @ 2018-02-28 1:30 UTC (permalink / raw)
To: Luc Van Oostenryck
Cc: Linus Torvalds, Randy Dunlap, Matthew Wilcox, Linux Kernel Mailing List
2018-02-28 7:36 GMT+09:00 Luc Van Oostenryck <luc.vanoostenryck@gmail.com>:
> On Tue, Feb 27, 2018 at 02:12:28PM -0800, Linus Torvalds wrote:
>> On Tue, Feb 27, 2018 at 12:18 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> >
>> > I don't mind the patch, but I did send a patch for this attribute on Feb. 13, 2018,
>> > to the sparse mailing list.
>>
>> I think the sparse plan is to just stop warning about unknown
>> attributes, because it doesn't really help users (at most it's a note
>> to a sparse developer).
>>
>> But sparse doesn't have the same regular releases the kernel has. Oh well.
>
> To compensate this, I sent a patch to use '-Wno-unknown-attribute' for kernel
> builds. Masahiro Yamada has already taken it to the linux-kbuild tree.
> I'm not sure if it's planned for the next -rc or for 4.17, though.
>
> -- Luc Van Oostenryck
I am planning to send it in the next MW (i.e. v4.17-rc1)
If you want me to send this earlier as fixes PR,
please let me know.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] sparse doesn't support indirect_branch attribute
2018-02-28 1:30 ` Masahiro Yamada
@ 2018-03-01 10:06 ` Luc Van Oostenryck
2018-03-01 10:23 ` Masahiro Yamada
0 siblings, 1 reply; 9+ messages in thread
From: Luc Van Oostenryck @ 2018-03-01 10:06 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Linus Torvalds, Randy Dunlap, Matthew Wilcox, Linux Kernel Mailing List
On Wed, Feb 28, 2018 at 10:30:58AM +0900, Masahiro Yamada wrote:
> 2018-02-28 7:36 GMT+09:00 Luc Van Oostenryck <luc.vanoostenryck@gmail.com>:
> >
> > To compensate this, I sent a patch to use '-Wno-unknown-attribute' for kernel
> > builds. Masahiro Yamada has already taken it to the linux-kbuild tree.
> > I'm not sure if it's planned for the next -rc or for 4.17, though.
>
> I am planning to send it in the next MW (i.e. v4.17-rc1)
>
> If you want me to send this earlier as fixes PR,
> please let me know.
>
Hi,
Thanks for having taken this patch promptly.
Given that the warnings is issued more than 148000 and thus tend
to drown the other, more useful, warnings in the noise, I think
it would be a good thing to have this patch already in 4.16.
I should have put this clearly in the patch description.
Best regards,
-- Luc Van Oostenryck
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] sparse doesn't support indirect_branch attribute
2018-03-01 10:06 ` Luc Van Oostenryck
@ 2018-03-01 10:23 ` Masahiro Yamada
0 siblings, 0 replies; 9+ messages in thread
From: Masahiro Yamada @ 2018-03-01 10:23 UTC (permalink / raw)
To: Luc Van Oostenryck
Cc: Linus Torvalds, Randy Dunlap, Matthew Wilcox, Linux Kernel Mailing List
2018-03-01 19:06 GMT+09:00 Luc Van Oostenryck <luc.vanoostenryck@gmail.com>:
> On Wed, Feb 28, 2018 at 10:30:58AM +0900, Masahiro Yamada wrote:
>> 2018-02-28 7:36 GMT+09:00 Luc Van Oostenryck <luc.vanoostenryck@gmail.com>:
>> >
>> > To compensate this, I sent a patch to use '-Wno-unknown-attribute' for kernel
>> > builds. Masahiro Yamada has already taken it to the linux-kbuild tree.
>> > I'm not sure if it's planned for the next -rc or for 4.17, though.
>>
>> I am planning to send it in the next MW (i.e. v4.17-rc1)
>>
>> If you want me to send this earlier as fixes PR,
>> please let me know.
>>
>
> Hi,
>
> Thanks for having taken this patch promptly.
> Given that the warnings is issued more than 148000 and thus tend
> to drown the other, more useful, warnings in the noise, I think
> it would be a good thing to have this patch already in 4.16.
> I should have put this clearly in the patch description.
>
> Best regards,
> -- Luc Van Oostenryck
OK. I will send a PR for v4.16-rc4 this weekend.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-03-01 10:24 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-27 19:48 [PATCH] sparse doesn't support indirect_branch attribute Matthew Wilcox
2018-02-27 20:18 ` Randy Dunlap
2018-02-27 22:12 ` Linus Torvalds
2018-02-27 22:30 ` Randy Dunlap
2018-02-27 22:32 ` Linus Torvalds
2018-02-27 22:36 ` Luc Van Oostenryck
2018-02-28 1:30 ` Masahiro Yamada
2018-03-01 10:06 ` Luc Van Oostenryck
2018-03-01 10:23 ` Masahiro Yamada
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).