Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1467924 > unrolled thread

[PATCH v05 00/72] Userspace compile test and fixes for exported uapi header files

Started byMikko Rapeli <mikko.rapeli@iki.fi>
First post2016-08-22 20:50 +0200
Last post2016-08-22 21:50 +0200
Articles 20 on this page of 87 — 11 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v05 00/72] Userspace compile test and fixes for exported uapi header files Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 31/72] include/uapi/linux/mroute.h: include linux/in.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 31/72] include/uapi/linux/mroute.h: include  linux/in.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 18/72] include/uapi/asm-generic/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ definition to hdlc/ioctl.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ  definition to hdlc/ioctl.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
        Re: [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ  definition to hdlc/ioctl.h David Miller <davem@davemloft.net> - 2016-08-23 09:10 +0200
          Re: [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ  definition to hdlc/ioctl.h Frans Klaver <fransklaver@gmail.com> - 2016-08-23 10:10 +0200
            Re: [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ  definition to hdlc/ioctl.h Frans Klaver <fransklaver@gmail.com> - 2016-08-24 09:00 +0200
        Re: [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ  definition to hdlc/ioctl.h Frans Klaver <fransklaver@gmail.com> - 2016-08-23 09:20 +0200
    [PATCH v05 26/72] include/uapi/linux/if_pppox.h: include linux/in.h and linux/in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 26/72] include/uapi/linux/if_pppox.h: include  linux/in.h and linux/in6.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 17/72] asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 41/72] include/uapi/linux/atm_zatm.h: include linux/time.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 41/72] include/uapi/linux/atm_zatm.h: include  linux/time.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 37/72] include/uapi/linux/auto_fs.h: include linux/limits.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 37/72] include/uapi/linux/auto_fs.h: include  linux/limits.h Ian Kent <raven@themaw.net> - 2016-08-23 02:50 +0200
    [PATCH v05 30/72] include/uapi/linux/mqueue.h: include linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 05/72] hsi_char.h: use __u32 from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 05/72] hsi_char.h: use __u32 from linux/types.h Sebastian Reichel <sre@kernel.org> - 2016-08-22 23:00 +0200
    [PATCH v05 13/72] include/uapi/linux/sysctl.h: use __kernel_size_t instead of size_t Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 39/72] include/uapi/linux/target_core_user.h: use __u8, __u16, __u32 and __u64 from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 32/72] include/uapi/linux/dlm_netlink.h: include linux/dlmconstants.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 33/72] include/uapi/linux/ip6_tunnel.h: include linux/if.h and linux/in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 28/72] include/uapi/linux/packet_diag.h: include linux/netdevice.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 36/72] arch/x86/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32  from linux/types.h Stephen Hemminger <stephen@networkplumber.org> - 2016-08-22 21:40 +0200
        Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32  from linux/types.h David Miller <davem@davemloft.net> - 2016-08-23 01:30 +0200
        Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32  from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 09:00 +0200
      Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32  from linux/types.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 43/72] include/uapi/linux/btrfs.h: define NULL Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include linux/time.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include  linux/time.h Sebastian Reichel <sre@kernel.org> - 2016-08-22 23:00 +0200
        Re: [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include  linux/time.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 09:00 +0200
    [PATCH v05 02/72] scripts/headers_compile_test.sh: compile test script for exported headers Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:00 +0200
      Re: [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32  from linux/types.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:00 +0200
      Re: [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
        Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header  file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 23:30 +0200
          Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header  file compatibility fixes David Miller <davem@davemloft.net> - 2016-08-24 01:50 +0200
    [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:00 +0200
      Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header  file compatibility fixes David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
      Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header  file compatibility fixes David Miller <davem@davemloft.net> - 2016-08-24 01:50 +0200
    [PATCH v05 55/72] include/uapi/xen/gntdev.h: include xen/privcmd.h and define grant_ref_t Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:00 +0200
    [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:10 +0200
      Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include  linux/if.h Stephen Hemminger <stephen@networkplumber.org> - 2016-08-22 21:40 +0200
        Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include  linux/if.h David Miller <davem@davemloft.net> - 2016-08-23 01:30 +0200
        Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include  linux/if.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 08:50 +0200
      Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include  linux/if.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 57/72] coda_psdev.h: move upc_req definition from uapi to kernel side headers Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:10 +0200
    [PATCH v05 65/72] uapi fcntl.h: glibc fcntl.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:10 +0200
    [PATCH v05 23/72] include/uapi/linux/ipv6_route.h: include linux/in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
      Re: [PATCH v05 23/72] include/uapi/linux/ipv6_route.h: include  linux/in6.h David Miller <davem@davemloft.net> - 2016-08-23 01:30 +0200
    [PATCH v05 19/72] include/uapi/linux/socket.h: include sys/socket.h in userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
    [PATCH v05 60/72] arch/arm/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
      Re: [PATCH v05 60/72] arch/arm/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t Arnd Bergmann <arnd@arndb.de> - 2016-08-24 17:10 +0200
    [PATCH v05 69/72] uapi rose.h: glibc netrose/rose.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
    [PATCH v05 52/72] include/linux/sdb.h: use linux/types.h types instead of stdint.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
    [PATCH v05 54/72] include/uapi/xen/privcmd.h: fix compilation in userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
      Re: [PATCH v05 54/72] include/uapi/xen/privcmd.h: fix compilation in  userspace Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-08-23 12:10 +0200
        Re: [PATCH v05 54/72] include/uapi/xen/privcmd.h: fix compilation  in userspace Stefano Stabellini <sstabellini@kernel.org> - 2016-08-23 20:20 +0200
          Re: [PATCH v05 54/72] include/uapi/xen/privcmd.h: fix compilation in  userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 22:40 +0200
            Re: [PATCH v05 54/72] include/uapi/xen/privcmd.h: fix compilation  in userspace Stefano Stabellini <sstabellini@kernel.org> - 2016-08-23 23:20 +0200
    [PATCH v05 24/72] include/uapi/linux/ipv6_route.h: include linux/in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 56/72] include/uapi/xen/evtchn.h: include xen/privcmd.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 63/72] include/uapi/sound/Kbuild: remove sound/asoc.h from userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 64/72] include/uapi/linux/ipx.h: fix conflicting defitions with glibc netipx/ipx.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
      Re: [PATCH v05 64/72] include/uapi/linux/ipx.h: fix conflicting  defitions with glibc netipx/ipx.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 20/72] include/uapi/linux/rds.h: include linux/socket.h and linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 58/72] include/uapi/linux/elfcore.h: remove non-compiling userspace parts Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 70/72] uapi time.h: glibc time.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 68/72] uapi ax25.h: glibc netax25/ax25.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
      Re: [PATCH v05 68/72] uapi ax25.h: glibc netax25/ax25.h header  file compatibility fixes David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 50/72] include/uapi/linux/fuse.h: use linux/types.h also in userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
      Re: [PATCH v05 50/72] include/uapi/linux/fuse.h: use linux/types.h  also in userspace Miklos Szeredi <miklos@szeredi.hu> - 2016-08-23 09:20 +0200
        Re: [PATCH v05 50/72] include/uapi/linux/fuse.h: use linux/types.h  also in userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 09:50 +0200
    [PATCH v05 67/72] uapi uio.h: glibc sys/uio.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 59/72] include/uapi/linux/errqueue.h: include time.h in userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:40 +0200
    [PATCH v05 53/72] include/linux/xz.h: use linux/types.h types instead of stdint.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:40 +0200
    [PATCH v05 61/72] include/uapi/rdma/rdma_user_rxe.h: include in.h and in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:40 +0200
      Re: [PATCH v05 61/72] include/uapi/rdma/rdma_user_rxe.h: include in.h  and in6.h Doug Ledford <dledford@redhat.com> - 2016-08-23 17:10 +0200
    [PATCH v05 71/72] uapi term*.h: glibc termios.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:50 +0200
    [PATCH v05 22/72] include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and linux/in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:50 +0200
      Re: [PATCH v05 22/72] include/uapi/linux/if_tunnel.h: include  linux/if.h, linux/ip.h and linux/in6.h David Miller <davem@davemloft.net> - 2016-08-23 01:30 +0200
    [PATCH v05 51/72] include/linux/ipmi-fru.h: use linux/types.h instead of stdint.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:50 +0200

Page 3 of 5 — ← Prev page 1 2 [3] 4 5  Next page →


#1468890 — Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-23 23:30 +0200
SubjectRe: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes
Message-ID<s9rqG-18W-31@gated-at.bofh.it>
In reply to#1468167
On Mon, Aug 22, 2016 at 04:32:51PM -0700, David Miller wrote:
> You have to post this properly to the netdev list.
> 
> If netdev is not CC:'d it doesn't get properly logged in patchwork,
> and won't be applied.

Sorry, get_maintainers.pl did not find netdev list for these patches.

Could you update MAINTAINERS so that networking stuff from include/linux/uapi/
finds netdev?

I could propose patches but they are bound to be incomplete so networking devs
could do this faster and with fewer review iterations.

This problem seems to be quite common though. Maybe the uapi split did not
update MAINTAINER file with include/uapi files.

-Mikko

[toc] | [prev] | [next] | [standalone]


#1468978 — Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes

FromDavid Miller <davem@davemloft.net>
Date2016-08-24 01:50 +0200
SubjectRe: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes
Message-ID<s9tC9-2t9-3@gated-at.bofh.it>
In reply to#1468890
From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Wed, 24 Aug 2016 00:21:45 +0300

> I could propose patches but they are bound to be incomplete so
> networking devs could do this faster and with fewer review
> iterations.

If I did it I'm seriously not going to go any further than taking the
diffstat of your patches and using that to add entries to MAINTAINERS.

So you could do it equally as well.

I don't have time for an exhaustive add.

[toc] | [prev] | [next] | [standalone]


#1467958 — [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:00 +0200
Subject[PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes
Message-ID<s92BY-1yy-41@gated-at.bofh.it>
In reply to#1467924
Fixes this userspace compile error when glibc netinet/ip_icmp.h is included
before linux/icmp.h:

linux/icmp.h:68:8: error: redefinition of ‘struct icmphdr’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/icmp.h        |  4 +++-
 include/uapi/linux/libc-compat.h | 10 ++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/icmp.h b/include/uapi/linux/icmp.h
index fddd9d7..cd38005 100644
--- a/include/uapi/linux/icmp.h
+++ b/include/uapi/linux/icmp.h
@@ -17,6 +17,7 @@
 #ifndef _UAPI_LINUX_ICMP_H
 #define _UAPI_LINUX_ICMP_H
 
+#include <linux/libc-compat.h>
 #include <linux/types.h>
 
 #define ICMP_ECHOREPLY		0	/* Echo Reply			*/
@@ -64,7 +65,7 @@
 #define ICMP_EXC_TTL		0	/* TTL count exceeded		*/
 #define ICMP_EXC_FRAGTIME	1	/* Fragment Reass time exceeded	*/
 
-
+#if __UAPI_DEF_ICMPHDR
 struct icmphdr {
   __u8		type;
   __u8		code;
@@ -82,6 +83,7 @@ struct icmphdr {
 	__u8	reserved[4];
   } un;
 };
+#endif /* __UAPI_DEF_ICMPHDR */
 
 
 /*
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index 40190a4..8a5a7cc 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -154,6 +154,13 @@
 
 #endif /* _NETINET_IN_H */
 
+/* Coordinate with glibc netinet/ip_icmp.h header. */
+#if defined(__NETINET_IP_ICMP_H)
+#define __UAPI_DEF_ICMPHDR		0
+#else /* defined(__NETINET_IP_ICMP_H) */
+#define __UAPI_DEF_ICMPHDR		1
+#endif /* defined(__NETINET_IP_ICMP_H) */
+
 /* Coordinate with glibc netipx/ipx.h header. */
 #if defined(__NETIPX_IPX_H)
 
@@ -218,6 +225,9 @@
 #define __UAPI_DEF_IN6_PKTINFO		1
 #define __UAPI_DEF_IP6_MTUINFO		1
 
+/* Definitions for icmp.h */
+#define __UAPI_DEF_ICMPHDR		1
+
 /* Definitions for ipx.h */
 #define __UAPI_DEF_SOCKADDR_IPX			1
 #define __UAPI_DEF_IPX_ROUTE_DEFINITION		1
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1468159 — Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes

FromDavid Miller <davem@davemloft.net>
Date2016-08-23 01:40 +0200
SubjectRe: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes
Message-ID<s96YW-4v1-25@gated-at.bofh.it>
In reply to#1467958
Must be CC:'d to netdev.

[toc] | [prev] | [next] | [standalone]


#1468977 — Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes

FromDavid Miller <davem@davemloft.net>
Date2016-08-24 01:50 +0200
SubjectRe: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes
Message-ID<s9tC9-2t9-1@gated-at.bofh.it>
In reply to#1467958
You'll need to respin these on top of the 'net' GIT tree, I've already
applied the other patches yesterday and I'm getting rejects for the
libc-compat.h changes.

[toc] | [prev] | [next] | [standalone]


#1467959 — [PATCH v05 55/72] include/uapi/xen/gntdev.h: include xen/privcmd.h and define grant_ref_t

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:00 +0200
Subject[PATCH v05 55/72] include/uapi/xen/gntdev.h: include xen/privcmd.h and define grant_ref_t
Message-ID<s92BY-1yy-37@gated-at.bofh.it>
In reply to#1467924
Both are needed to compile <xen/gntdev.h> wihtout compiler warnings
in userspace. Fixes these userspace compile errors:

xen/gntdev.h:151:4: error: unknown type name ‘grant_ref_t’
    grant_ref_t ref;
    ^
xen/gntdev.h:153:4: error: unknown type name ‘domid_t’
    domid_t domid;
    ^

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/xen/gntdev.h           | 6 ++++++
 include/xen/interface/grant_table.h | 6 +-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/uapi/xen/gntdev.h b/include/uapi/xen/gntdev.h
index d066197..f208706 100644
--- a/include/uapi/xen/gntdev.h
+++ b/include/uapi/xen/gntdev.h
@@ -34,6 +34,12 @@
 #define __LINUX_PUBLIC_GNTDEV_H__
 
 #include <linux/types.h>
+#include <xen/privcmd.h>
+
+/*
+ * Reference to a grant entry in a specified domain's grant table.
+ */
+typedef __u32 grant_ref_t;
 
 struct ioctl_gntdev_grant_ref {
 	/* The domain ID of the grant to be mapped. */
diff --git a/include/xen/interface/grant_table.h b/include/xen/interface/grant_table.h
index 56806bc..7e064d6 100644
--- a/include/xen/interface/grant_table.h
+++ b/include/xen/interface/grant_table.h
@@ -29,6 +29,7 @@
 #define __XEN_PUBLIC_GRANT_TABLE_H__
 
 #include <xen/interface/xen.h>
+#include <uapi/xen/gntdev.h> /* for grant_ref_t */
 
 /***********************************
  * GRANT TABLE REPRESENTATION
@@ -85,11 +86,6 @@
  */
 
 /*
- * Reference to a grant entry in a specified domain's grant table.
- */
-typedef uint32_t grant_ref_t;
-
-/*
  * A grant table comprises a packed array of grant entries in one or more
  * page frames shared between Xen and a guest.
  * [XEN]: This field is written by Xen and read by the sharing guest.
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467961 — [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:10 +0200
Subject[PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h
Message-ID<s92LD-1R8-7@gated-at.bofh.it>
In reply to#1467924
Fixes userspace compilation error:

error: ‘IFNAMSIZ’ undeclared here (not in a function)

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/if_pppox.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
index e128769..473c3c4 100644
--- a/include/uapi/linux/if_pppox.h
+++ b/include/uapi/linux/if_pppox.h
@@ -21,6 +21,7 @@
 #include <asm/byteorder.h>
 
 #include <linux/socket.h>
+#include <linux/if.h>
 #include <linux/if_ether.h>
 #include <linux/if_pppol2tp.h>
 
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467998 — Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h

FromStephen Hemminger <stephen@networkplumber.org>
Date2016-08-22 21:40 +0200
SubjectRe: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h
Message-ID<s93eG-26x-31@gated-at.bofh.it>
In reply to#1467961
On Mon, 22 Aug 2016 20:32:38 +0200
Mikko Rapeli <mikko.rapeli@iki.fi> wrote:

> Fixes userspace compilation error:
> 
> error: ‘IFNAMSIZ’ undeclared here (not in a function)
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> ---
>  include/uapi/linux/if_pppox.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
> index e128769..473c3c4 100644
> --- a/include/uapi/linux/if_pppox.h
> +++ b/include/uapi/linux/if_pppox.h
> @@ -21,6 +21,7 @@
>  #include <asm/byteorder.h>
>  
>  #include <linux/socket.h>
> +#include <linux/if.h>
>  #include <linux/if_ether.h>
>  #include <linux/if_pppol2tp.h>
>  

I went back to the first patch in LKML for this series.
It seems your goal is that every include file should be standalone,
i.e it must include every definition it uses.

I disagree with this premise. It just makes things harder to maintain with
no real gain for any existing program.  What is the motivation for all this
useless churn? Is there some silly style rule that should be fixed instead?

[toc] | [prev] | [next] | [standalone]


#1468150 — Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h

FromDavid Miller <davem@davemloft.net>
Date2016-08-23 01:30 +0200
SubjectRe: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h
Message-ID<s96Pg-4qY-9@gated-at.bofh.it>
In reply to#1467998
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 22 Aug 2016 12:37:45 -0700

> It seems your goal is that every include file should be standalone,
> i.e it must include every definition it uses.

I think this is absolutely mandatory Stephen.  If you include x.h
it should just work if you use the interfaces x.h defines.

No user should have to know about dependencies, that is exactly the
job of the header file itself.

[toc] | [prev] | [next] | [standalone]


#1468325 — Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-23 08:50 +0200
SubjectRe: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h
Message-ID<s9dH3-iA-15@gated-at.bofh.it>
In reply to#1467998
On Mon, Aug 22, 2016 at 12:37:45PM -0700, Stephen Hemminger wrote:
> On Mon, 22 Aug 2016 20:32:38 +0200
> Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
> 
> > Fixes userspace compilation error:
> > 
> > error: ‘IFNAMSIZ’ undeclared here (not in a function)
> > 
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> > ---
> >  include/uapi/linux/if_pppox.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
> > index e128769..473c3c4 100644
> > --- a/include/uapi/linux/if_pppox.h
> > +++ b/include/uapi/linux/if_pppox.h
> > @@ -21,6 +21,7 @@
> >  #include <asm/byteorder.h>
> >  
> >  #include <linux/socket.h>
> > +#include <linux/if.h>
> >  #include <linux/if_ether.h>
> >  #include <linux/if_pppol2tp.h>
> >  
> 
> I went back to the first patch in LKML for this series.
> It seems your goal is that every include file should be standalone,
> i.e it must include every definition it uses.
> 
> I disagree with this premise. It just makes things harder to maintain with
> no real gain for any existing program.  What is the motivation for all this
> useless churn? Is there some silly style rule that should be fixed instead?

With over 700 uapi headers exported to userspace by Linux kernel, how
do I find out the 'correct' order of including them if they can not be
included alone? Any hints on automating that?

My first trial was to include all of the uapi headers as a single bunch to
abi checker tool which calls gcc on them, but the compilation result was
so bad and hopeless that I decided to try feeding each header file one by
one to the compiler and here I am over two years later still fixing these
issues.

I came up with the rule because to me it makes sense. Several kernel
devs agree with this approach and have accepted patches.

If your kernel subsystem uapi headers have a single entry point header file,
then all of the others can just depend on that and be done with it.
For example most (if not all) drm driver specific headers include <drm/drm.h>.

-Mikko

[toc] | [prev] | [next] | [standalone]


#1468153 — Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h

FromDavid Miller <davem@davemloft.net>
Date2016-08-23 01:40 +0200
SubjectRe: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h
Message-ID<s96YV-4v1-1@gated-at.bofh.it>
In reply to#1467961
From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:32:38 +0200

> Fixes userspace compilation error:
> 
> error: ‘IFNAMSIZ’ undeclared here (not in a function)
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.

[toc] | [prev] | [next] | [standalone]


#1467962 — [PATCH v05 57/72] coda_psdev.h: move upc_req definition from uapi to kernel side headers

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:10 +0200
Subject[PATCH v05 57/72] coda_psdev.h: move upc_req definition from uapi to kernel side headers
Message-ID<s92LD-1R8-5@gated-at.bofh.it>
In reply to#1467924
Only users of upc_req in kernel side fs/coda/psdev.c and fs/coda/upcall.c
already include linux/coda_psdev.h.

Suggested by Jan Harkes <jaharkes@cs.cmu.edu> on lkml message
<20150531111913.GA23377@cs.cmu.edu>.

Fixes these include/uapi/linux/coda_psdev.h compilation errors in userspace:

./linux/coda_psdev.h:12:19: error: field ‘uc_chain’ has incomplete type
  struct list_head    uc_chain;
                   ^
./linux/coda_psdev.h:13:2: error: unknown type name ‘caddr_t’
  caddr_t             uc_data;
  ^
./linux/coda_psdev.h:14:2: error: unknown type name ‘u_short’
  u_short             uc_flags;
  ^
./linux/coda_psdev.h:15:2: error: unknown type name ‘u_short’
  u_short             uc_inSize;  /* Size is at most 5000 bytes */
  ^
./linux/coda_psdev.h:16:2: error: unknown type name ‘u_short’
  u_short             uc_outSize;
  ^
./linux/coda_psdev.h:17:2: error: unknown type name ‘u_short’
  u_short             uc_opcode;  /* copied from data to save lookup */
  ^
./linux/coda_psdev.h:19:2: error: unknown type name ‘wait_queue_head_t’
  wait_queue_head_t   uc_sleep;   /* process' wait queue */
  ^

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/linux/coda_psdev.h      | 11 +++++++++++
 include/uapi/linux/coda_psdev.h | 13 -------------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index 5b8721e..fe1466d 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -19,6 +19,17 @@ struct venus_comm {
 	struct mutex	    vc_mutex;
 };
 
+/* messages between coda filesystem in kernel and Venus */
+struct upc_req {
+	struct list_head	uc_chain;
+	caddr_t			uc_data;
+	u_short			uc_flags;
+	u_short			uc_inSize;  /* Size is at most 5000 bytes */
+	u_short			uc_outSize;
+	u_short			uc_opcode;  /* copied from data to save lookup */
+	int			uc_unique;
+	wait_queue_head_t	uc_sleep;   /* process' wait queue */
+};
 
 static inline struct venus_comm *coda_vcp(struct super_block *sb)
 {
diff --git a/include/uapi/linux/coda_psdev.h b/include/uapi/linux/coda_psdev.h
index 79d0598..e2c44d2 100644
--- a/include/uapi/linux/coda_psdev.h
+++ b/include/uapi/linux/coda_psdev.h
@@ -6,19 +6,6 @@
 #define CODA_PSDEV_MAJOR 67
 #define MAX_CODADEVS  5	   /* how many do we allow */
 
-
-/* messages between coda filesystem in kernel and Venus */
-struct upc_req {
-	struct list_head    uc_chain;
-	caddr_t	            uc_data;
-	u_short	            uc_flags;
-	u_short             uc_inSize;  /* Size is at most 5000 bytes */
-	u_short	            uc_outSize;
-	u_short	            uc_opcode;  /* copied from data to save lookup */
-	int		    uc_unique;
-	wait_queue_head_t   uc_sleep;   /* process' wait queue */
-};
-
 #define CODA_REQ_ASYNC  0x1
 #define CODA_REQ_READ   0x2
 #define CODA_REQ_WRITE  0x4
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467963 — [PATCH v05 65/72] uapi fcntl.h: glibc fcntl.h header file compatibility fixes

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:10 +0200
Subject[PATCH v05 65/72] uapi fcntl.h: glibc fcntl.h header file compatibility fixes
Message-ID<s92LD-1R8-17@gated-at.bofh.it>
In reply to#1467924
Fixes these userspace compile warnings and error when glibc fcntl.h is
included before linux/fcntl.h:

asm-generic/fcntl.h:18:0: warning: "O_ACCMODE" redefined
asm-generic/fcntl.h:19:0: warning: "O_RDONLY" redefined
asm-generic/fcntl.h:20:0: warning: "O_WRONLY" redefined
asm-generic/fcntl.h:21:0: warning: "O_RDWR" redefined
asm-generic/fcntl.h:195:8: error: redefinition of ‘struct flock’
linux/fcntl.h:16:0: warning: "F_DUPFD_CLOEXEC" redefined

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/asm-generic/fcntl.h |  6 ++++++
 include/uapi/linux/fcntl.h       |  3 +++
 include/uapi/linux/libc-compat.h | 20 ++++++++++++++++++++
 3 files changed, 29 insertions(+)

diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h
index e063eff..3b429ce 100644
--- a/include/uapi/asm-generic/fcntl.h
+++ b/include/uapi/asm-generic/fcntl.h
@@ -1,6 +1,7 @@
 #ifndef _ASM_GENERIC_FCNTL_H
 #define _ASM_GENERIC_FCNTL_H
 
+#include <linux/libc-compat.h>
 #include <linux/types.h>
 
 /*
@@ -15,10 +16,13 @@
  * When introducing new O_* bits, please check its uniqueness in fcntl_init().
  */
 
+#if __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR
 #define O_ACCMODE	00000003
 #define O_RDONLY	00000000
 #define O_WRONLY	00000001
 #define O_RDWR		00000002
+#endif /* __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR */
+
 #ifndef O_CREAT
 #define O_CREAT		00000100	/* not fcntl */
 #endif
@@ -192,6 +196,7 @@ struct f_owner_ex {
 #define __ARCH_FLOCK_PAD
 #endif
 
+#if __UAPI_DEF_FLOCK
 struct flock {
 	short	l_type;
 	short	l_whence;
@@ -200,6 +205,7 @@ struct flock {
 	__kernel_pid_t	l_pid;
 	__ARCH_FLOCK_PAD
 };
+#endif /* __UAPI_DEF_FLOCK */
 #endif
 
 #ifndef HAVE_ARCH_STRUCT_FLOCK64
diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h
index beed138..279bcfb 100644
--- a/include/uapi/linux/fcntl.h
+++ b/include/uapi/linux/fcntl.h
@@ -1,6 +1,7 @@
 #ifndef _UAPI_LINUX_FCNTL_H
 #define _UAPI_LINUX_FCNTL_H
 
+#include <linux/libc-compat.h>
 #include <asm/fcntl.h>
 
 #define F_SETLEASE	(F_LINUX_SPECIFIC_BASE + 0)
@@ -13,7 +14,9 @@
 #define F_CANCELLK	(F_LINUX_SPECIFIC_BASE + 5)
 
 /* Create a file descriptor with FD_CLOEXEC set. */
+#if __UAPI_DEF_F_DUPFD_CLOEXEC
 #define F_DUPFD_CLOEXEC	(F_LINUX_SPECIFIC_BASE + 6)
+#endif /* __UAPI_DEF_F_DUPFD_CLOEXEC */
 
 /*
  * Request nofications on a directory.
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index 44b8a6b..40190a4 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -51,6 +51,21 @@
 /* We have included glibc headers... */
 #if defined(__GLIBC__)
 
+/* Coordinate with glibc fcntl.h header. */
+#if defined(_FCNTL_H)
+
+#define __UAPI_DEF_FLOCK			0
+#define __UAPI_DEF_F_DUPFD_CLOEXEC		0
+#define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR	0
+
+#else /* defined(_FCNTL_H) */
+
+#define __UAPI_DEF_FLOCK			1
+#define __UAPI_DEF_F_DUPFD_CLOEXEC		1
+#define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR	1
+
+#endif /* defined(_FCNTL_H) */
+
 /* Coordinate with glibc net/if.h header. */
 #if defined(_NET_IF_H) && defined(__USE_MISC)
 
@@ -170,6 +185,11 @@
  * that we need. */
 #else /* !defined(__GLIBC__) */
 
+/* Definitions for asm-generic/fcntl.h */
+#define __UAPI_DEF_FLOCK			1
+#define __UAPI_DEF_F_DUPFD_CLOEXEC		1
+#define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR	1
+
 /* Definitions for if.h */
 #define __UAPI_DEF_IF_IFCONF 1
 #define __UAPI_DEF_IF_IFMAP 1
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467967 — [PATCH v05 23/72] include/uapi/linux/ipv6_route.h: include linux/in6.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:20 +0200
Subject[PATCH v05 23/72] include/uapi/linux/ipv6_route.h: include linux/in6.h
Message-ID<s92Vj-1VN-1@gated-at.bofh.it>
In reply to#1467924
Fixes userspace compile errors like:

error: field ‘mf6cc_origin’ has incomplete type
  struct sockaddr_in6 mf6cc_origin;  /* Origin of mcast */

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/mroute6.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/mroute6.h b/include/uapi/linux/mroute6.h
index 5062fb5..d05424f 100644
--- a/include/uapi/linux/mroute6.h
+++ b/include/uapi/linux/mroute6.h
@@ -4,6 +4,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/sockios.h>
+#include <linux/in6.h>
 
 /*
  *	Based on the MROUTING 3.5 defines primarily to keep
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1468148 — Re: [PATCH v05 23/72] include/uapi/linux/ipv6_route.h: include linux/in6.h

FromDavid Miller <davem@davemloft.net>
Date2016-08-23 01:30 +0200
SubjectRe: [PATCH v05 23/72] include/uapi/linux/ipv6_route.h: include linux/in6.h
Message-ID<s96Pf-4qY-1@gated-at.bofh.it>
In reply to#1467967
From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:32:40 +0200

> Fixes userspace compile errors like:
> 
> error: field ‘mf6cc_origin’ has incomplete type
>   struct sockaddr_in6 mf6cc_origin;  /* Origin of mcast */
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.

[toc] | [prev] | [next] | [standalone]


#1467968 — [PATCH v05 19/72] include/uapi/linux/socket.h: include sys/socket.h in userspace

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:20 +0200
Subject[PATCH v05 19/72] include/uapi/linux/socket.h: include sys/socket.h in userspace
Message-ID<s92Vj-1VN-3@gated-at.bofh.it>
In reply to#1467924
This libc header has sockaddr definition for userspace.

Fixes userspace compilation errors like these from kernel headers including
only linux/socket.h:

error: field ‘ifru_addr’ has incomplete type
struct sockaddr ifru_addr;

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/socket.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h
index 76ab0c6..8a81197 100644
--- a/include/uapi/linux/socket.h
+++ b/include/uapi/linux/socket.h
@@ -1,6 +1,10 @@
 #ifndef _UAPI_LINUX_SOCKET_H
 #define _UAPI_LINUX_SOCKET_H
 
+#ifndef __KERNEL__
+#include <sys/socket.h>
+#endif
+
 /*
  * Desired design of maximum size and alignment (see RFC2553)
  */
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467971 — [PATCH v05 60/72] arch/arm/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:20 +0200
Subject[PATCH v05 60/72] arch/arm/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t
Message-ID<s92Vk-1VN-31@gated-at.bofh.it>
In reply to#1467924
Fixes uapi header compilation error from userspace on ARCH=arm:

asm/signal.h:112:2: error: unknown type name ‘size_t’
  size_t ss_size;

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 arch/arm/include/uapi/asm/signal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h
index 33073bd..859f2de 100644
--- a/arch/arm/include/uapi/asm/signal.h
+++ b/arch/arm/include/uapi/asm/signal.h
@@ -113,7 +113,7 @@ struct sigaction {
 typedef struct sigaltstack {
 	void __user *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1469516 — Re: [PATCH v05 60/72] arch/arm/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t

FromArnd Bergmann <arnd@arndb.de>
Date2016-08-24 17:10 +0200
SubjectRe: [PATCH v05 60/72] arch/arm/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t
Message-ID<s9HYu-3Yy-23@gated-at.bofh.it>
In reply to#1467971
On Monday, August 22, 2016 8:33:17 PM CEST Mikko Rapeli wrote:
> diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h
> index 33073bd..859f2de 100644
> --- a/arch/arm/include/uapi/asm/signal.h
> +++ b/arch/arm/include/uapi/asm/signal.h
> @@ -113,7 +113,7 @@ struct sigaction {
>  typedef struct sigaltstack {
>         void __user *ss_sp;
>         int ss_flags;
> -       size_t ss_size;
> +       __kernel_size_t ss_size;
>  } stack_t;

I was going to reply with an Ack, but on further consideration,
I'm not sure if we can't do this in general: size_t may be either
'unsigned int' or 'unsigned long' (depending on the architecture
and toolchain), and if kernel and glibc disagree on this, we
have a problem with any user space code that expects sigaltstack->ss_size
to be the same type as size_t (as mandated by the man page).

I wonder if there is another way to address this.

	Arnd

[toc] | [prev] | [next] | [standalone]


#1467973 — [PATCH v05 69/72] uapi rose.h: glibc netrose/rose.h header file compatibility fixes

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:20 +0200
Subject[PATCH v05 69/72] uapi rose.h: glibc netrose/rose.h header file compatibility fixes
Message-ID<s92Vk-1VN-21@gated-at.bofh.it>
In reply to#1467924
Fixes these userspace compile errors and warnings when glibc
netrose/rose.h is included before linux/rose.h:

linux/rose.h:25:0: warning: "SIOCRSGCAUSE" redefined
linux/rose.h:26:0: warning: "SIOCRSSCAUSE" redefined
linux/rose.h:27:0: warning: "SIOCRSL2CALL" redefined
linux/rose.h:28:0: warning: "SIOCRSSL2CALL" redefined
linux/rose.h:29:0: warning: "SIOCRSACCEPT" redefined
linux/rose.h:30:0: warning: "SIOCRSCLRRT" redefined
linux/rose.h:31:0: warning: "SIOCRSGL2CALL" redefined
linux/rose.h:32:0: warning: "SIOCRSGFACILITIES" redefined
linux/rose.h:47:3: error: conflicting types for ‘rose_address’
linux/rose.h:49:8: error: redefinition of ‘struct sockaddr_rose’
linux/rose.h:57:8: error: redefinition of ‘struct full_sockaddr_rose’
linux/rose.h:65:8: error: redefinition of ‘struct rose_route_struct’
linux/rose.h:74:8: error: redefinition of ‘struct rose_cause_struct’
linux/rose.h:79:8: error: redefinition of ‘struct rose_facilities_struct’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/libc-compat.h | 30 ++++++++++++++++++++++++++++++
 include/uapi/linux/rose.h        | 15 +++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index 01bb521..acc2e75 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -209,6 +209,27 @@
 
 #endif /* defined(__NETIPX_IPX_H) */
 
+/* Coordinate with glibc netrose/rose.h */
+#if defined(_NETROSE_ROSE_H)
+#define __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES	0
+#define __UAPI_DEF_ROSE_ADDRESS				0
+#define __UAPI_DEF_SOCKADDR_ROSE			0
+#define __UAPI_DEF_FULL_SOCKADDR_ROSE			0
+#define __UAPI_DEF_ROSE_ROUTE_STRUCT			0
+#define __UAPI_DEF_ROSE_CAUSE_STRUCT			0
+#define __UAPI_DEF_ROSE_FACILITIES_STRUCT		0
+
+#else /* defined(_NETROSE_ROSE_H) */
+#define __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES	1
+#define __UAPI_DEF_ROSE_ADDRESS				1
+#define __UAPI_DEF_SOCKADDR_ROSE			1
+#define __UAPI_DEF_FULL_SOCKADDR_ROSE			1
+#define __UAPI_DEF_ROSE_ROUTE_STRUCT			1
+#define __UAPI_DEF_ROSE_CAUSE_STRUCT			1
+#define __UAPI_DEF_ROSE_FACILITIES_STRUCT		1
+
+#endif /* defined(_NETROSE_ROSE_H) */
+
 /* Definitions for sys/uio.h */
 #if defined(_SYS_UIO_H)
 #define __UAPI_DEF_IOVEC		0
@@ -283,6 +304,15 @@
 #define __UAPI_DEF_IPX_CONFIG_DATA		1
 #define __UAPI_DEF_IPX_ROUTE_DEF		1
 
+/* Definitions for rose.h */
+#define __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES	1
+#define __UAPI_DEF_ROSE_ADDRESS				1
+#define __UAPI_DEF_SOCKADDR_ROSE			1
+#define __UAPI_DEF_FULL_SOCKADDR_ROSE			1
+#define __UAPI_DEF_ROSE_ROUTE_STRUCT			1
+#define __UAPI_DEF_ROSE_CAUSE_STRUCT			1
+#define __UAPI_DEF_ROSE_FACILITIES_STRUCT		1
+
 /* Definitions for uio.h */
 #define __UAPI_DEF_IOVEC		1
 
diff --git a/include/uapi/linux/rose.h b/include/uapi/linux/rose.h
index 1fcfe95..c39499c 100644
--- a/include/uapi/linux/rose.h
+++ b/include/uapi/linux/rose.h
@@ -7,6 +7,7 @@
 #ifndef	ROSE_KERNEL_H
 #define	ROSE_KERNEL_H
 
+#include <linux/libc-compat.h>
 #include <linux/socket.h>
 #include <linux/ax25.h>
 
@@ -22,6 +23,7 @@
 #define	ROSE_QBITINCL	6
 #define	ROSE_HOLDBACK	7
 
+#if __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES
 #define	SIOCRSGCAUSE		(SIOCPROTOPRIVATE+0)
 #define	SIOCRSSCAUSE		(SIOCPROTOPRIVATE+1)
 #define	SIOCRSL2CALL		(SIOCPROTOPRIVATE+2)
@@ -30,6 +32,7 @@
 #define	SIOCRSCLRRT		(SIOCPROTOPRIVATE+4)
 #define	SIOCRSGL2CALL		(SIOCPROTOPRIVATE+5)
 #define	SIOCRSGFACILITIES	(SIOCPROTOPRIVATE+6)
+#endif /* __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES */
 
 #define	ROSE_DTE_ORIGINATED	0x00
 #define	ROSE_NUMBER_BUSY	0x01
@@ -42,10 +45,13 @@
 #define	ROSE_LOCAL_PROCEDURE	0x13
 #define	ROSE_SHIP_ABSENT	0x39
 
+#if __UAPI_DEF_ROSE_ADDRESS
 typedef struct {
 	char		rose_addr[5];
 } rose_address;
+#endif /* __UAPI_DEF_ROSE_ADDRESS */
 
+#if __UAPI_DEF_SOCKADDR_ROSE
 struct sockaddr_rose {
 	__kernel_sa_family_t srose_family;
 	rose_address	srose_addr;
@@ -53,7 +59,9 @@ struct sockaddr_rose {
 	int		srose_ndigis;
 	ax25_address	srose_digi;
 };
+#endif /* __UAPI_DEF_SOCKADDR_ROSE */
 
+#if __UAPI_DEF_FULL_SOCKADDR_ROSE
 struct full_sockaddr_rose {
 	__kernel_sa_family_t srose_family;
 	rose_address	srose_addr;
@@ -61,7 +69,9 @@ struct full_sockaddr_rose {
 	unsigned int	srose_ndigis;
 	ax25_address	srose_digis[ROSE_MAX_DIGIS];
 };
+#endif /* __UAPI_DEF_FULL_SOCKADDR_ROSE */
 
+#if __UAPI_DEF_ROSE_ROUTE_STRUCT
 struct rose_route_struct {
 	rose_address	address;
 	unsigned short	mask;
@@ -70,12 +80,16 @@ struct rose_route_struct {
 	unsigned char	ndigis;
 	ax25_address	digipeaters[AX25_MAX_DIGIS];
 };
+#endif /* __UAPI_DEF_ROSE_ROUTE_STRUCT */
 
+#if __UAPI_DEF_ROSE_CAUSE_STRUCT
 struct rose_cause_struct {
 	unsigned char	cause;
 	unsigned char	diagnostic;
 };
+#endif /* __UAPI_DEF_ROSE_CAUSE_STRUCT */
 
+#if __UAPI_DEF_ROSE_FACILITIES_STRUCT
 struct rose_facilities_struct {
 	rose_address	source_addr,   dest_addr;
 	ax25_address	source_call,   dest_call;
@@ -86,5 +100,6 @@ struct rose_facilities_struct {
 	rose_address	fail_addr;
 	ax25_address	fail_call;
 };
+#endif /* __UAPI_DEF_ROSE_FACILITIES_STRUCT */
 
 #endif
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467975 — [PATCH v05 52/72] include/linux/sdb.h: use linux/types.h types instead of stdint.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:20 +0200
Subject[PATCH v05 52/72] include/linux/sdb.h: use linux/types.h types instead of stdint.h
Message-ID<s92Vk-1VN-23@gated-at.bofh.it>
In reply to#1467924
Kernel headers should use linux/types.h types.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/linux/sdb.h | 62 +++++++++++++++++++++++++----------------------------
 1 file changed, 29 insertions(+), 33 deletions(-)

diff --git a/include/linux/sdb.h b/include/linux/sdb.h
index fbb76a4..e9ff976 100644
--- a/include/linux/sdb.h
+++ b/include/linux/sdb.h
@@ -3,11 +3,7 @@
  */
 #ifndef __SDB_H__
 #define __SDB_H__
-#ifdef __KERNEL__
 #include <linux/types.h>
-#else
-#include <stdint.h>
-#endif
 
 /*
  * All structures are 64 bytes long and are expected
@@ -25,12 +21,12 @@
  * and not terminated with a 0 byte.
  */
 struct sdb_product {
-	uint64_t		vendor_id;	/* 0x18..0x1f */
-	uint32_t		device_id;	/* 0x20..0x23 */
-	uint32_t		version;	/* 0x24..0x27 */
-	uint32_t		date;		/* 0x28..0x2b */
-	uint8_t			name[19];	/* 0x2c..0x3e */
-	uint8_t			record_type;	/* 0x3f */
+	__u64		vendor_id;	/* 0x18..0x1f */
+	__u32		device_id;	/* 0x20..0x23 */
+	__u32		version;	/* 0x24..0x27 */
+	__u32		date;		/* 0x28..0x2b */
+	__u8			name[19];	/* 0x2c..0x3e */
+	__u8			record_type;	/* 0x3f */
 };
 
 /*
@@ -40,8 +36,8 @@ struct sdb_product {
  * (for example 0x100000 - 0x10ffff)
  */
 struct sdb_component {
-	uint64_t		addr_first;	/* 0x08..0x0f */
-	uint64_t		addr_last;	/* 0x10..0x17 */
+	__u64		addr_first;	/* 0x08..0x0f */
+	__u64		addr_last;	/* 0x10..0x17 */
 	struct sdb_product	product;	/* 0x18..0x3f */
 };
 
@@ -63,10 +59,10 @@ enum sdb_record_type {
  */
 #define				SDB_MAGIC	0x5344422d /* "SDB-" */
 struct sdb_interconnect {
-	uint32_t		sdb_magic;	/* 0x00-0x03 */
-	uint16_t		sdb_records;	/* 0x04-0x05 */
-	uint8_t			sdb_version;	/* 0x06 */
-	uint8_t			sdb_bus_type;	/* 0x07 */
+	__u32		sdb_magic;	/* 0x00-0x03 */
+	__u16		sdb_records;	/* 0x04-0x05 */
+	__u8			sdb_version;	/* 0x06 */
+	__u8			sdb_bus_type;	/* 0x07 */
 	struct sdb_component	sdb_component;	/* 0x08-0x3f */
 };
 
@@ -77,10 +73,10 @@ struct sdb_interconnect {
  * bus-specific bits are defined by each bus (see below)
  */
 struct sdb_device {
-	uint16_t		abi_class;	/* 0x00-0x01 */
-	uint8_t			abi_ver_major;	/* 0x02 */
-	uint8_t			abi_ver_minor;	/* 0x03 */
-	uint32_t		bus_specific;	/* 0x04-0x07 */
+	__u16		abi_class;	/* 0x00-0x01 */
+	__u8			abi_ver_major;	/* 0x02 */
+	__u8			abi_ver_minor;	/* 0x03 */
+	__u32		bus_specific;	/* 0x04-0x07 */
 	struct sdb_component	sdb_component;	/* 0x08-0x3f */
 };
 
@@ -89,7 +85,7 @@ struct sdb_device {
  * child is the address of the nested SDB table
  */
 struct sdb_bridge {
-	uint64_t		sdb_child;	/* 0x00-0x07 */
+	__u64		sdb_child;	/* 0x00-0x07 */
 	struct sdb_component	sdb_component;	/* 0x08-0x3f */
 };
 
@@ -100,7 +96,7 @@ struct sdb_bridge {
  * just provide product information for an aggregate device
  */
 struct sdb_integration {
-	uint8_t			reserved[24];	/* 0x00-0x17 */
+	__u8			reserved[24];	/* 0x00-0x17 */
 	struct sdb_product	product;	/* 0x08-0x3f */
 };
 
@@ -109,8 +105,8 @@ struct sdb_integration {
  * again, an informative field that software can ignore
  */
 struct sdb_repo_url {
-	uint8_t			repo_url[63];	/* 0x00-0x3e */
-	uint8_t			record_type;	/* 0x3f */
+	__u8			repo_url[63];	/* 0x00-0x3e */
+	__u8			record_type;	/* 0x3f */
 };
 
 /* Type 0x82: Synthesis tool information
@@ -118,13 +114,13 @@ struct sdb_repo_url {
  * this informative record
  */
 struct sdb_synthesis {
-	uint8_t			syn_name[16];	/* 0x00-0x0f */
-	uint8_t			commit_id[16];	/* 0x10-0x1f */
-	uint8_t			tool_name[8];	/* 0x20-0x27 */
-	uint32_t		tool_version;	/* 0x28-0x2b */
-	uint32_t		date;		/* 0x2c-0x2f */
-	uint8_t			user_name[15];	/* 0x30-0x3e */
-	uint8_t			record_type;	/* 0x3f */
+	__u8			syn_name[16];	/* 0x00-0x0f */
+	__u8			commit_id[16];	/* 0x10-0x1f */
+	__u8			tool_name[8];	/* 0x20-0x27 */
+	__u32		tool_version;	/* 0x28-0x2b */
+	__u32		date;		/* 0x2c-0x2f */
+	__u8			user_name[15];	/* 0x30-0x3e */
+	__u8			record_type;	/* 0x3f */
 };
 
 /* Type 0xff: empty
@@ -135,8 +131,8 @@ struct sdb_synthesis {
  * It can also be used to pad a table to a desired length.
  */
 struct sdb_empty {
-	uint8_t			reserved[63];	/* 0x00-0x3e */
-	uint8_t			record_type;	/* 0x3f */
+	__u8			reserved[63];	/* 0x00-0x3e */
+	__u8			record_type;	/* 0x3f */
 };
 
 /* The type of bus, for bus-specific flags */
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


Page 3 of 5 — ← Prev page 1 2 [3] 4 5  Next page →

Back to top | Article view | linux.kernel


csiph-web