2022-02-10 02:17:02

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 0/6] Add more export headers to compile-test coverage




Masahiro Yamada (6):
signal.h: add linux/signal.h and asm/signal.h to UAPI compile-test
coverage
shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage
android/binder.h: add linux/android/binder(fs).h to UAPI compile-test
coverage
fsmap.h: add linux/fsmap.h to UAPI compile-test coverage
kexec.h: add linux/kexec.h to UAPI compile-test coverage
reiserfs_xattr.h: add linux/reiserfs_xattr.h to UAPI compile-test
coverage

arch/alpha/include/uapi/asm/signal.h | 2 +-
arch/arm/include/uapi/asm/signal.h | 2 +-
arch/h8300/include/uapi/asm/signal.h | 2 +-
arch/ia64/include/uapi/asm/signal.h | 2 +-
arch/m68k/include/uapi/asm/signal.h | 2 +-
arch/mips/include/uapi/asm/shmbuf.h | 7 +++++--
arch/mips/include/uapi/asm/signal.h | 2 +-
arch/parisc/include/uapi/asm/shmbuf.h | 2 ++
arch/parisc/include/uapi/asm/signal.h | 2 +-
arch/powerpc/include/uapi/asm/shmbuf.h | 5 ++++-
arch/powerpc/include/uapi/asm/signal.h | 2 +-
arch/s390/include/uapi/asm/signal.h | 2 +-
arch/sparc/include/uapi/asm/shmbuf.h | 5 ++++-
arch/sparc/include/uapi/asm/signal.h | 3 ++-
arch/x86/include/uapi/asm/shmbuf.h | 6 +++++-
arch/x86/include/uapi/asm/signal.h | 2 +-
arch/xtensa/include/uapi/asm/shmbuf.h | 5 ++++-
arch/xtensa/include/uapi/asm/signal.h | 2 +-
include/uapi/asm-generic/shmbuf.h | 4 +++-
include/uapi/asm-generic/signal.h | 2 +-
include/uapi/linux/android/binder.h | 4 ++--
include/uapi/linux/fsmap.h | 2 +-
include/uapi/linux/kexec.h | 4 ++--
include/uapi/linux/reiserfs_xattr.h | 2 +-
usr/include/Makefile | 8 --------
25 files changed, 47 insertions(+), 34 deletions(-)

--
2.32.0



2022-02-10 02:19:22

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 6/6] reiserfs_xattr.h: add linux/reiserfs_xattr.h to UAPI compile-test coverage

linux/reiserfs_xattr.h is currently excluded from the UAPI compile-test
because of the error like follows:

HDRTEST usr/include/linux/reiserfs_xattr.h
In file included from <command-line>:
./usr/include/linux/reiserfs_xattr.h:22:9: error: unknown type name ‘size_t’
22 | size_t length;
| ^~~~~~

The error can be fixed by replacing size_t with __kernel_size_t.

Then, remove the no-header-test entry from user/include/Makefile.

Signed-off-by: Masahiro Yamada <[email protected]>
---

include/uapi/linux/reiserfs_xattr.h | 2 +-
usr/include/Makefile | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/uapi/linux/reiserfs_xattr.h b/include/uapi/linux/reiserfs_xattr.h
index 28f10842f047..503ad018ce5b 100644
--- a/include/uapi/linux/reiserfs_xattr.h
+++ b/include/uapi/linux/reiserfs_xattr.h
@@ -19,7 +19,7 @@ struct reiserfs_xattr_header {
struct reiserfs_security_handle {
const char *name;
void *value;
- size_t length;
+ __kernel_size_t length;
};

#endif /* _LINUX_REISERFS_XATTR_H */
diff --git a/usr/include/Makefile b/usr/include/Makefile
index 48bb789099d5..5e703af0f83c 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -36,7 +36,6 @@ no-header-test += linux/omap3isp.h
no-header-test += linux/omapfb.h
no-header-test += linux/patchkey.h
no-header-test += linux/phonet.h
-no-header-test += linux/reiserfs_xattr.h
no-header-test += linux/sctp.h
no-header-test += linux/sysctl.h
no-header-test += linux/usb/audio.h
--
2.32.0


2022-02-10 02:19:56

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 3/6] android/binder.h: add linux/android/binder(fs).h to UAPI compile-test coverage

linux/android/binder.h and linux/android/binderfs.h are currently
excluded from the UAPI compile-test because of the errors like follows:

HDRTEST usr/include/linux/android/binder.h
In file included from <command-line>:
./usr/include/linux/android/binder.h:291:9: error: unknown type name ‘pid_t’
291 | pid_t sender_pid;
| ^~~~~
./usr/include/linux/android/binder.h:292:9: error: unknown type name ‘uid_t’
292 | uid_t sender_euid;
| ^~~~~

The errors can be fixed by replacing {pid,uid}_t with __kernel_{pid,uid}_t.

Then, remove the no-header-test entries from user/include/Makefile.

Signed-off-by: Masahiro Yamada <[email protected]>
---

include/uapi/linux/android/binder.h | 4 ++--
usr/include/Makefile | 2 --
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/android/binder.h b/include/uapi/linux/android/binder.h
index 3246f2c74696..11157fae8a8e 100644
--- a/include/uapi/linux/android/binder.h
+++ b/include/uapi/linux/android/binder.h
@@ -288,8 +288,8 @@ struct binder_transaction_data {

/* General information about the transaction. */
__u32 flags;
- pid_t sender_pid;
- uid_t sender_euid;
+ __kernel_pid_t sender_pid;
+ __kernel_uid_t sender_euid;
binder_size_t data_size; /* number of bytes of data */
binder_size_t offsets_size; /* number of bytes of offsets */

diff --git a/usr/include/Makefile b/usr/include/Makefile
index b0b6cc455930..717c7d4c89bb 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -26,8 +26,6 @@ override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I$(objtree)/usr/include
no-header-test += asm/ucontext.h
no-header-test += drm/vmwgfx_drm.h
no-header-test += linux/am437x-vpfe.h
-no-header-test += linux/android/binder.h
-no-header-test += linux/android/binderfs.h
no-header-test += linux/coda.h
no-header-test += linux/cyclades.h
no-header-test += linux/errqueue.h
--
2.32.0


2022-02-10 02:25:18

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 1/6] signal.h: add linux/signal.h and asm/signal.h to UAPI compile-test coverage

linux/signal.h and asm/signal.h are currently excluded from the UAPI
compile-test because of the errors like follows:

HDRTEST usr/include/asm/signal.h
In file included from <command-line>:
./usr/include/asm/signal.h:103:9: error: unknown type name ‘size_t’
103 | size_t ss_size;
| ^~~~~~

The errors can be fixed by replacing size_t with __kernel_size_t.

Then, remove the no-header-test entries from user/include/Makefile.

Signed-off-by: Masahiro Yamada <[email protected]>
---

arch/alpha/include/uapi/asm/signal.h | 2 +-
arch/arm/include/uapi/asm/signal.h | 2 +-
arch/h8300/include/uapi/asm/signal.h | 2 +-
arch/ia64/include/uapi/asm/signal.h | 2 +-
arch/m68k/include/uapi/asm/signal.h | 2 +-
arch/mips/include/uapi/asm/signal.h | 2 +-
arch/parisc/include/uapi/asm/signal.h | 2 +-
arch/powerpc/include/uapi/asm/signal.h | 2 +-
arch/s390/include/uapi/asm/signal.h | 2 +-
arch/sparc/include/uapi/asm/signal.h | 3 ++-
arch/x86/include/uapi/asm/signal.h | 2 +-
arch/xtensa/include/uapi/asm/signal.h | 2 +-
include/uapi/asm-generic/signal.h | 2 +-
usr/include/Makefile | 2 --
14 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/arch/alpha/include/uapi/asm/signal.h b/arch/alpha/include/uapi/asm/signal.h
index a69dd8d080a8..1413075f7616 100644
--- a/arch/alpha/include/uapi/asm/signal.h
+++ b/arch/alpha/include/uapi/asm/signal.h
@@ -100,7 +100,7 @@ struct sigaction {
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;

/* sigstack(2) is deprecated, and will be withdrawn in a future version
diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h
index c9a3ea1d8d41..9e2178420db2 100644
--- a/arch/arm/include/uapi/asm/signal.h
+++ b/arch/arm/include/uapi/asm/signal.h
@@ -93,7 +93,7 @@ struct sigaction {
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;


diff --git a/arch/h8300/include/uapi/asm/signal.h b/arch/h8300/include/uapi/asm/signal.h
index 2cd0dce2b6a6..1165481f80f6 100644
--- a/arch/h8300/include/uapi/asm/signal.h
+++ b/arch/h8300/include/uapi/asm/signal.h
@@ -85,7 +85,7 @@ struct sigaction {
typedef struct sigaltstack {
void *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;


diff --git a/arch/ia64/include/uapi/asm/signal.h b/arch/ia64/include/uapi/asm/signal.h
index 38166a88e4c9..63d574e802a2 100644
--- a/arch/ia64/include/uapi/asm/signal.h
+++ b/arch/ia64/include/uapi/asm/signal.h
@@ -90,7 +90,7 @@ struct siginfo;
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;


diff --git a/arch/m68k/include/uapi/asm/signal.h b/arch/m68k/include/uapi/asm/signal.h
index 4619291df601..80f520b9b10b 100644
--- a/arch/m68k/include/uapi/asm/signal.h
+++ b/arch/m68k/include/uapi/asm/signal.h
@@ -83,7 +83,7 @@ struct sigaction {
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;

#endif /* _UAPI_M68K_SIGNAL_H */
diff --git a/arch/mips/include/uapi/asm/signal.h b/arch/mips/include/uapi/asm/signal.h
index e6c78a15cb2f..94a00f82e373 100644
--- a/arch/mips/include/uapi/asm/signal.h
+++ b/arch/mips/include/uapi/asm/signal.h
@@ -100,7 +100,7 @@ struct sigaction {
/* IRIX compatible stack_t */
typedef struct sigaltstack {
void __user *ss_sp;
- size_t ss_size;
+ __kernel_size_t ss_size;
int ss_flags;
} stack_t;

diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h
index e5a2657477ac..8e4895c5ea5d 100644
--- a/arch/parisc/include/uapi/asm/signal.h
+++ b/arch/parisc/include/uapi/asm/signal.h
@@ -67,7 +67,7 @@ struct siginfo;
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;

#endif /* !__ASSEMBLY */
diff --git a/arch/powerpc/include/uapi/asm/signal.h b/arch/powerpc/include/uapi/asm/signal.h
index 04873dd311c2..37d41d87c45b 100644
--- a/arch/powerpc/include/uapi/asm/signal.h
+++ b/arch/powerpc/include/uapi/asm/signal.h
@@ -86,7 +86,7 @@ struct sigaction {
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;


diff --git a/arch/s390/include/uapi/asm/signal.h b/arch/s390/include/uapi/asm/signal.h
index 0189f326aac5..e74d6ba1bd3b 100644
--- a/arch/s390/include/uapi/asm/signal.h
+++ b/arch/s390/include/uapi/asm/signal.h
@@ -108,7 +108,7 @@ struct sigaction {
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;


diff --git a/arch/sparc/include/uapi/asm/signal.h b/arch/sparc/include/uapi/asm/signal.h
index 53758d53ac0e..d395af9b46d2 100644
--- a/arch/sparc/include/uapi/asm/signal.h
+++ b/arch/sparc/include/uapi/asm/signal.h
@@ -2,6 +2,7 @@
#ifndef _UAPI__SPARC_SIGNAL_H
#define _UAPI__SPARC_SIGNAL_H

+#include <asm/posix_types.h>
#include <asm/sigcontext.h>
#include <linux/compiler.h>

@@ -171,7 +172,7 @@ struct __old_sigaction {
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;


diff --git a/arch/x86/include/uapi/asm/signal.h b/arch/x86/include/uapi/asm/signal.h
index 164a22a72984..777c3a0f4e23 100644
--- a/arch/x86/include/uapi/asm/signal.h
+++ b/arch/x86/include/uapi/asm/signal.h
@@ -104,7 +104,7 @@ struct sigaction {
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;

#endif /* __ASSEMBLY__ */
diff --git a/arch/xtensa/include/uapi/asm/signal.h b/arch/xtensa/include/uapi/asm/signal.h
index 79ddabaa4e5d..b8c824dd4b74 100644
--- a/arch/xtensa/include/uapi/asm/signal.h
+++ b/arch/xtensa/include/uapi/asm/signal.h
@@ -103,7 +103,7 @@ struct sigaction {
typedef struct sigaltstack {
void *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;

#endif /* __ASSEMBLY__ */
diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h
index f634822906e4..0eb69dc8e572 100644
--- a/include/uapi/asm-generic/signal.h
+++ b/include/uapi/asm-generic/signal.h
@@ -85,7 +85,7 @@ struct sigaction {
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;

#endif /* __ASSEMBLY__ */
diff --git a/usr/include/Makefile b/usr/include/Makefile
index 8dbd1d8a245f..e7230a5a402a 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -24,7 +24,6 @@ override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I$(objtree)/usr/include
#
# Sorted alphabetically.
no-header-test += asm/shmbuf.h
-no-header-test += asm/signal.h
no-header-test += asm/ucontext.h
no-header-test += drm/vmwgfx_drm.h
no-header-test += linux/am437x-vpfe.h
@@ -44,7 +43,6 @@ no-header-test += linux/patchkey.h
no-header-test += linux/phonet.h
no-header-test += linux/reiserfs_xattr.h
no-header-test += linux/sctp.h
-no-header-test += linux/signal.h
no-header-test += linux/sysctl.h
no-header-test += linux/usb/audio.h
no-header-test += linux/v4l2-mediabus.h
--
2.32.0


2022-02-10 02:38:01

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 4/6] fsmap.h: add linux/fsmap.h to UAPI compile-test coverage

linux/fsmap.h is currently excluded from the UAPI compile-test because
of the error like follows:

HDRTEST usr/include/linux/fsmap.h
In file included from <command-line>:
./usr/include/linux/fsmap.h:72:19: error: unknown type name ‘size_t’
72 | static __inline__ size_t
| ^~~~~~

The error can be fixed by replacing size_t with __kernel_size_t.

Then, remove the no-header-test entry from user/include/Makefile.

Signed-off-by: Masahiro Yamada <[email protected]>
---

include/uapi/linux/fsmap.h | 2 +-
usr/include/Makefile | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/uapi/linux/fsmap.h b/include/uapi/linux/fsmap.h
index 91fd519a3f7d..c690d17f1d07 100644
--- a/include/uapi/linux/fsmap.h
+++ b/include/uapi/linux/fsmap.h
@@ -69,7 +69,7 @@ struct fsmap_head {
};

/* Size of an fsmap_head with room for nr records. */
-static inline size_t
+static inline __kernel_size_t
fsmap_sizeof(
unsigned int nr)
{
diff --git a/usr/include/Makefile b/usr/include/Makefile
index 717c7d4c89bb..9e35d022fd88 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -29,7 +29,6 @@ no-header-test += linux/am437x-vpfe.h
no-header-test += linux/coda.h
no-header-test += linux/cyclades.h
no-header-test += linux/errqueue.h
-no-header-test += linux/fsmap.h
no-header-test += linux/hdlc/ioctl.h
no-header-test += linux/ivtv.h
no-header-test += linux/kexec.h
--
2.32.0


2022-02-10 02:47:23

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 2/6] shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage

asm/shmbuf.h is currently excluded from the UAPI compile-test because of
the errors like follows:

HDRTEST usr/include/asm/shmbuf.h
In file included from ./usr/include/asm/shmbuf.h:6,
from <command-line>:
./usr/include/asm-generic/shmbuf.h:26:33: error: field ‘shm_perm’ has incomplete type
26 | struct ipc64_perm shm_perm; /* operation perms */
| ^~~~~~~~
./usr/include/asm-generic/shmbuf.h:27:9: error: unknown type name ‘size_t’
27 | size_t shm_segsz; /* size of segment (bytes) */
| ^~~~~~
./usr/include/asm-generic/shmbuf.h:40:9: error: unknown type name ‘__kernel_pid_t’
40 | __kernel_pid_t shm_cpid; /* pid of creator */
| ^~~~~~~~~~~~~~
./usr/include/asm-generic/shmbuf.h:41:9: error: unknown type name ‘__kernel_pid_t’
41 | __kernel_pid_t shm_lpid; /* pid of last operator */
| ^~~~~~~~~~~~~~

The errors can be fixed by replacing size_t with __kernel_size_t and by
including proper headers.

Then, remove the no-header-test entry from user/include/Makefile.

Signed-off-by: Masahiro Yamada <[email protected]>
---

arch/mips/include/uapi/asm/shmbuf.h | 7 +++++--
arch/parisc/include/uapi/asm/shmbuf.h | 2 ++
arch/powerpc/include/uapi/asm/shmbuf.h | 5 ++++-
arch/sparc/include/uapi/asm/shmbuf.h | 5 ++++-
arch/x86/include/uapi/asm/shmbuf.h | 6 +++++-
arch/xtensa/include/uapi/asm/shmbuf.h | 5 ++++-
include/uapi/asm-generic/shmbuf.h | 4 +++-
usr/include/Makefile | 1 -
8 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/arch/mips/include/uapi/asm/shmbuf.h b/arch/mips/include/uapi/asm/shmbuf.h
index 680bb95b2240..eb74d304b779 100644
--- a/arch/mips/include/uapi/asm/shmbuf.h
+++ b/arch/mips/include/uapi/asm/shmbuf.h
@@ -2,6 +2,9 @@
#ifndef _ASM_SHMBUF_H
#define _ASM_SHMBUF_H

+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
+
/*
* The shmid64_ds structure for the MIPS architecture.
* Note extra padding because this structure is passed back and forth
@@ -16,7 +19,7 @@
#ifdef __mips64
struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
- size_t shm_segsz; /* size of segment (bytes) */
+ __kernel_size_t shm_segsz; /* size of segment (bytes) */
long shm_atime; /* last attach time */
long shm_dtime; /* last detach time */
long shm_ctime; /* last change time */
@@ -29,7 +32,7 @@ struct shmid64_ds {
#else
struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
- size_t shm_segsz; /* size of segment (bytes) */
+ __kernel_size_t shm_segsz; /* size of segment (bytes) */
unsigned long shm_atime; /* last attach time */
unsigned long shm_dtime; /* last detach time */
unsigned long shm_ctime; /* last change time */
diff --git a/arch/parisc/include/uapi/asm/shmbuf.h b/arch/parisc/include/uapi/asm/shmbuf.h
index 5da3089be65e..532da742fb56 100644
--- a/arch/parisc/include/uapi/asm/shmbuf.h
+++ b/arch/parisc/include/uapi/asm/shmbuf.h
@@ -3,6 +3,8 @@
#define _PARISC_SHMBUF_H

#include <asm/bitsperlong.h>
+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>

/*
* The shmid64_ds structure for parisc architecture.
diff --git a/arch/powerpc/include/uapi/asm/shmbuf.h b/arch/powerpc/include/uapi/asm/shmbuf.h
index 00422b2f3c63..439a3a02ba64 100644
--- a/arch/powerpc/include/uapi/asm/shmbuf.h
+++ b/arch/powerpc/include/uapi/asm/shmbuf.h
@@ -2,6 +2,9 @@
#ifndef _ASM_POWERPC_SHMBUF_H
#define _ASM_POWERPC_SHMBUF_H

+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
+
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -34,7 +37,7 @@ struct shmid64_ds {
unsigned long shm_ctime; /* last change time */
unsigned long __unused4;
#endif
- size_t shm_segsz; /* size of segment (bytes) */
+ __kernel_size_t shm_segsz; /* size of segment (bytes) */
__kernel_pid_t shm_cpid; /* pid of creator */
__kernel_pid_t shm_lpid; /* pid of last operator */
unsigned long shm_nattch; /* no. of current attaches */
diff --git a/arch/sparc/include/uapi/asm/shmbuf.h b/arch/sparc/include/uapi/asm/shmbuf.h
index a5d7d8d681c4..ed4f061c7a15 100644
--- a/arch/sparc/include/uapi/asm/shmbuf.h
+++ b/arch/sparc/include/uapi/asm/shmbuf.h
@@ -2,6 +2,9 @@
#ifndef _SPARC_SHMBUF_H
#define _SPARC_SHMBUF_H

+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
+
/*
* The shmid64_ds structure for sparc architecture.
* Note extra padding because this structure is passed back and forth
@@ -25,7 +28,7 @@ struct shmid64_ds {
unsigned long shm_ctime_high;
unsigned long shm_ctime; /* last change time */
#endif
- size_t shm_segsz; /* size of segment (bytes) */
+ __kernel_size_t shm_segsz; /* size of segment (bytes) */
__kernel_pid_t shm_cpid; /* pid of creator */
__kernel_pid_t shm_lpid; /* pid of last operator */
unsigned long shm_nattch; /* no. of current attaches */
diff --git a/arch/x86/include/uapi/asm/shmbuf.h b/arch/x86/include/uapi/asm/shmbuf.h
index fce18eaa070c..13775bfdfee2 100644
--- a/arch/x86/include/uapi/asm/shmbuf.h
+++ b/arch/x86/include/uapi/asm/shmbuf.h
@@ -5,6 +5,10 @@
#if !defined(__x86_64__) || !defined(__ILP32__)
#include <asm-generic/shmbuf.h>
#else
+
+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
+
/*
* The shmid64_ds structure for x86 architecture with x32 ABI.
*
@@ -15,7 +19,7 @@

struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
- size_t shm_segsz; /* size of segment (bytes) */
+ __kernel_size_t shm_segsz; /* size of segment (bytes) */
__kernel_long_t shm_atime; /* last attach time */
__kernel_long_t shm_dtime; /* last detach time */
__kernel_long_t shm_ctime; /* last change time */
diff --git a/arch/xtensa/include/uapi/asm/shmbuf.h b/arch/xtensa/include/uapi/asm/shmbuf.h
index 554a57a6a90f..bb8bdddae9b5 100644
--- a/arch/xtensa/include/uapi/asm/shmbuf.h
+++ b/arch/xtensa/include/uapi/asm/shmbuf.h
@@ -20,9 +20,12 @@
#ifndef _XTENSA_SHMBUF_H
#define _XTENSA_SHMBUF_H

+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
+
struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
- size_t shm_segsz; /* size of segment (bytes) */
+ __kernel_size_t shm_segsz; /* size of segment (bytes) */
unsigned long shm_atime; /* last attach time */
unsigned long shm_atime_high;
unsigned long shm_dtime; /* last detach time */
diff --git a/include/uapi/asm-generic/shmbuf.h b/include/uapi/asm-generic/shmbuf.h
index 2bab955e0fed..2979b6dd2c56 100644
--- a/include/uapi/asm-generic/shmbuf.h
+++ b/include/uapi/asm-generic/shmbuf.h
@@ -3,6 +3,8 @@
#define __ASM_GENERIC_SHMBUF_H

#include <asm/bitsperlong.h>
+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>

/*
* The shmid64_ds structure for x86 architecture.
@@ -24,7 +26,7 @@

struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
- size_t shm_segsz; /* size of segment (bytes) */
+ __kernel_size_t shm_segsz; /* size of segment (bytes) */
#if __BITS_PER_LONG == 64
long shm_atime; /* last attach time */
long shm_dtime; /* last detach time */
diff --git a/usr/include/Makefile b/usr/include/Makefile
index e7230a5a402a..b0b6cc455930 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -23,7 +23,6 @@ override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I$(objtree)/usr/include
# Please consider to fix the header first.
#
# Sorted alphabetically.
-no-header-test += asm/shmbuf.h
no-header-test += asm/ucontext.h
no-header-test += drm/vmwgfx_drm.h
no-header-test += linux/am437x-vpfe.h
--
2.32.0


2022-02-10 03:38:16

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 5/6] kexec.h: add linux/kexec.h to UAPI compile-test coverage

linux/kexec.h is currently excluded from the UAPI compile-test because
of the errors like follows:

HDRTEST usr/include/linux/kexec.h
In file included from <command-line>:
./usr/include/linux/kexec.h:56:9: error: unknown type name ‘size_t’
56 | size_t bufsz;
| ^~~~~~
./usr/include/linux/kexec.h:58:9: error: unknown type name ‘size_t’
58 | size_t memsz;
| ^~~~~~

The errors can be fixed by replacing size_t with __kernel_size_t.

Then, remove the no-header-test entry from user/include/Makefile.

Signed-off-by: Masahiro Yamada <[email protected]>
---

include/uapi/linux/kexec.h | 4 ++--
usr/include/Makefile | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h
index 778dc191c265..fb7e2ef60825 100644
--- a/include/uapi/linux/kexec.h
+++ b/include/uapi/linux/kexec.h
@@ -54,9 +54,9 @@
*/
struct kexec_segment {
const void *buf;
- size_t bufsz;
+ __kernel_size_t bufsz;
const void *mem;
- size_t memsz;
+ __kernel_size_t memsz;
};

#endif /* __KERNEL__ */
diff --git a/usr/include/Makefile b/usr/include/Makefile
index 9e35d022fd88..48bb789099d5 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -31,7 +31,6 @@ no-header-test += linux/cyclades.h
no-header-test += linux/errqueue.h
no-header-test += linux/hdlc/ioctl.h
no-header-test += linux/ivtv.h
-no-header-test += linux/kexec.h
no-header-test += linux/matroxfb.h
no-header-test += linux/omap3isp.h
no-header-test += linux/omapfb.h
--
2.32.0


2022-02-10 09:57:23

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 4/6] fsmap.h: add linux/fsmap.h to UAPI compile-test coverage

On Thu, Feb 10, 2022 at 3:11 AM Masahiro Yamada <[email protected]> wrote:
>
> linux/fsmap.h is currently excluded from the UAPI compile-test because
> of the error like follows:
>
> HDRTEST usr/include/linux/fsmap.h
> In file included from <command-line>:
> ./usr/include/linux/fsmap.h:72:19: error: unknown type name ‘size_t’
> 72 | static __inline__ size_t
> | ^~~~~~
>
> The error can be fixed by replacing size_t with __kernel_size_t.
>
> Then, remove the no-header-test entry from user/include/Makefile.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

Reviewed-by: Arnd Bergmann <[email protected]>

2022-02-10 10:19:18

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 1/6] signal.h: add linux/signal.h and asm/signal.h to UAPI compile-test coverage

On Thu, Feb 10, 2022 at 3:11 AM Masahiro Yamada <[email protected]> wrote:
>
> linux/signal.h and asm/signal.h are currently excluded from the UAPI
> compile-test because of the errors like follows:
>
> HDRTEST usr/include/asm/signal.h
> In file included from <command-line>:
> ./usr/include/asm/signal.h:103:9: error: unknown type name ‘size_t’
> 103 | size_t ss_size;
> | ^~~~~~
>
> The errors can be fixed by replacing size_t with __kernel_size_t.
>
> Then, remove the no-header-test entries from user/include/Makefile.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

Reviewed-by: Arnd Bergmann <[email protected]>

2022-02-10 12:18:42

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 6/6] reiserfs_xattr.h: add linux/reiserfs_xattr.h to UAPI compile-test coverage

On Thu, Feb 10, 2022 at 3:11 AM Masahiro Yamada <[email protected]> wrote:
>
> linux/reiserfs_xattr.h is currently excluded from the UAPI compile-test
> because of the error like follows:
>
> HDRTEST usr/include/linux/reiserfs_xattr.h
> In file included from <command-line>:
> ./usr/include/linux/reiserfs_xattr.h:22:9: error: unknown type name ‘size_t’
> 22 | size_t length;
> | ^~~~~~
>
> The error can be fixed by replacing size_t with __kernel_size_t.
>
> Then, remove the no-header-test entry from user/include/Makefile.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

Reviewed-by: Arnd Bergmann <[email protected]>

2022-02-10 12:38:41

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 0/6] Add more export headers to compile-test coverage

On Thu, Feb 10, 2022 at 3:11 AM Masahiro Yamada <[email protected]> wrote:
> Masahiro Yamada (6):
> signal.h: add linux/signal.h and asm/signal.h to UAPI compile-test
> coverage
> shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage
> android/binder.h: add linux/android/binder(fs).h to UAPI compile-test
> coverage
> fsmap.h: add linux/fsmap.h to UAPI compile-test coverage
> kexec.h: add linux/kexec.h to UAPI compile-test coverage
> reiserfs_xattr.h: add linux/reiserfs_xattr.h to UAPI compile-test
> coverage

Very nice! Should I pick these up into the asm-generic tree?

Arnd

2022-02-10 13:45:27

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 3/6] android/binder.h: add linux/android/binder(fs).h to UAPI compile-test coverage

On Thu, Feb 10, 2022 at 3:11 AM Masahiro Yamada <[email protected]> wrote:
>
> linux/android/binder.h and linux/android/binderfs.h are currently
> excluded from the UAPI compile-test because of the errors like follows:
>
> HDRTEST usr/include/linux/android/binder.h
> In file included from <command-line>:
> ./usr/include/linux/android/binder.h:291:9: error: unknown type name ‘pid_t’
> 291 | pid_t sender_pid;
> | ^~~~~
> ./usr/include/linux/android/binder.h:292:9: error: unknown type name ‘uid_t’
> 292 | uid_t sender_euid;
> | ^~~~~
>
> The errors can be fixed by replacing {pid,uid}_t with __kernel_{pid,uid}_t.
>
> Then, remove the no-header-test entries from user/include/Makefile.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

Reviewed-by: Arnd Bergmann <[email protected]>

2022-02-10 16:00:23

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 5/6] kexec.h: add linux/kexec.h to UAPI compile-test coverage

On Thu, Feb 10, 2022 at 3:11 AM Masahiro Yamada <[email protected]> wrote:
>
> linux/kexec.h is currently excluded from the UAPI compile-test because
> of the errors like follows:
>
> HDRTEST usr/include/linux/kexec.h
> In file included from <command-line>:
> ./usr/include/linux/kexec.h:56:9: error: unknown type name ‘size_t’
> 56 | size_t bufsz;
> | ^~~~~~
> ./usr/include/linux/kexec.h:58:9: error: unknown type name ‘size_t’
> 58 | size_t memsz;
> | ^~~~~~
>
> The errors can be fixed by replacing size_t with __kernel_size_t.
>
> Then, remove the no-header-test entry from user/include/Makefile.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

Reviewed-by: Arnd Bergmann <[email protected]>

2022-02-10 18:56:55

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 1/6] signal.h: add linux/signal.h and asm/signal.h to UAPI compile-test coverage

On Thu, Feb 10, 2022 at 3:36 AM Masahiro Yamada <[email protected]> wrote:
> linux/signal.h and asm/signal.h are currently excluded from the UAPI
> compile-test because of the errors like follows:
>
> HDRTEST usr/include/asm/signal.h
> In file included from <command-line>:
> ./usr/include/asm/signal.h:103:9: error: unknown type name ‘size_t’
> 103 | size_t ss_size;
> | ^~~~~~
>
> The errors can be fixed by replacing size_t with __kernel_size_t.
>
> Then, remove the no-header-test entries from user/include/Makefile.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

> arch/m68k/include/uapi/asm/signal.h | 2 +-

Reviewed-by: Geert Uytterhoeven <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2022-02-10 19:27:53

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 2/6] shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage

On Thu, Feb 10, 2022 at 3:11 AM Masahiro Yamada <[email protected]> wrote:
>
> asm/shmbuf.h is currently excluded from the UAPI compile-test because of
> the errors like follows:
>
> HDRTEST usr/include/asm/shmbuf.h
> In file included from ./usr/include/asm/shmbuf.h:6,
> from <command-line>:
> ./usr/include/asm-generic/shmbuf.h:26:33: error: field ‘shm_perm’ has incomplete type
> 26 | struct ipc64_perm shm_perm; /* operation perms */
> | ^~~~~~~~
> ./usr/include/asm-generic/shmbuf.h:27:9: error: unknown type name ‘size_t’
> 27 | size_t shm_segsz; /* size of segment (bytes) */
> | ^~~~~~
> ./usr/include/asm-generic/shmbuf.h:40:9: error: unknown type name ‘__kernel_pid_t’
> 40 | __kernel_pid_t shm_cpid; /* pid of creator */
> | ^~~~~~~~~~~~~~
> ./usr/include/asm-generic/shmbuf.h:41:9: error: unknown type name ‘__kernel_pid_t’
> 41 | __kernel_pid_t shm_lpid; /* pid of last operator */
> | ^~~~~~~~~~~~~~
>
> The errors can be fixed by replacing size_t with __kernel_size_t and by
> including proper headers.
>
> Then, remove the no-header-test entry from user/include/Makefile.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

Reviewed-by: Arnd Bergmann <[email protected]>

2022-02-11 11:58:26

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH 0/6] Add more export headers to compile-test coverage

On Thu, Feb 10, 2022 at 6:46 PM Arnd Bergmann <[email protected]> wrote:
>
> On Thu, Feb 10, 2022 at 3:11 AM Masahiro Yamada <[email protected]> wrote:
> > Masahiro Yamada (6):
> > signal.h: add linux/signal.h and asm/signal.h to UAPI compile-test
> > coverage
> > shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage
> > android/binder.h: add linux/android/binder(fs).h to UAPI compile-test
> > coverage
> > fsmap.h: add linux/fsmap.h to UAPI compile-test coverage
> > kexec.h: add linux/kexec.h to UAPI compile-test coverage
> > reiserfs_xattr.h: add linux/reiserfs_xattr.h to UAPI compile-test
> > coverage
>
> Very nice! Should I pick these up into the asm-generic tree?
>
> Arnd


Yes, please.


--
Best Regards
Masahiro Yamada

2022-02-17 17:34:42

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 0/6] Add more export headers to compile-test coverage

On Fri, Feb 11, 2022 at 6:23 AM Masahiro Yamada <[email protected]> wrote:
>
> On Thu, Feb 10, 2022 at 6:46 PM Arnd Bergmann <[email protected]> wrote:
> >
> > On Thu, Feb 10, 2022 at 3:11 AM Masahiro Yamada <[email protected]> wrote:
> > > Masahiro Yamada (6):
> > > signal.h: add linux/signal.h and asm/signal.h to UAPI compile-test
> > > coverage
> > > shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage
> > > android/binder.h: add linux/android/binder(fs).h to UAPI compile-test
> > > coverage
> > > fsmap.h: add linux/fsmap.h to UAPI compile-test coverage
> > > kexec.h: add linux/kexec.h to UAPI compile-test coverage
> > > reiserfs_xattr.h: add linux/reiserfs_xattr.h to UAPI compile-test
> > > coverage
> >
> > Very nice! Should I pick these up into the asm-generic tree?
>
> Yes, please.

Done now.

Arnd

2022-03-13 17:50:08

by Dmitry V. Levin

[permalink] [raw]
Subject: Re: [PATCH 2/6] shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage

On Thu, Feb 10, 2022 at 11:11:25AM +0900, Masahiro Yamada wrote:
> asm/shmbuf.h is currently excluded from the UAPI compile-test because of
> the errors like follows:
>
> HDRTEST usr/include/asm/shmbuf.h
> In file included from ./usr/include/asm/shmbuf.h:6,
> from <command-line>:
> ./usr/include/asm-generic/shmbuf.h:26:33: error: field ‘shm_perm’ has incomplete type
> 26 | struct ipc64_perm shm_perm; /* operation perms */
> | ^~~~~~~~
> ./usr/include/asm-generic/shmbuf.h:27:9: error: unknown type name ‘size_t’
> 27 | size_t shm_segsz; /* size of segment (bytes) */
> | ^~~~~~
> ./usr/include/asm-generic/shmbuf.h:40:9: error: unknown type name ‘__kernel_pid_t’
> 40 | __kernel_pid_t shm_cpid; /* pid of creator */
> | ^~~~~~~~~~~~~~
> ./usr/include/asm-generic/shmbuf.h:41:9: error: unknown type name ‘__kernel_pid_t’
> 41 | __kernel_pid_t shm_lpid; /* pid of last operator */
> | ^~~~~~~~~~~~~~
>
> The errors can be fixed by replacing size_t with __kernel_size_t and by
> including proper headers.
>
> Then, remove the no-header-test entry from user/include/Makefile.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

This is essentially the same patch as
https://lore.kernel.org/lkml/[email protected]/

Apparently, some people are more lucky in getting their patches reviewed.

[...]
> diff --git a/arch/mips/include/uapi/asm/shmbuf.h b/arch/mips/include/uapi/asm/shmbuf.h
> index 680bb95b2240..eb74d304b779 100644
> --- a/arch/mips/include/uapi/asm/shmbuf.h
> +++ b/arch/mips/include/uapi/asm/shmbuf.h
> @@ -2,6 +2,9 @@
> #ifndef _ASM_SHMBUF_H
> #define _ASM_SHMBUF_H
>
> +#include <asm/ipcbuf.h>
> +#include <asm/posix_types.h>

There is no need to include <asm/posix_types.h> since <asm/ipcbuf.h>
already includes it, but there is no harm either.

[...]
> diff --git a/arch/parisc/include/uapi/asm/shmbuf.h b/arch/parisc/include/uapi/asm/shmbuf.h
> index 5da3089be65e..532da742fb56 100644
> --- a/arch/parisc/include/uapi/asm/shmbuf.h
> +++ b/arch/parisc/include/uapi/asm/shmbuf.h
> @@ -3,6 +3,8 @@
> #define _PARISC_SHMBUF_H
>
> #include <asm/bitsperlong.h>
> +#include <asm/ipcbuf.h>
> +#include <asm/posix_types.h>

Likewise.

[...]
> diff --git a/arch/powerpc/include/uapi/asm/shmbuf.h b/arch/powerpc/include/uapi/asm/shmbuf.h
> index 00422b2f3c63..439a3a02ba64 100644
> --- a/arch/powerpc/include/uapi/asm/shmbuf.h
> +++ b/arch/powerpc/include/uapi/asm/shmbuf.h
> @@ -2,6 +2,9 @@
> #ifndef _ASM_POWERPC_SHMBUF_H
> #define _ASM_POWERPC_SHMBUF_H
>
> +#include <asm/ipcbuf.h>
> +#include <asm/posix_types.h>

Likewise.

[...]
> diff --git a/arch/sparc/include/uapi/asm/shmbuf.h b/arch/sparc/include/uapi/asm/shmbuf.h
> index a5d7d8d681c4..ed4f061c7a15 100644
> --- a/arch/sparc/include/uapi/asm/shmbuf.h
> +++ b/arch/sparc/include/uapi/asm/shmbuf.h
> @@ -2,6 +2,9 @@
> #ifndef _SPARC_SHMBUF_H
> #define _SPARC_SHMBUF_H
>
> +#include <asm/ipcbuf.h>
> +#include <asm/posix_types.h>

Likewise.

[...]
> diff --git a/arch/x86/include/uapi/asm/shmbuf.h b/arch/x86/include/uapi/asm/shmbuf.h
> index fce18eaa070c..13775bfdfee2 100644
> --- a/arch/x86/include/uapi/asm/shmbuf.h
> +++ b/arch/x86/include/uapi/asm/shmbuf.h
> @@ -5,6 +5,10 @@
> #if !defined(__x86_64__) || !defined(__ILP32__)
> #include <asm-generic/shmbuf.h>
> #else
> +
> +#include <asm/ipcbuf.h>
> +#include <asm/posix_types.h>

Likewise.

[...]
> diff --git a/arch/xtensa/include/uapi/asm/shmbuf.h b/arch/xtensa/include/uapi/asm/shmbuf.h
> index 554a57a6a90f..bb8bdddae9b5 100644
> --- a/arch/xtensa/include/uapi/asm/shmbuf.h
> +++ b/arch/xtensa/include/uapi/asm/shmbuf.h
> @@ -20,9 +20,12 @@
> #ifndef _XTENSA_SHMBUF_H
> #define _XTENSA_SHMBUF_H
>
> +#include <asm/ipcbuf.h>
> +#include <asm/posix_types.h>

Likewise.

[...]
> diff --git a/include/uapi/asm-generic/shmbuf.h b/include/uapi/asm-generic/shmbuf.h
> index 2bab955e0fed..2979b6dd2c56 100644
> --- a/include/uapi/asm-generic/shmbuf.h
> +++ b/include/uapi/asm-generic/shmbuf.h
> @@ -3,6 +3,8 @@
> #define __ASM_GENERIC_SHMBUF_H
>
> #include <asm/bitsperlong.h>
> +#include <asm/ipcbuf.h>
> +#include <asm/posix_types.h>

Likewise.


--
ldv

2022-03-14 16:39:10

by Dmitry V. Levin

[permalink] [raw]
Subject: Re: [PATCH 1/6] signal.h: add linux/signal.h and asm/signal.h to UAPI compile-test coverage

On Thu, Feb 10, 2022 at 11:11:24AM +0900, Masahiro Yamada wrote:
> linux/signal.h and asm/signal.h are currently excluded from the UAPI
> compile-test because of the errors like follows:
>
> HDRTEST usr/include/asm/signal.h
> In file included from <command-line>:
> ./usr/include/asm/signal.h:103:9: error: unknown type name ‘size_t’
> 103 | size_t ss_size;
> | ^~~~~~
>
> The errors can be fixed by replacing size_t with __kernel_size_t.
>
> Then, remove the no-header-test entries from user/include/Makefile.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

This is essentially the same patch as
https://lore.kernel.org/lkml/[email protected]/

Apparently, some people are more lucky in getting their patches reviewed.

Anyway,
Reviewed-by: Dmitry V. Levin <[email protected]>


--
ldv