From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] kvm: user: include arch specific headers from $(KERNELDIR) Date: Thu, 14 May 2009 11:02:51 +0300 Message-ID: <4A0BD02B.1020009@redhat.com> References: <1242203541-12959-1-git-send-email-markmc@redhat.com> <200905132157.02633.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Mark McLoughlin , kvm@vger.kernel.org To: Arnd Bergmann Return-path: Received: from mx2.redhat.com ([66.187.237.31]:45538 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754266AbZENID0 (ORCPT ); Thu, 14 May 2009 04:03:26 -0400 In-Reply-To: <200905132157.02633.arnd@arndb.de> Sender: kvm-owner@vger.kernel.org List-ID: Arnd Bergmann wrote: > On Wednesday 13 May 2009 08:32:21 Mark McLoughlin wrote: > >> Currently we only include $(KERNELDIR)/include in CFLAGS, >> but we also have $(KERNELDIR)/arch/$(arch)/include or else >> we'll get mis-matched headers. >> >> > > I think this is fundamentally wrong. User files should never directly > access kernel headers, because they are postprocessed in various > ways in order to get files that are valid in user space, e.g. __user > annotations are removed. > There aren't the real kernel headers, just cheap copies carried in qemu-kvm.git which have been appropriately postprocessed. We do this since the kvm external module can run on a much older kernel, so there is no natural place to find it headers. > The three possible sources for kernel headers are: > > /usr/include > - system provided headers, may be older than the running kernel > /lib/modules/$(uname -r)/build/usr/include > - user space headers for the currently running kernel > $(KERNELDIR)/usr/include > - user space headers from a configured kernel tree after 'make headers_install' None of these are sufficiently up-to-date. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.