Is BIT() in arch/x86/include/uapi/asm/kvm.h defined? Where?

From: Brooks Moses
Date: Wed May 04 2016 - 20:49:51 EST


Ian and I have run into what looks like a bug in
arch/x86/include/uapi/asm/kvm.h, but it also looks so obvious that we
surely must be doing something wrong. So I request enlightenment.

We discovered this problem on the 4.5.2 release, but the relevant code
appears unchanged from 2013 until current trunk.

When I run "make ARCH=x86 headers_install", and then write a simple C
file that #includes "asm/kvm.h" from the resulting tree, I get a
compiler error: the BIT() macro used on line 219 of that file is

I attempted to find where it was supposed to be defined, and the only
match for "define BIT(" in the whole tree is in

However, that's not in a "uapi" directory, and it's not listed in
include/uapi/linux/Kbuild, so "make headers_install" doesn't install
it. Further, kvm.h doesn't reference it with a #include, so even if
it were installed, it wouldn't be included.

It seems that we must be missing something obvious. But what?

- Brooks

P.S. The change that appears to have added this reference is this
one, signed-off-on by Borislav and Paolo, which is why I've added you
to the cc line.