s390/bpf,jit: add support for BPF_S_ANC_ALU_XOR_X instruction
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 24 Sep 2012 06:31:35 +0000 (08:31 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 26 Sep 2012 13:45:28 +0000 (15:45 +0200)
Add support for new BPF_S_ANC_ALU_XOR_X instruction which got added
with ffe06c17 "filter: add XOR operation".

s390 version of 4bfaddf1 "x86 bpf_jit: support BPF_S_ANC_ALU_XOR_X instruction".

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/net/bpf_jit_comp.c

index f57f0c335b1d9befbd751d3c5bfeb1ccd3d40060..9b355b406afaafb924d52f9e8c853f0338a292a0 100644 (file)
@@ -367,6 +367,11 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct sock_filter *filter,
                        /* o %r5,<d(K)>(%r13) */
                        EMIT4_DISP(0x5650d000, EMIT_CONST(K));
                break;
+       case BPF_S_ANC_ALU_XOR_X: /* A ^= X; */
+               jit->seen |= SEEN_XREG;
+               /* xr %r5,%r12 */
+               EMIT2(0x175c);
+               break;
        case BPF_S_ALU_LSH_X: /* A <<= X; */
                jit->seen |= SEEN_XREG;
                /* sll %r5,0(%r12) */