linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
To: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Stefano Stabellini
	<stefano.stabellini-mvvWK6WmYclDPfheJLI6IQ@public.gmane.org>,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	Konrad Rzeszutek Wilk
	<konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	Boris Ostrovsky
	<boris.ostrovsky-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	xen-devel-GuqFBffKawtpuQazS67q72D2FQJk+8+b@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v4 75/79] include/uapi/xen/privcmd.h: fix compilation in userspace
Date: Thu, 15 Oct 2015 12:24:39 +0100	[thread overview]
Message-ID: <561F8CF7.9070102@citrix.com> (raw)
In-Reply-To: <20151015111801.GW6104-dqH1CgrzRhOk/eJAJmRu5A@public.gmane.org>

On 15/10/15 12:18, Mikko Rapeli wrote:
> On Thu, Oct 15, 2015 at 11:29:12AM +0100, David Vrabel wrote:
>> On 15/10/15 06:56, Mikko Rapeli wrote:
>>> xen/interface/xen.h is not exported from kernel headers so remove the
>>> dependency and provide needed defines for domid_t and xen_pfn_t if they
>>> are not already defined by some other e.g. Xen specific headers.
>>>
>>> Suggested by Andrew Cooper <andrew.cooper3-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org> on lkml message
>>> <5569F9C9.8000607-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>.
>>>
>>> The ifdef for ARM is ugly but did not find better solutions for it.
>>>
>>> Fixes userspace compilation error:
>>>
>>> xen/privcmd.h:38:31: fatal error: xen/interface/xen.h: No such file or directory
>> [...]
>>> --- a/include/uapi/xen/privcmd.h
>>> +++ b/include/uapi/xen/privcmd.h
>>> @@ -35,7 +35,19 @@
>>>  
>>>  #include <linux/types.h>
>>>  #include <linux/compiler.h>
>>> -#include <xen/interface/xen.h>
>>> +
>>> +/* Might be defined by Xen specific headers, but if not */
>>> +#ifndef domid_t
>>> +typedef __u16 domid_t;
>>> +#endif /* domid_t */
>>
>> As the kbuild bot points out, this does not work since the existence of
>> a typedef cannot be checked with #ifdef.
> 
> Yeah, this hack doesn't cut it. Sorry. Tried to implement these changes:
> http://www.spinics.net/lists/linux-api/msg11048.html
> 
>> I'm not really sure what problem you're trying to solve.  A user space
>> program making use of this interface gets the domid_t and xen_pfn_t etc
>> typedefs from the headers provided as part of the libxenctrl library.
> 
> I'm trying to make sure that kernel headers in userspace compile with minimal
> dependencies which are gcc and libc.
> 
> For me it is clear by now that many Linux API's and ABI's like Xen parts do
> not live in the uapi header files and instead there's a separate userspace
> library with needed headers and defines which have embedded copies of
> the needed API and ABI definitions, like header files.
> 
> So how could this file be changed so that it compiles in userspace without
> definitions from libxenctrl?

I don't think anything needs to be changed.

Instead I would make your compilation check of this header dependent on
the existence of the xen/interface/xen.h header. Or you may exclude the
check of this header entirely.

> I guess I could copy the needed definitions for domid_t and xen_pfn_t from
> xen/interface/xen.h of libxenctrl. That I should have done to begin with
> instead of trying to hack something on my own.

I do not want definitions duplicated/copied from the hypervisor ABI
headers.  This causes problems when support for new architectures is
added (for example).

David

  parent reply	other threads:[~2015-10-15 11:24 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1444888618-4506-1-git-send-email-mikko.rapeli@iki.fi>
2015-10-15  5:55 ` [PATCH v4 03/79] drm.h: use __kernel_size_t instead of size_t Mikko Rapeli
2015-10-15  5:55 ` [PATCH v4 04/79] drm_mode.h: use __u32 and __u64 from linux/types.h Mikko Rapeli
     [not found]   ` <1444888618-4506-5-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-10-15 13:32     ` Alex Deucher
2015-10-15 13:48       ` Mikko Rapeli
     [not found]         ` <20151015134844.GY6104-dqH1CgrzRhOk/eJAJmRu5A@public.gmane.org>
2015-10-21 15:09           ` Emil Velikov
2015-10-21 15:18             ` Alex Deucher
2015-10-21 16:21               ` Emil Velikov
2015-10-21 16:27                 ` Alex Deucher
     [not found]                   ` <CADnq5_OgN6tNKSGU-zUdhjNbqK+XRkGXccgxVtz+5092unza4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-21 17:42                     ` Emil Velikov
2015-10-15  5:55 ` [PATCH v4 05/79] exynos_drm.h: use " Mikko Rapeli
2015-10-15 16:17   ` Gustavo Padovan
2015-10-15  5:55 ` [PATCH v4 06/79] nouveau_drm.h: use __u32 and " Mikko Rapeli
2015-10-15  5:55 ` [PATCH v4 07/79] radeon_drm.h: " Mikko Rapeli
2015-10-15  5:55 ` [PATCH v4 08/79] r128_drm.h: include drm/drm.h Mikko Rapeli
2015-10-15  7:43   ` Daniel Vetter
2015-10-15  5:55 ` [PATCH v4 09/79] via_drm.h: don't include non-existing via_drmclient.h Mikko Rapeli
2015-10-21 15:01   ` Emil Velikov
2015-10-15  5:55 ` [PATCH v4 10/79] via_drm.h: move struct via_file_private definition to drivers/gpu/drm/via/via_drv.h Mikko Rapeli
2015-10-21 14:36   ` Emil Velikov
     [not found]     ` <CACvgo515FB4MSTWdR0dQdvNccYhMMhBD1bgL=heMLfrw7iqdmA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-21 15:33       ` Daniel Vetter
     [not found]         ` <20151021153323.GF16848-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2015-10-21 16:25           ` Emil Velikov
2015-10-15  5:55 ` [PATCH v4 12/79] include/uapi/drm/sis_drm.h: move sis_file_private to drivers/gpu/drm/sis/sis_drv.h Mikko Rapeli
2015-10-21 14:39   ` Emil Velikov
2015-10-21 15:34     ` Daniel Vetter
2015-10-15  5:55 ` [PATCH v4 13/79] drm/i810_drm.h: include drm/drm.h Mikko Rapeli
     [not found]   ` <1444888618-4506-14-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-10-15  7:44     ` Daniel Vetter
2015-10-15  5:55 ` [PATCH v4 14/79] include/uapi/drm/vmwgfx_drm.h: use __s32, __u32 and __u64 from linux/types.h Mikko Rapeli
2015-10-15  5:55 ` [PATCH v4 15/79] include/uapi/drm/qxl_drm.h: " Mikko Rapeli
2015-10-15  5:55 ` [PATCH v4 16/79] include/uapi/linux/agpgart.h: include stdlib.h in userspace Mikko Rapeli
2015-10-15  5:55 ` [PATCH v4 17/79] include/uapi/sound/emu10k1.h: added EMU10K1 version of DECLARE_BITMAP macro Mikko Rapeli
2015-10-15  8:04   ` Takashi Iwai
2015-10-15  5:55 ` [PATCH v4 18/79] dm-log-userspace.h: use __u32, __s32 and __u64 from linux/types.h Mikko Rapeli
     [not found]   ` <1444888618-4506-19-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-10-15  8:09     ` Mike Snitzer
     [not found]       ` <20151015080950.GA25635-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-10-15 17:53         ` Mikko Rapeli
2015-10-15  5:55 ` [PATCH v4 19/79] hsi_char.h: use __u32 " Mikko Rapeli
2015-10-15  5:55 ` [PATCH v4 20/79] include/uapi/linux/hsi/cs-protocol.h: include linux/time.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 22/79] cld.h: use __u8, __u16, __s16, __u32 and __s64 from linux/types.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 23/79] rds.h: " Mikko Rapeli
     [not found]   ` <1444888618-4506-24-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-10-15 11:06     ` Sowmini Varadhan
     [not found]       ` <20151015110614.GL948-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-10-15 22:00         ` Mikko Rapeli
2015-10-15 22:21           ` Sowmini Varadhan
     [not found]             ` <20151015222105.GA12132-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-10-15 22:39               ` Mikko Rapeli
     [not found]                 ` <20151015223911.GH6104-dqH1CgrzRhOk/eJAJmRu5A@public.gmane.org>
2015-10-15 23:03                   ` Sowmini Varadhan
     [not found] ` <1444888618-4506-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-10-15  5:55   ` [PATCH v4 11/79] savage_drm.h: include <drm/drm.h> Mikko Rapeli
     [not found]     ` <1444888618-4506-12-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-10-15  6:44       ` Daniel Vetter
2015-10-15  5:55   ` [PATCH v4 21/79] ebtables.h: use __u64 from linux/types.h Mikko Rapeli
2015-11-23 16:55     ` Pablo Neira Ayuso
2015-10-15  5:56   ` [PATCH v4 24/79] sctp.h: use __u8 and __u32 " Mikko Rapeli
2015-10-15  5:56   ` [PATCH v4 29/79] gntalloc.h: use __u16, __u32 and __u64 " Mikko Rapeli
2015-10-15 10:55     ` [Xen-devel] " David Vrabel
2015-10-15  5:56   ` [PATCH v4 35/79] asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h Mikko Rapeli
2015-10-15  5:56   ` [PATCH v4 48/79] include/uapi/linux/mqueue.h: include linux/types.h Mikko Rapeli
2015-10-15  5:56   ` [PATCH v4 50/79] include/uapi/linux/dlm_netlink.h: include linux/dlmconstants.h Mikko Rapeli
2015-10-15  5:56   ` [PATCH v4 54/79] include/uapi/asm-generic/ucontext.h: include asm/signal.h and asm/sigcontext.h Mikko Rapeli
2015-10-15  5:56   ` [PATCH v4 56/79] include/uapi/linux/auto_fs.h: include linux/limits.h Mikko Rapeli
2015-10-15  5:56   ` [PATCH v4 57/79] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h Mikko Rapeli
2015-10-15  5:56   ` [PATCH v4 59/79] include/uapi/linux/omapfb.h: use __kernel_size_t instead of size_t Mikko Rapeli
2015-10-15  5:56   ` [PATCH v4 63/79] include/uapi/linux/kexec.h: " Mikko Rapeli
2015-10-15  5:56   ` [PATCH v4 70/79] include/uapi/mtd/mtd-user.h: remove stdint.h include Mikko Rapeli
2015-10-15  5:56   ` [PATCH v4 76/79] coda_psdev.h: move upc_req definition from uapi to kernel side headers Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 25/79] scsi_bsg_fc.h: use __u8, __u32 and __u64 from linux/types.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 26/79] scsi_netlink.h: use __u8, __u16 " Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 27/79] scsi_netlink_fc.h: use __u16, __u32 " Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 28/79] hdspm.h: use __u8, __u32 and __u64 from linux/types.h instead of stdint.h Mikko Rapeli
2015-10-15  8:04   ` Takashi Iwai
2015-10-15  5:56 ` [PATCH v4 30/79] gntdev.h: use __u32 and __u64 from linux/types.h Mikko Rapeli
2015-10-15 10:56   ` [Xen-devel] " David Vrabel
2015-10-15  5:56 ` [PATCH v4 31/79] include/uapi/linux/sysctl.h: use __kernel_size_t instead of size_t Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 32/79] include/uapi/asm-generic/ipcbuf.h: include linux/posix_types.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 33/79] include/uapi/asm-generic/msgbuf.h: include asm/ipcbuf.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 34/79] include/uapi/asm-generic/shmbuf.h: include fixes Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 36/79] include/uapi/asm-generic/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 37/79] include/uapi/linux/socket.h: include sys/socket.h in userspace Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 38/79] include/uapi/linux/rds.h: include linux/socket.h and linux/types.h Mikko Rapeli
     [not found]   ` <1444888618-4506-39-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-10-15 11:10     ` Sowmini Varadhan
2015-10-15  5:56 ` [PATCH v4 39/79] include/uapi/linux/if_pppox.h: include linux/if.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 40/79] include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and linux/in6.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 41/79] include/uapi/linux/ipv6_route.h: include linux/in6.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 42/79] " Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 43/79] include/uapi/linux/if_pppol2tp.h: include linux/in.h and linux/in6.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 44/79] include/uapi/linux/if_pppox.h: " Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 45/79] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ definition to hdlc/ioctl.h Mikko Rapeli
     [not found]   ` <1444888618-4506-46-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-10-15  8:49     ` Frans Klaver
     [not found]       ` <CAH6sp9Pc48Qfux9K68rCRvfBUhEpxqM9k43Nn2vCpKh4Ewa+QQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-15 18:08         ` Mikko Rapeli
     [not found]           ` <20151015180850.GC6104-dqH1CgrzRhOk/eJAJmRu5A@public.gmane.org>
2015-10-15 18:11             ` [PATCH] " Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 46/79] include/uapi/linux/packet_diag.h: include linux/netdevice.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 47/79] include/uapi/linux/llc.h: include linux/if.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 49/79] include/uapi/linux/mroute.h: include linux/in.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 51/79] include/uapi/linux/ip6_tunnel.h: include linux/if.h and linux/in6.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 52/79] include/uapi/netfilter/*.h: fix include files for compilation Mikko Rapeli
2015-11-23 16:55   ` Pablo Neira Ayuso
2015-10-15  5:56 ` [PATCH v4 53/79] include/uapi/linux/errqueue.h: include linux/time.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 58/79] include/uapi/linux/target_core_user.h: use __u8, __u16, __u32 and __u64 from linux/types.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 60/79] include/uapi/linux/atm_zatm.h: include linux/time.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 61/79] include/uapi/linux/scc.h: include linux/sockios.h Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 62/79] include/uapi/linux/btrfs.h: define NULL Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 64/79] include/uapi/linux/reiserfs_xattr.h: use __kernel_size_t instead of size_t Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 65/79] include/uapi/linux/patchkey.h: change #error to #warning if file included directly Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 66/79] include/uapi/linux/coda.h: use __kernel_pid_t and add u_short etc definitions for userspace Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 67/79] include/uapi/linux/android/binder.h: use __kernel_pid_t and __kernel_uid_t Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 69/79] include/uapi/linux/dvb/video.h: remove stdint.h include Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 71/79] include/uapi/linux/fuse.h: use linux/types.h also in userspace Mikko Rapeli
     [not found]   ` <1444888618-4506-72-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-10-15 15:20     ` Miklos Szeredi
     [not found]       ` <CAJfpegv2P0=FCsqriYteyZQ9Ldu4DE1JfNs=URW7Cd-9fpA=oQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-15 17:41         ` Mikko Rapeli
     [not found]           ` <20151015174154.GZ6104-dqH1CgrzRhOk/eJAJmRu5A@public.gmane.org>
2015-10-15 18:32             ` Miklos Szeredi
     [not found]               ` <CAJfpegtSK-ttDXN+vz+yzsU9P1m7fDCn2VwXfHyJuWL6-O-g3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-15 18:59                 ` Arnd Bergmann
2015-10-15 19:25                   ` Miklos Szeredi
     [not found]                     ` <CAJfpegtYhwMW7vBPXG02fuijfsv3cGCwe9z=LWE56jKqvJwDMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-15 21:03                       ` Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 75/79] include/uapi/xen/privcmd.h: fix compilation " Mikko Rapeli
     [not found]   ` <1444888618-4506-76-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-10-15 10:07     ` kbuild test robot
2015-10-15 10:29     ` David Vrabel
2015-10-15 11:18       ` Mikko Rapeli
     [not found]         ` <20151015111801.GW6104-dqH1CgrzRhOk/eJAJmRu5A@public.gmane.org>
2015-10-15 11:24           ` David Vrabel [this message]
     [not found]             ` <561F8CF7.9070102-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
2015-10-15 11:35               ` Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 77/79] include/uapi/linux/elfcore.h: remove non-compiling userspace parts Mikko Rapeli
2015-10-15  5:56 ` [PATCH v4 78/79] include/uapi/linux/errqueue.h: include time.h in userspace Mikko Rapeli

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=561F8CF7.9070102@citrix.com \
    --to=david.vrabel-sxgqhf6nn4dqt0dzr+alfa@public.gmane.org \
    --cc=boris.ostrovsky-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=mikko.rapeli-X3B1VOXEql0@public.gmane.org \
    --cc=stefano.stabellini-mvvWK6WmYclDPfheJLI6IQ@public.gmane.org \
    --cc=xen-devel-GuqFBffKawtpuQazS67q72D2FQJk+8+b@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).