powerpc/bpf: Emit stf barrier instruction sequences for BPF_NOSPEC
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Tue, 5 Oct 2021 20:25:25 +0000 (01:55 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 7 Oct 2021 08:52:58 +0000 (19:52 +1100)
commitb7540d62509453263604a155bf2d5f0ed450cba2
tree25f51a15315b793e279b95a98184101f0caecdc3
parent030905920f32e91a52794937f67434ac0b3ea41a
powerpc/bpf: Emit stf barrier instruction sequences for BPF_NOSPEC

Emit similar instruction sequences to commit a048a07d7f4535
("powerpc/64s: Add support for a store forwarding barrier at kernel
entry/exit") when encountering BPF_NOSPEC.

Mitigations are enabled depending on what the firmware advertises. In
particular, we do not gate these mitigations based on current settings,
just like in x86. Due to this, we don't need to take any action if
mitigations are enabled or disabled at runtime.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/956570cbc191cd41f8274bed48ee757a86dac62a.1633464148.git.naveen.n.rao@linux.vnet.ibm.com
arch/powerpc/net/bpf_jit64.h
arch/powerpc/net/bpf_jit_comp64.c