From: Greg Kroah-Hartman Date: Fri, 17 May 2019 14:53:05 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.9.178~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a132615741333adfc95cfb0b507d37bc3ebb04fd;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: bpf-arm64-remove-prefetch-insn-in-xadd-mapping.patch --- diff --git a/queue-4.14/bpf-arm64-remove-prefetch-insn-in-xadd-mapping.patch b/queue-4.14/bpf-arm64-remove-prefetch-insn-in-xadd-mapping.patch new file mode 100644 index 00000000000..6ad4b8d55a1 --- /dev/null +++ b/queue-4.14/bpf-arm64-remove-prefetch-insn-in-xadd-mapping.patch @@ -0,0 +1,53 @@ +From 8968c67a82ab7501bc3b9439c3624a49b42fe54c Mon Sep 17 00:00:00 2001 +From: Daniel Borkmann +Date: Fri, 26 Apr 2019 21:48:21 +0200 +Subject: bpf, arm64: remove prefetch insn in xadd mapping + +From: Daniel Borkmann + +commit 8968c67a82ab7501bc3b9439c3624a49b42fe54c upstream. + +Prefetch-with-intent-to-write is currently part of the XADD mapping in +the AArch64 JIT and follows the kernel's implementation of atomic_add. +This may interfere with other threads executing the LDXR/STXR loop, +leading to potential starvation and fairness issues. Drop the optional +prefetch instruction. + +Fixes: 85f68fe89832 ("bpf, arm64: implement jiting of BPF_XADD") +Reported-by: Will Deacon +Signed-off-by: Daniel Borkmann +Acked-by: Jean-Philippe Brucker +Acked-by: Will Deacon +Signed-off-by: Alexei Starovoitov +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/net/bpf_jit.h | 6 ------ + arch/arm64/net/bpf_jit_comp.c | 1 - + 2 files changed, 7 deletions(-) + +--- a/arch/arm64/net/bpf_jit.h ++++ b/arch/arm64/net/bpf_jit.h +@@ -100,12 +100,6 @@ + #define A64_STXR(sf, Rt, Rn, Rs) \ + A64_LSX(sf, Rt, Rn, Rs, STORE_EX) + +-/* Prefetch */ +-#define A64_PRFM(Rn, type, target, policy) \ +- aarch64_insn_gen_prefetch(Rn, AARCH64_INSN_PRFM_TYPE_##type, \ +- AARCH64_INSN_PRFM_TARGET_##target, \ +- AARCH64_INSN_PRFM_POLICY_##policy) +- + /* Add/subtract (immediate) */ + #define A64_ADDSUB_IMM(sf, Rd, Rn, imm12, type) \ + aarch64_insn_gen_add_sub_imm(Rd, Rn, imm12, \ +--- a/arch/arm64/net/bpf_jit_comp.c ++++ b/arch/arm64/net/bpf_jit_comp.c +@@ -712,7 +712,6 @@ emit_cond_jmp: + case BPF_STX | BPF_XADD | BPF_DW: + emit_a64_mov_i(1, tmp, off, ctx); + emit(A64_ADD(1, tmp, tmp, dst), ctx); +- emit(A64_PRFM(tmp, PST, L1, STRM), ctx); + emit(A64_LDXR(isdw, tmp2, tmp), ctx); + emit(A64_ADD(isdw, tmp2, tmp2, src), ctx); + emit(A64_STXR(isdw, tmp2, tmp, tmp3), ctx); diff --git a/queue-4.14/series b/queue-4.14/series index f961062ee53..d8cf46f2c80 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -28,3 +28,4 @@ alsa-hda-hdmi-consider-eld_valid-when-reporting-jack-event.patch alsa-hda-realtek-eapd-turn-on-later.patch asoc-max98090-fix-restore-of-dapm-muxes.patch asoc-rt5677-spi-disable-16bit-spi-transfers.patch +bpf-arm64-remove-prefetch-insn-in-xadd-mapping.patch