Rename unwinder config symbols to match upstream changes.
Refresh patches.
Update patch that no longer applies: 202-reduce_module_size.patch
Also enable CONFIG_PAGE_TABLE_ISOLATION. This feature was backported
from 4.15 to the 4.14 stable series. It is enabled by default, so enable
it in OpenWrt as well.
Compile-tested on x86/64.
Runtime-tested on x86/64.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
LINUX_VERSION-3.18 = .71
LINUX_VERSION-4.4 = .108
LINUX_VERSION-4.9 = .73
-LINUX_VERSION-4.14 = .6
+LINUX_VERSION-4.14 = .11
LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
LINUX_KERNEL_HASH-4.4.108 = 5a001198625ce9f7b0ef1e4b43e033aea859e1ef3509532412cce8f0375ba51a
LINUX_KERNEL_HASH-4.9.73 = 558b65c53f6d6c421d897ad4b651e51ba341fe4dd97122ec922e23ebd2c16e2b
-LINUX_KERNEL_HASH-4.14.6 = 0907678ba9ea146ddbdecd0a0b6363f56b896b5c61c9a15e809effb3ea346ccc
+LINUX_KERNEL_HASH-4.14.11 = 7768956a513f1d4eeb49ba6b55c5b131da60f1a698a3b3657718bf23a6b86d0a
ifdef KERNEL_PATCHVER
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
--- a/Makefile
+++ b/Makefile
-@@ -415,8 +415,8 @@ KERNELRELEASE = $(shell cat include/conf
+@@ -410,8 +410,8 @@ KERNELRELEASE = $(shell cat include/conf
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
--- a/Makefile
+++ b/Makefile
-@@ -408,7 +408,7 @@ KBUILD_CFLAGS_KERNEL :=
- KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE)
+@@ -402,7 +402,7 @@ KBUILD_AFLAGS_KERNEL :=
+ KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
-KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
+KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s)
+ GCC_PLUGINS_CFLAGS :=
# Read KERNELRELEASE from include/config/kernel.release (if it exists)
- KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
--- a/Makefile
+++ b/Makefile
-@@ -1208,7 +1208,6 @@ all: modules
+@@ -1212,7 +1212,6 @@ all: modules
PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
-@@ -1237,7 +1236,6 @@ _modinst_:
+@@ -1241,7 +1240,6 @@ _modinst_:
rm -f $(MODLIB)/build ; \
ln -s $(CURDIR) $(MODLIB)/build ; \
fi
--- a/Makefile
+++ b/Makefile
-@@ -410,6 +410,11 @@ KBUILD_AFLAGS_MODULE := -DMODULE
- KBUILD_CFLAGS_MODULE := -DMODULE
+@@ -405,6 +405,11 @@ KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s)
+ GCC_PLUGINS_CFLAGS :=
+ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
+KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,)
# Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
-@@ -783,11 +788,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH
+@@ -784,11 +789,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH
KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
endif
*/
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -2492,6 +2492,10 @@ static inline int pskb_trim(struct sk_bu
+@@ -2494,6 +2494,10 @@ static inline int pskb_trim(struct sk_bu
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
}
/**
* pskb_trim_unique - remove end from a paged unique (not cloned) buffer
* @skb: buffer to alter
-@@ -2622,16 +2626,6 @@ static inline struct sk_buff *dev_alloc_
+@@ -2624,16 +2628,6 @@ static inline struct sk_buff *dev_alloc_
}
help
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -2974,10 +2974,20 @@ static int xmit_one(struct sk_buff *skb,
+@@ -2975,10 +2975,20 @@ static int xmit_one(struct sk_buff *skb,
if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all))
dev_queue_xmit_nit(skb, dev);
}
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
-@@ -144,7 +144,10 @@ static const struct file_operations proc
+@@ -145,7 +145,10 @@ static const struct file_operations proc
void proc_tty_register_driver(struct tty_driver *driver)
{
struct proc_dir_entry *ent;
if (!driver->driver_name || driver->proc_entry ||
!driver->ops->proc_fops)
return;
-@@ -161,6 +164,9 @@ void proc_tty_unregister_driver(struct t
+@@ -162,6 +165,9 @@ void proc_tty_unregister_driver(struct t
{
struct proc_dir_entry *ent;
ent = driver->proc_entry;
if (!ent)
return;
-@@ -175,6 +181,9 @@ void proc_tty_unregister_driver(struct t
+@@ -176,6 +182,9 @@ void proc_tty_unregister_driver(struct t
*/
void __init proc_tty_init(void)
{
--- a/Makefile
+++ b/Makefile
-@@ -637,12 +637,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni
+@@ -638,12 +638,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += $(call cc-option,-Oz,-Os)
#define PACKET_FANOUT_LB 1
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
-@@ -1829,6 +1829,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -1822,6 +1822,7 @@ static int packet_rcv_spkt(struct sk_buf
{
struct sock *sk;
struct sockaddr_pkt *spkt;
/*
* When we registered the protocol we saved the socket in the data
-@@ -1836,6 +1837,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -1829,6 +1830,7 @@ static int packet_rcv_spkt(struct sk_buf
*/
sk = pt->af_packet_priv;
/*
* Yank back the headers [hope the device set this
-@@ -1848,7 +1850,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -1841,7 +1843,7 @@ static int packet_rcv_spkt(struct sk_buf
* so that this procedure is noop.
*/
goto out;
if (!net_eq(dev_net(dev), sock_net(sk)))
-@@ -2075,12 +2077,12 @@ static int packet_rcv(struct sk_buff *sk
+@@ -2068,12 +2070,12 @@ static int packet_rcv(struct sk_buff *sk
unsigned int snaplen, res;
bool is_drop_n_account = false;
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
-@@ -2206,12 +2208,12 @@ static int tpacket_rcv(struct sk_buff *s
+@@ -2199,12 +2201,12 @@ static int tpacket_rcv(struct sk_buff *s
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32);
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48);
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
-@@ -3252,6 +3254,7 @@ static int packet_create(struct net *net
+@@ -3251,6 +3253,7 @@ static int packet_create(struct net *net
mutex_init(&po->pg_vec_lock);
po->rollover = NULL;
po->prot_hook.func = packet_rcv;
if (sock->type == SOCK_PACKET)
po->prot_hook.func = packet_rcv_spkt;
-@@ -3838,6 +3841,16 @@ packet_setsockopt(struct socket *sock, i
+@@ -3837,6 +3840,16 @@ packet_setsockopt(struct socket *sock, i
po->xmit = val ? packet_direct_xmit : dev_queue_xmit;
return 0;
}
default:
return -ENOPROTOOPT;
}
-@@ -3891,6 +3904,13 @@ static int packet_getsockopt(struct sock
+@@ -3889,6 +3902,13 @@ static int packet_getsockopt(struct sock
case PACKET_VNET_HDR:
val = po->has_vnet_hdr;
break;
break;
--- a/net/packet/internal.h
+++ b/net/packet/internal.h
-@@ -132,6 +132,7 @@ struct packet_sock {
+@@ -131,6 +131,7 @@ struct packet_sock {
struct net_device __rcu *cached_dev;
int (*xmit)(struct sk_buff *skb);
struct packet_type prot_hook ____cacheline_aligned_in_smp;
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -2456,7 +2456,7 @@ static inline int pskb_network_may_pull(
+@@ -2458,7 +2458,7 @@ static inline int pskb_network_may_pull(
* NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
*/
#ifndef NET_SKB_PAD
case -EAGAIN:
rtm->rtm_type = RTN_THROW;
break;
-@@ -3801,6 +3838,8 @@ static int ip6_route_dev_notify(struct n
+@@ -3804,6 +3841,8 @@ static int ip6_route_dev_notify(struct n
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
net->ipv6.ip6_prohibit_entry->dst.dev = dev;
net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
#endif
-@@ -4028,6 +4067,17 @@ static int __net_init ip6_route_net_init
+@@ -4031,6 +4070,17 @@ static int __net_init ip6_route_net_init
net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
ip6_template_metrics, true);
#endif
net->ipv6.sysctl.flush_delay = 0;
-@@ -4046,6 +4096,8 @@ out:
+@@ -4049,6 +4099,8 @@ out:
return ret;
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
out_ip6_prohibit_entry:
kfree(net->ipv6.ip6_prohibit_entry);
out_ip6_null_entry:
-@@ -4063,6 +4115,7 @@ static void __net_exit ip6_route_net_exi
+@@ -4066,6 +4118,7 @@ static void __net_exit ip6_route_net_exi
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
kfree(net->ipv6.ip6_prohibit_entry);
kfree(net->ipv6.ip6_blk_hole_entry);
#endif
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
}
-@@ -4136,6 +4189,9 @@ void __init ip6_route_init_special_entri
+@@ -4139,6 +4192,9 @@ void __init ip6_route_init_special_entri
init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
#endif
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -778,6 +778,7 @@ struct sk_buff {
+@@ -780,6 +780,7 @@ struct sk_buff {
__u8 tc_redirected:1;
__u8 tc_from_ingress:1;
#endif
__u16 tc_index; /* traffic control index */
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -4756,6 +4756,9 @@ static enum gro_result dev_gro_receive(s
+@@ -4757,6 +4757,9 @@ static enum gro_result dev_gro_receive(s
enum gro_result ret;
int grow;
if (netif_elide_gro(skb->dev))
goto normal;
-@@ -6226,6 +6229,48 @@ static void __netdev_adjacent_dev_unlink
+@@ -6227,6 +6230,48 @@ static void __netdev_adjacent_dev_unlink
&upper_dev->adj_list.lower);
}
static int __netdev_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev, bool master,
void *upper_priv, void *upper_info)
-@@ -6341,6 +6386,8 @@ void netdev_upper_dev_unlink(struct net_
+@@ -6342,6 +6387,8 @@ void netdev_upper_dev_unlink(struct net_
__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
&changeupper_info.info);
}
-@@ -6911,6 +6958,7 @@ int dev_set_mac_address(struct net_devic
+@@ -6912,6 +6959,7 @@ int dev_set_mac_address(struct net_devic
if (err)
return err;
dev->addr_assign_type = NET_ADDR_SET;
help
--- a/init/main.c
+++ b/init/main.c
-@@ -359,6 +359,29 @@ static inline void setup_nr_cpu_ids(void
+@@ -360,6 +360,29 @@ static inline void setup_nr_cpu_ids(void
static inline void smp_prepare_cpus(unsigned int maxcpus) { }
#endif
/*
* We need to store the untouched command line for future reference.
* We also need to store the touched command line since the parameter
-@@ -536,6 +559,7 @@ asmlinkage __visible void __init start_k
+@@ -541,6 +564,7 @@ asmlinkage __visible void __init start_k
add_device_randomness(command_line, strlen(command_line));
boot_init_stack_canary();
mm_init_cpumask(&init_mm);
CONFIG_NET_FLOW_LIMIT=y
CONFIG_NR_CPUS=8
# CONFIG_NUMA is not set
-# CONFIG_ORC_UNWINDER is not set
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_PADATA=y
+CONFIG_PAGE_TABLE_ISOLATION=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_CLOCK=y
# CONFIG_PARAVIRT_DEBUG is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
CONFIG_TREE_RCU=y
CONFIG_TREE_SRCU=y
+# CONFIG_UNWINDER_ORC is not set
CONFIG_UCS2_STRING=y
# CONFIG_UNISYSSPAR is not set
CONFIG_USB_OHCI_HCD_PCI=y
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_FRAME_POINTER=y
-CONFIG_FRAME_POINTER_UNWINDER=y
CONFIG_FS_MBCACHE=y
CONFIG_FUSION=y
# CONFIG_FUSION_CTL is not set
# CONFIG_GEOS is not set
CONFIG_GLOB=y
# CONFIG_GRO_CELLS is not set
-# CONFIG_GUESS_UNWINDER is not set
# CONFIG_HANGCHECK_TIMER is not set
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_TINY_SRCU=y
# CONFIG_TOSHIBA is not set
+# CONFIG_UNWINDER_GUESS is not set
+CONFIG_UNWINDER_FRAME_POINTER=y
CONFIG_UP_LATE_INIT=y
CONFIG_USB=y
CONFIG_USB_COMMON=y