diff options
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/net/bpf_jit_comp.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index bb284419b0fd..0972e91cced2 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c | |||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | #include <linux/moduleloader.h> | 8 | #include <linux/moduleloader.h> |
9 | #include <linux/netdevice.h> | 9 | #include <linux/netdevice.h> |
10 | #include <linux/if_vlan.h> | ||
10 | #include <linux/filter.h> | 11 | #include <linux/filter.h> |
11 | #include <asm/cacheflush.h> | 12 | #include <asm/cacheflush.h> |
12 | #include <asm/processor.h> | 13 | #include <asm/processor.h> |
@@ -254,6 +255,8 @@ static void bpf_jit_noleaks(struct bpf_jit *jit, struct sock_filter *filter) | |||
254 | case BPF_S_ANC_HATYPE: | 255 | case BPF_S_ANC_HATYPE: |
255 | case BPF_S_ANC_RXHASH: | 256 | case BPF_S_ANC_RXHASH: |
256 | case BPF_S_ANC_CPU: | 257 | case BPF_S_ANC_CPU: |
258 | case BPF_S_ANC_VLAN_TAG: | ||
259 | case BPF_S_ANC_VLAN_TAG_PRESENT: | ||
257 | case BPF_S_RET_K: | 260 | case BPF_S_RET_K: |
258 | /* first instruction sets A register */ | 261 | /* first instruction sets A register */ |
259 | break; | 262 | break; |
@@ -699,6 +702,24 @@ call_fn: /* lg %r1,<d(function)>(%r13) */ | |||
699 | /* l %r5,<d(rxhash)>(%r2) */ | 702 | /* l %r5,<d(rxhash)>(%r2) */ |
700 | EMIT4_DISP(0x58502000, offsetof(struct sk_buff, rxhash)); | 703 | EMIT4_DISP(0x58502000, offsetof(struct sk_buff, rxhash)); |
701 | break; | 704 | break; |
705 | case BPF_S_ANC_VLAN_TAG: | ||
706 | case BPF_S_ANC_VLAN_TAG_PRESENT: | ||
707 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_tci) != 2); | ||
708 | BUILD_BUG_ON(VLAN_TAG_PRESENT != 0x1000); | ||
709 | /* lhi %r5,0 */ | ||
710 | EMIT4(0xa7580000); | ||
711 | /* icm %r5,3,<d(vlan_tci)>(%r2) */ | ||
712 | EMIT4_DISP(0xbf532000, offsetof(struct sk_buff, vlan_tci)); | ||
713 | if (filter->code == BPF_S_ANC_VLAN_TAG) { | ||
714 | /* nill %r5,0xefff */ | ||
715 | EMIT4_IMM(0xa5570000, ~VLAN_TAG_PRESENT); | ||
716 | } else { | ||
717 | /* nill %r5,0x1000 */ | ||
718 | EMIT4_IMM(0xa5570000, VLAN_TAG_PRESENT); | ||
719 | /* srl %r5,12 */ | ||
720 | EMIT4_DISP(0x88500000, 12); | ||
721 | } | ||
722 | break; | ||
702 | case BPF_S_ANC_CPU: /* A = smp_processor_id() */ | 723 | case BPF_S_ANC_CPU: /* A = smp_processor_id() */ |
703 | #ifdef CONFIG_SMP | 724 | #ifdef CONFIG_SMP |
704 | /* l %r5,<d(cpu_nr)> */ | 725 | /* l %r5,<d(cpu_nr)> */ |