All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 for-4.3] MIPS: BPF: Avoid unreachable code on little endian
@ 2015-09-05 16:46 Aurelien Jarno
  2015-09-05 16:46 ` [PATCH 2/2 for-4.3] MIPS: BPF: Fix build on pre-R2 little endian CPUs Aurelien Jarno
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Aurelien Jarno @ 2015-09-05 16:46 UTC (permalink / raw)
  To: linux-mips; +Cc: Aurelien Jarno, Ralf Baechle, Markos Chandras

On little endian, avoid generating the big endian version of the code
by using #else in addition to #ifdef #endif. Also fix one alignment
issue wrt delay slot.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: stable@vger.kernel.org # v4.2+
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 arch/mips/net/bpf_jit_asm.S | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/mips/net/bpf_jit_asm.S b/arch/mips/net/bpf_jit_asm.S
index e927260..4f54cb1 100644
--- a/arch/mips/net/bpf_jit_asm.S
+++ b/arch/mips/net/bpf_jit_asm.S
@@ -151,9 +151,10 @@ NESTED(bpf_slow_path_word, (6 * SZREG), $r_sp)
 	wsbh	t0, $r_s0
 	jr	$r_ra
 	 rotr	$r_A, t0, 16
-#endif
+#else
 	jr	$r_ra
-	move	$r_A, $r_s0
+	 move	$r_A, $r_s0
+#endif
 
 	END(bpf_slow_path_word)
 
@@ -162,9 +163,10 @@ NESTED(bpf_slow_path_half, (6 * SZREG), $r_sp)
 #ifdef CONFIG_CPU_LITTLE_ENDIAN
 	jr	$r_ra
 	 wsbh	$r_A, $r_s0
-#endif
+#else
 	jr	$r_ra
 	 move	$r_A, $r_s0
+#endif
 
 	END(bpf_slow_path_half)
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-09-07  9:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-05 16:46 [PATCH 1/2 for-4.3] MIPS: BPF: Avoid unreachable code on little endian Aurelien Jarno
2015-09-05 16:46 ` [PATCH 2/2 for-4.3] MIPS: BPF: Fix build on pre-R2 little endian CPUs Aurelien Jarno
2015-09-07  9:33   ` Markos Chandras
2015-09-07  9:33     ` Markos Chandras
2015-09-07  8:29 ` [PATCH 1/2 for-4.3] MIPS: BPF: Avoid unreachable code on little endian Markos Chandras
2015-09-07  8:29   ` Markos Chandras
2015-09-07  9:48 ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.