public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: eric.dumazet@gmail.com (Eric Dumazet)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5] ARM: net: JIT compiler for packet filters
Date: Fri, 23 Dec 2011 05:44:17 +0100	[thread overview]
Message-ID: <1324615457.2674.6.camel@edumazet-laptop> (raw)
In-Reply-To: <1324601625-20351-1-git-send-email-mgherzan@gmail.com>

Le vendredi 23 d?cembre 2011 ? 01:53 +0100, Mircea Gherzan a ?crit :
> Based of Matt Evans's PPC64 implementation.
> 
> The compiler generates ARM instructions but interworking is
> supported for Thumb2 kernels.
> 
> Supports both little and big endian. Unaligned loads are emitted
> for ARMv6+. Not all the BPF opcodes that deal with ancillary data
> are supported. The scratch memory of the filter lives on the stack.
> Hardware integer division is used if it is available.
> 
> Enabled in the same way as for x86-64 and PPC64:
> 
> 	echo 1 > /proc/sys/net/core/bpf_jit_enable
> 
> A value greater than 1 enables opcode output.
> 
> Signed-off-by: Mircea Gherzan <mgherzan@gmail.com>
> ---
> 
> Changes in v5:
>  * replace SEEN_LEN with SEEN_SKB
>  * set ctx->seen when handling some ancillary data opcodes

> +		case BPF_S_ANC_CPU:
> +			/* A = current_thread_info()->cpu */
> +			emit_mov_i(r_scratch, (~(THREAD_SIZE - 1)), ctx);
> +			emit(ARM_ADD_R(r_scratch, ARM_SP, r_scratch), ctx);

This cant be right ;)

> +
> +			BUILD_BUG_ON(FIELD_SIZEOF(struct thread_info, cpu) != 4);
> +			off = offsetof(struct thread_info, cpu);
> +			emit(ARM_LDR_I(r_A, r_scratch, off), ctx);
> +			break;

code for r_A = raw_smp_processor_id(); should be something like :

mov r0, sp
bic r0, r0, #8128   ; 0x1fc0
bic r0, r0, #63 ; 0x3f
ldr r4, [r0, #20] 

  reply	other threads:[~2011-12-23  4:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-23  0:53 [PATCH v5] ARM: net: JIT compiler for packet filters Mircea Gherzan
2011-12-23  4:44 ` Eric Dumazet [this message]
2011-12-27 17:29 ` Rabin Vincent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324615457.2674.6.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox