From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755416AbcEEAts (ORCPT ); Wed, 4 May 2016 20:49:48 -0400 Received: from mail-yw0-f178.google.com ([209.85.161.178]:35273 "EHLO mail-yw0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752783AbcEEAtr (ORCPT ); Wed, 4 May 2016 20:49:47 -0400 MIME-Version: 1.0 From: Brooks Moses Date: Wed, 4 May 2016 17:49:27 -0700 Message-ID: Subject: Is BIT() in arch/x86/include/uapi/asm/kvm.h defined? Where? To: linux-kernel@vger.kernel.org Cc: Ian Kasprzak , Paolo Bonzini , Borislav Petkov Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! 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 undefined: https://github.com/torvalds/linux/blob/master/arch/x86/include/uapi/asm/kvm.h#L219 I attempted to find where it was supposed to be defined, and the only match for "define BIT(" in the whole tree is in include/linux/bitops.h: https://github.com/torvalds/linux/blob/master/include/linux/bitops.h#L6 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? Thanks, - 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. https://github.com/torvalds/linux/commit/9c15bb1d0a8411f9bb3395d21d5309bde7da0c1c