aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-03-31watchdog: fix checkpatch warnings and errorJingoo Han6-14/+13
Fix the following checkpatch warnings and error: WARNING: quoted string split across lines WARNING: braces {} are not necessary for single statement blocks WARNING: __initdata should be placed after ibmasr_id_table[] WARNING: please, no space before tabs ERROR: do not initialise statics to 0 or NULL Signed-off-by: Jingoo Han <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: Add tegra watchdogAndrew Chew4-0/+319
Add a driver for the hardware watchdogs in NVIDIA Tegra SoCs (Tegra30 and later). This driver will configure one watchdog timer that will reset the system in the case of a watchdog timeout. This driver binds to the nvidia,tegra30-timer device node and gets its register base from there. Signed-off-by: Andrew Chew <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Tested-by: Stephen Warren <[email protected]> Reviewed-by: Stephen Warren <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: xilinx: Remove no_timeout variableMichal Simek1-9/+4
Remove no_timeout variable and check variables directly. Suggested-by: Rob Herring <[email protected]> Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: xilinx: Enable this driver for ZynqMichal Simek1-13/+9
Enable this driver for Zynq. Move it to architecture independent Kconfig part. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: xilinx: Add missing bindingMichal Simek1-0/+23
Document current driver binding. Signed-off-by: Michal Simek <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: xilinx: Use correct comment indentationMichal Simek1-4/+4
No functional changes. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: xilinx: Use of_property_read_u32Michal Simek1-17/+12
Use of_property_read_u32 functions to clean probe function. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: xilinx: Fix all printk messagesMichal Simek1-8/+8
Use dev_ functions for printk messages. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: xilinx: Allocate private structure per deviceMichal Simek1-42/+55
Only one watchdog could be used by this driver. Create driver private data structure and move there all variables for one instance. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: xilinx: Move no_timeout to probe functionMichal Simek1-5/+3
no_timeout should be local variable because it is used only in probe function. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: xilinx: Simplify probe and remove functionsMichal Simek1-32/+9
Use devm_ helper function to simplify probe and error path. Move ioremap to the beginning of probe function. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: xilinx: Move control_status_reg to functionsMichal Simek1-1/+6
control_status_reg is temp variables and should be used locally by specific function. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: xilinx: Convert driver to the watchdog frameworkMichal Simek2-172/+33
- Remove uneeded headers, fops functions - Use xilinx_wdt prefix in start/stop/keepalive functions and in new structures Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: wdt285: Fix variable typeAlexander Shiyan1-2/+1
Variable "new_margin" is checked in the function watchdog_ioctl() to be non-negative, so change its type to "int". Signed-off-by: Alexander Shiyan <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: shwdt: Remove unused variableAlexander Shiyan1-2/+0
Variable "wdt" is not used anywhere in the function sh_wdt_remove(). This patch removes this variable. Signed-off-by: Alexander Shiyan <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: sc520_wdt: Remove unused variableAlexander Shiyan1-2/+1
Variable "dummy" is not used anywhere in the function wdt_config(). This patch removes this variable. Signed-off-by: Alexander Shiyan <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: intel_scu_watchdog: Remove unused variableAlexander Shiyan1-3/+1
Variable "hw_pre_value" is not used anywhere in the function intel_scu_set_heartbeat(). This patch removes this variable. Signed-off-by: Alexander Shiyan <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: indydog: Simplify indydog_{start,stop}Alexander Shiyan1-11/+2
This patch simplify functions indydog_start() and indydog_stop() a bit and removes excess intermediate variable. Signed-off-by: Alexander Shiyan <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: bcm63xx_wdt: Remove unused field from bcm63xx_wdt_deviceAlexander Shiyan1-1/+0
Field "default_ticks" is not used anywhere in the driver code. This patch removes this field. Signed-off-by: Alexander Shiyan <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: sp805_wdt: Use devm_ioremap_resource()Jingoo Han1-14/+3
Use devm_ioremap_resource() in order to make the code simpler. Signed-off-by: Jingoo Han <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: omap_wdt: Use devm_ioremap_resource()Jingoo Han1-16/+6
Use devm_ioremap_resource() in order to make the code simpler, and remove 'struct resource *mem' from 'struct omap_wdt_dev' and omap_wdt_probe(), resplectively. because the 'mem' variables are not used anymore. Also the redundant return value check of platform_get_resource() is removed, because the value is checked by devm_ioremap_resource(). Signed-off-by: Jingoo Han <[email protected]> Acked-by: Aaro Koskinen <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: ep93xx_wdt: Use devm_ioremap_resource()Jingoo Han1-10/+3
Use devm_ioremap_resource() in order to make the code simpler, and remove redundant return value check of platform_get_resource() because the value is checked by devm_ioremap_resource(). Signed-off-by: Jingoo Han <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: ts72xx_wdt: make 'ts72xx_wdt_pdev' staticJingoo Han1-1/+1
Make 'ts72xx_wdt_pdev' static, because it is used only in this file. It also fixes the following sparse warning. warning: symbol 'ts72xx_wdt_pdev' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Acked-by: Mika Westerberg <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: Remove unnecessary OOM messagesJingoo Han8-18/+5
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. For example, k.alloc and v.alloc failures use dump_stack(). Signed-off-by: Jingoo Han <[email protected]> Reviewed-by: Jean Delvare <[email protected]> [for at32ap700x] Acked-by: Lubomir Rintel <[email protected]> [for bcm2835] Acked-by: Viresh Kumar <[email protected]> [for sp805_wdt] Acked-by: Mika Westerberg <[email protected]> [for ts72xx_wdt] Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31watchdog: delete non-required instances of include <linux/init.h>Paul Gortmaker24-24/+0
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]> Cc: [email protected]
2014-03-31watchdog: mpc8xxx_wdt: MPC8xx is HW enabledChristophe Leroy1-0/+1
MPC8xx watchdog is enabled at startup by HW. If the bootloader disables it, it cannot be reenabled. Signed-off-by: Christophe Leroy <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
2014-03-31Merge tag 'asoc-v3.15-4' of ↵Takashi Iwai123-833/+1127
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Final updates for v3.15 merge window A few more updates from last week - use of the tdm_slot mapping from Xiubo plus a few smaller fixes and cleanups.
2014-03-31ALSA: ice1712: Add suspend support for M-Audio ICE1712-based cardsOndrej Zary1-1/+29
Add suspend support for M-Audio cards based on ICE1712 chip. Tested with M-Audio Audiophile 24/96. S/PDIF will probably not work. Signed-off-by: Ondrej Zary <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-03-31ALSA: ice1712: add suspend support for ICE1712 chipOndrej Zary1-8/+77
Add suspend/resume support for ICE1712 chip. Card-specific subdrivers need to enable it and provide callbacks that suspend/resume the codecs. Signed-off-by: Ondrej Zary <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-03-31Merge branch 'for-next' into for-linusTakashi Iwai714-14253/+30599
2014-03-31irqchip: sun7i/sun6i: Disable NMI before registering the handlerHans de Goede1-3/+3
It is advisable to disable the NMI before registering the IRQ handler as registering the IRQ handler unmasks the IRQ on the GIC, so if U-Boot has left the NMI enabled and the NMI pin is active we will immediately get an interrupt before any driver has claimed the downstream interrupt of the NMI. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Carlo Caione <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-03-31ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controllerHans de Goede1-1/+1
The IRQ line used in sun6i-a31.dtsi for the NMI controller is wrong. This causes a IRQ storm since the NMI controller is repeatedly fired. This patch fixes this problem assigning the correct IRQ number to the NMI controller. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Carlo Caione <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-03-31ALSA: hda - Enable beep for ASUS 1015EW. Trevor King1-0/+1
The `lspci -nnvv` output contains (wrapped for line length): 00:1b.0 Audio device [0403]: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller [8086:1e20] (rev 04) Subsystem: ASUSTeK Computer Inc. Device [1043:115d] Signed-off-by: W. Trevor King <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-03-31ALSA: asihpi: fix some indenting in snd_card_asihpi_pcm_new()Dan Carpenter1-4/+5
This used to be a part of a condition until f3d145aac913 ('ALSA: asihpi: MMAP for non-busmaster cards') but now it's not and we can remove an indent level. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-03-31MIPS: Hibernate: Flush TLB entries in swsusp_arch_resume()Huacai Chen1-0/+1
The original MIPS hibernate code flushes cache and TLB entries in swsusp_arch_resume(). But they are removed in Commit 44eeab67416711 (MIPS: Hibernation: Remove SMP TLB and cacheflushing code.). A cross- CPU flush is surely unnecessary because all but the local CPU have already been disabled. But a local flush (at least the TLB flush) is needed. When we do hibernation on Loongson-3 with an E1000E NIC, it is very easy to produce a kernel panic (kernel page fault, or unaligned access). The root cause is E1000E driver use vzalloc_node() to allocate pages, the stale TLB entries of the booting kernel will be misused by the resumed target kernel. Signed-off-by: Huacai Chen <[email protected]> Cc: John Crispin <[email protected]> Cc: Steven J. Hill <[email protected]> Cc: Aurelien Jarno <[email protected]> Cc: [email protected] Cc: Fuxin Zhang <[email protected]> Cc: Zhangjin Wu <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/6643/ Signed-off-by: Ralf Baechle <[email protected]>
2014-03-31MIPS: Alchemy: remove duplicate UART register offset definitionsManuel Lauss1-12/+0
The UART register names are identical to the ones in uapi/linux/serial_reg.h, which causes build failures in various drivers when they indirectly pull in the au1000.h header, for example via gpio.h: In file included from arch/mips/include/asm/mach-au1x00/gpio.h:13:0, from arch/mips/include/asm/gpio.h:4, from include/linux/gpio.h:48, from include/linux/ssb/ssb.h:9, from drivers/ssb/driver_mipscore.c:11: arch/mips/include/asm/mach-au1x00/au1000.h:1171:0: note: this is the location of the previous definition #define UART_LSR 0x1C /* Line Status Register */ Get rid of the altogether, nothing in the core Alchemy code depends on them any more. Signed-off-by: Manuel Lauss <[email protected]> Cc: Linux-MIPS <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/6664/ Signed-off-by: Ralf Baechle <[email protected]>
2014-03-31MIPS: Fix build error due to multiple prom_putchar() definitions.Ralf Baechle2-5/+10
This can happen if both the generic 8250 and another early console driver are enable. Fixed by using an auxilliary kconfig symbol to restrict that choice. Signed-off-by: Ralf Baechle <[email protected]>
2014-03-31Merge remote-tracking branch 'robh/for-next' into devicetree/nextGrant Likely305-1669/+2864
2014-03-31arch/avr32/mm/cache.c: export symbol flush_icache_range() for module usingChen Gang1-0/+1
Need export symbol flush_icache_range() to modules, just like another platforms have done, or can not pass compiling. The related error (with allmodconfig under avr32): ERROR: "flush_icache_range" [drivers/misc/lkdtm.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 Signed-off-by: Chen Gang <[email protected]> Acked-by: Hans-Christian Egtvedt <[email protected]>
2014-03-31avr32: remove cpu_data macro to fix compilesWolfram Sang2-7/+2
Having cpu_data as a parameterless macro can easily cause build failures because it can be a variable name like in linux/pm_domain.h [1]. So, remove the macro and convert its only user. Because this architecture cannot do SMP, remove the whole SMP block, too. Only compile tested due to no hardware. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Hans-Christian Egtvedt <[email protected]> [1] https://lists.01.org/pipermail/kbuild-all/2014-February/003252.html
2014-03-31Merge branch 'filter-next'David S. Miller20-536/+1658
Daniel Borkmann says: ==================== BPF updates We sat down and have heavily reworked the whole previous patchset from v10 [1] to address all comments/concerns. This patchset therefore *replaces* the internal BPF interpreter with the new layout as discussed in [1], and migrates some exotic callers to properly use the BPF API for a transparent upgrade. All other callers that already use the BPF API in a way it should be used, need no further changes to run the new internals. We also removed the sysctl knob entirely, and do not expose any structure to userland, so that implementation details only reside in kernel space. Since we are replacing the interpreter we had to migrate seccomp in one patch along with the interpreter to not break anything. When attaching a new filter, the flow can be described as following: i) test if jit compiler is enabled and can compile the user BPF, ii) if so, then go for it, iii) if not, then transparently migrate the filter into the new representation, and run it in the interpreter. Also, we have scratched the jit flag from the len attribute and made it as initial patch in this series as Pablo has suggested in the last feedback, thanks. For details, please refer to the patches themselves. We did extensive testing of BPF and seccomp on the new interpreter itself and also on the user ABIs and could not find any issues; new performance numbers as posted in patch 8 are also still the same. Please find more details in the patches themselves. For all the previous history from v1 to v10, see [1]. We have decided to drop the v11 as we have pedantically reworked the set, but of course, included all previous feedback. v3 -> v4: - Applied feedback from Dave regarding swap insns - Rebased on net-next v2 -> v3: - Rebased to latest net-next (i.e. w/ rxhash->hash rename) - Fixed patch 8/9 commit message/doc as suggested by Dave - Rest is unchanged v1 -> v2: - Rebased to latest net-next - Added static to ptp_filter as suggested by Dave - Fixed a typo in patch 8's commit message - Rest unchanged Thanks ! [1] http://thread.gmane.org/gmane.linux.kernel/1665858 ==================== Signed-off-by: David S. Miller <[email protected]>
2014-03-31doc: filter: extend BPF documentation to document new internalsAlexei Starovoitov1-0/+125
Further extend the current BPF documentation to document new BPF engine internals. Joint work with Daniel Borkmann. Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-03-31net: filter: rework/optimize internal BPF interpreter's instruction setAlexei Starovoitov4-372/+1279
This patch replaces/reworks the kernel-internal BPF interpreter with an optimized BPF instruction set format that is modelled closer to mimic native instruction sets and is designed to be JITed with one to one mapping. Thus, the new interpreter is noticeably faster than the current implementation of sk_run_filter(); mainly for two reasons: 1. Fall-through jumps: BPF jump instructions are forced to go either 'true' or 'false' branch which causes branch-miss penalty. The new BPF jump instructions have only one branch and fall-through otherwise, which fits the CPU branch predictor logic better. `perf stat` shows drastic difference for branch-misses between the old and new code. 2. Jump-threaded implementation of interpreter vs switch statement: Instead of single table-jump at the top of 'switch' statement, gcc will now generate multiple table-jump instructions, which helps CPU branch predictor logic. Note that the verification of filters is still being done through sk_chk_filter() in classical BPF format, so filters from user- or kernel space are verified in the same way as we do now, and same restrictions/constraints hold as well. We reuse current BPF JIT compilers in a way that this upgrade would even be fine as is, but nevertheless allows for a successive upgrade of BPF JIT compilers to the new format. The internal instruction set migration is being done after the probing for JIT compilation, so in case JIT compilers are able to create a native opcode image, we're going to use that, and in all other cases we're doing a follow-up migration of the BPF program's instruction set, so that it can be transparently run in the new interpreter. In short, the *internal* format extends BPF in the following way (more details can be taken from the appended documentation): - Number of registers increase from 2 to 10 - Register width increases from 32-bit to 64-bit - Conditional jt/jf targets replaced with jt/fall-through - Adds signed > and >= insns - 16 4-byte stack slots for register spill-fill replaced with up to 512 bytes of multi-use stack space - Introduction of bpf_call insn and register passing convention for zero overhead calls from/to other kernel functions - Adds arithmetic right shift and endianness conversion insns - Adds atomic_add insn - Old tax/txa insns are replaced with 'mov dst,src' insn Performance of two BPF filters generated by libpcap resp. bpf_asm was measured on x86_64, i386 and arm32 (other libpcap programs have similar performance differences): fprog #1 is taken from Documentation/networking/filter.txt: tcpdump -i eth0 port 22 -dd fprog #2 is taken from 'man tcpdump': tcpdump -i eth0 'tcp port 22 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -dd Raw performance data from BPF micro-benchmark: SK_RUN_FILTER on the same SKB (cache-hit) or 10k SKBs (cache-miss); time in ns per call, smaller is better: --x86_64-- fprog #1 fprog #1 fprog #2 fprog #2 cache-hit cache-miss cache-hit cache-miss old BPF 90 101 192 202 new BPF 31 71 47 97 old BPF jit 12 34 17 44 new BPF jit TBD --i386-- fprog #1 fprog #1 fprog #2 fprog #2 cache-hit cache-miss cache-hit cache-miss old BPF 107 136 227 252 new BPF 40 119 69 172 --arm32-- fprog #1 fprog #1 fprog #2 fprog #2 cache-hit cache-miss cache-hit cache-miss old BPF 202 300 475 540 new BPF 180 270 330 470 old BPF jit 26 182 37 202 new BPF jit TBD Thus, without changing any userland BPF filters, applications on top of AF_PACKET (or other families) such as libpcap/tcpdump, cls_bpf classifier, netfilter's xt_bpf, team driver's load-balancing mode, and many more will have better interpreter filtering performance. While we are replacing the internal BPF interpreter, we also need to convert seccomp BPF in the same step to make use of the new internal structure since it makes use of lower-level API details without being further decoupled through higher-level calls like sk_unattached_filter_{create,destroy}(), for example. Just as for normal socket filtering, also seccomp BPF experiences a time-to-verdict speedup: 05-sim-long_jumps.c of libseccomp was used as micro-benchmark: seccomp_rule_add_exact(ctx,... seccomp_rule_add_exact(ctx,... rc = seccomp_load(ctx); for (i = 0; i < 10000000; i++) syscall(199, 100); 'short filter' has 2 rules 'large filter' has 200 rules 'short filter' performance is slightly better on x86_64/i386/arm32 'large filter' is much faster on x86_64 and i386 and shows no difference on arm32 --x86_64-- short filter old BPF: 2.7 sec 39.12% bench libc-2.15.so [.] syscall 8.10% bench [kernel.kallsyms] [k] sk_run_filter 6.31% bench [kernel.kallsyms] [k] system_call 5.59% bench [kernel.kallsyms] [k] trace_hardirqs_on_caller 4.37% bench [kernel.kallsyms] [k] trace_hardirqs_off_caller 3.70% bench [kernel.kallsyms] [k] __secure_computing 3.67% bench [kernel.kallsyms] [k] lock_is_held 3.03% bench [kernel.kallsyms] [k] seccomp_bpf_load new BPF: 2.58 sec 42.05% bench libc-2.15.so [.] syscall 6.91% bench [kernel.kallsyms] [k] system_call 6.25% bench [kernel.kallsyms] [k] trace_hardirqs_on_caller 6.07% bench [kernel.kallsyms] [k] __secure_computing 5.08% bench [kernel.kallsyms] [k] sk_run_filter_int_seccomp --arm32-- short filter old BPF: 4.0 sec 39.92% bench [kernel.kallsyms] [k] vector_swi 16.60% bench [kernel.kallsyms] [k] sk_run_filter 14.66% bench libc-2.17.so [.] syscall 5.42% bench [kernel.kallsyms] [k] seccomp_bpf_load 5.10% bench [kernel.kallsyms] [k] __secure_computing new BPF: 3.7 sec 35.93% bench [kernel.kallsyms] [k] vector_swi 21.89% bench libc-2.17.so [.] syscall 13.45% bench [kernel.kallsyms] [k] sk_run_filter_int_seccomp 6.25% bench [kernel.kallsyms] [k] __secure_computing 3.96% bench [kernel.kallsyms] [k] syscall_trace_exit --x86_64-- large filter old BPF: 8.6 seconds 73.38% bench [kernel.kallsyms] [k] sk_run_filter 10.70% bench libc-2.15.so [.] syscall 5.09% bench [kernel.kallsyms] [k] seccomp_bpf_load 1.97% bench [kernel.kallsyms] [k] system_call new BPF: 5.7 seconds 66.20% bench [kernel.kallsyms] [k] sk_run_filter_int_seccomp 16.75% bench libc-2.15.so [.] syscall 3.31% bench [kernel.kallsyms] [k] system_call 2.88% bench [kernel.kallsyms] [k] __secure_computing --i386-- large filter old BPF: 5.4 sec new BPF: 3.8 sec --arm32-- large filter old BPF: 13.5 sec 73.88% bench [kernel.kallsyms] [k] sk_run_filter 10.29% bench [kernel.kallsyms] [k] vector_swi 6.46% bench libc-2.17.so [.] syscall 2.94% bench [kernel.kallsyms] [k] seccomp_bpf_load 1.19% bench [kernel.kallsyms] [k] __secure_computing 0.87% bench [kernel.kallsyms] [k] sys_getuid new BPF: 13.5 sec 76.08% bench [kernel.kallsyms] [k] sk_run_filter_int_seccomp 10.98% bench [kernel.kallsyms] [k] vector_swi 5.87% bench libc-2.17.so [.] syscall 1.77% bench [kernel.kallsyms] [k] __secure_computing 0.93% bench [kernel.kallsyms] [k] sys_getuid BPF filters generated by seccomp are very branchy, so the new internal BPF performance is better than the old one. Performance gains will be even higher when BPF JIT is committed for the new structure, which is planned in future work (as successive JIT migrations). BPF has also been stress-tested with trinity's BPF fuzzer. Joint work with Daniel Borkmann. Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Cc: Hagen Paul Pfeifer <[email protected]> Cc: Kees Cook <[email protected]> Cc: Paul Moore <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: [email protected] Acked-by: Kees Cook <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-03-31net: isdn: use sk_unattached_filter apiDaniel Borkmann2-23/+43
Similarly as in ppp, we need to migrate the ISDN/PPP code to make use of the sk_unattached_filter api in order to decouple having direct filter structure access. By using sk_unattached_filter_{create,destroy}, we can allow for the possibility to jit compile filters for faster filter verdicts as well. Joint work with Alexei Starovoitov. Signed-off-by: Daniel Borkmann <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Cc: Karsten Keil <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
2014-03-31net: ppp: use sk_unattached_filter apiDaniel Borkmann1-19/+41
For the ppp driver, there are currently two open-coded BPF filters in use, that is, pass_filter and active_filter. Migrate both to make proper use of sk_unattached_filter_{create,destroy} API so that the actual BPF code is decoupled from direct access, and filters can be jited as a side-effect by the internal filter compiler. Joint work with Alexei Starovoitov. Signed-off-by: Daniel Borkmann <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
2014-03-31net: ptp: do not reimplement PTP/BPF classifierDaniel Borkmann5-38/+12
There are currently pch_gbe, cpts, and ixp4xx_eth drivers that open-code and reimplement a BPF classifier for the PTP protocol. Since all of them effectively do the very same thing and load the very same PTP/BPF filter, we can just consolidate that code by introducing ptp_classify_raw() in the time-stamping core framework which can be used in drivers. As drivers get initialized after bootstrapping the core networking subsystem, they can make use of ptp_insns wrapped through ptp_classify_raw(), which allows to simplify and remove PTP classifier setup code in drivers. Joint work with Alexei Starovoitov. Signed-off-by: Daniel Borkmann <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Cc: Richard Cochran <[email protected]> Cc: Jiri Benc <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-03-31net: ptp: use sk_unattached_filter_create() for BPFDaniel Borkmann2-11/+14
This patch migrates an open-coded sk_run_filter() implementation with proper use of the BPF API, that is, sk_unattached_filter_create(). This migration is needed, as we will be internally transforming the filter to a different representation, and therefore needs to be decoupled. It is okay to do so as skb_timestamping_init() is called during initialization of the network stack in core initcall via sock_init(). This would effectively also allow for PTP filters to be jit compiled if bpf_jit_enable is set. For better readability, there are also some newlines introduced, also ptp_classify.h is only in kernel space. Joint work with Alexei Starovoitov. Signed-off-by: Daniel Borkmann <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Cc: Richard Cochran <[email protected]> Cc: Jiri Benc <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-03-31net: filter: move filter accounting to filter coreDaniel Borkmann3-42/+42
This patch basically does two things, i) removes the extern keyword from the include/linux/filter.h file to be more consistent with the rest of Joe's changes, and ii) moves filter accounting into the filter core framework. Filter accounting mainly done through sk_filter_{un,}charge() take care of the case when sockets are being cloned through sk_clone_lock() so that removal of the filter on one socket won't result in eviction as it's still referenced by the other. These functions actually belong to net/core/filter.c and not include/net/sock.h as we want to keep all that in a central place. It's also not in fast-path so uninlining them is fine and even allows us to get rd of sk_filter_release_rcu()'s EXPORT_SYMBOL and a forward declaration. Joint work with Alexei Starovoitov. Signed-off-by: Daniel Borkmann <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Cc: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-03-31net: filter: keep original BPF program aroundDaniel Borkmann3-31/+93
In order to open up the possibility to internally transform a BPF program into an alternative and possibly non-trivial reversible representation, we need to keep the original BPF program around, so that it can be passed back to user space w/o the need of a complex decoder. The reason for that use case resides in commit a8fc92778080 ("sk-filter: Add ability to get socket filter program (v2)"), that is, the ability to retrieve the currently attached BPF filter from a given socket used mainly by the checkpoint-restore project, for example. Therefore, we add two helpers sk_{store,release}_orig_filter for taking care of that. In the sk_unattached_filter_create() case, there's no such possibility/requirement to retrieve a loaded BPF program. Therefore, we can spare us the work in that case. This approach will simplify and slightly speed up both, sk_get_filter() and sock_diag_put_filterinfo() handlers as we won't need to successively decode filters anymore through sk_decode_filter(). As we still need sk_decode_filter() later on, we're keeping it around. Joint work with Alexei Starovoitov. Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Cc: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-03-31net: filter: add jited flag to indicate jit compiled filtersDaniel Borkmann7-6/+15
This patch adds a jited flag into sk_filter struct in order to indicate whether a filter is currently jited or not. The size of sk_filter is not being expanded as the 32 bit 'len' member allows upper bits to be reused since a filter can currently only grow as large as BPF_MAXINSNS. Therefore, there's enough room also for other in future needed flags to reuse 'len' field if necessary. The jited flag also allows for having alternative interpreter functions running as currently, we can only detect jit compiled filters by testing fp->bpf_func to not equal the address of sk_run_filter(). Joint work with Alexei Starovoitov. Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Cc: Pablo Neira Ayuso <[email protected]> Signed-off-by: David S. Miller <[email protected]>