1 |
commit: 9621e494be6f61e731e0163eb9e40c372b44843b |
2 |
Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Apr 16 11:13:21 2021 +0000 |
4 |
Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 16 11:13:41 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=9621e494 |
7 |
|
8 |
Linux patch 5.4.113 |
9 |
|
10 |
Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1112_linux-5.4.113.patch | 482 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 486 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 467a33d..4792b10 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -491,6 +491,10 @@ Patch: 1111_linux-5.4.112.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.4.112 |
23 |
|
24 |
+Patch: 1112_linux-5.4.113.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.4.113 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1112_linux-5.4.113.patch b/1112_linux-5.4.113.patch |
33 |
new file mode 100644 |
34 |
index 0000000..fa0b887 |
35 |
--- /dev/null |
36 |
+++ b/1112_linux-5.4.113.patch |
37 |
@@ -0,0 +1,482 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index ba8ee5e806627..7fe00a93c870c 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 4 |
46 |
+-SUBLEVEL = 112 |
47 |
++SUBLEVEL = 113 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Kleptomaniac Octopus |
50 |
+ |
51 |
+diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h |
52 |
+index a4ffd9b55e72c..9be64c0ad31f6 100644 |
53 |
+--- a/arch/arm64/include/asm/kvm_arm.h |
54 |
++++ b/arch/arm64/include/asm/kvm_arm.h |
55 |
+@@ -276,6 +276,7 @@ |
56 |
+ #define CPTR_EL2_DEFAULT CPTR_EL2_RES1 |
57 |
+ |
58 |
+ /* Hyp Debug Configuration Register bits */ |
59 |
++#define MDCR_EL2_TTRF (1 << 19) |
60 |
+ #define MDCR_EL2_TPMS (1 << 14) |
61 |
+ #define MDCR_EL2_E2PB_MASK (UL(0x3)) |
62 |
+ #define MDCR_EL2_E2PB_SHIFT (UL(12)) |
63 |
+diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c |
64 |
+index 79caab15ccbf7..acdef8d76c64d 100644 |
65 |
+--- a/arch/arm64/kernel/cpufeature.c |
66 |
++++ b/arch/arm64/kernel/cpufeature.c |
67 |
+@@ -277,7 +277,6 @@ static const struct arm64_ftr_bits ftr_id_aa64dfr0[] = { |
68 |
+ * of support. |
69 |
+ */ |
70 |
+ S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_EXACT, ID_AA64DFR0_PMUVER_SHIFT, 4, 0), |
71 |
+- ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, ID_AA64DFR0_TRACEVER_SHIFT, 4, 0), |
72 |
+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, ID_AA64DFR0_DEBUGVER_SHIFT, 4, 0x6), |
73 |
+ ARM64_FTR_END, |
74 |
+ }; |
75 |
+diff --git a/arch/arm64/kvm/debug.c b/arch/arm64/kvm/debug.c |
76 |
+index 7a7e425616b54..dbc8905116311 100644 |
77 |
+--- a/arch/arm64/kvm/debug.c |
78 |
++++ b/arch/arm64/kvm/debug.c |
79 |
+@@ -89,6 +89,7 @@ void kvm_arm_reset_debug_ptr(struct kvm_vcpu *vcpu) |
80 |
+ * - Debug ROM Address (MDCR_EL2_TDRA) |
81 |
+ * - OS related registers (MDCR_EL2_TDOSA) |
82 |
+ * - Statistical profiler (MDCR_EL2_TPMS/MDCR_EL2_E2PB) |
83 |
++ * - Self-hosted Trace Filter controls (MDCR_EL2_TTRF) |
84 |
+ * |
85 |
+ * Additionally, KVM only traps guest accesses to the debug registers if |
86 |
+ * the guest is not actively using them (see the KVM_ARM64_DEBUG_DIRTY |
87 |
+@@ -112,6 +113,7 @@ void kvm_arm_setup_debug(struct kvm_vcpu *vcpu) |
88 |
+ vcpu->arch.mdcr_el2 = __this_cpu_read(mdcr_el2) & MDCR_EL2_HPMN_MASK; |
89 |
+ vcpu->arch.mdcr_el2 |= (MDCR_EL2_TPM | |
90 |
+ MDCR_EL2_TPMS | |
91 |
++ MDCR_EL2_TTRF | |
92 |
+ MDCR_EL2_TPMCR | |
93 |
+ MDCR_EL2_TDRA | |
94 |
+ MDCR_EL2_TDOSA); |
95 |
+diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S |
96 |
+index 8ca4798311429..9c87ae77ad5d3 100644 |
97 |
+--- a/arch/riscv/kernel/entry.S |
98 |
++++ b/arch/riscv/kernel/entry.S |
99 |
+@@ -387,6 +387,7 @@ ENTRY(__switch_to) |
100 |
+ ENDPROC(__switch_to) |
101 |
+ |
102 |
+ .section ".rodata" |
103 |
++ .align LGREG |
104 |
+ /* Exception vector table */ |
105 |
+ ENTRY(excp_vect_table) |
106 |
+ RISCV_PTR do_trap_insn_misaligned |
107 |
+diff --git a/block/bio.c b/block/bio.c |
108 |
+index 24704bc2ad6f1..cb38d6f3acceb 100644 |
109 |
+--- a/block/bio.c |
110 |
++++ b/block/bio.c |
111 |
+@@ -305,7 +305,7 @@ static struct bio *__bio_chain_endio(struct bio *bio) |
112 |
+ { |
113 |
+ struct bio *parent = bio->bi_private; |
114 |
+ |
115 |
+- if (!parent->bi_status) |
116 |
++ if (bio->bi_status && !parent->bi_status) |
117 |
+ parent->bi_status = bio->bi_status; |
118 |
+ bio_put(bio); |
119 |
+ return parent; |
120 |
+diff --git a/drivers/base/dd.c b/drivers/base/dd.c |
121 |
+index 32823f36cffd0..cf7e5b4afc1be 100644 |
122 |
+--- a/drivers/base/dd.c |
123 |
++++ b/drivers/base/dd.c |
124 |
+@@ -300,14 +300,16 @@ int driver_deferred_probe_check_state_continue(struct device *dev) |
125 |
+ |
126 |
+ static void deferred_probe_timeout_work_func(struct work_struct *work) |
127 |
+ { |
128 |
+- struct device_private *private, *p; |
129 |
++ struct device_private *p; |
130 |
+ |
131 |
+ deferred_probe_timeout = 0; |
132 |
+ driver_deferred_probe_trigger(); |
133 |
+ flush_work(&deferred_probe_work); |
134 |
+ |
135 |
+- list_for_each_entry_safe(private, p, &deferred_probe_pending_list, deferred_probe) |
136 |
+- dev_info(private->device, "deferred probe pending"); |
137 |
++ mutex_lock(&deferred_probe_mutex); |
138 |
++ list_for_each_entry(p, &deferred_probe_pending_list, deferred_probe) |
139 |
++ dev_info(p->device, "deferred probe pending\n"); |
140 |
++ mutex_unlock(&deferred_probe_mutex); |
141 |
+ } |
142 |
+ static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_work_func); |
143 |
+ |
144 |
+diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c |
145 |
+index d6629fc869f3f..116473c2360aa 100644 |
146 |
+--- a/drivers/gpu/drm/imx/imx-ldb.c |
147 |
++++ b/drivers/gpu/drm/imx/imx-ldb.c |
148 |
+@@ -197,6 +197,11 @@ static void imx_ldb_encoder_enable(struct drm_encoder *encoder) |
149 |
+ int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN; |
150 |
+ int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder); |
151 |
+ |
152 |
++ if (mux < 0 || mux >= ARRAY_SIZE(ldb->clk_sel)) { |
153 |
++ dev_warn(ldb->dev, "%s: invalid mux %d\n", __func__, mux); |
154 |
++ return; |
155 |
++ } |
156 |
++ |
157 |
+ drm_panel_prepare(imx_ldb_ch->panel); |
158 |
+ |
159 |
+ if (dual) { |
160 |
+@@ -255,6 +260,11 @@ imx_ldb_encoder_atomic_mode_set(struct drm_encoder *encoder, |
161 |
+ int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder); |
162 |
+ u32 bus_format = imx_ldb_ch->bus_format; |
163 |
+ |
164 |
++ if (mux < 0 || mux >= ARRAY_SIZE(ldb->clk_sel)) { |
165 |
++ dev_warn(ldb->dev, "%s: invalid mux %d\n", __func__, mux); |
166 |
++ return; |
167 |
++ } |
168 |
++ |
169 |
+ if (mode->clock > 170000) { |
170 |
+ dev_warn(ldb->dev, |
171 |
+ "%s: mode exceeds 170 MHz pixel clock\n", __func__); |
172 |
+diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c |
173 |
+index fbf57bc3cdaba..617cbe468aec4 100644 |
174 |
+--- a/drivers/gpu/drm/tegra/dc.c |
175 |
++++ b/drivers/gpu/drm/tegra/dc.c |
176 |
+@@ -1667,6 +1667,11 @@ static void tegra_dc_commit_state(struct tegra_dc *dc, |
177 |
+ dev_err(dc->dev, |
178 |
+ "failed to set clock rate to %lu Hz\n", |
179 |
+ state->pclk); |
180 |
++ |
181 |
++ err = clk_set_rate(dc->clk, state->pclk); |
182 |
++ if (err < 0) |
183 |
++ dev_err(dc->dev, "failed to set clock %pC to %lu Hz: %d\n", |
184 |
++ dc->clk, state->pclk, err); |
185 |
+ } |
186 |
+ |
187 |
+ DRM_DEBUG_KMS("rate: %lu, div: %u\n", clk_get_rate(dc->clk), |
188 |
+@@ -1677,11 +1682,6 @@ static void tegra_dc_commit_state(struct tegra_dc *dc, |
189 |
+ value = SHIFT_CLK_DIVIDER(state->div) | PIXEL_CLK_DIVIDER_PCD1; |
190 |
+ tegra_dc_writel(dc, value, DC_DISP_DISP_CLOCK_CONTROL); |
191 |
+ } |
192 |
+- |
193 |
+- err = clk_set_rate(dc->clk, state->pclk); |
194 |
+- if (err < 0) |
195 |
+- dev_err(dc->dev, "failed to set clock %pC to %lu Hz: %d\n", |
196 |
+- dc->clk, state->pclk, err); |
197 |
+ } |
198 |
+ |
199 |
+ static void tegra_dc_stop(struct tegra_dc *dc) |
200 |
+diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c |
201 |
+index c498796adc074..e579b3633a842 100644 |
202 |
+--- a/drivers/interconnect/core.c |
203 |
++++ b/drivers/interconnect/core.c |
204 |
+@@ -704,6 +704,8 @@ int icc_link_destroy(struct icc_node *src, struct icc_node *dst) |
205 |
+ GFP_KERNEL); |
206 |
+ if (new) |
207 |
+ src->links = new; |
208 |
++ else |
209 |
++ ret = -ENOMEM; |
210 |
+ |
211 |
+ out: |
212 |
+ mutex_unlock(&icc_lock); |
213 |
+diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c |
214 |
+index 883abc46da6e2..9cc77f0397797 100644 |
215 |
+--- a/drivers/xen/events/events_base.c |
216 |
++++ b/drivers/xen/events/events_base.c |
217 |
+@@ -1783,7 +1783,7 @@ static void lateeoi_ack_dynirq(struct irq_data *data) |
218 |
+ |
219 |
+ if (VALID_EVTCHN(evtchn)) { |
220 |
+ do_mask(info, EVT_MASK_REASON_EOI_PENDING); |
221 |
+- event_handler_exit(info); |
222 |
++ ack_dynirq(data); |
223 |
+ } |
224 |
+ } |
225 |
+ |
226 |
+@@ -1794,7 +1794,7 @@ static void lateeoi_mask_ack_dynirq(struct irq_data *data) |
227 |
+ |
228 |
+ if (VALID_EVTCHN(evtchn)) { |
229 |
+ do_mask(info, EVT_MASK_REASON_EXPLICIT); |
230 |
+- event_handler_exit(info); |
231 |
++ ack_dynirq(data); |
232 |
+ } |
233 |
+ } |
234 |
+ |
235 |
+diff --git a/fs/block_dev.c b/fs/block_dev.c |
236 |
+index 79272cdbe8277..bd93563477a43 100644 |
237 |
+--- a/fs/block_dev.c |
238 |
++++ b/fs/block_dev.c |
239 |
+@@ -246,6 +246,8 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, |
240 |
+ bio.bi_opf = dio_bio_write_op(iocb); |
241 |
+ task_io_account_write(ret); |
242 |
+ } |
243 |
++ if (iocb->ki_flags & IOCB_NOWAIT) |
244 |
++ bio.bi_opf |= REQ_NOWAIT; |
245 |
+ if (iocb->ki_flags & IOCB_HIPRI) |
246 |
+ bio_set_polled(&bio, iocb); |
247 |
+ |
248 |
+@@ -399,6 +401,8 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) |
249 |
+ bio->bi_opf = dio_bio_write_op(iocb); |
250 |
+ task_io_account_write(bio->bi_iter.bi_size); |
251 |
+ } |
252 |
++ if (iocb->ki_flags & IOCB_NOWAIT) |
253 |
++ bio->bi_opf |= REQ_NOWAIT; |
254 |
+ |
255 |
+ dio->size += bio->bi_iter.bi_size; |
256 |
+ pos += bio->bi_iter.bi_size; |
257 |
+diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c |
258 |
+index 50c925d9c6103..9c593fd50c6a5 100644 |
259 |
+--- a/fs/gfs2/super.c |
260 |
++++ b/fs/gfs2/super.c |
261 |
+@@ -757,11 +757,13 @@ void gfs2_freeze_func(struct work_struct *work) |
262 |
+ static int gfs2_freeze(struct super_block *sb) |
263 |
+ { |
264 |
+ struct gfs2_sbd *sdp = sb->s_fs_info; |
265 |
+- int error = 0; |
266 |
++ int error; |
267 |
+ |
268 |
+ mutex_lock(&sdp->sd_freeze_mutex); |
269 |
+- if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN) |
270 |
++ if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN) { |
271 |
++ error = -EBUSY; |
272 |
+ goto out; |
273 |
++ } |
274 |
+ |
275 |
+ if (test_bit(SDF_WITHDRAWN, &sdp->sd_flags)) { |
276 |
+ error = -EINVAL; |
277 |
+@@ -798,10 +800,10 @@ static int gfs2_unfreeze(struct super_block *sb) |
278 |
+ struct gfs2_sbd *sdp = sb->s_fs_info; |
279 |
+ |
280 |
+ mutex_lock(&sdp->sd_freeze_mutex); |
281 |
+- if (atomic_read(&sdp->sd_freeze_state) != SFS_FROZEN || |
282 |
++ if (atomic_read(&sdp->sd_freeze_state) != SFS_FROZEN || |
283 |
+ !gfs2_holder_initialized(&sdp->sd_freeze_gh)) { |
284 |
+ mutex_unlock(&sdp->sd_freeze_mutex); |
285 |
+- return 0; |
286 |
++ return -EINVAL; |
287 |
+ } |
288 |
+ |
289 |
+ gfs2_glock_dq_uninit(&sdp->sd_freeze_gh); |
290 |
+diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c |
291 |
+index f1f78a742b36a..dc7dac676415e 100644 |
292 |
+--- a/net/ipv4/netfilter/arp_tables.c |
293 |
++++ b/net/ipv4/netfilter/arp_tables.c |
294 |
+@@ -1196,6 +1196,8 @@ static int translate_compat_table(struct net *net, |
295 |
+ if (!newinfo) |
296 |
+ goto out_unlock; |
297 |
+ |
298 |
++ memset(newinfo->entries, 0, size); |
299 |
++ |
300 |
+ newinfo->number = compatr->num_entries; |
301 |
+ for (i = 0; i < NF_ARP_NUMHOOKS; i++) { |
302 |
+ newinfo->hook_entry[i] = compatr->hook_entry[i]; |
303 |
+diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c |
304 |
+index 10b91ebdf2131..0076449eea355 100644 |
305 |
+--- a/net/ipv4/netfilter/ip_tables.c |
306 |
++++ b/net/ipv4/netfilter/ip_tables.c |
307 |
+@@ -1430,6 +1430,8 @@ translate_compat_table(struct net *net, |
308 |
+ if (!newinfo) |
309 |
+ goto out_unlock; |
310 |
+ |
311 |
++ memset(newinfo->entries, 0, size); |
312 |
++ |
313 |
+ newinfo->number = compatr->num_entries; |
314 |
+ for (i = 0; i < NF_INET_NUMHOOKS; i++) { |
315 |
+ newinfo->hook_entry[i] = compatr->hook_entry[i]; |
316 |
+diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c |
317 |
+index c973ace208c51..8bb543b0e775e 100644 |
318 |
+--- a/net/ipv6/netfilter/ip6_tables.c |
319 |
++++ b/net/ipv6/netfilter/ip6_tables.c |
320 |
+@@ -1445,6 +1445,8 @@ translate_compat_table(struct net *net, |
321 |
+ if (!newinfo) |
322 |
+ goto out_unlock; |
323 |
+ |
324 |
++ memset(newinfo->entries, 0, size); |
325 |
++ |
326 |
+ newinfo->number = compatr->num_entries; |
327 |
+ for (i = 0; i < NF_INET_NUMHOOKS; i++) { |
328 |
+ newinfo->hook_entry[i] = compatr->hook_entry[i]; |
329 |
+diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c |
330 |
+index 5c35d64d1f342..9cfee6664040f 100644 |
331 |
+--- a/net/netfilter/x_tables.c |
332 |
++++ b/net/netfilter/x_tables.c |
333 |
+@@ -733,7 +733,7 @@ void xt_compat_match_from_user(struct xt_entry_match *m, void **dstptr, |
334 |
+ { |
335 |
+ const struct xt_match *match = m->u.kernel.match; |
336 |
+ struct compat_xt_entry_match *cm = (struct compat_xt_entry_match *)m; |
337 |
+- int pad, off = xt_compat_match_offset(match); |
338 |
++ int off = xt_compat_match_offset(match); |
339 |
+ u_int16_t msize = cm->u.user.match_size; |
340 |
+ char name[sizeof(m->u.user.name)]; |
341 |
+ |
342 |
+@@ -743,9 +743,6 @@ void xt_compat_match_from_user(struct xt_entry_match *m, void **dstptr, |
343 |
+ match->compat_from_user(m->data, cm->data); |
344 |
+ else |
345 |
+ memcpy(m->data, cm->data, msize - sizeof(*cm)); |
346 |
+- pad = XT_ALIGN(match->matchsize) - match->matchsize; |
347 |
+- if (pad > 0) |
348 |
+- memset(m->data + match->matchsize, 0, pad); |
349 |
+ |
350 |
+ msize += off; |
351 |
+ m->u.user.match_size = msize; |
352 |
+@@ -1116,7 +1113,7 @@ void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr, |
353 |
+ { |
354 |
+ const struct xt_target *target = t->u.kernel.target; |
355 |
+ struct compat_xt_entry_target *ct = (struct compat_xt_entry_target *)t; |
356 |
+- int pad, off = xt_compat_target_offset(target); |
357 |
++ int off = xt_compat_target_offset(target); |
358 |
+ u_int16_t tsize = ct->u.user.target_size; |
359 |
+ char name[sizeof(t->u.user.name)]; |
360 |
+ |
361 |
+@@ -1126,9 +1123,6 @@ void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr, |
362 |
+ target->compat_from_user(t->data, ct->data); |
363 |
+ else |
364 |
+ memcpy(t->data, ct->data, tsize - sizeof(*ct)); |
365 |
+- pad = XT_ALIGN(target->targetsize) - target->targetsize; |
366 |
+- if (pad > 0) |
367 |
+- memset(t->data + target->targetsize, 0, pad); |
368 |
+ |
369 |
+ tsize += off; |
370 |
+ t->u.user.target_size = tsize; |
371 |
+diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y |
372 |
+index f9a20a39b64ad..7d226241f1d77 100644 |
373 |
+--- a/tools/perf/util/expr.y |
374 |
++++ b/tools/perf/util/expr.y |
375 |
+@@ -12,7 +12,8 @@ |
376 |
+ #define MAXIDLEN 256 |
377 |
+ %} |
378 |
+ |
379 |
+-%pure-parser |
380 |
++%define api.pure full |
381 |
++ |
382 |
+ %parse-param { double *final_val } |
383 |
+ %parse-param { struct parse_ctx *ctx } |
384 |
+ %parse-param { const char **pp } |
385 |
+diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c |
386 |
+index 4b07b1cc22dc8..571e99c908a0e 100644 |
387 |
+--- a/tools/perf/util/map.c |
388 |
++++ b/tools/perf/util/map.c |
389 |
+@@ -93,8 +93,7 @@ static inline bool replace_android_lib(const char *filename, char *newfilename) |
390 |
+ if (!strncmp(filename, "/system/lib/", 12)) { |
391 |
+ char *ndk, *app; |
392 |
+ const char *arch; |
393 |
+- size_t ndk_length; |
394 |
+- size_t app_length; |
395 |
++ int ndk_length, app_length; |
396 |
+ |
397 |
+ ndk = getenv("NDK_ROOT"); |
398 |
+ app = getenv("APP_PLATFORM"); |
399 |
+@@ -122,8 +121,8 @@ static inline bool replace_android_lib(const char *filename, char *newfilename) |
400 |
+ if (new_length > PATH_MAX) |
401 |
+ return false; |
402 |
+ snprintf(newfilename, new_length, |
403 |
+- "%s/platforms/%s/arch-%s/usr/lib/%s", |
404 |
+- ndk, app, arch, libname); |
405 |
++ "%.*s/platforms/%.*s/arch-%s/usr/lib/%s", |
406 |
++ ndk_length, ndk, app_length, app, arch, libname); |
407 |
+ |
408 |
+ return true; |
409 |
+ } |
410 |
+diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y |
411 |
+index 48126ae4cd13f..776d77093a195 100644 |
412 |
+--- a/tools/perf/util/parse-events.y |
413 |
++++ b/tools/perf/util/parse-events.y |
414 |
+@@ -1,4 +1,4 @@ |
415 |
+-%pure-parser |
416 |
++%define api.pure full |
417 |
+ %parse-param {void *_parse_state} |
418 |
+ %parse-param {void *scanner} |
419 |
+ %lex-param {void* scanner} |
420 |
+diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c |
421 |
+index b21a4b1918db5..56f3039fe2a71 100644 |
422 |
+--- a/tools/perf/util/session.c |
423 |
++++ b/tools/perf/util/session.c |
424 |
+@@ -88,7 +88,7 @@ static int perf_session__process_compressed_event(struct perf_session *session, |
425 |
+ session->decomp_last = decomp; |
426 |
+ } |
427 |
+ |
428 |
+- pr_debug("decomp (B): %ld to %ld\n", src_size, decomp_size); |
429 |
++ pr_debug("decomp (B): %zd to %zd\n", src_size, decomp_size); |
430 |
+ |
431 |
+ return 0; |
432 |
+ } |
433 |
+diff --git a/tools/perf/util/zstd.c b/tools/perf/util/zstd.c |
434 |
+index d2202392ffdbb..48dd2b018c47a 100644 |
435 |
+--- a/tools/perf/util/zstd.c |
436 |
++++ b/tools/perf/util/zstd.c |
437 |
+@@ -99,7 +99,7 @@ size_t zstd_decompress_stream(struct zstd_data *data, void *src, size_t src_size |
438 |
+ while (input.pos < input.size) { |
439 |
+ ret = ZSTD_decompressStream(data->dstream, &output, &input); |
440 |
+ if (ZSTD_isError(ret)) { |
441 |
+- pr_err("failed to decompress (B): %ld -> %ld, dst_size %ld : %s\n", |
442 |
++ pr_err("failed to decompress (B): %zd -> %zd, dst_size %zd : %s\n", |
443 |
+ src_size, output.size, dst_size, ZSTD_getErrorName(ret)); |
444 |
+ break; |
445 |
+ } |
446 |
+diff --git a/tools/testing/radix-tree/idr-test.c b/tools/testing/radix-tree/idr-test.c |
447 |
+index 3b796dd5e5772..6ce7460f3c7a9 100644 |
448 |
+--- a/tools/testing/radix-tree/idr-test.c |
449 |
++++ b/tools/testing/radix-tree/idr-test.c |
450 |
+@@ -301,16 +301,20 @@ void idr_find_test_1(int anchor_id, int throbber_id) |
451 |
+ pthread_t throbber; |
452 |
+ time_t start = time(NULL); |
453 |
+ |
454 |
+- pthread_create(&throbber, NULL, idr_throbber, &throbber_id); |
455 |
+- |
456 |
+ BUG_ON(idr_alloc(&find_idr, xa_mk_value(anchor_id), anchor_id, |
457 |
+ anchor_id + 1, GFP_KERNEL) != anchor_id); |
458 |
+ |
459 |
++ pthread_create(&throbber, NULL, idr_throbber, &throbber_id); |
460 |
++ |
461 |
++ rcu_read_lock(); |
462 |
+ do { |
463 |
+ int id = 0; |
464 |
+ void *entry = idr_get_next(&find_idr, &id); |
465 |
++ rcu_read_unlock(); |
466 |
+ BUG_ON(entry != xa_mk_value(id)); |
467 |
++ rcu_read_lock(); |
468 |
+ } while (time(NULL) < start + 11); |
469 |
++ rcu_read_unlock(); |
470 |
+ |
471 |
+ pthread_join(throbber, NULL); |
472 |
+ |
473 |
+@@ -577,6 +581,7 @@ void ida_tests(void) |
474 |
+ |
475 |
+ int __weak main(void) |
476 |
+ { |
477 |
++ rcu_register_thread(); |
478 |
+ radix_tree_init(); |
479 |
+ idr_checks(); |
480 |
+ ida_tests(); |
481 |
+@@ -584,5 +589,6 @@ int __weak main(void) |
482 |
+ rcu_barrier(); |
483 |
+ if (nr_allocated) |
484 |
+ printf("nr_allocated = %d\n", nr_allocated); |
485 |
++ rcu_unregister_thread(); |
486 |
+ return 0; |
487 |
+ } |
488 |
+diff --git a/tools/testing/radix-tree/multiorder.c b/tools/testing/radix-tree/multiorder.c |
489 |
+index 9eae0fb5a67d1..e00520cc63498 100644 |
490 |
+--- a/tools/testing/radix-tree/multiorder.c |
491 |
++++ b/tools/testing/radix-tree/multiorder.c |
492 |
+@@ -224,7 +224,9 @@ void multiorder_checks(void) |
493 |
+ |
494 |
+ int __weak main(void) |
495 |
+ { |
496 |
++ rcu_register_thread(); |
497 |
+ radix_tree_init(); |
498 |
+ multiorder_checks(); |
499 |
++ rcu_unregister_thread(); |
500 |
+ return 0; |
501 |
+ } |
502 |
+diff --git a/tools/testing/radix-tree/xarray.c b/tools/testing/radix-tree/xarray.c |
503 |
+index e61e43efe463c..f20e12cbbfd40 100644 |
504 |
+--- a/tools/testing/radix-tree/xarray.c |
505 |
++++ b/tools/testing/radix-tree/xarray.c |
506 |
+@@ -25,11 +25,13 @@ void xarray_tests(void) |
507 |
+ |
508 |
+ int __weak main(void) |
509 |
+ { |
510 |
++ rcu_register_thread(); |
511 |
+ radix_tree_init(); |
512 |
+ xarray_tests(); |
513 |
+ radix_tree_cpu_dead(1); |
514 |
+ rcu_barrier(); |
515 |
+ if (nr_allocated) |
516 |
+ printf("nr_allocated = %d\n", nr_allocated); |
517 |
++ rcu_unregister_thread(); |
518 |
+ return 0; |
519 |
+ } |