aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-11 17:27:06 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-11 17:27:06 -0500
commit70e71ca0af244f48a5dcf56dc435243792e3a495 (patch)
treef7d9c4c4d9a857a00043e9bf6aa2d6f533a34778 /arch
parentbae41e45b7400496b9bf0c70c6004419d9987819 (diff)
parent00c83b01d58068dfeb2e1351cca6fccf2a83fa8f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: 1) New offloading infrastructure and example 'rocker' driver for offloading of switching and routing to hardware. This work was done by a large group of dedicated individuals, not limited to: Scott Feldman, Jiri Pirko, Thomas Graf, John Fastabend, Jamal Hadi Salim, Andy Gospodarek, Florian Fainelli, Roopa Prabhu 2) Start making the networking operate on IOV iterators instead of modifying iov objects in-situ during transfers. Thanks to Al Viro and Herbert Xu. 3) A set of new netlink interfaces for the TIPC stack, from Richard Alpe. 4) Remove unnecessary looping during ipv6 routing lookups, from Martin KaFai Lau. 5) Add PAUSE frame generation support to gianfar driver, from Matei Pavaluca. 6) Allow for larger reordering levels in TCP, which are easily achievable in the real world right now, from Eric Dumazet. 7) Add a variable of napi_schedule that doesn't need to disable cpu interrupts, from Eric Dumazet. 8) Use a doubly linked list to optimize neigh_parms_release(), from Nicolas Dichtel. 9) Various enhancements to the kernel BPF verifier, and allow eBPF programs to actually be attached to sockets. From Alexei Starovoitov. 10) Support TSO/LSO in sunvnet driver, from David L Stevens. 11) Allow controlling ECN usage via routing metrics, from Florian Westphal. 12) Remote checksum offload, from Tom Herbert. 13) Add split-header receive, BQL, and xmit_more support to amd-xgbe driver, from Thomas Lendacky. 14) Add MPLS support to openvswitch, from Simon Horman. 15) Support wildcard tunnel endpoints in ipv6 tunnels, from Steffen Klassert. 16) Do gro flushes on a per-device basis using a timer, from Eric Dumazet. This tries to resolve the conflicting goals between the desired handling of bulk vs. RPC-like traffic. 17) Allow userspace to ask for the CPU upon what a packet was received/steered, via SO_INCOMING_CPU. From Eric Dumazet. 18) Limit GSO packets to half the current congestion window, from Eric Dumazet. 19) Add a generic helper so that all drivers set their RSS keys in a consistent way, from Eric Dumazet. 20) Add xmit_more support to enic driver, from Govindarajulu Varadarajan. 21) Add VLAN packet scheduler action, from Jiri Pirko. 22) Support configurable RSS hash functions via ethtool, from Eyal Perry. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1820 commits) Fix race condition between vxlan_sock_add and vxlan_sock_release net/macb: fix compilation warning for print_hex_dump() called with skb->mac_header net/mlx4: Add support for A0 steering net/mlx4: Refactor QUERY_PORT net/mlx4_core: Add explicit error message when rule doesn't meet configuration net/mlx4: Add A0 hybrid steering net/mlx4: Add mlx4_bitmap zone allocator net/mlx4: Add a check if there are too many reserved QPs net/mlx4: Change QP allocation scheme net/mlx4_core: Use tasklet for user-space CQ completion events net/mlx4_core: Mask out host side virtualization features for guests net/mlx4_en: Set csum level for encapsulated packets be2net: Export tunnel offloads only when a VxLAN tunnel is created gianfar: Fix dma check map error when DMA_API_DEBUG is enabled cxgb4/csiostor: Don't use MASTER_MUST for fw_hello call net: fec: only enable mdio interrupt before phy device link up net: fec: clear all interrupt events to support i.MX6SX net: fec: reset fep link status in suspend function net: sock: fix access via invalid file descriptor net: introduce helper macro for_each_cmsghdr ...
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/Kbuild1
-rw-r--r--arch/alpha/include/uapi/asm/socket.h5
-rw-r--r--arch/arc/include/asm/Kbuild1
-rw-r--r--arch/arm/configs/davinci_all_defconfig1
-rw-r--r--arch/arm/include/asm/Kbuild1
-rw-r--r--arch/arm/kernel/sys_oabi-compat.c4
-rw-r--r--arch/arm/mach-mmp/gplugd.c1
-rw-r--r--arch/arm64/include/asm/Kbuild1
-rw-r--r--arch/avr32/include/asm/Kbuild1
-rw-r--r--arch/avr32/include/uapi/asm/socket.h5
-rw-r--r--arch/blackfin/include/asm/Kbuild1
-rw-r--r--arch/c6x/include/asm/Kbuild1
-rw-r--r--arch/cris/include/asm/Kbuild1
-rw-r--r--arch/cris/include/uapi/asm/socket.h5
-rw-r--r--arch/frv/include/asm/Kbuild1
-rw-r--r--arch/frv/include/uapi/asm/socket.h5
-rw-r--r--arch/hexagon/include/asm/Kbuild1
-rw-r--r--arch/ia64/include/asm/Kbuild1
-rw-r--r--arch/ia64/include/uapi/asm/socket.h5
-rw-r--r--arch/m32r/include/asm/Kbuild1
-rw-r--r--arch/m32r/include/uapi/asm/socket.h5
-rw-r--r--arch/m68k/include/asm/Kbuild1
-rw-r--r--arch/metag/include/asm/Kbuild1
-rw-r--r--arch/microblaze/include/asm/Kbuild1
-rw-r--r--arch/mips/include/asm/Kbuild1
-rw-r--r--arch/mips/include/uapi/asm/socket.h5
-rw-r--r--arch/mips/net/bpf_jit.c4
-rw-r--r--arch/mn10300/include/asm/Kbuild1
-rw-r--r--arch/mn10300/include/uapi/asm/socket.h5
-rw-r--r--arch/nios2/include/asm/Kbuild1
-rw-r--r--arch/openrisc/include/asm/Kbuild1
-rw-r--r--arch/parisc/include/asm/Kbuild1
-rw-r--r--arch/parisc/include/uapi/asm/socket.h5
-rw-r--r--arch/powerpc/configs/85xx/ge_imp3a_defconfig1
-rw-r--r--arch/powerpc/configs/86xx/gef_ppc9a_defconfig1
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc310_defconfig1
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc610_defconfig1
-rw-r--r--arch/powerpc/configs/86xx/sbc8641d_defconfig1
-rw-r--r--arch/powerpc/configs/c2k_defconfig1
-rw-r--r--arch/powerpc/configs/ppc64_defconfig1
-rw-r--r--arch/powerpc/configs/ppc64e_defconfig1
-rw-r--r--arch/powerpc/configs/ppc6xx_defconfig1
-rw-r--r--arch/powerpc/configs/pseries_defconfig1
-rw-r--r--arch/powerpc/configs/pseries_le_defconfig1
-rw-r--r--arch/powerpc/include/asm/Kbuild1
-rw-r--r--arch/powerpc/include/asm/ppc-opcode.h1
-rw-r--r--arch/powerpc/include/uapi/asm/socket.h5
-rw-r--r--arch/powerpc/net/bpf_jit.h7
-rw-r--r--arch/powerpc/net/bpf_jit_comp.c49
-rw-r--r--arch/s390/include/asm/Kbuild1
-rw-r--r--arch/s390/include/uapi/asm/socket.h5
-rw-r--r--arch/score/include/asm/Kbuild1
-rw-r--r--arch/sh/include/asm/Kbuild1
-rw-r--r--arch/sparc/include/asm/Kbuild1
-rw-r--r--arch/sparc/include/asm/vio.h19
-rw-r--r--arch/sparc/include/uapi/asm/socket.h5
-rw-r--r--arch/tile/configs/tilegx_defconfig1
-rw-r--r--arch/tile/configs/tilepro_defconfig1
-rw-r--r--arch/tile/include/asm/Kbuild1
-rw-r--r--arch/um/include/asm/Kbuild1
-rw-r--r--arch/unicore32/include/asm/Kbuild1
-rw-r--r--arch/x86/include/asm/hash.h7
-rw-r--r--arch/x86/lib/Makefile2
-rw-r--r--arch/x86/lib/hash.c92
-rw-r--r--arch/x86/net/bpf_jit_comp.c34
-rw-r--r--arch/xtensa/include/asm/Kbuild1
-rw-r--r--arch/xtensa/include/uapi/asm/socket.h5
67 files changed, 142 insertions, 186 deletions
diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild
index 25b49725df07..76aeb8fa551a 100644
--- a/arch/alpha/include/asm/Kbuild
+++ b/arch/alpha/include/asm/Kbuild
@@ -3,7 +3,6 @@
3generic-y += clkdev.h 3generic-y += clkdev.h
4generic-y += cputime.h 4generic-y += cputime.h
5generic-y += exec.h 5generic-y += exec.h
6generic-y += hash.h
7generic-y += irq_work.h 6generic-y += irq_work.h
8generic-y += mcs_spinlock.h 7generic-y += mcs_spinlock.h
9generic-y += preempt.h 8generic-y += preempt.h
diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h
index 3de1394bcab8..9a20821b111c 100644
--- a/arch/alpha/include/uapi/asm/socket.h
+++ b/arch/alpha/include/uapi/asm/socket.h
@@ -87,4 +87,9 @@
87 87
88#define SO_BPF_EXTENSIONS 48 88#define SO_BPF_EXTENSIONS 48
89 89
90#define SO_INCOMING_CPU 49
91
92#define SO_ATTACH_BPF 50
93#define SO_DETACH_BPF SO_DETACH_FILTER
94
90#endif /* _UAPI_ASM_SOCKET_H */ 95#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild
index b8fffc1a2ac2..be0c39e76f7c 100644
--- a/arch/arc/include/asm/Kbuild
+++ b/arch/arc/include/asm/Kbuild
@@ -12,7 +12,6 @@ generic-y += fb.h
12generic-y += fcntl.h 12generic-y += fcntl.h
13generic-y += ftrace.h 13generic-y += ftrace.h
14generic-y += hardirq.h 14generic-y += hardirq.h
15generic-y += hash.h
16generic-y += hw_irq.h 15generic-y += hw_irq.h
17generic-y += ioctl.h 16generic-y += ioctl.h
18generic-y += ioctls.h 17generic-y += ioctls.h
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index f95f72d62db7..759f9b0053e2 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -97,7 +97,6 @@ CONFIG_PPP_ASYNC=m
97CONFIG_PPP_SYNC_TTY=m 97CONFIG_PPP_SYNC_TTY=m
98CONFIG_PPP_DEFLATE=m 98CONFIG_PPP_DEFLATE=m
99CONFIG_NETCONSOLE=y 99CONFIG_NETCONSOLE=y
100CONFIG_NETPOLL_TRAP=y
101# CONFIG_INPUT_MOUSEDEV is not set 100# CONFIG_INPUT_MOUSEDEV is not set
102CONFIG_INPUT_EVDEV=m 101CONFIG_INPUT_EVDEV=m
103CONFIG_INPUT_EVBUG=m 102CONFIG_INPUT_EVBUG=m
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index 70cd84eb7fda..fe74c0d1e485 100644
--- a/arch/arm/include/asm/Kbuild
+++ b/arch/arm/include/asm/Kbuild
@@ -7,7 +7,6 @@ generic-y += current.h
7generic-y += emergency-restart.h 7generic-y += emergency-restart.h
8generic-y += errno.h 8generic-y += errno.h
9generic-y += exec.h 9generic-y += exec.h
10generic-y += hash.h
11generic-y += ioctl.h 10generic-y += ioctl.h
12generic-y += ipcbuf.h 11generic-y += ipcbuf.h
13generic-y += irq_regs.h 12generic-y += irq_regs.h
diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c
index e90a3148f385..b83f3b7737fb 100644
--- a/arch/arm/kernel/sys_oabi-compat.c
+++ b/arch/arm/kernel/sys_oabi-compat.c
@@ -400,7 +400,7 @@ asmlinkage long sys_oabi_sendto(int fd, void __user *buff,
400 return sys_sendto(fd, buff, len, flags, addr, addrlen); 400 return sys_sendto(fd, buff, len, flags, addr, addrlen);
401} 401}
402 402
403asmlinkage long sys_oabi_sendmsg(int fd, struct msghdr __user *msg, unsigned flags) 403asmlinkage long sys_oabi_sendmsg(int fd, struct user_msghdr __user *msg, unsigned flags)
404{ 404{
405 struct sockaddr __user *addr; 405 struct sockaddr __user *addr;
406 int msg_namelen; 406 int msg_namelen;
@@ -446,7 +446,7 @@ asmlinkage long sys_oabi_socketcall(int call, unsigned long __user *args)
446 break; 446 break;
447 case SYS_SENDMSG: 447 case SYS_SENDMSG:
448 if (copy_from_user(a, args, 3 * sizeof(long)) == 0) 448 if (copy_from_user(a, args, 3 * sizeof(long)) == 0)
449 r = sys_oabi_sendmsg(a[0], (struct msghdr __user *)a[1], a[2]); 449 r = sys_oabi_sendmsg(a[0], (struct user_msghdr __user *)a[1], a[2]);
450 break; 450 break;
451 default: 451 default:
452 r = sys_socketcall(call, args); 452 r = sys_socketcall(call, args);
diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c
index d81b2475e67e..22762a1f9f72 100644
--- a/arch/arm/mach-mmp/gplugd.c
+++ b/arch/arm/mach-mmp/gplugd.c
@@ -158,6 +158,7 @@ struct pxa168_eth_platform_data gplugd_eth_platform_data = {
158 .port_number = 0, 158 .port_number = 0,
159 .phy_addr = 0, 159 .phy_addr = 0,
160 .speed = 0, /* Autonagotiation */ 160 .speed = 0, /* Autonagotiation */
161 .intf = PHY_INTERFACE_MODE_RMII,
161 .init = gplugd_eth_init, 162 .init = gplugd_eth_init,
162}; 163};
163 164
diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild
index dc770bd4f5a5..6b61091c7f4c 100644
--- a/arch/arm64/include/asm/Kbuild
+++ b/arch/arm64/include/asm/Kbuild
@@ -14,7 +14,6 @@ generic-y += early_ioremap.h
14generic-y += emergency-restart.h 14generic-y += emergency-restart.h
15generic-y += errno.h 15generic-y += errno.h
16generic-y += ftrace.h 16generic-y += ftrace.h
17generic-y += hash.h
18generic-y += hw_irq.h 17generic-y += hw_irq.h
19generic-y += ioctl.h 18generic-y += ioctl.h
20generic-y += ioctls.h 19generic-y += ioctls.h
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild
index 2a71b1cb9848..528d70d47a54 100644
--- a/arch/avr32/include/asm/Kbuild
+++ b/arch/avr32/include/asm/Kbuild
@@ -7,7 +7,6 @@ generic-y += div64.h
7generic-y += emergency-restart.h 7generic-y += emergency-restart.h
8generic-y += exec.h 8generic-y += exec.h
9generic-y += futex.h 9generic-y += futex.h
10generic-y += hash.h
11generic-y += irq_regs.h 10generic-y += irq_regs.h
12generic-y += irq_work.h 11generic-y += irq_work.h
13generic-y += local.h 12generic-y += local.h
diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h
index 6e6cd159924b..2b65ed6b277c 100644
--- a/arch/avr32/include/uapi/asm/socket.h
+++ b/arch/avr32/include/uapi/asm/socket.h
@@ -80,4 +80,9 @@
80 80
81#define SO_BPF_EXTENSIONS 48 81#define SO_BPF_EXTENSIONS 48
82 82
83#define SO_INCOMING_CPU 49
84
85#define SO_ATTACH_BPF 50
86#define SO_DETACH_BPF SO_DETACH_FILTER
87
83#endif /* _UAPI__ASM_AVR32_SOCKET_H */ 88#endif /* _UAPI__ASM_AVR32_SOCKET_H */
diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild
index 46ed6bb9c679..4bd3c3cfc9ab 100644
--- a/arch/blackfin/include/asm/Kbuild
+++ b/arch/blackfin/include/asm/Kbuild
@@ -10,7 +10,6 @@ generic-y += emergency-restart.h
10generic-y += errno.h 10generic-y += errno.h
11generic-y += fb.h 11generic-y += fb.h
12generic-y += futex.h 12generic-y += futex.h
13generic-y += hash.h
14generic-y += hw_irq.h 13generic-y += hw_irq.h
15generic-y += ioctl.h 14generic-y += ioctl.h
16generic-y += ipcbuf.h 15generic-y += ipcbuf.h
diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild
index e77e0c1dbe75..2de73391b81e 100644
--- a/arch/c6x/include/asm/Kbuild
+++ b/arch/c6x/include/asm/Kbuild
@@ -15,7 +15,6 @@ generic-y += exec.h
15generic-y += fb.h 15generic-y += fb.h
16generic-y += fcntl.h 16generic-y += fcntl.h
17generic-y += futex.h 17generic-y += futex.h
18generic-y += hash.h
19generic-y += hw_irq.h 18generic-y += hw_irq.h
20generic-y += io.h 19generic-y += io.h
21generic-y += ioctl.h 20generic-y += ioctl.h
diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild
index 2ca489eaadd3..d5f124832fd1 100644
--- a/arch/cris/include/asm/Kbuild
+++ b/arch/cris/include/asm/Kbuild
@@ -7,7 +7,6 @@ generic-y += barrier.h
7generic-y += clkdev.h 7generic-y += clkdev.h
8generic-y += cputime.h 8generic-y += cputime.h
9generic-y += exec.h 9generic-y += exec.h
10generic-y += hash.h
11generic-y += irq_work.h 10generic-y += irq_work.h
12generic-y += kvm_para.h 11generic-y += kvm_para.h
13generic-y += linkage.h 12generic-y += linkage.h
diff --git a/arch/cris/include/uapi/asm/socket.h b/arch/cris/include/uapi/asm/socket.h
index ed94e5ed0a23..e2503d9f1869 100644
--- a/arch/cris/include/uapi/asm/socket.h
+++ b/arch/cris/include/uapi/asm/socket.h
@@ -82,6 +82,11 @@
82 82
83#define SO_BPF_EXTENSIONS 48 83#define SO_BPF_EXTENSIONS 48
84 84
85#define SO_INCOMING_CPU 49
86
87#define SO_ATTACH_BPF 50
88#define SO_DETACH_BPF SO_DETACH_FILTER
89
85#endif /* _ASM_SOCKET_H */ 90#endif /* _ASM_SOCKET_H */
86 91
87 92
diff --git a/arch/frv/include/asm/Kbuild b/arch/frv/include/asm/Kbuild
index 3caf05cabfc5..e3f81b53578e 100644
--- a/arch/frv/include/asm/Kbuild
+++ b/arch/frv/include/asm/Kbuild
@@ -2,7 +2,6 @@
2generic-y += clkdev.h 2generic-y += clkdev.h
3generic-y += cputime.h 3generic-y += cputime.h
4generic-y += exec.h 4generic-y += exec.h
5generic-y += hash.h
6generic-y += irq_work.h 5generic-y += irq_work.h
7generic-y += mcs_spinlock.h 6generic-y += mcs_spinlock.h
8generic-y += preempt.h 7generic-y += preempt.h
diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h
index ca2c6e6f31c6..4823ad125578 100644
--- a/arch/frv/include/uapi/asm/socket.h
+++ b/arch/frv/include/uapi/asm/socket.h
@@ -80,5 +80,10 @@
80 80
81#define SO_BPF_EXTENSIONS 48 81#define SO_BPF_EXTENSIONS 48
82 82
83#define SO_INCOMING_CPU 49
84
85#define SO_ATTACH_BPF 50
86#define SO_DETACH_BPF SO_DETACH_FILTER
87
83#endif /* _ASM_SOCKET_H */ 88#endif /* _ASM_SOCKET_H */
84 89
diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild
index 5f234a5a2320..c7a99f860b40 100644
--- a/arch/hexagon/include/asm/Kbuild
+++ b/arch/hexagon/include/asm/Kbuild
@@ -16,7 +16,6 @@ generic-y += fb.h
16generic-y += fcntl.h 16generic-y += fcntl.h
17generic-y += ftrace.h 17generic-y += ftrace.h
18generic-y += hardirq.h 18generic-y += hardirq.h
19generic-y += hash.h
20generic-y += hw_irq.h 19generic-y += hw_irq.h
21generic-y += ioctl.h 20generic-y += ioctl.h
22generic-y += ioctls.h 21generic-y += ioctls.h
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild
index 747320be9d0e..9b41b4bcc073 100644
--- a/arch/ia64/include/asm/Kbuild
+++ b/arch/ia64/include/asm/Kbuild
@@ -1,7 +1,6 @@
1 1
2generic-y += clkdev.h 2generic-y += clkdev.h
3generic-y += exec.h 3generic-y += exec.h
4generic-y += hash.h
5generic-y += irq_work.h 4generic-y += irq_work.h
6generic-y += kvm_para.h 5generic-y += kvm_para.h
7generic-y += mcs_spinlock.h 6generic-y += mcs_spinlock.h
diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h
index a1b49bac7951..59be3d87f86d 100644
--- a/arch/ia64/include/uapi/asm/socket.h
+++ b/arch/ia64/include/uapi/asm/socket.h
@@ -89,4 +89,9 @@
89 89
90#define SO_BPF_EXTENSIONS 48 90#define SO_BPF_EXTENSIONS 48
91 91
92#define SO_INCOMING_CPU 49
93
94#define SO_ATTACH_BPF 50
95#define SO_DETACH_BPF SO_DETACH_FILTER
96
92#endif /* _ASM_IA64_SOCKET_H */ 97#endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild
index 3796801d6e0c..2edc793372fc 100644
--- a/arch/m32r/include/asm/Kbuild
+++ b/arch/m32r/include/asm/Kbuild
@@ -2,7 +2,6 @@
2generic-y += clkdev.h 2generic-y += clkdev.h
3generic-y += cputime.h 3generic-y += cputime.h
4generic-y += exec.h 4generic-y += exec.h
5generic-y += hash.h
6generic-y += irq_work.h 5generic-y += irq_work.h
7generic-y += mcs_spinlock.h 6generic-y += mcs_spinlock.h
8generic-y += module.h 7generic-y += module.h
diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h
index 6c9a24b3aefa..7bc4cb273856 100644
--- a/arch/m32r/include/uapi/asm/socket.h
+++ b/arch/m32r/include/uapi/asm/socket.h
@@ -80,4 +80,9 @@
80 80
81#define SO_BPF_EXTENSIONS 48 81#define SO_BPF_EXTENSIONS 48
82 82
83#define SO_INCOMING_CPU 49
84
85#define SO_ATTACH_BPF 50
86#define SO_DETACH_BPF SO_DETACH_FILTER
87
83#endif /* _ASM_M32R_SOCKET_H */ 88#endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild
index dbaf9f3065e8..9b6c691874bd 100644
--- a/arch/m68k/include/asm/Kbuild
+++ b/arch/m68k/include/asm/Kbuild
@@ -6,7 +6,6 @@ generic-y += device.h
6generic-y += emergency-restart.h 6generic-y += emergency-restart.h
7generic-y += errno.h 7generic-y += errno.h
8generic-y += exec.h 8generic-y += exec.h
9generic-y += hash.h
10generic-y += hw_irq.h 9generic-y += hw_irq.h
11generic-y += ioctl.h 10generic-y += ioctl.h
12generic-y += ipcbuf.h 11generic-y += ipcbuf.h
diff --git a/arch/metag/include/asm/Kbuild b/arch/metag/include/asm/Kbuild
index 7b8111c8f937..0bf5d525b945 100644
--- a/arch/metag/include/asm/Kbuild
+++ b/arch/metag/include/asm/Kbuild
@@ -13,7 +13,6 @@ generic-y += fb.h
13generic-y += fcntl.h 13generic-y += fcntl.h
14generic-y += futex.h 14generic-y += futex.h
15generic-y += hardirq.h 15generic-y += hardirq.h
16generic-y += hash.h
17generic-y += hw_irq.h 16generic-y += hw_irq.h
18generic-y += ioctl.h 17generic-y += ioctl.h
19generic-y += ioctls.h 18generic-y += ioctls.h
diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild
index 448143b8cabd..ab564a6db5c3 100644
--- a/arch/microblaze/include/asm/Kbuild
+++ b/arch/microblaze/include/asm/Kbuild
@@ -4,7 +4,6 @@ generic-y += clkdev.h
4generic-y += cputime.h 4generic-y += cputime.h
5generic-y += device.h 5generic-y += device.h
6generic-y += exec.h 6generic-y += exec.h
7generic-y += hash.h
8generic-y += irq_work.h 7generic-y += irq_work.h
9generic-y += mcs_spinlock.h 8generic-y += mcs_spinlock.h
10generic-y += preempt.h 9generic-y += preempt.h
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild
index 72e1cf1cab00..200efeac4181 100644
--- a/arch/mips/include/asm/Kbuild
+++ b/arch/mips/include/asm/Kbuild
@@ -3,7 +3,6 @@ generic-y += cputime.h
3generic-y += current.h 3generic-y += current.h
4generic-y += dma-contiguous.h 4generic-y += dma-contiguous.h
5generic-y += emergency-restart.h 5generic-y += emergency-restart.h
6generic-y += hash.h
7generic-y += irq_work.h 6generic-y += irq_work.h
8generic-y += local64.h 7generic-y += local64.h
9generic-y += mcs_spinlock.h 8generic-y += mcs_spinlock.h
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
index a14baa218c76..dec3c850f36b 100644
--- a/arch/mips/include/uapi/asm/socket.h
+++ b/arch/mips/include/uapi/asm/socket.h
@@ -98,4 +98,9 @@
98 98
99#define SO_BPF_EXTENSIONS 48 99#define SO_BPF_EXTENSIONS 48
100 100
101#define SO_INCOMING_CPU 49
102
103#define SO_ATTACH_BPF 50
104#define SO_DETACH_BPF SO_DETACH_FILTER
105
101#endif /* _UAPI_ASM_SOCKET_H */ 106#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
index 9b55143d19db..9fd6834a2172 100644
--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -426,7 +426,7 @@ static inline void emit_mod(unsigned int dst, unsigned int src,
426 u32 *p = &ctx->target[ctx->idx]; 426 u32 *p = &ctx->target[ctx->idx];
427 uasm_i_divu(&p, dst, src); 427 uasm_i_divu(&p, dst, src);
428 p = &ctx->target[ctx->idx + 1]; 428 p = &ctx->target[ctx->idx + 1];
429 uasm_i_mflo(&p, dst); 429 uasm_i_mfhi(&p, dst);
430 } 430 }
431 ctx->idx += 2; /* 2 insts */ 431 ctx->idx += 2; /* 2 insts */
432} 432}
@@ -971,7 +971,7 @@ load_ind:
971 break; 971 break;
972 case BPF_ALU | BPF_MOD | BPF_K: 972 case BPF_ALU | BPF_MOD | BPF_K:
973 /* A %= k */ 973 /* A %= k */
974 if (k == 1 || optimize_div(&k)) { 974 if (k == 1) {
975 ctx->flags |= SEEN_A; 975 ctx->flags |= SEEN_A;
976 emit_jit_reg_move(r_A, r_zero, ctx); 976 emit_jit_reg_move(r_A, r_zero, ctx);
977 } else { 977 } else {
diff --git a/arch/mn10300/include/asm/Kbuild b/arch/mn10300/include/asm/Kbuild
index 54a062cb9f2c..f892d9de47d9 100644
--- a/arch/mn10300/include/asm/Kbuild
+++ b/arch/mn10300/include/asm/Kbuild
@@ -3,7 +3,6 @@ generic-y += barrier.h
3generic-y += clkdev.h 3generic-y += clkdev.h
4generic-y += cputime.h 4generic-y += cputime.h
5generic-y += exec.h 5generic-y += exec.h
6generic-y += hash.h
7generic-y += irq_work.h 6generic-y += irq_work.h
8generic-y += mcs_spinlock.h 7generic-y += mcs_spinlock.h
9generic-y += preempt.h 8generic-y += preempt.h
diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h
index 6aa3ce1854aa..cab7d6d50051 100644
--- a/arch/mn10300/include/uapi/asm/socket.h
+++ b/arch/mn10300/include/uapi/asm/socket.h
@@ -80,4 +80,9 @@
80 80
81#define SO_BPF_EXTENSIONS 48 81#define SO_BPF_EXTENSIONS 48
82 82
83#define SO_INCOMING_CPU 49
84
85#define SO_ATTACH_BPF 50
86#define SO_DETACH_BPF SO_DETACH_FILTER
87
83#endif /* _ASM_SOCKET_H */ 88#endif /* _ASM_SOCKET_H */
diff --git a/arch/nios2/include/asm/Kbuild b/arch/nios2/include/asm/Kbuild
index bb160be0dc28..01c75f36e8b3 100644
--- a/arch/nios2/include/asm/Kbuild
+++ b/arch/nios2/include/asm/Kbuild
@@ -19,7 +19,6 @@ generic-y += fcntl.h
19generic-y += ftrace.h 19generic-y += ftrace.h
20generic-y += futex.h 20generic-y += futex.h
21generic-y += hardirq.h 21generic-y += hardirq.h
22generic-y += hash.h
23generic-y += hw_irq.h 22generic-y += hw_irq.h
24generic-y += ioctl.h 23generic-y += ioctl.h
25generic-y += ioctls.h 24generic-y += ioctls.h
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
index 89b61d7dc790..91f1f360a7c4 100644
--- a/arch/openrisc/include/asm/Kbuild
+++ b/arch/openrisc/include/asm/Kbuild
@@ -25,7 +25,6 @@ generic-y += fcntl.h
25generic-y += ftrace.h 25generic-y += ftrace.h
26generic-y += futex.h 26generic-y += futex.h
27generic-y += hardirq.h 27generic-y += hardirq.h
28generic-y += hash.h
29generic-y += hw_irq.h 28generic-y += hw_irq.h
30generic-y += ioctl.h 29generic-y += ioctl.h
31generic-y += ioctls.h 30generic-y += ioctls.h
diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild
index ffb024b8423f..8686237a3c3c 100644
--- a/arch/parisc/include/asm/Kbuild
+++ b/arch/parisc/include/asm/Kbuild
@@ -7,7 +7,6 @@ generic-y += device.h
7generic-y += div64.h 7generic-y += div64.h
8generic-y += emergency-restart.h 8generic-y += emergency-restart.h
9generic-y += exec.h 9generic-y += exec.h
10generic-y += hash.h
11generic-y += hw_irq.h 10generic-y += hw_irq.h
12generic-y += irq_regs.h 11generic-y += irq_regs.h
13generic-y += irq_work.h 12generic-y += irq_work.h
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
index fe35ceacf0e7..a5cd40cd8ee1 100644
--- a/arch/parisc/include/uapi/asm/socket.h
+++ b/arch/parisc/include/uapi/asm/socket.h
@@ -79,4 +79,9 @@
79 79
80#define SO_BPF_EXTENSIONS 0x4029 80#define SO_BPF_EXTENSIONS 0x4029
81 81
82#define SO_INCOMING_CPU 0x402A
83
84#define SO_ATTACH_BPF 0x402B
85#define SO_DETACH_BPF SO_DETACH_FILTER
86
82#endif /* _UAPI_ASM_SOCKET_H */ 87#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/powerpc/configs/85xx/ge_imp3a_defconfig b/arch/powerpc/configs/85xx/ge_imp3a_defconfig
index dc939de9b5b0..b4c4b469e320 100644
--- a/arch/powerpc/configs/85xx/ge_imp3a_defconfig
+++ b/arch/powerpc/configs/85xx/ge_imp3a_defconfig
@@ -100,7 +100,6 @@ CONFIG_NETDEVICES=y
100CONFIG_BONDING=m 100CONFIG_BONDING=m
101CONFIG_DUMMY=m 101CONFIG_DUMMY=m
102CONFIG_NETCONSOLE=y 102CONFIG_NETCONSOLE=y
103CONFIG_NETPOLL_TRAP=y
104CONFIG_TUN=m 103CONFIG_TUN=m
105# CONFIG_NET_VENDOR_3COM is not set 104# CONFIG_NET_VENDOR_3COM is not set
106CONFIG_FS_ENET=y 105CONFIG_FS_ENET=y
diff --git a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
index e5a648115ada..7cb9719abf3d 100644
--- a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
+++ b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
@@ -113,7 +113,6 @@ CONFIG_SLIP_COMPRESSED=y
113CONFIG_SLIP_SMART=y 113CONFIG_SLIP_SMART=y
114CONFIG_SLIP_MODE_SLIP6=y 114CONFIG_SLIP_MODE_SLIP6=y
115CONFIG_NETCONSOLE=y 115CONFIG_NETCONSOLE=y
116CONFIG_NETPOLL_TRAP=y
117# CONFIG_INPUT_KEYBOARD is not set 116# CONFIG_INPUT_KEYBOARD is not set
118# CONFIG_INPUT_MOUSE is not set 117# CONFIG_INPUT_MOUSE is not set
119# CONFIG_SERIO is not set 118# CONFIG_SERIO is not set
diff --git a/arch/powerpc/configs/86xx/gef_sbc310_defconfig b/arch/powerpc/configs/86xx/gef_sbc310_defconfig
index 8317b6010ba6..ecabf625d249 100644
--- a/arch/powerpc/configs/86xx/gef_sbc310_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc310_defconfig
@@ -114,7 +114,6 @@ CONFIG_SLIP_COMPRESSED=y
114CONFIG_SLIP_SMART=y 114CONFIG_SLIP_SMART=y
115CONFIG_SLIP_MODE_SLIP6=y 115CONFIG_SLIP_MODE_SLIP6=y
116CONFIG_NETCONSOLE=y 116CONFIG_NETCONSOLE=y
117CONFIG_NETPOLL_TRAP=y
118# CONFIG_INPUT_KEYBOARD is not set 117# CONFIG_INPUT_KEYBOARD is not set
119# CONFIG_INPUT_MOUSE is not set 118# CONFIG_INPUT_MOUSE is not set
120# CONFIG_SERIO is not set 119# CONFIG_SERIO is not set
diff --git a/arch/powerpc/configs/86xx/gef_sbc610_defconfig b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
index 124d66f0282c..4a4a86fb0d3d 100644
--- a/arch/powerpc/configs/86xx/gef_sbc610_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
@@ -165,7 +165,6 @@ CONFIG_SLIP_COMPRESSED=y
165CONFIG_SLIP_SMART=y 165CONFIG_SLIP_SMART=y
166CONFIG_SLIP_MODE_SLIP6=y 166CONFIG_SLIP_MODE_SLIP6=y
167CONFIG_NETCONSOLE=y 167CONFIG_NETCONSOLE=y
168CONFIG_NETPOLL_TRAP=y
169CONFIG_INPUT_FF_MEMLESS=m 168CONFIG_INPUT_FF_MEMLESS=m
170# CONFIG_INPUT_KEYBOARD is not set 169# CONFIG_INPUT_KEYBOARD is not set
171# CONFIG_INPUT_MOUSE is not set 170# CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/86xx/sbc8641d_defconfig b/arch/powerpc/configs/86xx/sbc8641d_defconfig
index 1e151594c691..99ea8746bbaf 100644
--- a/arch/powerpc/configs/86xx/sbc8641d_defconfig
+++ b/arch/powerpc/configs/86xx/sbc8641d_defconfig
@@ -167,7 +167,6 @@ CONFIG_SLIP_COMPRESSED=y
167CONFIG_SLIP_SMART=y 167CONFIG_SLIP_SMART=y
168CONFIG_SLIP_MODE_SLIP6=y 168CONFIG_SLIP_MODE_SLIP6=y
169CONFIG_NETCONSOLE=y 169CONFIG_NETCONSOLE=y
170CONFIG_NETPOLL_TRAP=y
171# CONFIG_INPUT_KEYBOARD is not set 170# CONFIG_INPUT_KEYBOARD is not set
172# CONFIG_INPUT_MOUSE is not set 171# CONFIG_INPUT_MOUSE is not set
173# CONFIG_SERIO is not set 172# CONFIG_SERIO is not set
diff --git a/arch/powerpc/configs/c2k_defconfig b/arch/powerpc/configs/c2k_defconfig
index 59734916986a..8a08d6dcb0b4 100644
--- a/arch/powerpc/configs/c2k_defconfig
+++ b/arch/powerpc/configs/c2k_defconfig
@@ -211,7 +211,6 @@ CONFIG_MV643XX_ETH=y
211# CONFIG_NETDEV_10000 is not set 211# CONFIG_NETDEV_10000 is not set
212# CONFIG_ATM_DRIVERS is not set 212# CONFIG_ATM_DRIVERS is not set
213CONFIG_NETCONSOLE=m 213CONFIG_NETCONSOLE=m
214CONFIG_NETPOLL_TRAP=y
215# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 214# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
216CONFIG_INPUT_EVDEV=y 215CONFIG_INPUT_EVDEV=y
217# CONFIG_INPUT_KEYBOARD is not set 216# CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index 20bc5e2d368d..5830d735c5c3 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -154,7 +154,6 @@ CONFIG_WINDFARM_PM121=y
154CONFIG_BONDING=m 154CONFIG_BONDING=m
155CONFIG_DUMMY=m 155CONFIG_DUMMY=m
156CONFIG_NETCONSOLE=y 156CONFIG_NETCONSOLE=y
157CONFIG_NETPOLL_TRAP=y
158CONFIG_TUN=m 157CONFIG_TUN=m
159CONFIG_VIRTIO_NET=m 158CONFIG_VIRTIO_NET=m
160CONFIG_VHOST_NET=m 159CONFIG_VHOST_NET=m
diff --git a/arch/powerpc/configs/ppc64e_defconfig b/arch/powerpc/configs/ppc64e_defconfig
index c3a3269b0865..67885b2d70aa 100644
--- a/arch/powerpc/configs/ppc64e_defconfig
+++ b/arch/powerpc/configs/ppc64e_defconfig
@@ -103,7 +103,6 @@ CONFIG_NETDEVICES=y
103CONFIG_BONDING=m 103CONFIG_BONDING=m
104CONFIG_DUMMY=m 104CONFIG_DUMMY=m
105CONFIG_NETCONSOLE=y 105CONFIG_NETCONSOLE=y
106CONFIG_NETPOLL_TRAP=y
107CONFIG_TUN=m 106CONFIG_TUN=m
108CONFIG_VORTEX=y 107CONFIG_VORTEX=y
109CONFIG_ACENIC=y 108CONFIG_ACENIC=y
diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
index fec5870f1818..ad6d6b5af7d7 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -629,7 +629,6 @@ CONFIG_SLIP_SMART=y
629CONFIG_NET_FC=y 629CONFIG_NET_FC=y
630CONFIG_NETCONSOLE=m 630CONFIG_NETCONSOLE=m
631CONFIG_NETCONSOLE_DYNAMIC=y 631CONFIG_NETCONSOLE_DYNAMIC=y
632CONFIG_NETPOLL_TRAP=y
633CONFIG_VIRTIO_NET=m 632CONFIG_VIRTIO_NET=m
634# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 633# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
635CONFIG_INPUT_JOYDEV=m 634CONFIG_INPUT_JOYDEV=m
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index dd2a9cab4b50..1f97364017c7 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -133,7 +133,6 @@ CONFIG_DM_UEVENT=y
133CONFIG_BONDING=m 133CONFIG_BONDING=m
134CONFIG_DUMMY=m 134CONFIG_DUMMY=m
135CONFIG_NETCONSOLE=y 135CONFIG_NETCONSOLE=y
136CONFIG_NETPOLL_TRAP=y
137CONFIG_TUN=m 136CONFIG_TUN=m
138CONFIG_VIRTIO_NET=m 137CONFIG_VIRTIO_NET=m
139CONFIG_VHOST_NET=m 138CONFIG_VHOST_NET=m
diff --git a/arch/powerpc/configs/pseries_le_defconfig b/arch/powerpc/configs/pseries_le_defconfig
index d2008887eb8c..ac7ca5852827 100644
--- a/arch/powerpc/configs/pseries_le_defconfig
+++ b/arch/powerpc/configs/pseries_le_defconfig
@@ -134,7 +134,6 @@ CONFIG_DM_UEVENT=y
134CONFIG_BONDING=m 134CONFIG_BONDING=m
135CONFIG_DUMMY=m 135CONFIG_DUMMY=m
136CONFIG_NETCONSOLE=y 136CONFIG_NETCONSOLE=y
137CONFIG_NETPOLL_TRAP=y
138CONFIG_TUN=m 137CONFIG_TUN=m
139CONFIG_VIRTIO_NET=m 138CONFIG_VIRTIO_NET=m
140CONFIG_VHOST_NET=m 139CONFIG_VHOST_NET=m
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index 31e8f59aff38..382b28e364dc 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -1,6 +1,5 @@
1 1
2generic-y += clkdev.h 2generic-y += clkdev.h
3generic-y += hash.h
4generic-y += irq_work.h 3generic-y += irq_work.h
5generic-y += mcs_spinlock.h 4generic-y += mcs_spinlock.h
6generic-y += preempt.h 5generic-y += preempt.h
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 6f8536208049..1a5287759fc8 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -204,6 +204,7 @@
204#define PPC_INST_ERATSX_DOT 0x7c000127 204#define PPC_INST_ERATSX_DOT 0x7c000127
205 205
206/* Misc instructions for BPF compiler */ 206/* Misc instructions for BPF compiler */
207#define PPC_INST_LBZ 0x88000000
207#define PPC_INST_LD 0xe8000000 208#define PPC_INST_LD 0xe8000000
208#define PPC_INST_LHZ 0xa0000000 209#define PPC_INST_LHZ 0xa0000000
209#define PPC_INST_LHBRX 0x7c00062c 210#define PPC_INST_LHBRX 0x7c00062c
diff --git a/arch/powerpc/include/uapi/asm/socket.h b/arch/powerpc/include/uapi/asm/socket.h
index a9c3e2e18c05..c046666038f8 100644
--- a/arch/powerpc/include/uapi/asm/socket.h
+++ b/arch/powerpc/include/uapi/asm/socket.h
@@ -87,4 +87,9 @@
87 87
88#define SO_BPF_EXTENSIONS 48 88#define SO_BPF_EXTENSIONS 48
89 89
90#define SO_INCOMING_CPU 49
91
92#define SO_ATTACH_BPF 50
93#define SO_DETACH_BPF SO_DETACH_FILTER
94
90#endif /* _ASM_POWERPC_SOCKET_H */ 95#endif /* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h
index 9aee27c582dc..c406aa95b2bc 100644
--- a/arch/powerpc/net/bpf_jit.h
+++ b/arch/powerpc/net/bpf_jit.h
@@ -87,6 +87,9 @@ DECLARE_LOAD_FUNC(sk_load_byte_msh);
87#define PPC_STD(r, base, i) EMIT(PPC_INST_STD | ___PPC_RS(r) | \ 87#define PPC_STD(r, base, i) EMIT(PPC_INST_STD | ___PPC_RS(r) | \
88 ___PPC_RA(base) | ((i) & 0xfffc)) 88 ___PPC_RA(base) | ((i) & 0xfffc))
89 89
90
91#define PPC_LBZ(r, base, i) EMIT(PPC_INST_LBZ | ___PPC_RT(r) | \
92 ___PPC_RA(base) | IMM_L(i))
90#define PPC_LD(r, base, i) EMIT(PPC_INST_LD | ___PPC_RT(r) | \ 93#define PPC_LD(r, base, i) EMIT(PPC_INST_LD | ___PPC_RT(r) | \
91 ___PPC_RA(base) | IMM_L(i)) 94 ___PPC_RA(base) | IMM_L(i))
92#define PPC_LWZ(r, base, i) EMIT(PPC_INST_LWZ | ___PPC_RT(r) | \ 95#define PPC_LWZ(r, base, i) EMIT(PPC_INST_LWZ | ___PPC_RT(r) | \
@@ -96,6 +99,10 @@ DECLARE_LOAD_FUNC(sk_load_byte_msh);
96#define PPC_LHBRX(r, base, b) EMIT(PPC_INST_LHBRX | ___PPC_RT(r) | \ 99#define PPC_LHBRX(r, base, b) EMIT(PPC_INST_LHBRX | ___PPC_RT(r) | \
97 ___PPC_RA(base) | ___PPC_RB(b)) 100 ___PPC_RA(base) | ___PPC_RB(b))
98/* Convenience helpers for the above with 'far' offsets: */ 101/* Convenience helpers for the above with 'far' offsets: */
102#define PPC_LBZ_OFFS(r, base, i) do { if ((i) < 32768) PPC_LBZ(r, base, i); \
103 else { PPC_ADDIS(r, base, IMM_HA(i)); \
104 PPC_LBZ(r, r, IMM_L(i)); } } while(0)
105
99#define PPC_LD_OFFS(r, base, i) do { if ((i) < 32768) PPC_LD(r, base, i); \ 106#define PPC_LD_OFFS(r, base, i) do { if ((i) < 32768) PPC_LD(r, base, i); \
100 else { PPC_ADDIS(r, base, IMM_HA(i)); \ 107 else { PPC_ADDIS(r, base, IMM_HA(i)); \
101 PPC_LD(r, r, IMM_L(i)); } } while(0) 108 PPC_LD(r, r, IMM_L(i)); } } while(0)
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index cbae2dfd053c..1ca125b9c226 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -181,6 +181,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
181 } 181 }
182 break; 182 break;
183 case BPF_ALU | BPF_MOD | BPF_X: /* A %= X; */ 183 case BPF_ALU | BPF_MOD | BPF_X: /* A %= X; */
184 case BPF_ALU | BPF_DIV | BPF_X: /* A /= X; */
184 ctx->seen |= SEEN_XREG; 185 ctx->seen |= SEEN_XREG;
185 PPC_CMPWI(r_X, 0); 186 PPC_CMPWI(r_X, 0);
186 if (ctx->pc_ret0 != -1) { 187 if (ctx->pc_ret0 != -1) {
@@ -190,9 +191,13 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
190 PPC_LI(r_ret, 0); 191 PPC_LI(r_ret, 0);
191 PPC_JMP(exit_addr); 192 PPC_JMP(exit_addr);
192 } 193 }
193 PPC_DIVWU(r_scratch1, r_A, r_X); 194 if (code == (BPF_ALU | BPF_MOD | BPF_X)) {
194 PPC_MUL(r_scratch1, r_X, r_scratch1); 195 PPC_DIVWU(r_scratch1, r_A, r_X);
195 PPC_SUB(r_A, r_A, r_scratch1); 196 PPC_MUL(r_scratch1, r_X, r_scratch1);
197 PPC_SUB(r_A, r_A, r_scratch1);
198 } else {
199 PPC_DIVWU(r_A, r_A, r_X);
200 }
196 break; 201 break;
197 case BPF_ALU | BPF_MOD | BPF_K: /* A %= K; */ 202 case BPF_ALU | BPF_MOD | BPF_K: /* A %= K; */
198 PPC_LI32(r_scratch2, K); 203 PPC_LI32(r_scratch2, K);
@@ -200,22 +205,6 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
200 PPC_MUL(r_scratch1, r_scratch2, r_scratch1); 205 PPC_MUL(r_scratch1, r_scratch2, r_scratch1);
201 PPC_SUB(r_A, r_A, r_scratch1); 206 PPC_SUB(r_A, r_A, r_scratch1);
202 break; 207 break;
203 case BPF_ALU | BPF_DIV | BPF_X: /* A /= X; */
204 ctx->seen |= SEEN_XREG;
205 PPC_CMPWI(r_X, 0);
206 if (ctx->pc_ret0 != -1) {
207 PPC_BCC(COND_EQ, addrs[ctx->pc_ret0]);
208 } else {
209 /*
210 * Exit, returning 0; first pass hits here
211 * (longer worst-case code size).
212 */
213 PPC_BCC_SHORT(COND_NE, (ctx->idx*4)+12);
214 PPC_LI(r_ret, 0);
215 PPC_JMP(exit_addr);
216 }
217 PPC_DIVWU(r_A, r_A, r_X);
218 break;
219 case BPF_ALU | BPF_DIV | BPF_K: /* A /= K */ 208 case BPF_ALU | BPF_DIV | BPF_K: /* A /= K */
220 if (K == 1) 209 if (K == 1)
221 break; 210 break;
@@ -361,6 +350,11 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
361 protocol)); 350 protocol));
362 break; 351 break;
363 case BPF_ANC | SKF_AD_IFINDEX: 352 case BPF_ANC | SKF_AD_IFINDEX:
353 case BPF_ANC | SKF_AD_HATYPE:
354 BUILD_BUG_ON(FIELD_SIZEOF(struct net_device,
355 ifindex) != 4);
356 BUILD_BUG_ON(FIELD_SIZEOF(struct net_device,
357 type) != 2);
364 PPC_LD_OFFS(r_scratch1, r_skb, offsetof(struct sk_buff, 358 PPC_LD_OFFS(r_scratch1, r_skb, offsetof(struct sk_buff,
365 dev)); 359 dev));
366 PPC_CMPDI(r_scratch1, 0); 360 PPC_CMPDI(r_scratch1, 0);
@@ -368,14 +362,18 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
368 PPC_BCC(COND_EQ, addrs[ctx->pc_ret0]); 362 PPC_BCC(COND_EQ, addrs[ctx->pc_ret0]);
369 } else { 363 } else {
370 /* Exit, returning 0; first pass hits here. */ 364 /* Exit, returning 0; first pass hits here. */
371 PPC_BCC_SHORT(COND_NE, (ctx->idx*4)+12); 365 PPC_BCC_SHORT(COND_NE, ctx->idx * 4 + 12);
372 PPC_LI(r_ret, 0); 366 PPC_LI(r_ret, 0);
373 PPC_JMP(exit_addr); 367 PPC_JMP(exit_addr);
374 } 368 }
375 BUILD_BUG_ON(FIELD_SIZEOF(struct net_device, 369 if (code == (BPF_ANC | SKF_AD_IFINDEX)) {
376 ifindex) != 4); 370 PPC_LWZ_OFFS(r_A, r_scratch1,
377 PPC_LWZ_OFFS(r_A, r_scratch1,
378 offsetof(struct net_device, ifindex)); 371 offsetof(struct net_device, ifindex));
372 } else {
373 PPC_LHZ_OFFS(r_A, r_scratch1,
374 offsetof(struct net_device, type));
375 }
376
379 break; 377 break;
380 case BPF_ANC | SKF_AD_MARK: 378 case BPF_ANC | SKF_AD_MARK:
381 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, mark) != 4); 379 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, mark) != 4);
@@ -407,6 +405,11 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
407 PPC_LHZ_OFFS(r_A, r_skb, offsetof(struct sk_buff, 405 PPC_LHZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,
408 queue_mapping)); 406 queue_mapping));
409 break; 407 break;
408 case BPF_ANC | SKF_AD_PKTTYPE:
409 PPC_LBZ_OFFS(r_A, r_skb, PKT_TYPE_OFFSET());
410 PPC_ANDI(r_A, r_A, PKT_TYPE_MAX);
411 PPC_SRWI(r_A, r_A, 5);
412 break;
410 case BPF_ANC | SKF_AD_CPU: 413 case BPF_ANC | SKF_AD_CPU:
411#ifdef CONFIG_SMP 414#ifdef CONFIG_SMP
412 /* 415 /*
diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild
index 773f86676588..c631f98fd524 100644
--- a/arch/s390/include/asm/Kbuild
+++ b/arch/s390/include/asm/Kbuild
@@ -1,7 +1,6 @@
1 1
2 2
3generic-y += clkdev.h 3generic-y += clkdev.h
4generic-y += hash.h
5generic-y += irq_work.h 4generic-y += irq_work.h
6generic-y += mcs_spinlock.h 5generic-y += mcs_spinlock.h
7generic-y += preempt.h 6generic-y += preempt.h
diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h
index e031332096d7..296942d56e6a 100644
--- a/arch/s390/include/uapi/asm/socket.h
+++ b/arch/s390/include/uapi/asm/socket.h
@@ -86,4 +86,9 @@
86 86
87#define SO_BPF_EXTENSIONS 48 87#define SO_BPF_EXTENSIONS 48
88 88
89#define SO_INCOMING_CPU 49
90
91#define SO_ATTACH_BPF 50
92#define SO_DETACH_BPF SO_DETACH_FILTER
93
89#endif /* _ASM_SOCKET_H */ 94#endif /* _ASM_SOCKET_H */
diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild
index 46461c19f284..83ed116d414c 100644
--- a/arch/score/include/asm/Kbuild
+++ b/arch/score/include/asm/Kbuild
@@ -5,7 +5,6 @@ header-y +=
5generic-y += barrier.h 5generic-y += barrier.h
6generic-y += clkdev.h 6generic-y += clkdev.h
7generic-y += cputime.h 7generic-y += cputime.h
8generic-y += hash.h
9generic-y += irq_work.h 8generic-y += irq_work.h
10generic-y += mcs_spinlock.h 9generic-y += mcs_spinlock.h
11generic-y += preempt.h 10generic-y += preempt.h
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild
index 5a6c9acff0d2..654ebb6bd5d8 100644
--- a/arch/sh/include/asm/Kbuild
+++ b/arch/sh/include/asm/Kbuild
@@ -8,7 +8,6 @@ generic-y += emergency-restart.h
8generic-y += errno.h 8generic-y += errno.h
9generic-y += exec.h 9generic-y += exec.h
10generic-y += fcntl.h 10generic-y += fcntl.h
11generic-y += hash.h
12generic-y += ioctl.h 11generic-y += ioctl.h
13generic-y += ipcbuf.h 12generic-y += ipcbuf.h
14generic-y += irq_regs.h 13generic-y += irq_regs.h
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index f5f94ce1692c..94f36e7086a7 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -6,7 +6,6 @@ generic-y += cputime.h
6generic-y += div64.h 6generic-y += div64.h
7generic-y += emergency-restart.h 7generic-y += emergency-restart.h
8generic-y += exec.h 8generic-y += exec.h
9generic-y += hash.h
10generic-y += irq_regs.h 9generic-y += irq_regs.h
11generic-y += irq_work.h 10generic-y += irq_work.h
12generic-y += linkage.h 11generic-y += linkage.h
diff --git a/arch/sparc/include/asm/vio.h b/arch/sparc/include/asm/vio.h
index d758c8d8f47d..fb124feb363b 100644
--- a/arch/sparc/include/asm/vio.h
+++ b/arch/sparc/include/asm/vio.h
@@ -247,6 +247,25 @@ struct vio_net_desc {
247 struct ldc_trans_cookie cookies[0]; 247 struct ldc_trans_cookie cookies[0];
248}; 248};
249 249
250struct vio_net_dext {
251 u8 flags;
252#define VNET_PKT_HASH 0x01
253#define VNET_PKT_HCK_IPV4_HDRCKSUM 0x02
254#define VNET_PKT_HCK_FULLCKSUM 0x04
255#define VNET_PKT_IPV4_LSO 0x08
256#define VNET_PKT_HCK_IPV4_HDRCKSUM_OK 0x10
257#define VNET_PKT_HCK_FULLCKSUM_OK 0x20
258
259 u8 vnet_hashval;
260 u16 ipv4_lso_mss;
261 u32 resv3;
262};
263
264static inline struct vio_net_dext *vio_net_ext(struct vio_net_desc *desc)
265{
266 return (struct vio_net_dext *)&desc->cookies[2];
267}
268
250#define VIO_MAX_RING_COOKIES 24 269#define VIO_MAX_RING_COOKIES 24
251 270
252struct vio_dring_state { 271struct vio_dring_state {
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h
index 54d9608681b6..e6a16c40be5f 100644
--- a/arch/sparc/include/uapi/asm/socket.h
+++ b/arch/sparc/include/uapi/asm/socket.h
@@ -76,6 +76,11 @@
76 76
77#define SO_BPF_EXTENSIONS 0x0032 77#define SO_BPF_EXTENSIONS 0x0032
78 78
79#define SO_INCOMING_CPU 0x0033
80
81#define SO_ATTACH_BPF 0x0034
82#define SO_DETACH_BPF SO_DETACH_FILTER
83
79/* Security levels - as per NRL IPv6 - don't actually do anything */ 84/* Security levels - as per NRL IPv6 - don't actually do anything */
80#define SO_SECURITY_AUTHENTICATION 0x5001 85#define SO_SECURITY_AUTHENTICATION 0x5001
81#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 86#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
diff --git a/arch/tile/configs/tilegx_defconfig b/arch/tile/configs/tilegx_defconfig
index 91de7dd7427f..37dc9364c4a1 100644
--- a/arch/tile/configs/tilegx_defconfig
+++ b/arch/tile/configs/tilegx_defconfig
@@ -218,7 +218,6 @@ CONFIG_MACVLAN=m
218CONFIG_MACVTAP=m 218CONFIG_MACVTAP=m
219CONFIG_NETCONSOLE=m 219CONFIG_NETCONSOLE=m
220CONFIG_NETCONSOLE_DYNAMIC=y 220CONFIG_NETCONSOLE_DYNAMIC=y
221CONFIG_NETPOLL_TRAP=y
222CONFIG_TUN=y 221CONFIG_TUN=y
223CONFIG_VETH=m 222CONFIG_VETH=m
224CONFIG_NET_DSA_MV88E6060=y 223CONFIG_NET_DSA_MV88E6060=y
diff --git a/arch/tile/configs/tilepro_defconfig b/arch/tile/configs/tilepro_defconfig
index c7702b7ab7a5..76a2781dec2c 100644
--- a/arch/tile/configs/tilepro_defconfig
+++ b/arch/tile/configs/tilepro_defconfig
@@ -337,7 +337,6 @@ CONFIG_MACVLAN=m
337CONFIG_MACVTAP=m 337CONFIG_MACVTAP=m
338CONFIG_NETCONSOLE=m 338CONFIG_NETCONSOLE=m
339CONFIG_NETCONSOLE_DYNAMIC=y 339CONFIG_NETCONSOLE_DYNAMIC=y
340CONFIG_NETPOLL_TRAP=y
341CONFIG_TUN=y 340CONFIG_TUN=y
342CONFIG_VETH=m 341CONFIG_VETH=m
343CONFIG_NET_DSA_MV88E6060=y 342CONFIG_NET_DSA_MV88E6060=y
diff --git a/arch/tile/include/asm/Kbuild b/arch/tile/include/asm/Kbuild
index e6462b8a6284..b4c488b65745 100644
--- a/arch/tile/include/asm/Kbuild
+++ b/arch/tile/include/asm/Kbuild
@@ -11,7 +11,6 @@ generic-y += errno.h
11generic-y += exec.h 11generic-y += exec.h
12generic-y += fb.h 12generic-y += fb.h
13generic-y += fcntl.h 13generic-y += fcntl.h
14generic-y += hash.h
15generic-y += hw_irq.h 14generic-y += hw_irq.h
16generic-y += ioctl.h 15generic-y += ioctl.h
17generic-y += ioctls.h 16generic-y += ioctls.h
diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
index 244b12c8cb39..9176fa11d49b 100644
--- a/arch/um/include/asm/Kbuild
+++ b/arch/um/include/asm/Kbuild
@@ -10,7 +10,6 @@ generic-y += exec.h
10generic-y += ftrace.h 10generic-y += ftrace.h
11generic-y += futex.h 11generic-y += futex.h
12generic-y += hardirq.h 12generic-y += hardirq.h
13generic-y += hash.h
14generic-y += hw_irq.h 13generic-y += hw_irq.h
15generic-y += io.h 14generic-y += io.h
16generic-y += irq_regs.h 15generic-y += irq_regs.h
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild
index 5a2bb53faa42..3e0c19d0f4c5 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -16,7 +16,6 @@ generic-y += fcntl.h
16generic-y += ftrace.h 16generic-y += ftrace.h
17generic-y += futex.h 17generic-y += futex.h
18generic-y += hardirq.h 18generic-y += hardirq.h
19generic-y += hash.h
20generic-y += hw_irq.h 19generic-y += hw_irq.h
21generic-y += ioctl.h 20generic-y += ioctl.h
22generic-y += ioctls.h 21generic-y += ioctls.h
diff --git a/arch/x86/include/asm/hash.h b/arch/x86/include/asm/hash.h
deleted file mode 100644
index e8c58f88b1d4..000000000000
--- a/arch/x86/include/asm/hash.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _ASM_X86_HASH_H
2#define _ASM_X86_HASH_H
3
4struct fast_hash_ops;
5extern void setup_arch_fast_hash(struct fast_hash_ops *ops);
6
7#endif /* _ASM_X86_HASH_H */
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index db92793b7e23..1530afb07c85 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -23,7 +23,7 @@ lib-y += memcpy_$(BITS).o
23lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o 23lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
24lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o 24lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o
25 25
26obj-y += msr.o msr-reg.o msr-reg-export.o hash.o 26obj-y += msr.o msr-reg.o msr-reg-export.o
27 27
28ifeq ($(CONFIG_X86_32),y) 28ifeq ($(CONFIG_X86_32),y)
29 obj-y += atomic64_32.o 29 obj-y += atomic64_32.o
diff --git a/arch/x86/lib/hash.c b/arch/x86/lib/hash.c
deleted file mode 100644
index ff4fa51a5b1f..000000000000
--- a/arch/x86/lib/hash.c
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * Some portions derived from code covered by the following notice:
3 *
4 * Copyright (c) 2010-2013 Intel Corporation. All rights reserved.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#include <linux/hash.h>
35#include <linux/init.h>
36
37#include <asm/processor.h>
38#include <asm/cpufeature.h>
39#include <asm/hash.h>
40
41static inline u32 crc32_u32(u32 crc, u32 val)
42{
43#ifdef CONFIG_AS_CRC32
44 asm ("crc32l %1,%0\n" : "+r" (crc) : "rm" (val));
45#else
46 asm (".byte 0xf2, 0x0f, 0x38, 0xf1, 0xc1" : "+a" (crc) : "c" (val));
47#endif
48 return crc;
49}
50
51static u32 intel_crc4_2_hash(const void *data, u32 len, u32 seed)
52{
53 const u32 *p32 = (const u32 *) data;
54 u32 i, tmp = 0;
55
56 for (i = 0; i < len / 4; i++)
57 seed = crc32_u32(seed, *p32++);
58
59 switch (len & 3) {
60 case 3:
61 tmp |= *((const u8 *) p32 + 2) << 16;
62 /* fallthrough */
63 case 2:
64 tmp |= *((const u8 *) p32 + 1) << 8;
65 /* fallthrough */
66 case 1:
67 tmp |= *((const u8 *) p32);
68 seed = crc32_u32(seed, tmp);
69 break;
70 }
71
72 return seed;
73}
74
75static u32 intel_crc4_2_hash2(const u32 *data, u32 len, u32 seed)
76{
77 const u32 *p32 = (const u32 *) data;
78 u32 i;
79
80 for (i = 0; i < len; i++)
81 seed = crc32_u32(seed, *p32++);
82
83 return seed;
84}
85
86void __init setup_arch_fast_hash(struct fast_hash_ops *ops)
87{
88 if (cpu_has_xmm4_2) {
89 ops->hash = intel_crc4_2_hash;
90 ops->hash2 = intel_crc4_2_hash2;
91 }
92}
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 3f627345d51c..987514396c1e 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -24,7 +24,7 @@ extern u8 sk_load_byte_positive_offset[];
24extern u8 sk_load_word_negative_offset[], sk_load_half_negative_offset[]; 24extern u8 sk_load_word_negative_offset[], sk_load_half_negative_offset[];
25extern u8 sk_load_byte_negative_offset[]; 25extern u8 sk_load_byte_negative_offset[];
26 26
27static inline u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len) 27static u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len)
28{ 28{
29 if (len == 1) 29 if (len == 1)
30 *ptr = bytes; 30 *ptr = bytes;
@@ -52,12 +52,12 @@ static inline u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len)
52#define EMIT4_off32(b1, b2, b3, b4, off) \ 52#define EMIT4_off32(b1, b2, b3, b4, off) \
53 do {EMIT4(b1, b2, b3, b4); EMIT(off, 4); } while (0) 53 do {EMIT4(b1, b2, b3, b4); EMIT(off, 4); } while (0)
54 54
55static inline bool is_imm8(int value) 55static bool is_imm8(int value)
56{ 56{
57 return value <= 127 && value >= -128; 57 return value <= 127 && value >= -128;
58} 58}
59 59
60static inline bool is_simm32(s64 value) 60static bool is_simm32(s64 value)
61{ 61{
62 return value == (s64) (s32) value; 62 return value == (s64) (s32) value;
63} 63}
@@ -94,7 +94,7 @@ static int bpf_size_to_x86_bytes(int bpf_size)
94#define X86_JGE 0x7D 94#define X86_JGE 0x7D
95#define X86_JG 0x7F 95#define X86_JG 0x7F
96 96
97static inline void bpf_flush_icache(void *start, void *end) 97static void bpf_flush_icache(void *start, void *end)
98{ 98{
99 mm_segment_t old_fs = get_fs(); 99 mm_segment_t old_fs = get_fs();
100 100
@@ -133,24 +133,24 @@ static const int reg2hex[] = {
133 * which need extra byte of encoding. 133 * which need extra byte of encoding.
134 * rax,rcx,...,rbp have simpler encoding 134 * rax,rcx,...,rbp have simpler encoding
135 */ 135 */
136static inline bool is_ereg(u32 reg) 136static bool is_ereg(u32 reg)
137{ 137{
138 if (reg == BPF_REG_5 || reg == AUX_REG || 138 return (1 << reg) & (BIT(BPF_REG_5) |
139 (reg >= BPF_REG_7 && reg <= BPF_REG_9)) 139 BIT(AUX_REG) |
140 return true; 140 BIT(BPF_REG_7) |
141 else 141 BIT(BPF_REG_8) |
142 return false; 142 BIT(BPF_REG_9));
143} 143}
144 144
145/* add modifiers if 'reg' maps to x64 registers r8..r15 */ 145/* add modifiers if 'reg' maps to x64 registers r8..r15 */
146static inline u8 add_1mod(u8 byte, u32 reg) 146static u8 add_1mod(u8 byte, u32 reg)
147{ 147{
148 if (is_ereg(reg)) 148 if (is_ereg(reg))
149 byte |= 1; 149 byte |= 1;
150 return byte; 150 return byte;
151} 151}
152 152
153static inline u8 add_2mod(u8 byte, u32 r1, u32 r2) 153static u8 add_2mod(u8 byte, u32 r1, u32 r2)
154{ 154{
155 if (is_ereg(r1)) 155 if (is_ereg(r1))
156 byte |= 1; 156 byte |= 1;
@@ -160,13 +160,13 @@ static inline u8 add_2mod(u8 byte, u32 r1, u32 r2)
160} 160}
161 161
162/* encode 'dst_reg' register into x64 opcode 'byte' */ 162/* encode 'dst_reg' register into x64 opcode 'byte' */
163static inline u8 add_1reg(u8 byte, u32 dst_reg) 163static u8 add_1reg(u8 byte, u32 dst_reg)
164{ 164{
165 return byte + reg2hex[dst_reg]; 165 return byte + reg2hex[dst_reg];
166} 166}
167 167
168/* encode 'dst_reg' and 'src_reg' registers into x64 opcode 'byte' */ 168/* encode 'dst_reg' and 'src_reg' registers into x64 opcode 'byte' */
169static inline u8 add_2reg(u8 byte, u32 dst_reg, u32 src_reg) 169static u8 add_2reg(u8 byte, u32 dst_reg, u32 src_reg)
170{ 170{
171 return byte + reg2hex[dst_reg] + (reg2hex[src_reg] << 3); 171 return byte + reg2hex[dst_reg] + (reg2hex[src_reg] << 3);
172} 172}
@@ -178,7 +178,7 @@ static void jit_fill_hole(void *area, unsigned int size)
178} 178}
179 179
180struct jit_context { 180struct jit_context {
181 unsigned int cleanup_addr; /* epilogue code offset */ 181 int cleanup_addr; /* epilogue code offset */
182 bool seen_ld_abs; 182 bool seen_ld_abs;
183}; 183};
184 184
@@ -192,6 +192,7 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
192 struct bpf_insn *insn = bpf_prog->insnsi; 192 struct bpf_insn *insn = bpf_prog->insnsi;
193 int insn_cnt = bpf_prog->len; 193 int insn_cnt = bpf_prog->len;
194 bool seen_ld_abs = ctx->seen_ld_abs | (oldproglen == 0); 194 bool seen_ld_abs = ctx->seen_ld_abs | (oldproglen == 0);
195 bool seen_exit = false;
195 u8 temp[BPF_MAX_INSN_SIZE + BPF_INSN_SAFETY]; 196 u8 temp[BPF_MAX_INSN_SIZE + BPF_INSN_SAFETY];
196 int i; 197 int i;
197 int proglen = 0; 198 int proglen = 0;
@@ -854,10 +855,11 @@ common_load:
854 goto common_load; 855 goto common_load;
855 856
856 case BPF_JMP | BPF_EXIT: 857 case BPF_JMP | BPF_EXIT:
857 if (i != insn_cnt - 1) { 858 if (seen_exit) {
858 jmp_offset = ctx->cleanup_addr - addrs[i]; 859 jmp_offset = ctx->cleanup_addr - addrs[i];
859 goto emit_jmp; 860 goto emit_jmp;
860 } 861 }
862 seen_exit = true;
861 /* update cleanup_addr */ 863 /* update cleanup_addr */
862 ctx->cleanup_addr = proglen; 864 ctx->cleanup_addr = proglen;
863 /* mov rbx, qword ptr [rbp-X] */ 865 /* mov rbx, qword ptr [rbp-X] */
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild
index 105d38922c44..86a9ab2e2ca9 100644
--- a/arch/xtensa/include/asm/Kbuild
+++ b/arch/xtensa/include/asm/Kbuild
@@ -9,7 +9,6 @@ generic-y += errno.h
9generic-y += exec.h 9generic-y += exec.h
10generic-y += fcntl.h 10generic-y += fcntl.h
11generic-y += hardirq.h 11generic-y += hardirq.h
12generic-y += hash.h
13generic-y += ioctl.h 12generic-y += ioctl.h
14generic-y += irq_regs.h 13generic-y += irq_regs.h
15generic-y += irq_work.h 14generic-y += irq_work.h
diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h
index 39acec0cf0b1..4120af086160 100644
--- a/arch/xtensa/include/uapi/asm/socket.h
+++ b/arch/xtensa/include/uapi/asm/socket.h
@@ -91,4 +91,9 @@
91 91
92#define SO_BPF_EXTENSIONS 48 92#define SO_BPF_EXTENSIONS 48
93 93
94#define SO_INCOMING_CPU 49
95
96#define SO_ATTACH_BPF 50
97#define SO_DETACH_BPF SO_DETACH_FILTER
98
94#endif /* _XTENSA_SOCKET_H */ 99#endif /* _XTENSA_SOCKET_H */