Re: [PATCH 1/5] x86/cpufeature: Carve out X86_FEATURE_*

From: Borislav Petkov
Date: Fri Jan 22 2016 - 06:20:08 EST


On Thu, Jan 21, 2016 at 08:03:40PM +0100, Borislav Petkov wrote:
> On Thu, Jan 21, 2016 at 10:57:06AM -0800, H. Peter Anvin wrote:
> > On 01/21/16 10:34, Borislav Petkov wrote:
> > > +#ifndef _ASM_X86_REQUIRED_FEATURES_H
> >
> > Why do we have all these include guards at the point of the #include?
> > This is not standard procedure.
>
> Some uapi monkey business:
>
> abbf1590de22 ("UAPI: Partition the header include path sets and add uapi/ header directories")
>
> The funny thing is, the headers themselves have the guards too. I'll try
> to remove them to see what breaks.

Ah, here it is:

In file included from arch/x86/boot/mkcpustr.c:20:0:
arch/x86/boot/../include/asm/cpufeatures.h:4:35: fatal error: asm/required-features.h: No such file or directory
compilation terminated.
make[1]: *** [arch/x86/boot/mkcpustr] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [bzImage] Error 2
make: *** Waiting for unfinished jobs....

That's when you remove the #ifndef guards.

And I think the commit above does this special dancing to keep
cpufeature.h a kernel-only header and not make it an uapi one. David, am
I close?

Thanks.

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.