Skip to contentSkip to conversation

MIPS: BPF: Disable JIT on R3000 (MIPS-I)

PATCH Superseded Ben Hutchings 3 participants 4 messages Sep 5, 2015 – Oct 5, 2015 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: BPF: Disable JIT on R3000 (MIPS-I)

The JIT does not include the load delay slots required by MIPS-I processors.

---
 arch/mips/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/Kconfig +1 -1
index 199a835..7ff9cba 100644
@@ -12,7 +12,7 @@ config MIPS
 	select HAVE_ARCH_KGDB
 	select HAVE_ARCH_SECCOMP_FILTER
 	select HAVE_ARCH_TRACEHOOK
-	select HAVE_BPF_JIT if !CPU_MICROMIPS
+	select HAVE_BPF_JIT if !CPU_MICROMIPS && !CPU_R3000
 	select ARCH_HAVE_CUSTOM_GPIO_H
 	select HAVE_FUNCTION_TRACER
 	select HAVE_DYNAMIC_FTRACE
Signature · 2 lines
Ben Hutchings
friends: People who know you well, but like you anyway.
#1 lore raw
Quoted 2 lines · Ben Hutchings

The JIT does not include the load delay slots required by MIPS-I processors.

See 0c5d187828588dd1b36cb93b4481a8db467ef3e8 (MIPS: BPF: Fix load delay slots.) for a proper fix.

I'm wondering, how did you find this issue, are you scanning the code for broken instruction sequences?

Ralf

#2 lore raw
Quoted 7 lines · Ralf Baechle
Quoted 2 lines · Ben Hutchings

The JIT does not include the load delay slots required by MIPS-I processors.

See 0c5d187828588dd1b36cb93b4481a8db467ef3e8 (MIPS: BPF: Fix load delay slots.) for a proper fix.

Since this patch didn't make it to the LMO and never discussed, i must say that it's probably not complete. The bpf_jit.c code also emits load instructions (for example see emit_load_imm). So I guess you need to extend your patch to cover the C code as well.

Signature · 1 line
markos
#3 lore raw
In reply to Ralf Baechle
Quoted 7 lines · Ralf Baechle
Quoted 2 lines · Ben Hutchings

The JIT does not include the load delay slots required by MIPS-I processors.

See 0c5d187828588dd1b36cb93b4481a8db467ef3e8 (MIPS: BPF: Fix load delay slots.) for a proper fix.

How about all the inlined loads (emit_load, emit_load_byte, emit_half_load)?

Quoted 2 lines

I'm wondering, how did you find this issue, are you scanning the code for broken instruction sequences?

No, I was already looking at the BPF JIT implementation for some other reason.

Ben.

Signature · 2 lines
Ben Hutchings
compatible: Gracefully accepts erroneous data from any source