summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2019-03-06 11:37:10 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-06 16:44:37 +0000
commitc2fecb0a513cfe5ddf75bfe24e98dec15dab3adc (patch)
tree8f84d32b48206c9319673f74fd1610d9f0d7ab9f /meta/recipes-kernel
parent04bfce60c8c8e4d0ba17460e89d7a6d3d071c147 (diff)
downloadpoky-c2fecb0a513cfe5ddf75bfe24e98dec15dab3adc.tar.gz
linux-libc-headers: update to 5.x headers
Updating the linux-libc-headers to the 5.x kernel variant to match the latest reference kernel in the 2.7 release. We have two patches refreshed for context changes, and three patches dropped since they have been merged to the mainline kernel and are no longer necessary. (From OE-Core rev: f6c825c41e3d4c14ae4ba0b2a07cc41d538e0d61) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc2
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-net-Use-__kernel_clockid_t-in-uapi-net_stamp.h.patch49
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch11
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-arm64-sve-ptrace-Fix-SVE_PT_REGS_OFFSET-definition.patch43
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-arm64-sve-Disentangle-uapi-asm-ptrace.h-from-uapi-as.patch289
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers_5.0.bb (renamed from meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.19.bb)7
6 files changed, 9 insertions, 392 deletions
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
index be215af9b9..7f838f623e 100644
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -38,6 +38,8 @@ python __anonymous () {
38 d.setVar("HEADER_FETCH_VER", "3.0") 38 d.setVar("HEADER_FETCH_VER", "3.0")
39 elif major == "4": 39 elif major == "4":
40 d.setVar("HEADER_FETCH_VER", "4.x") 40 d.setVar("HEADER_FETCH_VER", "4.x")
41 elif major == "5":
42 d.setVar("HEADER_FETCH_VER", "5.x")
41 else: 43 else:
42 d.setVar("HEADER_FETCH_VER", "2.6") 44 d.setVar("HEADER_FETCH_VER", "2.6")
43} 45}
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-net-Use-__kernel_clockid_t-in-uapi-net_stamp.h.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-net-Use-__kernel_clockid_t-in-uapi-net_stamp.h.patch
deleted file mode 100644
index 3684cc21bf..0000000000
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-net-Use-__kernel_clockid_t-in-uapi-net_stamp.h.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1From e2c4cf7f98a519eb4d95532bfa06bcaf3562fed5 Mon Sep 17 00:00:00 2001
2From: Davide Caratti <dcaratti@redhat.com>
3Date: Mon, 17 Dec 2018 11:26:38 +0100
4Subject: [PATCH] net: Use __kernel_clockid_t in uapi net_stamp.h
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Herton reports the following error when building a userspace program that
10includes net_stamp.h:
11
12 In file included from foo.c:2:
13 /usr/include/linux/net_tstamp.h:158:2: error: unknown type name
14 ‘clockid_t’
15 clockid_t clockid; /* reference clockid */
16 ^~~~~~~~~
17
18Fix it by using __kernel_clockid_t in place of clockid_t.
19
20Fixes: 80b14dee2bea ("net: Add a new socket option for a future transmit time.")
21Cc: Timothy Redaelli <tredaelli@redhat.com>
22Reported-by: Herton R. Krzesinski <herton@redhat.com>
23Signed-off-by: Davide Caratti <dcaratti@redhat.com>
24Tested-by: Paolo Abeni <pabeni@redhat.com>
25Signed-off-by: David S. Miller <davem@davemloft.net>
26---
27Upstream-Status: Backport [https://github.com/torvalds/linux/commit/e2c4cf7f98a519eb4d95532bfa06bcaf3562fed5]
28
29 include/uapi/linux/net_tstamp.h | 4 ++--
30 1 file changed, 2 insertions(+), 2 deletions(-)
31
32diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h
33index 97ff3c17ec4d..e5b39721c6e4 100644
34--- a/include/uapi/linux/net_tstamp.h
35+++ b/include/uapi/linux/net_tstamp.h
36@@ -155,8 +155,8 @@ enum txtime_flags {
37 };
38
39 struct sock_txtime {
40- clockid_t clockid; /* reference clockid */
41- __u32 flags; /* as defined by enum txtime_flags */
42+ __kernel_clockid_t clockid;/* reference clockid */
43+ __u32 flags; /* as defined by enum txtime_flags */
44 };
45
46 #endif /* _NET_TIMESTAMPING_H */
47--
482.20.1
49
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch
index 9ba1c076e8..a5ded602e5 100644
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch
@@ -1,8 +1,7 @@
1From 694eba7bb974f6b8bd308804cb24350150108b2b Mon Sep 17 00:00:00 2001 1From 694eba7bb974f6b8bd308804cb24350150108b2b Mon Sep 17 00:00:00 2001
2From: He Zhe <zhe.he@windriver.com> 2From: He Zhe <zhe.he@windriver.com>
3Date: Wed, 21 Nov 2018 15:12:43 +0800 3Date: Wed, 21 Nov 2018 15:12:43 +0800
4Subject: [PATCH] scripts: Use fixed input and output files instead of pipe for 4Subject: [PATCH] scripts: Use fixed input and output files instead of pipe for here-doc
5 here-doc
6 5
7There was a bug of "as" in binutils that when it checks if the input file and 6There was a bug of "as" in binutils that when it checks if the input file and
8output file are the same one, it would not check if they are on the same block 7output file are the same one, it would not check if they are on the same block
@@ -44,14 +43,14 @@ Signed-off-by: He Zhe <zhe.he@windriver.com>
44 1 file changed, 4 insertions(+), 1 deletion(-) 43 1 file changed, 4 insertions(+), 1 deletion(-)
45 44
46diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh 45diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh
47index 083c526..8dfac55 100755 46index 8b980fb22..d256a9438 100755
48--- a/scripts/gcc-goto.sh 47--- a/scripts/gcc-goto.sh
49+++ b/scripts/gcc-goto.sh 48+++ b/scripts/gcc-goto.sh
50@@ -3,7 +3,7 @@ 49@@ -3,7 +3,7 @@
51 # Test for gcc 'asm goto' support 50 # Test for gcc 'asm goto' support
52 # Copyright (C) 2010, Jason Baron <jbaron@redhat.com> 51 # Copyright (C) 2010, Jason Baron <jbaron@redhat.com>
53 52
54-cat << "END" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y" 53-cat << "END" | $@ -x c - -fno-PIE -c -o /dev/null
55+cat << "END" > ./input 54+cat << "END" > ./input
56 int main(void) 55 int main(void)
57 { 56 {
@@ -61,8 +60,8 @@ index 083c526..8dfac55 100755
61 } 60 }
62 END 61 END
63+ 62+
64+$@ -x c ./input -c -o ./output && echo "y" 63+$@ -x c ./input -fno-PIE -c -o ./output
65+rm ./input ./output 64+rm ./input ./output
66-- 65--
672.7.4 662.19.1
68 67
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-arm64-sve-ptrace-Fix-SVE_PT_REGS_OFFSET-definition.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-arm64-sve-ptrace-Fix-SVE_PT_REGS_OFFSET-definition.patch
deleted file mode 100644
index 462fdba2ed..0000000000
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-arm64-sve-ptrace-Fix-SVE_PT_REGS_OFFSET-definition.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 0dede80d25ae2005f8af7235809fc09a7c47c62e Mon Sep 17 00:00:00 2001
2From: Dave Martin <Dave.Martin@arm.com>
3Date: Tue, 11 Dec 2018 19:26:46 +0000
4Subject: [PATCH 2/3] arm64/sve: ptrace: Fix SVE_PT_REGS_OFFSET definition
5
6SVE_PT_REGS_OFFSET is supposed to indicate the offset for skipping
7over the ptrace NT_ARM_SVE header (struct user_sve_header) to the
8start of the SVE register data proper.
9
10However, currently SVE_PT_REGS_OFFSET is defined in terms of struct
11sve_context, which is wrong: that structure describes the SVE
12header in the signal frame, not in the ptrace regset.
13
14This patch fixes the definition to use the ptrace header structure
15struct user_sve_header instead.
16
17By good fortune, the to structures are the same size anyway, so
18there is no functional or ABI change.
19
20Signed-off-by: Dave Martin <Dave.Martin@arm.com>
21Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
22
23Upstream-Status: Submitted [https://www.spinics.net/lists/arm-kernel/msg694800.html]
24---
25 arch/arm64/include/uapi/asm/ptrace.h | 2 +-
26 1 file changed, 1 insertion(+), 1 deletion(-)
27
28diff --git a/arch/arm64/include/uapi/asm/ptrace.h b/arch/arm64/include/uapi/asm/ptrace.h
29index 98c4ce55d9c3..ad64d2c92ef5 100644
30--- a/arch/arm64/include/uapi/asm/ptrace.h
31+++ b/arch/arm64/include/uapi/asm/ptrace.h
32@@ -130,7 +130,7 @@ struct user_sve_header {
33
34 /* Offset from the start of struct user_sve_header to the register data */
35 #define SVE_PT_REGS_OFFSET \
36- ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) \
37+ ((sizeof(struct user_sve_header) + (SVE_VQ_BYTES - 1)) \
38 / SVE_VQ_BYTES * SVE_VQ_BYTES)
39
40 /*
41--
422.5.0
43
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-arm64-sve-Disentangle-uapi-asm-ptrace.h-from-uapi-as.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-arm64-sve-Disentangle-uapi-asm-ptrace.h-from-uapi-as.patch
deleted file mode 100644
index 0423f0f2cc..0000000000
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-arm64-sve-Disentangle-uapi-asm-ptrace.h-from-uapi-as.patch
+++ /dev/null
@@ -1,289 +0,0 @@
1From 1114697c04b9699112e78dd8fc6ec849609ca1cb Mon Sep 17 00:00:00 2001
2From: Dave Martin <Dave.Martin@arm.com>
3Date: Tue, 11 Dec 2018 19:26:47 +0000
4Subject: [PATCH 3/3] arm64/sve: Disentangle <uapi/asm/ptrace.h> from
5 <uapi/asm/sigcontext.h>
6
7Currently, <uapi/asm/sigcontext.h> provides common definitions for
8describing SVE context structures that are also used by the ptrace
9definitions in <uapi/asm/ptrace.h>.
10
11For this reason, a #include of <asm/sigcontext.h> was added in
12ptrace.h, but it this turns out that this can interact badly with
13userspace code that tries to include ptrace.h on top of the libc
14headers (which may provide their own shadow definitions for
15sigcontext.h).
16
17To make the headers easier for userspace to consume, this patch
18bounces the common definitions into an __SVE_* namespace and moves
19them to a backend header <uapi/asm/sve_context.h> that can be
20included by the other headers as appropriate. This should allow
21ptrace.h to be used alongside libc's sigcontext.h (if any) without
22ill effects.
23
24This should make the situation unambiguous: <asm/sigcontext.h> is
25the header to include for the sigframe-specific definitions, while
26<asm/ptrace.h> is the header to include for ptrace-specific
27definitions.
28
29To avoid conflicting with existing usage, <asm/sigcontext.h>
30remains the canonical way to get the common definitions for
31SVE_VQ_MIN, sve_vq_from_vl() etc., both in userspace and in the
32kernel: relying on these being defined as a side effect of
33including just <asm/ptrace.h> was never intended to be safe.
34
35Signed-off-by: Dave Martin <Dave.Martin@arm.com>
36Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
37
38Upstream-Status: Submitted [https://www.spinics.net/lists/arm-kernel/msg694800.html]
39---
40 arch/arm64/include/uapi/asm/ptrace.h | 39 ++++++++++-----------
41 arch/arm64/include/uapi/asm/sigcontext.h | 56 +++++++++++++++----------------
42 arch/arm64/include/uapi/asm/sve_context.h | 50 +++++++++++++++++++++++++++
43 3 files changed, 96 insertions(+), 49 deletions(-)
44 create mode 100644 arch/arm64/include/uapi/asm/sve_context.h
45
46diff --git a/arch/arm64/include/uapi/asm/ptrace.h b/arch/arm64/include/uapi/asm/ptrace.h
47index ad64d2c92ef5..81547c3a95a3 100644
48--- a/arch/arm64/include/uapi/asm/ptrace.h
49+++ b/arch/arm64/include/uapi/asm/ptrace.h
50@@ -23,7 +23,7 @@
51 #include <linux/types.h>
52
53 #include <asm/hwcap.h>
54-#include <asm/sigcontext.h>
55+#include <asm/sve_context.h>
56
57
58 /*
59@@ -129,9 +129,9 @@ struct user_sve_header {
60 */
61
62 /* Offset from the start of struct user_sve_header to the register data */
63-#define SVE_PT_REGS_OFFSET \
64- ((sizeof(struct user_sve_header) + (SVE_VQ_BYTES - 1)) \
65- / SVE_VQ_BYTES * SVE_VQ_BYTES)
66+#define SVE_PT_REGS_OFFSET \
67+ ((sizeof(struct user_sve_header) + (__SVE_VQ_BYTES - 1)) \
68+ / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
69
70 /*
71 * The register data content and layout depends on the value of the
72@@ -177,39 +177,36 @@ struct user_sve_header {
73 * Additional data might be appended in the future.
74 */
75
76-#define SVE_PT_SVE_ZREG_SIZE(vq) SVE_SIG_ZREG_SIZE(vq)
77-#define SVE_PT_SVE_PREG_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
78-#define SVE_PT_SVE_FFR_SIZE(vq) SVE_SIG_FFR_SIZE(vq)
79+#define SVE_PT_SVE_ZREG_SIZE(vq) __SVE_ZREG_SIZE(vq)
80+#define SVE_PT_SVE_PREG_SIZE(vq) __SVE_PREG_SIZE(vq)
81+#define SVE_PT_SVE_FFR_SIZE(vq) __SVE_FFR_SIZE(vq)
82 #define SVE_PT_SVE_FPSR_SIZE sizeof(__u32)
83 #define SVE_PT_SVE_FPCR_SIZE sizeof(__u32)
84
85-#define __SVE_SIG_TO_PT(offset) \
86- ((offset) - SVE_SIG_REGS_OFFSET + SVE_PT_REGS_OFFSET)
87-
88 #define SVE_PT_SVE_OFFSET SVE_PT_REGS_OFFSET
89
90 #define SVE_PT_SVE_ZREGS_OFFSET \
91- __SVE_SIG_TO_PT(SVE_SIG_ZREGS_OFFSET)
92+ (SVE_PT_REGS_OFFSET + __SVE_ZREGS_OFFSET)
93 #define SVE_PT_SVE_ZREG_OFFSET(vq, n) \
94- __SVE_SIG_TO_PT(SVE_SIG_ZREG_OFFSET(vq, n))
95+ (SVE_PT_REGS_OFFSET + __SVE_ZREG_OFFSET(vq, n))
96 #define SVE_PT_SVE_ZREGS_SIZE(vq) \
97- (SVE_PT_SVE_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_PT_SVE_ZREGS_OFFSET)
98+ (SVE_PT_SVE_ZREG_OFFSET(vq, __SVE_NUM_ZREGS) - SVE_PT_SVE_ZREGS_OFFSET)
99
100 #define SVE_PT_SVE_PREGS_OFFSET(vq) \
101- __SVE_SIG_TO_PT(SVE_SIG_PREGS_OFFSET(vq))
102+ (SVE_PT_REGS_OFFSET + __SVE_PREGS_OFFSET(vq))
103 #define SVE_PT_SVE_PREG_OFFSET(vq, n) \
104- __SVE_SIG_TO_PT(SVE_SIG_PREG_OFFSET(vq, n))
105+ (SVE_PT_REGS_OFFSET + __SVE_PREG_OFFSET(vq, n))
106 #define SVE_PT_SVE_PREGS_SIZE(vq) \
107- (SVE_PT_SVE_PREG_OFFSET(vq, SVE_NUM_PREGS) - \
108+ (SVE_PT_SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - \
109 SVE_PT_SVE_PREGS_OFFSET(vq))
110
111 #define SVE_PT_SVE_FFR_OFFSET(vq) \
112- __SVE_SIG_TO_PT(SVE_SIG_FFR_OFFSET(vq))
113+ (SVE_PT_REGS_OFFSET + __SVE_FFR_OFFSET(vq))
114
115 #define SVE_PT_SVE_FPSR_OFFSET(vq) \
116 ((SVE_PT_SVE_FFR_OFFSET(vq) + SVE_PT_SVE_FFR_SIZE(vq) + \
117- (SVE_VQ_BYTES - 1)) \
118- / SVE_VQ_BYTES * SVE_VQ_BYTES)
119+ (__SVE_VQ_BYTES - 1)) \
120+ / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
121 #define SVE_PT_SVE_FPCR_OFFSET(vq) \
122 (SVE_PT_SVE_FPSR_OFFSET(vq) + SVE_PT_SVE_FPSR_SIZE)
123
124@@ -220,8 +217,8 @@ struct user_sve_header {
125
126 #define SVE_PT_SVE_SIZE(vq, flags) \
127 ((SVE_PT_SVE_FPCR_OFFSET(vq) + SVE_PT_SVE_FPCR_SIZE \
128- - SVE_PT_SVE_OFFSET + (SVE_VQ_BYTES - 1)) \
129- / SVE_VQ_BYTES * SVE_VQ_BYTES)
130+ - SVE_PT_SVE_OFFSET + (__SVE_VQ_BYTES - 1)) \
131+ / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
132
133 #define SVE_PT_SIZE(vq, flags) \
134 (((flags) & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE ? \
135diff --git a/arch/arm64/include/uapi/asm/sigcontext.h b/arch/arm64/include/uapi/asm/sigcontext.h
136index dca8f8b5168b..5f3c0cec5af9 100644
137--- a/arch/arm64/include/uapi/asm/sigcontext.h
138+++ b/arch/arm64/include/uapi/asm/sigcontext.h
139@@ -130,6 +130,8 @@ struct sve_context {
140
141 #endif /* !__ASSEMBLY__ */
142
143+#include <asm/sve_context.h>
144+
145 /*
146 * The SVE architecture leaves space for future expansion of the
147 * vector length beyond its initial architectural limit of 2048 bits
148@@ -138,21 +140,20 @@ struct sve_context {
149 * See linux/Documentation/arm64/sve.txt for a description of the VL/VQ
150 * terminology.
151 */
152-#define SVE_VQ_BYTES 16 /* number of bytes per quadword */
153+#define SVE_VQ_BYTES __SVE_VQ_BYTES /* bytes per quadword */
154
155-#define SVE_VQ_MIN 1
156-#define SVE_VQ_MAX 512
157+#define SVE_VQ_MIN __SVE_VQ_MIN
158+#define SVE_VQ_MAX __SVE_VQ_MAX
159
160-#define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
161-#define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
162+#define SVE_VL_MIN __SVE_VL_MIN
163+#define SVE_VL_MAX __SVE_VL_MAX
164
165-#define SVE_NUM_ZREGS 32
166-#define SVE_NUM_PREGS 16
167+#define SVE_NUM_ZREGS __SVE_NUM_ZREGS
168+#define SVE_NUM_PREGS __SVE_NUM_PREGS
169
170-#define sve_vl_valid(vl) \
171- ((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
172-#define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES)
173-#define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES)
174+#define sve_vl_valid(vl) __sve_vl_valid(vl)
175+#define sve_vq_from_vl(vl) __sve_vq_from_vl(vl)
176+#define sve_vl_from_vq(vq) __sve_vl_from_vq(vq)
177
178 /*
179 * If the SVE registers are currently live for the thread at signal delivery,
180@@ -205,34 +206,33 @@ struct sve_context {
181 * Additional data might be appended in the future.
182 */
183
184-#define SVE_SIG_ZREG_SIZE(vq) ((__u32)(vq) * SVE_VQ_BYTES)
185-#define SVE_SIG_PREG_SIZE(vq) ((__u32)(vq) * (SVE_VQ_BYTES / 8))
186-#define SVE_SIG_FFR_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
187+#define SVE_SIG_ZREG_SIZE(vq) __SVE_ZREG_SIZE(vq)
188+#define SVE_SIG_PREG_SIZE(vq) __SVE_PREG_SIZE(vq)
189+#define SVE_SIG_FFR_SIZE(vq) __SVE_FFR_SIZE(vq)
190
191 #define SVE_SIG_REGS_OFFSET \
192- ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) \
193- / SVE_VQ_BYTES * SVE_VQ_BYTES)
194+ ((sizeof(struct sve_context) + (__SVE_VQ_BYTES - 1)) \
195+ / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
196
197-#define SVE_SIG_ZREGS_OFFSET SVE_SIG_REGS_OFFSET
198+#define SVE_SIG_ZREGS_OFFSET \
199+ (SVE_SIG_REGS_OFFSET + __SVE_ZREGS_OFFSET)
200 #define SVE_SIG_ZREG_OFFSET(vq, n) \
201- (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))
202-#define SVE_SIG_ZREGS_SIZE(vq) \
203- (SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)
204+ (SVE_SIG_REGS_OFFSET + __SVE_ZREG_OFFSET(vq, n))
205+#define SVE_SIG_ZREGS_SIZE(vq) __SVE_ZREGS_SIZE(vq)
206
207 #define SVE_SIG_PREGS_OFFSET(vq) \
208- (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))
209+ (SVE_SIG_REGS_OFFSET + __SVE_PREGS_OFFSET(vq))
210 #define SVE_SIG_PREG_OFFSET(vq, n) \
211- (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))
212-#define SVE_SIG_PREGS_SIZE(vq) \
213- (SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))
214+ (SVE_SIG_REGS_OFFSET + __SVE_PREG_OFFSET(vq, n))
215+#define SVE_SIG_PREGS_SIZE(vq) __SVE_PREGS_SIZE(vq)
216
217 #define SVE_SIG_FFR_OFFSET(vq) \
218- (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))
219+ (SVE_SIG_REGS_OFFSET + __SVE_FFR_OFFSET(vq))
220
221 #define SVE_SIG_REGS_SIZE(vq) \
222- (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
223-
224-#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
225+ (__SVE_FFR_OFFSET(vq) + __SVE_FFR_SIZE(vq))
226
227+#define SVE_SIG_CONTEXT_SIZE(vq) \
228+ (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
229
230 #endif /* _UAPI__ASM_SIGCONTEXT_H */
231diff --git a/arch/arm64/include/uapi/asm/sve_context.h b/arch/arm64/include/uapi/asm/sve_context.h
232new file mode 100644
233index 000000000000..140f14c318a5
234--- /dev/null
235+++ b/arch/arm64/include/uapi/asm/sve_context.h
236@@ -0,0 +1,50 @@
237+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
238+/* Copyright (C) 2017-2018 ARM Limited */
239+
240+#if !defined(_UAPI__ASM_PTRACE_H) && !defined(_UAPI__ASM_SIGCONTEXT_H)
241+#error "Do not include this header or use its definitions directly."
242+#endif
243+
244+#ifndef _UAPI__ASM_SVE_CONTEXT_H
245+#define _UAPI__ASM_SVE_CONTEXT_H
246+
247+#define __SVE_VQ_BYTES 16 /* number of bytes per quadword */
248+
249+#define __SVE_VQ_MIN 1
250+#define __SVE_VQ_MAX 512
251+
252+#define __SVE_VL_MIN (__SVE_VQ_MIN * __SVE_VQ_BYTES)
253+#define __SVE_VL_MAX (__SVE_VQ_MAX * __SVE_VQ_BYTES)
254+
255+#define __SVE_NUM_ZREGS 32
256+#define __SVE_NUM_PREGS 16
257+
258+#define __sve_vl_valid(vl) \
259+ ((vl) % __SVE_VQ_BYTES == 0 && \
260+ (vl) >= __SVE_VL_MIN && \
261+ (vl) <= __SVE_VL_MAX)
262+
263+#define __sve_vq_from_vl(vl) ((vl) / __SVE_VQ_BYTES)
264+#define __sve_vl_from_vq(vq) ((vq) * __SVE_VQ_BYTES)
265+
266+#define __SVE_ZREG_SIZE(vq) ((__u32)(vq) * __SVE_VQ_BYTES)
267+#define __SVE_PREG_SIZE(vq) ((__u32)(vq) * (__SVE_VQ_BYTES / 8))
268+#define __SVE_FFR_SIZE(vq) __SVE_PREG_SIZE(vq)
269+
270+#define __SVE_ZREGS_OFFSET 0
271+#define __SVE_ZREG_OFFSET(vq, n) \
272+ (__SVE_ZREGS_OFFSET + __SVE_ZREG_SIZE(vq) * (n))
273+#define __SVE_ZREGS_SIZE(vq) \
274+ (__SVE_ZREG_OFFSET(vq, __SVE_NUM_ZREGS) - __SVE_ZREGS_OFFSET)
275+
276+#define __SVE_PREGS_OFFSET(vq) \
277+ (__SVE_ZREGS_OFFSET + __SVE_ZREGS_SIZE(vq))
278+#define __SVE_PREG_OFFSET(vq, n) \
279+ (__SVE_PREGS_OFFSET(vq) + __SVE_PREG_SIZE(vq) * (n))
280+#define __SVE_PREGS_SIZE(vq) \
281+ (__SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - __SVE_PREGS_OFFSET(vq))
282+
283+#define __SVE_FFR_OFFSET(vq) \
284+ (__SVE_PREGS_OFFSET(vq) + __SVE_PREGS_SIZE(vq))
285+
286+#endif /* ! _UAPI__ASM_SVE_CONTEXT_H */
287--
2882.5.0
289
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.19.bb b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_5.0.bb
index 48f25ebc1a..e76120c5b8 100644
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.19.bb
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_5.0.bb
@@ -10,12 +10,9 @@ SRC_URI_append_libc-musl = "\
10 " 10 "
11 11
12SRC_URI_append = "\ 12SRC_URI_append = "\
13 file://0001-net-Use-__kernel_clockid_t-in-uapi-net_stamp.h.patch \
14 file://0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch \ 13 file://0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch \
15 file://0001-kbuild-install_headers.sh-Strip-_UAPI-from-if-define.patch \ 14 file://0001-kbuild-install_headers.sh-Strip-_UAPI-from-if-define.patch \
16 file://0002-arm64-sve-ptrace-Fix-SVE_PT_REGS_OFFSET-definition.patch \
17 file://0003-arm64-sve-Disentangle-uapi-asm-ptrace.h-from-uapi-as.patch \
18" 15"
19 16
20SRC_URI[md5sum] = "740a90cf810c2105df8ee12e5d0bb900" 17SRC_URI[md5sum] = "7381ce8aac80a01448e065ce795c19c0"
21SRC_URI[sha256sum] = "0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1" 18SRC_URI[sha256sum] = "437b141a6499159f5a7282d5eb4b2be055f8e862ccce44d7464e8759c31a2e43"