From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jan Seiffert <kaffeemonster@googlemail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Matt Evans <matt@ozlabs.org>
Subject: Re: [REGRESSION][PATCH] bpf_jit drops the ball on indirect negative mem references
Date: Fri, 30 Mar 2012 11:11:51 +0200 [thread overview]
Message-ID: <1333098711.19659.9.camel@edumazet-laptop> (raw)
In-Reply-To: <4F744D58.3070009@googlemail.com>
Le jeudi 29 mars 2012 à 13:54 +0200, Jan Seiffert a écrit :
>
> + .p2align 1
> bpf_slow_path_word:
> bpf_slow_path_common(4)
> js bpf_error
> @@ -115,6 +116,7 @@ bpf_slow_path_word:
> bswap %eax
> ret
>
> + .p2align 1
> bpf_slow_path_half:
> bpf_slow_path_common(2)
> js bpf_error
> @@ -123,12 +125,14 @@ bpf_slow_path_half:
> movzwl %ax,%eax
> ret
All these ".p2align 1" are noise for this patch.
This should be done as separate patch, explaining the rationale.
...
> case BPF_S_LD_W_IND:
> - func = sk_load_word_ind;
> + func = sk_load_word;
> common_load_ind: seen |= SEEN_DATAREF | SEEN_XREG;
> t_offset = func - (image + addrs[i]);
> - EMIT1_off32(0xbe, K); /* mov imm32,%esi */
> + if (K) {
> + EMIT2(0x8d, 0xb3); /* lea imm32(%rbx),%esi */
> + EMIT(K, 4);
> + } else {
> + EMIT2(0x89,0xde); /* mov %ebx,%esi */
> + }
> EMIT1_off32(0xe8, t_offset); /* call sk_load_xxx_ind */
> break;
Please add the code for imm8 offsets as well ?
if (is_imm8(K))
EMIT3(0x8d, 0x73, K); /* lea imm8(%rbx),%esi */
else
EMIT2_off32(0x8d, 0xb3, K); /* lea imm32(%rbx),%esi */
Thanks
next prev parent reply other threads:[~2012-03-30 9:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-28 19:15 [REGRESSION][PATCH] bpf_jit drops the ball on indirect negative mem references Jan Seiffert
2012-03-28 20:05 ` Eric Dumazet
2012-03-28 20:26 ` Jan Seiffert
2012-03-28 20:39 ` Eric Dumazet
2012-03-29 11:54 ` Jan Seiffert
2012-03-29 13:57 ` Eric Dumazet
2012-03-30 9:11 ` Eric Dumazet [this message]
2012-03-30 13:42 ` Jan Seiffert
2012-03-30 14:08 ` Eric Dumazet
2012-03-30 14:11 ` Josh Boyer
2012-03-30 15:24 ` Matt Evans
2012-03-30 15:19 ` Matt Evans
2012-03-30 15:51 ` Jan Seiffert
2012-03-28 20:58 ` David Miller
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=1333098711.19659.9.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=kaffeemonster@googlemail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@ozlabs.org \
--cc=netdev@vger.kernel.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