Skip to content

Commit b905f4b

Browse files
committed
Update Linux headers from v5.10.5 to v6.6
This patch imports the Linux kernel from v5.10.5 to v6.6. Important RISC-V specific changes are: * hwprobe support * V support (ptrace and prctl calls) * KVM support There are patches on the glibc list that introduce code which uses the hwprobe interface. Let's update the kernel headers to be ready for these changes. Signed-off-by: Christoph Müllner <[email protected]>
1 parent c2b4923 commit b905f4b

File tree

469 files changed

+37468
-9676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

469 files changed

+37468
-9676
lines changed

linux-headers/include/asm-generic/bitsperlong.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,26 @@
22
#ifndef __ASM_GENERIC_BITS_PER_LONG
33
#define __ASM_GENERIC_BITS_PER_LONG
44

5+
#ifndef __BITS_PER_LONG
6+
/*
7+
* In order to keep safe and avoid regression, only unify uapi
8+
* bitsperlong.h for some archs which are using newer toolchains
9+
* that have the definitions of __CHAR_BIT__ and __SIZEOF_LONG__.
10+
* See the following link for more info:
11+
* https://lore.kernel.org/linux-arch/[email protected]/
12+
*/
13+
#if defined(__CHAR_BIT__) && defined(__SIZEOF_LONG__)
14+
#define __BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)
15+
#else
516
/*
617
* There seems to be no way of detecting this automatically from user
718
* space, so 64 bit architectures should override this in their
819
* bitsperlong.h. In particular, an architecture that supports
920
* both 32 and 64 bit user space must not rely on CONFIG_64BIT
1021
* to decide it, but rather check a compiler provided macro.
1122
*/
12-
#ifndef __BITS_PER_LONG
1323
#define __BITS_PER_LONG 32
1424
#endif
25+
#endif
1526

1627
#endif /* __ASM_GENERIC_BITS_PER_LONG */

linux-headers/include/asm-generic/fcntl.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191

9292
/* a horrid kludge trying to make sure that this will fail on old kernels */
9393
#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
94-
#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)
9594

9695
#ifndef O_NDELAY
9796
#define O_NDELAY O_NONBLOCK
@@ -116,13 +115,13 @@
116115
#define F_GETSIG 11 /* for sockets. */
117116
#endif
118117

119-
#ifndef CONFIG_64BIT
118+
#if __BITS_PER_LONG == 32 || defined(__KERNEL__)
120119
#ifndef F_GETLK64
121120
#define F_GETLK64 12 /* using 'struct flock64' */
122121
#define F_SETLK64 13
123122
#define F_SETLKW64 14
124123
#endif
125-
#endif
124+
#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */
126125

127126
#ifndef F_SETOWN_EX
128127
#define F_SETOWN_EX 15
@@ -181,6 +180,10 @@ struct f_owner_ex {
181180
blocking */
182181
#define LOCK_UN 8 /* remove lock */
183182

183+
/*
184+
* LOCK_MAND support has been removed from the kernel. We leave the symbols
185+
* here to not break legacy builds, but these should not be used in new code.
186+
*/
184187
#define LOCK_MAND 32 /* This is a mandatory flock ... */
185188
#define LOCK_READ 64 /* which allows concurrent read operations */
186189
#define LOCK_WRITE 128 /* which allows concurrent write operations */
@@ -189,33 +192,30 @@ struct f_owner_ex {
189192
#define F_LINUX_SPECIFIC_BASE 1024
190193

191194
#ifndef HAVE_ARCH_STRUCT_FLOCK
192-
#ifndef __ARCH_FLOCK_PAD
193-
#define __ARCH_FLOCK_PAD
194-
#endif
195-
196195
struct flock {
197196
short l_type;
198197
short l_whence;
199198
__kernel_off_t l_start;
200199
__kernel_off_t l_len;
201200
__kernel_pid_t l_pid;
202-
__ARCH_FLOCK_PAD
203-
};
201+
#ifdef __ARCH_FLOCK_EXTRA_SYSID
202+
__ARCH_FLOCK_EXTRA_SYSID
204203
#endif
205-
206-
#ifndef HAVE_ARCH_STRUCT_FLOCK64
207-
#ifndef __ARCH_FLOCK64_PAD
208-
#define __ARCH_FLOCK64_PAD
204+
#ifdef __ARCH_FLOCK_PAD
205+
__ARCH_FLOCK_PAD
209206
#endif
207+
};
210208

211209
struct flock64 {
212210
short l_type;
213211
short l_whence;
214212
__kernel_loff_t l_start;
215213
__kernel_loff_t l_len;
216214
__kernel_pid_t l_pid;
215+
#ifdef __ARCH_FLOCK64_PAD
217216
__ARCH_FLOCK64_PAD
218-
};
219217
#endif
218+
};
219+
#endif /* HAVE_ARCH_STRUCT_FLOCK */
220220

221221
#endif /* _ASM_GENERIC_FCNTL_H */

linux-headers/include/asm-generic/hugetlb_encode.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
#define HUGETLB_FLAG_ENCODE_SHIFT 26
2121
#define HUGETLB_FLAG_ENCODE_MASK 0x3f
2222

23-
#define HUGETLB_FLAG_ENCODE_16KB (14 << HUGETLB_FLAG_ENCODE_SHIFT)
24-
#define HUGETLB_FLAG_ENCODE_64KB (16 << HUGETLB_FLAG_ENCODE_SHIFT)
25-
#define HUGETLB_FLAG_ENCODE_512KB (19 << HUGETLB_FLAG_ENCODE_SHIFT)
26-
#define HUGETLB_FLAG_ENCODE_1MB (20 << HUGETLB_FLAG_ENCODE_SHIFT)
27-
#define HUGETLB_FLAG_ENCODE_2MB (21 << HUGETLB_FLAG_ENCODE_SHIFT)
28-
#define HUGETLB_FLAG_ENCODE_8MB (23 << HUGETLB_FLAG_ENCODE_SHIFT)
29-
#define HUGETLB_FLAG_ENCODE_16MB (24 << HUGETLB_FLAG_ENCODE_SHIFT)
30-
#define HUGETLB_FLAG_ENCODE_32MB (25 << HUGETLB_FLAG_ENCODE_SHIFT)
31-
#define HUGETLB_FLAG_ENCODE_256MB (28 << HUGETLB_FLAG_ENCODE_SHIFT)
32-
#define HUGETLB_FLAG_ENCODE_512MB (29 << HUGETLB_FLAG_ENCODE_SHIFT)
33-
#define HUGETLB_FLAG_ENCODE_1GB (30 << HUGETLB_FLAG_ENCODE_SHIFT)
34-
#define HUGETLB_FLAG_ENCODE_2GB (31 << HUGETLB_FLAG_ENCODE_SHIFT)
35-
#define HUGETLB_FLAG_ENCODE_16GB (34 << HUGETLB_FLAG_ENCODE_SHIFT)
23+
#define HUGETLB_FLAG_ENCODE_16KB (14U << HUGETLB_FLAG_ENCODE_SHIFT)
24+
#define HUGETLB_FLAG_ENCODE_64KB (16U << HUGETLB_FLAG_ENCODE_SHIFT)
25+
#define HUGETLB_FLAG_ENCODE_512KB (19U << HUGETLB_FLAG_ENCODE_SHIFT)
26+
#define HUGETLB_FLAG_ENCODE_1MB (20U << HUGETLB_FLAG_ENCODE_SHIFT)
27+
#define HUGETLB_FLAG_ENCODE_2MB (21U << HUGETLB_FLAG_ENCODE_SHIFT)
28+
#define HUGETLB_FLAG_ENCODE_8MB (23U << HUGETLB_FLAG_ENCODE_SHIFT)
29+
#define HUGETLB_FLAG_ENCODE_16MB (24U << HUGETLB_FLAG_ENCODE_SHIFT)
30+
#define HUGETLB_FLAG_ENCODE_32MB (25U << HUGETLB_FLAG_ENCODE_SHIFT)
31+
#define HUGETLB_FLAG_ENCODE_256MB (28U << HUGETLB_FLAG_ENCODE_SHIFT)
32+
#define HUGETLB_FLAG_ENCODE_512MB (29U << HUGETLB_FLAG_ENCODE_SHIFT)
33+
#define HUGETLB_FLAG_ENCODE_1GB (30U << HUGETLB_FLAG_ENCODE_SHIFT)
34+
#define HUGETLB_FLAG_ENCODE_2GB (31U << HUGETLB_FLAG_ENCODE_SHIFT)
35+
#define HUGETLB_FLAG_ENCODE_16GB (34U << HUGETLB_FLAG_ENCODE_SHIFT)
3636

3737
#endif /* _ASM_GENERIC_HUGETLB_ENCODE_H_ */

linux-headers/include/asm-generic/mman-common.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@
7272
#define MADV_COLD 20 /* deactivate these pages */
7373
#define MADV_PAGEOUT 21 /* reclaim these pages */
7474

75+
#define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */
76+
#define MADV_POPULATE_WRITE 23 /* populate (prefault) page tables writable */
77+
78+
#define MADV_DONTNEED_LOCKED 24 /* like DONTNEED, but drop locked pages too */
79+
80+
#define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */
81+
7582
/* compatibility flags */
7683
#define MAP_FILE 0
7784

linux-headers/include/asm-generic/poll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#define POLLRDHUP 0x2000
3030
#endif
3131

32-
#define POLLFREE (__poll_t)0x4000 /* currently only for epoll */
32+
#define POLLFREE (__poll_t)0x4000
3333

3434
#define POLL_BUSY_LOOP (__poll_t)0x8000
3535

linux-headers/include/asm-generic/sembuf.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include <asm/ipcbuf.h>
77

88
/*
9-
* The semid64_ds structure for x86 architecture.
10-
* Note extra padding because this structure is passed back and forth
11-
* between kernel and user space.
9+
* The semid64_ds structure for most architectures (though it came from x86_32
10+
* originally). Note extra padding because this structure is passed back and
11+
* forth between kernel and user space.
1212
*
1313
* semid64_ds was originally meant to be architecture specific, but
1414
* everyone just ended up making identical copies without specific

linux-headers/include/asm-generic/shmbuf.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#define __ASM_GENERIC_SHMBUF_H
44

55
#include <asm/bitsperlong.h>
6+
#include <asm/ipcbuf.h>
7+
#include <asm/posix_types.h>
68

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

2527
struct shmid64_ds {
2628
struct ipc64_perm shm_perm; /* operation perms */
27-
size_t shm_segsz; /* size of segment (bytes) */
29+
__kernel_size_t shm_segsz; /* size of segment (bytes) */
2830
#if __BITS_PER_LONG == 64
2931
long shm_atime; /* last attach time */
3032
long shm_dtime; /* last detach time */

linux-headers/include/asm-generic/siginfo.h

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ typedef union sigval {
2929
#define __ARCH_SI_ATTRIBUTES
3030
#endif
3131

32+
/*
33+
* Be careful when extending this union. On 32bit siginfo_t is 32bit
34+
* aligned. Which means that a 64bit field or any other field that
35+
* would increase the alignment of siginfo_t will break the ABI.
36+
*/
3237
union __sifields {
3338
/* kill() */
3439
struct {
@@ -63,9 +68,6 @@ union __sifields {
6368
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
6469
struct {
6570
void *_addr; /* faulting insn/memory ref. */
66-
#ifdef __ARCH_SI_TRAPNO
67-
int _trapno; /* TRAP # which caused the signal */
68-
#endif
6971
#ifdef __ia64__
7072
int _imm; /* immediate value for "break" */
7173
unsigned int _flags; /* see ia64 si_flags */
@@ -75,6 +77,8 @@ union __sifields {
7577
#define __ADDR_BND_PKEY_PAD (__alignof__(void *) < sizeof(short) ? \
7678
sizeof(short) : __alignof__(void *))
7779
union {
80+
/* used on alpha and sparc */
81+
int _trapno; /* TRAP # which caused the signal */
7882
/*
7983
* used when si_code=BUS_MCEERR_AR or
8084
* used when si_code=BUS_MCEERR_AO
@@ -91,6 +95,12 @@ union __sifields {
9195
char _dummy_pkey[__ADDR_BND_PKEY_PAD];
9296
__u32 _pkey;
9397
} _addr_pkey;
98+
/* used when si_code=TRAP_PERF */
99+
struct {
100+
unsigned long _data;
101+
__u32 _type;
102+
__u32 _flags;
103+
} _perf;
94104
};
95105
} _sigfault;
96106

@@ -148,13 +158,14 @@ typedef struct siginfo {
148158
#define si_int _sifields._rt._sigval.sival_int
149159
#define si_ptr _sifields._rt._sigval.sival_ptr
150160
#define si_addr _sifields._sigfault._addr
151-
#ifdef __ARCH_SI_TRAPNO
152161
#define si_trapno _sifields._sigfault._trapno
153-
#endif
154162
#define si_addr_lsb _sifields._sigfault._addr_lsb
155163
#define si_lower _sifields._sigfault._addr_bnd._lower
156164
#define si_upper _sifields._sigfault._addr_bnd._upper
157165
#define si_pkey _sifields._sigfault._addr_pkey._pkey
166+
#define si_perf_data _sifields._sigfault._perf._data
167+
#define si_perf_type _sifields._sigfault._perf._type
168+
#define si_perf_flags _sifields._sigfault._perf._flags
158169
#define si_band _sifields._sigpoll._band
159170
#define si_fd _sifields._sigpoll._fd
160171
#define si_call_addr _sifields._sigsys._call_addr
@@ -231,7 +242,8 @@ typedef struct siginfo {
231242
#define SEGV_ADIPERR 7 /* Precise MCD exception */
232243
#define SEGV_MTEAERR 8 /* Asynchronous ARM MTE error */
233244
#define SEGV_MTESERR 9 /* Synchronous ARM MTE exception */
234-
#define NSIGSEGV 9
245+
#define SEGV_CPERR 10 /* Control protection fault */
246+
#define NSIGSEGV 10
235247

236248
/*
237249
* SIGBUS si_codes
@@ -253,13 +265,19 @@ typedef struct siginfo {
253265
#define TRAP_BRANCH 3 /* process taken branch trap */
254266
#define TRAP_HWBKPT 4 /* hardware breakpoint/watchpoint */
255267
#define TRAP_UNK 5 /* undiagnosed trap */
256-
#define NSIGTRAP 5
268+
#define TRAP_PERF 6 /* perf event with sigtrap=1 */
269+
#define NSIGTRAP 6
257270

258271
/*
259272
* There is an additional set of SIGTRAP si_codes used by ptrace
260273
* that are of the form: ((PTRACE_EVENT_XXX << 8) | SIGTRAP)
261274
*/
262275

276+
/*
277+
* Flags for si_perf_flags if SIGTRAP si_code is TRAP_PERF.
278+
*/
279+
#define TRAP_PERF_FLAG_ASYNC (1u << 0)
280+
263281
/*
264282
* SIGCHLD si_codes
265283
*/
@@ -286,7 +304,8 @@ typedef struct siginfo {
286304
* SIGSYS si_codes
287305
*/
288306
#define SYS_SECCOMP 1 /* seccomp triggered */
289-
#define NSIGSYS 1
307+
#define SYS_USER_DISPATCH 2 /* syscall user dispatch triggered */
308+
#define NSIGSYS 2
290309

291310
/*
292311
* SIGEMT si_codes

linux-headers/include/asm-generic/signal-defs.h

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,70 @@
44

55

66

7+
/*
8+
* SA_FLAGS values:
9+
*
10+
* SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
11+
* SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
12+
* SA_SIGINFO delivers the signal with SIGINFO structs.
13+
* SA_ONSTACK indicates that a registered stack_t will be used.
14+
* SA_RESTART flag to get restarting signals (which were the default long ago)
15+
* SA_NODEFER prevents the current signal from being masked in the handler.
16+
* SA_RESETHAND clears the handler when the signal is delivered.
17+
* SA_UNSUPPORTED is a flag bit that will never be supported. Kernels from
18+
* before the introduction of SA_UNSUPPORTED did not clear unknown bits from
19+
* sa_flags when read using the oldact argument to sigaction and rt_sigaction,
20+
* so this bit allows flag bit support to be detected from userspace while
21+
* allowing an old kernel to be distinguished from a kernel that supports every
22+
* flag bit.
23+
* SA_EXPOSE_TAGBITS exposes an architecture-defined set of tag bits in
24+
* siginfo.si_addr.
25+
*
26+
* SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
27+
* Unix names RESETHAND and NODEFER respectively.
28+
*/
29+
#ifndef SA_NOCLDSTOP
30+
#define SA_NOCLDSTOP 0x00000001
31+
#endif
32+
#ifndef SA_NOCLDWAIT
33+
#define SA_NOCLDWAIT 0x00000002
34+
#endif
35+
#ifndef SA_SIGINFO
36+
#define SA_SIGINFO 0x00000004
37+
#endif
38+
/* 0x00000008 used on alpha, mips, parisc */
39+
/* 0x00000010 used on alpha, parisc */
40+
/* 0x00000020 used on alpha, parisc, sparc */
41+
/* 0x00000040 used on alpha, parisc */
42+
/* 0x00000080 used on parisc */
43+
/* 0x00000100 used on sparc */
44+
/* 0x00000200 used on sparc */
45+
#define SA_UNSUPPORTED 0x00000400
46+
#define SA_EXPOSE_TAGBITS 0x00000800
47+
/* 0x00010000 used on mips */
48+
/* 0x00800000 used for internal SA_IMMUTABLE */
49+
/* 0x01000000 used on x86 */
50+
/* 0x02000000 used on x86 */
51+
/*
52+
* New architectures should not define the obsolete
53+
* SA_RESTORER 0x04000000
54+
*/
55+
#ifndef SA_ONSTACK
56+
#define SA_ONSTACK 0x08000000
57+
#endif
58+
#ifndef SA_RESTART
59+
#define SA_RESTART 0x10000000
60+
#endif
61+
#ifndef SA_NODEFER
62+
#define SA_NODEFER 0x40000000
63+
#endif
64+
#ifndef SA_RESETHAND
65+
#define SA_RESETHAND 0x80000000
66+
#endif
67+
68+
#define SA_NOMASK SA_NODEFER
69+
#define SA_ONESHOT SA_RESETHAND
70+
771
#ifndef SIG_BLOCK
872
#define SIG_BLOCK 0 /* for blocking signals */
973
#endif

0 commit comments

Comments
 (0)