From: David Howells <dhowells@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Jan Kiszka <jan.kiszka@siemens.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
qemu-devel qemu-devel <qemu-devel@nongnu.org>,
dhowells@redhat.com,
"qemu-ppc@nongnu.org List" <qemu-ppc@nongnu.org>,
Bharat Bhushan <bharat.bhushan@freescale.com>,
Bharat Bhushan <r65777@freescale.com>
Subject: Re: [Qemu-devel] [PATCH v2] Added uapi directory into linux-header
Date: Tue, 18 Dec 2012 14:10:20 +0000 [thread overview]
Message-ID: <6056.1355839820@warthog.procyon.org.uk> (raw)
In-Reply-To: <0C2DB64D-B8EB-492B-876F-111BD818101C@suse.de>
Alexander Graf <agraf@suse.de> wrote:
> But looking through this whole thing, it seems like the root cause is
> actually different. We don't want any uapi directories exposed to user
> space. So let's go back a step:
>
> Why do we need the uapi include dir? Because some header is using it.
>
> linux-headers/asm-powerpc/kvm_para.h:
>
> #include <uapi/asm/epapr_hcalls.h>
>
> This is the root cause of the problem. We must never manually include any
> uapi header paths. We only ever include their normal asm-counterparts which
> then may include uapi (in kernel) or actually are uapi (in user
> space). David, please correct me if I'm wrong.
I think you're correct, if I understand what you're saying.
Within the kernel sources, the userspace facing headers are in uapi/
directories whilst the stuff userspace shouldn't see is outside of that.
uapi/ headers should _not_ #include headers with uapi/ prefixes; rather they
should rely on the -I flags to pull in the UAPI header if the KAPI header of
the same name does not exist.
However, KAPI headers that shadow UAPI headers (linux/fs.h for example) _must_
manually #include the UAPI header with the uapi/ prefix as there's no other
way to reach it. I originally used #include_next for this, but some people
refused to countenance it because it's a gcc-ism, but no matter.
After doing make headers_install in the kernel, you should find the contents
of the appropriate uapi/ directories installed in the target directory without
any uapi/ directories present. Further, the _UAPI prefixes on the guards are
removed if present. There should be no #includes with "uapi/" in their
filenames.
David
next prev parent reply other threads:[~2012-12-18 14:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-17 16:01 [Qemu-devel] [PATCH v2] Added uapi directory into linux-header Bharat Bhushan
2012-12-17 17:48 ` Alexander Graf
2012-12-18 1:14 ` Bhushan Bharat-R65777
2012-12-18 1:20 ` Alexander Graf
2012-12-18 1:27 ` Bhushan Bharat-R65777
2012-12-18 1:29 ` Alexander Graf
2012-12-18 2:07 ` Bhushan Bharat-R65777
2012-12-18 10:08 ` Alexander Graf
2012-12-18 10:19 ` Bhushan Bharat-R65777
2012-12-18 10:38 ` Alexander Graf
2012-12-18 14:10 ` David Howells [this message]
2012-12-18 14:11 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6056.1355839820@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=agraf@suse.de \
--cc=bharat.bhushan@freescale.com \
--cc=jan.kiszka@siemens.com \
--cc=mtosatti@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=r65777@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.