]> Pileus Git - ~andy/linux/blobdiff - arch/arm/net/bpf_jit_32.c
bpf: do not use reciprocal divide
[~andy/linux] / arch / arm / net / bpf_jit_32.c
index 9ed155ad0f97c42c80fd903919a51dac8b0298d4..271b5e9715682ab40869a1ea8a02c9696eaebf07 100644 (file)
@@ -641,10 +641,10 @@ load_ind:
                        emit(ARM_MUL(r_A, r_A, r_X), ctx);
                        break;
                case BPF_S_ALU_DIV_K:
-                       /* current k == reciprocal_value(userspace k) */
+                       if (k == 1)
+                               break;
                        emit_mov_i(r_scratch, k, ctx);
-                       /* A = top 32 bits of the product */
-                       emit(ARM_UMULL(r_scratch, r_A, r_A, r_scratch), ctx);
+                       emit_udiv(r_A, r_A, r_scratch, ctx);
                        break;
                case BPF_S_ALU_DIV_X:
                        update_on_xread(ctx);