aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/net/bpf_jit_comp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 17:20:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 17:20:19 -0500
commitc7708fac5a878d6e0f2de0aa19f9749cff4f707f (patch)
tree21a59cbe503ca526697f7d0bce5e0e30980bcbc0 /arch/s390/net/bpf_jit_comp.c
parent3127f23f013eabe9b58132c05061684c49146ba3 (diff)
parent6726a807c38d7fd09bc23a0adc738efec6ff9492 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 update from Martin Schwidefsky: "Add support to generate code for the latest machine zEC12, MOD and XOR instruction support for the BPF jit compiler, the dasd safe offline feature and the big one: the s390 architecture gets PCI support!! Right before the world ends on the 21st ;-)" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (41 commits) s390/qdio: rename the misleading PCI flag of qdio devices s390/pci: remove obsolete email addresses s390/pci: speed up __iowrite64_copy by using pci store block insn s390/pci: enable NEED_DMA_MAP_STATE s390/pci: no msleep in potential IRQ context s390/pci: fix potential NULL pointer dereference in dma_free_seg_table() s390/pci: use kmem_cache_zalloc instead of kmem_cache_alloc/memset s390/bpf,jit: add support for XOR instruction s390/bpf,jit: add support MOD instruction s390/cio: fix pgid reserved check vga: compile fix, disable vga for s390 s390/pci: add PCI Kconfig options s390/pci: s390 specific PCI sysfs attributes s390/pci: PCI hotplug support via SCLP s390/pci: CHSC PCI support for error and availability events s390/pci: DMA support s390/pci: PCI adapter interrupts for MSI/MSI-X s390/bitops: find leftmost bit instruction support s390/pci: CLP interface s390/pci: base support ...
Diffstat (limited to 'arch/s390/net/bpf_jit_comp.c')
-rw-r--r--arch/s390/net/bpf_jit_comp.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 9b355b406afa..bb284419b0fd 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -341,6 +341,27 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct sock_filter *filter,
341 /* lr %r5,%r4 */ 341 /* lr %r5,%r4 */
342 EMIT2(0x1854); 342 EMIT2(0x1854);
343 break; 343 break;
344 case BPF_S_ALU_MOD_X: /* A %= X */
345 jit->seen |= SEEN_XREG | SEEN_RET0;
346 /* ltr %r12,%r12 */
347 EMIT2(0x12cc);
348 /* jz <ret0> */
349 EMIT4_PCREL(0xa7840000, (jit->ret0_ip - jit->prg));
350 /* lhi %r4,0 */
351 EMIT4(0xa7480000);
352 /* dr %r4,%r12 */
353 EMIT2(0x1d4c);
354 /* lr %r5,%r4 */
355 EMIT2(0x1854);
356 break;
357 case BPF_S_ALU_MOD_K: /* A %= K */
358 /* lhi %r4,0 */
359 EMIT4(0xa7480000);
360 /* d %r4,<d(K)>(%r13) */
361 EMIT4_DISP(0x5d40d000, EMIT_CONST(K));
362 /* lr %r5,%r4 */
363 EMIT2(0x1854);
364 break;
344 case BPF_S_ALU_AND_X: /* A &= X */ 365 case BPF_S_ALU_AND_X: /* A &= X */
345 jit->seen |= SEEN_XREG; 366 jit->seen |= SEEN_XREG;
346 /* nr %r5,%r12 */ 367 /* nr %r5,%r12 */
@@ -368,10 +389,17 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct sock_filter *filter,
368 EMIT4_DISP(0x5650d000, EMIT_CONST(K)); 389 EMIT4_DISP(0x5650d000, EMIT_CONST(K));
369 break; 390 break;
370 case BPF_S_ANC_ALU_XOR_X: /* A ^= X; */ 391 case BPF_S_ANC_ALU_XOR_X: /* A ^= X; */
392 case BPF_S_ALU_XOR_X:
371 jit->seen |= SEEN_XREG; 393 jit->seen |= SEEN_XREG;
372 /* xr %r5,%r12 */ 394 /* xr %r5,%r12 */
373 EMIT2(0x175c); 395 EMIT2(0x175c);
374 break; 396 break;
397 case BPF_S_ALU_XOR_K: /* A ^= K */
398 if (!K)
399 break;
400 /* x %r5,<d(K)>(%r13) */
401 EMIT4_DISP(0x5750d000, EMIT_CONST(K));
402 break;
375 case BPF_S_ALU_LSH_X: /* A <<= X; */ 403 case BPF_S_ALU_LSH_X: /* A <<= X; */
376 jit->seen |= SEEN_XREG; 404 jit->seen |= SEEN_XREG;
377 /* sll %r5,0(%r12) */ 405 /* sll %r5,0(%r12) */