s390/bpf: Replace ly instruction with llgf

cpu_nr is a 32 bit value and BPF_REG_0 is a 64 bit register, when ly loads
the cpu_nr into BPF_REG_0 it does not zero the upper bits, but llgf does.

Fixes: 9012cf2491 ("s390/bpf: Inline smp_processor_id and current_task")
Signed-off-by: Maxim Khmelevskii <max@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://sashiko.dev/#/patchset/20260414142930.528751-1-max%40linux.ibm.com
Link: https://lore.kernel.org/bpf/20260703125648.919196-5-max@linux.ibm.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
This commit is contained in:
Maxim Khmelevskii 2026-07-03 14:51:35 +02:00 committed by Kumar Kartikeya Dwivedi
parent f66d25468b
commit 5f6cc29993
No known key found for this signature in database
GPG Key ID: 472D377B63542F83

View File

@ -1783,8 +1783,8 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
insn->imm == BPF_FUNC_get_smp_processor_id) {
const u32 *cpu_nr = &get_lowcore()->cpu_nr;
/* ly %b0, cpu_nr */
EMIT6_DISP_LH(0xe3000000, 0x0058, BPF_REG_0, REG_0, REG_0,
/* llgf %b0, cpu_nr */
EMIT6_DISP_LH(0xe3000000, 0x0016, BPF_REG_0, REG_0, REG_0,
(unsigned long)cpu_nr);
break;
}