lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 12 Mar 2014 13:34:54 -0700
From:	Alexei Starovoitov <ast@...mgrid.com>
To:	David Miller <davem@...emloft.net>
Cc:	Daniel Borkmann <dborkman@...hat.com>,
	Ingo Molnar <mingo@...nel.org>, Will Drewry <wad@...omium.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	"H. Peter Anvin" <hpa@...or.com>,
	Hagen Paul Pfeifer <hagen@...u.net>,
	Jesse Gross <jesse@...ira.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Eric Dumazet <edumazet@...gle.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Frédéric Weisbecker <fweisbec@...il.com>,
	Arnaldo Carvalho de Melo <acme@...radead.org>,
	Pekka Enberg <penberg@....fi>,
	Arjan van de Ven <arjan@...radead.org>,
	Christoph Hellwig <hch@...radead.org>,
	Pavel Emelyanov <xemul@...allels.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH v9 net-next 1/3] filter: add Extended BPF interpreter and converter

On Wed, Mar 12, 2014 at 12:22 PM, David Miller <davem@...emloft.net> wrote:
> From: Alexei Starovoitov <ast@...mgrid.com>
> Date: Mon, 10 Mar 2014 21:41:30 -0700
>
>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> index 1a869488b8ae..2c13d000389c 100644
>> --- a/include/linux/netdevice.h
>> +++ b/include/linux/netdevice.h
>> @@ -3054,6 +3054,7 @@ extern int              netdev_max_backlog;
>>  extern int           netdev_tstamp_prequeue;
>>  extern int           weight_p;
>>  extern int           bpf_jit_enable;
>> +extern int           bpf_ext_enable;
>
> I don't like seeing config ifdefs in C code, so please adjust the
> bpf_jit_enable declaration with something like:
>
> #ifdef CONFIG_BPF_JIT
> extern int              bpf_jit_enable;
> #else
> #define bpf_jit_enable  0
> #endif

agree. that's definitely cleaner.

>> +#ifdef CONFIG_64BIT
>> +             DL(BPF_STX, BPF_XADD, BPF_DW)
>> +#endif
>  ...
>> +#ifdef CONFIG_64BIT
>> +BPF_STX_BPF_XADD_BPF_DW: /* lock xadd *(u64 *)(A + insn->off) += X */
>> +     atomic64_add((u64)X, (atomic64_t *)(ulong)(A + insn->off));
>> +     CONT;
>> +#endif
>
> I'm not too happy about instructions which are only available on
> certain architectures.
>
> I'd rather see best effort emulation than wholesale lack of support.
>
> We have an implementation of 64-bit atomics for 32-bit systems or
> those without true atomic compare-and-saw etc. ops in lib/atomic64.c
> so the routines are always available.

Good point. Will do.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ