Re: [PATCH v2] Compiler Attributes: don't pollute userspace with macro definitions

From: åæè
Date: Fri Dec 14 2018 - 05:17:28 EST


Hi Miguel,

On Thu, Dec 13, 2018 at 10:59:10PM +0100, Miguel Ojeda wrote:

> I wonder if we can/should simply move them into the __KERNEL__ &&
> !__ASSEMBLY__ block that is above, instead. It would be simpler to
> read, and there aren't apparently dependencies to those outside it
> that go after the block.

Yes, this is also more accurate. I will send a v3.

> I took a look at where the macros were at each "step", and, on one
> hand, compiler-gcc.h was (and is) included entirely inside it, which
> is from where most of the macros come originally from. On the other
> hand, not all do: __must_check (the generic version, not the one in
> -gcc.h) and noinline_for_stack were defined in __KERNEL__ (only)
> before commit 815f0ddb346c ("include/linux/compiler*.h: make
> compiler-*.h mutually exclusive"). But anyway using those two in
> assembly does not make sense, right?
>
> What do you think?

A simple grep shows no assembly are using those macros. Pretty sure
it is safe to do it this way.


Thanks,
Xiaozhou