summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-03-14 20:43:24 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-03-14 20:43:24 -0400
commit11dead9592da00b2946c86aca618661dfc497af6 (patch)
tree8563caf068c4cfd91d117860f43f22c35dd6dbcb
parent3.2.68: fix 1067_linux-3.2.68.patch (diff)
downloadhardened-patchset-11dead9592da00b2946c86aca618661dfc497af6.tar.gz
hardened-patchset-11dead9592da00b2946c86aca618661dfc497af6.tar.bz2
hardened-patchset-11dead9592da00b2946c86aca618661dfc497af6.zip
Grsec/PaX: 3.1-{3.2.68,3.14.35,3.19.1}-20150312220520150312
-rw-r--r--3.14.35/0000_README2
-rw-r--r--3.14.35/4420_grsecurity-3.1-3.14.35-201503092203.patch (renamed from 3.14.35/4420_grsecurity-3.1-3.14.35-201503071140.patch)336
-rw-r--r--3.19.1/0000_README (renamed from 3.18.9/0000_README)8
-rw-r--r--3.19.1/1000_linux-3.19.1.patch (renamed from 3.18.9/1008_linux-3.18.9.patch)1925
-rw-r--r--3.19.1/4420_grsecurity-3.1-3.19.1-201503122205.patch (renamed from 3.18.9/4420_grsecurity-3.1-3.18.9-201503071142.patch)45559
-rw-r--r--3.19.1/4425_grsec_remove_EI_PAX.patch (renamed from 3.18.9/4425_grsec_remove_EI_PAX.patch)0
-rw-r--r--3.19.1/4427_force_XATTR_PAX_tmpfs.patch (renamed from 3.18.9/4427_force_XATTR_PAX_tmpfs.patch)0
-rw-r--r--3.19.1/4430_grsec-remove-localversion-grsec.patch (renamed from 3.18.9/4430_grsec-remove-localversion-grsec.patch)0
-rw-r--r--3.19.1/4435_grsec-mute-warnings.patch (renamed from 3.18.9/4435_grsec-mute-warnings.patch)0
-rw-r--r--3.19.1/4440_grsec-remove-protected-paths.patch (renamed from 3.18.9/4440_grsec-remove-protected-paths.patch)0
-rw-r--r--3.19.1/4450_grsec-kconfig-default-gids.patch (renamed from 3.18.9/4450_grsec-kconfig-default-gids.patch)0
-rw-r--r--3.19.1/4465_selinux-avc_audit-log-curr_ip.patch (renamed from 3.18.9/4465_selinux-avc_audit-log-curr_ip.patch)0
-rw-r--r--3.19.1/4470_disable-compat_vdso.patch (renamed from 3.18.9/4470_disable-compat_vdso.patch)2
-rw-r--r--3.19.1/4475_emutramp_default_on.patch (renamed from 3.18.9/4475_emutramp_default_on.patch)0
-rw-r--r--3.2.68/0000_README2
-rw-r--r--3.2.68/4420_grsecurity-3.1-3.2.68-201503092202.patch (renamed from 3.2.68/4420_grsecurity-3.1-3.2.68-201503071137.patch)72
16 files changed, 35492 insertions, 12414 deletions
diff --git a/3.14.35/0000_README b/3.14.35/0000_README
index 8a45ea6..f876e1c 100644
--- a/3.14.35/0000_README
+++ b/3.14.35/0000_README
@@ -6,7 +6,7 @@ Patch: 1034_linux-3.14.35.patch
From: http://www.kernel.org
Desc: Linux 3.14.35
-Patch: 4420_grsecurity-3.1-3.14.35-201503071140.patch
+Patch: 4420_grsecurity-3.1-3.14.35-201503092203.patch
From: http://www.grsecurity.net
Desc: hardened-sources base patch from upstream grsecurity
diff --git a/3.14.35/4420_grsecurity-3.1-3.14.35-201503071140.patch b/3.14.35/4420_grsecurity-3.1-3.14.35-201503092203.patch
index 4cf9495..6e35a88 100644
--- a/3.14.35/4420_grsecurity-3.1-3.14.35-201503071140.patch
+++ b/3.14.35/4420_grsecurity-3.1-3.14.35-201503092203.patch
@@ -36091,7 +36091,7 @@ index d6bfb87..876ee18 100644
return NULL;
}
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
-index ab6ba35..7ede14e 100644
+index ab6ba35..2a5ff0d 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
@@ -16,8 +16,6 @@
@@ -36103,20 +36103,7 @@ index ab6ba35..7ede14e 100644
extern char vdso_start[], vdso_end[];
extern unsigned short vdso_sync_cpuid;
-@@ -152,12 +150,6 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
- addr = start;
- }
-
-- /*
-- * Forcibly align the final address in case we have a hardware
-- * issue that requires alignment for performance reasons.
-- */
-- addr = align_vdso_addr(addr);
--
- return addr;
- }
-
-@@ -169,30 +161,37 @@ static int setup_additional_pages(struct linux_binprm *bprm,
+@@ -169,13 +167,15 @@ static int setup_additional_pages(struct linux_binprm *bprm,
unsigned size)
{
struct mm_struct *mm = current->mm;
@@ -36134,16 +36121,9 @@ index ab6ba35..7ede14e 100644
+#endif
+
addr = vdso_addr(mm->start_stack, size);
-+
-+ /*
-+ * Forcibly align the final address in case we have a hardware
-+ * issue that requires alignment for performance reasons.
-+ */
-+ addr = align_vdso_addr(addr);
-+
addr = get_unmapped_area(NULL, addr, size, 0, 0);
if (IS_ERR_VALUE(addr)) {
- ret = addr;
+@@ -183,16 +183,14 @@ static int setup_additional_pages(struct linux_binprm *bprm,
goto up_fail;
}
@@ -36163,7 +36143,7 @@ index ab6ba35..7ede14e 100644
up_fail:
up_write(&mm->mmap_sem);
-@@ -212,10 +211,3 @@ int x32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
+@@ -212,10 +210,3 @@ int x32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
vdsox32_size);
}
#endif
@@ -39458,7 +39438,7 @@ index 8b4fa2c..5f81848 100644
new_smi->interrupt_disabled = 1;
atomic_set(&new_smi->stop_operation, 0);
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
-index 92c5937..1be4e4d 100644
+index 92c5937..2cc937b 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -18,6 +18,7 @@
@@ -39506,15 +39486,17 @@ index 92c5937..1be4e4d 100644
#else
static inline int range_is_allowed(unsigned long pfn, unsigned long size)
{
-@@ -119,6 +133,7 @@ static ssize_t read_mem(struct file *file, char __user *buf,
+@@ -118,7 +132,8 @@ static ssize_t read_mem(struct file *file, char __user *buf,
+ #endif
while (count > 0) {
- unsigned long remaining;
+- unsigned long remaining;
++ unsigned long remaining = 0;
+ char *temp;
sz = size_inside_page(p, count);
-@@ -134,7 +149,23 @@ static ssize_t read_mem(struct file *file, char __user *buf,
+@@ -134,7 +149,24 @@ static ssize_t read_mem(struct file *file, char __user *buf,
if (!ptr)
return -EFAULT;
@@ -39525,12 +39507,13 @@ index 92c5937..1be4e4d 100644
+ unxlate_dev_mem_ptr(p, ptr);
+ return -ENOMEM;
+ }
-+ memcpy(temp, ptr, sz);
++ remaining = probe_kernel_read(temp, ptr, sz);
+#else
+ temp = ptr;
+#endif
+
-+ remaining = copy_to_user(buf, temp, sz);
++ if (!remaining)
++ remaining = copy_to_user(buf, temp, sz);
+
+#ifdef CONFIG_PAX_USERCOPY
+ kfree(temp);
@@ -39539,7 +39522,7 @@ index 92c5937..1be4e4d 100644
unxlate_dev_mem_ptr(p, ptr);
if (remaining)
return -EFAULT;
-@@ -363,9 +394,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -363,9 +395,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
unsigned long p = *ppos;
@@ -39550,7 +39533,7 @@ index 92c5937..1be4e4d 100644
read = 0;
if (p < (unsigned long) high_memory) {
-@@ -387,6 +417,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -387,6 +418,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
}
#endif
while (low_count > 0) {
@@ -39559,7 +39542,7 @@ index 92c5937..1be4e4d 100644
sz = size_inside_page(p, low_count);
/*
-@@ -396,7 +428,22 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -396,7 +429,23 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
*/
kbuf = xlate_dev_kmem_ptr((char *)p);
@@ -39568,12 +39551,13 @@ index 92c5937..1be4e4d 100644
+ temp = kmalloc(sz, GFP_KERNEL|GFP_USERCOPY);
+ if (!temp)
+ return -ENOMEM;
-+ memcpy(temp, kbuf, sz);
++ err = probe_kernel_read(temp, kbuf, sz);
+#else
+ temp = kbuf;
+#endif
+
-+ err = copy_to_user(buf, temp, sz);
++ if (!err)
++ err = copy_to_user(buf, temp, sz);
+
+#ifdef CONFIG_PAX_USERCOPY
+ kfree(temp);
@@ -39583,7 +39567,7 @@ index 92c5937..1be4e4d 100644
return -EFAULT;
buf += sz;
p += sz;
-@@ -821,6 +868,9 @@ static const struct memdev {
+@@ -821,6 +870,9 @@ static const struct memdev {
#ifdef CONFIG_PRINTK
[11] = { "kmsg", 0644, &kmsg_fops, NULL },
#endif
@@ -39593,7 +39577,7 @@ index 92c5937..1be4e4d 100644
};
static int memory_open(struct inode *inode, struct file *filp)
-@@ -892,7 +942,7 @@ static int __init chr_dev_init(void)
+@@ -892,7 +944,7 @@ static int __init chr_dev_init(void)
continue;
device_create(mem_class, NULL, MKDEV(MEM_MAJOR, minor),
@@ -45918,6 +45902,19 @@ index 2fd9009..278cc1e 100644
radio = devm_kzalloc(&pdev->dev, sizeof(*radio), GFP_KERNEL);
if (!radio)
+diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl128x/fmdrv_common.c
+index 4b2e9e8..c2900d9 100644
+--- a/drivers/media/radio/wl128x/fmdrv_common.c
++++ b/drivers/media/radio/wl128x/fmdrv_common.c
+@@ -71,7 +71,7 @@ module_param(default_rds_buf, uint, 0444);
+ MODULE_PARM_DESC(rds_buf, "RDS buffer entries");
+
+ /* Radio Nr */
+-static u32 radio_nr = -1;
++static int radio_nr = -1;
+ module_param(radio_nr, int, 0444);
+ MODULE_PARM_DESC(radio_nr, "Radio Nr");
+
diff --git a/drivers/media/usb/dvb-usb/cinergyT2-core.c b/drivers/media/usb/dvb-usb/cinergyT2-core.c
index 9fd1527..8927230 100644
--- a/drivers/media/usb/dvb-usb/cinergyT2-core.c
@@ -48454,6 +48451,37 @@ index d2bb12b..d6c921e 100644
.kind = "nlmon",
.priv_size = sizeof(struct nlmon),
.setup = nlmon_setup,
+diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
+index 25f7419..62ed80a7 100644
+--- a/drivers/net/phy/phy_device.c
++++ b/drivers/net/phy/phy_device.c
+@@ -216,7 +216,7 @@ EXPORT_SYMBOL(phy_device_create);
+ * zero on success.
+ *
+ */
+-static int get_phy_c45_ids(struct mii_bus *bus, int addr, u32 *phy_id,
++static int get_phy_c45_ids(struct mii_bus *bus, int addr, int *phy_id,
+ struct phy_c45_device_ids *c45_ids) {
+ int phy_reg;
+ int i, reg_addr;
+@@ -286,7 +286,7 @@ static int get_phy_c45_ids(struct mii_bus *bus, int addr, u32 *phy_id,
+ * its return value is in turn returned.
+ *
+ */
+-static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id,
++static int get_phy_id(struct mii_bus *bus, int addr, int *phy_id,
+ bool is_c45, struct phy_c45_device_ids *c45_ids)
+ {
+ int phy_reg;
+@@ -324,7 +324,7 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id,
+ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45)
+ {
+ struct phy_c45_device_ids c45_ids = {0};
+- u32 phy_id = 0;
++ int phy_id = 0;
+ int r;
+
+ r = get_phy_id(bus, addr, &phy_id, is_c45, &c45_ids);
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 5a1897d..e860630 100644
--- a/drivers/net/ppp/ppp_generic.c
@@ -53886,9 +53914,20 @@ index ce396ec..04a37be 100644
if (get_user(c, buf))
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
-index 25d0741..36e7237 100644
+index 25d0741..f36ed8a 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
+@@ -996,8 +996,8 @@ EXPORT_SYMBOL(start_tty);
+ /* We limit tty time update visibility to every 8 seconds or so. */
+ static void tty_update_time(struct timespec *time)
+ {
+- unsigned long sec = get_seconds() & ~7;
+- if ((long)(sec - time->tv_sec) > 0)
++ unsigned long sec = get_seconds();
++ if (abs(sec - time->tv_sec) & ~7)
+ time->tv_sec = sec;
+ }
+
@@ -3480,7 +3480,7 @@ EXPORT_SYMBOL_GPL(get_current_tty);
void tty_default_fops(struct file_operations *fops)
@@ -53898,6 +53937,31 @@ index 25d0741..36e7237 100644
}
/*
+diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
+index 6fd60fe..22da05d 100644
+--- a/drivers/tty/tty_ioctl.c
++++ b/drivers/tty/tty_ioctl.c
+@@ -217,11 +217,17 @@ void tty_wait_until_sent(struct tty_struct *tty, long timeout)
+ #endif
+ if (!timeout)
+ timeout = MAX_SCHEDULE_TIMEOUT;
++
+ if (wait_event_interruptible_timeout(tty->write_wait,
+- !tty_chars_in_buffer(tty), timeout) >= 0) {
+- if (tty->ops->wait_until_sent)
+- tty->ops->wait_until_sent(tty, timeout);
++ !tty_chars_in_buffer(tty), timeout) < 0) {
++ return;
+ }
++
++ if (timeout == MAX_SCHEDULE_TIMEOUT)
++ timeout = 0;
++
++ if (tty->ops->wait_until_sent)
++ tty->ops->wait_until_sent(tty, timeout);
+ }
+ EXPORT_SYMBOL(tty_wait_until_sent);
+
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 2d822aa..a566234 100644
--- a/drivers/tty/tty_ldisc.c
@@ -54689,6 +54753,29 @@ index 29fa1c3..a57b08e 100644
struct usb_serial_port *port = info->port;
struct usb_serial *serial;
int retval = -ENODEV;
+diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
+index b63ce02..d6a1979 100644
+--- a/drivers/usb/serial/generic.c
++++ b/drivers/usb/serial/generic.c
+@@ -258,7 +258,8 @@ void usb_serial_generic_wait_until_sent(struct tty_struct *tty, long timeout)
+ * character or at least one jiffy.
+ */
+ period = max_t(unsigned long, (10 * HZ / bps), 1);
+- period = min_t(unsigned long, period, timeout);
++ if (timeout)
++ period = min_t(unsigned long, period, timeout);
+
+ dev_dbg(&port->dev, "%s - timeout = %u ms, period = %u ms\n",
+ __func__, jiffies_to_msecs(timeout),
+@@ -268,7 +269,7 @@ void usb_serial_generic_wait_until_sent(struct tty_struct *tty, long timeout)
+ schedule_timeout_interruptible(period);
+ if (signal_pending(current))
+ break;
+- if (time_after(jiffies, expire))
++ if (timeout && time_after(jiffies, expire))
+ break;
+ }
+ }
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 75f70f0..d467e1a 100644
--- a/drivers/usb/storage/usb.h
@@ -59691,6 +59778,19 @@ index ff286f3..8153a14 100644
.name = "features",
.attrs = attrs,
};
+diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
+index aeb57b98..a7f32bf 100644
+--- a/fs/btrfs/tree-log.c
++++ b/fs/btrfs/tree-log.c
+@@ -979,7 +979,7 @@ again:
+ base = btrfs_item_ptr_offset(leaf, path->slots[0]);
+
+ while (cur_offset < item_size) {
+- extref = (struct btrfs_inode_extref *)base + cur_offset;
++ extref = (struct btrfs_inode_extref *)(base + cur_offset);
+
+ victim_name_len = btrfs_inode_extref_name_len(leaf, extref);
+
diff --git a/fs/buffer.c b/fs/buffer.c
index eef21c6..10a8304 100644
--- a/fs/buffer.c
@@ -85289,6 +85389,19 @@ index 5f2e559..7d59314 100644
/**
* struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot
+diff --git a/include/linux/percpu.h b/include/linux/percpu.h
+index e3817d2..74af65b 100644
+--- a/include/linux/percpu.h
++++ b/include/linux/percpu.h
+@@ -59,7 +59,7 @@
+ * preallocate for this. Keep PERCPU_DYNAMIC_RESERVE equal to or
+ * larger than PERCPU_DYNAMIC_EARLY_SIZE.
+ */
+-#define PERCPU_DYNAMIC_EARLY_SLOTS 128
++#define PERCPU_DYNAMIC_EARLY_SLOTS 256
+ #define PERCPU_DYNAMIC_EARLY_SIZE (12 << 10)
+
+ /*
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index e56b07f..aef789b 100644
--- a/include/linux/perf_event.h
@@ -92892,8 +93005,21 @@ index f1fe7ec..7d4e641 100644
break;
if (pm_wakeup_pending()) {
+diff --git a/kernel/printk/console_cmdline.h b/kernel/printk/console_cmdline.h
+index cbd69d8..2ca4a8b 100644
+--- a/kernel/printk/console_cmdline.h
++++ b/kernel/printk/console_cmdline.h
+@@ -3,7 +3,7 @@
+
+ struct console_cmdline
+ {
+- char name[8]; /* Name of the driver */
++ char name[16]; /* Name of the driver */
+ int index; /* Minor dev. to use */
+ char *options; /* Options for the driver */
+ #ifdef CONFIG_A11Y_BRAILLE_CONSOLE
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
-index 8c086e6..a52bc51 100644
+index 8c086e6..bf7e534 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -385,6 +385,11 @@ static int check_syslog_permissions(int type, bool from_file)
@@ -92908,6 +93034,14 @@ index 8c086e6..a52bc51 100644
if (syslog_action_restricted(type)) {
if (capable(CAP_SYSLOG))
return 0;
+@@ -2280,6 +2285,7 @@ void register_console(struct console *newcon)
+ for (i = 0, c = console_cmdline;
+ i < MAX_CMDLINECONSOLES && c->name[0];
+ i++, c++) {
++ BUILD_BUG_ON(sizeof(c->name) != sizeof(newcon->name));
+ if (strcmp(c->name, newcon->name) != 0)
+ continue;
+ if (newcon->index >= 0 &&
diff --git a/kernel/profile.c b/kernel/profile.c
index ebdd9c1..612ee05 100644
--- a/kernel/profile.c
@@ -108165,9 +108299,18 @@ index 0f73f45..a96aa52 100644
/* make a copy for the caller */
*handle = ctxh;
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
-index ae333c1..18521f0 100644
+index ae333c1..1dca80d 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
+@@ -920,7 +920,7 @@ static unsigned int cache_poll(struct file *filp, poll_table *wait,
+ poll_wait(filp, &queue_wait, wait);
+
+ /* alway allow write */
+- mask = POLL_OUT | POLLWRNORM;
++ mask = POLLOUT | POLLWRNORM;
+
+ if (!rp)
+ return mask;
@@ -1609,7 +1609,7 @@ static int create_cache_proc_entries(struct cache_detail *cd, struct net *net)
struct sunrpc_net *sn;
@@ -112352,10 +112495,10 @@ index 0000000..54461af
+}
diff --git a/tools/gcc/constify_plugin.c b/tools/gcc/constify_plugin.c
new file mode 100644
-index 0000000..82bc5a8
+index 0000000..3b5af59
--- /dev/null
+++ b/tools/gcc/constify_plugin.c
-@@ -0,0 +1,557 @@
+@@ -0,0 +1,558 @@
+/*
+ * Copyright 2011 by Emese Revfy <re.emese@gmail.com>
+ * Copyright 2011-2014 by PaX Team <pageexec@freemail.hu>
@@ -112789,7 +112932,8 @@ index 0000000..82bc5a8
+#if BUILDING_GCC_VERSION >= 4008
+ .optinfo_flags = OPTGROUP_NONE,
+#endif
-+#if BUILDING_GCC_VERSION >= 4009
++#if BUILDING_GCC_VERSION >= 5000
++#elif BUILDING_GCC_VERSION >= 4009
+ .has_gate = false,
+ .has_execute = true,
+#else
@@ -112897,8 +113041,8 @@ index 0000000..82bc5a8
+ error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
+ }
+
-+ if (strcmp(lang_hooks.name, "GNU C")) {
-+ inform(UNKNOWN_LOCATION, G_("%s supports C only"), plugin_name);
++ if (strncmp(lang_hooks.name, "GNU C", 5) && !strncmp(lang_hooks.name, "GNU C+", 6)) {
++ inform(UNKNOWN_LOCATION, G_("%s supports C only, not %s"), plugin_name, lang_hooks.name);
+ constify = false;
+ }
+
@@ -112915,10 +113059,10 @@ index 0000000..82bc5a8
+}
diff --git a/tools/gcc/gcc-common.h b/tools/gcc/gcc-common.h
new file mode 100644
-index 0000000..e90c205
+index 0000000..de1d984
--- /dev/null
+++ b/tools/gcc/gcc-common.h
-@@ -0,0 +1,295 @@
+@@ -0,0 +1,375 @@
+#ifndef GCC_COMMON_H_INCLUDED
+#define GCC_COMMON_H_INCLUDED
+
@@ -112955,7 +113099,13 @@ index 0000000..e90c205
+#include "timevar.h"
+
+#include "params.h"
++
++#if BUILDING_GCC_VERSION <= 4009
+#include "pointer-set.h"
++#else
++#include "hash-map.h"
++#endif
++
+#include "emit-rtl.h"
+//#include "reload.h"
+//#include "ira.h"
@@ -112970,11 +113120,21 @@ index 0000000..e90c205
+//#include "coverage.h"
+//#include "value-prof.h"
+
++#if BUILDING_GCC_VERSION == 4005
++#include <sys/mman.h>
++#endif
++
+#if BUILDING_GCC_VERSION >= 4007
+#include "tree-pretty-print.h"
+#include "gimple-pretty-print.h"
-+#include "c-tree.h"
-+//#include "alloc-pool.h"
++#endif
++
++#if BUILDING_GCC_VERSION >= 4006
++//#include "c-tree.h"
++//#include "cp/cp-tree.h"
++#include "c-family/c-common.h"
++#else
++#include "c-common.h"
+#endif
+
+#if BUILDING_GCC_VERSION <= 4008
@@ -112996,6 +113156,7 @@ index 0000000..e90c205
+#include "stor-layout.h"
+#include "internal-fn.h"
+#include "gimple-expr.h"
++#include "gimple-fold.h"
+//#include "diagnostic-color.h"
+#include "context.h"
+#include "tree-ssa-alias.h"
@@ -113018,7 +113179,11 @@ index 0000000..e90c205
+#endif
+
+//#include "lto/lto.h"
++#if BUILDING_GCC_VERSION >= 4007
+//#include "data-streamer.h"
++#else
++//#include "lto-streamer.h"
++#endif
+//#include "lto-compress.h"
+
+//#include "expr.h" where are you...
@@ -113028,6 +113193,15 @@ index 0000000..e90c205
+extern void debug_dominance_info(enum cdi_direction dir);
+extern void debug_dominance_tree(enum cdi_direction dir, basic_block root);
+
++#ifdef __cplusplus
++static inline void debug_tree(const_tree t)
++{
++ debug_tree(CONST_CAST_TREE(t));
++}
++#else
++#define debug_tree(t) debug_tree(CONST_CAST_TREE(t))
++#endif
++
+#define __unused __attribute__((__unused__))
+
+#define DECL_NAME_POINTER(node) IDENTIFIER_POINTER(DECL_NAME(node))
@@ -113035,12 +113209,20 @@ index 0000000..e90c205
+#define TYPE_NAME_POINTER(node) IDENTIFIER_POINTER(TYPE_NAME(node))
+#define TYPE_NAME_LENGTH(node) IDENTIFIER_LENGTH(TYPE_NAME(node))
+
++// should come from c-tree.h if only it were installed for gcc 4.5...
++#define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1(TYPE)
++
+#if BUILDING_GCC_VERSION == 4005
-+#define FOR_EACH_LOCAL_DECL(FUN, I, D) for (tree vars = (FUN)->local_decls; vars && (D = TREE_VALUE(vars)); vars = TREE_CHAIN(vars), I)
++#define FOR_EACH_VEC_ELT_REVERSE(T,V,I,P) for (I = VEC_length(T, (V)) - 1; VEC_iterate(T, (V), (I), (P)); (I)--)
++#define FOR_EACH_LOCAL_DECL(FUN, I, D) FOR_EACH_VEC_ELT_REVERSE(tree, (FUN)->local_decls, I, D)
+#define DECL_CHAIN(NODE) (TREE_CHAIN(DECL_MINIMAL_CHECK(NODE)))
+#define FOR_EACH_VEC_ELT(T, V, I, P) for (I = 0; VEC_iterate(T, (V), (I), (P)); ++(I))
+#define TODO_rebuild_cgraph_edges 0
+
++#ifndef O_BINARY
++#define O_BINARY 0
++#endif
++
+static inline bool gimple_call_builtin_p(gimple stmt, enum built_in_function code)
+{
+ tree fndecl;
@@ -113090,25 +113272,45 @@ index 0000000..e90c205
+#if BUILDING_GCC_VERSION <= 4006
+#define ANY_RETURN_P(rtx) (GET_CODE(rtx) == RETURN)
+#define C_DECL_REGISTER(EXP) DECL_LANG_FLAG_4(EXP)
-+
-+// should come from c-tree.h if only it were installed for gcc 4.5...
-+#define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1(TYPE)
++#define EDGE_PRESERVE 0ULL
++#define HOST_WIDE_INT_PRINT_HEX_PURE "%" HOST_WIDE_INT_PRINT "x"
++#define flag_fat_lto_objects true
+
+#define get_random_seed(noinit) ({ \
+ unsigned HOST_WIDE_INT seed; \
+ sscanf(get_random_seed(noinit), "%" HOST_WIDE_INT_PRINT "x", &seed); \
+ seed * seed; })
+
++#define int_const_binop(code, arg1, arg2) int_const_binop((code), (arg1), (arg2), 0)
++
+static inline bool gimple_clobber_p(gimple s)
+{
+ return false;
+}
+
++static inline bool gimple_asm_clobbers_memory_p(const_gimple stmt)
++{
++ unsigned i;
++
++ for (i = 0; i < gimple_asm_nclobbers(stmt); i++) {
++ tree op = gimple_asm_clobber_op(stmt, i);
++ if (!strcmp(TREE_STRING_POINTER(TREE_VALUE(op)), "memory"))
++ return true;
++ }
++
++ return false;
++}
++
+static inline tree builtin_decl_implicit(enum built_in_function fncode)
+{
+ return implicit_built_in_decls[fncode];
+}
+
++static inline int ipa_reverse_postorder(struct cgraph_node **order)
++{
++ return cgraph_postorder(order);
++}
++
+static inline struct cgraph_node *cgraph_get_create_node(tree decl)
+{
+ struct cgraph_node *node = cgraph_get_node(decl);
@@ -113154,8 +113356,11 @@ index 0000000..e90c205
+#endif
+
+#if BUILDING_GCC_VERSION <= 4007
++#define FOR_EACH_FUNCTION(node) for (node = cgraph_nodes; node; node = node->next)
+#define FOR_EACH_VARIABLE(node) for (node = varpool_nodes; node; node = node->next)
+#define PROP_loops 0
++#define NODE_SYMBOL(node) (node)
++#define NODE_DECL(node) (node)->decl
+
+static inline int bb_loop_depth(const_basic_block bb)
+{
@@ -113185,6 +113390,8 @@ index 0000000..e90c205
+#define last_basic_block_for_fn(FN) ((FN)->cfg->x_last_basic_block)
+#define label_to_block_map_for_fn(FN) ((FN)->cfg->x_label_to_block_map)
+#define profile_status_for_fn(FN) ((FN)->cfg->x_profile_status)
++#define BASIC_BLOCK_FOR_FN(FN, N) BASIC_BLOCK_FOR_FUNCTION((FN), (N))
++#define NODE_IMPLICIT_ALIAS(node) (node)->same_body_alias
+
+static inline const char *get_tree_code_name(enum tree_code code)
+{
@@ -113196,9 +113403,8 @@ index 0000000..e90c205
+#endif
+
+#if BUILDING_GCC_VERSION == 4008
-+#define NODE_DECL(node) node->symbol.decl
-+#else
-+#define NODE_DECL(node) node->decl
++#define NODE_SYMBOL(node) (&(node)->symbol)
++#define NODE_DECL(node) (node)->symbol.decl
+#endif
+
+#if BUILDING_GCC_VERSION >= 4008
@@ -113209,8 +113415,26 @@ index 0000000..e90c205
+#define TODO_dump_cgraph 0
+#endif
+
++#if BUILDING_GCC_VERSION <= 4009
++#define TODO_verify_il 0
++#endif
++
+#if BUILDING_GCC_VERSION >= 4009
+#define TODO_ggc_collect 0
++#define NODE_SYMBOL(node) (node)
++#define NODE_DECL(node) (node)->decl
++#define cgraph_node_name(node) (node)->name()
++#define NODE_IMPLICIT_ALIAS(node) (node)->cpp_implicit_alias
++#endif
++
++#if BUILDING_GCC_VERSION >= 5000
++#define TODO_verify_ssa TODO_verify_il
++#define TODO_verify_flow TODO_verify_il
++#define TODO_verify_stmts TODO_verify_il
++#define TODO_verify_rtl_sharing TODO_verify_il
++
++#define debug_cgraph_node(node) (node)->debug()
++#define cgraph_get_node(decl) cgraph_node::get(decl)
+#endif
+
+#endif
diff --git a/3.18.9/0000_README b/3.19.1/0000_README
index 099e6de..fa067a7 100644
--- a/3.18.9/0000_README
+++ b/3.19.1/0000_README
@@ -2,11 +2,11 @@ README
-----------------------------------------------------------------------------
Individual Patch Descriptions:
-----------------------------------------------------------------------------
-Patch: 1008_linux-3.18.9.patch
-From: http://www.kernel.org
-Desc: Linux 3.18.9
+Patch: 1000_linux-3.19.1.patch
+From: http://www.kernel.org
+Desc: Linux 3.14.35
-Patch: 4420_grsecurity-3.1-3.18.9-201503071142.patch
+Patch: 4420_grsecurity-3.1-3.19.1-201503122205.patch
From: http://www.grsecurity.net
Desc: hardened-sources base patch from upstream grsecurity
diff --git a/3.18.9/1008_linux-3.18.9.patch b/3.19.1/1000_linux-3.19.1.patch
index a840bda..0d6158e 100644
--- a/3.18.9/1008_linux-3.18.9.patch
+++ b/3.19.1/1000_linux-3.19.1.patch
@@ -1,12 +1,12 @@
diff --git a/Makefile b/Makefile
-index 0b3f8a1..62b3338 100644
+index b15036b..688777b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION = 3
- PATCHLEVEL = 18
--SUBLEVEL = 8
-+SUBLEVEL = 9
+ PATCHLEVEL = 19
+-SUBLEVEL = 0
++SUBLEVEL = 1
EXTRAVERSION =
NAME = Diseased Newt
@@ -37,7 +37,7 @@ index 6cc25ed..2c6248d 100644
&usb1 {
diff --git a/arch/arm/boot/dts/bcm63138.dtsi b/arch/arm/boot/dts/bcm63138.dtsi
-index f3bb2dd..c97844c 100644
+index d2d8e94..f46329c 100644
--- a/arch/arm/boot/dts/bcm63138.dtsi
+++ b/arch/arm/boot/dts/bcm63138.dtsi
@@ -66,8 +66,9 @@
@@ -80,6 +80,155 @@ index 8acf5d8..f76fe94 100644
clocks = <&tegra_car TEGRA20_CLK_DSI>;
resets = <&tegra_car 48>;
reset-names = "dsi";
+diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
+index aaeec78..8b11f44 100644
+--- a/arch/arm/mach-bcm/Kconfig
++++ b/arch/arm/mach-bcm/Kconfig
+@@ -68,7 +68,7 @@ config ARCH_BCM_MOBILE
+ This enables support for systems based on Broadcom mobile SoCs.
+
+ config ARCH_BCM_281XX
+- bool "Broadcom BCM281XX SoC family"
++ bool "Broadcom BCM281XX SoC family" if ARCH_MULTI_V7
+ select ARCH_BCM_MOBILE
+ select HAVE_SMP
+ help
+@@ -77,7 +77,7 @@ config ARCH_BCM_281XX
+ variants.
+
+ config ARCH_BCM_21664
+- bool "Broadcom BCM21664 SoC family"
++ bool "Broadcom BCM21664 SoC family" if ARCH_MULTI_V7
+ select ARCH_BCM_MOBILE
+ select HAVE_SMP
+ help
+diff --git a/arch/arm/mach-bcm/platsmp-brcmstb.c b/arch/arm/mach-bcm/platsmp-brcmstb.c
+index 31c87a2..e209e6f 100644
+--- a/arch/arm/mach-bcm/platsmp-brcmstb.c
++++ b/arch/arm/mach-bcm/platsmp-brcmstb.c
+@@ -17,6 +17,7 @@
+ #include <linux/errno.h>
+ #include <linux/init.h>
+ #include <linux/io.h>
++#include <linux/jiffies.h>
+ #include <linux/of_address.h>
+ #include <linux/of_platform.h>
+ #include <linux/printk.h>
+@@ -94,10 +95,35 @@ static u32 pwr_ctrl_rd(u32 cpu)
+ return readl_relaxed(base);
+ }
+
+-static void pwr_ctrl_wr(u32 cpu, u32 val)
++static void pwr_ctrl_set(unsigned int cpu, u32 val, u32 mask)
+ {
+ void __iomem *base = pwr_ctrl_get_base(cpu);
+- writel(val, base);
++ writel((readl(base) & mask) | val, base);
++}
++
++static void pwr_ctrl_clr(unsigned int cpu, u32 val, u32 mask)
++{
++ void __iomem *base = pwr_ctrl_get_base(cpu);
++ writel((readl(base) & mask) & ~val, base);
++}
++
++#define POLL_TMOUT_MS 500
++static int pwr_ctrl_wait_tmout(unsigned int cpu, u32 set, u32 mask)
++{
++ const unsigned long timeo = jiffies + msecs_to_jiffies(POLL_TMOUT_MS);
++ u32 tmp;
++
++ do {
++ tmp = pwr_ctrl_rd(cpu) & mask;
++ if (!set == !tmp)
++ return 0;
++ } while (time_before(jiffies, timeo));
++
++ tmp = pwr_ctrl_rd(cpu) & mask;
++ if (!set == !tmp)
++ return 0;
++
++ return -ETIMEDOUT;
+ }
+
+ static void cpu_rst_cfg_set(u32 cpu, int set)
+@@ -139,15 +165,22 @@ static void brcmstb_cpu_power_on(u32 cpu)
+ * The secondary cores power was cut, so we must go through
+ * power-on initialization.
+ */
+- u32 tmp;
++ pwr_ctrl_set(cpu, ZONE_MAN_ISO_CNTL_MASK, 0xffffff00);
++ pwr_ctrl_set(cpu, ZONE_MANUAL_CONTROL_MASK, -1);
++ pwr_ctrl_set(cpu, ZONE_RESERVED_1_MASK, -1);
+
+- /* Request zone power up */
+- pwr_ctrl_wr(cpu, ZONE_PWR_UP_REQ_MASK);
++ pwr_ctrl_set(cpu, ZONE_MAN_MEM_PWR_MASK, -1);
+
+- /* Wait for the power up FSM to complete */
+- do {
+- tmp = pwr_ctrl_rd(cpu);
+- } while (!(tmp & ZONE_PWR_ON_STATE_MASK));
++ if (pwr_ctrl_wait_tmout(cpu, 1, ZONE_MEM_PWR_STATE_MASK))
++ panic("ZONE_MEM_PWR_STATE_MASK set timeout");
++
++ pwr_ctrl_set(cpu, ZONE_MAN_CLKEN_MASK, -1);
++
++ if (pwr_ctrl_wait_tmout(cpu, 1, ZONE_DPG_PWR_STATE_MASK))
++ panic("ZONE_DPG_PWR_STATE_MASK set timeout");
++
++ pwr_ctrl_clr(cpu, ZONE_MAN_ISO_CNTL_MASK, -1);
++ pwr_ctrl_set(cpu, ZONE_MAN_RESET_CNTL_MASK, -1);
+ }
+
+ static int brcmstb_cpu_get_power_state(u32 cpu)
+@@ -174,25 +207,33 @@ static void brcmstb_cpu_die(u32 cpu)
+
+ static int brcmstb_cpu_kill(u32 cpu)
+ {
+- u32 tmp;
++ /*
++ * Ordinarily, the hardware forbids power-down of CPU0 (which is good
++ * because it is the boot CPU), but this is not true when using BPCM
++ * manual mode. Consequently, we must avoid turning off CPU0 here to
++ * ensure that TI2C master reset will work.
++ */
++ if (cpu == 0) {
++ pr_warn("SMP: refusing to power off CPU0\n");
++ return 1;
++ }
+
+ while (per_cpu_sw_state_rd(cpu))
+ ;
+
+- /* Program zone reset */
+- pwr_ctrl_wr(cpu, ZONE_RESET_STATE_MASK | ZONE_BLK_RST_ASSERT_MASK |
+- ZONE_PWR_DN_REQ_MASK);
++ pwr_ctrl_set(cpu, ZONE_MANUAL_CONTROL_MASK, -1);
++ pwr_ctrl_clr(cpu, ZONE_MAN_RESET_CNTL_MASK, -1);
++ pwr_ctrl_clr(cpu, ZONE_MAN_CLKEN_MASK, -1);
++ pwr_ctrl_set(cpu, ZONE_MAN_ISO_CNTL_MASK, -1);
++ pwr_ctrl_clr(cpu, ZONE_MAN_MEM_PWR_MASK, -1);
+
+- /* Verify zone reset */
+- tmp = pwr_ctrl_rd(cpu);
+- if (!(tmp & ZONE_RESET_STATE_MASK))
+- pr_err("%s: Zone reset bit for CPU %d not asserted!\n",
+- __func__, cpu);
++ if (pwr_ctrl_wait_tmout(cpu, 0, ZONE_MEM_PWR_STATE_MASK))
++ panic("ZONE_MEM_PWR_STATE_MASK clear timeout");
+
+- /* Wait for power down */
+- do {
+- tmp = pwr_ctrl_rd(cpu);
+- } while (!(tmp & ZONE_PWR_OFF_STATE_MASK));
++ pwr_ctrl_clr(cpu, ZONE_RESERVED_1_MASK, -1);
++
++ if (pwr_ctrl_wait_tmout(cpu, 0, ZONE_DPG_PWR_STATE_MASK))
++ panic("ZONE_DPG_PWR_STATE_MASK clear timeout");
+
+ /* Flush pipeline before resetting CPU */
+ mb();
diff --git a/arch/arm/mach-mvebu/system-controller.c b/arch/arm/mach-mvebu/system-controller.c
index a068cb5..c6c132a 100644
--- a/arch/arm/mach-mvebu/system-controller.c
@@ -94,7 +243,7 @@ index a068cb5..c6c132a 100644
{
u32 dev, rev;
diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
-index 5684f11..4e9d2a9 100644
+index ffd6604..b6ea88f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -2017,7 +2017,7 @@ static struct omap_hwmod dra7xx_uart3_hwmod = {
@@ -141,7 +290,7 @@ index c66ad4e..5fb41ad 100644
MACHINE_START(H4700, "HP iPAQ HX4700")
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
-index 1319916..e81d216 100644
+index 29019be..195b112 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -25,6 +25,7 @@
@@ -160,6 +309,19 @@ index 1319916..e81d216 100644
}
static void __init fixup_poodle(struct tag *tags, char **cmdline)
+diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
+index 962a7f3..f4e2e27 100644
+--- a/arch/arm/mach-pxa/spitz.c
++++ b/arch/arm/mach-pxa/spitz.c
+@@ -979,6 +979,8 @@ static void __init spitz_init(void)
+ spitz_nand_init();
+ spitz_i2c_init();
+ spitz_audio_init();
++
++ regulator_has_full_constraints();
+ }
+
+ static void __init spitz_fixup(struct tag *tags, char **cmdline)
diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c
index 6645d1e..34853d5 100644
--- a/arch/arm/mach-sa1100/pm.c
@@ -173,10 +335,10 @@ index 6645d1e..34853d5 100644
/*
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
-index b2cfba16c..1886513 100644
+index d6b16d9..3c2509b 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
-@@ -75,6 +75,7 @@ config ARCH_VEXPRESS_TC2_PM
+@@ -73,6 +73,7 @@ config ARCH_VEXPRESS_TC2_PM
depends on MCPM
select ARM_CCI
select ARCH_VEXPRESS_SPC
@@ -185,7 +347,7 @@ index b2cfba16c..1886513 100644
Support for CPU and cluster power management on Versatile Express
with a TC2 (A15x2 A7x3) big.LITTLE core tile.
diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c
-index 1b9ad02..76920d4 100644
+index 5a1ba6e..6ae9340 100644
--- a/arch/arm64/kernel/signal32.c
+++ b/arch/arm64/kernel/signal32.c
@@ -154,8 +154,7 @@ int copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from)
@@ -205,8 +367,8 @@ index 1b9ad02..76920d4 100644
- err |= __put_user((compat_uptr_t)(unsigned long)from->si_ptr, &to->si_ptr);
+ err |= __put_user(from->si_int, &to->si_int);
break;
- default: /* this is just in case for now ... */
- err |= __put_user(from->si_pid, &to->si_pid);
+ case __SI_SYS:
+ err |= __put_user((compat_uptr_t)(unsigned long)
diff --git a/arch/metag/include/asm/processor.h b/arch/metag/include/asm/processor.h
index 881071c..13272fd 100644
--- a/arch/metag/include/asm/processor.h
@@ -223,10 +385,10 @@ index 881071c..13272fd 100644
#define user_stack_pointer(regs) ((regs)->ctx.AX[0].U0)
diff --git a/arch/mips/alchemy/common/clock.c b/arch/mips/alchemy/common/clock.c
-index d7557cd..3fff11e 100644
+index 48a9dfc..c4d21ce 100644
--- a/arch/mips/alchemy/common/clock.c
+++ b/arch/mips/alchemy/common/clock.c
-@@ -128,6 +128,8 @@ static unsigned long alchemy_clk_cpu_recalc(struct clk_hw *hw,
+@@ -127,6 +127,8 @@ static unsigned long alchemy_clk_cpu_recalc(struct clk_hw *hw,
t = 396000000;
else {
t = alchemy_rdsys(AU1000_SYS_CPUPLL) & 0x7f;
@@ -334,7 +496,7 @@ index 2f82568..bc01579 100644
}
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
-index d6d1928..bc3fc4f 100644
+index 62a6ba3..845016d 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -99,29 +99,35 @@ extern void paging_init(void);
@@ -489,10 +651,10 @@ index 0384b05..55b759a 100644
nop
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
-index dc49cf3..5d6e59f 100644
+index 5342674..228ae86 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
-@@ -367,8 +367,10 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
+@@ -424,8 +424,10 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
if (config3 & MIPS_CONF3_MSA)
c->ases |= MIPS_ASE_MSA;
/* Only tested on 32-bit cores */
@@ -505,7 +667,7 @@ index dc49cf3..5d6e59f 100644
return config3 & MIPS_CONF_M;
}
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
-index 2607c3a..1b2452e 100644
+index 17eaf0c..1a73c6c 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -14,6 +14,8 @@
@@ -517,7 +679,7 @@ index 2607c3a..1b2452e 100644
extern void *__bzero(void *__s, size_t __count);
extern long __strncpy_from_kernel_nocheck_asm(char *__to,
-@@ -34,6 +36,14 @@ extern long __strnlen_user_nocheck_asm(const char *s);
+@@ -32,6 +34,14 @@ extern long __strnlen_user_nocheck_asm(const char *s);
extern long __strnlen_user_asm(const char *s);
/*
@@ -615,8 +777,146 @@ index e3b21e5..270bbd4 100644
return ret;
}
+diff --git a/arch/powerpc/kvm/book3s_hv_rm_xics.c b/arch/powerpc/kvm/book3s_hv_rm_xics.c
+index 7b066f6..7c22997 100644
+--- a/arch/powerpc/kvm/book3s_hv_rm_xics.c
++++ b/arch/powerpc/kvm/book3s_hv_rm_xics.c
+@@ -152,7 +152,7 @@ static void icp_rm_down_cppr(struct kvmppc_xics *xics, struct kvmppc_icp *icp,
+ * in virtual mode.
+ */
+ do {
+- old_state = new_state = ACCESS_ONCE(icp->state);
++ old_state = new_state = READ_ONCE(icp->state);
+
+ /* Down_CPPR */
+ new_state.cppr = new_cppr;
+@@ -211,7 +211,7 @@ unsigned long kvmppc_rm_h_xirr(struct kvm_vcpu *vcpu)
+ * pending priority
+ */
+ do {
+- old_state = new_state = ACCESS_ONCE(icp->state);
++ old_state = new_state = READ_ONCE(icp->state);
+
+ xirr = old_state.xisr | (((u32)old_state.cppr) << 24);
+ if (!old_state.xisr)
+@@ -277,7 +277,7 @@ int kvmppc_rm_h_ipi(struct kvm_vcpu *vcpu, unsigned long server,
+ * whenever the MFRR is made less favored.
+ */
+ do {
+- old_state = new_state = ACCESS_ONCE(icp->state);
++ old_state = new_state = READ_ONCE(icp->state);
+
+ /* Set_MFRR */
+ new_state.mfrr = mfrr;
+@@ -352,7 +352,7 @@ int kvmppc_rm_h_cppr(struct kvm_vcpu *vcpu, unsigned long cppr)
+ icp_rm_clr_vcpu_irq(icp->vcpu);
+
+ do {
+- old_state = new_state = ACCESS_ONCE(icp->state);
++ old_state = new_state = READ_ONCE(icp->state);
+
+ reject = 0;
+ new_state.cppr = cppr;
+diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c
+index 807351f..a4a8d9f 100644
+--- a/arch/powerpc/kvm/book3s_xics.c
++++ b/arch/powerpc/kvm/book3s_xics.c
+@@ -327,7 +327,7 @@ static bool icp_try_to_deliver(struct kvmppc_icp *icp, u32 irq, u8 priority,
+ icp->server_num);
+
+ do {
+- old_state = new_state = ACCESS_ONCE(icp->state);
++ old_state = new_state = READ_ONCE(icp->state);
+
+ *reject = 0;
+
+@@ -512,7 +512,7 @@ static void icp_down_cppr(struct kvmppc_xics *xics, struct kvmppc_icp *icp,
+ * in virtual mode.
+ */
+ do {
+- old_state = new_state = ACCESS_ONCE(icp->state);
++ old_state = new_state = READ_ONCE(icp->state);
+
+ /* Down_CPPR */
+ new_state.cppr = new_cppr;
+@@ -567,7 +567,7 @@ static noinline unsigned long kvmppc_h_xirr(struct kvm_vcpu *vcpu)
+ * pending priority
+ */
+ do {
+- old_state = new_state = ACCESS_ONCE(icp->state);
++ old_state = new_state = READ_ONCE(icp->state);
+
+ xirr = old_state.xisr | (((u32)old_state.cppr) << 24);
+ if (!old_state.xisr)
+@@ -634,7 +634,7 @@ static noinline int kvmppc_h_ipi(struct kvm_vcpu *vcpu, unsigned long server,
+ * whenever the MFRR is made less favored.
+ */
+ do {
+- old_state = new_state = ACCESS_ONCE(icp->state);
++ old_state = new_state = READ_ONCE(icp->state);
+
+ /* Set_MFRR */
+ new_state.mfrr = mfrr;
+@@ -679,7 +679,7 @@ static int kvmppc_h_ipoll(struct kvm_vcpu *vcpu, unsigned long server)
+ if (!icp)
+ return H_PARAMETER;
+ }
+- state = ACCESS_ONCE(icp->state);
++ state = READ_ONCE(icp->state);
+ kvmppc_set_gpr(vcpu, 4, ((u32)state.cppr << 24) | state.xisr);
+ kvmppc_set_gpr(vcpu, 5, state.mfrr);
+ return H_SUCCESS;
+@@ -721,7 +721,7 @@ static noinline void kvmppc_h_cppr(struct kvm_vcpu *vcpu, unsigned long cppr)
+ BOOK3S_INTERRUPT_EXTERNAL_LEVEL);
+
+ do {
+- old_state = new_state = ACCESS_ONCE(icp->state);
++ old_state = new_state = READ_ONCE(icp->state);
+
+ reject = 0;
+ new_state.cppr = cppr;
+@@ -885,7 +885,7 @@ static int xics_debug_show(struct seq_file *m, void *private)
+ if (!icp)
+ continue;
+
+- state.raw = ACCESS_ONCE(icp->state.raw);
++ state.raw = READ_ONCE(icp->state.raw);
+ seq_printf(m, "cpu server %#lx XIRR:%#x PPRI:%#x CPPR:%#x MFRR:%#x OUT:%d NR:%d\n",
+ icp->server_num, state.xisr,
+ state.pending_pri, state.cppr, state.mfrr,
+@@ -1082,7 +1082,7 @@ int kvmppc_xics_set_icp(struct kvm_vcpu *vcpu, u64 icpval)
+ * the ICS states before the ICP states.
+ */
+ do {
+- old_state = ACCESS_ONCE(icp->state);
++ old_state = READ_ONCE(icp->state);
+
+ if (new_state.mfrr <= old_state.mfrr) {
+ resend = false;
+diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
+index 5ff4e07..620d0ec 100644
+--- a/arch/powerpc/mm/hugetlbpage.c
++++ b/arch/powerpc/mm/hugetlbpage.c
+@@ -978,7 +978,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift
+ */
+ pdshift = PUD_SHIFT;
+ pudp = pud_offset(&pgd, ea);
+- pud = ACCESS_ONCE(*pudp);
++ pud = READ_ONCE(*pudp);
+
+ if (pud_none(pud))
+ return NULL;
+@@ -990,7 +990,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift
+ else {
+ pdshift = PMD_SHIFT;
+ pmdp = pmd_offset(&pud, ea);
+- pmd = ACCESS_ONCE(*pmdp);
++ pmd = READ_ONCE(*pmdp);
+ /*
+ * A hugepage collapse is captured by pmd_none, because
+ * it mark the pmd none and do a hpte invalidate.
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
-index ad56edc..e8bb33b 100644
+index f532c92..367533b 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -156,7 +156,7 @@ axon_ram_direct_access(struct block_device *device, sector_t sector,
@@ -629,10 +929,10 @@ index ad56edc..e8bb33b 100644
return 0;
}
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
-index 4fc3fed..29e2e5a 100644
+index f00f31e..f512cff 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
-@@ -613,7 +613,7 @@ no_timer:
+@@ -820,7 +820,7 @@ no_timer:
__unset_cpu_idle(vcpu);
vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
@@ -641,7 +941,7 @@ index 4fc3fed..29e2e5a 100644
return 0;
}
-@@ -633,10 +633,20 @@ void kvm_s390_vcpu_wakeup(struct kvm_vcpu *vcpu)
+@@ -840,10 +840,20 @@ void kvm_s390_vcpu_wakeup(struct kvm_vcpu *vcpu)
enum hrtimer_restart kvm_s390_idle_wakeup(struct hrtimer *timer)
{
struct kvm_vcpu *vcpu;
@@ -663,7 +963,7 @@ index 4fc3fed..29e2e5a 100644
return HRTIMER_NORESTART;
}
-@@ -840,6 +850,8 @@ static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)
+@@ -1187,6 +1197,8 @@ static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)
list_add_tail(&inti->list, &iter->list);
}
atomic_set(&fi->active, 1);
@@ -672,7 +972,7 @@ index 4fc3fed..29e2e5a 100644
sigcpu = find_first_bit(fi->idle_mask, KVM_MAX_VCPUS);
if (sigcpu == KVM_MAX_VCPUS) {
do {
-@@ -864,6 +876,7 @@ int kvm_s390_inject_vm(struct kvm *kvm,
+@@ -1221,6 +1233,7 @@ int kvm_s390_inject_vm(struct kvm *kvm,
struct kvm_s390_interrupt *s390int)
{
struct kvm_s390_interrupt_info *inti;
@@ -680,7 +980,7 @@ index 4fc3fed..29e2e5a 100644
inti = kzalloc(sizeof(*inti), GFP_KERNEL);
if (!inti)
-@@ -911,7 +924,10 @@ int kvm_s390_inject_vm(struct kvm *kvm,
+@@ -1268,7 +1281,10 @@ int kvm_s390_inject_vm(struct kvm *kvm,
trace_kvm_s390_inject_vm(s390int->type, s390int->parm, s390int->parm64,
2);
@@ -693,10 +993,10 @@ index 4fc3fed..29e2e5a 100644
void kvm_s390_reinject_io_int(struct kvm *kvm,
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
-index 55aade4..ced09d8 100644
+index 3e09801..9af01dc 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
-@@ -662,7 +662,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
+@@ -670,7 +670,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
if (rc)
return rc;
}
@@ -705,14 +1005,27 @@ index 55aade4..ced09d8 100644
vcpu->arch.ckc_timer.function = kvm_s390_idle_wakeup;
get_cpu_id(&vcpu->arch.cpu_id);
vcpu->arch.cpu_id.version = 0xff;
+diff --git a/arch/sh/mm/gup.c b/arch/sh/mm/gup.c
+index 37458f3..e113bb4 100644
+--- a/arch/sh/mm/gup.c
++++ b/arch/sh/mm/gup.c
+@@ -17,7 +17,7 @@
+ static inline pte_t gup_get_pte(pte_t *ptep)
+ {
+ #ifndef CONFIG_X2TLB
+- return ACCESS_ONCE(*ptep);
++ return READ_ONCE(*ptep);
+ #else
+ /*
+ * With get_user_pages_fast, we walk down the pagetables without
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
-index 6a1a845..30c0acf 100644
+index ad754b4..8bd44e8 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
-@@ -36,6 +36,7 @@ vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/aslr.o
- $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone
+@@ -49,6 +49,7 @@ $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone
- vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o
+ vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o \
+ $(objtree)/drivers/firmware/efi/libstub/lib.a
+vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_thunk_$(BITS).o
$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
@@ -952,43 +1265,248 @@ index 0000000..630384a
+ .quad 0x0080890000000000 /* TS descriptor */
+ .quad 0x0000000000000000 /* TS continued */
+efi_gdt64_end:
+diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
+index 625660f..cf87de3 100644
+--- a/arch/x86/include/asm/spinlock.h
++++ b/arch/x86/include/asm/spinlock.h
+@@ -46,7 +46,7 @@ static __always_inline bool static_key_false(struct static_key *key);
+
+ static inline void __ticket_enter_slowpath(arch_spinlock_t *lock)
+ {
+- set_bit(0, (volatile unsigned long *)&lock->tickets.tail);
++ set_bit(0, (volatile unsigned long *)&lock->tickets.head);
+ }
+
+ #else /* !CONFIG_PARAVIRT_SPINLOCKS */
+@@ -60,10 +60,30 @@ static inline void __ticket_unlock_kick(arch_spinlock_t *lock,
+ }
+
+ #endif /* CONFIG_PARAVIRT_SPINLOCKS */
++static inline int __tickets_equal(__ticket_t one, __ticket_t two)
++{
++ return !((one ^ two) & ~TICKET_SLOWPATH_FLAG);
++}
++
++static inline void __ticket_check_and_clear_slowpath(arch_spinlock_t *lock,
++ __ticket_t head)
++{
++ if (head & TICKET_SLOWPATH_FLAG) {
++ arch_spinlock_t old, new;
++
++ old.tickets.head = head;
++ new.tickets.head = head & ~TICKET_SLOWPATH_FLAG;
++ old.tickets.tail = new.tickets.head + TICKET_LOCK_INC;
++ new.tickets.tail = old.tickets.tail;
++
++ /* try to clear slowpath flag when there are no contenders */
++ cmpxchg(&lock->head_tail, old.head_tail, new.head_tail);
++ }
++}
+
+ static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
+ {
+- return lock.tickets.head == lock.tickets.tail;
++ return __tickets_equal(lock.tickets.head, lock.tickets.tail);
+ }
+
+ /*
+@@ -87,18 +107,21 @@ static __always_inline void arch_spin_lock(arch_spinlock_t *lock)
+ if (likely(inc.head == inc.tail))
+ goto out;
+
+- inc.tail &= ~TICKET_SLOWPATH_FLAG;
+ for (;;) {
+ unsigned count = SPIN_THRESHOLD;
+
+ do {
+- if (READ_ONCE(lock->tickets.head) == inc.tail)
+- goto out;
++ inc.head = READ_ONCE(lock->tickets.head);
++ if (__tickets_equal(inc.head, inc.tail))
++ goto clear_slowpath;
+ cpu_relax();
+ } while (--count);
+ __ticket_lock_spinning(lock, inc.tail);
+ }
+-out: barrier(); /* make sure nothing creeps before the lock is taken */
++clear_slowpath:
++ __ticket_check_and_clear_slowpath(lock, inc.head);
++out:
++ barrier(); /* make sure nothing creeps before the lock is taken */
+ }
+
+ static __always_inline int arch_spin_trylock(arch_spinlock_t *lock)
+@@ -106,56 +129,30 @@ static __always_inline int arch_spin_trylock(arch_spinlock_t *lock)
+ arch_spinlock_t old, new;
+
+ old.tickets = READ_ONCE(lock->tickets);
+- if (old.tickets.head != (old.tickets.tail & ~TICKET_SLOWPATH_FLAG))
++ if (!__tickets_equal(old.tickets.head, old.tickets.tail))
+ return 0;
+
+ new.head_tail = old.head_tail + (TICKET_LOCK_INC << TICKET_SHIFT);
++ new.head_tail &= ~TICKET_SLOWPATH_FLAG;
+
+ /* cmpxchg is a full barrier, so nothing can move before it */
+ return cmpxchg(&lock->head_tail, old.head_tail, new.head_tail) == old.head_tail;
+ }
+
+-static inline void __ticket_unlock_slowpath(arch_spinlock_t *lock,
+- arch_spinlock_t old)
+-{
+- arch_spinlock_t new;
+-
+- BUILD_BUG_ON(((__ticket_t)NR_CPUS) != NR_CPUS);
+-
+- /* Perform the unlock on the "before" copy */
+- old.tickets.head += TICKET_LOCK_INC;
+-
+- /* Clear the slowpath flag */
+- new.head_tail = old.head_tail & ~(TICKET_SLOWPATH_FLAG << TICKET_SHIFT);
+-
+- /*
+- * If the lock is uncontended, clear the flag - use cmpxchg in
+- * case it changes behind our back though.
+- */
+- if (new.tickets.head != new.tickets.tail ||
+- cmpxchg(&lock->head_tail, old.head_tail,
+- new.head_tail) != old.head_tail) {
+- /*
+- * Lock still has someone queued for it, so wake up an
+- * appropriate waiter.
+- */
+- __ticket_unlock_kick(lock, old.tickets.head);
+- }
+-}
+-
+ static __always_inline void arch_spin_unlock(arch_spinlock_t *lock)
+ {
+ if (TICKET_SLOWPATH_FLAG &&
+- static_key_false(&paravirt_ticketlocks_enabled)) {
+- arch_spinlock_t prev;
++ static_key_false(&paravirt_ticketlocks_enabled)) {
++ __ticket_t head;
+
+- prev = *lock;
+- add_smp(&lock->tickets.head, TICKET_LOCK_INC);
++ BUILD_BUG_ON(((__ticket_t)NR_CPUS) != NR_CPUS);
+
+- /* add_smp() is a full mb() */
++ head = xadd(&lock->tickets.head, TICKET_LOCK_INC);
+
+- if (unlikely(lock->tickets.tail & TICKET_SLOWPATH_FLAG))
+- __ticket_unlock_slowpath(lock, prev);
++ if (unlikely(head & TICKET_SLOWPATH_FLAG)) {
++ head &= ~TICKET_SLOWPATH_FLAG;
++ __ticket_unlock_kick(lock, (head + TICKET_LOCK_INC));
++ }
+ } else
+ __add(&lock->tickets.head, TICKET_LOCK_INC, UNLOCK_LOCK_PREFIX);
+ }
+@@ -164,14 +161,15 @@ static inline int arch_spin_is_locked(arch_spinlock_t *lock)
+ {
+ struct __raw_tickets tmp = READ_ONCE(lock->tickets);
+
+- return tmp.tail != tmp.head;
++ return !__tickets_equal(tmp.tail, tmp.head);
+ }
+
+ static inline int arch_spin_is_contended(arch_spinlock_t *lock)
+ {
+ struct __raw_tickets tmp = READ_ONCE(lock->tickets);
+
+- return (__ticket_t)(tmp.tail - tmp.head) > TICKET_LOCK_INC;
++ tmp.head &= ~TICKET_SLOWPATH_FLAG;
++ return (tmp.tail - tmp.head) > TICKET_LOCK_INC;
+ }
+ #define arch_spin_is_contended arch_spin_is_contended
+
+@@ -183,16 +181,16 @@ static __always_inline void arch_spin_lock_flags(arch_spinlock_t *lock,
+
+ static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
+ {
+- __ticket_t head = ACCESS_ONCE(lock->tickets.head);
++ __ticket_t head = READ_ONCE(lock->tickets.head);
+
+ for (;;) {
+- struct __raw_tickets tmp = ACCESS_ONCE(lock->tickets);
++ struct __raw_tickets tmp = READ_ONCE(lock->tickets);
+ /*
+ * We need to check "unlocked" in a loop, tmp.head == head
+ * can be false positive because of overflow.
+ */
+- if (tmp.head == (tmp.tail & ~TICKET_SLOWPATH_FLAG) ||
+- tmp.head != head)
++ if (__tickets_equal(tmp.head, tmp.tail) ||
++ !__tickets_equal(tmp.head, head))
+ break;
+
+ cpu_relax();
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
-index a142e77..a3eadfd 100644
+index b9e30da..b5ddc96 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -604,18 +604,24 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
-
- int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp)
+@@ -613,6 +613,11 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp)
{
-- int irq;
-+ int rc, irq, trigger, polarity;
+ int rc, irq, trigger, polarity;
- if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
- *irqp = gsi;
-- } else {
-- irq = mp_map_gsi_to_irq(gsi,
-- IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK);
-- if (irq < 0)
-- return -1;
-- *irqp = irq;
++ if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
++ *irqp = gsi;
+ return 0;
- }
-- return 0;
-+
-+ rc = acpi_get_override_irq(gsi, &trigger, &polarity);
-+ if (rc == 0) {
-+ trigger = trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE;
-+ polarity = polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH;
-+ irq = acpi_register_gsi(NULL, gsi, trigger, polarity);
-+ if (irq >= 0) {
-+ *irqp = irq;
-+ return 0;
-+ }
+ }
-+ return -1;
- }
- EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
++
+ rc = acpi_get_override_irq(gsi, &trigger, &polarity);
+ if (rc == 0) {
+ trigger = trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE;
+diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
+index 94f6434..e354cc6 100644
+--- a/arch/x86/kernel/kvm.c
++++ b/arch/x86/kernel/kvm.c
+@@ -609,7 +609,7 @@ static inline void check_zero(void)
+ u8 ret;
+ u8 old;
+
+- old = ACCESS_ONCE(zero_stats);
++ old = READ_ONCE(zero_stats);
+ if (unlikely(old)) {
+ ret = cmpxchg(&zero_stats, old, 0);
+ /* This ensures only one fellow resets the stat */
+@@ -727,6 +727,7 @@ __visible void kvm_lock_spinning(struct arch_spinlock *lock, __ticket_t want)
+ int cpu;
+ u64 start;
+ unsigned long flags;
++ __ticket_t head;
+
+ if (in_nmi())
+ return;
+@@ -768,11 +769,15 @@ __visible void kvm_lock_spinning(struct arch_spinlock *lock, __ticket_t want)
+ */
+ __ticket_enter_slowpath(lock);
++ /* make sure enter_slowpath, which is atomic does not cross the read */
++ smp_mb__after_atomic();
++
+ /*
+ * check again make sure it didn't become free while
+ * we weren't looking.
+ */
+- if (ACCESS_ONCE(lock->tickets.head) == want) {
++ head = READ_ONCE(lock->tickets.head);
++ if (__tickets_equal(head, want)) {
+ add_stats(TAKEN_SLOW_PICKUP, 1);
+ goto out;
+ }
+@@ -803,8 +808,8 @@ static void kvm_unlock_kick(struct arch_spinlock *lock, __ticket_t ticket)
+ add_stats(RELEASED_SLOW, 1);
+ for_each_cpu(cpu, &waiting_cpus) {
+ const struct kvm_lock_waiting *w = &per_cpu(klock_waiting, cpu);
+- if (ACCESS_ONCE(w->lock) == lock &&
+- ACCESS_ONCE(w->want) == ticket) {
++ if (READ_ONCE(w->lock) == lock &&
++ READ_ONCE(w->want) == ticket) {
+ add_stats(RELEASED_SLOW_KICKED, 1);
+ kvm_kick_cpu(cpu);
+ break;
diff --git a/arch/x86/kernel/pmc_atom.c b/arch/x86/kernel/pmc_atom.c
index 0ee5025e..8bb9a61 100644
--- a/arch/x86/kernel/pmc_atom.c
@@ -1011,44 +1529,8 @@ index 0ee5025e..8bb9a61 100644
return 0;
err:
pmc_dbgfs_unregister(pmc);
-diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
-index 506488c..8b92cf4 100644
---- a/arch/x86/kvm/x86.c
-+++ b/arch/x86/kvm/x86.c
-@@ -1237,21 +1237,22 @@ void kvm_track_tsc_matching(struct kvm_vcpu *vcpu)
- {
- #ifdef CONFIG_X86_64
- bool vcpus_matched;
-- bool do_request = false;
- struct kvm_arch *ka = &vcpu->kvm->arch;
- struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
-
- vcpus_matched = (ka->nr_vcpus_matched_tsc + 1 ==
- atomic_read(&vcpu->kvm->online_vcpus));
-
-- if (vcpus_matched && gtod->clock.vclock_mode == VCLOCK_TSC)
-- if (!ka->use_master_clock)
-- do_request = 1;
--
-- if (!vcpus_matched && ka->use_master_clock)
-- do_request = 1;
--
-- if (do_request)
-+ /*
-+ * Once the masterclock is enabled, always perform request in
-+ * order to update it.
-+ *
-+ * In order to enable masterclock, the host clocksource must be TSC
-+ * and the vcpus need to have matched TSCs. When that happens,
-+ * perform request to enable masterclock.
-+ */
-+ if (ka->use_master_clock ||
-+ (gtod->clock.vclock_mode == VCLOCK_TSC && vcpus_matched))
- kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu);
-
- trace_kvm_track_tsc(vcpu->vcpu_id, ka->nr_vcpus_matched_tsc,
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
-index 207d9aef..448ee89 100644
+index d754782..224b142 100644
--- a/arch/x86/mm/gup.c
+++ b/arch/x86/mm/gup.c
@@ -172,7 +172,7 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
@@ -1101,71 +1583,6 @@ index 919b912..df4552b 100644
}
return max;
-diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
-index 093f5f4..6b3cf7c 100644
---- a/arch/x86/pci/xen.c
-+++ b/arch/x86/pci/xen.c
-@@ -452,52 +452,6 @@ int __init pci_xen_hvm_init(void)
- }
-
- #ifdef CONFIG_XEN_DOM0
--static __init void xen_setup_acpi_sci(void)
--{
-- int rc;
-- int trigger, polarity;
-- int gsi = acpi_sci_override_gsi;
-- int irq = -1;
-- int gsi_override = -1;
--
-- if (!gsi)
-- return;
--
-- rc = acpi_get_override_irq(gsi, &trigger, &polarity);
-- if (rc) {
-- printk(KERN_WARNING "xen: acpi_get_override_irq failed for acpi"
-- " sci, rc=%d\n", rc);
-- return;
-- }
-- trigger = trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE;
-- polarity = polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH;
--
-- printk(KERN_INFO "xen: sci override: global_irq=%d trigger=%d "
-- "polarity=%d\n", gsi, trigger, polarity);
--
-- /* Before we bind the GSI to a Linux IRQ, check whether
-- * we need to override it with bus_irq (IRQ) value. Usually for
-- * IRQs below IRQ_LEGACY_IRQ this holds IRQ == GSI, as so:
-- * ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)
-- * but there are oddballs where the IRQ != GSI:
-- * ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 20 low level)
-- * which ends up being: gsi_to_irq[9] == 20
-- * (which is what acpi_gsi_to_irq ends up calling when starting the
-- * the ACPI interpreter and keels over since IRQ 9 has not been
-- * setup as we had setup IRQ 20 for it).
-- */
-- if (acpi_gsi_to_irq(gsi, &irq) == 0) {
-- /* Use the provided value if it's valid. */
-- if (irq >= 0)
-- gsi_override = irq;
-- }
--
-- gsi = xen_register_gsi(gsi, gsi_override, trigger, polarity);
-- printk(KERN_INFO "xen: acpi sci %d\n", gsi);
--
-- return;
--}
--
- int __init pci_xen_initial_domain(void)
- {
- int irq;
-@@ -509,7 +463,6 @@ int __init pci_xen_initial_domain(void)
- x86_msi.msi_mask_irq = xen_nop_msi_mask_irq;
- x86_msi.msix_mask_irq = xen_nop_msix_mask_irq;
- #endif
-- xen_setup_acpi_sci();
- __acpi_register_gsi = acpi_register_gsi_xen;
- /* Pre-allocate legacy irqs */
- for (irq = 0; irq < nr_legacy_irqs(); irq++) {
diff --git a/arch/x86/platform/efi/efi_stub_64.S b/arch/x86/platform/efi/efi_stub_64.S
index 5fcda72..86d0f9e 100644
--- a/arch/x86/platform/efi/efi_stub_64.S
@@ -1486,11 +1903,73 @@ index 8806fa7..ff85d28 100644
+ .balign 8
+func_rt_ptr: .quad 0
efi_saved_sp: .quad 0
+diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
+index 70fb507..376a0a9 100644
+--- a/arch/x86/xen/p2m.c
++++ b/arch/x86/xen/p2m.c
+@@ -554,7 +554,7 @@ static bool alloc_p2m(unsigned long pfn)
+ mid_mfn = NULL;
+ }
+
+- p2m_pfn = pte_pfn(ACCESS_ONCE(*ptep));
++ p2m_pfn = pte_pfn(READ_ONCE(*ptep));
+ if (p2m_pfn == PFN_DOWN(__pa(p2m_identity)) ||
+ p2m_pfn == PFN_DOWN(__pa(p2m_missing))) {
+ /* p2m leaf page is missing */
+diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
+index 23b45eb..956374c 100644
+--- a/arch/x86/xen/spinlock.c
++++ b/arch/x86/xen/spinlock.c
+@@ -41,7 +41,7 @@ static u8 zero_stats;
+ static inline void check_zero(void)
+ {
+ u8 ret;
+- u8 old = ACCESS_ONCE(zero_stats);
++ u8 old = READ_ONCE(zero_stats);
+ if (unlikely(old)) {
+ ret = cmpxchg(&zero_stats, old, 0);
+ /* This ensures only one fellow resets the stat */
+@@ -112,6 +112,7 @@ __visible void xen_lock_spinning(struct arch_spinlock *lock, __ticket_t want)
+ struct xen_lock_waiting *w = this_cpu_ptr(&lock_waiting);
+ int cpu = smp_processor_id();
+ u64 start;
++ __ticket_t head;
+ unsigned long flags;
+
+ /* If kicker interrupts not initialized yet, just spin */
+@@ -159,11 +160,15 @@ __visible void xen_lock_spinning(struct arch_spinlock *lock, __ticket_t want)
+ */
+ __ticket_enter_slowpath(lock);
+
++ /* make sure enter_slowpath, which is atomic does not cross the read */
++ smp_mb__after_atomic();
++
+ /*
+ * check again make sure it didn't become free while
+ * we weren't looking
+ */
+- if (ACCESS_ONCE(lock->tickets.head) == want) {
++ head = READ_ONCE(lock->tickets.head);
++ if (__tickets_equal(head, want)) {
+ add_stats(TAKEN_SLOW_PICKUP, 1);
+ goto out;
+ }
+@@ -204,8 +209,8 @@ static void xen_unlock_kick(struct arch_spinlock *lock, __ticket_t next)
+ const struct xen_lock_waiting *w = &per_cpu(lock_waiting, cpu);
+
+ /* Make sure we read lock before want */
+- if (ACCESS_ONCE(w->lock) == lock &&
+- ACCESS_ONCE(w->want) == next) {
++ if (READ_ONCE(w->lock) == lock &&
++ READ_ONCE(w->want) == next) {
+ add_stats(RELEASED_SLOW_KICKED, 1);
+ xen_send_IPI_one(cpu, XEN_SPIN_UNLOCK_VECTOR);
+ break;
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
-index ff18dab..702ae29 100644
+index 60c9d4a..3a415ec 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
-@@ -500,6 +500,7 @@ static int bt_alloc(struct blk_mq_bitmap_tags *bt, unsigned int depth,
+@@ -509,6 +509,7 @@ static int bt_alloc(struct blk_mq_bitmap_tags *bt, unsigned int depth,
bt->bs = kzalloc(BT_WAIT_QUEUES * sizeof(*bt->bs), GFP_KERNEL);
if (!bt->bs) {
kfree(bt->map);
@@ -1558,7 +2037,7 @@ index 6f2751d..5da8e6e 100644
cfqq = *async_cfqq;
}
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
-index 93d1606..41e9c19 100644
+index e75737f..7d5880d 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -105,7 +105,7 @@ static void lpss_uart_setup(struct lpss_private_data *pdata)
@@ -1612,10 +2091,10 @@ index 93d1606..41e9c19 100644
{ "INT3430", LPSS_ADDR(lpt_dev_desc) },
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
-index 086240c..fe1678c 100644
+index 1ee27ac..de4c849 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
-@@ -106,6 +106,7 @@ static const struct usb_device_id ath3k_table[] = {
+@@ -108,6 +108,7 @@ static const struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x13d3, 0x3393) },
{ USB_DEVICE(0x13d3, 0x3402) },
{ USB_DEVICE(0x13d3, 0x3408) },
@@ -1623,7 +2102,7 @@ index 086240c..fe1678c 100644
{ USB_DEVICE(0x13d3, 0x3432) },
/* Atheros AR5BBU12 with sflash firmware */
-@@ -158,6 +159,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
+@@ -162,6 +163,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 },
@@ -1631,7 +2110,7 @@ index 086240c..fe1678c 100644
{ USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },
/* Atheros AR5BBU22 with sflash firmware */
-@@ -170,6 +172,8 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
+@@ -174,6 +176,8 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
#define USB_REQ_DFU_DNLOAD 1
#define BULK_SIZE 4096
#define FW_HDR_SIZE 20
@@ -1640,7 +2119,7 @@ index 086240c..fe1678c 100644
static int ath3k_load_firmware(struct usb_device *udev,
const struct firmware *firmware)
-@@ -201,6 +205,9 @@ static int ath3k_load_firmware(struct usb_device *udev,
+@@ -205,6 +209,9 @@ static int ath3k_load_firmware(struct usb_device *udev,
pipe = usb_sndbulkpipe(udev, 0x02);
while (count) {
@@ -1650,7 +2129,7 @@ index 086240c..fe1678c 100644
size = min_t(uint, count, BULK_SIZE);
memcpy(send_buf, firmware->data + sent, size);
-@@ -298,6 +305,9 @@ static int ath3k_load_fwfile(struct usb_device *udev,
+@@ -302,6 +309,9 @@ static int ath3k_load_fwfile(struct usb_device *udev,
pipe = usb_sndbulkpipe(udev, 0x02);
while (count) {
@@ -1661,18 +2140,19 @@ index 086240c..fe1678c 100644
memcpy(send_buf, firmware->data + sent, size);
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
-index 091c813..f0e2f72 100644
+index 19cf2cf..c91ec52 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
-@@ -107,15 +107,23 @@ static const struct usb_device_id btusb_table[] = {
- { USB_DEVICE(0x0b05, 0x17cb) },
- { USB_DEVICE(0x413c, 0x8197) },
+@@ -109,16 +109,24 @@ static const struct usb_device_id btusb_table[] = {
+ { USB_DEVICE(0x13d3, 0x3404),
+ .driver_info = BTUSB_BCM_PATCHRAM },
+ /* Broadcom BCM20702B0 (Dynex/Insignia) */
+ { USB_DEVICE(0x19ff, 0x0239), .driver_info = BTUSB_BCM_PATCHRAM },
+
/* Foxconn - Hon Hai */
- { USB_VENDOR_AND_INTERFACE_INFO(0x0489, 0xff, 0x01, 0x01) },
+ { USB_VENDOR_AND_INTERFACE_INFO(0x0489, 0xff, 0x01, 0x01),
+ .driver_info = BTUSB_BCM_PATCHRAM },
+ /* Lite-On Technology - Broadcom based */
+ { USB_VENDOR_AND_INTERFACE_INFO(0x04ca, 0xff, 0x01, 0x01),
@@ -1689,7 +2169,7 @@ index 091c813..f0e2f72 100644
/* Belkin F8065bf - Broadcom based */
{ USB_VENDOR_AND_INTERFACE_INFO(0x050d, 0xff, 0x01, 0x01) },
-@@ -183,6 +191,7 @@ static const struct usb_device_id blacklist_table[] = {
+@@ -188,6 +196,7 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 },
@@ -1870,7 +2350,7 @@ index af74c57..eff9d58 100644
return;
default:
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
-index 2c46734..51350cd 100644
+index 6f19854..ccb140d 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -75,6 +75,10 @@ enum tis_defaults {
@@ -2043,10 +2523,10 @@ index 32a3d25..68ab423 100644
err_clk_disable:
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
-index 4473eba..e3bf702 100644
+index 46bed4f..7030c40 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
-@@ -1409,9 +1409,10 @@ static int __cpufreq_remove_dev_finish(struct device *dev,
+@@ -1416,9 +1416,10 @@ static int __cpufreq_remove_dev_finish(struct device *dev,
unsigned long flags;
struct cpufreq_policy *policy;
@@ -2059,7 +2539,7 @@ index 4473eba..e3bf702 100644
if (!policy) {
pr_debug("%s: No cpu_data found\n", __func__);
-@@ -1466,7 +1467,6 @@ static int __cpufreq_remove_dev_finish(struct device *dev,
+@@ -1473,7 +1474,6 @@ static int __cpufreq_remove_dev_finish(struct device *dev,
}
}
@@ -2186,10 +2666,10 @@ index 5fc96d5..819229e 100644
if (new_state == state)
pr_debug("change to %u MHz succeeded after %u tries "
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
-index bbd6514..c7236ba 100644
+index 17638d7..5907c17 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
-@@ -2039,14 +2039,20 @@ static void __log_bus_error(struct mem_ctl_info *mci, struct err_info *err,
+@@ -2174,14 +2174,20 @@ static void __log_bus_error(struct mem_ctl_info *mci, struct err_info *err,
static inline void decode_bus_error(int node_id, struct mce *m)
{
@@ -2213,10 +2693,10 @@ index bbd6514..c7236ba 100644
if (PP(ec) == NBSL_PP_OBS)
return;
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
-index e9bb1af..3cdaac8 100644
+index 63aa673..1acf57b 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
-@@ -2297,7 +2297,7 @@ static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+@@ -2447,7 +2447,7 @@ static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id)
rc = sbridge_get_all_devices(&num_mc, pci_dev_descr_ibridge_table);
type = IVY_BRIDGE;
break;
@@ -2225,8 +2705,8 @@ index e9bb1af..3cdaac8 100644
rc = sbridge_get_all_devices(&num_mc, pci_dev_descr_sbridge_table);
type = SANDY_BRIDGE;
break;
-@@ -2306,8 +2306,11 @@ static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id)
- type = HASWELL;
+@@ -2460,8 +2460,11 @@ static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+ type = BROADWELL;
break;
}
- if (unlikely(rc < 0))
@@ -2238,7 +2718,7 @@ index e9bb1af..3cdaac8 100644
mc = 0;
list_for_each_entry(sbridge_dev, &sbridge_edac_list, list) {
-@@ -2320,7 +2323,7 @@ static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+@@ -2474,7 +2477,7 @@ static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto fail1;
}
@@ -2248,7 +2728,7 @@ index e9bb1af..3cdaac8 100644
mutex_unlock(&sbridge_edac_lock);
return 0;
diff --git a/drivers/gpio/gpio-tps65912.c b/drivers/gpio/gpio-tps65912.c
-index 22052d8..a8c7830 100644
+index 472fb5b..9cdbc0c 100644
--- a/drivers/gpio/gpio-tps65912.c
+++ b/drivers/gpio/gpio-tps65912.c
@@ -26,9 +26,12 @@ struct tps65912_gpio_data {
@@ -2318,7 +2798,7 @@ index 08261f2..26645a8 100644
gg_data->out_gpio = gpiochip_get_desc(gc, ret);
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
-index 80e33e0..6d7c9c5 100644
+index d43e967..5e72fc2 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -370,7 +370,10 @@ static int i2c_hid_hwreset(struct i2c_client *client)
@@ -2371,10 +2851,10 @@ index b98765f..8577cc7 100644
* look like rcw is cheaper
*/
diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
-index 1cd93be..64a759c 100644
+index ce9ab44..acf0fc3 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
-@@ -605,6 +605,8 @@ static const struct dvb_frontend_ops si2168_ops = {
+@@ -635,6 +635,8 @@ static const struct dvb_frontend_ops si2168_ops = {
.delsys = {SYS_DVBT, SYS_DVBT2, SYS_DVBC_ANNEX_A},
.info = {
.name = "Silicon Labs Si2168",
@@ -2384,7 +2864,7 @@ index 1cd93be..64a759c 100644
FE_CAN_FEC_2_3 |
FE_CAN_FEC_3_4 |
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
-index 3aac88f..7362772 100644
+index 765bffb..6a1334b 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -56,10 +56,8 @@ config VIDEO_VIU
@@ -2401,7 +2881,7 @@ index 3aac88f..7362772 100644
select VIDEOBUF_DMA_CONTIG
---help---
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
-index 8d3b74c..fc369b03 100644
+index 86ffcd5..f8c5e47 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -1021,16 +1021,16 @@ static ssize_t store_protocols(struct device *device,
@@ -2429,7 +2909,7 @@ index 8d3b74c..fc369b03 100644
* Fall back to clearing the filter.
*/
diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c
-index 9f2c545..2273ce7 100644
+index 994de53..15db9f6 100644
--- a/drivers/media/usb/dvb-usb-v2/lmedm04.c
+++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c
@@ -344,15 +344,17 @@ static void lme2510_int_response(struct urb *lme_urb)
@@ -2467,10 +2947,10 @@ index 9f2c545..2273ce7 100644
usb_submit_urb(lme_int->lme_urb, GFP_ATOMIC);
diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c
-index 957c7ae..1ead904 100644
+index 44ae1e0..49a5f95 100644
--- a/drivers/media/usb/em28xx/em28xx-audio.c
+++ b/drivers/media/usb/em28xx/em28xx-audio.c
-@@ -821,7 +821,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
+@@ -820,7 +820,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
if (urb_size > ep_size * npackets)
npackets = DIV_ROUND_UP(urb_size, ep_size);
@@ -2479,7 +2959,7 @@ index 957c7ae..1ead904 100644
num_urb, npackets, urb_size);
/* Estimate the bytes per period */
-@@ -982,7 +982,7 @@ static int em28xx_audio_fini(struct em28xx *dev)
+@@ -981,7 +981,7 @@ static int em28xx_audio_fini(struct em28xx *dev)
return 0;
}
@@ -2488,7 +2968,7 @@ index 957c7ae..1ead904 100644
if (dev->adev.sndcard) {
snd_card_disconnect(dev->adev.sndcard);
-@@ -1006,7 +1006,7 @@ static int em28xx_audio_suspend(struct em28xx *dev)
+@@ -1005,7 +1005,7 @@ static int em28xx_audio_suspend(struct em28xx *dev)
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
return 0;
@@ -2497,7 +2977,7 @@ index 957c7ae..1ead904 100644
em28xx_deinit_isoc_audio(dev);
atomic_set(&dev->adev.stream_started, 0);
return 0;
-@@ -1020,7 +1020,7 @@ static int em28xx_audio_resume(struct em28xx *dev)
+@@ -1019,7 +1019,7 @@ static int em28xx_audio_resume(struct em28xx *dev)
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
return 0;
@@ -2507,10 +2987,10 @@ index 957c7ae..1ead904 100644
schedule_work(&dev->adev.wq_trigger);
return 0;
diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c
-index 901cf2b..84dd4ae 100644
+index 86461a7..3745607 100644
--- a/drivers/media/usb/em28xx/em28xx-core.c
+++ b/drivers/media/usb/em28xx/em28xx-core.c
-@@ -1122,7 +1122,7 @@ int em28xx_suspend_extension(struct em28xx *dev)
+@@ -1125,7 +1125,7 @@ int em28xx_suspend_extension(struct em28xx *dev)
{
const struct em28xx_ops *ops = NULL;
@@ -2519,7 +2999,7 @@ index 901cf2b..84dd4ae 100644
mutex_lock(&em28xx_devlist_mutex);
list_for_each_entry(ops, &em28xx_extension_devlist, next) {
if (ops->suspend)
-@@ -1136,7 +1136,7 @@ int em28xx_resume_extension(struct em28xx *dev)
+@@ -1139,7 +1139,7 @@ int em28xx_resume_extension(struct em28xx *dev)
{
const struct em28xx_ops *ops = NULL;
@@ -2529,10 +3009,10 @@ index 901cf2b..84dd4ae 100644
list_for_each_entry(ops, &em28xx_extension_devlist, next) {
if (ops->resume)
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
-index 9682c52..41a6864 100644
+index 9877b69..aee70d4 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
-@@ -1667,7 +1667,7 @@ static int em28xx_dvb_fini(struct em28xx *dev)
+@@ -1724,7 +1724,7 @@ static int em28xx_dvb_fini(struct em28xx *dev)
if (!dev->dvb)
return 0;
@@ -2541,7 +3021,7 @@ index 9682c52..41a6864 100644
dvb = dev->dvb;
client = dvb->i2c_client_tuner;
-@@ -1718,17 +1718,17 @@ static int em28xx_dvb_suspend(struct em28xx *dev)
+@@ -1775,17 +1775,17 @@ static int em28xx_dvb_suspend(struct em28xx *dev)
if (!dev->board.has_dvb)
return 0;
@@ -2562,7 +3042,7 @@ index 9682c52..41a6864 100644
}
}
-@@ -1745,18 +1745,18 @@ static int em28xx_dvb_resume(struct em28xx *dev)
+@@ -1802,18 +1802,18 @@ static int em28xx_dvb_resume(struct em28xx *dev)
if (!dev->board.has_dvb)
return 0;
@@ -2585,10 +3065,27 @@ index 9682c52..41a6864 100644
}
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
-index 23f8f6a..b31e275 100644
+index d8dc03a..4007356 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
-@@ -833,7 +833,7 @@ static int em28xx_ir_fini(struct em28xx *dev)
+@@ -654,8 +654,6 @@ next_button:
+ if (dev->num_button_polling_addresses) {
+ memset(dev->button_polling_last_values, 0,
+ EM28XX_NUM_BUTTON_ADDRESSES_MAX);
+- INIT_DELAYED_WORK(&dev->buttons_query_work,
+- em28xx_query_buttons);
+ schedule_delayed_work(&dev->buttons_query_work,
+ msecs_to_jiffies(dev->button_polling_interval));
+ }
+@@ -689,6 +687,7 @@ static int em28xx_ir_init(struct em28xx *dev)
+ }
+
+ kref_get(&dev->ref);
++ INIT_DELAYED_WORK(&dev->buttons_query_work, em28xx_query_buttons);
+
+ if (dev->board.buttons)
+ em28xx_init_buttons(dev);
+@@ -833,7 +832,7 @@ static int em28xx_ir_fini(struct em28xx *dev)
return 0;
}
@@ -2597,7 +3094,7 @@ index 23f8f6a..b31e275 100644
em28xx_shutdown_buttons(dev);
-@@ -863,7 +863,7 @@ static int em28xx_ir_suspend(struct em28xx *dev)
+@@ -862,7 +861,7 @@ static int em28xx_ir_suspend(struct em28xx *dev)
if (dev->is_audio_only)
return 0;
@@ -2606,7 +3103,7 @@ index 23f8f6a..b31e275 100644
if (ir)
cancel_delayed_work_sync(&ir->work);
cancel_delayed_work_sync(&dev->buttons_query_work);
-@@ -880,7 +880,7 @@ static int em28xx_ir_resume(struct em28xx *dev)
+@@ -879,7 +878,7 @@ static int em28xx_ir_resume(struct em28xx *dev)
if (dev->is_audio_only)
return 0;
@@ -2616,10 +3113,10 @@ index 23f8f6a..b31e275 100644
ir_raw_event_register() */
if (ir)
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
-index 03d5ece..e0f4be8 100644
+index cf7f58b..f220c1f37 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
-@@ -1956,7 +1956,7 @@ static int em28xx_v4l2_fini(struct em28xx *dev)
+@@ -1958,7 +1958,7 @@ static int em28xx_v4l2_fini(struct em28xx *dev)
if (v4l2 == NULL)
return 0;
@@ -2628,7 +3125,7 @@ index 03d5ece..e0f4be8 100644
mutex_lock(&dev->lock);
-@@ -2005,7 +2005,7 @@ static int em28xx_v4l2_suspend(struct em28xx *dev)
+@@ -2007,7 +2007,7 @@ static int em28xx_v4l2_suspend(struct em28xx *dev)
if (!dev->has_video)
return 0;
@@ -2637,7 +3134,7 @@ index 03d5ece..e0f4be8 100644
em28xx_stop_urbs(dev);
return 0;
}
-@@ -2018,7 +2018,7 @@ static int em28xx_v4l2_resume(struct em28xx *dev)
+@@ -2020,7 +2020,7 @@ static int em28xx_v4l2_resume(struct em28xx *dev)
if (!dev->has_video)
return 0;
@@ -2647,7 +3144,7 @@ index 03d5ece..e0f4be8 100644
return 0;
}
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
-index 432aec8..350a28a 100644
+index 06ff0a2..f8fd503 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -242,7 +242,7 @@ static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
@@ -2667,7 +3164,7 @@ index 432aec8..350a28a 100644
dev->recvd_hw_ready = false;
return 0;
}
-@@ -729,9 +730,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id)
+@@ -731,9 +732,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id)
/* check if we need to start the dev */
if (!mei_host_is_ready(dev)) {
if (mei_hw_is_ready(dev)) {
@@ -2678,10 +3175,10 @@ index 432aec8..350a28a 100644
wake_up(&dev->wait_hw_ready);
} else {
diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
-index 5036d7d..38251da 100644
+index ca3424e..e187f70 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
-@@ -112,6 +112,38 @@ static int mv_conf_mbus_windows(struct platform_device *pdev,
+@@ -118,6 +118,38 @@ static int mv_conf_mbus_windows(struct platform_device *pdev,
return 0;
}
@@ -2720,7 +3217,7 @@ index 5036d7d..38251da 100644
static void pxav3_reset(struct sdhci_host *host, u8 mask)
{
struct platform_device *pdev = to_platform_device(mmc_dev(host->mmc));
-@@ -261,8 +293,8 @@ static struct sdhci_pxa_platdata *pxav3_get_mmc_pdata(struct device *dev)
+@@ -268,8 +300,8 @@ static struct sdhci_pxa_platdata *pxav3_get_mmc_pdata(struct device *dev)
if (!pdata)
return NULL;
@@ -2731,9 +3228,9 @@ index 5036d7d..38251da 100644
pdata->clk_delay_cycles = clk_delay_cycles;
return pdata;
-@@ -295,7 +327,13 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
- if (IS_ERR(host))
- return PTR_ERR(host);
+@@ -318,15 +350,18 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
+ if (!IS_ERR(pxa->clk_core))
+ clk_prepare_enable(pxa->clk_core);
+ /* enable 1/8V DDR capable */
+ host->mmc->caps |= MMC_CAP_1_8V_DDR;
@@ -2745,9 +3242,7 @@ index 5036d7d..38251da 100644
ret = mv_conf_mbus_windows(pdev, mv_mbus_dram_info());
if (ret < 0)
goto err_mbus_win;
-@@ -314,9 +352,6 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
- pltfm_host->clk = clk;
- clk_prepare_enable(clk);
+ }
- /* enable 1/8V DDR capable */
- host->mmc->caps |= MMC_CAP_1_8V_DDR;
@@ -2755,7 +3250,7 @@ index 5036d7d..38251da 100644
match = of_match_device(of_match_ptr(sdhci_pxav3_of_match), &pdev->dev);
if (match) {
ret = mmc_of_parse(host->mmc);
-@@ -355,10 +390,11 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
+@@ -365,10 +400,11 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
}
}
@@ -2769,7 +3264,7 @@ index 5036d7d..38251da 100644
pm_suspend_ignore_children(&pdev->dev, 1);
ret = sdhci_add_host(host);
-@@ -381,8 +417,8 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
+@@ -391,8 +427,8 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
return 0;
err_add_host:
@@ -2778,12 +3273,47 @@ index 5036d7d..38251da 100644
+ pm_runtime_put_noidle(&pdev->dev);
err_of_parse:
err_cd_req:
- clk_disable_unprepare(clk);
+ err_mbus_win:
+@@ -457,11 +493,11 @@ static int sdhci_pxav3_runtime_suspend(struct device *dev)
+ struct sdhci_host *host = dev_get_drvdata(dev);
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ struct sdhci_pxa *pxa = pltfm_host->priv;
+- unsigned long flags;
++ int ret;
+
+- spin_lock_irqsave(&host->lock, flags);
+- host->runtime_suspended = true;
+- spin_unlock_irqrestore(&host->lock, flags);
++ ret = sdhci_runtime_suspend_host(host);
++ if (ret)
++ return ret;
+
+ clk_disable_unprepare(pxa->clk_io);
+ if (!IS_ERR(pxa->clk_core))
+@@ -475,17 +511,12 @@ static int sdhci_pxav3_runtime_resume(struct device *dev)
+ struct sdhci_host *host = dev_get_drvdata(dev);
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ struct sdhci_pxa *pxa = pltfm_host->priv;
+- unsigned long flags;
+
+ clk_prepare_enable(pxa->clk_io);
+ if (!IS_ERR(pxa->clk_core))
+ clk_prepare_enable(pxa->clk_core);
+
+- spin_lock_irqsave(&host->lock, flags);
+- host->runtime_suspended = false;
+- spin_unlock_irqrestore(&host->lock, flags);
+-
+- return 0;
++ return sdhci_runtime_resume_host(host);
+ }
+ #endif
+
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
-index b6d2683..f71c22f 100644
+index 2091558..a704be0 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
-@@ -668,9 +668,6 @@ static void iwl_mvm_cleanup_iterator(void *data, u8 *mac,
+@@ -707,9 +707,6 @@ static void iwl_mvm_cleanup_iterator(void *data, u8 *mac,
mvmvif->uploaded = false;
mvmvif->ap_sta_id = IWL_MVM_STATION_COUNT;
@@ -2793,7 +3323,7 @@ index b6d2683..f71c22f 100644
spin_lock_bh(&mvm->time_event_lock);
iwl_mvm_te_clear_data(mvm, &mvmvif->time_event_data);
spin_unlock_bh(&mvm->time_event_lock);
-@@ -1014,7 +1011,7 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
+@@ -1146,7 +1143,7 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
ret = iwl_mvm_power_update_mac(mvm);
if (ret)
@@ -2803,10 +3333,10 @@ index b6d2683..f71c22f 100644
/* beacon filtering */
ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0);
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c
-index c6a517c..5928c9d 100644
+index c59d075..650a5f0 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
-@@ -902,6 +902,11 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
+@@ -930,6 +930,11 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
sta_id = ba_notif->sta_id;
tid = ba_notif->tid;
@@ -2819,7 +3349,7 @@ index c6a517c..5928c9d 100644
sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]);
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c
-index eb8e298..62ea2b5 100644
+index 8a6c7a0..76709f9 100644
--- a/drivers/net/wireless/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
@@ -722,7 +722,12 @@ void iwl_trans_pcie_tx_reset(struct iwl_trans *trans)
@@ -3162,10 +3692,10 @@ index 6f9be1c..8effef9 100644
#define GET_RX_DESC_RXMCS(__pdesc) \
LE_BITS_TO_4BYTE(__pdesc+12, 0, 7)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
-index 2b3c894..b720e78 100644
+index 887e6bd..09a66ba 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
-@@ -1389,7 +1389,7 @@ static int pci_uevent(struct device *dev, struct kobj_uevent_env *env)
+@@ -1383,7 +1383,7 @@ static int pci_uevent(struct device *dev, struct kobj_uevent_env *env)
if (add_uevent_var(env, "PCI_SLOT_NAME=%s", pci_name(pdev)))
return -ENOMEM;
@@ -3266,7 +3796,7 @@ index ff765d8..ce364a4 100644
ret = samsung_platform_init(samsung);
diff --git a/drivers/power/88pm860x_charger.c b/drivers/power/88pm860x_charger.c
-index de029bb..5ccca87 100644
+index 650930e..734ec4a 100644
--- a/drivers/power/88pm860x_charger.c
+++ b/drivers/power/88pm860x_charger.c
@@ -711,6 +711,7 @@ static int pm860x_charger_probe(struct platform_device *pdev)
@@ -3291,10 +3821,10 @@ index ad3ff8f..e4c95e1 100644
charger->set_property = bq24190_charger_set_property;
charger->property_is_writeable = bq24190_charger_property_is_writeable;
diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c
-index 7536933..e5deb11 100644
+index aef74bd..b7424c8 100644
--- a/drivers/power/gpio-charger.c
+++ b/drivers/power/gpio-charger.c
-@@ -168,7 +168,7 @@ static int gpio_charger_suspend(struct device *dev)
+@@ -229,7 +229,7 @@ static int gpio_charger_suspend(struct device *dev)
if (device_may_wakeup(dev))
gpio_charger->wakeup_enabled =
@@ -3303,7 +3833,7 @@ index 7536933..e5deb11 100644
return 0;
}
-@@ -178,7 +178,7 @@ static int gpio_charger_resume(struct device *dev)
+@@ -239,7 +239,7 @@ static int gpio_charger_resume(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct gpio_charger *gpio_charger = platform_get_drvdata(pdev);
@@ -3313,10 +3843,107 @@ index 7536933..e5deb11 100644
power_supply_changed(&gpio_charger->charger);
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
-index 5e881e5..6e50380 100644
+index ff283d2..d63f041 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
-@@ -3556,7 +3556,6 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
+@@ -1689,22 +1689,66 @@ static int megasas_slave_alloc(struct scsi_device *sdev)
+ return 0;
+ }
+
++/*
++* megasas_complete_outstanding_ioctls - Complete outstanding ioctls after a
++* kill adapter
++* @instance: Adapter soft state
++*
++*/
++void megasas_complete_outstanding_ioctls(struct megasas_instance *instance)
++{
++ int i;
++ struct megasas_cmd *cmd_mfi;
++ struct megasas_cmd_fusion *cmd_fusion;
++ struct fusion_context *fusion = instance->ctrl_context;
++
++ /* Find all outstanding ioctls */
++ if (fusion) {
++ for (i = 0; i < instance->max_fw_cmds; i++) {
++ cmd_fusion = fusion->cmd_list[i];
++ if (cmd_fusion->sync_cmd_idx != (u32)ULONG_MAX) {
++ cmd_mfi = instance->cmd_list[cmd_fusion->sync_cmd_idx];
++ if (cmd_mfi->sync_cmd &&
++ cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT)
++ megasas_complete_cmd(instance,
++ cmd_mfi, DID_OK);
++ }
++ }
++ } else {
++ for (i = 0; i < instance->max_fw_cmds; i++) {
++ cmd_mfi = instance->cmd_list[i];
++ if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd !=
++ MFI_CMD_ABORT)
++ megasas_complete_cmd(instance, cmd_mfi, DID_OK);
++ }
++ }
++}
++
++
+ void megaraid_sas_kill_hba(struct megasas_instance *instance)
+ {
++ /* Set critical error to block I/O & ioctls in case caller didn't */
++ instance->adprecovery = MEGASAS_HW_CRITICAL_ERROR;
++ /* Wait 1 second to ensure IO or ioctls in build have posted */
++ msleep(1000);
+ if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
+- (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY) ||
+- (instance->pdev->device == PCI_DEVICE_ID_LSI_FUSION) ||
+- (instance->pdev->device == PCI_DEVICE_ID_LSI_PLASMA) ||
+- (instance->pdev->device == PCI_DEVICE_ID_LSI_INVADER) ||
+- (instance->pdev->device == PCI_DEVICE_ID_LSI_FURY)) {
+- writel(MFI_STOP_ADP, &instance->reg_set->doorbell);
++ (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY) ||
++ (instance->pdev->device == PCI_DEVICE_ID_LSI_FUSION) ||
++ (instance->pdev->device == PCI_DEVICE_ID_LSI_PLASMA) ||
++ (instance->pdev->device == PCI_DEVICE_ID_LSI_INVADER) ||
++ (instance->pdev->device == PCI_DEVICE_ID_LSI_FURY)) {
++ writel(MFI_STOP_ADP,
++ &instance->reg_set->doorbell);
+ /* Flush */
+ readl(&instance->reg_set->doorbell);
+ if (instance->mpio && instance->requestorId)
+ memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS);
+ } else {
+- writel(MFI_STOP_ADP, &instance->reg_set->inbound_doorbell);
++ writel(MFI_STOP_ADP,
++ &instance->reg_set->inbound_doorbell);
+ }
++ /* Complete outstanding ioctls when adapter is killed */
++ megasas_complete_outstanding_ioctls(instance);
+ }
+
+ /**
+@@ -3028,10 +3072,9 @@ megasas_issue_pending_cmds_again(struct megasas_instance *instance)
+ "was tried multiple times during reset."
+ "Shutting down the HBA\n",
+ cmd, cmd->scmd, cmd->sync_cmd);
++ instance->instancet->disable_intr(instance);
++ atomic_set(&instance->fw_reset_no_pci_access, 1);
+ megaraid_sas_kill_hba(instance);
+-
+- instance->adprecovery =
+- MEGASAS_HW_CRITICAL_ERROR;
+ return;
+ }
+ }
+@@ -3165,8 +3208,8 @@ process_fw_state_change_wq(struct work_struct *work)
+ if (megasas_transition_to_ready(instance, 1)) {
+ printk(KERN_NOTICE "megaraid_sas:adapter not ready\n");
+
++ atomic_set(&instance->fw_reset_no_pci_access, 1);
+ megaraid_sas_kill_hba(instance);
+- instance->adprecovery = MEGASAS_HW_CRITICAL_ERROR;
+ return ;
+ }
+
+@@ -3547,7 +3590,6 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
int i;
u32 max_cmd;
u32 sge_sz;
@@ -3324,7 +3951,7 @@ index 5e881e5..6e50380 100644
u32 total_sz;
u32 frame_count;
struct megasas_cmd *cmd;
-@@ -3575,24 +3574,23 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
+@@ -3566,24 +3608,23 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
}
/*
@@ -3361,10 +3988,10 @@ index 5e881e5..6e50380 100644
if (!instance->frame_dma_pool) {
printk(KERN_DEBUG "megasas: failed to setup frame pool\n");
diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c
-index 0f66d0e..7d2d424 100644
+index 460c6a3..4f72287 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fp.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fp.c
-@@ -170,6 +170,7 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance)
+@@ -172,6 +172,7 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance)
struct MR_FW_RAID_MAP_ALL *fw_map_old = NULL;
struct MR_FW_RAID_MAP *pFwRaidMap = NULL;
int i;
@@ -3372,7 +3999,7 @@ index 0f66d0e..7d2d424 100644
struct MR_DRV_RAID_MAP_ALL *drv_map =
-@@ -189,9 +190,10 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance)
+@@ -191,9 +192,10 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance)
fw_map_old = (struct MR_FW_RAID_MAP_ALL *)
fusion->ld_map[(instance->map_id & 1)];
pFwRaidMap = &fw_map_old->raidMap;
@@ -3384,7 +4011,7 @@ index 0f66d0e..7d2d424 100644
dev_dbg(&instance->pdev->dev, "(%d) :Index 0x%x "
"Target Id 0x%x Seq Num 0x%x Size 0/%llx\n",
instance->unique_id, i,
-@@ -203,12 +205,15 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance)
+@@ -205,12 +207,15 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance)
memset(drv_map, 0, fusion->drv_map_sz);
pDrvRaidMap->totalSize = pFwRaidMap->totalSize;
@@ -3402,7 +4029,7 @@ index 0f66d0e..7d2d424 100644
pDrvRaidMap->ldSpanMap[i] = pFwRaidMap->ldSpanMap[i];
#if VD_EXT_DEBUG
dev_dbg(&instance->pdev->dev,
-@@ -250,7 +255,7 @@ u8 MR_ValidateMapInfo(struct megasas_instance *instance)
+@@ -252,7 +257,7 @@ u8 MR_ValidateMapInfo(struct megasas_instance *instance)
struct LD_LOAD_BALANCE_INFO *lbInfo;
PLD_SPAN_INFO ldSpanInfo;
struct MR_LD_RAID *raid;
@@ -3411,7 +4038,7 @@ index 0f66d0e..7d2d424 100644
u16 ld;
u32 expected_size;
-@@ -354,7 +359,7 @@ static int getSpanInfo(struct MR_DRV_RAID_MAP_ALL *map,
+@@ -356,7 +361,7 @@ static int getSpanInfo(struct MR_DRV_RAID_MAP_ALL *map,
for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES_EXT; ldCount++) {
ld = MR_TargetIdToLdGet(ldCount, map);
@@ -3420,7 +4047,7 @@ index 0f66d0e..7d2d424 100644
continue;
raid = MR_LdRaidGet(ld, map);
dev_dbg(&instance->pdev->dev, "LD %x: span_depth=%x\n",
-@@ -1155,7 +1160,7 @@ void mr_update_span_set(struct MR_DRV_RAID_MAP_ALL *map,
+@@ -1157,7 +1162,7 @@ void mr_update_span_set(struct MR_DRV_RAID_MAP_ALL *map,
for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES_EXT; ldCount++) {
ld = MR_TargetIdToLdGet(ldCount, map);
@@ -3430,10 +4057,10 @@ index 0f66d0e..7d2d424 100644
raid = MR_LdRaidGet(ld, map);
for (element = 0; element < MAX_QUAD_DEPTH; element++) {
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
-index 9d9c27c..5543956 100644
+index 71557f6..0764d20 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
-@@ -101,6 +101,8 @@ megasas_enable_intr_fusion(struct megasas_instance *instance)
+@@ -103,6 +103,8 @@ megasas_enable_intr_fusion(struct megasas_instance *instance)
{
struct megasas_register_set __iomem *regs;
regs = instance->reg_set;
@@ -3442,7 +4069,7 @@ index 9d9c27c..5543956 100644
/* For Thunderbolt/Invader also clear intr on enable */
writel(~0, &regs->outbound_intr_status);
readl(&regs->outbound_intr_status);
-@@ -109,7 +111,6 @@ megasas_enable_intr_fusion(struct megasas_instance *instance)
+@@ -111,7 +113,6 @@ megasas_enable_intr_fusion(struct megasas_instance *instance)
/* Dummy readl to force pci flush */
readl(&regs->outbound_intr_mask);
@@ -3450,7 +4077,7 @@ index 9d9c27c..5543956 100644
}
/**
-@@ -696,12 +697,11 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
+@@ -698,12 +699,11 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
cpu_to_le32(lower_32_bits(ioc_init_handle));
init_frame->data_xfer_len = cpu_to_le32(sizeof(struct MPI2_IOC_INIT_REQUEST));
@@ -3466,7 +4093,7 @@ index 9d9c27c..5543956 100644
/*
* disable the intr before firing the init frame
-@@ -1753,9 +1753,19 @@ megasas_build_dcdb_fusion(struct megasas_instance *instance,
+@@ -1717,9 +1717,19 @@ megasas_build_dcdb_fusion(struct megasas_instance *instance,
if (scmd->device->channel < MEGASAS_MAX_PD_CHANNELS)
goto NonFastPath;
@@ -3488,11 +4115,36 @@ index 9d9c27c..5543956 100644
goto NonFastPath;
raid = MR_LdRaidGet(ld, local_map_ptr);
+@@ -2612,7 +2622,6 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int iotimeout)
+ instance->host->host_no);
+ megaraid_sas_kill_hba(instance);
+ instance->skip_heartbeat_timer_del = 1;
+- instance->adprecovery = MEGASAS_HW_CRITICAL_ERROR;
+ retval = FAILED;
+ goto out;
+ }
+@@ -2808,8 +2817,6 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int iotimeout)
+ dev_info(&instance->pdev->dev,
+ "Failed from %s %d\n",
+ __func__, __LINE__);
+- instance->adprecovery =
+- MEGASAS_HW_CRITICAL_ERROR;
+ megaraid_sas_kill_hba(instance);
+ retval = FAILED;
+ }
+@@ -2858,7 +2865,6 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int iotimeout)
+ "adapter scsi%d.\n", instance->host->host_no);
+ megaraid_sas_kill_hba(instance);
+ instance->skip_heartbeat_timer_del = 1;
+- instance->adprecovery = MEGASAS_HW_CRITICAL_ERROR;
+ retval = FAILED;
+ } else {
+ /* For VF: Restart HB timer if we didn't OCR */
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.h b/drivers/scsi/megaraid/megaraid_sas_fusion.h
-index 0d183d5..a7f216f 100644
+index 5ab7dae..56e6db2 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.h
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.h
-@@ -304,14 +304,9 @@ struct MPI2_RAID_SCSI_IO_REQUEST {
+@@ -306,14 +306,9 @@ struct MPI2_RAID_SCSI_IO_REQUEST {
* MPT RAID MFA IO Descriptor.
*/
struct MEGASAS_RAID_MFA_IO_REQUEST_DESCRIPTOR {
@@ -3510,10 +4162,10 @@ index 0d183d5..a7f216f 100644
/* Default Request Descriptor */
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
-index 6035444..843594c 100644
+index b14f64c..763bffe 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
-@@ -1376,6 +1376,17 @@ sg_rq_end_io(struct request *rq, int uptodate)
+@@ -1350,6 +1350,17 @@ sg_rq_end_io(struct request *rq, int uptodate)
}
/* Rely on write phase to clean out srp status values, so no "else" */
@@ -3531,7 +4183,7 @@ index 6035444..843594c 100644
write_lock_irqsave(&sfp->rq_list_lock, iflags);
if (unlikely(srp->orphan)) {
if (sfp->keep_orphan)
-@@ -1710,7 +1721,22 @@ sg_start_req(Sg_request *srp, unsigned char *cmd)
+@@ -1684,7 +1695,22 @@ sg_start_req(Sg_request *srp, unsigned char *cmd)
return -ENOMEM;
}
@@ -3555,7 +4207,7 @@ index 6035444..843594c 100644
if (IS_ERR(rq)) {
kfree(long_cmdp);
return PTR_ERR(rq);
-@@ -1803,10 +1829,10 @@ sg_finish_rem_req(Sg_request *srp)
+@@ -1777,10 +1803,10 @@ sg_finish_rem_req(Sg_request *srp)
SCSI_LOG_TIMEOUT(4, sg_printk(KERN_INFO, sfp->parentdp,
"sg_finish_rem_req: res_used=%d\n",
(int) srp->res_used));
@@ -3649,24 +4301,51 @@ index 601e9cc..bb2890e 100644
if (!iscsit_global->in_shutdown)
iscsi_deallocate_extra_thread_sets();
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
-index 7c4447a..082304d 100644
+index a9d256d..6e1f150 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -210,6 +210,9 @@ static int pty_signal(struct tty_struct *tty, int sig)
- unsigned long flags;
+ {
struct pid *pgrp;
+ if (sig != SIGINT && sig != SIGQUIT && sig != SIGTSTP)
+ return -EINVAL;
+
if (tty->link) {
- spin_lock_irqsave(&tty->link->ctrl_lock, flags);
- pgrp = get_pid(tty->link->pgrp);
+ pgrp = tty_get_pgrp(tty->link);
+ if (pgrp)
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
-index edde3ec..6ee5c6c 100644
+index 4d848a2..92a8b26 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
-@@ -2577,7 +2577,7 @@ static int atmel_serial_probe(struct platform_device *pdev)
+@@ -794,7 +794,7 @@ static void atmel_tx_dma(struct uart_port *port)
+ return;
+ }
+
+- dma_sync_sg_for_device(port->dev, sg, 1, DMA_MEM_TO_DEV);
++ dma_sync_sg_for_device(port->dev, sg, 1, DMA_TO_DEVICE);
+
+ atmel_port->desc_tx = desc;
+ desc->callback = atmel_complete_tx_dma;
+@@ -927,7 +927,7 @@ static void atmel_rx_from_dma(struct uart_port *port)
+ dma_sync_sg_for_cpu(port->dev,
+ &atmel_port->sg_rx,
+ 1,
+- DMA_DEV_TO_MEM);
++ DMA_FROM_DEVICE);
+
+ /*
+ * ring->head points to the end of data already written by the DMA.
+@@ -974,7 +974,7 @@ static void atmel_rx_from_dma(struct uart_port *port)
+ dma_sync_sg_for_device(port->dev,
+ &atmel_port->sg_rx,
+ 1,
+- DMA_DEV_TO_MEM);
++ DMA_FROM_DEVICE);
+
+ /*
+ * Drop the lock here since it might end up calling
+@@ -2565,7 +2565,7 @@ static int atmel_serial_probe(struct platform_device *pdev)
ret = atmel_init_port(port, pdev);
if (ret)
@@ -3675,7 +4354,33 @@ index edde3ec..6ee5c6c 100644
if (!atmel_use_pdc_rx(&port->uart)) {
ret = -ENOMEM;
-@@ -2626,6 +2626,8 @@ err_alloc_ring:
+@@ -2596,6 +2596,12 @@ static int atmel_serial_probe(struct platform_device *pdev)
+ device_init_wakeup(&pdev->dev, 1);
+ platform_set_drvdata(pdev, port);
+
++ /*
++ * The peripheral clock has been disabled by atmel_init_port():
++ * enable it before accessing I/O registers
++ */
++ clk_prepare_enable(port->clk);
++
+ if (rs485_enabled) {
+ UART_PUT_MR(&port->uart, ATMEL_US_USMODE_NORMAL);
+ UART_PUT_CR(&port->uart, ATMEL_US_RTSEN);
+@@ -2606,6 +2612,12 @@ static int atmel_serial_probe(struct platform_device *pdev)
+ */
+ atmel_get_ip_name(&port->uart);
+
++ /*
++ * The peripheral clock can now safely be disabled till the port
++ * is used
++ */
++ clk_disable_unprepare(port->clk);
++
+ return 0;
+
+ err_add_port:
+@@ -2616,6 +2628,8 @@ err_alloc_ring:
clk_put(port->clk);
port->clk = NULL;
}
@@ -3685,7 +4390,7 @@ index edde3ec..6ee5c6c 100644
return ret;
}
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
-index 6dd53af..eb9bc7e 100644
+index e7cde3a..e95c497 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -506,9 +506,6 @@ static inline void lpuart_prepare_rx(struct lpuart_port *sport)
@@ -3741,11 +4446,29 @@ index 6dd53af..eb9bc7e 100644
lpuart_dma_tx_free(port);
lpuart_dma_rx_free(port);
}
+diff --git a/drivers/tty/tty_mutex.c b/drivers/tty/tty_mutex.c
+index 4486741..a872389 100644
+--- a/drivers/tty/tty_mutex.c
++++ b/drivers/tty/tty_mutex.c
+@@ -46,12 +46,8 @@ EXPORT_SYMBOL(tty_unlock);
+
+ void __lockfunc tty_lock_slave(struct tty_struct *tty)
+ {
+- if (tty && tty != tty->link) {
+- WARN_ON(!mutex_is_locked(&tty->link->legacy_mutex) ||
+- !tty->driver->type == TTY_DRIVER_TYPE_PTY ||
+- !tty->driver->type == PTY_TYPE_SLAVE);
++ if (tty && tty != tty->link)
+ tty_lock(tty);
+- }
+ }
+
+ void __lockfunc tty_unlock_slave(struct tty_struct *tty)
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
-index b33b00b..53c25bc 100644
+index f3fbbbc..42d8f17 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
-@@ -498,6 +498,7 @@ void invert_screen(struct vc_data *vc, int offset, int count, int viewed)
+@@ -500,6 +500,7 @@ void invert_screen(struct vc_data *vc, int offset, int count, int viewed)
#endif
if (DO_UPDATE(vc))
do_update_region(vc, (unsigned long) p, count);
@@ -3753,7 +4476,7 @@ index b33b00b..53c25bc 100644
}
/* used by selection: complement pointer position */
-@@ -514,6 +515,7 @@ void complement_pos(struct vc_data *vc, int offset)
+@@ -516,6 +517,7 @@ void complement_pos(struct vc_data *vc, int offset)
scr_writew(old, screenpos(vc, old_offset, 1));
if (DO_UPDATE(vc))
vc->vc_sw->con_putc(vc, old, oldy, oldx);
@@ -3761,7 +4484,7 @@ index b33b00b..53c25bc 100644
}
old_offset = offset;
-@@ -531,8 +533,8 @@ void complement_pos(struct vc_data *vc, int offset)
+@@ -533,8 +535,8 @@ void complement_pos(struct vc_data *vc, int offset)
oldy = (offset >> 1) / vc->vc_cols;
vc->vc_sw->con_putc(vc, new, oldy, oldx);
}
@@ -3771,6 +4494,73 @@ index b33b00b..53c25bc 100644
}
static void insert_char(struct vc_data *vc, unsigned int nr)
+diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
+index 546a17e8..a417b73 100644
+--- a/drivers/usb/class/cdc-acm.c
++++ b/drivers/usb/class/cdc-acm.c
+@@ -1091,6 +1091,7 @@ static int acm_probe(struct usb_interface *intf,
+ unsigned long quirks;
+ int num_rx_buf;
+ int i;
++ unsigned int elength = 0;
+ int combined_interfaces = 0;
+ struct device *tty_dev;
+ int rv = -ENOMEM;
+@@ -1136,9 +1137,12 @@ static int acm_probe(struct usb_interface *intf,
+ dev_err(&intf->dev, "skipping garbage\n");
+ goto next_desc;
+ }
++ elength = buffer[0];
+
+ switch (buffer[2]) {
+ case USB_CDC_UNION_TYPE: /* we've found it */
++ if (elength < sizeof(struct usb_cdc_union_desc))
++ goto next_desc;
+ if (union_header) {
+ dev_err(&intf->dev, "More than one "
+ "union descriptor, skipping ...\n");
+@@ -1147,29 +1151,36 @@ static int acm_probe(struct usb_interface *intf,
+ union_header = (struct usb_cdc_union_desc *)buffer;
+ break;
+ case USB_CDC_COUNTRY_TYPE: /* export through sysfs*/
++ if (elength < sizeof(struct usb_cdc_country_functional_desc))
++ goto next_desc;
+ cfd = (struct usb_cdc_country_functional_desc *)buffer;
+ break;
+ case USB_CDC_HEADER_TYPE: /* maybe check version */
+ break; /* for now we ignore it */
+ case USB_CDC_ACM_TYPE:
++ if (elength < 4)
++ goto next_desc;
+ ac_management_function = buffer[3];
+ break;
+ case USB_CDC_CALL_MANAGEMENT_TYPE:
++ if (elength < 5)
++ goto next_desc;
+ call_management_function = buffer[3];
+ call_interface_num = buffer[4];
+ break;
+ default:
+- /* there are LOTS more CDC descriptors that
++ /*
++ * there are LOTS more CDC descriptors that
+ * could legitimately be found here.
+ */
+ dev_dbg(&intf->dev, "Ignoring descriptor: "
+- "type %02x, length %d\n",
+- buffer[2], buffer[0]);
++ "type %02x, length %ud\n",
++ buffer[2], elength);
+ break;
+ }
+ next_desc:
+- buflen -= buffer[0];
+- buffer += buffer[0];
++ buflen -= elength;
++ buffer += elength;
+ }
+
+ if (!union_header) {
diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c
index 684ef70..506b969 100644
--- a/drivers/usb/core/buffer.c
@@ -3811,7 +4601,7 @@ index 684ef70..506b969 100644
/* SETUP primitives */
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
-index 9bffd26..d7a6d8b 100644
+index 874dec3..818369a 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -275,21 +275,6 @@ static int usb_unbind_device(struct device *dev)
@@ -3852,7 +4642,7 @@ index 9bffd26..d7a6d8b 100644
/* Free streams */
for (i = 0, j = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) {
-@@ -1801,6 +1784,18 @@ static int autosuspend_check(struct usb_device *udev)
+@@ -1797,6 +1780,18 @@ static int autosuspend_check(struct usb_device *udev)
dev_dbg(&udev->dev, "remote wakeup needed for autosuspend\n");
return -EOPNOTSUPP;
}
@@ -3872,7 +4662,7 @@ index 9bffd26..d7a6d8b 100644
return 0;
}
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
-index a6efb41..0009fc8 100644
+index 11cee55..45a915c 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1618,6 +1618,7 @@ static int unlink1(struct usb_hcd *hcd, struct urb *urb, int status)
@@ -3912,10 +4702,10 @@ index a6efb41..0009fc8 100644
}
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
-index b649fef..2246954 100644
+index aeb50bb..b4bfa3a 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
-@@ -5591,26 +5591,19 @@ EXPORT_SYMBOL_GPL(usb_reset_device);
+@@ -5589,26 +5589,19 @@ EXPORT_SYMBOL_GPL(usb_reset_device);
* possible; depending on how the driver attached to each interface
* handles ->pre_reset(), the second reset might happen or not.
*
@@ -4010,10 +4800,10 @@ index f7b7713..f368d20 100644
kfree(new_interfaces);
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
-index 2dd2362..29ee936 100644
+index 2a92b97..b1fb9ae 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
-@@ -1051,6 +1051,7 @@ static int __init usb_init(void)
+@@ -1049,6 +1049,7 @@ static int __init usb_init(void)
pr_info("%s: USB support disabled\n", usbcore_name);
return 0;
}
@@ -4021,8 +4811,20 @@ index 2dd2362..29ee936 100644
retval = usb_debugfs_init();
if (retval)
+diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
+index 8f65ab3..4efd3bd 100644
+--- a/drivers/usb/dwc3/gadget.c
++++ b/drivers/usb/dwc3/gadget.c
+@@ -2043,6 +2043,7 @@ static void dwc3_resume_gadget(struct dwc3 *dwc)
+ if (dwc->gadget_driver && dwc->gadget_driver->resume) {
+ spin_unlock(&dwc->lock);
+ dwc->gadget_driver->resume(&dwc->gadget);
++ spin_lock(&dwc->lock);
+ }
+ }
+
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
-index e752c30..d2a8565 100644
+index 395649f..c83ac89 100644
--- a/drivers/usb/host/isp1760-hcd.c
+++ b/drivers/usb/host/isp1760-hcd.c
@@ -2247,6 +2247,9 @@ struct usb_hcd *isp1760_register(phys_addr_t res_start, resource_size_t res_len,
@@ -4070,10 +4872,10 @@ index f8bb36f..bf19407 100644
if (err) {
pr_err("%s: dpm_suspend_start %d\n", __func__, err);
diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
-index 3e32146..d30c6b2 100644
+index e999496e..8e38499 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
-@@ -712,12 +712,11 @@ static int prepare_pending_reqs(struct vscsibk_info *info,
+@@ -708,12 +708,11 @@ static int prepare_pending_reqs(struct vscsibk_info *info,
static int scsiback_do_cmd_fn(struct vscsibk_info *info)
{
struct vscsiif_back_ring *ring = &info->ring;
@@ -4087,7 +4889,7 @@ index 3e32146..d30c6b2 100644
rc = ring->req_cons;
rp = ring->sring->req_prod;
-@@ -738,11 +737,10 @@ static int scsiback_do_cmd_fn(struct vscsibk_info *info)
+@@ -734,11 +733,10 @@ static int scsiback_do_cmd_fn(struct vscsibk_info *info)
if (!pending_req)
return 1;
@@ -4101,7 +4903,7 @@ index 3e32146..d30c6b2 100644
if (err) {
switch (err) {
case -ENODEV:
-@@ -758,9 +756,9 @@ static int scsiback_do_cmd_fn(struct vscsibk_info *info)
+@@ -754,9 +752,9 @@ static int scsiback_do_cmd_fn(struct vscsibk_info *info)
return 1;
}
@@ -4113,7 +4915,7 @@ index 3e32146..d30c6b2 100644
scsiback_fast_flush_area(pending_req);
scsiback_do_resp_with_sense(NULL,
DRIVER_ERROR << 24, 0, pending_req);
-@@ -771,7 +769,7 @@ static int scsiback_do_cmd_fn(struct vscsibk_info *info)
+@@ -767,7 +765,7 @@ static int scsiback_do_cmd_fn(struct vscsibk_info *info)
break;
case VSCSIIF_ACT_SCSI_ABORT:
scsiback_device_action(pending_req, TMR_ABORT_TASK,
@@ -4123,10 +4925,10 @@ index 3e32146..d30c6b2 100644
case VSCSIIF_ACT_SCSI_RESET:
scsiback_device_action(pending_req, TMR_LUN_RESET, 0);
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
-index d8fc060..e1efcaa 100644
+index 02b1691..995986b 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
-@@ -554,11 +554,12 @@ out:
+@@ -645,11 +645,12 @@ out:
static unsigned long randomize_stack_top(unsigned long stack_top)
{
@@ -4142,7 +4944,7 @@ index d8fc060..e1efcaa 100644
}
#ifdef CONFIG_STACK_GROWSUP
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
-index 150822e..c81ce0c 100644
+index 14a72ed..f54511d 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -2609,32 +2609,23 @@ static int key_search(struct extent_buffer *b, struct btrfs_key *key,
@@ -4183,7 +4985,7 @@ index 150822e..c81ce0c 100644
eb = path->nodes[0];
if (ret && path->slots[0] >= btrfs_header_nritems(eb)) {
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
-index 9767673..b170983 100644
+index 8c63419..6f46c9b 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1630,6 +1630,7 @@ struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info,
@@ -4210,7 +5012,7 @@ index 9767673..b170983 100644
if (ret < 0)
goto fail;
if (ret == 0)
-@@ -2496,7 +2503,7 @@ int open_ctree(struct super_block *sb,
+@@ -2498,7 +2505,7 @@ int open_ctree(struct super_block *sb,
features |= BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO;
if (features & BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA)
@@ -4220,7 +5022,7 @@ index 9767673..b170983 100644
/*
* flag our filesystem as having big metadata blocks if
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
-index 7d96cc9..ee1c604 100644
+index 1a9585d..f78e9dc 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -488,8 +488,20 @@ insert:
@@ -4266,7 +5068,7 @@ index 7d96cc9..ee1c604 100644
return ret;
}
-@@ -3209,7 +3230,8 @@ static int drop_objectid_items(struct btrfs_trans_handle *trans,
+@@ -3219,7 +3240,8 @@ static int drop_objectid_items(struct btrfs_trans_handle *trans,
static void fill_inode_item(struct btrfs_trans_handle *trans,
struct extent_buffer *leaf,
struct btrfs_inode_item *item,
@@ -4276,7 +5078,7 @@ index 7d96cc9..ee1c604 100644
{
struct btrfs_map_token token;
-@@ -3222,7 +3244,7 @@ static void fill_inode_item(struct btrfs_trans_handle *trans,
+@@ -3232,7 +3254,7 @@ static void fill_inode_item(struct btrfs_trans_handle *trans,
* to say 'update this inode with these values'
*/
btrfs_set_token_inode_generation(leaf, item, 0, &token);
@@ -4285,7 +5087,7 @@ index 7d96cc9..ee1c604 100644
} else {
btrfs_set_token_inode_generation(leaf, item,
BTRFS_I(inode)->generation,
-@@ -3274,7 +3296,7 @@ static int log_inode_item(struct btrfs_trans_handle *trans,
+@@ -3284,7 +3306,7 @@ static int log_inode_item(struct btrfs_trans_handle *trans,
return ret;
inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0],
struct btrfs_inode_item);
@@ -4294,7 +5096,7 @@ index 7d96cc9..ee1c604 100644
btrfs_release_path(path);
return 0;
}
-@@ -3283,7 +3305,8 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
+@@ -3293,7 +3315,8 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
struct inode *inode,
struct btrfs_path *dst_path,
struct btrfs_path *src_path, u64 *last_extent,
@@ -4304,7 +5106,7 @@ index 7d96cc9..ee1c604 100644
{
unsigned long src_offset;
unsigned long dst_offset;
-@@ -3340,7 +3363,8 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
+@@ -3350,7 +3373,8 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
dst_path->slots[0],
struct btrfs_inode_item);
fill_inode_item(trans, dst_path->nodes[0], inode_item,
@@ -4314,7 +5116,7 @@ index 7d96cc9..ee1c604 100644
} else {
copy_extent_buffer(dst_path->nodes[0], src, dst_offset,
src_offset, ins_sizes[i]);
-@@ -3886,6 +3910,33 @@ process:
+@@ -3902,6 +3926,33 @@ process:
return ret;
}
@@ -4348,7 +5150,7 @@ index 7d96cc9..ee1c604 100644
/* log a single inode in the tree log.
* At least one parent directory for this inode must exist in the tree
* or be logged already.
-@@ -3923,6 +3974,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
+@@ -3939,6 +3990,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
bool fast_search = false;
u64 ino = btrfs_ino(inode);
struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
@@ -4356,7 +5158,7 @@ index 7d96cc9..ee1c604 100644
path = btrfs_alloc_path();
if (!path)
-@@ -3976,6 +4028,25 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
+@@ -3992,6 +4044,25 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
max_key_type = BTRFS_XATTR_ITEM_KEY;
ret = drop_objectid_items(trans, log, path, ino, max_key_type);
} else {
@@ -4382,7 +5184,7 @@ index 7d96cc9..ee1c604 100644
if (test_and_clear_bit(BTRFS_INODE_NEEDS_FULL_SYNC,
&BTRFS_I(inode)->runtime_flags)) {
clear_bit(BTRFS_INODE_COPY_EVERYTHING,
-@@ -4031,7 +4102,8 @@ again:
+@@ -4047,7 +4118,8 @@ again:
}
ret = copy_items(trans, inode, dst_path, path, &last_extent,
@@ -4392,7 +5194,7 @@ index 7d96cc9..ee1c604 100644
if (ret < 0) {
err = ret;
goto out_unlock;
-@@ -4055,7 +4127,7 @@ next_slot:
+@@ -4071,7 +4143,7 @@ next_slot:
if (ins_nr) {
ret = copy_items(trans, inode, dst_path, path,
&last_extent, ins_start_slot,
@@ -4401,7 +5203,7 @@ index 7d96cc9..ee1c604 100644
if (ret < 0) {
err = ret;
goto out_unlock;
-@@ -4076,7 +4148,8 @@ next_slot:
+@@ -4092,7 +4164,8 @@ next_slot:
}
if (ins_nr) {
ret = copy_items(trans, inode, dst_path, path, &last_extent,
@@ -4411,6 +5213,22 @@ index 7d96cc9..ee1c604 100644
if (ret < 0) {
err = ret;
goto out_unlock;
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c
+index 74c5f53..fc29b2c 100644
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -4864,9 +4864,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
+ if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^
+ test_opt(sb, JOURNAL_CHECKSUM)) {
+ ext4_msg(sb, KERN_ERR, "changing journal_checksum "
+- "during remount not supported");
+- err = -EINVAL;
+- goto restore_opts;
++ "during remount not supported; ignoring");
++ sbi->s_mount_opt ^= EXT4_MOUNT_JOURNAL_CHECKSUM;
+ }
+
+ if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 7654e87..9ad5ba4 100644
--- a/fs/jffs2/scan.c
@@ -4435,7 +5253,7 @@ index 7654e87..9ad5ba4 100644
if (!buf_size) {
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
-index 9106f42..67bdc0b 100644
+index 1cc6ec5..47a32b6 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -65,7 +65,7 @@ static inline struct sockaddr *nsm_addr(const struct nsm_handle *nsm)
@@ -4560,10 +5378,10 @@ index 294692f..a094b0c 100644
cinfo->ds = &dreq->ds_cinfo;
cinfo->dreq = dreq;
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
-index efaa31c..e1acc1c 100644
+index b6f34bf..b84efe4 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
-@@ -377,7 +377,7 @@ extern struct rpc_stat nfs_rpcstat;
+@@ -375,7 +375,7 @@ extern struct rpc_stat nfs_rpcstat;
extern int __init register_nfs_fs(void);
extern void __exit unregister_nfs_fs(void);
@@ -4572,7 +5390,7 @@ index efaa31c..e1acc1c 100644
extern void nfs_sb_deactive(struct super_block *sb);
/* namespace.c */
-@@ -495,6 +495,26 @@ extern int nfs41_walk_client_list(struct nfs_client *clp,
+@@ -493,6 +493,26 @@ extern int nfs41_walk_client_list(struct nfs_client *clp,
struct nfs_client **result,
struct rpc_cred *cred);
@@ -4600,10 +5418,10 @@ index efaa31c..e1acc1c 100644
* Determine the device name as a string
*/
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
-index 83f3a7d..cd61707 100644
+index c347705..89f6827 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
-@@ -5130,9 +5130,13 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata)
+@@ -5137,9 +5137,13 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata)
static void nfs4_delegreturn_release(void *calldata)
{
struct nfs4_delegreturndata *data = calldata;
@@ -4619,7 +5437,7 @@ index 83f3a7d..cd61707 100644
kfree(calldata);
}
-@@ -5189,9 +5193,9 @@ static int _nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, co
+@@ -5196,9 +5200,9 @@ static int _nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, co
nfs_fattr_init(data->res.fattr);
data->timestamp = jiffies;
data->rpc_status = 0;
@@ -4730,10 +5548,10 @@ index 10b6539..465223b 100644
if (!oinfo) {
mlog(ML_ERROR, "failed to allocate memory for ocfs2 quota"
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index 4e0388c..e8972bc 100644
+index 246eae8..88f9b83 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
-@@ -1034,7 +1034,7 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
+@@ -1069,7 +1069,7 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
struct vm_area_struct *vma;
struct pagemapread *pm = walk->private;
spinlock_t *ptl;
@@ -4742,7 +5560,7 @@ index 4e0388c..e8972bc 100644
int err = 0;
/* find the first VMA at or above 'addr' */
-@@ -1095,15 +1095,19 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
+@@ -1130,15 +1130,19 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
BUG_ON(is_vm_hugetlb_page(vma));
/* Addresses in the VMA. */
@@ -4767,10 +5585,10 @@ index 4e0388c..e8972bc 100644
if (addr == end)
break;
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
-index 9340228..05fea2a 100644
+index 69df5b2..ca035a2 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
-@@ -2380,16 +2380,6 @@ out:
+@@ -2385,16 +2385,6 @@ out:
}
EXPORT_SYMBOL(dquot_quota_on_mount);
@@ -4787,7 +5605,7 @@ index 9340228..05fea2a 100644
/* Generic routine for getting common part of quota structure */
static void do_get_dqblk(struct dquot *dquot, struct qc_dqblk *di)
{
-@@ -2439,13 +2429,13 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di)
+@@ -2444,13 +2434,13 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di)
return -EINVAL;
if (((di->d_fieldmask & QC_SPC_SOFT) &&
@@ -4926,10 +5744,10 @@ index 5bc71d9..7b72b7d 100644
}
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
-index 79c9819..661666e 100644
+index b5eb474..4e20fe7 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
-@@ -976,7 +976,11 @@ xfs_bmap_local_to_extents(
+@@ -973,7 +973,11 @@ xfs_bmap_local_to_extents(
*firstblock = args.fsbno;
bp = xfs_btree_get_bufl(args.mp, tp, args.fsbno, 0);
@@ -4943,10 +5761,10 @@ index 79c9819..661666e 100644
/* account for the change in fork size and log everything */
diff --git a/fs/xfs/libxfs/xfs_symlink_remote.c b/fs/xfs/libxfs/xfs_symlink_remote.c
-index 5782f03..a7dce9a 100644
+index c80c523..e7e26bd 100644
--- a/fs/xfs/libxfs/xfs_symlink_remote.c
+++ b/fs/xfs/libxfs/xfs_symlink_remote.c
-@@ -180,6 +180,8 @@ xfs_symlink_local_to_remote(
+@@ -178,6 +178,8 @@ xfs_symlink_local_to_remote(
struct xfs_mount *mp = ip->i_mount;
char *buf;
@@ -4956,7 +5774,7 @@ index 5782f03..a7dce9a 100644
bp->b_ops = NULL;
memcpy(bp->b_addr, ifp->if_u1.if_data, ifp->if_bytes);
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
-index f159695..1a6c9b9 100644
+index 3f9bd58..744352b 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -319,6 +319,10 @@ xfs_buf_item_format(
@@ -4971,10 +5789,10 @@ index f159695..1a6c9b9 100644
/*
* If it is an inode buffer, transfer the in-memory state to the
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
-index 8ed049d..3cc309a 100644
+index 41f804e..d745e1a 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
-@@ -2000,6 +2000,7 @@ xfs_iunlink(
+@@ -1995,6 +1995,7 @@ xfs_iunlink(
agi->agi_unlinked[bucket_index] = cpu_to_be32(agino);
offset = offsetof(xfs_agi_t, agi_unlinked) +
(sizeof(xfs_agino_t) * bucket_index);
@@ -4982,7 +5800,7 @@ index 8ed049d..3cc309a 100644
xfs_trans_log_buf(tp, agibp, offset,
(offset + sizeof(xfs_agino_t) - 1));
return 0;
-@@ -2091,6 +2092,7 @@ xfs_iunlink_remove(
+@@ -2086,6 +2087,7 @@ xfs_iunlink_remove(
agi->agi_unlinked[bucket_index] = cpu_to_be32(next_agino);
offset = offsetof(xfs_agi_t, agi_unlinked) +
(sizeof(xfs_agino_t) * bucket_index);
@@ -4991,10 +5809,10 @@ index 8ed049d..3cc309a 100644
(offset + sizeof(xfs_agino_t) - 1));
} else {
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
-index d68f230..cf2bc2d 100644
+index 79fb19d..79a62bb 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
-@@ -844,6 +844,11 @@ xfs_qm_reset_dqcounts(
+@@ -842,6 +842,11 @@ xfs_qm_reset_dqcounts(
*/
xfs_dqcheck(mp, ddq, id+j, type, XFS_QMOPT_DQREPAIR,
"xfs_quotacheck");
@@ -5007,10 +5825,10 @@ index d68f230..cf2bc2d 100644
ddq->d_icount = 0;
ddq->d_rtbcount = 0;
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
-index 30e8e34..32dfdb5 100644
+index fa3135b..eb90cd5 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
-@@ -474,6 +474,7 @@ xfs_trans_apply_sb_deltas(
+@@ -472,6 +472,7 @@ xfs_trans_apply_sb_deltas(
whole = 1;
}
@@ -5018,6 +5836,78 @@ index 30e8e34..32dfdb5 100644
if (whole)
/*
* Log the whole thing, the fields are noncontiguous.
+diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
+index 0a4d4ab..7579841 100644
+--- a/fs/xfs/xfs_trans_buf.c
++++ b/fs/xfs/xfs_trans_buf.c
+@@ -327,9 +327,10 @@ xfs_trans_read_buf_map(
+ return -EIO;
+ }
+
+- if (tp)
++ if (tp) {
+ _xfs_trans_bjoin(tp, bp, 1);
+- trace_xfs_trans_read_buf(bp->b_fspriv);
++ trace_xfs_trans_read_buf(bp->b_fspriv);
++ }
+ *bpp = bp;
+ return 0;
+
+diff --git a/include/linux/compiler.h b/include/linux/compiler.h
+index 33063f8..fa6a314 100644
+--- a/include/linux/compiler.h
++++ b/include/linux/compiler.h
+@@ -198,7 +198,7 @@ static __always_inline void data_access_exceeds_word_size(void)
+ {
+ }
+
+-static __always_inline void __read_once_size(volatile void *p, void *res, int size)
++static __always_inline void __read_once_size(const volatile void *p, void *res, int size)
+ {
+ switch (size) {
+ case 1: *(__u8 *)res = *(volatile __u8 *)p; break;
+@@ -255,10 +255,10 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
+ */
+
+ #define READ_ONCE(x) \
+- ({ typeof(x) __val; __read_once_size(&x, &__val, sizeof(__val)); __val; })
++ ({ union { typeof(x) __val; char __c[1]; } __u; __read_once_size(&(x), __u.__c, sizeof(x)); __u.__val; })
+
+ #define WRITE_ONCE(x, val) \
+- ({ typeof(x) __val; __val = val; __write_once_size(&x, &__val, sizeof(__val)); __val; })
++ ({ typeof(x) __val = (val); __write_once_size(&(x), &__val, sizeof(__val)); __val; })
+
+ #endif /* __KERNEL__ */
+
+@@ -447,12 +447,23 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
+ * to make the compiler aware of ordering is to put the two invocations of
+ * ACCESS_ONCE() in different C statements.
+ *
+- * This macro does absolutely -nothing- to prevent the CPU from reordering,
+- * merging, or refetching absolutely anything at any time. Its main intended
+- * use is to mediate communication between process-level code and irq/NMI
+- * handlers, all running on the same CPU.
++ * ACCESS_ONCE will only work on scalar types. For union types, ACCESS_ONCE
++ * on a union member will work as long as the size of the member matches the
++ * size of the union and the size is smaller than word size.
++ *
++ * The major use cases of ACCESS_ONCE used to be (1) Mediating communication
++ * between process-level code and irq/NMI handlers, all running on the same CPU,
++ * and (2) Ensuring that the compiler does not fold, spindle, or otherwise
++ * mutilate accesses that either do not require ordering or that interact
++ * with an explicit memory barrier or atomic instruction that provides the
++ * required ordering.
++ *
++ * If possible use READ_ONCE/ASSIGN_ONCE instead.
+ */
+-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
++#define __ACCESS_ONCE(x) ({ \
++ __maybe_unused typeof(x) __var = (__force typeof(x)) 0; \
++ (volatile typeof(x) *)&(x); })
++#define ACCESS_ONCE(x) (*__ACCESS_ONCE(x))
+
+ /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */
+ #ifdef CONFIG_KPROBES
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 1c804b0..7ee1774 100644
--- a/include/linux/fsnotify.h
@@ -5035,11 +5925,31 @@ index 1c804b0..7ee1774 100644
if (target)
fsnotify_link_count(target);
+diff --git a/include/linux/kdb.h b/include/linux/kdb.h
+index 75ae2e2..a19bcf9 100644
+--- a/include/linux/kdb.h
++++ b/include/linux/kdb.h
+@@ -156,8 +156,14 @@ typedef enum {
+ KDB_REASON_SYSTEM_NMI, /* In NMI due to SYSTEM cmd; regs valid */
+ } kdb_reason_t;
+
++enum kdb_msgsrc {
++ KDB_MSGSRC_INTERNAL, /* direct call to kdb_printf() */
++ KDB_MSGSRC_PRINTK, /* trapped from printk() */
++};
++
+ extern int kdb_trap_printk;
+-extern __printf(1, 0) int vkdb_printf(const char *fmt, va_list args);
++extern __printf(2, 0) int vkdb_printf(enum kdb_msgsrc src, const char *fmt,
++ va_list args);
+ extern __printf(1, 2) int kdb_printf(const char *, ...);
+ typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...);
+
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
-index 47ebb4f..d77a08d 100644
+index 467c84e..06ebfa1 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
-@@ -1328,7 +1328,7 @@ struct nfs_commit_completion_ops {
+@@ -1342,7 +1342,7 @@ struct nfs_commit_completion_ops {
};
struct nfs_commit_info {
@@ -5049,10 +5959,10 @@ index 47ebb4f..d77a08d 100644
struct pnfs_ds_commit_info *ds;
struct nfs_direct_req *dreq; /* O_DIRECT request */
diff --git a/include/linux/quota.h b/include/linux/quota.h
-index 224fb81..8b0877f 100644
+index 097d7eb2..b86df49 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
-@@ -211,8 +211,8 @@ struct mem_dqinfo {
+@@ -216,8 +216,8 @@ struct mem_dqinfo {
unsigned long dqi_flags;
unsigned int dqi_bgrace;
unsigned int dqi_igrace;
@@ -5064,7 +5974,7 @@ index 224fb81..8b0877f 100644
};
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
-index 70736b9..b363a0f 100644
+index d86acc6..598ba80 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -57,7 +57,7 @@ struct rpc_clnt {
@@ -5076,7 +5986,7 @@ index 70736b9..b363a0f 100644
struct rpc_pipe_dir_head cl_pipedir_objects;
struct rpc_clnt * cl_parent; /* Points to parent of clones */
struct rpc_rtt cl_rtt_default;
-@@ -109,6 +109,7 @@ struct rpc_create_args {
+@@ -112,6 +112,7 @@ struct rpc_create_args {
struct sockaddr *saddress;
const struct rpc_timeout *timeout;
const char *servername;
@@ -5085,7 +5995,7 @@ index 70736b9..b363a0f 100644
u32 prognumber; /* overrides program->number */
u32 version;
diff --git a/include/linux/usb.h b/include/linux/usb.h
-index 447a7e2..3827bff 100644
+index f89c24a..058a769 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -127,10 +127,6 @@ enum usb_interface_condition {
@@ -5108,7 +6018,7 @@ index 447a7e2..3827bff 100644
struct device dev; /* interface specific device info */
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
-index cd96a2b..2f48e17 100644
+index 086bf13..68b1e83 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -146,6 +146,8 @@ struct usb_hcd {
@@ -5120,7 +6030,7 @@ index cd96a2b..2f48e17 100644
unsigned int irq; /* irq allocated */
void __iomem *regs; /* device memory/io */
-@@ -450,6 +452,7 @@ extern const struct dev_pm_ops usb_hcd_pci_pm_ops;
+@@ -453,6 +455,7 @@ extern const struct dev_pm_ops usb_hcd_pci_pm_ops;
#endif /* CONFIG_PCI */
/* pci-ish (pdev null is ok) buffer alloc/mapping support */
@@ -5206,11 +6116,94 @@ index a6fd939..3ebb168 100644
static inline int cipso_v4_validate(const struct sk_buff *skb,
unsigned char **option)
{
+diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
+index 07ce18c..ac5c0f9 100644
+--- a/kernel/debug/debug_core.c
++++ b/kernel/debug/debug_core.c
+@@ -604,7 +604,7 @@ return_normal:
+ online_cpus)
+ cpu_relax();
+ if (!time_left)
+- pr_crit("KGDB: Timed out waiting for secondary CPUs.\n");
++ pr_crit("Timed out waiting for secondary CPUs.\n");
+
+ /*
+ * At this point the primary processor is completely
+diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c
+index 7c70812..a550afb 100644
+--- a/kernel/debug/kdb/kdb_io.c
++++ b/kernel/debug/kdb/kdb_io.c
+@@ -548,7 +548,7 @@ static int kdb_search_string(char *searched, char *searchfor)
+ return 0;
+ }
+
+-int vkdb_printf(const char *fmt, va_list ap)
++int vkdb_printf(enum kdb_msgsrc src, const char *fmt, va_list ap)
+ {
+ int diag;
+ int linecount;
+@@ -691,19 +691,20 @@ kdb_printit:
+ * Write to all consoles.
+ */
+ retlen = strlen(kdb_buffer);
++ cp = (char *) printk_skip_level(kdb_buffer);
+ if (!dbg_kdb_mode && kgdb_connected) {
+- gdbstub_msg_write(kdb_buffer, retlen);
++ gdbstub_msg_write(cp, retlen - (cp - kdb_buffer));
+ } else {
+ if (dbg_io_ops && !dbg_io_ops->is_console) {
+- len = retlen;
+- cp = kdb_buffer;
++ len = retlen - (cp - kdb_buffer);
++ cp2 = cp;
+ while (len--) {
+- dbg_io_ops->write_char(*cp);
+- cp++;
++ dbg_io_ops->write_char(*cp2);
++ cp2++;
+ }
+ }
+ while (c) {
+- c->write(c, kdb_buffer, retlen);
++ c->write(c, cp, retlen - (cp - kdb_buffer));
+ touch_nmi_watchdog();
+ c = c->next;
+ }
+@@ -711,7 +712,10 @@ kdb_printit:
+ if (logging) {
+ saved_loglevel = console_loglevel;
+ console_loglevel = CONSOLE_LOGLEVEL_SILENT;
+- printk(KERN_INFO "%s", kdb_buffer);
++ if (printk_get_level(kdb_buffer) || src == KDB_MSGSRC_PRINTK)
++ printk("%s", kdb_buffer);
++ else
++ pr_info("%s", kdb_buffer);
+ }
+
+ if (KDB_STATE(PAGER)) {
+@@ -844,7 +848,7 @@ int kdb_printf(const char *fmt, ...)
+ int r;
+
+ va_start(ap, fmt);
+- r = vkdb_printf(fmt, ap);
++ r = vkdb_printf(KDB_MSGSRC_INTERNAL, fmt, ap);
+ va_end(ap);
+
+ return r;
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
-index 379650b..6ffdc96 100644
+index 7b40c5f..60f6bb8 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
-@@ -2535,7 +2535,7 @@ static int kdb_summary(int argc, const char **argv)
+@@ -2256,7 +2256,7 @@ static int kdb_cpu(int argc, const char **argv)
+ /*
+ * Validate cpunum
+ */
+- if ((cpunum > NR_CPUS) || !kgdb_info[cpunum].enter_kgdb)
++ if ((cpunum >= CONFIG_NR_CPUS) || !kgdb_info[cpunum].enter_kgdb)
+ return KDB_BADCPUNUM;
+
+ dbg_switch_cpu = cpunum;
+@@ -2583,7 +2583,7 @@ static int kdb_summary(int argc, const char **argv)
#define K(x) ((x) << (PAGE_SHIFT - 10))
kdb_printf("\nMemTotal: %8lu kB\nMemFree: %8lu kB\n"
"Buffers: %8lu kB\n",
@@ -5219,6 +6212,38 @@ index 379650b..6ffdc96 100644
return 0;
}
+diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
+index 02d6b6d..fae29e3 100644
+--- a/kernel/printk/printk.c
++++ b/kernel/printk/printk.c
+@@ -1811,7 +1811,7 @@ int vprintk_default(const char *fmt, va_list args)
+
+ #ifdef CONFIG_KGDB_KDB
+ if (unlikely(kdb_trap_printk)) {
+- r = vkdb_printf(fmt, args);
++ r = vkdb_printf(KDB_MSGSRC_PRINTK, fmt, args);
+ return r;
+ }
+ #endif
+diff --git a/kernel/softirq.c b/kernel/softirq.c
+index 501baa9..c497fcd 100644
+--- a/kernel/softirq.c
++++ b/kernel/softirq.c
+@@ -656,9 +656,13 @@ static void run_ksoftirqd(unsigned int cpu)
+ * in the task stack here.
+ */
+ __do_softirq();
+- rcu_note_context_switch();
+ local_irq_enable();
+ cond_resched();
++
++ preempt_disable();
++ rcu_note_context_switch();
++ preempt_enable();
++
+ return;
+ }
+ local_irq_enable();
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 28bf91c..85fb3d6 100644
--- a/kernel/time/ntp.c
@@ -5242,10 +6267,10 @@ index 28bf91c..85fb3d6 100644
}
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
-index a56e07c..f4fbbfc 100644
+index 7a4104c..d2e151c 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
-@@ -450,7 +450,10 @@ int ring_buffer_print_page_header(struct trace_seq *s)
+@@ -447,7 +447,10 @@ int ring_buffer_print_page_header(struct trace_seq *s)
struct rb_irq_work {
struct irq_work work;
wait_queue_head_t waiters;
@@ -5256,7 +6281,7 @@ index a56e07c..f4fbbfc 100644
};
/*
-@@ -532,6 +535,10 @@ static void rb_wake_up_waiters(struct irq_work *work)
+@@ -529,6 +532,10 @@ static void rb_wake_up_waiters(struct irq_work *work)
struct rb_irq_work *rbwork = container_of(work, struct rb_irq_work, work);
wake_up_all(&rbwork->waiters);
@@ -5267,7 +6292,7 @@ index a56e07c..f4fbbfc 100644
}
/**
-@@ -556,9 +563,11 @@ int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full)
+@@ -553,9 +560,11 @@ int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full)
* data in any cpu buffer, or a specific buffer, put the
* caller on the appropriate wait queue.
*/
@@ -5281,7 +6306,7 @@ index a56e07c..f4fbbfc 100644
if (!cpumask_test_cpu(cpu, buffer->cpumask))
return -ENODEV;
cpu_buffer = buffer->buffers[cpu];
-@@ -567,7 +576,10 @@ int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full)
+@@ -564,7 +573,10 @@ int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full)
while (true) {
@@ -5293,7 +6318,7 @@ index a56e07c..f4fbbfc 100644
/*
* The events can happen in critical sections where
-@@ -589,7 +601,10 @@ int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full)
+@@ -586,7 +598,10 @@ int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full)
* that is necessary is that the wake up happens after
* a task has been queued. It's OK for spurious wake ups.
*/
@@ -5305,7 +6330,7 @@ index a56e07c..f4fbbfc 100644
if (signal_pending(current)) {
ret = -EINTR;
-@@ -618,7 +633,10 @@ int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full)
+@@ -615,7 +630,10 @@ int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full)
schedule();
}
@@ -5317,7 +6342,7 @@ index a56e07c..f4fbbfc 100644
return ret;
}
-@@ -1233,6 +1251,7 @@ rb_allocate_cpu_buffer(struct ring_buffer *buffer, int nr_pages, int cpu)
+@@ -1230,6 +1248,7 @@ rb_allocate_cpu_buffer(struct ring_buffer *buffer, int nr_pages, int cpu)
init_completion(&cpu_buffer->update_done);
init_irq_work(&cpu_buffer->irq_work.work, rb_wake_up_waiters);
init_waitqueue_head(&cpu_buffer->irq_work.waiters);
@@ -5325,7 +6350,7 @@ index a56e07c..f4fbbfc 100644
bpage = kzalloc_node(ALIGN(sizeof(*bpage), cache_line_size()),
GFP_KERNEL, cpu_to_node(cpu));
-@@ -2804,6 +2823,8 @@ static void rb_commit(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2801,6 +2820,8 @@ static void rb_commit(struct ring_buffer_per_cpu *cpu_buffer,
static __always_inline void
rb_wakeups(struct ring_buffer *buffer, struct ring_buffer_per_cpu *cpu_buffer)
{
@@ -5334,7 +6359,7 @@ index a56e07c..f4fbbfc 100644
if (buffer->irq_work.waiters_pending) {
buffer->irq_work.waiters_pending = false;
/* irq_work_queue() supplies it's own memory barriers */
-@@ -2815,6 +2836,15 @@ rb_wakeups(struct ring_buffer *buffer, struct ring_buffer_per_cpu *cpu_buffer)
+@@ -2812,6 +2833,15 @@ rb_wakeups(struct ring_buffer *buffer, struct ring_buffer_per_cpu *cpu_buffer)
/* irq_work_queue() supplies it's own memory barriers */
irq_work_queue(&cpu_buffer->irq_work.work);
}
@@ -5351,10 +6376,10 @@ index a56e07c..f4fbbfc 100644
/**
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
-index 426962b..72c7134 100644
+index 4a9079b..361a827 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
-@@ -4916,7 +4916,7 @@ tracing_mark_write(struct file *filp, const char __user *ubuf,
+@@ -4942,7 +4942,7 @@ tracing_mark_write(struct file *filp, const char __user *ubuf,
*fpos += written;
out_unlock:
@@ -5363,11 +6388,24 @@ index 426962b..72c7134 100644
kunmap_atomic(map_page[i]);
put_page(pages[i]);
}
+diff --git a/mm/gup.c b/mm/gup.c
+index 8dd50ce..9b2afbf 100644
+--- a/mm/gup.c
++++ b/mm/gup.c
+@@ -926,7 +926,7 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
+
+ pmdp = pmd_offset(&pud, addr);
+ do {
+- pmd_t pmd = ACCESS_ONCE(*pmdp);
++ pmd_t pmd = READ_ONCE(*pmdp);
+
+ next = pmd_addr_end(addr, end);
+ if (pmd_none(pmd) || pmd_trans_splitting(pmd))
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
-index 9fd7227..f08fec7 100644
+index 85032de..c49586f 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
-@@ -3659,6 +3659,8 @@ follow_huge_pmd(struct mm_struct *mm, unsigned long address,
+@@ -3666,6 +3666,8 @@ follow_huge_pmd(struct mm_struct *mm, unsigned long address,
{
struct page *page;
@@ -5376,11 +6414,25 @@ index 9fd7227..f08fec7 100644
page = pte_page(*(pte_t *)pmd);
if (page)
page += ((address & ~PMD_MASK) >> PAGE_SHIFT);
+diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
+index 693ce8b..1775dbf 100644
+--- a/net/bluetooth/mgmt.c
++++ b/net/bluetooth/mgmt.c
+@@ -7066,7 +7066,8 @@ void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
+ * However when using service discovery, the value 127 will be
+ * returned when the RSSI is not available.
+ */
+- if (rssi == HCI_RSSI_INVALID && !hdev->discovery.report_invalid_rssi)
++ if (rssi == HCI_RSSI_INVALID && !hdev->discovery.report_invalid_rssi &&
++ link_type == ACL_LINK)
+ rssi = 0;
+
+ bacpy(&ev->addr.bdaddr, bdaddr);
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
-index f09b6b6..9ebc394 100644
+index b67749b..757ae32 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
-@@ -1392,8 +1392,12 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
+@@ -2303,8 +2303,12 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
* implementations are not known of and in order to not over
* complicate our implementation, simply pretend that we never
* received an IRK for such a device.
@@ -5395,10 +6447,10 @@ index f09b6b6..9ebc394 100644
goto distribute;
}
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
-index 6f16428..b0cf1f2 100644
+index 53299c7..f693a2f 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
-@@ -1006,14 +1006,24 @@ static void put_osd(struct ceph_osd *osd)
+@@ -1048,14 +1048,24 @@ static void put_osd(struct ceph_osd *osd)
*/
static void __remove_osd(struct ceph_osd_client *osdc, struct ceph_osd *osd)
{
@@ -5427,7 +6479,7 @@ index 6f16428..b0cf1f2 100644
}
static void remove_all_osds(struct ceph_osd_client *osdc)
-@@ -1023,7 +1033,7 @@ static void remove_all_osds(struct ceph_osd_client *osdc)
+@@ -1065,7 +1075,7 @@ static void remove_all_osds(struct ceph_osd_client *osdc)
while (!RB_EMPTY_ROOT(&osdc->osds)) {
struct ceph_osd *osd = rb_entry(rb_first(&osdc->osds),
struct ceph_osd, o_node);
@@ -5436,7 +6488,7 @@ index 6f16428..b0cf1f2 100644
}
mutex_unlock(&osdc->request_mutex);
}
-@@ -1064,7 +1074,7 @@ static void remove_old_osds(struct ceph_osd_client *osdc)
+@@ -1106,7 +1116,7 @@ static void remove_old_osds(struct ceph_osd_client *osdc)
list_for_each_entry_safe(osd, nosd, &osdc->osd_lru, o_osd_lru) {
if (time_before(jiffies, osd->lru_ttl))
break;
@@ -5445,7 +6497,7 @@ index 6f16428..b0cf1f2 100644
}
mutex_unlock(&osdc->request_mutex);
}
-@@ -1079,8 +1089,7 @@ static int __reset_osd(struct ceph_osd_client *osdc, struct ceph_osd *osd)
+@@ -1121,8 +1131,7 @@ static int __reset_osd(struct ceph_osd_client *osdc, struct ceph_osd *osd)
dout("__reset_osd %p osd%d\n", osd, osd->o_osd);
if (list_empty(&osd->o_requests) &&
list_empty(&osd->o_linger_requests)) {
@@ -5455,7 +6507,7 @@ index 6f16428..b0cf1f2 100644
return -ENODEV;
}
-@@ -1884,6 +1893,7 @@ static void reset_changed_osds(struct ceph_osd_client *osdc)
+@@ -1926,6 +1935,7 @@ static void reset_changed_osds(struct ceph_osd_client *osdc)
{
struct rb_node *p, *n;
@@ -5464,10 +6516,10 @@ index 6f16428..b0cf1f2 100644
struct ceph_osd *osd = rb_entry(p, struct ceph_osd, o_node);
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
-index 4715f25..bc7c966 100644
+index 5160c71..e361ea6 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
-@@ -376,20 +376,18 @@ static int cipso_v4_cache_check(const unsigned char *key,
+@@ -378,20 +378,18 @@ static int cipso_v4_cache_check(const unsigned char *key,
* negative values on failure.
*
*/
@@ -5489,7 +6541,7 @@ index 4715f25..bc7c966 100644
cipso_ptr_len = cipso_ptr[1];
entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
-@@ -1577,6 +1575,33 @@ static int cipso_v4_parsetag_loc(const struct cipso_v4_doi *doi_def,
+@@ -1579,6 +1577,33 @@ static int cipso_v4_parsetag_loc(const struct cipso_v4_doi *doi_def,
}
/**
@@ -5523,7 +6575,7 @@ index 4715f25..bc7c966 100644
* cipso_v4_validate - Validate a CIPSO option
* @option: the start of the option, on error it is set to point to the error
*
-@@ -2117,8 +2142,8 @@ void cipso_v4_req_delattr(struct request_sock *req)
+@@ -2119,8 +2144,8 @@ void cipso_v4_req_delattr(struct request_sock *req)
* on success and negative values on failure.
*
*/
@@ -5534,7 +6586,7 @@ index 4715f25..bc7c966 100644
{
int ret_val = -ENOMSG;
u32 doi;
-@@ -2303,22 +2328,6 @@ int cipso_v4_skbuff_delattr(struct sk_buff *skb)
+@@ -2305,22 +2330,6 @@ int cipso_v4_skbuff_delattr(struct sk_buff *skb)
return 0;
}
@@ -5603,7 +6655,7 @@ index a845cd4..28cddc8 100644
return -ENOMSG;
}
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
-index 9acd6ce..ae46f01 100644
+index 05da12a..3f5d4d4 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -286,10 +286,8 @@ static struct rpc_xprt *rpc_clnt_set_transport(struct rpc_clnt *clnt,
@@ -5619,7 +6671,7 @@ index 9acd6ce..ae46f01 100644
}
static int rpc_client_register(struct rpc_clnt *clnt,
-@@ -360,6 +358,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args,
+@@ -365,6 +363,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args,
const struct rpc_version *version;
struct rpc_clnt *clnt = NULL;
const struct rpc_timeout *timeout;
@@ -5627,7 +6679,7 @@ index 9acd6ce..ae46f01 100644
int err;
/* sanity check the name before trying to print it */
-@@ -415,8 +414,10 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args,
+@@ -420,8 +419,10 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args,
atomic_set(&clnt->cl_count, 1);
@@ -5639,7 +6691,7 @@ index 9acd6ce..ae46f01 100644
err = rpc_client_register(clnt, args->authflavor, args->client_name);
if (err)
-@@ -571,6 +572,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
+@@ -576,6 +577,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
if (xprt == NULL)
goto out_err;
args->servername = xprt->servername;
@@ -5648,7 +6700,7 @@ index 9acd6ce..ae46f01 100644
new = rpc_new_client(args, xprt, clnt);
if (IS_ERR(new)) {
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
-index 1891a10..74b75c3 100644
+index 0520201..cf5770d 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -355,7 +355,8 @@ out:
@@ -5702,7 +6754,7 @@ index b828a37..b48359c 100644
* Present a pointer to the forked smack label entry in an task blob.
*/
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index d515ec2..9d3c64a 100644
+index f1b17a4..a717877 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -43,8 +43,6 @@
@@ -5714,7 +6766,7 @@ index d515ec2..9d3c64a 100644
#define TRANS_TRUE "TRUE"
#define TRANS_TRUE_SIZE 4
-@@ -119,7 +117,7 @@ static int smk_bu_current(char *note, struct smack_known *oskp,
+@@ -120,7 +118,7 @@ static int smk_bu_current(char *note, struct smack_known *oskp,
static int smk_bu_task(struct task_struct *otp, int mode, int rc)
{
struct task_smack *tsp = current_security();
@@ -5723,7 +6775,7 @@ index d515ec2..9d3c64a 100644
char acc[SMK_NUM_ACCESS_TYPE + 1];
if (rc <= 0)
-@@ -127,7 +125,7 @@ static int smk_bu_task(struct task_struct *otp, int mode, int rc)
+@@ -128,7 +126,7 @@ static int smk_bu_task(struct task_struct *otp, int mode, int rc)
smk_bu_mode(mode, acc);
pr_info("Smack Bringup: (%s %s %s) %s to %s\n",
@@ -5732,7 +6784,7 @@ index d515ec2..9d3c64a 100644
current->comm, otp->comm);
return 0;
}
-@@ -344,7 +342,8 @@ static int smk_ptrace_rule_check(struct task_struct *tracer,
+@@ -345,7 +343,8 @@ static int smk_ptrace_rule_check(struct task_struct *tracer,
saip = &ad;
}
@@ -5742,7 +6794,7 @@ index d515ec2..9d3c64a 100644
tracer_known = smk_of_task(tsp);
if ((mode & PTRACE_MODE_ATTACH) &&
-@@ -364,11 +363,14 @@ static int smk_ptrace_rule_check(struct task_struct *tracer,
+@@ -365,11 +364,14 @@ static int smk_ptrace_rule_check(struct task_struct *tracer,
tracee_known->smk_known,
0, rc, saip);
@@ -5757,7 +6809,7 @@ index d515ec2..9d3c64a 100644
return rc;
}
-@@ -395,7 +397,7 @@ static int smack_ptrace_access_check(struct task_struct *ctp, unsigned int mode)
+@@ -396,7 +398,7 @@ static int smack_ptrace_access_check(struct task_struct *ctp, unsigned int mode)
if (rc != 0)
return rc;
@@ -5766,7 +6818,7 @@ index d515ec2..9d3c64a 100644
rc = smk_ptrace_rule_check(current, skp, mode, __func__);
return rc;
-@@ -1825,7 +1827,7 @@ static int smk_curacc_on_task(struct task_struct *p, int access,
+@@ -1826,7 +1828,7 @@ static int smk_curacc_on_task(struct task_struct *p, int access,
const char *caller)
{
struct smk_audit_info ad;
@@ -5775,7 +6827,7 @@ index d515ec2..9d3c64a 100644
int rc;
smk_ad_init(&ad, caller, LSM_AUDIT_DATA_TASK);
-@@ -1878,7 +1880,7 @@ static int smack_task_getsid(struct task_struct *p)
+@@ -1879,7 +1881,7 @@ static int smack_task_getsid(struct task_struct *p)
*/
static void smack_task_getsecid(struct task_struct *p, u32 *secid)
{
@@ -5784,7 +6836,7 @@ index d515ec2..9d3c64a 100644
*secid = skp->smk_secid;
}
-@@ -1985,7 +1987,7 @@ static int smack_task_kill(struct task_struct *p, struct siginfo *info,
+@@ -1986,7 +1988,7 @@ static int smack_task_kill(struct task_struct *p, struct siginfo *info,
{
struct smk_audit_info ad;
struct smack_known *skp;
@@ -5793,7 +6845,7 @@ index d515ec2..9d3c64a 100644
int rc;
smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK);
-@@ -2039,7 +2041,7 @@ static int smack_task_wait(struct task_struct *p)
+@@ -2040,7 +2042,7 @@ static int smack_task_wait(struct task_struct *p)
static void smack_task_to_inode(struct task_struct *p, struct inode *inode)
{
struct inode_smack *isp = inode->i_security;
@@ -5802,7 +6854,7 @@ index d515ec2..9d3c64a 100644
isp->smk_inode = skp;
}
-@@ -3199,7 +3201,7 @@ unlockandout:
+@@ -3200,7 +3202,7 @@ unlockandout:
*/
static int smack_getprocattr(struct task_struct *p, char *name, char **value)
{
@@ -5812,10 +6864,10 @@ index d515ec2..9d3c64a 100644
int slen;
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
-index c879c37..50762cf 100644
+index 65f1f4e..0c993f7 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
-@@ -4805,6 +4805,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
+@@ -4844,6 +4844,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
/* ALC282 */
@@ -5932,10 +6984,10 @@ index 6abc2ac..e768572 100644
static void snd_riptide_joystick_remove(struct pci_dev *pci)
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
-index 52d86af..fcf91ee 100644
+index 3342705..13bc201 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
-@@ -6114,6 +6114,9 @@ static int snd_hdspm_playback_open(struct snd_pcm_substream *substream)
+@@ -6086,6 +6086,9 @@ static int snd_hdspm_playback_open(struct snd_pcm_substream *substream)
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
64, 8192);
@@ -5945,7 +6997,7 @@ index 52d86af..fcf91ee 100644
break;
}
-@@ -6188,6 +6191,9 @@ static int snd_hdspm_capture_open(struct snd_pcm_substream *substream)
+@@ -6160,6 +6163,9 @@ static int snd_hdspm_capture_open(struct snd_pcm_substream *substream)
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
64, 8192);
@@ -5955,11 +7007,24 @@ index 52d86af..fcf91ee 100644
break;
}
+diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
+index 8349f98..ef2c70e 100644
+--- a/sound/soc/codecs/Kconfig
++++ b/sound/soc/codecs/Kconfig
+@@ -525,7 +525,7 @@ config SND_SOC_RT5677
+
+ config SND_SOC_RT5677_SPI
+ tristate
+- default SND_SOC_RT5677
++ default SND_SOC_RT5677 && SPI
+
+ #Freescale sgtl5000 codec
+ config SND_SOC_SGTL5000
diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c
-index 9bd8b4f..7134f9e 100644
+index 8a0833d..1e574c8 100644
--- a/sound/soc/codecs/rt5670.c
+++ b/sound/soc/codecs/rt5670.c
-@@ -2439,6 +2439,7 @@ static struct snd_soc_codec_driver soc_codec_dev_rt5670 = {
+@@ -2522,6 +2522,7 @@ static struct snd_soc_codec_driver soc_codec_dev_rt5670 = {
static const struct regmap_config rt5670_regmap = {
.reg_bits = 8,
.val_bits = 16,
@@ -5967,6 +7032,20 @@ index 9bd8b4f..7134f9e 100644
.max_register = RT5670_VENDOR_ID2 + 1 + (ARRAY_SIZE(rt5670_ranges) *
RT5670_PR_SPACING),
.volatile_reg = rt5670_volatile_register,
+diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
+index 918ada9..cc90988 100644
+--- a/sound/soc/codecs/rt5677.c
++++ b/sound/soc/codecs/rt5677.c
+@@ -702,6 +702,9 @@ static int rt5677_set_dsp_vad(struct snd_soc_codec *codec, bool on)
+ static bool activity;
+ int ret;
+
++ if (!IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI))
++ return -ENXIO;
++
+ if (on && !activity) {
+ activity = true;
+
diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig
index 8e948c6..2b81ca4 100644
--- a/sound/soc/davinci/Kconfig
@@ -5986,8 +7065,42 @@ index 8e948c6..2b81ca4 100644
select MFD_DAVINCI_VOICECODEC
select SND_DAVINCI_SOC_VCIF
select SND_SOC_CQ0093VC
+diff --git a/sound/soc/intel/sst/sst.h b/sound/soc/intel/sst/sst.h
+index 7f4bbfc..562bc48 100644
+--- a/sound/soc/intel/sst/sst.h
++++ b/sound/soc/intel/sst/sst.h
+@@ -58,6 +58,7 @@ enum sst_algo_ops {
+ #define SST_BLOCK_TIMEOUT 1000
+
+ #define FW_SIGNATURE_SIZE 4
++#define FW_NAME_SIZE 32
+
+ /* stream states */
+ enum sst_stream_states {
+@@ -426,7 +427,7 @@ struct intel_sst_drv {
+ * Holder for firmware name. Due to async call it needs to be
+ * persistent till worker thread gets called
+ */
+- char firmware_name[20];
++ char firmware_name[FW_NAME_SIZE];
+ };
+
+ /* misc definitions */
+diff --git a/sound/soc/intel/sst/sst_acpi.c b/sound/soc/intel/sst/sst_acpi.c
+index b336013..51f83ba 100644
+--- a/sound/soc/intel/sst/sst_acpi.c
++++ b/sound/soc/intel/sst/sst_acpi.c
+@@ -47,7 +47,7 @@ struct sst_machines {
+ char board[32];
+ char machine[32];
+ void (*machine_quirk)(void);
+- char firmware[32];
++ char firmware[FW_NAME_SIZE];
+ struct sst_platform_info *pdata;
+
+ };
diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c
-index 595eee3..a08a877 100644
+index 396dbd5..a9615a57 100644
--- a/sound/soc/pxa/mioa701_wm9713.c
+++ b/sound/soc/pxa/mioa701_wm9713.c
@@ -81,7 +81,7 @@ static int rear_amp_power(struct snd_soc_codec *codec, int power)
@@ -5999,6 +7112,34 @@ index 595eee3..a08a877 100644
return rear_amp_power(codec, SND_SOC_DAPM_EVENT_ON(event));
}
+diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
+index a739841..a0795ba 100644
+--- a/sound/usb/quirks.c
++++ b/sound/usb/quirks.c
+@@ -1122,6 +1122,7 @@ int snd_usb_select_mode_quirk(struct snd_usb_substream *subs,
+ int err;
+
+ switch (subs->stream->chip->usb_id) {
++ case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */
+ case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */
+ case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */
+
+@@ -1201,6 +1202,7 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
+ (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) {
+
+ switch (le16_to_cpu(dev->descriptor.idProduct)) {
++ case 0x1003: /* Denon DA300-USB */
+ case 0x3005: /* Marantz HD-DAC1 */
+ case 0x3006: /* Marantz SA-14S1 */
+ mdelay(20);
+@@ -1262,6 +1264,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
+
+ /* Denon/Marantz devices with USB DAC functionality */
+ switch (chip->usb_id) {
++ case USB_ID(0x154e, 0x1003): /* Denon DA300-USB */
+ case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */
+ case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */
+ if (fp->altsetting == 2)
diff --git a/tools/perf/util/cloexec.c b/tools/perf/util/cloexec.c
index 47b78b3..6da965b 100644
--- a/tools/perf/util/cloexec.c
diff --git a/3.18.9/4420_grsecurity-3.1-3.18.9-201503071142.patch b/3.19.1/4420_grsecurity-3.1-3.19.1-201503122205.patch
index dfa314e..fd20fa4 100644
--- a/3.18.9/4420_grsecurity-3.1-3.18.9-201503071142.patch
+++ b/3.19.1/4420_grsecurity-3.1-3.19.1-201503122205.patch
@@ -313,10 +313,10 @@ index a311db8..415b28c 100644
A typical pattern in a Kbuild file looks like this:
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index f4c71d4..66811b1 100644
+index 176d4fe..17ceefa 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
-@@ -1182,6 +1182,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -1191,6 +1191,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Format: <unsigned int> such that (rxsize & ~0x1fffc0) == 0.
Default: 1024
@@ -327,7 +327,7 @@ index f4c71d4..66811b1 100644
hashdist= [KNL,NUMA] Large hashes allocated during boot
are distributed across NUMA nodes. Defaults on
for 64-bit NUMA, off otherwise.
-@@ -2260,6 +2264,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -2283,6 +2287,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
noexec=on: enable non-executable mappings (default)
noexec=off: disable non-executable mappings
@@ -338,7 +338,7 @@ index f4c71d4..66811b1 100644
nosmap [X86]
Disable SMAP (Supervisor Mode Access Prevention)
even if it is supported by processor.
-@@ -2552,6 +2560,30 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -2584,6 +2592,30 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
the specified number of seconds. This is to be used if
your oopses keep scrolling off the screen.
@@ -370,7 +370,7 @@ index f4c71d4..66811b1 100644
pcd. [PARIDE]
diff --git a/Makefile b/Makefile
-index 62b3338..fba6407 100644
+index 688777b..2821d8c 100644
--- a/Makefile
+++ b/Makefile
@@ -298,7 +298,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
@@ -384,7 +384,7 @@ index 62b3338..fba6407 100644
ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \
-@@ -445,8 +447,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
+@@ -446,8 +448,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
# Rules shared between *config targets and build targets
# Basic helpers built in scripts/
@@ -395,7 +395,7 @@ index 62b3338..fba6407 100644
$(Q)$(MAKE) $(build)=scripts/basic
$(Q)rm -f .tmp_quiet_recordmcount
-@@ -620,6 +622,72 @@ endif
+@@ -622,6 +624,72 @@ endif
# Tell gcc to never replace conditional load with a non-conditional one
KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
@@ -468,7 +468,7 @@ index 62b3338..fba6407 100644
ifdef CONFIG_READABLE_ASM
# Disable optimizations that make assembler listings hard to read.
# reorder blocks reorders the control in the function
-@@ -712,7 +780,7 @@ KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g)
+@@ -714,7 +782,7 @@ KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g)
else
KBUILD_CFLAGS += -g
endif
@@ -477,7 +477,7 @@ index 62b3338..fba6407 100644
endif
ifdef CONFIG_DEBUG_INFO_DWARF4
KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,)
-@@ -877,7 +945,7 @@ export mod_sign_cmd
+@@ -879,7 +947,7 @@ export mod_sign_cmd
ifeq ($(KBUILD_EXTMOD),)
@@ -486,7 +486,7 @@ index 62b3338..fba6407 100644
vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-@@ -924,6 +992,8 @@ endif
+@@ -926,6 +994,8 @@ endif
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
@@ -495,7 +495,7 @@ index 62b3338..fba6407 100644
$(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
# Handle descending into subdirectories listed in $(vmlinux-dirs)
-@@ -933,7 +1003,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
+@@ -935,7 +1005,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
# Error messages still appears in the original language
PHONY += $(vmlinux-dirs)
@@ -504,7 +504,7 @@ index 62b3338..fba6407 100644
$(Q)$(MAKE) $(build)=$@
define filechk_kernel.release
-@@ -976,10 +1046,13 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
+@@ -978,10 +1048,13 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
archprepare: archheaders archscripts prepare1 scripts_basic
@@ -518,7 +518,7 @@ index 62b3338..fba6407 100644
prepare: prepare0
# Generate some files
-@@ -1094,6 +1167,8 @@ all: modules
+@@ -1095,6 +1168,8 @@ all: modules
# using awk while concatenating to the final file.
PHONY += modules
@@ -527,7 +527,7 @@ index 62b3338..fba6407 100644
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
@$(kecho) ' Building modules, stage 2.';
-@@ -1109,7 +1184,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
+@@ -1110,7 +1185,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
# Target to prepare building external modules
PHONY += modules_prepare
@@ -536,19 +536,19 @@ index 62b3338..fba6407 100644
# Target to install modules
PHONY += modules_install
-@@ -1175,7 +1250,10 @@ MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
+@@ -1176,7 +1251,10 @@ MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
signing_key.priv signing_key.x509 x509.genkey \
extra_certificates signing_key.x509.keyid \
-- signing_key.x509.signer include/linux/version.h
-+ signing_key.x509.signer include/linux/version.h \
+- signing_key.x509.signer
++ signing_key.x509.signer \
+ tools/gcc/size_overflow_plugin/size_overflow_hash_aux.h \
+ tools/gcc/size_overflow_plugin/size_overflow_hash.h \
+ tools/gcc/randomize_layout_seed.h
# clean - Delete most, but leave enough to build external modules
#
-@@ -1214,7 +1292,7 @@ distclean: mrproper
+@@ -1215,7 +1293,7 @@ distclean: mrproper
@find $(srctree) $(RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
@@ -557,7 +557,7 @@ index 62b3338..fba6407 100644
-type f -print | xargs rm -f
-@@ -1380,6 +1458,8 @@ PHONY += $(module-dirs) modules
+@@ -1381,6 +1459,8 @@ PHONY += $(module-dirs) modules
$(module-dirs): crmodverdir $(objtree)/Module.symvers
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
@@ -566,7 +566,7 @@ index 62b3338..fba6407 100644
modules: $(module-dirs)
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
-@@ -1520,17 +1600,21 @@ else
+@@ -1521,17 +1601,21 @@ else
target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
endif
@@ -592,7 +592,7 @@ index 62b3338..fba6407 100644
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.symtypes: %.c prepare scripts FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
-@@ -1542,11 +1626,15 @@ endif
+@@ -1543,11 +1627,15 @@ endif
$(build)=$(build-dir)
# Make sure the latest headers are built for Documentation
Documentation/: headers_install
@@ -726,10 +726,10 @@ index 2fd00b7..cfd5069 100644
for (i = 0; i < n; i++) {
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
-index f9c732e..78fbb0f 100644
+index e51f578..16c64a3 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
-@@ -1295,10 +1295,11 @@ SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)
+@@ -1296,10 +1296,11 @@ SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)
generic version except that we know how to honor ADDR_LIMIT_32BIT. */
static unsigned long
@@ -743,7 +743,7 @@ index f9c732e..78fbb0f 100644
info.flags = 0;
info.length = len;
-@@ -1306,6 +1307,7 @@ arch_get_unmapped_area_1(unsigned long addr, unsigned long len,
+@@ -1307,6 +1308,7 @@ arch_get_unmapped_area_1(unsigned long addr, unsigned long len,
info.high_limit = limit;
info.align_mask = 0;
info.align_offset = 0;
@@ -751,7 +751,7 @@ index f9c732e..78fbb0f 100644
return vm_unmapped_area(&info);
}
-@@ -1338,20 +1340,24 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -1339,20 +1341,24 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
merely specific addresses, but regions of memory -- perhaps
this feature should be incorporated into all ports? */
@@ -941,10 +941,10 @@ index 9d0ac09..479a962 100644
/* Allow reads even for write-only mappings */
if (!(vma->vm_flags & (VM_READ | VM_WRITE)))
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index 89c4b5c..847a7be 100644
+index 97d07ed..2931f2b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -1740,7 +1740,7 @@ config ALIGNMENT_TRAP
+@@ -1727,7 +1727,7 @@ config ALIGNMENT_TRAP
config UACCESS_WITH_MEMCPY
bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user()"
@@ -953,7 +953,7 @@ index 89c4b5c..847a7be 100644
default y if CPU_FEROCEON
help
Implement faster copy_to_user and clear_user methods for CPU
-@@ -2004,6 +2004,7 @@ config XIP_PHYS_ADDR
+@@ -1991,6 +1991,7 @@ config XIP_PHYS_ADDR
config KEXEC
bool "Kexec system call (EXPERIMENTAL)"
depends on (!SMP || PM_SLEEP_SMP)
@@ -1527,10 +1527,10 @@ index e22c119..eaa807d 100644
#define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0)
#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1LL, 0LL)
diff --git a/arch/arm/include/asm/barrier.h b/arch/arm/include/asm/barrier.h
-index c6a3e73..35cca85 100644
+index d2f81e6..3c4dba5 100644
--- a/arch/arm/include/asm/barrier.h
+++ b/arch/arm/include/asm/barrier.h
-@@ -63,7 +63,7 @@
+@@ -67,7 +67,7 @@
do { \
compiletime_assert_atomic_type(*p); \
smp_mb(); \
@@ -1563,7 +1563,7 @@ index 75fe66b..ba3dee4 100644
#endif
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
-index 10e78d0..dc8505d 100644
+index 2d46862..a35415b 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -116,7 +116,7 @@ struct cpu_cache_fns {
@@ -1866,7 +1866,7 @@ index 4355f0e..cd9168e 100644
#ifdef MULTI_USER
extern struct cpu_user_fns cpu_user;
diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h
-index 78a7793..e3dc06c 100644
+index 19cfab5..3f5c7e9 100644
--- a/arch/arm/include/asm/pgalloc.h
+++ b/arch/arm/include/asm/pgalloc.h
@@ -17,6 +17,7 @@
@@ -1917,36 +1917,20 @@ index 78a7793..e3dc06c 100644
static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte,
pmdval_t prot)
{
-@@ -157,7 +177,7 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
- static inline void
- pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep)
- {
-- __pmd_populate(pmdp, page_to_phys(ptep), _PAGE_USER_TABLE);
-+ __pmd_populate(pmdp, page_to_phys(ptep), _PAGE_USER_TABLE | __supported_pmd_mask);
- }
- #define pmd_pgtable(pmd) pmd_page(pmd)
-
diff --git a/arch/arm/include/asm/pgtable-2level-hwdef.h b/arch/arm/include/asm/pgtable-2level-hwdef.h
-index 5cfba15..f415e1a 100644
+index 5e68278..1869bae 100644
--- a/arch/arm/include/asm/pgtable-2level-hwdef.h
+++ b/arch/arm/include/asm/pgtable-2level-hwdef.h
-@@ -20,12 +20,15 @@
- #define PMD_TYPE_FAULT (_AT(pmdval_t, 0) << 0)
- #define PMD_TYPE_TABLE (_AT(pmdval_t, 1) << 0)
- #define PMD_TYPE_SECT (_AT(pmdval_t, 2) << 0)
-+#define PMD_PXNTABLE (_AT(pmdval_t, 1) << 2) /* v7 */
- #define PMD_BIT4 (_AT(pmdval_t, 1) << 4)
- #define PMD_DOMAIN(x) (_AT(pmdval_t, (x)) << 5)
- #define PMD_PROTECTION (_AT(pmdval_t, 1) << 9) /* v5 */
-+
+@@ -27,7 +27,7 @@
/*
* - section
*/
-+#define PMD_SECT_PXN (_AT(pmdval_t, 1) << 0) /* v7 */
+-#define PMD_SECT_PXN (_AT(pmdval_t, 1) << 0) /* v7 */
++#define PMD_SECT_PXN (_AT(pmdval_t, 1) << 0) /* v7 */
#define PMD_SECT_BUFFERABLE (_AT(pmdval_t, 1) << 2)
#define PMD_SECT_CACHEABLE (_AT(pmdval_t, 1) << 3)
#define PMD_SECT_XN (_AT(pmdval_t, 1) << 4) /* v6 */
-@@ -37,6 +40,7 @@
+@@ -39,6 +39,7 @@
#define PMD_SECT_nG (_AT(pmdval_t, 1) << 17) /* v6 */
#define PMD_SECT_SUPER (_AT(pmdval_t, 1) << 18) /* v6 */
#define PMD_SECT_AF (_AT(pmdval_t, 0))
@@ -1954,7 +1938,7 @@ index 5cfba15..f415e1a 100644
#define PMD_SECT_UNCACHED (_AT(pmdval_t, 0))
#define PMD_SECT_BUFFERED (PMD_SECT_BUFFERABLE)
-@@ -66,6 +70,7 @@
+@@ -68,6 +69,7 @@
* - extended small page/tiny page
*/
#define PTE_EXT_XN (_AT(pteval_t, 1) << 0) /* v6 */
@@ -1976,18 +1960,6 @@ index f027941..f36ce30 100644
/*
* These are the memory types, defined to be compatible with
* pre-ARMv6 CPUs cacheable and bufferable bits: XXCB
-diff --git a/arch/arm/include/asm/pgtable-3level-hwdef.h b/arch/arm/include/asm/pgtable-3level-hwdef.h
-index 9fd61c7..f8f1cff 100644
---- a/arch/arm/include/asm/pgtable-3level-hwdef.h
-+++ b/arch/arm/include/asm/pgtable-3level-hwdef.h
-@@ -76,6 +76,7 @@
- #define PTE_EXT_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */
- #define PTE_EXT_AF (_AT(pteval_t, 1) << 10) /* Access Flag */
- #define PTE_EXT_NG (_AT(pteval_t, 1) << 11) /* nG */
-+#define PTE_EXT_PXN (_AT(pteval_t, 1) << 53) /* PXN */
- #define PTE_EXT_XN (_AT(pteval_t, 1) << 54) /* XN */
-
- /*
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
index a31ecdad..95e98d4 100644
--- a/arch/arm/include/asm/pgtable-3level.h
@@ -2014,7 +1986,7 @@ index a31ecdad..95e98d4 100644
#define L_PTE_DIRTY_HIGH (1 << (55 - 32))
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
-index 3b30062..01a5f9d 100644
+index d5cac54..906ea3e 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -33,6 +33,9 @@
@@ -2097,7 +2069,7 @@ index 3b30062..01a5f9d 100644
*/
#define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG
-@@ -267,7 +315,7 @@ PTE_BIT_FUNC(mknexec, |= L_PTE_XN);
+@@ -307,7 +355,7 @@ static inline pte_t pte_mknexec(pte_t pte)
static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{
const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER |
@@ -2133,7 +2105,7 @@ index 18f5a55..5072a40 100644
struct of_cpu_method {
const char *method;
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
-index ce73ab6..7310f8a 100644
+index d890e41..3921292 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -78,9 +78,9 @@ struct thread_info {
@@ -2149,7 +2121,7 @@ index ce73ab6..7310f8a 100644
.restart_block = { \
.fn = do_no_restart_syscall, \
}, \
-@@ -154,7 +154,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
+@@ -159,7 +159,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
#define TIF_SYSCALL_AUDIT 9
#define TIF_SYSCALL_TRACEPOINT 10
#define TIF_SECCOMP 11 /* seccomp syscall filtering active */
@@ -2162,7 +2134,7 @@ index ce73ab6..7310f8a 100644
#define TIF_USING_IWMMXT 17
#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
#define TIF_RESTORE_SIGMASK 20
-@@ -168,10 +172,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
+@@ -173,10 +177,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
#define _TIF_SECCOMP (1 << TIF_SECCOMP)
#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT)
@@ -2626,7 +2598,7 @@ index 2f5555d..d493c91 100644
#endif
mov r5, r0
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
-index 6bb09d4..113e875 100644
+index f8ccc21..83d192f 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -11,18 +11,46 @@
@@ -2679,7 +2651,7 @@ index 6bb09d4..113e875 100644
.align 5
/*
* This is the fast syscall return path. We do as little as
-@@ -406,6 +434,12 @@ ENTRY(vector_swi)
+@@ -171,6 +199,12 @@ ENTRY(vector_swi)
USER( ldr scno, [lr, #-4] ) @ get SWI instruction
#endif
@@ -2693,7 +2665,7 @@ index 6bb09d4..113e875 100644
#if defined(CONFIG_OABI_COMPAT)
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
-index 4176df7..a901f8d 100644
+index 1a0045a..9b4f34d 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -196,6 +196,60 @@
@@ -2767,7 +2739,7 @@ index 4176df7..a901f8d 100644
msr spsr_cxsf, \rpsr
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K)
@ We must avoid clrex due to Cortex-A15 erratum #830321
-@@ -290,6 +347,9 @@
+@@ -291,6 +348,9 @@
blne trace_hardirqs_off
#endif
.endif
@@ -2778,7 +2750,7 @@ index 4176df7..a901f8d 100644
ldrd r0, r1, [sp, #S_LR] @ calling lr and pc
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
-index b37752a..ff5cb72 100644
+index 059c3da..8e45cfc 100644
--- a/arch/arm/kernel/fiq.c
+++ b/arch/arm/kernel/fiq.c
@@ -95,7 +95,10 @@ void set_fiq_handler(void *start, unsigned int length)
@@ -2806,7 +2778,7 @@ index 664eee8..f470938 100644
mcr p15, 0, r4, c2, c0, 0 @ load page table pointer
#endif
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
-index 6a4dffe..4a86a70 100644
+index bea7db9..a210d10 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -38,12 +38,39 @@
@@ -2836,11 +2808,11 @@ index 6a4dffe..4a86a70 100644
+}
+
+#ifdef CONFIG_PAX_KERNEXEC
-+void module_free_exec(struct module *mod, void *module_region)
++void module_memfree_exec(void *module_region)
+{
-+ module_free(mod, module_region);
++ module_memfree(module_region);
+}
-+EXPORT_SYMBOL(module_free_exec);
++EXPORT_SYMBOL(module_memfree_exec);
+
+void *module_alloc_exec(unsigned long size)
+{
@@ -2852,27 +2824,27 @@ index 6a4dffe..4a86a70 100644
int
diff --git a/arch/arm/kernel/patch.c b/arch/arm/kernel/patch.c
-index 07314af..c46655c 100644
+index 5038960..4aa71d8 100644
--- a/arch/arm/kernel/patch.c
+++ b/arch/arm/kernel/patch.c
-@@ -18,6 +18,7 @@ void __kprobes __patch_text(void *addr, unsigned int insn)
- bool thumb2 = IS_ENABLED(CONFIG_THUMB2_KERNEL);
- int size;
+@@ -67,6 +67,7 @@ void __kprobes __patch_text_real(void *addr, unsigned int insn, bool remap)
+ else
+ __acquire(&patch_lock);
+ pax_open_kernel();
if (thumb2 && __opcode_is_thumb16(insn)) {
- *(u16 *)addr = __opcode_to_mem_thumb16(insn);
+ *(u16 *)waddr = __opcode_to_mem_thumb16(insn);
size = sizeof(u16);
-@@ -39,6 +40,7 @@ void __kprobes __patch_text(void *addr, unsigned int insn)
- *(u32 *)addr = insn;
+@@ -98,6 +99,7 @@ void __kprobes __patch_text_real(void *addr, unsigned int insn, bool remap)
+ *(u32 *)waddr = insn;
size = sizeof(u32);
}
+ pax_close_kernel();
- flush_icache_range((uintptr_t)(addr),
- (uintptr_t)(addr) + size);
+ if (waddr != addr) {
+ flush_kernel_vmap_range(waddr, twopage ? size / 2 : size);
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
-index fe972a2..a772d83 100644
+index fdfa3a7..5d208b8 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -207,6 +207,7 @@ void machine_power_off(void)
@@ -3047,10 +3019,10 @@ index ef9119f..31995a3 100644
#ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
if (secure_computing() == -1)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
-index 306e1ac..1b477ed 100644
+index e55408e..14d9998 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
-@@ -104,21 +104,23 @@ EXPORT_SYMBOL(elf_hwcap);
+@@ -105,21 +105,23 @@ EXPORT_SYMBOL(elf_hwcap);
unsigned int elf_hwcap2 __read_mostly;
EXPORT_SYMBOL(elf_hwcap2);
@@ -3079,7 +3051,7 @@ index 306e1ac..1b477ed 100644
EXPORT_SYMBOL(outer_cache);
#endif
-@@ -252,9 +254,13 @@ static int __get_cpu_architecture(void)
+@@ -253,9 +255,13 @@ static int __get_cpu_architecture(void)
asm("mrc p15, 0, %0, c0, c1, 4"
: "=r" (mmfr0));
if ((mmfr0 & 0x0000000f) >= 0x00000003 ||
@@ -3096,7 +3068,7 @@ index 306e1ac..1b477ed 100644
cpu_arch = CPU_ARCH_ARMv6;
else
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
-index bd19834..e4d8c66 100644
+index 8aa6f1b..0899e08 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -24,8 +24,6 @@
@@ -3118,7 +3090,7 @@ index bd19834..e4d8c66 100644
} else
#endif
{
-@@ -604,33 +601,3 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
+@@ -603,33 +600,3 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
} while (thread_flags & _TIF_WORK_MASK);
return 0;
}
@@ -3153,7 +3125,7 @@ index bd19834..e4d8c66 100644
- return page;
-}
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
-index a8e32aa..b2f7198 100644
+index 86ef244..c518451 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -76,7 +76,7 @@ enum ipi_msg_type {
@@ -3189,7 +3161,7 @@ index 7a3be1d..b00c7de 100644
start, end);
itcm_present = true;
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
-index 9f5d818..e013427 100644
+index 788e23f..6fa06a1 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -65,7 +65,7 @@ static void dump_mem(const char *, const char *, unsigned long, unsigned long);
@@ -3234,23 +3206,10 @@ index 9f5d818..e013427 100644
/*
* on V7-M there is no need to copy the vector table to a dedicated
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
-index 8e95aa4..595dfc8 100644
+index b31aa73..cc4b7a1 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
-@@ -8,7 +8,11 @@
- #include <asm/thread_info.h>
- #include <asm/memory.h>
- #include <asm/page.h>
--
-+
-+#ifdef CONFIG_PAX_KERNEXEC
-+#include <asm/pgtable.h>
-+#endif
-+
- #define PROC_INFO \
- . = ALIGN(4); \
- VMLINUX_SYMBOL(__proc_info_begin) = .; \
-@@ -34,7 +38,7 @@
+@@ -37,7 +37,7 @@
#endif
#if (defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)) || \
@@ -3259,52 +3218,26 @@ index 8e95aa4..595dfc8 100644
#define ARM_EXIT_KEEP(x) x
#define ARM_EXIT_DISCARD(x)
#else
-@@ -90,6 +94,11 @@ SECTIONS
- _text = .;
- HEAD_TEXT
- }
-+
-+#ifdef CONFIG_PAX_KERNEXEC
-+ . = ALIGN(1<<SECTION_SHIFT);
-+#endif
-+
- .text : { /* Real text segment */
- _stext = .; /* Text and read-only data */
- __exception_text_start = .;
-@@ -112,6 +121,8 @@ SECTIONS
- ARM_CPU_KEEP(PROC_INFO)
- }
-
+@@ -123,6 +123,8 @@ SECTIONS
+ #ifdef CONFIG_DEBUG_RODATA
+ . = ALIGN(1<<SECTION_SHIFT);
+ #endif
+ _etext = .; /* End of text section */
+
RO_DATA(PAGE_SIZE)
. = ALIGN(4);
-@@ -142,7 +153,9 @@ SECTIONS
+@@ -153,8 +155,6 @@ SECTIONS
NOTES
- _etext = .; /* End of text and rodata section */
-+#ifdef CONFIG_PAX_KERNEXEC
-+ . = ALIGN(1<<SECTION_SHIFT);
-+#endif
-
+-
#ifndef CONFIG_XIP_KERNEL
- . = ALIGN(PAGE_SIZE);
-@@ -221,6 +234,11 @@ SECTIONS
- #else
- . = ALIGN(THREAD_SIZE);
- __init_end = .;
-+
-+#ifdef CONFIG_PAX_KERNEXEC
-+ . = ALIGN(1<<SECTION_SHIFT);
-+#endif
-+
- __data_loc = .;
- #endif
-
+ # ifdef CONFIG_ARM_KERNMEM_PERMS
+ . = ALIGN(1<<SECTION_SHIFT);
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
-index 9e193c8..3560fe6 100644
+index 0b0d58a..988cb45 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -57,7 +57,7 @@ static unsigned long hyp_default_vectors;
@@ -3316,7 +3249,7 @@ index 9e193c8..3560fe6 100644
static u8 kvm_next_vmid;
static DEFINE_SPINLOCK(kvm_vmid_lock);
-@@ -354,7 +354,7 @@ void force_vm_exit(const cpumask_t *mask)
+@@ -351,7 +351,7 @@ void force_vm_exit(const cpumask_t *mask)
*/
static bool need_new_vmid_gen(struct kvm *kvm)
{
@@ -3325,7 +3258,7 @@ index 9e193c8..3560fe6 100644
}
/**
-@@ -387,7 +387,7 @@ static void update_vttbr(struct kvm *kvm)
+@@ -384,7 +384,7 @@ static void update_vttbr(struct kvm *kvm)
/* First user of a new VMID generation? */
if (unlikely(kvm_next_vmid == 0)) {
@@ -3334,7 +3267,7 @@ index 9e193c8..3560fe6 100644
kvm_next_vmid = 1;
/*
-@@ -404,7 +404,7 @@ static void update_vttbr(struct kvm *kvm)
+@@ -401,7 +401,7 @@ static void update_vttbr(struct kvm *kvm)
kvm_call_hyp(__kvm_flush_vm_context);
}
@@ -3343,7 +3276,7 @@ index 9e193c8..3560fe6 100644
kvm->arch.vmid = kvm_next_vmid;
kvm_next_vmid++;
-@@ -980,7 +980,7 @@ static void check_kvm_target_cpu(void *ret)
+@@ -1038,7 +1038,7 @@ static void check_kvm_target_cpu(void *ret)
/**
* Initialize Hyp-mode and memory mappings on all CPUs.
*/
@@ -3383,10 +3316,10 @@ index 14a0d98..7771a7d 100644
.pushsection .fixup,"ax"
diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S
-index 66a477a..bee61d3 100644
+index 7a235b9..73a0556 100644
--- a/arch/arm/lib/copy_from_user.S
+++ b/arch/arm/lib/copy_from_user.S
-@@ -16,7 +16,7 @@
+@@ -17,7 +17,7 @@
/*
* Prototype:
*
@@ -3395,7 +3328,7 @@ index 66a477a..bee61d3 100644
*
* Purpose:
*
-@@ -84,11 +84,11 @@
+@@ -89,11 +89,11 @@
.text
@@ -3422,10 +3355,10 @@ index 6ee2f67..d1cce76 100644
#include <asm/asm-offsets.h>
#include <asm/cache.h>
diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S
-index d066df6..df28194 100644
+index a9d3db1..164b089 100644
--- a/arch/arm/lib/copy_to_user.S
+++ b/arch/arm/lib/copy_to_user.S
-@@ -16,7 +16,7 @@
+@@ -17,7 +17,7 @@
/*
* Prototype:
*
@@ -3434,7 +3367,7 @@ index d066df6..df28194 100644
*
* Purpose:
*
-@@ -88,11 +88,11 @@
+@@ -93,11 +93,11 @@
.text
ENTRY(__copy_to_user_std)
@@ -3499,10 +3432,10 @@ index 3e58d71..029817c 100644
/* See rational for this in __copy_to_user() above. */
if (n < 64)
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
-index 9610792..4dfb851 100644
+index ce25e85..3dd7850 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
-@@ -83,7 +83,7 @@ void __init at91_init_sram(int bank, unsigned long base, unsigned int length)
+@@ -57,7 +57,7 @@ void __init at91_init_sram(int bank, unsigned long base, unsigned int length)
desc->pfn = __phys_to_pfn(base);
desc->length = length;
@@ -3511,6 +3444,31 @@ index 9610792..4dfb851 100644
pr_info("sram at 0x%lx of 0x%x mapped at 0x%lx\n",
base, length, desc->virtual);
+diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
+index f8e7dcd..17ee921 100644
+--- a/arch/arm/mach-exynos/suspend.c
++++ b/arch/arm/mach-exynos/suspend.c
+@@ -18,6 +18,7 @@
+ #include <linux/syscore_ops.h>
+ #include <linux/cpu_pm.h>
+ #include <linux/io.h>
++#include <linux/irq.h>
+ #include <linux/irqchip/arm-gic.h>
+ #include <linux/err.h>
+ #include <linux/regulator/machine.h>
+@@ -558,8 +559,10 @@ void __init exynos_pm_init(void)
+ tmp |= pm_data->wake_disable_mask;
+ pmu_raw_writel(tmp, S5P_WAKEUP_MASK);
+
+- exynos_pm_syscore_ops.suspend = pm_data->pm_suspend;
+- exynos_pm_syscore_ops.resume = pm_data->pm_resume;
++ pax_open_kernel();
++ *(void **)&exynos_pm_syscore_ops.suspend = pm_data->pm_suspend;
++ *(void **)&exynos_pm_syscore_ops.resume = pm_data->pm_resume;
++ pax_close_kernel();
+
+ register_syscore_ops(&exynos_pm_syscore_ops);
+ suspend_set_ops(&exynos_suspend_ops);
diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c
index 7f352de..6dc0929 100644
--- a/arch/arm/mach-keystone/keystone.c
@@ -3525,10 +3483,10 @@ index 7f352de..6dc0929 100644
static int keystone_platform_notifier(struct notifier_block *nb,
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
-index 2ffccd4..69ffe115 100644
+index ccef880..5dfad80 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
-@@ -316,7 +316,7 @@ static void __init armada_370_coherency_init(struct device_node *np)
+@@ -164,7 +164,7 @@ static void __init armada_370_coherency_init(struct device_node *np)
/*
* This ioremap hook is used on Armada 375/38x to ensure that PCIe
@@ -3537,7 +3495,7 @@ index 2ffccd4..69ffe115 100644
* is needed as a workaround for a deadlock issue between the PCIe
* interface and the cache controller.
*/
-@@ -329,7 +329,7 @@ armada_pcie_wa_ioremap_caller(phys_addr_t phys_addr, size_t size,
+@@ -177,7 +177,7 @@ armada_pcie_wa_ioremap_caller(phys_addr_t phys_addr, size_t size,
mvebu_mbus_get_pcie_mem_aperture(&pcie_mem);
if (pcie_mem.start <= phys_addr && (phys_addr + size) <= pcie_mem.end)
@@ -3547,7 +3505,7 @@ index 2ffccd4..69ffe115 100644
return __arm_ioremap_caller(phys_addr, size, mtype, caller);
}
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
-index 97767a2..9233746 100644
+index b6443a4..20a0b74 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -569,7 +569,7 @@ static int n8x0_menelaus_late_init(struct device *dev)
@@ -3559,55 +3517,8 @@ index 97767a2..9233746 100644
.late_init = n8x0_menelaus_late_init,
};
-diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
-index 5fa3755..1e8c247 100644
---- a/arch/arm/mach-omap2/gpmc.c
-+++ b/arch/arm/mach-omap2/gpmc.c
-@@ -151,7 +151,6 @@ struct omap3_gpmc_regs {
- };
-
- static struct gpmc_client_irq gpmc_client_irq[GPMC_NR_IRQ];
--static struct irq_chip gpmc_irq_chip;
- static int gpmc_irq_start;
-
- static struct resource gpmc_mem_root;
-@@ -736,6 +735,18 @@ static void gpmc_irq_noop(struct irq_data *data) { }
-
- static unsigned int gpmc_irq_noop_ret(struct irq_data *data) { return 0; }
-
-+static struct irq_chip gpmc_irq_chip = {
-+ .name = "gpmc",
-+ .irq_startup = gpmc_irq_noop_ret,
-+ .irq_enable = gpmc_irq_enable,
-+ .irq_disable = gpmc_irq_disable,
-+ .irq_shutdown = gpmc_irq_noop,
-+ .irq_ack = gpmc_irq_noop,
-+ .irq_mask = gpmc_irq_noop,
-+ .irq_unmask = gpmc_irq_noop,
-+
-+};
-+
- static int gpmc_setup_irq(void)
- {
- int i;
-@@ -750,15 +761,6 @@ static int gpmc_setup_irq(void)
- return gpmc_irq_start;
- }
-
-- gpmc_irq_chip.name = "gpmc";
-- gpmc_irq_chip.irq_startup = gpmc_irq_noop_ret;
-- gpmc_irq_chip.irq_enable = gpmc_irq_enable;
-- gpmc_irq_chip.irq_disable = gpmc_irq_disable;
-- gpmc_irq_chip.irq_shutdown = gpmc_irq_noop;
-- gpmc_irq_chip.irq_ack = gpmc_irq_noop;
-- gpmc_irq_chip.irq_mask = gpmc_irq_noop;
-- gpmc_irq_chip.irq_unmask = gpmc_irq_noop;
--
- gpmc_client_irq[0].bitmask = GPMC_IRQ_FIFOEVENTENABLE;
- gpmc_client_irq[1].bitmask = GPMC_IRQ_COUNT_EVENT;
-
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
-index 6944ae3..bc587ca 100644
+index 79f49d9..70bf184 100644
--- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c
+++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
@@ -86,7 +86,7 @@ struct cpu_pm_ops {
@@ -3628,6 +3539,18 @@ index 6944ae3..bc587ca 100644
.finish_suspend = default_finish_suspend,
.resume = dummy_cpu_resume,
.scu_prepare = dummy_scu_prepare,
+diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
+index 5305ec7..6d74045 100644
+--- a/arch/arm/mach-omap2/omap-smp.c
++++ b/arch/arm/mach-omap2/omap-smp.c
+@@ -19,6 +19,7 @@
+ #include <linux/device.h>
+ #include <linux/smp.h>
+ #include <linux/io.h>
++#include <linux/irq.h>
+ #include <linux/irqchip/arm-gic.h>
+
+ #include <asm/smp_scu.h>
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index f961c46..4a453dc 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -3642,7 +3565,7 @@ index f961c46..4a453dc 100644
};
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
-index 8c58b71..95b655f 100644
+index be9541e..821805f 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -510,7 +510,7 @@ void omap_device_delete(struct omap_device *od)
@@ -3683,10 +3606,10 @@ index 78c02b3..c94109a 100644
struct omap_device *omap_device_alloc(struct platform_device *pdev,
struct omap_hwmod **ohs, int oh_cnt);
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
-index 716247e..8df346d 100644
+index 9025fff..3555702 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
-@@ -194,10 +194,10 @@ struct omap_hwmod_soc_ops {
+@@ -193,10 +193,10 @@ struct omap_hwmod_soc_ops {
int (*init_clkdm)(struct omap_hwmod *oh);
void (*update_context_lost)(struct omap_hwmod *oh);
int (*get_context_lost)(struct omap_hwmod *oh);
@@ -3747,10 +3670,10 @@ index ff0a68c..b312aa0 100644
sizeof(struct omap_wd_timer_platform_data));
WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
diff --git a/arch/arm/mach-tegra/cpuidle-tegra20.c b/arch/arm/mach-tegra/cpuidle-tegra20.c
-index b30bf5c..d0825bf 100644
+index 4f25a7c..a81be85 100644
--- a/arch/arm/mach-tegra/cpuidle-tegra20.c
+++ b/arch/arm/mach-tegra/cpuidle-tegra20.c
-@@ -180,7 +180,7 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
+@@ -179,7 +179,7 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
bool entered_lp2 = false;
if (tegra_pending_sgi())
@@ -3759,6 +3682,30 @@ index b30bf5c..d0825bf 100644
cpuidle_coupled_parallel_barrier(dev, &abort_barrier);
+diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
+index ab95f53..4b977a7 100644
+--- a/arch/arm/mach-tegra/irq.c
++++ b/arch/arm/mach-tegra/irq.c
+@@ -20,6 +20,7 @@
+ #include <linux/cpu_pm.h>
+ #include <linux/interrupt.h>
+ #include <linux/io.h>
++#include <linux/irq.h>
+ #include <linux/irqchip/arm-gic.h>
+ #include <linux/irq.h>
+ #include <linux/kernel.h>
+diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c
+index 2cb587b..6ddfebf 100644
+--- a/arch/arm/mach-ux500/pm.c
++++ b/arch/arm/mach-ux500/pm.c
+@@ -10,6 +10,7 @@
+ */
+
+ #include <linux/kernel.h>
++#include <linux/irq.h>
+ #include <linux/irqchip/arm-gic.h>
+ #include <linux/delay.h>
+ #include <linux/io.h>
diff --git a/arch/arm/mach-ux500/setup.h b/arch/arm/mach-ux500/setup.h
index 2dea8b5..6499da2 100644
--- a/arch/arm/mach-ux500/setup.h
@@ -3777,8 +3724,20 @@ index 2dea8b5..6499da2 100644
extern struct smp_operations ux500_smp_ops;
extern void ux500_cpu_die(unsigned int cpu);
+diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
+index 52d768f..5f93180 100644
+--- a/arch/arm/mach-zynq/platsmp.c
++++ b/arch/arm/mach-zynq/platsmp.c
+@@ -24,6 +24,7 @@
+ #include <linux/io.h>
+ #include <asm/cacheflush.h>
+ #include <asm/smp_scu.h>
++#include <linux/irq.h>
+ #include <linux/irqchip/arm-gic.h>
+ #include "common.h"
+
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
-index 7eb94e6..799ad3e 100644
+index c43c714..4f8f7b9 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -446,6 +446,7 @@ config CPU_32v5
@@ -3816,7 +3775,7 @@ index 7eb94e6..799ad3e 100644
If all of the binaries and libraries which run on your platform
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
-index 83792f4..c25d36b 100644
+index 2c0c541..4585df9 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -216,10 +216,12 @@ union offset_union {
@@ -3894,7 +3853,7 @@ index 5e65ca8..879e7b3 100644
#define CACHE_LINE_SIZE 32
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
-index 4370933..e77848e 100644
+index 845769e..4278fd7 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -43,7 +43,7 @@
@@ -3913,18 +3872,18 @@ index 4370933..e77848e 100644
- u64 generation = atomic64_read(&asid_generation);
+ u64 generation = atomic64_read_unchecked(&asid_generation);
- if (asid != 0 && is_reserved_asid(asid)) {
+ if (asid != 0) {
/*
-@@ -199,7 +199,7 @@ static u64 new_context(struct mm_struct *mm, unsigned int cpu)
- */
- asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, cur_idx);
- if (asid == NUM_USER_ASIDS) {
-- generation = atomic64_add_return(ASID_FIRST_VERSION,
-+ generation = atomic64_add_return_unchecked(ASID_FIRST_VERSION,
- &asid_generation);
- flush_context(cpu);
- asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1);
-@@ -230,14 +230,14 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk)
+@@ -208,7 +208,7 @@ static u64 new_context(struct mm_struct *mm, unsigned int cpu)
+ */
+ asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, cur_idx);
+ if (asid == NUM_USER_ASIDS) {
+- generation = atomic64_add_return(ASID_FIRST_VERSION,
++ generation = atomic64_add_return_unchecked(ASID_FIRST_VERSION,
+ &asid_generation);
+ flush_context(cpu);
+ asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1);
+@@ -240,14 +240,14 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk)
cpu_set_reserved_ttbr0();
asid = atomic64_read(&mm->context.id);
@@ -3942,7 +3901,7 @@ index 4370933..e77848e 100644
atomic64_set(&mm->context.id, asid);
}
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
-index eb8830a..e8ff52e 100644
+index a982dc3..2d9f5f7 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -25,6 +25,7 @@
@@ -3985,7 +3944,7 @@ index eb8830a..e8ff52e 100644
/*
* No handler, we'll have to terminate things with extreme prejudice.
*/
-@@ -174,6 +200,13 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
+@@ -173,6 +199,13 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
}
#endif
@@ -3999,7 +3958,7 @@ index eb8830a..e8ff52e 100644
tsk->thread.address = addr;
tsk->thread.error_code = fsr;
tsk->thread.trap_no = 14;
-@@ -401,6 +434,33 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
+@@ -400,6 +433,33 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
}
#endif /* CONFIG_MMU */
@@ -4033,7 +3992,7 @@ index eb8830a..e8ff52e 100644
/*
* First Level Translation Fault Handler
*
-@@ -548,9 +608,22 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
+@@ -547,9 +607,22 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
const struct fsr_info *inf = fsr_info + fsr_fs(fsr);
struct siginfo info;
@@ -4053,10 +4012,10 @@ index eb8830a..e8ff52e 100644
return;
+die:
- printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n",
+ pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n",
inf->name, fsr, addr);
-@@ -574,15 +647,104 @@ hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *
+@@ -573,15 +646,104 @@ hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *
ifsr_info[nr].name = name;
}
@@ -4158,7 +4117,7 @@ index eb8830a..e8ff52e 100644
return;
+die:
- printk(KERN_ALERT "Unhandled prefetch abort: %s (0x%03x) at 0x%08lx\n",
+ pr_alert("Unhandled prefetch abort: %s (0x%03x) at 0x%08lx\n",
inf->name, ifsr, addr);
diff --git a/arch/arm/mm/fault.h b/arch/arm/mm/fault.h
@@ -4192,19 +4151,10 @@ index cf08bdf..772656c 100644
unsigned long search_exception_table(unsigned long addr);
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
-index 9481f85..6dae261 100644
+index 2495c8c..415b7fc 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
-@@ -31,6 +31,8 @@
- #include <asm/setup.h>
- #include <asm/tlb.h>
- #include <asm/fixmap.h>
-+#include <asm/system_info.h>
-+#include <asm/cp15.h>
-
- #include <asm/mach/arch.h>
- #include <asm/mach/map.h>
-@@ -619,7 +621,46 @@ void free_initmem(void)
+@@ -758,7 +758,46 @@ void free_tcmmem(void)
{
#ifdef CONFIG_HAVE_TCM
extern char __tcm_start, __tcm_end;
@@ -4379,10 +4329,10 @@ index 5e85ed3..b10a7ed 100644
}
}
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
-index 9f98cec..115fcb6 100644
+index 4e6ef89..21c27f2 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
-@@ -40,6 +40,22 @@
+@@ -41,6 +41,22 @@
#include "mm.h"
#include "tcm.h"
@@ -4405,7 +4355,7 @@ index 9f98cec..115fcb6 100644
/*
* empty_zero_page is a special page that is used for
* zero-initialized data and COW.
-@@ -239,7 +255,15 @@ __setup("noalign", noalign_setup);
+@@ -242,7 +258,15 @@ __setup("noalign", noalign_setup);
#define PROT_PTE_S2_DEVICE PROT_PTE_DEVICE
#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE
@@ -4422,7 +4372,7 @@ index 9f98cec..115fcb6 100644
[MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */
.prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED |
L_PTE_SHARED,
-@@ -268,19 +292,19 @@ static struct mem_type mem_types[] = {
+@@ -271,19 +295,19 @@ static struct mem_type mem_types[] = {
.prot_sect = PROT_SECT_DEVICE,
.domain = DOMAIN_IO,
},
@@ -4447,7 +4397,7 @@ index 9f98cec..115fcb6 100644
.domain = DOMAIN_KERNEL,
},
#endif
-@@ -288,15 +312,15 @@ static struct mem_type mem_types[] = {
+@@ -291,15 +315,15 @@ static struct mem_type mem_types[] = {
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
L_PTE_RDONLY,
.prot_l1 = PMD_TYPE_TABLE,
@@ -4466,7 +4416,7 @@ index 9f98cec..115fcb6 100644
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY,
.prot_l1 = PMD_TYPE_TABLE,
.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
-@@ -309,17 +333,30 @@ static struct mem_type mem_types[] = {
+@@ -312,17 +336,30 @@ static struct mem_type mem_types[] = {
.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
.domain = DOMAIN_KERNEL,
},
@@ -4500,7 +4450,7 @@ index 9f98cec..115fcb6 100644
[MT_MEMORY_RW_DTCM] = {
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
L_PTE_XN,
-@@ -327,9 +364,10 @@ static struct mem_type mem_types[] = {
+@@ -330,9 +367,10 @@ static struct mem_type mem_types[] = {
.prot_sect = PMD_TYPE_SECT | PMD_SECT_XN,
.domain = DOMAIN_KERNEL,
},
@@ -4513,7 +4463,7 @@ index 9f98cec..115fcb6 100644
.domain = DOMAIN_KERNEL,
},
[MT_MEMORY_RW_SO] = {
-@@ -547,9 +585,14 @@ static void __init build_mem_type_table(void)
+@@ -544,9 +582,14 @@ static void __init build_mem_type_table(void)
* Mark cache clean areas and XIP ROM read only
* from SVC mode and no access from userspace.
*/
@@ -4531,7 +4481,7 @@ index 9f98cec..115fcb6 100644
#endif
/*
-@@ -566,13 +609,17 @@ static void __init build_mem_type_table(void)
+@@ -563,13 +606,17 @@ static void __init build_mem_type_table(void)
mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED;
mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S;
mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED;
@@ -4553,7 +4503,7 @@ index 9f98cec..115fcb6 100644
}
}
-@@ -583,15 +630,20 @@ static void __init build_mem_type_table(void)
+@@ -580,15 +627,20 @@ static void __init build_mem_type_table(void)
if (cpu_arch >= CPU_ARCH_ARMv6) {
if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) {
/* Non-cacheable Normal is XCB = 001 */
@@ -4577,8 +4527,8 @@ index 9f98cec..115fcb6 100644
}
#ifdef CONFIG_ARM_LPAE
-@@ -607,6 +659,8 @@ static void __init build_mem_type_table(void)
- vecs_pgprot |= PTE_EXT_AF;
+@@ -609,6 +661,8 @@ static void __init build_mem_type_table(void)
+ user_pgprot |= PTE_EXT_PXN;
#endif
+ user_pgprot |= __supported_pte_mask;
@@ -4586,7 +4536,7 @@ index 9f98cec..115fcb6 100644
for (i = 0; i < 16; i++) {
pteval_t v = pgprot_val(protection_map[i]);
protection_map[i] = __pgprot(v | user_pgprot);
-@@ -624,21 +678,24 @@ static void __init build_mem_type_table(void)
+@@ -626,21 +680,24 @@ static void __init build_mem_type_table(void)
mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask;
mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask;
@@ -4617,7 +4567,7 @@ index 9f98cec..115fcb6 100644
break;
}
pr_info("Memory policy: %sData cache %s\n",
-@@ -856,7 +913,7 @@ static void __init create_mapping(struct map_desc *md)
+@@ -854,7 +911,7 @@ static void __init create_mapping(struct map_desc *md)
return;
}
@@ -4625,8 +4575,8 @@ index 9f98cec..115fcb6 100644
+ if ((md->type == MT_DEVICE || md->type == MT_ROM_RX) &&
md->virtual >= PAGE_OFFSET &&
(md->virtual < VMALLOC_START || md->virtual >= VMALLOC_END)) {
- printk(KERN_WARNING "BUG: mapping for 0x%08llx"
-@@ -1224,18 +1281,15 @@ void __init arm_mm_memblock_reserve(void)
+ pr_warn("BUG: mapping for 0x%08llx at 0x%08lx out of vmalloc space\n",
+@@ -1218,18 +1275,15 @@ void __init arm_mm_memblock_reserve(void)
* called function. This means you can't use any function or debugging
* method which may touch any device, otherwise the kernel _will_ crash.
*/
@@ -4649,7 +4599,7 @@ index 9f98cec..115fcb6 100644
for (addr = VMALLOC_START; addr; addr += PMD_SIZE)
pmd_clear(pmd_off_k(addr));
-@@ -1248,7 +1302,7 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
+@@ -1242,7 +1296,7 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & SECTION_MASK);
map.virtual = MODULES_VADDR;
map.length = ((unsigned long)_etext - map.virtual + ~SECTION_MASK) & SECTION_MASK;
@@ -4658,7 +4608,7 @@ index 9f98cec..115fcb6 100644
create_mapping(&map);
#endif
-@@ -1259,14 +1313,14 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
+@@ -1253,14 +1307,14 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
map.pfn = __phys_to_pfn(FLUSH_BASE_PHYS);
map.virtual = FLUSH_BASE;
map.length = SZ_1M;
@@ -4675,7 +4625,7 @@ index 9f98cec..115fcb6 100644
create_mapping(&map);
#endif
-@@ -1275,7 +1329,7 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
+@@ -1269,7 +1323,7 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
* location (0xffff0000). If we aren't using high-vectors, also
* create a mapping at the low-vectors virtual address.
*/
@@ -4684,18 +4634,18 @@ index 9f98cec..115fcb6 100644
map.virtual = 0xffff0000;
map.length = PAGE_SIZE;
#ifdef CONFIG_KUSER_HELPERS
-@@ -1335,8 +1389,10 @@ static void __init kmap_init(void)
+@@ -1329,8 +1383,10 @@ static void __init kmap_init(void)
static void __init map_lowmem(void)
{
struct memblock_region *reg;
+#ifndef CONFIG_PAX_KERNEXEC
- unsigned long kernel_x_start = round_down(__pa(_stext), SECTION_SIZE);
- unsigned long kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE);
+ phys_addr_t kernel_x_start = round_down(__pa(_stext), SECTION_SIZE);
+ phys_addr_t kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE);
+#endif
/* Map all the lowmem memory banks. */
for_each_memblock(memory, reg) {
-@@ -1349,11 +1405,48 @@ static void __init map_lowmem(void)
+@@ -1343,11 +1399,48 @@ static void __init map_lowmem(void)
if (start >= end)
break;
@@ -4736,7 +4686,7 @@ index 9f98cec..115fcb6 100644
+ map.type = MT_MEMORY_RW;
+ create_mapping(&map);
+#else
- if (end < kernel_x_start || start >= kernel_x_end) {
+ if (end < kernel_x_start) {
map.pfn = __phys_to_pfn(start);
map.virtual = __phys_to_virt(start);
map.length = end - start;
@@ -4744,8 +4694,8 @@ index 9f98cec..115fcb6 100644
+ map.type = __MT_MEMORY_RWX;
create_mapping(&map);
- } else {
-@@ -1370,7 +1463,7 @@ static void __init map_lowmem(void)
+ } else if (start >= kernel_x_end) {
+@@ -1371,7 +1464,7 @@ static void __init map_lowmem(void)
map.pfn = __phys_to_pfn(kernel_x_start);
map.virtual = __phys_to_virt(kernel_x_start);
map.length = kernel_x_end - kernel_x_start;
@@ -4754,7 +4704,7 @@ index 9f98cec..115fcb6 100644
create_mapping(&map);
-@@ -1383,6 +1476,7 @@ static void __init map_lowmem(void)
+@@ -1384,6 +1477,7 @@ static void __init map_lowmem(void)
create_mapping(&map);
}
}
@@ -4837,10 +4787,10 @@ index ce6d763..cfea917 100644
extern void *samsung_dmadev_get_ops(void);
extern void *s3c_dma_get_ops(void);
diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h
-index 6389d60..b5d3bdd 100644
+index a5abb00..9cbca9a 100644
--- a/arch/arm64/include/asm/barrier.h
+++ b/arch/arm64/include/asm/barrier.h
-@@ -41,7 +41,7 @@
+@@ -44,7 +44,7 @@
do { \
compiletime_assert_atomic_type(*p); \
barrier(); \
@@ -4849,6 +4799,31 @@ index 6389d60..b5d3bdd 100644
} while (0)
#define smp_load_acquire(p) \
+diff --git a/arch/arm64/include/asm/percpu.h b/arch/arm64/include/asm/percpu.h
+index 09da25b..3ea0d64 100644
+--- a/arch/arm64/include/asm/percpu.h
++++ b/arch/arm64/include/asm/percpu.h
+@@ -135,16 +135,16 @@ static inline void __percpu_write(void *ptr, unsigned long val, int size)
+ {
+ switch (size) {
+ case 1:
+- ACCESS_ONCE(*(u8 *)ptr) = (u8)val;
++ ACCESS_ONCE_RW(*(u8 *)ptr) = (u8)val;
+ break;
+ case 2:
+- ACCESS_ONCE(*(u16 *)ptr) = (u16)val;
++ ACCESS_ONCE_RW(*(u16 *)ptr) = (u16)val;
+ break;
+ case 4:
+- ACCESS_ONCE(*(u32 *)ptr) = (u32)val;
++ ACCESS_ONCE_RW(*(u32 *)ptr) = (u32)val;
+ break;
+ case 8:
+- ACCESS_ONCE(*(u64 *)ptr) = (u64)val;
++ ACCESS_ONCE_RW(*(u64 *)ptr) = (u64)val;
+ break;
+ default:
+ BUILD_BUG();
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
index 3bf8f4e..5dd5491 100644
--- a/arch/arm64/include/asm/uaccess.h
@@ -5093,7 +5068,7 @@ index 836f147..4cf23f5 100644
if (!(addr & ~PAGE_MASK))
goto success;
diff --git a/arch/hexagon/include/asm/cache.h b/arch/hexagon/include/asm/cache.h
-index 2635117..fa223cb 100644
+index 69952c1..4fa2908 100644
--- a/arch/hexagon/include/asm/cache.h
+++ b/arch/hexagon/include/asm/cache.h
@@ -21,9 +21,11 @@
@@ -5108,13 +5083,13 @@ index 2635117..fa223cb 100644
+#define L1_CACHE_SHIFT 5
+#define L1_CACHE_BYTES (_AC(1,UL) << L1_CACHE_SHIFT)
- #define __cacheline_aligned __aligned(L1_CACHE_BYTES)
- #define ____cacheline_aligned __aligned(L1_CACHE_BYTES)
+ #define ARCH_DMA_MINALIGN L1_CACHE_BYTES
+
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
-index c84c88b..2a6e1ba 100644
+index 074e52b..76afdac 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
-@@ -549,6 +549,7 @@ source "drivers/sn/Kconfig"
+@@ -548,6 +548,7 @@ source "drivers/sn/Kconfig"
config KEXEC
bool "kexec system call"
depends on !IA64_HP_SIM && (!SMP || HOTPLUG_CPU)
@@ -5123,10 +5098,10 @@ index c84c88b..2a6e1ba 100644
kexec is a system call that implements the ability to shutdown your
current kernel, and to start another kernel. It is like a reboot
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
-index 5441b14..039a446 100644
+index 970d0bd..e750b9b 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
-@@ -99,5 +99,6 @@ endef
+@@ -98,5 +98,6 @@ endef
archprepare: make_nr_irqs_h FORCE
PHONY += make_nr_irqs_h FORCE
@@ -5153,10 +5128,10 @@ index 0bf0350..2ad1957 100644
+
#endif /* _ASM_IA64_ATOMIC_H */
diff --git a/arch/ia64/include/asm/barrier.h b/arch/ia64/include/asm/barrier.h
-index a48957c..e097b56 100644
+index f6769eb..1cdb590 100644
--- a/arch/ia64/include/asm/barrier.h
+++ b/arch/ia64/include/asm/barrier.h
-@@ -67,7 +67,7 @@
+@@ -66,7 +66,7 @@
do { \
compiletime_assert_atomic_type(*p); \
barrier(); \
@@ -5279,7 +5254,7 @@ index 45698cd..e8e2dbc 100644
static __always_inline void __ticket_spin_unlock_wait(arch_spinlock_t *lock)
diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h
-index 449c8c0..3d4b1e9 100644
+index 103bedc..0210597 100644
--- a/arch/ia64/include/asm/uaccess.h
+++ b/arch/ia64/include/asm/uaccess.h
@@ -70,6 +70,7 @@
@@ -5349,20 +5324,10 @@ index 449c8c0..3d4b1e9 100644
})
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
-index 24603be..948052d 100644
+index 29754aa..06d2838 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
-@@ -307,8 +307,7 @@ plt_target (struct plt_entry *plt)
- void
- module_free (struct module *mod, void *module_region)
- {
-- if (mod && mod->arch.init_unw_table &&
-- module_region == mod->module_init) {
-+ if (mod && mod->arch.init_unw_table && module_region == mod->module_init_rx) {
- unw_remove_unwind_table(mod->arch.init_unw_table);
- mod->arch.init_unw_table = NULL;
- }
-@@ -494,15 +493,39 @@ module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings,
+@@ -492,15 +492,39 @@ module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings,
}
static inline int
@@ -5404,7 +5369,7 @@ index 24603be..948052d 100644
}
static inline int
-@@ -685,7 +708,14 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
+@@ -683,7 +707,14 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
break;
case RV_BDREL:
@@ -5420,7 +5385,7 @@ index 24603be..948052d 100644
break;
case RV_LTV:
-@@ -820,15 +850,15 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
+@@ -818,15 +849,15 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
* addresses have been selected...
*/
uint64_t gp;
@@ -5662,10 +5627,10 @@ index 0395c51..5f26031 100644
#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
diff --git a/arch/metag/include/asm/barrier.h b/arch/metag/include/asm/barrier.h
-index c7591e8..ecef036 100644
+index d703d8e..a8e2d70 100644
--- a/arch/metag/include/asm/barrier.h
+++ b/arch/metag/include/asm/barrier.h
-@@ -89,7 +89,7 @@ static inline void fence(void)
+@@ -90,7 +90,7 @@ static inline void fence(void)
do { \
compiletime_assert_atomic_type(*p); \
smp_mb(); \
@@ -5705,10 +5670,10 @@ index 4efe96a..60e8699 100644
#define SMP_CACHE_BYTES L1_CACHE_BYTES
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
-index 9536ef9..9333776 100644
+index 843713c..b6a87b9 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -2413,6 +2413,7 @@ source "kernel/Kconfig.preempt"
+@@ -2439,6 +2439,7 @@ source "kernel/Kconfig.preempt"
config KEXEC
bool "Kexec system call"
@@ -5717,7 +5682,7 @@ index 9536ef9..9333776 100644
kexec is a system call that implements the ability to shutdown your
current kernel, and to start another kernel. It is like a reboot
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
-index 02f2444..506969c 100644
+index 3778655..1dff0a9 100644
--- a/arch/mips/cavium-octeon/dma-octeon.c
+++ b/arch/mips/cavium-octeon/dma-octeon.c
@@ -199,7 +199,7 @@ static void octeon_dma_free_coherent(struct device *dev, size_t size,
@@ -5730,10 +5695,10 @@ index 02f2444..506969c 100644
static dma_addr_t octeon_unity_phys_to_dma(struct device *dev, phys_addr_t paddr)
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
-index 6dd6bfc..903b0d6 100644
+index 857da84..3f4458b 100644
--- a/arch/mips/include/asm/atomic.h
+++ b/arch/mips/include/asm/atomic.h
-@@ -21,15 +21,39 @@
+@@ -22,15 +22,39 @@
#include <asm/cmpxchg.h>
#include <asm/war.h>
@@ -5774,7 +5739,7 @@ index 6dd6bfc..903b0d6 100644
/*
* atomic_set - set atomic variable
-@@ -38,47 +62,77 @@
+@@ -39,47 +63,77 @@
*
* Atomically sets the value of @v to @i.
*/
@@ -5784,8 +5749,8 @@ index 6dd6bfc..903b0d6 100644
+ v->counter = i;
+}
--#define ATOMIC_OP(op, c_op, asm_op) \
--static __inline__ void atomic_##op(int i, atomic_t * v) \
+-#define ATOMIC_OP(op, c_op, asm_op) \
+-static __inline__ void atomic_##op(int i, atomic_t * v) \
+static inline void atomic_set_unchecked(atomic_unchecked_t *v, int i)
+{
+ v->counter = i;
@@ -5806,150 +5771,153 @@ index 6dd6bfc..903b0d6 100644
+#define __OVERFLOW_EXTABLE
+#endif
+
-+#define __ATOMIC_OP(op, suffix, asm_op, extable) \
-+static inline void atomic_##op##suffix(int i, atomic##suffix##_t * v) \
- { \
- if (kernel_uses_llsc && R10000_LLSC_WAR) { \
- int temp; \
- \
- __asm__ __volatile__( \
-- " .set arch=r4000 \n" \
-- "1: ll %0, %1 # atomic_" #op " \n" \
-- " " #asm_op " %0, %2 \n" \
-+ " .set mips3 \n" \
-+ "1: ll %0, %1 # atomic_" #op #suffix "\n" \
-+ "2: " #asm_op " %0, %2 \n" \
- " sc %0, %1 \n" \
- " beqzl %0, 1b \n" \
-+ extable \
- " .set mips0 \n" \
- : "=&r" (temp), "+m" (v->counter) \
- : "Ir" (i)); \
- } else if (kernel_uses_llsc) { \
- int temp; \
- \
-- do { \
-- __asm__ __volatile__( \
-- " .set arch=r4000 \n" \
-- " ll %0, %1 # atomic_" #op "\n" \
-- " " #asm_op " %0, %2 \n" \
-- " sc %0, %1 \n" \
-- " .set mips0 \n" \
-- : "=&r" (temp), "+m" (v->counter) \
-- : "Ir" (i)); \
-- } while (unlikely(!temp)); \
-+ __asm__ __volatile__( \
-+ " .set mips3 \n" \
-+ " ll %0, %1 # atomic_" #op #suffix "\n" \
-+ "2: " #asm_op " %0, %2 \n" \
-+ " sc %0, %1 \n" \
-+ " beqz %0, 1b \n" \
-+ extable \
-+ " .set mips0 \n" \
-+ : "=&r" (temp), "+m" (v->counter) \
-+ : "Ir" (i)); \
- } else { \
- unsigned long flags; \
- \
- raw_local_irq_save(flags); \
-- v->counter c_op i; \
-+ __asm__ __volatile__( \
-+ "2: " #asm_op " %0, %1 \n" \
-+ extable \
-+ : "+r" (v->counter) : "Ir" (i)); \
- raw_local_irq_restore(flags); \
- } \
- } \
-
--#define ATOMIC_OP_RETURN(op, c_op, asm_op) \
--static __inline__ int atomic_##op##_return(int i, atomic_t * v) \
-+#define ATOMIC_OP(op, asm_op) __ATOMIC_OP(op, , asm_op##u) \
++#define __ATOMIC_OP(op, suffix, asm_op, extable) \
++static inline void atomic_##op##suffix(int i, atomic##suffix##_t * v) \
+ { \
+ if (kernel_uses_llsc && R10000_LLSC_WAR) { \
+ int temp; \
+ \
+ __asm__ __volatile__( \
+- " .set arch=r4000 \n" \
+- "1: ll %0, %1 # atomic_" #op " \n" \
+- " " #asm_op " %0, %2 \n" \
++ " .set mips3 \n" \
++ "1: ll %0, %1 # atomic_" #op #suffix "\n" \
++ "2: " #asm_op " %0, %2 \n" \
+ " sc %0, %1 \n" \
+ " beqzl %0, 1b \n" \
++ extable \
+ " .set mips0 \n" \
+ : "=&r" (temp), "+" GCC_OFF12_ASM() (v->counter) \
+ : "Ir" (i)); \
+ } else if (kernel_uses_llsc) { \
+ int temp; \
+ \
+- do { \
+- __asm__ __volatile__( \
+- " .set arch=r4000 \n" \
+- " ll %0, %1 # atomic_" #op "\n" \
+- " " #asm_op " %0, %2 \n" \
+- " sc %0, %1 \n" \
+- " .set mips0 \n" \
+- : "=&r" (temp), "+" GCC_OFF12_ASM() (v->counter) \
+- : "Ir" (i)); \
+- } while (unlikely(!temp)); \
++ __asm__ __volatile__( \
++ " .set mips3 \n" \
++ "1: ll %0, %1 # atomic_" #op #suffix "\n" \
++ "2: " #asm_op " %0, %2 \n" \
++ " sc %0, %1 \n" \
++ " beqz %0, 1b \n" \
++ extable \
++ " .set mips0 \n" \
++ : "=&r" (temp), "+" GCC_OFF12_ASM() (v->counter) \
++ : "Ir" (i)); \
+ } else { \
+ unsigned long flags; \
+ \
+ raw_local_irq_save(flags); \
+- v->counter c_op i; \
++ __asm__ __volatile__( \
++ "2: " #asm_op " %0, %1 \n" \
++ extable \
++ : "+r" (v->counter) : "Ir" (i)); \
+ raw_local_irq_restore(flags); \
+ } \
+ }
+
+-#define ATOMIC_OP_RETURN(op, c_op, asm_op) \
+-static __inline__ int atomic_##op##_return(int i, atomic_t * v) \
++#define ATOMIC_OP(op, asm_op) __ATOMIC_OP(op, , asm_op##u) \
+ __ATOMIC_OP(op, _unchecked, asm_op)
+
-+#define __ATOMIC_OP_RETURN(op, suffix, asm_op, post_op, extable) \
-+static inline int atomic_##op##_return##suffix(int i, atomic##suffix##_t * v) \
- { \
- int result; \
- \
-@@ -88,37 +142,47 @@ static __inline__ int atomic_##op##_return(int i, atomic_t * v) \
- int temp; \
- \
- __asm__ __volatile__( \
-- " .set arch=r4000 \n" \
-- "1: ll %1, %2 # atomic_" #op "_return \n" \
-- " " #asm_op " %0, %1, %3 \n" \
-+ " .set mips3 \n" \
-+ "1: ll %1, %2 # atomic_" #op "_return" #suffix "\n" \
-+ "2: " #asm_op " %0, %1, %3 \n" \
- " sc %0, %2 \n" \
- " beqzl %0, 1b \n" \
-- " " #asm_op " %0, %1, %3 \n" \
-+ post_op \
-+ extable \
-+ "4: " #asm_op " %0, %1, %3 \n" \
-+ "5: \n" \
- " .set mips0 \n" \
- : "=&r" (result), "=&r" (temp), "+m" (v->counter) \
- : "Ir" (i)); \
- } else if (kernel_uses_llsc) { \
- int temp; \
- \
-- do { \
-- __asm__ __volatile__( \
-- " .set arch=r4000 \n" \
-- " ll %1, %2 # atomic_" #op "_return \n" \
-- " " #asm_op " %0, %1, %3 \n" \
-- " sc %0, %2 \n" \
-- " .set mips0 \n" \
-- : "=&r" (result), "=&r" (temp), "+m" (v->counter) \
-- : "Ir" (i)); \
-- } while (unlikely(!result)); \
-+ __asm__ __volatile__( \
-+ " .set mips3 \n" \
-+ "1: ll %1, %2 # atomic_" #op "_return" #suffix "\n" \
-+ "2: " #asm_op " %0, %1, %3 \n" \
-+ " sc %0, %2 \n" \
-+ " beqz %0, 1b \n" \
-+ post_op \
-+ extable \
-+ "4: " #asm_op " %0, %1, %3 \n" \
-+ "5: \n" \
-+ " .set mips0 \n" \
-+ : "=&r" (result), "=&r" (temp), "+m" (v->counter) \
-+ : "Ir" (i)); \
- \
- result = temp; result c_op i; \
- } else { \
- unsigned long flags; \
- \
- raw_local_irq_save(flags); \
-- result = v->counter; \
-- result c_op i; \
-- v->counter = result; \
-+ __asm__ __volatile__( \
-+ " lw %0, %1 \n" \
-+ "2: " #asm_op " %0, %1, %2 \n" \
-+ " sw %0, %1 \n" \
-+ "3: \n" \
-+ extable \
-+ : "=&r" (result), "+m" (v->counter) : "Ir" (i)); \
- raw_local_irq_restore(flags); \
- } \
- \
-@@ -127,16 +191,21 @@ static __inline__ int atomic_##op##_return(int i, atomic_t * v) \
- return result; \
- }
-
--#define ATOMIC_OPS(op, c_op, asm_op) \
-- ATOMIC_OP(op, c_op, asm_op) \
++#define __ATOMIC_OP_RETURN(op, suffix, asm_op, post_op, extable) \
++static inline int atomic_##op##_return##suffix(int i, atomic##suffix##_t * v) \
+ { \
+ int result; \
+ \
+@@ -89,12 +143,15 @@ static __inline__ int atomic_##op##_return(int i, atomic_t * v) \
+ int temp; \
+ \
+ __asm__ __volatile__( \
+- " .set arch=r4000 \n" \
+- "1: ll %1, %2 # atomic_" #op "_return \n" \
+- " " #asm_op " %0, %1, %3 \n" \
++ " .set mips3 \n" \
++ "1: ll %1, %2 # atomic_" #op "_return" #suffix"\n" \
++ "2: " #asm_op " %0, %1, %3 \n" \
+ " sc %0, %2 \n" \
+ " beqzl %0, 1b \n" \
+- " " #asm_op " %0, %1, %3 \n" \
++ post_op \
++ extable \
++ "4: " #asm_op " %0, %1, %3 \n" \
++ "5: \n" \
+ " .set mips0 \n" \
+ : "=&r" (result), "=&r" (temp), \
+ "+" GCC_OFF12_ASM() (v->counter) \
+@@ -102,26 +159,33 @@ static __inline__ int atomic_##op##_return(int i, atomic_t * v) \
+ } else if (kernel_uses_llsc) { \
+ int temp; \
+ \
+- do { \
+- __asm__ __volatile__( \
+- " .set arch=r4000 \n" \
+- " ll %1, %2 # atomic_" #op "_return \n" \
+- " " #asm_op " %0, %1, %3 \n" \
+- " sc %0, %2 \n" \
+- " .set mips0 \n" \
+- : "=&r" (result), "=&r" (temp), \
+- "+" GCC_OFF12_ASM() (v->counter) \
+- : "Ir" (i)); \
+- } while (unlikely(!result)); \
++ __asm__ __volatile__( \
++ " .set mips3 \n" \
++ "1: ll %1, %2 # atomic_" #op "_return" #suffix "\n" \
++ "2: " #asm_op " %0, %1, %3 \n" \
++ " sc %0, %2 \n" \
++ post_op \
++ extable \
++ "4: " #asm_op " %0, %1, %3 \n" \
++ "5: \n" \
++ " .set mips0 \n" \
++ : "=&r" (result), "=&r" (temp), \
++ "+" GCC_OFF12_ASM() (v->counter) \
++ : "Ir" (i)); \
+ \
+ result = temp; result c_op i; \
+ } else { \
+ unsigned long flags; \
+ \
+ raw_local_irq_save(flags); \
+- result = v->counter; \
+- result c_op i; \
+- v->counter = result; \
++ __asm__ __volatile__( \
++ " lw %0, %1 \n" \
++ "2: " #asm_op " %0, %1, %2 \n" \
++ " sw %0, %1 \n" \
++ "3: \n" \
++ extable \
++ : "=&r" (result), "+" GCC_OFF12_ASM() (v->counter) \
++ : "Ir" (i)); \
+ raw_local_irq_restore(flags); \
+ } \
+ \
+@@ -130,16 +194,21 @@ static __inline__ int atomic_##op##_return(int i, atomic_t * v) \
+ return result; \
+ }
+
+-#define ATOMIC_OPS(op, c_op, asm_op) \
+- ATOMIC_OP(op, c_op, asm_op) \
- ATOMIC_OP_RETURN(op, c_op, asm_op)
+#define ATOMIC_OP_RETURN(op, asm_op) __ATOMIC_OP_RETURN(op, , asm_op##u, , __OVERFLOW_EXTABLE) \
+ __ATOMIC_OP_RETURN(op, _unchecked, asm_op, __OVERFLOW_POST, __OVERFLOW_EXTABLE)
-ATOMIC_OPS(add, +=, addu)
-ATOMIC_OPS(sub, -=, subu)
-+#define ATOMIC_OPS(op, asm_op) \
-+ ATOMIC_OP(op, asm_op) \
++#define ATOMIC_OPS(op, asm_op) \
++ ATOMIC_OP(op, asm_op) \
+ ATOMIC_OP_RETURN(op, asm_op)
+
+ATOMIC_OPS(add, add)
@@ -5963,7 +5931,7 @@ index 6dd6bfc..903b0d6 100644
/*
* atomic_sub_if_positive - conditionally subtract integer from atomic variable
-@@ -146,7 +215,7 @@ ATOMIC_OPS(sub, -=, subu)
+@@ -149,7 +218,7 @@ ATOMIC_OPS(sub, -=, subu)
* Atomically test @v and subtract @i if @v is greater or equal than @i.
* The function returns the old value of @v minus @i.
*/
@@ -5972,7 +5940,7 @@ index 6dd6bfc..903b0d6 100644
{
int result;
-@@ -203,8 +272,26 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
+@@ -208,8 +277,26 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
return result;
}
@@ -6001,7 +5969,7 @@ index 6dd6bfc..903b0d6 100644
/**
* __atomic_add_unless - add unless the number is a given value
-@@ -232,6 +319,10 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
+@@ -237,6 +324,10 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
#define atomic_dec_return(v) atomic_sub_return(1, (v))
#define atomic_inc_return(v) atomic_add_return(1, (v))
@@ -6012,7 +5980,7 @@ index 6dd6bfc..903b0d6 100644
/*
* atomic_sub_and_test - subtract value from variable and test result
-@@ -253,6 +344,10 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
+@@ -258,6 +349,10 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
* other cases.
*/
#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
@@ -6023,7 +5991,7 @@ index 6dd6bfc..903b0d6 100644
/*
* atomic_dec_and_test - decrement by 1 and test
-@@ -277,6 +372,10 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
+@@ -282,6 +377,10 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
* Atomically increments @v by 1.
*/
#define atomic_inc(v) atomic_add(1, (v))
@@ -6034,7 +6002,7 @@ index 6dd6bfc..903b0d6 100644
/*
* atomic_dec - decrement and test
-@@ -285,6 +384,10 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
+@@ -290,6 +389,10 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
* Atomically decrements @v by 1.
*/
#define atomic_dec(v) atomic_sub(1, (v))
@@ -6045,7 +6013,7 @@ index 6dd6bfc..903b0d6 100644
/*
* atomic_add_negative - add and test if negative
-@@ -306,54 +409,77 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
+@@ -311,54 +414,77 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
* @v: pointer of type atomic64_t
*
*/
@@ -6071,150 +6039,154 @@ index 6dd6bfc..903b0d6 100644
+ v->counter = i;
+}
--#define ATOMIC64_OP(op, c_op, asm_op) \
--static __inline__ void atomic64_##op(long i, atomic64_t * v) \
+-#define ATOMIC64_OP(op, c_op, asm_op) \
+-static __inline__ void atomic64_##op(long i, atomic64_t * v) \
+static inline void atomic64_set_unchecked(atomic64_unchecked_t *v, long i)
+{
+ v->counter = i;
+}
+
-+#define __ATOMIC64_OP(op, suffix, asm_op, extable) \
-+static inline void atomic64_##op##suffix(long i, atomic64##suffix##_t * v) \
- { \
- if (kernel_uses_llsc && R10000_LLSC_WAR) { \
- long temp; \
- \
- __asm__ __volatile__( \
-- " .set arch=r4000 \n" \
-- "1: lld %0, %1 # atomic64_" #op " \n" \
-- " " #asm_op " %0, %2 \n" \
-+ " .set mips3 \n" \
-+ "1: lld %0, %1 # atomic64_" #op #suffix "\n" \
-+ "2: " #asm_op " %0, %2 \n" \
- " scd %0, %1 \n" \
- " beqzl %0, 1b \n" \
-+ extable \
- " .set mips0 \n" \
- : "=&r" (temp), "+m" (v->counter) \
- : "Ir" (i)); \
- } else if (kernel_uses_llsc) { \
- long temp; \
- \
-- do { \
-- __asm__ __volatile__( \
-- " .set arch=r4000 \n" \
-- " lld %0, %1 # atomic64_" #op "\n" \
-- " " #asm_op " %0, %2 \n" \
-- " scd %0, %1 \n" \
-- " .set mips0 \n" \
-- : "=&r" (temp), "+m" (v->counter) \
-- : "Ir" (i)); \
-- } while (unlikely(!temp)); \
-+ __asm__ __volatile__( \
-+ " .set mips3 \n" \
-+ " lld %0, %1 # atomic64_" #op #suffix "\n" \
-+ "2: " #asm_op " %0, %2 \n" \
-+ " scd %0, %1 \n" \
-+ " beqz %0, 1b \n" \
-+ extable \
-+ " .set mips0 \n" \
-+ : "=&r" (temp), "+m" (v->counter) \
-+ : "Ir" (i)); \
- } else { \
- unsigned long flags; \
- \
- raw_local_irq_save(flags); \
-- v->counter c_op i; \
-+ __asm__ __volatile__( \
-+ "2: " #asm_op " %0, %1 \n" \
-+ extable \
-+ : "+r" (v->counter) : "Ir" (i)); \
- raw_local_irq_restore(flags); \
- } \
- } \
-
--#define ATOMIC64_OP_RETURN(op, c_op, asm_op) \
--static __inline__ long atomic64_##op##_return(long i, atomic64_t * v) \
-+#define ATOMIC64_OP(op, asm_op) __ATOMIC64_OP(op, , asm_op##u) \
++#define __ATOMIC64_OP(op, suffix, asm_op, extable) \
++static inline void atomic64_##op##suffix(long i, atomic64##suffix##_t * v) \
+ { \
+ if (kernel_uses_llsc && R10000_LLSC_WAR) { \
+ long temp; \
+ \
+ __asm__ __volatile__( \
+- " .set arch=r4000 \n" \
+- "1: lld %0, %1 # atomic64_" #op " \n" \
+- " " #asm_op " %0, %2 \n" \
++ " .set mips3 \n" \
++ "1: lld %0, %1 # atomic64_" #op #suffix "\n" \
++ "2: " #asm_op " %0, %2 \n" \
+ " scd %0, %1 \n" \
+ " beqzl %0, 1b \n" \
++ extable \
+ " .set mips0 \n" \
+ : "=&r" (temp), "+" GCC_OFF12_ASM() (v->counter) \
+ : "Ir" (i)); \
+ } else if (kernel_uses_llsc) { \
+ long temp; \
+ \
+- do { \
+- __asm__ __volatile__( \
+- " .set arch=r4000 \n" \
+- " lld %0, %1 # atomic64_" #op "\n" \
+- " " #asm_op " %0, %2 \n" \
+- " scd %0, %1 \n" \
+- " .set mips0 \n" \
+- : "=&r" (temp), "+" GCC_OFF12_ASM() (v->counter) \
+- : "Ir" (i)); \
+- } while (unlikely(!temp)); \
++ __asm__ __volatile__( \
++ " .set mips3 \n" \
++ "1: lld %0, %1 # atomic64_" #op #suffix "\n" \
++ "2: " #asm_op " %0, %2 \n" \
++ " scd %0, %1 \n" \
++ " beqz %0, 1b \n" \
++ extable \
++ " .set mips0 \n" \
++ : "=&r" (temp), "+" GCC_OFF12_ASM() (v->counter) \
++ : "Ir" (i)); \
+ } else { \
+ unsigned long flags; \
+ \
+ raw_local_irq_save(flags); \
+- v->counter c_op i; \
++ __asm__ __volatile__( \
++ "2: " #asm_op " %0, %1 \n" \
++ extable \
++ : "+" GCC_OFF12_ASM() (v->counter) : "Ir" (i)); \
+ raw_local_irq_restore(flags); \
+ } \
+ }
+
+-#define ATOMIC64_OP_RETURN(op, c_op, asm_op) \
+-static __inline__ long atomic64_##op##_return(long i, atomic64_t * v) \
++#define ATOMIC64_OP(op, asm_op) __ATOMIC64_OP(op, , asm_op##u) \
+ __ATOMIC64_OP(op, _unchecked, asm_op)
+
-+#define __ATOMIC64_OP_RETURN(op, suffix, asm_op, post_op, extable) \
++#define __ATOMIC64_OP_RETURN(op, suffix, asm_op, post_op, extable) \
+static inline long atomic64_##op##_return##suffix(long i, atomic64##suffix##_t * v)\
- { \
- long result; \
- \
-@@ -363,38 +489,48 @@ static __inline__ long atomic64_##op##_return(long i, atomic64_t * v) \
- long temp; \
- \
- __asm__ __volatile__( \
-- " .set arch=r4000 \n" \
-+ " .set mips3 \n" \
- "1: lld %1, %2 # atomic64_" #op "_return\n" \
-- " " #asm_op " %0, %1, %3 \n" \
-+ "2: " #asm_op " %0, %1, %3 \n" \
- " scd %0, %2 \n" \
- " beqzl %0, 1b \n" \
-- " " #asm_op " %0, %1, %3 \n" \
-+ post_op \
-+ extable \
-+ "4: " #asm_op " %0, %1, %3 \n" \
-+ "5: \n" \
- " .set mips0 \n" \
- : "=&r" (result), "=&r" (temp), "+m" (v->counter) \
- : "Ir" (i)); \
- } else if (kernel_uses_llsc) { \
- long temp; \
- \
-- do { \
-- __asm__ __volatile__( \
-- " .set arch=r4000 \n" \
-- " lld %1, %2 # atomic64_" #op "_return\n" \
-- " " #asm_op " %0, %1, %3 \n" \
-- " scd %0, %2 \n" \
-- " .set mips0 \n" \
-- : "=&r" (result), "=&r" (temp), "=m" (v->counter) \
-- : "Ir" (i), "m" (v->counter) \
-- : "memory"); \
-- } while (unlikely(!result)); \
-+ __asm__ __volatile__( \
-+ " .set mips3 \n" \
-+ "1: lld %1, %2 # atomic64_" #op "_return" #suffix "\n" \
-+ "2: " #asm_op " %0, %1, %3 \n" \
-+ " scd %0, %2 \n" \
-+ " beqz %0, 1b \n" \
-+ post_op \
-+ extable \
-+ "4: " #asm_op " %0, %1, %3 \n" \
-+ "5: \n" \
-+ " .set mips0 \n" \
-+ : "=&r" (result), "=&r" (temp), "=m" (v->counter) \
-+ : "Ir" (i), "m" (v->counter) \
-+ : "memory"); \
- \
- result = temp; result c_op i; \
- } else { \
- unsigned long flags; \
- \
- raw_local_irq_save(flags); \
-- result = v->counter; \
-- result c_op i; \
-- v->counter = result; \
-+ __asm__ __volatile__( \
-+ " ld %0, %1 \n" \
-+ "2: " #asm_op " %0, %1, %2 \n" \
-+ " sd %0, %1 \n" \
-+ "3: \n" \
-+ extable \
-+ : "=&r" (result), "+m" (v->counter) : "Ir" (i)); \
- raw_local_irq_restore(flags); \
- } \
- \
-@@ -403,16 +539,23 @@ static __inline__ long atomic64_##op##_return(long i, atomic64_t * v) \
- return result; \
- }
-
--#define ATOMIC64_OPS(op, c_op, asm_op) \
-- ATOMIC64_OP(op, c_op, asm_op) \
+ { \
+ long result; \
+ \
+@@ -368,12 +494,15 @@ static __inline__ long atomic64_##op##_return(long i, atomic64_t * v) \
+ long temp; \
+ \
+ __asm__ __volatile__( \
+- " .set arch=r4000 \n" \
++ " .set mips3 \n" \
+ "1: lld %1, %2 # atomic64_" #op "_return\n" \
+- " " #asm_op " %0, %1, %3 \n" \
++ "2: " #asm_op " %0, %1, %3 \n" \
+ " scd %0, %2 \n" \
+ " beqzl %0, 1b \n" \
+- " " #asm_op " %0, %1, %3 \n" \
++ post_op \
++ extable \
++ "4: " #asm_op " %0, %1, %3 \n" \
++ "5: \n" \
+ " .set mips0 \n" \
+ : "=&r" (result), "=&r" (temp), \
+ "+" GCC_OFF12_ASM() (v->counter) \
+@@ -381,27 +510,35 @@ static __inline__ long atomic64_##op##_return(long i, atomic64_t * v) \
+ } else if (kernel_uses_llsc) { \
+ long temp; \
+ \
+- do { \
+- __asm__ __volatile__( \
+- " .set arch=r4000 \n" \
+- " lld %1, %2 # atomic64_" #op "_return\n" \
+- " " #asm_op " %0, %1, %3 \n" \
+- " scd %0, %2 \n" \
+- " .set mips0 \n" \
+- : "=&r" (result), "=&r" (temp), \
+- "=" GCC_OFF12_ASM() (v->counter) \
+- : "Ir" (i), GCC_OFF12_ASM() (v->counter) \
+- : "memory"); \
+- } while (unlikely(!result)); \
++ __asm__ __volatile__( \
++ " .set mips3 \n" \
++ "1: lld %1, %2 # atomic64_" #op "_return" #suffix "\n"\
++ "2: " #asm_op " %0, %1, %3 \n" \
++ " scd %0, %2 \n" \
++ " beqz %0, 1b \n" \
++ post_op \
++ extable \
++ "4: " #asm_op " %0, %1, %3 \n" \
++ "5: \n" \
++ " .set mips0 \n" \
++ : "=&r" (result), "=&r" (temp), \
++ "=" GCC_OFF12_ASM() (v->counter) \
++ : "Ir" (i), GCC_OFF12_ASM() (v->counter) \
++ : "memory"); \
+ \
+ result = temp; result c_op i; \
+ } else { \
+ unsigned long flags; \
+ \
+ raw_local_irq_save(flags); \
+- result = v->counter; \
+- result c_op i; \
+- v->counter = result; \
++ __asm__ __volatile__( \
++ " ld %0, %1 \n" \
++ "2: " #asm_op " %0, %1, %2 \n" \
++ " sd %0, %1 \n" \
++ "3: \n" \
++ extable \
++ : "=&r" (result), "+" GCC_OFF12_ASM() (v->counter) \
++ : "Ir" (i)); \
+ raw_local_irq_restore(flags); \
+ } \
+ \
+@@ -410,16 +547,23 @@ static __inline__ long atomic64_##op##_return(long i, atomic64_t * v) \
+ return result; \
+ }
+
+-#define ATOMIC64_OPS(op, c_op, asm_op) \
+- ATOMIC64_OP(op, c_op, asm_op) \
- ATOMIC64_OP_RETURN(op, c_op, asm_op)
+#define ATOMIC64_OP_RETURN(op, asm_op) __ATOMIC64_OP_RETURN(op, , asm_op##u, , __OVERFLOW_EXTABLE) \
+ __ATOMIC64_OP_RETURN(op, _unchecked, asm_op, __OVERFLOW_POST, __OVERFLOW_EXTABLE)
@@ -6237,8 +6209,8 @@ index 6dd6bfc..903b0d6 100644
+#undef __OVERFLOW_POST
/*
- * atomic64_sub_if_positive - conditionally subtract integer from atomic variable
-@@ -422,7 +565,7 @@ ATOMIC64_OPS(sub, -=, dsubu)
+ * atomic64_sub_if_positive - conditionally subtract integer from atomic
+@@ -430,7 +574,7 @@ ATOMIC64_OPS(sub, -=, dsubu)
* Atomically test @v and subtract @i if @v is greater or equal than @i.
* The function returns the old value of @v minus @i.
*/
@@ -6247,7 +6219,7 @@ index 6dd6bfc..903b0d6 100644
{
long result;
-@@ -479,9 +622,26 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
+@@ -489,9 +633,26 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
return result;
}
@@ -6277,7 +6249,7 @@ index 6dd6bfc..903b0d6 100644
/**
* atomic64_add_unless - add unless the number is a given value
-@@ -511,6 +671,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
+@@ -521,6 +682,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
#define atomic64_dec_return(v) atomic64_sub_return(1, (v))
#define atomic64_inc_return(v) atomic64_add_return(1, (v))
@@ -6285,7 +6257,7 @@ index 6dd6bfc..903b0d6 100644
/*
* atomic64_sub_and_test - subtract value from variable and test result
-@@ -532,6 +693,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
+@@ -542,6 +704,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
* other cases.
*/
#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
@@ -6293,7 +6265,7 @@ index 6dd6bfc..903b0d6 100644
/*
* atomic64_dec_and_test - decrement by 1 and test
-@@ -556,6 +718,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
+@@ -566,6 +729,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
* Atomically increments @v by 1.
*/
#define atomic64_inc(v) atomic64_add(1, (v))
@@ -6301,7 +6273,7 @@ index 6dd6bfc..903b0d6 100644
/*
* atomic64_dec - decrement and test
-@@ -564,6 +727,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
+@@ -574,6 +738,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
* Atomically decrements @v by 1.
*/
#define atomic64_dec(v) atomic64_sub(1, (v))
@@ -6310,10 +6282,10 @@ index 6dd6bfc..903b0d6 100644
/*
* atomic64_add_negative - add and test if negative
diff --git a/arch/mips/include/asm/barrier.h b/arch/mips/include/asm/barrier.h
-index d0101dd..266982c 100644
+index 2b8bbbc..4556df6 100644
--- a/arch/mips/include/asm/barrier.h
+++ b/arch/mips/include/asm/barrier.h
-@@ -184,7 +184,7 @@
+@@ -133,7 +133,7 @@
do { \
compiletime_assert_atomic_type(*p); \
smp_mb(); \
@@ -6340,10 +6312,10 @@ index b4db69f..8f3b093 100644
#define SMP_CACHE_SHIFT L1_CACHE_SHIFT
#define SMP_CACHE_BYTES L1_CACHE_BYTES
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
-index 1d38fe0..9beabc9d 100644
+index eb4d95d..f2f7f93 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
-@@ -381,13 +381,16 @@ extern const char *__elf_platform;
+@@ -405,15 +405,18 @@ extern const char *__elf_platform;
#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
#endif
@@ -6363,7 +6335,9 @@ index 1d38fe0..9beabc9d 100644
-extern unsigned long arch_randomize_brk(struct mm_struct *mm);
-#define arch_randomize_brk arch_randomize_brk
-
- #endif /* _ASM_ELF_H */
+ struct arch_elf_state {
+ int fp_abi;
+ int interp_fp_abi;
diff --git a/arch/mips/include/asm/exec.h b/arch/mips/include/asm/exec.h
index c1f6afa..38cc6e9 100644
--- a/arch/mips/include/asm/exec.h
@@ -6481,7 +6455,7 @@ index 46dfc3c..a16b13a 100644
/**
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
-index 3be8180..c4798d5 100644
+index 154b70a..426ae3d 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -120,7 +120,7 @@ extern void copy_user_highpage(struct page *to, struct page *from,
@@ -6510,7 +6484,7 @@ index b336037..5b874cc 100644
/*
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
-index bc3fc4f..e2483f0 100644
+index 845016d..3303268 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -20,6 +20,9 @@
@@ -6524,10 +6498,10 @@ index bc3fc4f..e2483f0 100644
struct vm_area_struct;
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
-index 7de8658..c109224 100644
+index e4440f9..8fb0005 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
-@@ -105,6 +105,9 @@ static inline struct thread_info *current_thread_info(void)
+@@ -106,6 +106,9 @@ static inline struct thread_info *current_thread_info(void)
#define TIF_SECCOMP 4 /* secure computing */
#define TIF_NOTIFY_RESUME 5 /* callback before returning to user */
#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
@@ -6537,7 +6511,7 @@ index 7de8658..c109224 100644
#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
#define TIF_NOHZ 19 /* in adaptive nohz mode */
-@@ -138,14 +141,16 @@ static inline struct thread_info *current_thread_info(void)
+@@ -141,14 +144,16 @@ static inline struct thread_info *current_thread_info(void)
#define _TIF_USEDMSA (1<<TIF_USEDMSA)
#define _TIF_MSA_CTX_LIVE (1<<TIF_MSA_CTX_LIVE)
#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
@@ -6556,7 +6530,7 @@ index 7de8658..c109224 100644
/* work to do on interrupt/exception return */
#define _TIF_WORK_MASK \
-@@ -153,7 +158,7 @@ static inline struct thread_info *current_thread_info(void)
+@@ -156,7 +161,7 @@ static inline struct thread_info *current_thread_info(void)
/* work to do on any return to u-space */
#define _TIF_ALLWORK_MASK (_TIF_NOHZ | _TIF_WORK_MASK | \
_TIF_WORK_SYSCALL_EXIT | \
@@ -6566,7 +6540,7 @@ index 7de8658..c109224 100644
/*
* We stash processor id into a COP0 register to retrieve it fast
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h
-index 22a5624..7c96295 100644
+index bf8b324..cec5705 100644
--- a/arch/mips/include/asm/uaccess.h
+++ b/arch/mips/include/asm/uaccess.h
@@ -130,6 +130,7 @@ extern u64 __ua_limit;
@@ -6614,10 +6588,10 @@ index 9287678..f870e47 100644
#include <linux/module.h>
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
-index 50b3648..c2f3cec 100644
+index a74ec3a..4f06f18 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
-@@ -201,7 +201,7 @@ spurious_8259A_irq:
+@@ -202,7 +202,7 @@ spurious_8259A_irq:
printk(KERN_DEBUG "spurious 8259A interrupt: IRQ%d.\n", irq);
spurious_irq_mask |= irqmask;
}
@@ -6697,14 +6671,13 @@ index 0614717..002fa43 100644
/* Run the generated entry code */
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
-index 636b074..8fbb91f 100644
+index 85bff5d..39bc202 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
-@@ -520,15 +520,3 @@ unsigned long get_wchan(struct task_struct *task)
- out:
+@@ -534,18 +534,6 @@ out:
return pc;
}
--
+
-/*
- * Don't forget that the stack pointer must be aligned on a 8 bytes
- * boundary for 32-bits ABI and 16 bytes for 64-bits ABI.
@@ -6716,8 +6689,12 @@ index 636b074..8fbb91f 100644
-
- return sp & ALMASK;
-}
+-
+ static void arch_dump_stack(void *info)
+ {
+ struct pt_regs *regs;
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
-index 9d1487d..10c5da5 100644
+index 5104528..950bbdc 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -761,6 +761,10 @@ long arch_ptrace(struct task_struct *child, long request,
@@ -6731,7 +6708,7 @@ index 9d1487d..10c5da5 100644
/*
* Notification of system call entry/exit
* - triggered by current->work.syscall_trace
-@@ -777,6 +781,11 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
+@@ -779,6 +783,11 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
tracehook_report_syscall_entry(regs))
ret = -1;
@@ -6845,7 +6822,7 @@ index 2242bdd..b284048 100644
}
/* Arrange for an interrupt in a short while */
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
-index d255a2a..916271c 100644
+index c3b41e2..46c32e9 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -688,7 +688,18 @@ asmlinkage void do_ov(struct pt_regs *regs)
@@ -7030,7 +7007,7 @@ index f1baadd..5472dca 100644
{
return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c
-index 59cccd9..f39ac2f 100644
+index d07e041..bedb72b 100644
--- a/arch/mips/pci/pci-octeon.c
+++ b/arch/mips/pci/pci-octeon.c
@@ -327,8 +327,8 @@ static int octeon_write_config(struct pci_bus *bus, unsigned int devfn,
@@ -7345,7 +7322,7 @@ index a5cb070..8604ddc 100644
else
copy_from_user_overflow();
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
-index 50dfafc..b9fc230 100644
+index 5822e8e..bc5e638 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -98,16 +98,38 @@
@@ -7391,7 +7368,7 @@ index 50dfafc..b9fc230 100644
}
static inline int in_local(struct module *me, void *loc)
-@@ -371,13 +393,13 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr,
+@@ -367,13 +389,13 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr,
}
/* align things a bit */
@@ -7411,7 +7388,7 @@ index 50dfafc..b9fc230 100644
me->arch.got_max = gots;
me->arch.fdesc_max = fdescs;
-@@ -395,7 +417,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend)
+@@ -391,7 +413,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend)
BUG_ON(value == 0);
@@ -7420,7 +7397,7 @@ index 50dfafc..b9fc230 100644
for (i = 0; got[i].addr; i++)
if (got[i].addr == value)
goto out;
-@@ -413,7 +435,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend)
+@@ -409,7 +431,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend)
#ifdef CONFIG_64BIT
static Elf_Addr get_fdesc(struct module *me, unsigned long value)
{
@@ -7429,7 +7406,7 @@ index 50dfafc..b9fc230 100644
if (!value) {
printk(KERN_ERR "%s: zero OPD requested!\n", me->name);
-@@ -431,7 +453,7 @@ static Elf_Addr get_fdesc(struct module *me, unsigned long value)
+@@ -427,7 +449,7 @@ static Elf_Addr get_fdesc(struct module *me, unsigned long value)
/* Create new one */
fdesc->addr = value;
@@ -7438,7 +7415,7 @@ index 50dfafc..b9fc230 100644
return (Elf_Addr)fdesc;
}
#endif /* CONFIG_64BIT */
-@@ -843,7 +865,7 @@ register_unwind_table(struct module *me,
+@@ -839,7 +861,7 @@ register_unwind_table(struct module *me,
table = (unsigned char *)sechdrs[me->arch.unwind_section].sh_addr;
end = table + sechdrs[me->arch.unwind_section].sh_size;
@@ -7708,10 +7685,10 @@ index e5120e6..8ddb5cc 100644
/*
* If for any reason at all we couldn't handle the fault, make
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
-index 88eace4..4ba2591 100644
+index a2a168e..e484682 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
-@@ -404,6 +404,7 @@ config PPC64_SUPPORTS_MEMORY_FAILURE
+@@ -408,6 +408,7 @@ config PPC64_SUPPORTS_MEMORY_FAILURE
config KEXEC
bool "kexec system call"
depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP))
@@ -8233,13 +8210,13 @@ index 512d278..d31fadd 100644
2:"
: "=&r" (t)
diff --git a/arch/powerpc/include/asm/barrier.h b/arch/powerpc/include/asm/barrier.h
-index bab79a1..4a3eabc 100644
+index a3bf5be..e03ba81 100644
--- a/arch/powerpc/include/asm/barrier.h
+++ b/arch/powerpc/include/asm/barrier.h
-@@ -73,7 +73,7 @@
+@@ -76,7 +76,7 @@
do { \
compiletime_assert_atomic_type(*p); \
- __lwsync(); \
+ smp_lwsync(); \
- ACCESS_ONCE(*p) = (v); \
+ ACCESS_ONCE_RW(*p) = (v); \
} while (0)
@@ -8267,17 +8244,13 @@ index 34a05a1..a1f2c67 100644
#define SMP_CACHE_BYTES L1_CACHE_BYTES
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
-index 888d8f3..66f581c 100644
+index 57d289a..b36c98c 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
-@@ -28,8 +28,19 @@
- the loader. We need to make sure that it is out of the way of the program
- that it will "exec", and that there is sufficient room for the brk. */
+@@ -30,6 +30,18 @@
+
+ #define ELF_ET_DYN_BASE 0x20000000
--extern unsigned long randomize_et_dyn(unsigned long base);
--#define ELF_ET_DYN_BASE (randomize_et_dyn(0x20000000))
-+#define ELF_ET_DYN_BASE (0x20000000)
-+
+#ifdef CONFIG_PAX_ASLR
+#define PAX_ELF_ET_DYN_BASE (0x10000000UL)
+
@@ -8289,10 +8262,11 @@ index 888d8f3..66f581c 100644
+#define PAX_DELTA_STACK_LEN 15
+#endif
+#endif
-
++
#define ELF_CORE_EFLAGS (is_elf2_task() ? 2 : 0)
-@@ -129,10 +140,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
+ /*
+@@ -128,10 +140,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
(0x7ff >> (PAGE_SHIFT - 12)) : \
(0x3ffff >> (PAGE_SHIFT - 12)))
@@ -8421,7 +8395,7 @@ index 8565c25..2865190 100644
return (vm_flags & VM_SAO) ? __pgprot(_PAGE_SAO) : __pgprot(0);
}
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
-index 26fe1ae..987ffc5 100644
+index 69c0598..2c56964 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -227,8 +227,9 @@ extern long long virt_phys_offset;
@@ -8504,7 +8478,7 @@ index 4b0be20..c15a27d 100644
static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
pte_t *pte)
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
-index 316f9a5..ba05c77 100644
+index a8805fe..6d69617 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -2,6 +2,7 @@
@@ -8528,7 +8502,7 @@ index 4aad413..85d86bf 100644
#define _PAGE_NO_CACHE 0x020 /* I: cache inhibit */
#define _PAGE_WRITETHRU 0x040 /* W: cache write-through */
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
-index a68ee15..552d213 100644
+index 1c874fb..e8480a4 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -253,6 +253,7 @@
@@ -8620,7 +8594,7 @@ index 4dbe072..b803275 100644
: "r"(&rw->lock)
: "cr0", "xer", "memory");
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
-index b034ecd..af7e31f 100644
+index 0be6c68..9c3c6ee 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -107,6 +107,8 @@ static inline struct thread_info *current_thread_info(void)
@@ -8645,7 +8619,7 @@ index b034ecd..af7e31f 100644
#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
_TIF_NOTIFY_RESUME | _TIF_UPROBE | \
diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h
-index 9485b43..3bd3c16 100644
+index a0c071d..49cdc7f 100644
--- a/arch/powerpc/include/asm/uaccess.h
+++ b/arch/powerpc/include/asm/uaccess.h
@@ -58,6 +58,7 @@
@@ -8872,10 +8846,10 @@ index 3e68d1c..72a5ee6 100644
ld r4,_DAR(r1)
bl bad_page_fault
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
-index 72e783e..fe058e2 100644
+index c2df815..bae3d12 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
-@@ -1588,10 +1588,10 @@ handle_page_fault:
+@@ -1599,10 +1599,10 @@ handle_page_fault:
11: ld r4,_DAR(r1)
ld r5,_DSISR(r1)
addi r3,r1,STACK_FRAME_OVERHEAD
@@ -8888,10 +8862,10 @@ index 72e783e..fe058e2 100644
addi r3,r1,STACK_FRAME_OVERHEAD
lwz r4,_DAR(r1)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
-index c143835..5a9697f 100644
+index 4509603..cdb491f 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
-@@ -461,6 +461,8 @@ void migrate_irqs(void)
+@@ -460,6 +460,8 @@ void migrate_irqs(void)
}
#endif
@@ -8900,7 +8874,7 @@ index c143835..5a9697f 100644
static inline void check_stack_overflow(void)
{
#ifdef CONFIG_DEBUG_STACKOVERFLOW
-@@ -473,6 +475,7 @@ static inline void check_stack_overflow(void)
+@@ -472,6 +474,7 @@ static inline void check_stack_overflow(void)
pr_err("do_IRQ: stack overflow: %ld\n",
sp - sizeof(struct thread_info));
dump_stack();
@@ -8951,10 +8925,10 @@ index c94d2e0..992a9ce 100644
sechdrs, module);
#endif
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
-index 923cd2d..ae782a9 100644
+index b4cc7be..1fe8bb3 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
-@@ -1040,8 +1040,8 @@ void show_regs(struct pt_regs * regs)
+@@ -1036,8 +1036,8 @@ void show_regs(struct pt_regs * regs)
* Lookup NIP late so we have the best change of getting the
* above info out without failing
*/
@@ -8965,20 +8939,20 @@ index 923cd2d..ae782a9 100644
#endif
show_stack(current, (unsigned long *) regs->gpr[1]);
if (!user_mode(regs))
-@@ -1560,10 +1560,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
+@@ -1549,10 +1549,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
newsp = stack[0];
ip = stack[STACK_FRAME_LR_SAVE];
if (!firstframe || ip != lr) {
- printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip);
+ printk("["REG"] ["REG"] %pA", sp, ip, (void *)ip);
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
- if ((ip == rth || ip == mrth) && curr_frame >= 0) {
+ if ((ip == rth) && curr_frame >= 0) {
- printk(" (%pS)",
+ printk(" (%pA)",
(void *)current->ret_stack[curr_frame].ret);
curr_frame--;
}
-@@ -1583,7 +1583,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
+@@ -1572,7 +1572,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
struct pt_regs *regs = (struct pt_regs *)
(sp + STACK_FRAME_OVERHEAD);
lr = regs->link;
@@ -8987,7 +8961,7 @@ index 923cd2d..ae782a9 100644
regs->trap, (void *)regs->nip, (void *)lr);
firstframe = 1;
}
-@@ -1619,58 +1619,3 @@ void notrace __ppc64_runlatch_off(void)
+@@ -1608,49 +1608,3 @@ void notrace __ppc64_runlatch_off(void)
mtspr(SPRN_CTRLT, ctrl);
}
#endif /* CONFIG_PPC64 */
@@ -9037,15 +9011,6 @@ index 923cd2d..ae782a9 100644
- return ret;
-}
-
--unsigned long randomize_et_dyn(unsigned long base)
--{
-- unsigned long ret = PAGE_ALIGN(base + brk_rnd());
--
-- if (ret < base)
-- return base;
--
-- return ret;
--}
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index f21897b..28c0428 100644
--- a/arch/powerpc/kernel/ptrace.c
@@ -9112,7 +9077,7 @@ index 2cb0c94..c0c0bc9 100644
} else {
err |= setup_trampoline(__NR_rt_sigreturn, &frame->tramp[0]);
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
-index 0dc43f9..a885d33 100644
+index e6595b7..24bde6e 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -36,6 +36,7 @@
@@ -9170,10 +9135,10 @@ index 0dc43f9..a885d33 100644
* has no FPU, in that case the reason flags will be 0 */
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
-index f174351..5722009 100644
+index 305eb0d..accc5b40 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
-@@ -35,6 +35,7 @@
+@@ -34,6 +34,7 @@
#include <asm/vdso.h>
#include <asm/vdso_datapage.h>
#include <asm/setup.h>
@@ -9181,7 +9146,7 @@ index f174351..5722009 100644
#undef DEBUG
-@@ -221,7 +222,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
+@@ -220,7 +221,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
vdso_base = VDSO32_MBASE;
#endif
@@ -9190,7 +9155,7 @@ index f174351..5722009 100644
/* vDSO has a problem and was disabled, just don't "enable" it for the
* process
-@@ -241,7 +242,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
+@@ -240,7 +241,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
vdso_base = get_unmapped_area(NULL, vdso_base,
(vdso_pages << PAGE_SHIFT) +
((VDSO_ALIGNMENT - 1) & PAGE_MASK),
@@ -9200,10 +9165,10 @@ index f174351..5722009 100644
rc = vdso_base;
goto fail_mmapsem;
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
-index c1f8f53..71a3b96 100644
+index c45eaab..5f41b57 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
-@@ -1409,7 +1409,7 @@ void kvmppc_init_lpid(unsigned long nr_lpids_param)
+@@ -1403,7 +1403,7 @@ void kvmppc_init_lpid(unsigned long nr_lpids_param)
}
EXPORT_SYMBOL_GPL(kvmppc_init_lpid);
@@ -9248,7 +9213,7 @@ index 5eea6f3..5d10396 100644
EXPORT_SYMBOL(copy_in_user);
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
-index f06b56b..ffb2fb4 100644
+index 6154b0a..4de2b19 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -33,6 +33,10 @@
@@ -9262,7 +9227,7 @@ index f06b56b..ffb2fb4 100644
#include <asm/firmware.h>
#include <asm/page.h>
-@@ -69,6 +73,33 @@ static inline int notify_page_fault(struct pt_regs *regs)
+@@ -68,6 +72,33 @@ static inline int notify_page_fault(struct pt_regs *regs)
}
#endif
@@ -9296,7 +9261,7 @@ index f06b56b..ffb2fb4 100644
/*
* Check whether the instruction at regs->nip is a store using
* an update addressing form which will update r1.
-@@ -228,7 +259,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
+@@ -227,7 +258,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
* indicate errors in DSISR but can validly be set in SRR1.
*/
if (trap == 0x400)
@@ -9305,7 +9270,7 @@ index f06b56b..ffb2fb4 100644
else
is_write = error_code & DSISR_ISSTORE;
#else
-@@ -390,7 +421,7 @@ good_area:
+@@ -383,7 +414,7 @@ good_area:
* "undefined". Of those that can be set, this is the only
* one which seems bad.
*/
@@ -9314,7 +9279,7 @@ index f06b56b..ffb2fb4 100644
/* Guarded storage error. */
goto bad_area;
#endif /* CONFIG_8xx */
-@@ -405,7 +436,7 @@ good_area:
+@@ -398,7 +429,7 @@ good_area:
* processors use the same I/D cache coherency mechanism
* as embedded.
*/
@@ -9323,7 +9288,7 @@ index f06b56b..ffb2fb4 100644
goto bad_area;
#endif /* CONFIG_PPC_STD_MMU */
-@@ -497,6 +528,23 @@ bad_area:
+@@ -490,6 +521,23 @@ bad_area:
bad_area_nosemaphore:
/* User mode accesses cause a SIGSEGV */
if (user_mode(regs)) {
@@ -9447,10 +9412,10 @@ index ded0ea1..f213a9b 100644
if (!fixed && addr) {
addr = _ALIGN_UP(addr, 1ul << pshift);
diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
-index 4278acf..67fd0e6 100644
+index f223875..94170e4 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
-@@ -400,8 +400,8 @@ static int scc_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
+@@ -399,8 +399,8 @@ static int scc_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
}
static struct pci_ops scc_pciex_pci_ops = {
@@ -9497,10 +9462,10 @@ index fa934fe..c296056 100644
+
#endif /* __ARCH_S390_ATOMIC__ */
diff --git a/arch/s390/include/asm/barrier.h b/arch/s390/include/asm/barrier.h
-index b5dce65..8aca09a 100644
+index 8d72471..5322500 100644
--- a/arch/s390/include/asm/barrier.h
+++ b/arch/s390/include/asm/barrier.h
-@@ -39,7 +39,7 @@
+@@ -42,7 +42,7 @@
do { \
compiletime_assert_atomic_type(*p); \
barrier(); \
@@ -9609,10 +9574,10 @@ index cd4c68e..6764641 100644
return n;
}
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
-index b89b591..fd9609d 100644
+index 409d152..d90d368 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
-@@ -169,11 +169,11 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
+@@ -165,11 +165,11 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
/* Increase core size by size of got & plt and set start
offsets for got and plt. */
@@ -9629,7 +9594,7 @@ index b89b591..fd9609d 100644
return 0;
}
-@@ -289,7 +289,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -285,7 +285,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
if (info->got_initialized == 0) {
Elf_Addr *gotent;
@@ -9638,7 +9603,7 @@ index b89b591..fd9609d 100644
info->got_offset;
*gotent = val;
info->got_initialized = 1;
-@@ -312,7 +312,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -308,7 +308,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
rc = apply_rela_bits(loc, val, 0, 64, 0);
else if (r_type == R_390_GOTENT ||
r_type == R_390_GOTPLTENT) {
@@ -9647,7 +9612,7 @@ index b89b591..fd9609d 100644
rc = apply_rela_bits(loc, val, 1, 32, 1);
}
break;
-@@ -325,7 +325,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -321,7 +321,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
case R_390_PLTOFF64: /* 16 bit offset from GOT to PLT. */
if (info->plt_initialized == 0) {
unsigned int *ip;
@@ -9656,7 +9621,7 @@ index b89b591..fd9609d 100644
info->plt_offset;
#ifndef CONFIG_64BIT
ip[0] = 0x0d105810; /* basr 1,0; l 1,6(1); br 1 */
-@@ -350,7 +350,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -346,7 +346,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
val - loc + 0xffffUL < 0x1ffffeUL) ||
(r_type == R_390_PLT32DBL &&
val - loc + 0xffffffffULL < 0x1fffffffeULL)))
@@ -9665,7 +9630,7 @@ index b89b591..fd9609d 100644
me->arch.plt_offset +
info->plt_offset;
val += rela->r_addend - loc;
-@@ -372,7 +372,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -368,7 +368,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
case R_390_GOTOFF32: /* 32 bit offset to GOT. */
case R_390_GOTOFF64: /* 64 bit offset to GOT. */
val = val + rela->r_addend -
@@ -9674,7 +9639,7 @@ index b89b591..fd9609d 100644
if (r_type == R_390_GOTOFF16)
rc = apply_rela_bits(loc, val, 0, 16, 0);
else if (r_type == R_390_GOTOFF32)
-@@ -382,7 +382,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -378,7 +378,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
break;
case R_390_GOTPC: /* 32 bit PC relative offset to GOT. */
case R_390_GOTPCDBL: /* 32 bit PC rel. off. to GOT shifted by 1. */
@@ -9684,10 +9649,10 @@ index b89b591..fd9609d 100644
if (r_type == R_390_GOTPC)
rc = apply_rela_bits(loc, val, 1, 32, 0);
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
-index ed84cc2..c05a9d2 100644
+index aa7a839..6c2a916 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
-@@ -218,37 +218,3 @@ unsigned long get_wchan(struct task_struct *p)
+@@ -219,37 +219,3 @@ unsigned long get_wchan(struct task_struct *p)
}
return 0;
}
@@ -10101,10 +10066,10 @@ index 4082749..fd97781 100644
#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
diff --git a/arch/sparc/include/asm/barrier_64.h b/arch/sparc/include/asm/barrier_64.h
-index 305dcc3..7835030 100644
+index 7664894..45a974b 100644
--- a/arch/sparc/include/asm/barrier_64.h
+++ b/arch/sparc/include/asm/barrier_64.h
-@@ -57,7 +57,7 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
+@@ -60,7 +60,7 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
do { \
compiletime_assert_atomic_type(*p); \
barrier(); \
@@ -10916,10 +10881,10 @@ index c85403d..6af95c9 100644
}
}
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
-index 33a17e7..d87fb1f 100644
+index bb00089..e0ea580 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
-@@ -52,7 +52,7 @@ sys32_rt_sigreturn:
+@@ -62,7 +62,7 @@ sys32_rt_sigreturn:
#endif
.align 32
1: ldx [%g6 + TI_FLAGS], %l5
@@ -10928,7 +10893,7 @@ index 33a17e7..d87fb1f 100644
be,pt %icc, rtrap
nop
call syscall_trace_leave
-@@ -184,7 +184,7 @@ linux_sparc_syscall32:
+@@ -194,7 +194,7 @@ linux_sparc_syscall32:
srl %i3, 0, %o3 ! IEU0
srl %i2, 0, %o2 ! IEU0 Group
@@ -10937,7 +10902,7 @@ index 33a17e7..d87fb1f 100644
bne,pn %icc, linux_syscall_trace32 ! CTI
mov %i0, %l5 ! IEU1
5: call %l7 ! CTI Group brk forced
-@@ -208,7 +208,7 @@ linux_sparc_syscall:
+@@ -218,7 +218,7 @@ linux_sparc_syscall:
mov %i3, %o3 ! IEU1
mov %i4, %o4 ! IEU0 Group
@@ -10946,7 +10911,7 @@ index 33a17e7..d87fb1f 100644
bne,pn %icc, linux_syscall_trace ! CTI Group
mov %i0, %l5 ! IEU0
2: call %l7 ! CTI Group brk forced
-@@ -223,7 +223,7 @@ ret_sys_call:
+@@ -233,7 +233,7 @@ ret_sys_call:
cmp %o0, -ERESTART_RESTARTBLOCK
bgeu,pn %xcc, 1f
@@ -12306,7 +12271,7 @@ index d329537..2c3746a 100644
pte_t *huge_pte_alloc(struct mm_struct *mm,
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
-index 2d91c62..17a8fff 100644
+index 3ea267c..93f0659 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -186,9 +186,9 @@ unsigned long sparc64_kern_sec_context __read_mostly;
@@ -12411,7 +12376,7 @@ index b6cde32..c0cb736 100644
else
copy_from_user_overflow();
diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c
-index e514899..f8743c4 100644
+index 3270e00..a77236e 100644
--- a/arch/tile/mm/hugetlbpage.c
+++ b/arch/tile/mm/hugetlbpage.c
@@ -207,6 +207,7 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file,
@@ -12548,10 +12513,10 @@ index ad8f795..2c7eec6 100644
/*
* Memory returned by kmalloc() may be used for DMA, so we must make
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
-index 3635fff..c1f9fab 100644
+index 0dc9d01..98df103 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -129,7 +129,7 @@ config X86
+@@ -130,7 +130,7 @@ config X86
select RTC_LIB
select HAVE_DEBUG_STACKOVERFLOW
select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64
@@ -12560,7 +12525,7 @@ index 3635fff..c1f9fab 100644
select GENERIC_CPU_AUTOPROBE
select HAVE_ARCH_AUDITSYSCALL
select ARCH_SUPPORTS_ATOMIC_RMW
-@@ -262,7 +262,7 @@ config X86_HT
+@@ -263,7 +263,7 @@ config X86_HT
config X86_32_LAZY_GS
def_bool y
@@ -12569,7 +12534,7 @@ index 3635fff..c1f9fab 100644
config ARCH_HWEIGHT_CFLAGS
string
-@@ -600,6 +600,7 @@ config SCHED_OMIT_FRAME_POINTER
+@@ -601,6 +601,7 @@ config SCHED_OMIT_FRAME_POINTER
menuconfig HYPERVISOR_GUEST
bool "Linux guest support"
@@ -12577,7 +12542,7 @@ index 3635fff..c1f9fab 100644
---help---
Say Y here to enable options for running Linux under various hyper-
visors. This option enables basic hypervisor detection and platform
-@@ -977,6 +978,7 @@ config VM86
+@@ -978,6 +979,7 @@ config VM86
config X86_16BIT
bool "Enable support for 16-bit segments" if EXPERT
@@ -12585,7 +12550,7 @@ index 3635fff..c1f9fab 100644
default y
---help---
This option is required by programs like Wine to run 16-bit
-@@ -1132,6 +1134,7 @@ choice
+@@ -1151,6 +1153,7 @@ choice
config NOHIGHMEM
bool "off"
@@ -12593,7 +12558,7 @@ index 3635fff..c1f9fab 100644
---help---
Linux can use up to 64 Gigabytes of physical memory on x86 systems.
However, the address space of 32-bit x86 processors is only 4
-@@ -1168,6 +1171,7 @@ config NOHIGHMEM
+@@ -1187,6 +1190,7 @@ config NOHIGHMEM
config HIGHMEM4G
bool "4GB"
@@ -12601,7 +12566,7 @@ index 3635fff..c1f9fab 100644
---help---
Select this if you have a 32-bit processor and between 1 and 4
gigabytes of physical RAM.
-@@ -1220,7 +1224,7 @@ config PAGE_OFFSET
+@@ -1239,7 +1243,7 @@ config PAGE_OFFSET
hex
default 0xB0000000 if VMSPLIT_3G_OPT
default 0x80000000 if VMSPLIT_2G
@@ -12610,7 +12575,7 @@ index 3635fff..c1f9fab 100644
default 0x40000000 if VMSPLIT_1G
default 0xC0000000
depends on X86_32
-@@ -1635,6 +1639,7 @@ source kernel/Kconfig.hz
+@@ -1680,6 +1684,7 @@ source kernel/Kconfig.hz
config KEXEC
bool "kexec system call"
@@ -12618,7 +12583,7 @@ index 3635fff..c1f9fab 100644
---help---
kexec is a system call that implements the ability to shutdown your
current kernel, and to start another kernel. It is like a reboot
-@@ -1820,7 +1825,9 @@ config X86_NEED_RELOCS
+@@ -1865,7 +1870,9 @@ config X86_NEED_RELOCS
config PHYSICAL_ALIGN
hex "Alignment value to which kernel should be aligned"
@@ -12629,7 +12594,7 @@ index 3635fff..c1f9fab 100644
range 0x2000 0x1000000 if X86_32
range 0x200000 0x1000000 if X86_64
---help---
-@@ -1903,6 +1910,7 @@ config COMPAT_VDSO
+@@ -1948,6 +1955,7 @@ config COMPAT_VDSO
def_bool n
prompt "Disable the 32-bit vDSO (needed for glibc 2.3.3)"
depends on X86_32 || IA32_EMULATION
@@ -12782,10 +12747,10 @@ index bd49ec6..94c7f58 100644
}
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
-index 30c0acf..48c3a77 100644
+index 8bd44e8..6b111e9 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
-@@ -16,6 +16,9 @@ KBUILD_CFLAGS += $(cflags-y)
+@@ -28,6 +28,9 @@ KBUILD_CFLAGS += $(cflags-y)
KBUILD_CFLAGS += -mno-mmx -mno-sse
KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
@@ -12911,7 +12876,7 @@ index 6b1766c..ad465c9 100644
.quad 0x0000000000000000 /* TS continued */
gdt_end:
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
-index 0c33a7c..be226ed 100644
+index a950864..c710239 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -242,7 +242,7 @@ static void handle_relocations(void *output, unsigned long output_len)
@@ -12923,7 +12888,7 @@ index 0c33a7c..be226ed 100644
if (!delta) {
debug_putstr("No relocation needed... ");
return;
-@@ -312,7 +312,7 @@ static void parse_elf(void *output)
+@@ -324,7 +324,7 @@ static void parse_elf(void *output)
Elf32_Ehdr ehdr;
Elf32_Phdr *phdrs, *phdr;
#endif
@@ -12932,7 +12897,7 @@ index 0c33a7c..be226ed 100644
int i;
memcpy(&ehdr, output, sizeof(ehdr));
-@@ -339,13 +339,16 @@ static void parse_elf(void *output)
+@@ -351,13 +351,16 @@ static void parse_elf(void *output)
case PT_LOAD:
#ifdef CONFIG_RELOCATABLE
dest = output;
@@ -12950,7 +12915,7 @@ index 0c33a7c..be226ed 100644
break;
default: /* Ignore other PT_* */ break;
}
-@@ -404,7 +407,7 @@ asmlinkage __visible void *decompress_kernel(void *rmode, memptr heap,
+@@ -416,7 +419,7 @@ asmlinkage __visible void *decompress_kernel(void *rmode, memptr heap,
error("Destination address too large");
#endif
#ifndef CONFIG_RELOCATABLE
@@ -14619,7 +14584,7 @@ index a039d21..524b8b2 100644
ret
ENDPROC(twofish_dec_blk)
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
-index df91466..74b31cb 100644
+index ae6aad1..719d6d9 100644
--- a/arch/x86/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
@@ -153,6 +153,8 @@ static int aout_core_dump(struct coredump_params *cprm)
@@ -14709,7 +14674,7 @@ index f9e181a..300544c 100644
err |= copy_siginfo_to_user32(&frame->info, &ksig->info);
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
-index ffe7122..899bad3 100644
+index 82e8a1d..4e998d5 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -15,8 +15,10 @@
@@ -15196,7 +15161,7 @@ index 20370c6..a2eb9b0 100644
"popl %%ebp\n\t"
"popl %%edi\n\t"
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h
-index 5e5cd12..3d18208 100644
+index 5e5cd12..51cdc93 100644
--- a/arch/x86/include/asm/atomic.h
+++ b/arch/x86/include/asm/atomic.h
@@ -28,6 +28,17 @@ static inline int atomic_read(const atomic_t *v)
@@ -15465,12 +15430,9 @@ index 5e5cd12..3d18208 100644
/**
* __atomic_add_unless - add unless the number is already a given value
* @v: pointer of type atomic_t
-@@ -191,14 +337,27 @@ static inline int atomic_xchg(atomic_t *v, int new)
- * Atomically adds @a to @v, so long as @v was not already @u.
- * Returns the old value of @v.
+@@ -193,12 +339,25 @@ static inline int atomic_xchg(atomic_t *v, int new)
*/
--static inline int __atomic_add_unless(atomic_t *v, int a, int u)
-+static inline int __intentional_overflow(-1) __atomic_add_unless(atomic_t *v, int a, int u)
+ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
{
- int c, old;
+ int c, old, new;
@@ -16041,10 +16003,10 @@ index f8d273e..02f39f3 100644
#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
-index 0f4460b..fa1ee19 100644
+index 2ab1eb3..1e8cc5d 100644
--- a/arch/x86/include/asm/barrier.h
+++ b/arch/x86/include/asm/barrier.h
-@@ -107,7 +107,7 @@
+@@ -57,7 +57,7 @@
do { \
compiletime_assert_atomic_type(*p); \
smp_mb(); \
@@ -16053,7 +16015,7 @@ index 0f4460b..fa1ee19 100644
} while (0)
#define smp_load_acquire(p) \
-@@ -124,7 +124,7 @@ do { \
+@@ -74,7 +74,7 @@ do { \
do { \
compiletime_assert_atomic_type(*p); \
barrier(); \
@@ -16188,19 +16150,6 @@ index 48f99f1..d78ebf9 100644
#ifdef CONFIG_X86_VSMP
#ifdef CONFIG_SMP
-diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h
-index 9863ee3..4a1f8e1 100644
---- a/arch/x86/include/asm/cacheflush.h
-+++ b/arch/x86/include/asm/cacheflush.h
-@@ -27,7 +27,7 @@ static inline unsigned long get_page_memtype(struct page *pg)
- unsigned long pg_flags = pg->flags & _PGMT_MASK;
-
- if (pg_flags == _PGMT_DEFAULT)
-- return -1;
-+ return ~0UL;
- else if (pg_flags == _PGMT_WC)
- return _PAGE_CACHE_WC;
- else if (pg_flags == _PGMT_UC_MINUS)
diff --git a/arch/x86/include/asm/calling.h b/arch/x86/include/asm/calling.h
index 76659b6..72b8439 100644
--- a/arch/x86/include/asm/calling.h
@@ -16495,10 +16444,10 @@ index 59c6c40..5e0b22c 100644
struct compat_timespec {
compat_time_t tv_sec;
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
-index 0bb1335..8f1aec7 100644
+index aede2c3..40d7a8f 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
-@@ -207,7 +207,7 @@
+@@ -212,7 +212,7 @@
#define X86_FEATURE_PAUSEFILTER ( 8*32+13) /* AMD filtered pause intercept */
#define X86_FEATURE_PFTHRESHOLD ( 8*32+14) /* AMD pause filter threshold */
#define X86_FEATURE_VMMCALL ( 8*32+15) /* Prefer vmmcall to vmcall */
@@ -16507,7 +16456,7 @@ index 0bb1335..8f1aec7 100644
/* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */
#define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* {RD/WR}{FS/GS}BASE instructions*/
-@@ -215,7 +215,7 @@
+@@ -220,7 +220,7 @@
#define X86_FEATURE_BMI1 ( 9*32+ 3) /* 1st group bit manipulation extensions */
#define X86_FEATURE_HLE ( 9*32+ 4) /* Hardware Lock Elision */
#define X86_FEATURE_AVX2 ( 9*32+ 5) /* AVX2 instructions */
@@ -16516,7 +16465,7 @@ index 0bb1335..8f1aec7 100644
#define X86_FEATURE_BMI2 ( 9*32+ 8) /* 2nd group bit manipulation extensions */
#define X86_FEATURE_ERMS ( 9*32+ 9) /* Enhanced REP MOVSB/STOSB */
#define X86_FEATURE_INVPCID ( 9*32+10) /* Invalidate Processor Context ID */
-@@ -383,6 +383,7 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
+@@ -388,6 +388,7 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
#define cpu_has_cx16 boot_cpu_has(X86_FEATURE_CX16)
#define cpu_has_eager_fpu boot_cpu_has(X86_FEATURE_EAGER_FPU)
#define cpu_has_topoext boot_cpu_has(X86_FEATURE_TOPOEXT)
@@ -16524,7 +16473,7 @@ index 0bb1335..8f1aec7 100644
#if __GNUC__ >= 4
extern void warn_pre_alternatives(void);
-@@ -434,7 +435,8 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
+@@ -439,7 +440,8 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
#ifdef CONFIG_X86_DEBUG_STATIC_CPU_HAS
t_warn:
@@ -16534,7 +16483,7 @@ index 0bb1335..8f1aec7 100644
return false;
#endif
-@@ -454,7 +456,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
+@@ -459,7 +461,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
".section .discard,\"aw\",@progbits\n"
" .byte 0xff + (4f-3f) - (2b-1b)\n" /* size check */
".previous\n"
@@ -16543,7 +16492,7 @@ index 0bb1335..8f1aec7 100644
"3: movb $1,%0\n"
"4:\n"
".previous\n"
-@@ -491,7 +493,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
+@@ -496,7 +498,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
" .byte 2b - 1b\n" /* src len */
" .byte 4f - 3f\n" /* repl len */
".previous\n"
@@ -16552,7 +16501,7 @@ index 0bb1335..8f1aec7 100644
"3: .byte 0xe9\n .long %l[t_no] - 2b\n"
"4:\n"
".previous\n"
-@@ -524,7 +526,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
+@@ -529,7 +531,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
".section .discard,\"aw\",@progbits\n"
" .byte 0xff + (4f-3f) - (2b-1b)\n" /* size check */
".previous\n"
@@ -16561,7 +16510,7 @@ index 0bb1335..8f1aec7 100644
"3: movb $0,%0\n"
"4:\n"
".previous\n"
-@@ -538,7 +540,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
+@@ -543,7 +545,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
".section .discard,\"aw\",@progbits\n"
" .byte 0xff + (6f-5f) - (4b-3b)\n" /* size check */
".previous\n"
@@ -17055,11 +17004,11 @@ index b4c1f54..e290c08 100644
pagefault_enable();
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
-index 4615906..788c817 100644
+index 9662290..49ca5e5 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
-@@ -164,8 +164,8 @@ extern void setup_ioapic_dest(void);
- extern void enable_IO_APIC(void);
+@@ -160,8 +160,8 @@ static inline void unlock_vector_lock(void) {}
+ #endif /* CONFIG_X86_LOCAL_APIC */
/* Statistics */
-extern atomic_t irq_err_count;
@@ -17083,7 +17032,7 @@ index ccffa53..3c90c87 100644
extern struct legacy_pic *legacy_pic;
extern struct legacy_pic null_legacy_pic;
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
-index b8237d8..3e8864e 100644
+index 34a5b93..27e40a6 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -52,12 +52,12 @@ static inline void name(type val, volatile void __iomem *addr) \
@@ -17103,7 +17052,7 @@ index b8237d8..3e8864e 100644
build_mmio_write(writeb, "b", unsigned char, "q", :"memory")
build_mmio_write(writew, "w", unsigned short, "r", :"memory")
-@@ -109,7 +109,7 @@ build_mmio_write(writeq, "q", unsigned long, "r", :"memory")
+@@ -113,7 +113,7 @@ build_mmio_write(writeq, "q", unsigned long, "r", :"memory")
* this function
*/
@@ -17112,7 +17061,7 @@ index b8237d8..3e8864e 100644
{
return __pa(address);
}
-@@ -185,7 +185,7 @@ static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
+@@ -189,7 +189,7 @@ static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
return ioremap_nocache(offset, size);
}
@@ -17121,7 +17070,7 @@ index b8237d8..3e8864e 100644
extern void set_iounmap_nonlazy(void);
-@@ -195,6 +195,17 @@ extern void set_iounmap_nonlazy(void);
+@@ -199,6 +199,17 @@ extern void set_iounmap_nonlazy(void);
#include <linux/vmalloc.h>
@@ -17176,14 +17125,15 @@ index 4421b5d..8543006 100644
#define flush_insn_slot(p) do { } while (0)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
-index 6ed0c30..74fb6c3 100644
+index d89c6b8..e711c69 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
-@@ -51,6 +51,7 @@
+@@ -51,7 +51,7 @@
| X86_CR0_NW | X86_CR0_CD | X86_CR0_PG))
#define CR3_L_MODE_RESERVED_BITS 0xFFFFFF0000000000ULL
-+#define CR3_PCID_INVD (1UL << 63)
+-#define CR3_PCID_INVD (1UL << 63)
++#define CR3_PCID_INVD (1ULL << 63)
#define CR4_RESERVED_BITS \
(~(unsigned long)(X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD | X86_CR4_DE\
| X86_CR4_PSE | X86_CR4_PAE | X86_CR4_MCE \
@@ -17425,10 +17375,10 @@ index 876e74e..e20bfb1 100644
#ifdef CONFIG_SMP
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
-index 166af2a..648c200 100644
+index 4b75d59..8ffacb6 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
-@@ -28,6 +28,20 @@ void destroy_context(struct mm_struct *mm);
+@@ -27,6 +27,20 @@ void destroy_context(struct mm_struct *mm);
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
@@ -17449,7 +17399,7 @@ index 166af2a..648c200 100644
#ifdef CONFIG_SMP
if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK)
this_cpu_write(cpu_tlbstate.state, TLBSTATE_LAZY);
-@@ -38,16 +52,59 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
+@@ -37,16 +51,59 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk)
{
unsigned cpu = smp_processor_id();
@@ -17509,8 +17459,8 @@ index 166af2a..648c200 100644
trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL);
/* Stop flush ipis for the previous mm */
-@@ -56,9 +113,67 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
- /* Load the LDT, if the LDT is different: */
+@@ -64,9 +121,67 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
+ */
if (unlikely(prev->context.ldt != next->context.ldt))
load_LDT_nolock(&next->context);
+
@@ -17578,7 +17528,7 @@ index 166af2a..648c200 100644
this_cpu_write(cpu_tlbstate.state, TLBSTATE_OK);
BUG_ON(this_cpu_read(cpu_tlbstate.active_mm) != next);
-@@ -75,12 +190,29 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
+@@ -83,12 +198,29 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
* tlb flush IPI delivery. We must reload CR3
* to make sure to use no freed page tables.
*/
@@ -17725,7 +17675,7 @@ index 802dde3..9183e68 100644
#include <asm-generic/memory_model.h>
diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h
-index f408caf..4a0455e 100644
+index b3bebf9..e1f5d95 100644
--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
@@ -7,9 +7,9 @@
@@ -17741,7 +17691,7 @@ index f408caf..4a0455e 100644
unsigned long y = x - __START_KERNEL_map;
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
-index cd6e1610..70f4418 100644
+index 32444ae..1a1624b 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -560,7 +560,7 @@ static inline pmd_t __pmd(pmdval_t val)
@@ -18020,10 +17970,10 @@ index 81bb91b..9392125 100644
/*
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
-index aa97a07..5c53c32 100644
+index e8a5454..1539359 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
-@@ -46,6 +46,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
+@@ -47,6 +47,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
#ifndef __PAGETABLE_PUD_FOLDED
#define set_pgd(pgdp, pgd) native_set_pgd(pgdp, pgd)
@@ -18031,7 +17981,7 @@ index aa97a07..5c53c32 100644
#define pgd_clear(pgd) native_pgd_clear(pgd)
#endif
-@@ -83,12 +84,53 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
+@@ -84,12 +85,53 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
#define arch_end_context_switch(prev) do {} while(0)
@@ -18085,7 +18035,7 @@ index aa97a07..5c53c32 100644
static inline int pte_dirty(pte_t pte)
{
return pte_flags(pte) & _PAGE_DIRTY;
-@@ -155,6 +197,11 @@ static inline unsigned long pud_pfn(pud_t pud)
+@@ -161,6 +203,11 @@ static inline unsigned long pud_pfn(pud_t pud)
return (pud_val(pud) & PTE_PFN_MASK) >> PAGE_SHIFT;
}
@@ -18097,7 +18047,7 @@ index aa97a07..5c53c32 100644
#define pte_page(pte) pfn_to_page(pte_pfn(pte))
static inline int pmd_large(pmd_t pte)
-@@ -208,9 +255,29 @@ static inline pte_t pte_wrprotect(pte_t pte)
+@@ -214,9 +261,29 @@ static inline pte_t pte_wrprotect(pte_t pte)
return pte_clear_flags(pte, _PAGE_RW);
}
@@ -18128,7 +18078,7 @@ index aa97a07..5c53c32 100644
}
static inline pte_t pte_mkdirty(pte_t pte)
-@@ -440,6 +507,16 @@ pte_t *populate_extra_pte(unsigned long vaddr);
+@@ -446,6 +513,16 @@ pte_t *populate_extra_pte(unsigned long vaddr);
#endif
#ifndef __ASSEMBLY__
@@ -18145,7 +18095,7 @@ index aa97a07..5c53c32 100644
#include <linux/mm_types.h>
#include <linux/mmdebug.h>
#include <linux/log2.h>
-@@ -586,7 +663,7 @@ static inline unsigned long pud_page_vaddr(pud_t pud)
+@@ -592,7 +669,7 @@ static inline unsigned long pud_page_vaddr(pud_t pud)
* Currently stuck as a macro due to indirect forward reference to
* linux/mmzone.h's __section_mem_map_addr() definition:
*/
@@ -18154,7 +18104,7 @@ index aa97a07..5c53c32 100644
/* Find an entry in the second-level page table.. */
static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
-@@ -626,7 +703,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)
+@@ -632,7 +709,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)
* Currently stuck as a macro due to indirect forward reference to
* linux/mmzone.h's __section_mem_map_addr() definition:
*/
@@ -18163,7 +18113,7 @@ index aa97a07..5c53c32 100644
/* to find an entry in a page-table-directory. */
static inline unsigned long pud_index(unsigned long address)
-@@ -641,7 +718,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
+@@ -647,7 +724,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
static inline int pgd_bad(pgd_t pgd)
{
@@ -18172,7 +18122,7 @@ index aa97a07..5c53c32 100644
}
static inline int pgd_none(pgd_t pgd)
-@@ -664,7 +741,12 @@ static inline int pgd_none(pgd_t pgd)
+@@ -670,7 +747,12 @@ static inline int pgd_none(pgd_t pgd)
* pgd_offset() returns a (pgd_t *)
* pgd_index() is used get the offset into the pgd page's array of pgd_t's;
*/
@@ -18186,7 +18136,7 @@ index aa97a07..5c53c32 100644
/*
* a shortcut which implies the use of the kernel's pgd, instead
* of a process's
-@@ -675,6 +757,23 @@ static inline int pgd_none(pgd_t pgd)
+@@ -681,6 +763,23 @@ static inline int pgd_none(pgd_t pgd)
#define KERNEL_PGD_BOUNDARY pgd_index(PAGE_OFFSET)
#define KERNEL_PGD_PTRS (PTRS_PER_PGD - KERNEL_PGD_BOUNDARY)
@@ -18210,7 +18160,7 @@ index aa97a07..5c53c32 100644
#ifndef __ASSEMBLY__
extern int direct_gbpages;
-@@ -841,11 +940,24 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
+@@ -847,11 +946,24 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
* dst and src can be on the same page, but the range must not overlap,
* and must not cross a page boundary.
*/
@@ -18283,7 +18233,7 @@ index b6c0b40..3535d47 100644
* kern_addr_valid() is (1) for FLATMEM and (0) for
* SPARSEMEM and DISCONTIGMEM
diff --git a/arch/x86/include/asm/pgtable_32_types.h b/arch/x86/include/asm/pgtable_32_types.h
-index ed5903b..c7fe163 100644
+index 9fb2f2b..b04b4bf 100644
--- a/arch/x86/include/asm/pgtable_32_types.h
+++ b/arch/x86/include/asm/pgtable_32_types.h
@@ -8,7 +8,7 @@
@@ -18373,10 +18323,10 @@ index 4572b2f..4430113 100644
}
diff --git a/arch/x86/include/asm/pgtable_64_types.h b/arch/x86/include/asm/pgtable_64_types.h
-index 7166e25..baaa6fe 100644
+index 602b602..acb53ed 100644
--- a/arch/x86/include/asm/pgtable_64_types.h
+++ b/arch/x86/include/asm/pgtable_64_types.h
-@@ -61,9 +61,14 @@ typedef struct { pteval_t pte; } pte_t;
+@@ -61,11 +61,16 @@ typedef struct { pteval_t pte; } pte_t;
#define MODULES_VADDR (__START_KERNEL_map + KERNEL_IMAGE_SIZE)
#define MODULES_END _AC(0xffffffffff000000, UL)
#define MODULES_LEN (MODULES_END - MODULES_VADDR)
@@ -18384,6 +18334,8 @@ index 7166e25..baaa6fe 100644
+#define MODULES_EXEC_END MODULES_END
#define ESPFIX_PGD_ENTRY _AC(-2, UL)
#define ESPFIX_BASE_ADDR (ESPFIX_PGD_ENTRY << PGDIR_SHIFT)
+ #define EFI_VA_START ( -4 * (_AC(1, UL) << 30))
+ #define EFI_VA_END (-68 * (_AC(1, UL) << 30))
+#define ktla_ktva(addr) (addr)
+#define ktva_ktla(addr) (addr)
@@ -18392,7 +18344,7 @@ index 7166e25..baaa6fe 100644
#endif /* _ASM_X86_PGTABLE_64_DEFS_H */
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
-index 0778964..0e94758 100644
+index 25bcd4a..bf3f815 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -110,8 +110,10 @@
@@ -18407,7 +18359,7 @@ index 0778964..0e94758 100644
#endif
#define _PAGE_FILE (_AT(pteval_t, 1) << _PAGE_BIT_FILE)
-@@ -150,6 +152,9 @@
+@@ -167,6 +169,9 @@ enum page_cache_mode {
#define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | \
_PAGE_ACCESSED)
@@ -18417,16 +18369,16 @@ index 0778964..0e94758 100644
#define __PAGE_KERNEL_EXEC \
(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL)
#define __PAGE_KERNEL (__PAGE_KERNEL_EXEC | _PAGE_NX)
-@@ -160,7 +165,7 @@
- #define __PAGE_KERNEL_WC (__PAGE_KERNEL | _PAGE_CACHE_WC)
- #define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_PCD | _PAGE_PWT)
- #define __PAGE_KERNEL_UC_MINUS (__PAGE_KERNEL | _PAGE_PCD)
+@@ -174,7 +179,7 @@ enum page_cache_mode {
+ #define __PAGE_KERNEL_RO (__PAGE_KERNEL & ~_PAGE_RW)
+ #define __PAGE_KERNEL_RX (__PAGE_KERNEL_EXEC & ~_PAGE_RW)
+ #define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_NOCACHE)
-#define __PAGE_KERNEL_VSYSCALL (__PAGE_KERNEL_RX | _PAGE_USER)
+#define __PAGE_KERNEL_VSYSCALL (__PAGE_KERNEL_RO | _PAGE_USER)
#define __PAGE_KERNEL_VVAR (__PAGE_KERNEL_RO | _PAGE_USER)
- #define __PAGE_KERNEL_VVAR_NOCACHE (__PAGE_KERNEL_VVAR | _PAGE_PCD | _PAGE_PWT)
#define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE)
-@@ -217,7 +222,7 @@
+ #define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE)
+@@ -220,7 +225,7 @@ enum page_cache_mode {
#ifdef CONFIG_X86_64
#define __PAGE_KERNEL_IDENT_LARGE_EXEC __PAGE_KERNEL_LARGE_EXEC
#else
@@ -18435,7 +18387,7 @@ index 0778964..0e94758 100644
#define PDE_IDENT_ATTR 0x063 /* PRESENT+RW+DIRTY+ACCESSED */
#define PGD_IDENT_ATTR 0x001 /* PRESENT (no other attributes) */
#endif
-@@ -256,7 +261,17 @@ static inline pgdval_t pgd_flags(pgd_t pgd)
+@@ -259,7 +264,17 @@ static inline pgdval_t pgd_flags(pgd_t pgd)
{
return native_pgd_val(pgd) & PTE_FLAGS_MASK;
}
@@ -18453,7 +18405,7 @@ index 0778964..0e94758 100644
#if PAGETABLE_LEVELS > 3
typedef struct { pudval_t pud; } pud_t;
-@@ -270,8 +285,6 @@ static inline pudval_t native_pud_val(pud_t pud)
+@@ -273,8 +288,6 @@ static inline pudval_t native_pud_val(pud_t pud)
return pud.pud;
}
#else
@@ -18462,7 +18414,7 @@ index 0778964..0e94758 100644
static inline pudval_t native_pud_val(pud_t pud)
{
return native_pgd_val(pud.pgd);
-@@ -291,8 +304,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
+@@ -294,8 +307,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
return pmd.pmd;
}
#else
@@ -18471,7 +18423,7 @@ index 0778964..0e94758 100644
static inline pmdval_t native_pmd_val(pmd_t pmd)
{
return native_pgd_val(pmd.pud.pgd);
-@@ -346,7 +357,6 @@ typedef struct page *pgtable_t;
+@@ -402,7 +413,6 @@ typedef struct page *pgtable_t;
extern pteval_t __supported_pte_mask;
extern void set_nx(void);
@@ -18480,10 +18432,10 @@ index 0778964..0e94758 100644
#define pgprot_writecombine pgprot_writecombine
extern pgprot_t pgprot_writecombine(pgprot_t prot);
diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h
-index 4008734..48f0d81 100644
+index 8f327184..368fb29 100644
--- a/arch/x86/include/asm/preempt.h
+++ b/arch/x86/include/asm/preempt.h
-@@ -87,7 +87,7 @@ static __always_inline void __preempt_count_sub(int val)
+@@ -84,7 +84,7 @@ static __always_inline void __preempt_count_sub(int val)
*/
static __always_inline bool __preempt_count_dec_and_test(void)
{
@@ -18493,15 +18445,15 @@ index 4008734..48f0d81 100644
/*
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
-index eb71ec7..f06532a 100644
+index a092a0c..8e9640b 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -127,7 +127,7 @@ struct cpuinfo_x86 {
/* Index into per_cpu list: */
u16 cpu_index;
u32 microcode;
--} __attribute__((__aligned__(SMP_CACHE_BYTES)));
-+} __attribute__((__aligned__(SMP_CACHE_BYTES))) __randomize_layout;
+-};
++} __randomize_layout;
#define X86_VENDOR_INTEL 0
#define X86_VENDOR_CYRIX 1
@@ -18537,7 +18489,7 @@ index eb71ec7..f06532a 100644
/*
* Save the original ist values for checking stack pointers during debugging
-@@ -478,6 +490,7 @@ struct thread_struct {
+@@ -479,6 +491,7 @@ struct thread_struct {
unsigned short ds;
unsigned short fsindex;
unsigned short gsindex;
@@ -18545,7 +18497,7 @@ index eb71ec7..f06532a 100644
#endif
#ifdef CONFIG_X86_32
unsigned long ip;
-@@ -587,29 +600,8 @@ static inline void load_sp0(struct tss_struct *tss,
+@@ -588,29 +601,8 @@ static inline void load_sp0(struct tss_struct *tss,
extern unsigned long mmu_cr4_features;
extern u32 *trampoline_cr4_features;
@@ -18577,7 +18529,7 @@ index eb71ec7..f06532a 100644
typedef struct {
unsigned long seg;
-@@ -837,11 +829,18 @@ static inline void spin_lock_prefetch(const void *x)
+@@ -838,11 +830,18 @@ static inline void spin_lock_prefetch(const void *x)
*/
#define TASK_SIZE PAGE_OFFSET
#define TASK_SIZE_MAX TASK_SIZE
@@ -18598,7 +18550,7 @@ index eb71ec7..f06532a 100644
.vm86_info = NULL, \
.sysenter_cs = __KERNEL_CS, \
.io_bitmap_ptr = NULL, \
-@@ -855,7 +854,7 @@ static inline void spin_lock_prefetch(const void *x)
+@@ -856,7 +855,7 @@ static inline void spin_lock_prefetch(const void *x)
*/
#define INIT_TSS { \
.x86_tss = { \
@@ -18607,7 +18559,7 @@ index eb71ec7..f06532a 100644
.ss0 = __KERNEL_DS, \
.ss1 = __KERNEL_CS, \
.io_bitmap_base = INVALID_IO_BITMAP_OFFSET, \
-@@ -866,11 +865,7 @@ static inline void spin_lock_prefetch(const void *x)
+@@ -867,11 +866,7 @@ static inline void spin_lock_prefetch(const void *x)
extern unsigned long thread_saved_pc(struct task_struct *tsk);
#define THREAD_SIZE_LONGS (THREAD_SIZE/sizeof(unsigned long))
@@ -18620,7 +18572,7 @@ index eb71ec7..f06532a 100644
/*
* The below -8 is to reserve 8 bytes on top of the ring0 stack.
-@@ -885,7 +880,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
+@@ -886,7 +881,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
#define task_pt_regs(task) \
({ \
struct pt_regs *__regs__; \
@@ -18629,9 +18581,9 @@ index eb71ec7..f06532a 100644
__regs__ - 1; \
})
-@@ -895,13 +890,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
- /*
- * User space process size. 47bits minus one guard page.
+@@ -902,13 +897,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
+ * particular problem by preventing anything from being mapped
+ * at the maximum canonical address.
*/
-#define TASK_SIZE_MAX ((1UL << 47) - PAGE_SIZE)
+#define TASK_SIZE_MAX ((1UL << TASK_SIZE_MAX_SHIFT) - PAGE_SIZE)
@@ -18645,7 +18597,7 @@ index eb71ec7..f06532a 100644
#define TASK_SIZE (test_thread_flag(TIF_ADDR32) ? \
IA32_PAGE_OFFSET : TASK_SIZE_MAX)
-@@ -912,11 +907,11 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
+@@ -919,11 +914,11 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
#define STACK_TOP_MAX TASK_SIZE_MAX
#define INIT_THREAD { \
@@ -18659,7 +18611,7 @@ index eb71ec7..f06532a 100644
}
/*
-@@ -944,6 +939,10 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
+@@ -951,6 +946,10 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
*/
#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
@@ -18670,7 +18622,7 @@ index eb71ec7..f06532a 100644
#define KSTK_EIP(task) (task_pt_regs(task)->ip)
/* Get/set a process' ability to use the timestamp counter instruction */
-@@ -970,7 +969,7 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
+@@ -995,7 +994,7 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
return 0;
}
@@ -18679,7 +18631,7 @@ index eb71ec7..f06532a 100644
extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
void default_idle(void);
-@@ -980,6 +979,6 @@ bool xen_set_default_idle(void);
+@@ -1005,6 +1004,6 @@ bool xen_set_default_idle(void);
#define xen_set_default_idle 0
#endif
@@ -19056,10 +19008,10 @@ index cad82c9..2e5c5c1 100644
#endif /* __KERNEL__ */
diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
-index 6f1c3a8..7744f19 100644
+index db257a5..b91bc77 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
-@@ -64,10 +64,15 @@
+@@ -73,10 +73,15 @@
* 26 - ESPFIX small SS
* 27 - per-cpu [ offset to per-cpu data area ]
* 28 - stack_canary-20 [ for stack protector ]
@@ -19077,7 +19029,7 @@ index 6f1c3a8..7744f19 100644
#define GDT_ENTRY_TLS_MIN 6
#define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1)
-@@ -79,6 +84,8 @@
+@@ -88,6 +93,8 @@
#define GDT_ENTRY_KERNEL_CS (GDT_ENTRY_KERNEL_BASE+0)
@@ -19086,7 +19038,7 @@ index 6f1c3a8..7744f19 100644
#define GDT_ENTRY_KERNEL_DS (GDT_ENTRY_KERNEL_BASE+1)
#define GDT_ENTRY_TSS (GDT_ENTRY_KERNEL_BASE+4)
-@@ -104,6 +111,12 @@
+@@ -113,6 +120,12 @@
#define __KERNEL_STACK_CANARY 0
#endif
@@ -19099,7 +19051,7 @@ index 6f1c3a8..7744f19 100644
#define GDT_ENTRY_DOUBLEFAULT_TSS 31
/*
-@@ -141,7 +154,7 @@
+@@ -140,7 +153,7 @@
*/
/* Matches PNP_CS32 and PNP_CS16 (they must be consecutive) */
@@ -19108,7 +19060,7 @@ index 6f1c3a8..7744f19 100644
#else
-@@ -165,6 +178,8 @@
+@@ -164,6 +177,8 @@
#define __USER32_CS (GDT_ENTRY_DEFAULT_USER32_CS*8+3)
#define __USER32_DS __USER_DS
@@ -19117,7 +19069,7 @@ index 6f1c3a8..7744f19 100644
#define GDT_ENTRY_TSS 8 /* needs two entries */
#define GDT_ENTRY_LDT 10 /* needs two entries */
#define GDT_ENTRY_TLS_MIN 12
-@@ -173,6 +188,8 @@
+@@ -172,6 +187,8 @@
#define GDT_ENTRY_PER_CPU 15 /* Abused to load per CPU data from limit */
#define __PER_CPU_SEG (GDT_ENTRY_PER_CPU * 8 + 3)
@@ -19126,7 +19078,7 @@ index 6f1c3a8..7744f19 100644
/* TLS indexes for 64bit - hardcoded in arch_prctl */
#define FS_TLS 0
#define GS_TLS 1
-@@ -180,12 +197,14 @@
+@@ -179,12 +196,14 @@
#define GS_TLS_SEL ((GDT_ENTRY_TLS_MIN+GS_TLS)*8 + 3)
#define FS_TLS_SEL ((GDT_ENTRY_TLS_MIN+FS_TLS)*8 + 3)
@@ -19142,7 +19094,7 @@ index 6f1c3a8..7744f19 100644
#define __USER_DS (GDT_ENTRY_DEFAULT_USER_DS*8+3)
#define __USER_CS (GDT_ENTRY_DEFAULT_USER_CS*8+3)
#ifndef CONFIG_PARAVIRT
-@@ -268,7 +287,7 @@ static inline unsigned long get_limit(unsigned long segment)
+@@ -256,7 +275,7 @@ static inline unsigned long get_limit(unsigned long segment)
{
unsigned long __limit;
asm("lsll %1,%0" : "=r" (__limit) : "r" (segment));
@@ -19359,10 +19311,10 @@ index 70bbe39..4ae2bd4 100644
void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
diff --git a/arch/x86/include/asm/switch_to.h b/arch/x86/include/asm/switch_to.h
-index d7f3b3b..3cc39f1 100644
+index 751bf4b..a1278b5 100644
--- a/arch/x86/include/asm/switch_to.h
+++ b/arch/x86/include/asm/switch_to.h
-@@ -108,7 +108,7 @@ do { \
+@@ -112,7 +112,7 @@ do { \
"call __switch_to\n\t" \
"movq "__percpu_arg([current_task])",%%rsi\n\t" \
__switch_canary \
@@ -19371,7 +19323,7 @@ index d7f3b3b..3cc39f1 100644
"movq %%rax,%%rdi\n\t" \
"testl %[_tif_fork],%P[ti_flags](%%r8)\n\t" \
"jnz ret_from_fork\n\t" \
-@@ -119,7 +119,7 @@ do { \
+@@ -123,7 +123,7 @@ do { \
[threadrsp] "i" (offsetof(struct task_struct, thread.sp)), \
[ti_flags] "i" (offsetof(struct thread_info, flags)), \
[_tif_fork] "i" (_TIF_FORK), \
@@ -19605,7 +19557,7 @@ index 04905bf..1178cdf 100644
}
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
-index 0d592e0..526f797 100644
+index 0d592e0..7430aad 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -7,6 +7,7 @@
@@ -19872,6 +19824,15 @@ index 0d592e0..526f797 100644
} while (0)
#define put_user_try uaccess_try
+@@ -531,7 +606,7 @@ extern __must_check long strlen_user(const char __user *str);
+ extern __must_check long strnlen_user(const char __user *str, long n);
+
+ unsigned long __must_check clear_user(void __user *mem, unsigned long len);
+-unsigned long __must_check __clear_user(void __user *mem, unsigned long len);
++unsigned long __must_check __clear_user(void __user *mem, unsigned long len) __size_overflow(2);
+
+ extern void __cmpxchg_wrong_size(void)
+ __compiletime_error("Bad argument size for cmpxchg");
@@ -542,18 +617,19 @@ extern void __cmpxchg_wrong_size(void)
__typeof__(ptr) __uval = (uval); \
__typeof__(*(ptr)) __old = (old); \
@@ -20056,11 +20017,15 @@ index 0d592e0..526f797 100644
return n;
}
diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h
-index 3c03a5d..1071638 100644
+index 3c03a5d..edb68ae 100644
--- a/arch/x86/include/asm/uaccess_32.h
+++ b/arch/x86/include/asm/uaccess_32.h
-@@ -43,6 +43,11 @@ unsigned long __must_check __copy_from_user_ll_nocache_nozero
- static __always_inline unsigned long __must_check
+@@ -40,9 +40,14 @@ unsigned long __must_check __copy_from_user_ll_nocache_nozero
+ * anything, so this is accurate.
+ */
+
+-static __always_inline unsigned long __must_check
++static __always_inline __size_overflow(3) unsigned long __must_check
__copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
{
+ if ((long)n < 0)
@@ -20079,7 +20044,8 @@ index 3c03a5d..1071638 100644
return __copy_to_user_inatomic(to, from, n);
}
- static __always_inline unsigned long
+-static __always_inline unsigned long
++static __always_inline __size_overflow(3) unsigned long
__copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)
{
+ if ((long)n < 0)
@@ -20125,7 +20091,7 @@ index 3c03a5d..1071638 100644
#endif /* _ASM_X86_UACCESS_32_H */
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
-index 12a26b9..206c200 100644
+index 12a26b9..c36fff5 100644
--- a/arch/x86/include/asm/uaccess_64.h
+++ b/arch/x86/include/asm/uaccess_64.h
@@ -10,6 +10,9 @@
@@ -20138,21 +20104,13 @@ index 12a26b9..206c200 100644
/*
* Copy To/From Userspace
-@@ -17,14 +20,14 @@
-
- /* Handles exceptions in both to and from, but doesn't do access_ok */
- __must_check unsigned long
--copy_user_enhanced_fast_string(void *to, const void *from, unsigned len);
-+copy_user_enhanced_fast_string(void *to, const void *from, unsigned len) __size_overflow(3);
+@@ -23,8 +26,8 @@ copy_user_generic_string(void *to, const void *from, unsigned len);
__must_check unsigned long
--copy_user_generic_string(void *to, const void *from, unsigned len);
-+copy_user_generic_string(void *to, const void *from, unsigned len) __size_overflow(3);
- __must_check unsigned long
--copy_user_generic_unrolled(void *to, const void *from, unsigned len);
-+copy_user_generic_unrolled(void *to, const void *from, unsigned len) __size_overflow(3);
+ copy_user_generic_unrolled(void *to, const void *from, unsigned len);
- static __always_inline __must_check unsigned long
+-static __always_inline __must_check unsigned long
-copy_user_generic(void *to, const void *from, unsigned len)
++static __always_inline __must_check __size_overflow(3) unsigned long
+copy_user_generic(void *to, const void *from, unsigned long len)
{
unsigned ret;
@@ -20473,7 +20431,7 @@ index 5b238981..77fdd78 100644
#define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0x01), REPEAT_BYTE(0x80) }
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
-index e45e4da..44e8572 100644
+index f58a9c7..dc378042a 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -129,7 +129,7 @@ struct x86_init_ops {
@@ -20503,16 +20461,16 @@ index e45e4da..44e8572 100644
struct pci_dev;
struct msi_msg;
-@@ -185,7 +185,7 @@ struct x86_msi_ops {
+@@ -182,7 +182,7 @@ struct x86_msi_ops {
+ void (*teardown_msi_irqs)(struct pci_dev *dev);
+ void (*restore_msi_irqs)(struct pci_dev *dev);
int (*setup_hpet_msi)(unsigned int irq, unsigned int id);
- u32 (*msi_mask_irq)(struct msi_desc *desc, u32 mask, u32 flag);
- u32 (*msix_mask_irq)(struct msi_desc *desc, u32 flag);
-};
+} __no_const;
struct IO_APIC_route_entry;
struct io_apic_irq_attr;
-@@ -206,7 +206,7 @@ struct x86_io_apic_ops {
+@@ -203,7 +203,7 @@ struct x86_io_apic_ops {
unsigned int destination, int vector,
struct io_apic_irq_attr *attr);
void (*eoi_ioapic_pin)(int apic, int pin, int vector);
@@ -20522,23 +20480,23 @@ index e45e4da..44e8572 100644
extern struct x86_init_ops x86_init;
extern struct x86_cpuinit_ops x86_cpuinit;
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
-index f58ef6c..a2abc78 100644
+index 5eea099..ff7ef8d 100644
--- a/arch/x86/include/asm/xen/page.h
+++ b/arch/x86/include/asm/xen/page.h
-@@ -63,7 +63,7 @@ extern int m2p_remove_override(struct page *page,
- extern struct page *m2p_find_override(unsigned long mfn);
- extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn);
-
--static inline unsigned long pfn_to_mfn(unsigned long pfn)
-+static inline unsigned long __intentional_overflow(-1) pfn_to_mfn(unsigned long pfn)
+@@ -83,7 +83,7 @@ static inline int xen_safe_read_ulong(unsigned long *addr, unsigned long *val)
+ * - get_phys_to_machine() is to be called by __pfn_to_mfn() only in special
+ * cases needing an extended handling.
+ */
+-static inline unsigned long __pfn_to_mfn(unsigned long pfn)
++static inline unsigned long __intentional_overflow(-1) __pfn_to_mfn(unsigned long pfn)
{
unsigned long mfn;
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
-index 7e7a79a..0824666 100644
+index 5fa9770..2b49d6c 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
-@@ -228,12 +228,16 @@ static inline int xsave_user(struct xsave_struct __user *buf)
+@@ -229,12 +229,16 @@ static inline int xsave_user(struct xsave_struct __user *buf)
if (unlikely(err))
return -EFAULT;
@@ -20556,7 +20514,7 @@ index 7e7a79a..0824666 100644
return err;
}
-@@ -243,16 +247,20 @@ static inline int xsave_user(struct xsave_struct __user *buf)
+@@ -244,16 +248,20 @@ static inline int xsave_user(struct xsave_struct __user *buf)
static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask)
{
int err = 0;
@@ -20605,7 +20563,7 @@ index 7b0a55a..ad115bf 100644
/* top of stack page */
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
-index 8f1e774..9b4c381 100644
+index 5d4502c..a567e09 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -24,7 +24,7 @@ obj-y += time.o ioport.o ldt.o dumpstack.o nmi.o
@@ -20618,10 +20576,10 @@ index 8f1e774..9b4c381 100644
obj-$(CONFIG_X86_64) += mcount_64.o
obj-y += syscall_$(BITS).o vsyscall_gtod.o
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
-index a3eadfd..56fdd27 100644
+index b5ddc96..490b4e4 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -1282,7 +1282,7 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
+@@ -1351,7 +1351,7 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
* If your system is blacklisted here, but you find that acpi=force
* works for you, please contact linux-acpi@vger.kernel.org
*/
@@ -20630,7 +20588,7 @@ index a3eadfd..56fdd27 100644
/*
* Boxes that need ACPI disabled
*/
-@@ -1357,7 +1357,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
+@@ -1426,7 +1426,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
};
/* second table for DMI checks that should run after early-quirks */
@@ -20844,10 +20802,10 @@ index 703130f..27a155d 100644
bp_int3_handler = handler;
bp_int3_addr = (u8 *)addr + sizeof(int3);
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
-index ba6cc04..06fd971 100644
+index 29b5b18..3bdfc29 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
-@@ -201,7 +201,7 @@ int first_system_vector = 0xfe;
+@@ -201,7 +201,7 @@ int first_system_vector = FIRST_SYSTEM_VECTOR;
/*
* Debug level, exported for io_apic.c
*/
@@ -20856,7 +20814,7 @@ index ba6cc04..06fd971 100644
int pic_mode;
-@@ -1989,7 +1989,7 @@ static inline void __smp_error_interrupt(struct pt_regs *regs)
+@@ -1991,7 +1991,7 @@ static inline void __smp_error_interrupt(struct pt_regs *regs)
apic_write(APIC_ESR, 0);
v = apic_read(APIC_ESR);
ack_APIC_irq();
@@ -20914,29 +20872,11 @@ index c4a8d63..fe893ac 100644
.name = "bigsmp",
.probe = probe_bigsmp,
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
-index 1183d54..6158e47 100644
+index 3f5f604..309c0e6 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
-@@ -1230,7 +1230,7 @@ out:
- }
- EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector);
-
--void lock_vector_lock(void)
-+void lock_vector_lock(void) __acquires(vector_lock)
- {
- /* Used to the online set of cpus does not change
- * during assign_irq_vector.
-@@ -1238,7 +1238,7 @@ void lock_vector_lock(void)
- raw_spin_lock(&vector_lock);
- }
-
--void unlock_vector_lock(void)
-+void unlock_vector_lock(void) __releases(vector_lock)
- {
- raw_spin_unlock(&vector_lock);
- }
-@@ -2465,7 +2465,7 @@ static void ack_apic_edge(struct irq_data *data)
- ack_APIC_irq();
+@@ -1859,7 +1859,7 @@ int native_ioapic_set_affinity(struct irq_data *data,
+ return ret;
}
-atomic_t irq_mis_count;
@@ -20944,7 +20884,7 @@ index 1183d54..6158e47 100644
#ifdef CONFIG_GENERIC_PENDING_IRQ
static bool io_apic_level_ack_pending(struct irq_cfg *cfg)
-@@ -2606,7 +2606,7 @@ static void ack_apic_level(struct irq_data *data)
+@@ -2000,7 +2000,7 @@ static void ack_ioapic_level(struct irq_data *data)
* at the cpu.
*/
if (!(v & (1 << (i & 0x1f)))) {
@@ -20966,6 +20906,28 @@ index bda4886..f9c7195 100644
.name = "default",
.probe = probe_default,
+diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
+index 6cedd79..023ff8e 100644
+--- a/arch/x86/kernel/apic/vector.c
++++ b/arch/x86/kernel/apic/vector.c
+@@ -21,7 +21,7 @@
+
+ static DEFINE_RAW_SPINLOCK(vector_lock);
+
+-void lock_vector_lock(void)
++void lock_vector_lock(void) __acquires(vector_lock)
+ {
+ /* Used to the online set of cpus does not change
+ * during assign_irq_vector.
+@@ -29,7 +29,7 @@ void lock_vector_lock(void)
+ raw_spin_lock(&vector_lock);
+ }
+
+-void unlock_vector_lock(void)
++void unlock_vector_lock(void) __releases(vector_lock)
+ {
+ raw_spin_unlock(&vector_lock);
+ }
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
index e658f21..b695a1a 100644
--- a/arch/x86/kernel/apic/x2apic_cluster.c
@@ -21015,10 +20977,10 @@ index 8e9dcfd..c61b3e4 100644
.name = "UV large system",
.probe = uv_probe,
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
-index 5848744..56cb598 100644
+index 927ec92..0dc3bd4 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
-@@ -433,7 +433,7 @@ static DEFINE_MUTEX(apm_mutex);
+@@ -432,7 +432,7 @@ static DEFINE_MUTEX(apm_mutex);
* This is for buggy BIOS's that refer to (real mode) segment 0x40
* even though they are called in protected mode.
*/
@@ -21027,7 +20989,7 @@ index 5848744..56cb598 100644
(unsigned long)__va(0x400UL), PAGE_SIZE - 0x400 - 1);
static const char driver_version[] = "1.16ac"; /* no spaces */
-@@ -611,7 +611,10 @@ static long __apm_bios_call(void *_call)
+@@ -610,7 +610,10 @@ static long __apm_bios_call(void *_call)
BUG_ON(cpu != 0);
gdt = get_cpu_gdt_table(cpu);
save_desc_40 = gdt[0x40 / 8];
@@ -21038,7 +21000,7 @@ index 5848744..56cb598 100644
apm_irq_save(flags);
APM_DO_SAVE_SEGS;
-@@ -620,7 +623,11 @@ static long __apm_bios_call(void *_call)
+@@ -619,7 +622,11 @@ static long __apm_bios_call(void *_call)
&call->esi);
APM_DO_RESTORE_SEGS;
apm_irq_restore(flags);
@@ -21050,7 +21012,7 @@ index 5848744..56cb598 100644
put_cpu();
return call->eax & 0xff;
-@@ -687,7 +694,10 @@ static long __apm_bios_call_simple(void *_call)
+@@ -686,7 +693,10 @@ static long __apm_bios_call_simple(void *_call)
BUG_ON(cpu != 0);
gdt = get_cpu_gdt_table(cpu);
save_desc_40 = gdt[0x40 / 8];
@@ -21061,7 +21023,7 @@ index 5848744..56cb598 100644
apm_irq_save(flags);
APM_DO_SAVE_SEGS;
-@@ -695,7 +705,11 @@ static long __apm_bios_call_simple(void *_call)
+@@ -694,7 +704,11 @@ static long __apm_bios_call_simple(void *_call)
&call->eax);
APM_DO_RESTORE_SEGS;
apm_irq_restore(flags);
@@ -21073,7 +21035,7 @@ index 5848744..56cb598 100644
put_cpu();
return error;
}
-@@ -2350,12 +2364,15 @@ static int __init apm_init(void)
+@@ -2349,12 +2363,15 @@ static int __init apm_init(void)
* code to that CPU.
*/
gdt = get_cpu_gdt_table(0);
@@ -21130,10 +21092,10 @@ index 9f6b934..cf5ffb3 100644
BLANK();
OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
-index e7c798b..2b2019b 100644
+index fdcbb4d..036dd93 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
-@@ -77,6 +77,7 @@ int main(void)
+@@ -80,6 +80,7 @@ int main(void)
BLANK();
#undef ENTRY
@@ -21157,10 +21119,10 @@ index 80091ae..0c5184f 100644
obj-y += common.o
obj-y += rdrand.o
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
-index 813d29d..6e542d4 100644
+index 15c5df9..d9a604a 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -718,7 +718,7 @@ static void init_amd(struct cpuinfo_x86 *c)
+@@ -717,7 +717,7 @@ static void init_amd(struct cpuinfo_x86 *c)
static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size)
{
/* AMD errata T13 (order #21922) */
@@ -21170,7 +21132,7 @@ index 813d29d..6e542d4 100644
if (c->x86_model == 3 && c->x86_mask == 0)
size = 64;
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
-index cfa9b5b..19b5084 100644
+index c604965..0b0e28a 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -90,60 +90,6 @@ static const struct cpu_dev default_cpu = {
@@ -21325,7 +21287,7 @@ index cfa9b5b..19b5084 100644
/* If the model name is still unset, do table lookup. */
if (!c->x86_model_id[0]) {
const char *p;
-@@ -985,7 +992,7 @@ static void syscall32_cpu_init(void)
+@@ -977,7 +984,7 @@ static void syscall32_cpu_init(void)
void enable_sep_cpu(void)
{
int cpu = get_cpu();
@@ -21334,7 +21296,7 @@ index cfa9b5b..19b5084 100644
if (!boot_cpu_has(X86_FEATURE_SEP)) {
put_cpu();
-@@ -1125,14 +1132,16 @@ static __init int setup_disablecpuid(char *arg)
+@@ -1115,14 +1122,16 @@ static __init int setup_disablecpuid(char *arg)
}
__setup("clearcpuid=", setup_disablecpuid);
@@ -21355,7 +21317,7 @@ index cfa9b5b..19b5084 100644
DEFINE_PER_CPU_FIRST(union irq_stack_union,
irq_stack_union) __aligned(PAGE_SIZE) __visible;
-@@ -1309,7 +1318,7 @@ void cpu_init(void)
+@@ -1299,7 +1308,7 @@ void cpu_init(void)
*/
load_ucode_ap();
@@ -21364,7 +21326,7 @@ index cfa9b5b..19b5084 100644
oist = &per_cpu(orig_ist, cpu);
#ifdef CONFIG_NUMA
-@@ -1341,7 +1350,6 @@ void cpu_init(void)
+@@ -1331,7 +1340,6 @@ void cpu_init(void)
wrmsrl(MSR_KERNEL_GS_BASE, 0);
barrier();
@@ -21372,7 +21334,7 @@ index cfa9b5b..19b5084 100644
enable_x2apic();
/*
-@@ -1393,7 +1401,7 @@ void cpu_init(void)
+@@ -1383,7 +1391,7 @@ void cpu_init(void)
{
int cpu = smp_processor_id();
struct task_struct *curr = current;
@@ -21473,7 +21435,7 @@ index c703507..28535e3 100644
"index%1lu", i);
if (unlikely(retval)) {
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
-index 61a9668ce..b446a37 100644
+index d2c6116..62fd7aa 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -45,6 +45,7 @@
@@ -21497,12 +21459,12 @@ index 61a9668ce..b446a37 100644
#define PANIC_TIMEOUT 5 /* 5 seconds */
--static atomic_t mce_paniced;
-+static atomic_unchecked_t mce_paniced;
+-static atomic_t mce_panicked;
++static atomic_unchecked_t mce_panicked;
static int fake_panic;
--static atomic_t mce_fake_paniced;
-+static atomic_unchecked_t mce_fake_paniced;
+-static atomic_t mce_fake_panicked;
++static atomic_unchecked_t mce_fake_panicked;
/* Panic in progress. Enable interrupts and wait for final IPI */
static void wait_for_panic(void)
@@ -21510,8 +21472,8 @@ index 61a9668ce..b446a37 100644
/*
* Make sure only one CPU runs in machine check panic
*/
-- if (atomic_inc_return(&mce_paniced) > 1)
-+ if (atomic_inc_return_unchecked(&mce_paniced) > 1)
+- if (atomic_inc_return(&mce_panicked) > 1)
++ if (atomic_inc_return_unchecked(&mce_panicked) > 1)
wait_for_panic();
barrier();
@@ -21519,8 +21481,8 @@ index 61a9668ce..b446a37 100644
console_verbose();
} else {
/* Don't log too much for fake panic */
-- if (atomic_inc_return(&mce_fake_paniced) > 1)
-+ if (atomic_inc_return_unchecked(&mce_fake_paniced) > 1)
+- if (atomic_inc_return(&mce_fake_panicked) > 1)
++ if (atomic_inc_return_unchecked(&mce_fake_panicked) > 1)
return;
}
/* First print corrected ones that are still unlogged */
@@ -21533,16 +21495,16 @@ index 61a9668ce..b446a37 100644
} else
pr_emerg(HW_ERR "Fake kernel panic: %s\n", msg);
}
-@@ -697,7 +698,7 @@ static int mce_timed_out(u64 *t)
+@@ -744,7 +745,7 @@ static int mce_timed_out(u64 *t)
* might have been modified by someone else.
*/
rmb();
-- if (atomic_read(&mce_paniced))
-+ if (atomic_read_unchecked(&mce_paniced))
+- if (atomic_read(&mce_panicked))
++ if (atomic_read_unchecked(&mce_panicked))
wait_for_panic();
if (!mca_cfg.monarch_timeout)
goto out;
-@@ -1674,7 +1675,7 @@ static void unexpected_machine_check(struct pt_regs *regs, long error_code)
+@@ -1722,7 +1723,7 @@ static void unexpected_machine_check(struct pt_regs *regs, long error_code)
}
/* Call the installed machine check handler for this CPU setup. */
@@ -21551,7 +21513,7 @@ index 61a9668ce..b446a37 100644
unexpected_machine_check;
/*
-@@ -1697,7 +1698,9 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)
+@@ -1745,7 +1746,9 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)
return;
}
@@ -21561,7 +21523,7 @@ index 61a9668ce..b446a37 100644
__mcheck_cpu_init_generic();
__mcheck_cpu_init_vendor(c);
-@@ -1711,7 +1714,7 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)
+@@ -1759,7 +1762,7 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)
*/
static DEFINE_SPINLOCK(mce_chrdev_state_lock);
@@ -21570,7 +21532,7 @@ index 61a9668ce..b446a37 100644
static int mce_chrdev_open_exclu; /* already open exclusive? */
static int mce_chrdev_open(struct inode *inode, struct file *file)
-@@ -1719,7 +1722,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
+@@ -1767,7 +1770,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
spin_lock(&mce_chrdev_state_lock);
if (mce_chrdev_open_exclu ||
@@ -21579,7 +21541,7 @@ index 61a9668ce..b446a37 100644
spin_unlock(&mce_chrdev_state_lock);
return -EBUSY;
-@@ -1727,7 +1730,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
+@@ -1775,7 +1778,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
if (file->f_flags & O_EXCL)
mce_chrdev_open_exclu = 1;
@@ -21588,7 +21550,7 @@ index 61a9668ce..b446a37 100644
spin_unlock(&mce_chrdev_state_lock);
-@@ -1738,7 +1741,7 @@ static int mce_chrdev_release(struct inode *inode, struct file *file)
+@@ -1786,7 +1789,7 @@ static int mce_chrdev_release(struct inode *inode, struct file *file)
{
spin_lock(&mce_chrdev_state_lock);
@@ -21597,7 +21559,7 @@ index 61a9668ce..b446a37 100644
mce_chrdev_open_exclu = 0;
spin_unlock(&mce_chrdev_state_lock);
-@@ -2413,7 +2416,7 @@ static __init void mce_init_banks(void)
+@@ -2461,7 +2464,7 @@ static __init void mce_init_banks(void)
for (i = 0; i < mca_cfg.banks; i++) {
struct mce_bank *b = &mce_banks[i];
@@ -21606,12 +21568,12 @@ index 61a9668ce..b446a37 100644
sysfs_attr_init(&a->attr);
a->attr.name = b->attrname;
-@@ -2520,7 +2523,7 @@ struct dentry *mce_get_debugfs_dir(void)
+@@ -2568,7 +2571,7 @@ struct dentry *mce_get_debugfs_dir(void)
static void mce_reset(void)
{
cpu_missing = 0;
-- atomic_set(&mce_fake_paniced, 0);
-+ atomic_set_unchecked(&mce_fake_paniced, 0);
+- atomic_set(&mce_fake_panicked, 0);
++ atomic_set_unchecked(&mce_fake_panicked, 0);
atomic_set(&mce_executing, 0);
atomic_set(&mce_callin, 0);
atomic_set(&global_nwo, 0);
@@ -21788,10 +21750,10 @@ index 143e5f5..5825081 100644
}
diff --git a/arch/x86/kernel/cpu/perf_event_amd_iommu.c b/arch/x86/kernel/cpu/perf_event_amd_iommu.c
-index 639d128..e92d7e5 100644
+index 97242a9..cf9c30e 100644
--- a/arch/x86/kernel/cpu/perf_event_amd_iommu.c
+++ b/arch/x86/kernel/cpu/perf_event_amd_iommu.c
-@@ -405,7 +405,7 @@ static void perf_iommu_del(struct perf_event *event, int flags)
+@@ -402,7 +402,7 @@ static void perf_iommu_del(struct perf_event *event, int flags)
static __init int _init_events_attrs(struct perf_amd_iommu *perf_iommu)
{
struct attribute **attrs;
@@ -21819,10 +21781,10 @@ index 498b6d9..4126515 100644
intel_ds_init();
diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
-index 8c25674..30aa32e 100644
+index c4bb8b8..9f7384d 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
-@@ -449,7 +449,7 @@ static struct attribute *rapl_events_hsw_attr[] = {
+@@ -465,7 +465,7 @@ static struct attribute *rapl_events_hsw_attr[] = {
NULL,
};
@@ -21832,10 +21794,10 @@ index 8c25674..30aa32e 100644
.attrs = NULL, /* patched at runtime */
};
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
-index e98f68c..1992b15 100644
+index c635b8b..b78835e 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
-@@ -737,7 +737,7 @@ static void __init uncore_types_exit(struct intel_uncore_type **types)
+@@ -733,7 +733,7 @@ static void __init uncore_types_exit(struct intel_uncore_type **types)
static int __init uncore_type_init(struct intel_uncore_type *type)
{
struct intel_uncore_pmu *pmus;
@@ -21845,7 +21807,7 @@ index e98f68c..1992b15 100644
int i, j;
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.h b/arch/x86/kernel/cpu/perf_event_intel_uncore.h
-index 863d9b0..6289b63 100644
+index 6c8c1e7..515b98a 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.h
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.h
@@ -114,7 +114,7 @@ struct intel_uncore_box {
@@ -21858,7 +21820,7 @@ index 863d9b0..6289b63 100644
ssize_t uncore_event_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf);
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
-index 3225ae6c..ee3c6db 100644
+index 83741a7..bd3507d 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -170,7 +170,7 @@ static int cpuid_class_cpu_callback(struct notifier_block *nfb,
@@ -21871,10 +21833,10 @@ index 3225ae6c..ee3c6db 100644
.notifier_call = cpuid_class_cpu_callback,
};
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
-index f5ab56d..d3b201a 100644
+index aceb2f9..c76d3e3 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
-@@ -104,7 +104,7 @@ static void kdump_nmi_callback(int cpu, struct pt_regs *regs)
+@@ -105,7 +105,7 @@ static void kdump_nmi_callback(int cpu, struct pt_regs *regs)
#ifdef CONFIG_X86_32
struct pt_regs fixed_regs;
@@ -22303,7 +22265,7 @@ index ff86f19..73eabf4 100644
+EXPORT_SYMBOL(pax_check_alloca);
+#endif
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
-index 49f8864..1cc6d07 100644
+index dd2f07a..845dc05 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -802,8 +802,8 @@ unsigned long __init e820_end_of_low_ram_pfn(void)
@@ -22330,7 +22292,7 @@ index 01d1c18..8073693 100644
#include <asm/processor.h>
#include <asm/fcntl.h>
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
-index 344b63f..55adf14 100644
+index 000d419..8f66802 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -177,13 +177,154 @@
@@ -23106,7 +23068,7 @@ index 344b63f..55adf14 100644
#endif
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
-index c0226ab..386eb53 100644
+index 9ebaf63..c786610 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -59,6 +59,8 @@
@@ -23893,9 +23855,18 @@ index c0226ab..386eb53 100644
-END(stub_execve)
+ENDPROC(stub_execve)
+ ENTRY(stub_execveat)
+ CFI_STARTPROC
+@@ -664,7 +1133,7 @@ ENTRY(stub_execveat)
+ RESTORE_REST
+ jmp int_ret_from_sys_call
+ CFI_ENDPROC
+-END(stub_execveat)
++ENDPROC(stub_execveat)
+
/*
* sigreturn is special because it needs to restore all registers on return.
-@@ -667,7 +1136,7 @@ ENTRY(stub_rt_sigreturn)
+@@ -681,7 +1150,7 @@ ENTRY(stub_rt_sigreturn)
RESTORE_REST
jmp int_ret_from_sys_call
CFI_ENDPROC
@@ -23904,7 +23875,7 @@ index c0226ab..386eb53 100644
#ifdef CONFIG_X86_X32_ABI
ENTRY(stub_x32_rt_sigreturn)
-@@ -681,7 +1150,7 @@ ENTRY(stub_x32_rt_sigreturn)
+@@ -695,7 +1164,7 @@ ENTRY(stub_x32_rt_sigreturn)
RESTORE_REST
jmp int_ret_from_sys_call
CFI_ENDPROC
@@ -23913,16 +23884,7 @@ index c0226ab..386eb53 100644
ENTRY(stub_x32_execve)
CFI_STARTPROC
-@@ -695,7 +1164,7 @@ ENTRY(stub_x32_execve)
- RESTORE_REST
- jmp int_ret_from_sys_call
- CFI_ENDPROC
--END(stub_x32_execve)
-+ENDPROC(stub_x32_execve)
-
- #endif
-
-@@ -732,7 +1201,7 @@ vector=vector+1
+@@ -760,7 +1229,7 @@ vector=vector+1
2: jmp common_interrupt
.endr
CFI_ENDPROC
@@ -23931,7 +23893,7 @@ index c0226ab..386eb53 100644
.previous
END(interrupt)
-@@ -749,8 +1218,8 @@ END(interrupt)
+@@ -777,8 +1246,8 @@ END(interrupt)
/* 0(%rsp): ~(interrupt number) */
.macro interrupt func
/* reserve pt_regs for scratch regs and rbp */
@@ -23942,7 +23904,7 @@ index c0226ab..386eb53 100644
SAVE_ARGS_IRQ
call \func
.endm
-@@ -773,14 +1242,14 @@ ret_from_intr:
+@@ -801,14 +1270,14 @@ ret_from_intr:
/* Restore saved previous stack */
popq %rsi
@@ -23961,7 +23923,7 @@ index c0226ab..386eb53 100644
je retint_kernel
/* Interrupt came from user space */
-@@ -802,12 +1271,35 @@ retint_swapgs: /* return to user-space */
+@@ -830,12 +1299,35 @@ retint_swapgs: /* return to user-space */
* The iretq could re-enable interrupts:
*/
DISABLE_INTERRUPTS(CLBR_ANY)
@@ -23997,7 +23959,7 @@ index c0226ab..386eb53 100644
/*
* The iretq could re-enable interrupts:
*/
-@@ -845,15 +1337,15 @@ native_irq_return_ldt:
+@@ -873,15 +1365,15 @@ native_irq_return_ldt:
SWAPGS
movq PER_CPU_VAR(espfix_waddr),%rdi
movq %rax,(0*8)(%rdi) /* RAX */
@@ -24018,7 +23980,7 @@ index c0226ab..386eb53 100644
movq %rax,(4*8)(%rdi)
andl $0xffff0000,%eax
popq_cfi %rdi
-@@ -907,7 +1399,7 @@ ENTRY(retint_kernel)
+@@ -935,7 +1427,7 @@ ENTRY(retint_kernel)
jmp exit_intr
#endif
CFI_ENDPROC
@@ -24027,7 +23989,7 @@ index c0226ab..386eb53 100644
/*
* APIC interrupts.
-@@ -921,7 +1413,7 @@ ENTRY(\sym)
+@@ -949,7 +1441,7 @@ ENTRY(\sym)
interrupt \do_sym
jmp ret_from_intr
CFI_ENDPROC
@@ -24036,7 +23998,7 @@ index c0226ab..386eb53 100644
.endm
#ifdef CONFIG_TRACING
-@@ -994,7 +1486,7 @@ apicinterrupt IRQ_WORK_VECTOR \
+@@ -1022,7 +1514,7 @@ apicinterrupt IRQ_WORK_VECTOR \
/*
* Exception entry points.
*/
@@ -24045,7 +24007,7 @@ index c0226ab..386eb53 100644
.macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1
ENTRY(\sym)
-@@ -1045,6 +1537,12 @@ ENTRY(\sym)
+@@ -1073,6 +1565,12 @@ ENTRY(\sym)
.endif
.if \shift_ist != -1
@@ -24058,7 +24020,7 @@ index c0226ab..386eb53 100644
subq $EXCEPTION_STKSZ, INIT_TSS_IST(\shift_ist)
.endif
-@@ -1061,7 +1559,7 @@ ENTRY(\sym)
+@@ -1089,7 +1587,7 @@ ENTRY(\sym)
.endif
CFI_ENDPROC
@@ -24067,7 +24029,7 @@ index c0226ab..386eb53 100644
.endm
#ifdef CONFIG_TRACING
-@@ -1102,9 +1600,10 @@ gs_change:
+@@ -1130,9 +1628,10 @@ gs_change:
2: mfence /* workaround */
SWAPGS
popfq_cfi
@@ -24079,7 +24041,7 @@ index c0226ab..386eb53 100644
_ASM_EXTABLE(gs_change,bad_gs)
.section .fixup,"ax"
-@@ -1132,9 +1631,10 @@ ENTRY(do_softirq_own_stack)
+@@ -1160,9 +1659,10 @@ ENTRY(do_softirq_own_stack)
CFI_DEF_CFA_REGISTER rsp
CFI_ADJUST_CFA_OFFSET -8
decl PER_CPU_VAR(irq_count)
@@ -24091,7 +24053,7 @@ index c0226ab..386eb53 100644
#ifdef CONFIG_XEN
idtentry xen_hypervisor_callback xen_do_hypervisor_callback has_error_code=0
-@@ -1172,7 +1672,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs)
+@@ -1200,7 +1700,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs)
decl PER_CPU_VAR(irq_count)
jmp error_exit
CFI_ENDPROC
@@ -24100,7 +24062,7 @@ index c0226ab..386eb53 100644
/*
* Hypervisor uses this for application faults while it executes.
-@@ -1231,7 +1731,7 @@ ENTRY(xen_failsafe_callback)
+@@ -1259,7 +1759,7 @@ ENTRY(xen_failsafe_callback)
SAVE_ALL
jmp error_exit
CFI_ENDPROC
@@ -24109,7 +24071,7 @@ index c0226ab..386eb53 100644
apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \
xen_hvm_callback_vector xen_evtchn_do_upcall
-@@ -1278,18 +1778,33 @@ ENTRY(paranoid_exit)
+@@ -1306,18 +1806,33 @@ ENTRY(paranoid_exit)
DEFAULT_FRAME
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF_DEBUG
@@ -24145,7 +24107,7 @@ index c0226ab..386eb53 100644
jmp irq_return
paranoid_userspace:
GET_THREAD_INFO(%rcx)
-@@ -1318,7 +1833,7 @@ paranoid_schedule:
+@@ -1346,7 +1861,7 @@ paranoid_schedule:
TRACE_IRQS_OFF
jmp paranoid_userspace
CFI_ENDPROC
@@ -24154,7 +24116,7 @@ index c0226ab..386eb53 100644
/*
* Exception entry point. This expects an error code/orig_rax on the stack.
-@@ -1345,12 +1860,23 @@ ENTRY(error_entry)
+@@ -1373,12 +1888,23 @@ ENTRY(error_entry)
movq %r14, R14+8(%rsp)
movq %r15, R15+8(%rsp)
xorl %ebx,%ebx
@@ -24179,7 +24141,7 @@ index c0226ab..386eb53 100644
ret
/*
-@@ -1385,7 +1911,7 @@ error_bad_iret:
+@@ -1413,7 +1939,7 @@ error_bad_iret:
decl %ebx /* Return to usergs */
jmp error_sti
CFI_ENDPROC
@@ -24188,7 +24150,7 @@ index c0226ab..386eb53 100644
/* ebx: no swapgs flag (1: don't need swapgs, 0: need it) */
-@@ -1396,7 +1922,7 @@ ENTRY(error_exit)
+@@ -1424,7 +1950,7 @@ ENTRY(error_exit)
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF
GET_THREAD_INFO(%rcx)
@@ -24197,7 +24159,7 @@ index c0226ab..386eb53 100644
jne retint_kernel
LOCKDEP_SYS_EXIT_IRQ
movl TI_flags(%rcx),%edx
-@@ -1405,7 +1931,7 @@ ENTRY(error_exit)
+@@ -1433,7 +1959,7 @@ ENTRY(error_exit)
jnz retint_careful
jmp retint_swapgs
CFI_ENDPROC
@@ -24206,7 +24168,7 @@ index c0226ab..386eb53 100644
/*
* Test if a given stack is an NMI stack or not.
-@@ -1463,9 +1989,11 @@ ENTRY(nmi)
+@@ -1491,9 +2017,11 @@ ENTRY(nmi)
* If %cs was not the kernel segment, then the NMI triggered in user
* space, which means it is definitely not nested.
*/
@@ -24219,7 +24181,7 @@ index c0226ab..386eb53 100644
/*
* Check the special variable on the stack to see if NMIs are
* executing.
-@@ -1499,8 +2027,7 @@ nested_nmi:
+@@ -1527,8 +2055,7 @@ nested_nmi:
1:
/* Set up the interrupted NMIs stack to jump to repeat_nmi */
@@ -24229,7 +24191,7 @@ index c0226ab..386eb53 100644
CFI_ADJUST_CFA_OFFSET 1*8
leaq -10*8(%rsp), %rdx
pushq_cfi $__KERNEL_DS
-@@ -1518,6 +2045,7 @@ nested_nmi_out:
+@@ -1546,6 +2073,7 @@ nested_nmi_out:
CFI_RESTORE rdx
/* No need to check faults here */
@@ -24237,7 +24199,7 @@ index c0226ab..386eb53 100644
INTERRUPT_RETURN
CFI_RESTORE_STATE
-@@ -1614,13 +2142,13 @@ end_repeat_nmi:
+@@ -1642,13 +2170,13 @@ end_repeat_nmi:
subq $ORIG_RAX-R15, %rsp
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
/*
@@ -24253,7 +24215,7 @@ index c0226ab..386eb53 100644
DEFAULT_FRAME 0
/*
-@@ -1630,9 +2158,9 @@ end_repeat_nmi:
+@@ -1658,9 +2186,9 @@ end_repeat_nmi:
* NMI itself takes a page fault, the page fault that was preempted
* will read the information from the NMI page fault and not the
* origin fault. Save it off and restore it if it changes.
@@ -24265,7 +24227,7 @@ index c0226ab..386eb53 100644
/* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */
movq %rsp,%rdi
-@@ -1641,29 +2169,34 @@ end_repeat_nmi:
+@@ -1669,29 +2197,34 @@ end_repeat_nmi:
/* Did the NMI take a page fault? Restore cr2 if it did */
movq %cr2, %rcx
@@ -24306,7 +24268,7 @@ index c0226ab..386eb53 100644
+ENDPROC(ignore_sysret)
diff --git a/arch/x86/kernel/espfix_64.c b/arch/x86/kernel/espfix_64.c
-index 94d857f..5bce89c 100644
+index f5d0730..5bce89c 100644
--- a/arch/x86/kernel/espfix_64.c
+++ b/arch/x86/kernel/espfix_64.c
@@ -70,8 +70,7 @@ static DEFINE_MUTEX(espfix_init_mutex);
@@ -24319,13 +24281,10 @@ index 94d857f..5bce89c 100644
static unsigned int page_random, slot_random;
-@@ -122,14 +121,17 @@ static void init_espfix_random(void)
+@@ -122,11 +121,17 @@ static void init_espfix_random(void)
void __init init_espfix_bsp(void)
{
pgd_t *pgd_p;
-- pteval_t ptemask;
--
-- ptemask = __supported_pte_mask;
+ unsigned long index = pgd_index(ESPFIX_BASE_ADDR);
/* Install the espfix pud into the kernel page directory */
@@ -24341,7 +24300,7 @@ index 94d857f..5bce89c 100644
/* Randomize the locations */
init_espfix_random();
-@@ -197,7 +199,7 @@ void init_espfix_ap(void)
+@@ -194,7 +199,7 @@ void init_espfix_ap(void)
set_pte(&pte_p[n*PTE_STRIDE], pte);
/* Job is done for this CPU and any CPU which shares this page */
@@ -24351,10 +24310,10 @@ index 94d857f..5bce89c 100644
unlock_done:
mutex_unlock(&espfix_init_mutex);
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
-index 3386dc9..28bdf81 100644
+index 8b7b0a5..2395f29 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
-@@ -88,7 +88,7 @@ static unsigned long text_ip_addr(unsigned long ip)
+@@ -89,7 +89,7 @@ static unsigned long text_ip_addr(unsigned long ip)
* kernel identity mapping to modify code.
*/
if (within(ip, (unsigned long)_text, (unsigned long)_etext))
@@ -24363,7 +24322,7 @@ index 3386dc9..28bdf81 100644
return ip;
}
-@@ -104,6 +104,8 @@ ftrace_modify_code_direct(unsigned long ip, unsigned const char *old_code,
+@@ -105,6 +105,8 @@ ftrace_modify_code_direct(unsigned long ip, unsigned const char *old_code,
{
unsigned char replaced[MCOUNT_INSN_SIZE];
@@ -24372,7 +24331,7 @@ index 3386dc9..28bdf81 100644
/*
* Note: Due to modules and __init, code can
* disappear and change, we need to protect against faulting
-@@ -229,7 +231,7 @@ static int update_ftrace_func(unsigned long ip, void *new)
+@@ -230,7 +232,7 @@ static int update_ftrace_func(unsigned long ip, void *new)
unsigned char old[MCOUNT_INSN_SIZE];
int ret;
@@ -24381,7 +24340,7 @@ index 3386dc9..28bdf81 100644
ftrace_update_func = ip;
/* Make sure the breakpoints see the ftrace_update_func update */
-@@ -310,7 +312,7 @@ static int add_break(unsigned long ip, const char *old)
+@@ -311,7 +313,7 @@ static int add_break(unsigned long ip, const char *old)
unsigned char replaced[MCOUNT_INSN_SIZE];
unsigned char brk = BREAKPOINT_INSTRUCTION;
@@ -25276,7 +25235,7 @@ index 4ddaf66..49d5c18 100644
regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | (level << 12);
t->iopl = level << 12;
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
-index 3790775..53717dc 100644
+index 705ef8d..8672c9d 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -22,7 +22,7 @@
@@ -25290,7 +25249,7 @@ index 3790775..53717dc 100644
void (*x86_platform_ipi_callback)(void) = NULL;
@@ -132,9 +132,9 @@ int arch_show_interrupts(struct seq_file *p, int prec)
seq_printf(p, "%10u ", irq_stats(j)->irq_hv_callback_count);
- seq_printf(p, " Hypervisor callback interrupts\n");
+ seq_puts(p, " Hypervisor callback interrupts\n");
#endif
- seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
+ seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read_unchecked(&irq_err_count));
@@ -25608,7 +25567,7 @@ index 7ec1d5f..5a7d130 100644
}
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
-index 93d2c04..36d0e94 100644
+index 98f654d..ac04352 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -120,9 +120,12 @@ __synthesize_relative_insn(void *from, void *to, u8 op)
@@ -25646,7 +25605,7 @@ index 93d2c04..36d0e94 100644
}
/*
-@@ -336,7 +339,9 @@ int __copy_instruction(u8 *dest, u8 *src)
+@@ -338,7 +341,9 @@ int __copy_instruction(u8 *dest, u8 *src)
/* Another subsystem puts a breakpoint, failed to recover */
if (insn.opcode.bytes[0] == BREAKPOINT_INSTRUCTION)
return 0;
@@ -25656,7 +25615,7 @@ index 93d2c04..36d0e94 100644
#ifdef CONFIG_X86_64
if (insn_rip_relative(&insn)) {
-@@ -363,7 +368,9 @@ int __copy_instruction(u8 *dest, u8 *src)
+@@ -365,7 +370,9 @@ int __copy_instruction(u8 *dest, u8 *src)
return 0;
}
disp = (u8 *) dest + insn_offset_displacement(&insn);
@@ -25666,7 +25625,7 @@ index 93d2c04..36d0e94 100644
}
#endif
return insn.length;
-@@ -505,7 +512,7 @@ static void setup_singlestep(struct kprobe *p, struct pt_regs *regs,
+@@ -507,7 +514,7 @@ static void setup_singlestep(struct kprobe *p, struct pt_regs *regs,
* nor set current_kprobe, because it doesn't use single
* stepping.
*/
@@ -25675,7 +25634,7 @@ index 93d2c04..36d0e94 100644
preempt_enable_no_resched();
return;
}
-@@ -522,9 +529,9 @@ static void setup_singlestep(struct kprobe *p, struct pt_regs *regs,
+@@ -524,9 +531,9 @@ static void setup_singlestep(struct kprobe *p, struct pt_regs *regs,
regs->flags &= ~X86_EFLAGS_IF;
/* single step inline if the instruction is an int3 */
if (p->opcode == BREAKPOINT_INSTRUCTION)
@@ -25687,7 +25646,7 @@ index 93d2c04..36d0e94 100644
}
NOKPROBE_SYMBOL(setup_singlestep);
-@@ -574,7 +581,7 @@ int kprobe_int3_handler(struct pt_regs *regs)
+@@ -576,7 +583,7 @@ int kprobe_int3_handler(struct pt_regs *regs)
struct kprobe *p;
struct kprobe_ctlblk *kcb;
@@ -25696,7 +25655,7 @@ index 93d2c04..36d0e94 100644
return 0;
addr = (kprobe_opcode_t *)(regs->ip - sizeof(kprobe_opcode_t));
-@@ -609,7 +616,7 @@ int kprobe_int3_handler(struct pt_regs *regs)
+@@ -611,7 +618,7 @@ int kprobe_int3_handler(struct pt_regs *regs)
setup_singlestep(p, regs, kcb, 0);
return 1;
}
@@ -25705,7 +25664,7 @@ index 93d2c04..36d0e94 100644
/*
* The breakpoint instruction was removed right
* after we hit it. Another cpu has removed
-@@ -656,6 +663,9 @@ static void __used kretprobe_trampoline_holder(void)
+@@ -658,6 +665,9 @@ static void __used kretprobe_trampoline_holder(void)
" movq %rax, 152(%rsp)\n"
RESTORE_REGS_STRING
" popfq\n"
@@ -25715,7 +25674,7 @@ index 93d2c04..36d0e94 100644
#else
" pushf\n"
SAVE_REGS_STRING
-@@ -796,7 +806,7 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs,
+@@ -798,7 +808,7 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb)
{
unsigned long *tos = stack_addr(regs);
@@ -25724,7 +25683,7 @@ index 93d2c04..36d0e94 100644
unsigned long orig_ip = (unsigned long)p->addr;
kprobe_opcode_t *insn = p->ainsn.insn;
-@@ -979,7 +989,7 @@ int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val,
+@@ -981,7 +991,7 @@ int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val,
struct die_args *args = data;
int ret = NOTIFY_DONE;
@@ -25734,7 +25693,7 @@ index 93d2c04..36d0e94 100644
if (val == DIE_GPF) {
diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c
-index f1314d0..15f3154 100644
+index 7c523bb..01b051b 100644
--- a/arch/x86/kernel/kprobes/opt.c
+++ b/arch/x86/kernel/kprobes/opt.c
@@ -79,6 +79,7 @@ found:
@@ -25753,7 +25712,7 @@ index f1314d0..15f3154 100644
}
asm (
-@@ -337,7 +339,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
+@@ -339,7 +341,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
* Verify if the address gap is in 2GB range, because this uses
* a relative jump.
*/
@@ -25762,7 +25721,7 @@ index f1314d0..15f3154 100644
if (abs(rel) > 0x7fffffff) {
__arch_remove_optimized_kprobe(op, 0);
return -ERANGE;
-@@ -354,16 +356,18 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
+@@ -356,16 +358,18 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
op->optinsn.size = ret;
/* Copy arch-dep-instance from template */
@@ -25784,7 +25743,7 @@ index f1314d0..15f3154 100644
(u8 *)op->kp.addr + op->optinsn.size);
flush_icache_range((unsigned long) buf,
-@@ -388,7 +392,7 @@ void arch_optimize_kprobes(struct list_head *oplist)
+@@ -390,7 +394,7 @@ void arch_optimize_kprobes(struct list_head *oplist)
WARN_ON(kprobe_disabled(&op->kp));
/* Backup instructions which will be replaced by jump address */
@@ -25793,7 +25752,7 @@ index f1314d0..15f3154 100644
RELATIVE_ADDR_SIZE);
insn_buf[0] = RELATIVEJUMP_OPCODE;
-@@ -436,7 +440,7 @@ int setup_detour_execution(struct kprobe *p, struct pt_regs *regs, int reenter)
+@@ -438,7 +442,7 @@ int setup_detour_execution(struct kprobe *p, struct pt_regs *regs, int reenter)
/* This kprobe is really able to run optimized path. */
op = container_of(p, struct optimized_kprobe, kp);
/* Detour through copied instructions */
@@ -25884,10 +25843,10 @@ index c37886d..d851d32 100644
error = -EINVAL;
goto out_unlock;
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
-index 72e8e31..f2f1605 100644
+index 469b23d..5449cfe 100644
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
-@@ -25,7 +25,7 @@
+@@ -26,7 +26,7 @@
#include <asm/cacheflush.h>
#include <asm/debugreg.h>
@@ -25896,7 +25855,7 @@ index 72e8e31..f2f1605 100644
{
struct desc_ptr curidt;
-@@ -37,7 +37,7 @@ static void set_idt(void *newidt, __u16 limit)
+@@ -38,7 +38,7 @@ static void set_idt(void *newidt, __u16 limit)
}
@@ -25905,7 +25864,7 @@ index 72e8e31..f2f1605 100644
{
struct desc_ptr curgdt;
-@@ -215,7 +215,7 @@ void machine_kexec(struct kimage *image)
+@@ -216,7 +216,7 @@ void machine_kexec(struct kimage *image)
}
control_page = page_address(image->control_code_page);
@@ -25915,7 +25874,7 @@ index 72e8e31..f2f1605 100644
relocate_kernel_ptr = control_page;
page_list[PA_CONTROL_PAGE] = __pa(control_page);
diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S
-index c73aecf..4c63630 100644
+index 94ea120..4154cea 100644
--- a/arch/x86/kernel/mcount_64.S
+++ b/arch/x86/kernel/mcount_64.S
@@ -7,7 +7,7 @@
@@ -25927,7 +25886,7 @@ index c73aecf..4c63630 100644
.code64
.section .entry.text, "ax"
-@@ -24,8 +24,9 @@
+@@ -148,8 +148,9 @@
#ifdef CONFIG_DYNAMIC_FTRACE
ENTRY(function_hook)
@@ -25936,9 +25895,9 @@ index c73aecf..4c63630 100644
-END(function_hook)
+ENDPROC(function_hook)
- /* skip is set if stack has been adjusted */
- .macro ftrace_caller_setup skip=0
-@@ -62,8 +63,9 @@ GLOBAL(ftrace_graph_call)
+ ENTRY(ftrace_caller)
+ /* save_mcount_regs fills in first two parameters */
+@@ -181,8 +182,9 @@ GLOBAL(ftrace_graph_call)
#endif
GLOBAL(ftrace_stub)
@@ -25948,17 +25907,17 @@ index c73aecf..4c63630 100644
+ENDPROC(ftrace_caller)
ENTRY(ftrace_regs_caller)
- /* Save the current flags before compare (in SS location)*/
-@@ -127,7 +129,7 @@ GLOBAL(ftrace_regs_call)
- popfq
- jmp ftrace_stub
+ /* Save the current flags before any operations that can change them */
+@@ -253,7 +255,7 @@ GLOBAL(ftrace_regs_caller_end)
+
+ jmp ftrace_return
-END(ftrace_regs_caller)
+ENDPROC(ftrace_regs_caller)
#else /* ! CONFIG_DYNAMIC_FTRACE */
-@@ -145,6 +147,7 @@ ENTRY(function_hook)
+@@ -272,18 +274,20 @@ fgraph_trace:
#endif
GLOBAL(ftrace_stub)
@@ -25966,24 +25925,23 @@ index c73aecf..4c63630 100644
retq
trace:
-@@ -158,12 +161,13 @@ trace:
- #endif
- subq $MCOUNT_INSN_SIZE, %rdi
+ /* save_mcount_regs fills in first two parameters */
+ save_mcount_regs
+ pax_force_fptr ftrace_trace_function
call *ftrace_trace_function
- MCOUNT_RESTORE_FRAME
+ restore_mcount_regs
- jmp ftrace_stub
+ jmp fgraph_trace
-END(function_hook)
+ENDPROC(function_hook)
#endif /* CONFIG_DYNAMIC_FTRACE */
#endif /* CONFIG_FUNCTION_TRACER */
-@@ -185,8 +189,9 @@ ENTRY(ftrace_graph_caller)
+@@ -305,8 +309,9 @@ ENTRY(ftrace_graph_caller)
- MCOUNT_RESTORE_FRAME
+ restore_mcount_regs
+ pax_force_retaddr
retq
@@ -25992,7 +25950,7 @@ index c73aecf..4c63630 100644
GLOBAL(return_to_handler)
subq $24, %rsp
-@@ -202,5 +207,7 @@ GLOBAL(return_to_handler)
+@@ -322,5 +327,7 @@ GLOBAL(return_to_handler)
movq 8(%rsp), %rdx
movq (%rsp), %rax
addq $24, %rsp
@@ -26001,7 +25959,7 @@ index c73aecf..4c63630 100644
+ENDPROC(return_to_handler)
#endif
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
-index e69f988..da078ea 100644
+index e69f988..72902b7 100644
--- a/arch/x86/kernel/module.c
+++ b/arch/x86/kernel/module.c
@@ -81,17 +81,62 @@ static unsigned long int get_module_load_offset(void)
@@ -26048,17 +26006,17 @@ index e69f988..da078ea 100644
+}
+EXPORT_SYMBOL(module_alloc_exec);
+
-+void module_free_exec(struct module *mod, void *module_region)
++void module_memfree_exec(void *module_region)
+{
+ vunmap(module_region);
+}
-+EXPORT_SYMBOL(module_free_exec);
++EXPORT_SYMBOL(module_memfree_exec);
+#else
-+void module_free_exec(struct module *mod, void *module_region)
++void module_memfree_exec(void *module_region)
+{
-+ module_free(mod, module_region);
++ module_memfree(module_region);
+}
-+EXPORT_SYMBOL(module_free_exec);
++EXPORT_SYMBOL(module_memfree_exec);
+
+void *module_alloc_exec(unsigned long size)
+{
@@ -26141,10 +26099,10 @@ index e69f988..da078ea 100644
if ((s64)val != *(s32 *)loc)
goto overflow;
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
-index c9603ac..9f88728 100644
+index 113e707..0a690e1 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
-@@ -37,6 +37,7 @@
+@@ -39,6 +39,7 @@
#include <linux/notifier.h>
#include <linux/uaccess.h>
#include <linux/gfp.h>
@@ -26152,7 +26110,7 @@ index c9603ac..9f88728 100644
#include <asm/processor.h>
#include <asm/msr.h>
-@@ -103,6 +104,11 @@ static ssize_t msr_write(struct file *file, const char __user *buf,
+@@ -105,6 +106,11 @@ static ssize_t msr_write(struct file *file, const char __user *buf,
int err = 0;
ssize_t bytes = 0;
@@ -26164,7 +26122,7 @@ index c9603ac..9f88728 100644
if (count % 8)
return -EINVAL; /* Invalid chunk size */
-@@ -150,6 +156,10 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg)
+@@ -152,6 +158,10 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg)
err = -EBADF;
break;
}
@@ -26175,7 +26133,7 @@ index c9603ac..9f88728 100644
if (copy_from_user(&regs, uregs, sizeof regs)) {
err = -EFAULT;
break;
-@@ -233,7 +243,7 @@ static int msr_class_cpu_callback(struct notifier_block *nfb,
+@@ -235,7 +245,7 @@ static int msr_class_cpu_callback(struct notifier_block *nfb,
return notifier_from_errno(err);
}
@@ -26994,10 +26952,10 @@ index 2f355d2..e75ed0a 100644
return ret;
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
-index 17962e6..47f55db 100644
+index bae6c60..b438619 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
-@@ -69,6 +69,11 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
+@@ -70,6 +70,11 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
void __noreturn machine_real_restart(unsigned int type)
{
@@ -27009,7 +26967,7 @@ index 17962e6..47f55db 100644
local_irq_disable();
/*
-@@ -96,7 +101,29 @@ void __noreturn machine_real_restart(unsigned int type)
+@@ -97,7 +102,29 @@ void __noreturn machine_real_restart(unsigned int type)
/* Jump to the identity-mapped low memory code */
#ifdef CONFIG_X86_32
@@ -27040,7 +26998,7 @@ index 17962e6..47f55db 100644
"rm" (real_mode_header->machine_real_restart_asm),
"a" (type));
#else
-@@ -500,7 +527,7 @@ void __attribute__((weak)) mach_reboot_fixups(void)
+@@ -501,7 +528,7 @@ void __attribute__((weak)) mach_reboot_fixups(void)
* This means that this function can never return, it can misbehave
* by not rebooting properly and hanging.
*/
@@ -27049,7 +27007,7 @@ index 17962e6..47f55db 100644
{
int i;
int attempt = 0;
-@@ -620,13 +647,13 @@ void native_machine_shutdown(void)
+@@ -621,13 +648,13 @@ void native_machine_shutdown(void)
#endif
}
@@ -27065,7 +27023,7 @@ index 17962e6..47f55db 100644
{
pr_notice("machine restart\n");
-@@ -635,7 +662,7 @@ static void native_machine_restart(char *__unused)
+@@ -636,7 +663,7 @@ static void native_machine_restart(char *__unused)
__machine_emergency_restart(0);
}
@@ -27074,7 +27032,7 @@ index 17962e6..47f55db 100644
{
/* Stop other cpus and apics */
machine_shutdown();
-@@ -645,7 +672,7 @@ static void native_machine_halt(void)
+@@ -646,7 +673,7 @@ static void native_machine_halt(void)
stop_this_cpu(NULL);
}
@@ -27083,7 +27041,7 @@ index 17962e6..47f55db 100644
{
if (pm_power_off) {
if (!reboot_force)
-@@ -654,9 +681,10 @@ static void native_machine_power_off(void)
+@@ -655,9 +682,10 @@ static void native_machine_power_off(void)
}
/* A fallback in case there is no PM info available */
tboot_shutdown(TB_SHUTDOWN_HALT);
@@ -27123,7 +27081,7 @@ index 3fd2c69..a444264 100644
identity_mapped:
/* set return address to 0 if not preserving context */
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
-index ab08aa2..6d74a3a 100644
+index ab4734e..c4ca0eb 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -110,6 +110,7 @@
@@ -27219,7 +27177,7 @@ index ab08aa2..6d74a3a 100644
early_reserve_initrd();
-@@ -955,14 +998,14 @@ void __init setup_arch(char **cmdline_p)
+@@ -955,16 +998,16 @@ void __init setup_arch(char **cmdline_p)
if (!boot_params.hdr.root_flags)
root_mountflags &= ~MS_RDONLY;
@@ -27230,6 +27188,8 @@ index ab08aa2..6d74a3a 100644
init_mm.end_data = (unsigned long) _edata;
init_mm.brk = _brk_end;
+ mpx_mm_init(&init_mm);
+
- code_resource.start = __pa_symbol(_text);
- code_resource.end = __pa_symbol(_etext)-1;
- data_resource.start = __pa_symbol(_etext);
@@ -27240,7 +27200,7 @@ index ab08aa2..6d74a3a 100644
bss_resource.start = __pa_symbol(__bss_start);
bss_resource.end = __pa_symbol(__bss_stop)-1;
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
-index 5cdff03..80fa283 100644
+index e4fcb87..9c06c55 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -21,19 +21,17 @@
@@ -27259,7 +27219,7 @@ index 5cdff03..80fa283 100644
-#define BOOT_PERCPU_OFFSET 0
-#endif
- DEFINE_PER_CPU(unsigned long, this_cpu_off) = BOOT_PERCPU_OFFSET;
+ DEFINE_PER_CPU_READ_MOSTLY(unsigned long, this_cpu_off) = BOOT_PERCPU_OFFSET;
EXPORT_PER_CPU_SYMBOL(this_cpu_off);
-unsigned long __per_cpu_offset[NR_CPUS] __read_mostly = {
@@ -27409,7 +27369,7 @@ index be8e1bd..a3d93fa 100644
.smp_prepare_cpus = native_smp_prepare_cpus,
.smp_cpus_done = native_smp_cpus_done,
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
-index 668d8f2..84a9d54 100644
+index 6d7022c..4feb6be 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -194,14 +194,17 @@ static void notrace start_secondary(void *unused)
@@ -27854,7 +27814,7 @@ index 91a4496..bb87552 100644
#ifdef CONFIG_DEBUG_FS
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c
-index 0fa2960..91eabbe 100644
+index 25adc0e..1df4349 100644
--- a/arch/x86/kernel/time.c
+++ b/arch/x86/kernel/time.c
@@ -30,9 +30,9 @@ unsigned long profile_pc(struct pt_regs *regs)
@@ -27931,10 +27891,10 @@ index 1c113db..287b42e 100644
static int trace_irq_vector_refcount;
static DEFINE_MUTEX(irq_vector_mutex);
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
-index 07ab8e9..99c8456 100644
+index 88900e2..aa4149d 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
-@@ -67,7 +67,7 @@
+@@ -68,7 +68,7 @@
#include <asm/proto.h>
/* No need to be aligned, but done to keep all IDTs defined the same way. */
@@ -27943,7 +27903,7 @@ index 07ab8e9..99c8456 100644
#else
#include <asm/processor-flags.h>
#include <asm/setup.h>
-@@ -76,7 +76,7 @@ asmlinkage int system_call(void);
+@@ -77,7 +77,7 @@ asmlinkage int system_call(void);
#endif
/* Must be page-aligned because the real IDT is used in a fixmap. */
@@ -27952,7 +27912,7 @@ index 07ab8e9..99c8456 100644
DECLARE_BITMAP(used_vectors, NR_VECTORS);
EXPORT_SYMBOL_GPL(used_vectors);
-@@ -108,11 +108,11 @@ static inline void preempt_conditional_cli(struct pt_regs *regs)
+@@ -109,11 +109,11 @@ static inline void preempt_conditional_cli(struct pt_regs *regs)
}
static nokprobe_inline int
@@ -27966,7 +27926,7 @@ index 07ab8e9..99c8456 100644
/*
* Traps 0, 1, 3, 4, and 5 should be forwarded to vm86.
* On nmi (interrupt 2), do_trap should not be called.
-@@ -125,12 +125,24 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str,
+@@ -126,12 +126,24 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str,
return -1;
}
#endif
@@ -27992,7 +27952,7 @@ index 07ab8e9..99c8456 100644
return 0;
}
-@@ -169,7 +181,7 @@ static siginfo_t *fill_trap_info(struct pt_regs *regs, int signr, int trapnr,
+@@ -170,7 +182,7 @@ static siginfo_t *fill_trap_info(struct pt_regs *regs, int signr, int trapnr,
}
static void
@@ -28001,7 +27961,7 @@ index 07ab8e9..99c8456 100644
long error_code, siginfo_t *info)
{
struct task_struct *tsk = current;
-@@ -193,7 +205,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
+@@ -194,7 +206,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
if (show_unhandled_signals && unhandled_signal(tsk, signr) &&
printk_ratelimit()) {
pr_info("%s[%d] trap %s ip:%lx sp:%lx error:%lx",
@@ -28022,7 +27982,7 @@ index 07ab8e9..99c8456 100644
#ifdef CONFIG_DOUBLEFAULT
df_debug(regs, error_code);
#endif
-@@ -296,7 +313,7 @@ do_general_protection(struct pt_regs *regs, long error_code)
+@@ -379,7 +396,7 @@ do_general_protection(struct pt_regs *regs, long error_code)
conditional_sti(regs);
#ifdef CONFIG_X86_32
@@ -28031,7 +27991,7 @@ index 07ab8e9..99c8456 100644
local_irq_enable();
handle_vm86_fault((struct kernel_vm86_regs *) regs, error_code);
goto exit;
-@@ -304,18 +321,42 @@ do_general_protection(struct pt_regs *regs, long error_code)
+@@ -387,18 +404,42 @@ do_general_protection(struct pt_regs *regs, long error_code)
#endif
tsk = current;
@@ -28076,7 +28036,7 @@ index 07ab8e9..99c8456 100644
tsk->thread.error_code = error_code;
tsk->thread.trap_nr = X86_TRAP_GP;
-@@ -427,13 +468,16 @@ struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
+@@ -510,13 +551,16 @@ struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
container_of(task_pt_regs(current),
struct bad_iret_stack, regs);
@@ -28094,7 +28054,7 @@ index 07ab8e9..99c8456 100644
return new_stack;
}
NOKPROBE_SYMBOL(fixup_bad_iret);
-@@ -519,7 +563,7 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code)
+@@ -602,7 +646,7 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code)
/* It's safe to allow irq's after DR6 has been saved */
preempt_conditional_sti(regs);
@@ -28103,7 +28063,7 @@ index 07ab8e9..99c8456 100644
handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code,
X86_TRAP_DB);
preempt_conditional_cli(regs);
-@@ -534,7 +578,7 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code)
+@@ -617,7 +661,7 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code)
* We already checked v86 mode above, so we can check for kernel mode
* by just checking the CPL of CS.
*/
@@ -28112,7 +28072,7 @@ index 07ab8e9..99c8456 100644
tsk->thread.debugreg6 &= ~DR_STEP;
set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
regs->flags &= ~X86_EFLAGS_TF;
-@@ -567,7 +611,7 @@ static void math_error(struct pt_regs *regs, int error_code, int trapnr)
+@@ -650,7 +694,7 @@ static void math_error(struct pt_regs *regs, int error_code, int trapnr)
return;
conditional_sti(regs);
@@ -28135,7 +28095,7 @@ index 5054497..139f8f8 100644
/*
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
-index 5d1cbfe..2a21feb 100644
+index 8b96a94..792b410 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -845,7 +845,7 @@ int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val,
@@ -28237,7 +28197,7 @@ index e8edcf5..27f9344 100644
goto cannot_handle;
if ((segoffs >> 16) == BIOSSEG)
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
-index 49edf2d..df596b1 100644
+index 00bf300..129df8e 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -26,6 +26,13 @@
@@ -28405,8 +28365,8 @@ index 49edf2d..df596b1 100644
/*
* percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the
* output PHDR, so the next output section - .init.text - should
-@@ -188,12 +253,27 @@ SECTIONS
- PERCPU_VADDR(INTERNODE_CACHE_BYTES, 0, :percpu)
+@@ -190,12 +255,27 @@ SECTIONS
+ "per-CPU data too large - increase CONFIG_PHYSICAL_START")
#endif
- INIT_TEXT_SECTION(PAGE_SIZE)
@@ -28438,7 +28398,7 @@ index 49edf2d..df596b1 100644
.x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
__x86_cpu_dev_start = .;
-@@ -264,19 +344,12 @@ SECTIONS
+@@ -266,19 +346,12 @@ SECTIONS
}
. = ALIGN(8);
@@ -28459,7 +28419,7 @@ index 49edf2d..df596b1 100644
PERCPU_SECTION(INTERNODE_CACHE_BYTES)
#endif
-@@ -295,16 +368,10 @@ SECTIONS
+@@ -297,16 +370,10 @@ SECTIONS
.smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
__smp_locks = .;
*(.smp_locks)
@@ -28477,7 +28437,7 @@ index 49edf2d..df596b1 100644
/* BSS */
. = ALIGN(PAGE_SIZE);
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
-@@ -320,6 +387,7 @@ SECTIONS
+@@ -322,6 +389,7 @@ SECTIONS
__brk_base = .;
. += 64 * 1024; /* 64k alignment slop space */
*(.brk_reservation) /* areas brk users have reserved */
@@ -28485,7 +28445,7 @@ index 49edf2d..df596b1 100644
__brk_limit = .;
}
-@@ -346,13 +414,12 @@ SECTIONS
+@@ -348,13 +416,12 @@ SECTIONS
* for the boot processor.
*/
#define INIT_PER_CPU(x) init_per_cpu__##x = x + __per_cpu_load
@@ -28501,12 +28461,12 @@ index 49edf2d..df596b1 100644
#ifdef CONFIG_SMP
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
-index 957779f..74e405c 100644
+index 2dcc6ff..082dc7a 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
-@@ -54,15 +54,13 @@
-
- DEFINE_VVAR(int, vgetcpu_mode);
+@@ -38,15 +38,13 @@
+ #define CREATE_TRACE_POINTS
+ #include "vsyscall_trace.h"
-static enum { EMULATE, NATIVE, NONE } vsyscall_mode = EMULATE;
+static enum { EMULATE, NONE } vsyscall_mode = EMULATE;
@@ -28521,7 +28481,7 @@ index 957779f..74e405c 100644
else if (!strcmp("none", str))
vsyscall_mode = NONE;
else
-@@ -279,8 +277,7 @@ do_ret:
+@@ -264,8 +262,7 @@ do_ret:
return true;
sigsegv:
@@ -28531,18 +28491,29 @@ index 957779f..74e405c 100644
}
/*
-@@ -331,10 +328,7 @@ void __init map_vsyscall(void)
- extern char __vsyscall_page;
+@@ -283,8 +280,8 @@ static struct vm_operations_struct gate_vma_ops = {
+ static struct vm_area_struct gate_vma = {
+ .vm_start = VSYSCALL_ADDR,
+ .vm_end = VSYSCALL_ADDR + PAGE_SIZE,
+- .vm_page_prot = PAGE_READONLY_EXEC,
+- .vm_flags = VM_READ | VM_EXEC,
++ .vm_page_prot = PAGE_READONLY,
++ .vm_flags = VM_READ,
+ .vm_ops = &gate_vma_ops,
+ };
+
+@@ -325,10 +322,7 @@ void __init map_vsyscall(void)
unsigned long physaddr_vsyscall = __pa_symbol(&__vsyscall_page);
-- __set_fixmap(VSYSCALL_PAGE, physaddr_vsyscall,
-- vsyscall_mode == NATIVE
-- ? PAGE_KERNEL_VSYSCALL
-- : PAGE_KERNEL_VVAR);
-+ __set_fixmap(VSYSCALL_PAGE, physaddr_vsyscall, PAGE_KERNEL_VVAR);
+ if (vsyscall_mode != NONE)
+- __set_fixmap(VSYSCALL_PAGE, physaddr_vsyscall,
+- vsyscall_mode == NATIVE
+- ? PAGE_KERNEL_VSYSCALL
+- : PAGE_KERNEL_VVAR);
++ __set_fixmap(VSYSCALL_PAGE, physaddr_vsyscall, PAGE_KERNEL_VVAR);
+
BUILD_BUG_ON((unsigned long)__fix_to_virt(VSYSCALL_PAGE) !=
(unsigned long)VSYSCALL_ADDR);
- }
diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c
index 04068192..4d75aa6 100644
--- a/arch/x86/kernel/x8664_ksyms_64.c
@@ -28565,7 +28536,7 @@ index 04068192..4d75aa6 100644
+EXPORT_SYMBOL(cpu_pgd);
+#endif
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
-index e48b674..a451dd9 100644
+index 234b072..b7ab191 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -93,7 +93,7 @@ struct x86_cpuinit_ops x86_cpuinit = {
@@ -28586,7 +28557,7 @@ index e48b674..a451dd9 100644
.setup_msi_irqs = native_setup_msi_irqs,
.compose_msi_msg = native_compose_msi_msg,
.teardown_msi_irq = native_teardown_msi_irq,
-@@ -150,7 +150,7 @@ u32 arch_msix_mask_irq(struct msi_desc *desc, u32 flag)
+@@ -140,7 +140,7 @@ void arch_restore_msi_irqs(struct pci_dev *dev)
}
#endif
@@ -28647,10 +28618,10 @@ index 0de1fae..298d037 100644
if ((unsigned long)buf % 64 || fx_only) {
u64 init_bv = pcntxt_mask & ~XSTATE_FPSSE;
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
-index 88f9201..0e7f1a3 100644
+index 8a80737..bac4961 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
-@@ -175,15 +175,20 @@ int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
+@@ -182,15 +182,20 @@ int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries)
{
@@ -28674,7 +28645,7 @@ index 88f9201..0e7f1a3 100644
vcpu->arch.cpuid_nent = cpuid->nent;
kvm_apic_set_version(vcpu);
kvm_x86_ops->cpuid_update(vcpu);
-@@ -196,15 +201,19 @@ int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
+@@ -203,15 +208,19 @@ int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries)
{
@@ -28698,10 +28669,10 @@ index 88f9201..0e7f1a3 100644
out:
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
-index c7327a7..c3e2419 100644
+index de12c1d..4031e2a 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
-@@ -3508,7 +3508,7 @@ static int check_cr_write(struct x86_emulate_ctxt *ctxt)
+@@ -3503,7 +3503,7 @@ static int check_cr_write(struct x86_emulate_ctxt *ctxt)
int cr = ctxt->modrm_reg;
u64 efer = 0;
@@ -28710,17 +28681,8 @@ index c7327a7..c3e2419 100644
0xffffffff00000000ULL,
0, 0, 0, /* CR3 checked later */
CR4_RESERVED_BITS,
-@@ -3543,7 +3543,7 @@ static int check_cr_write(struct x86_emulate_ctxt *ctxt)
-
- ctxt->ops->get_msr(ctxt, MSR_EFER, &efer);
- if (efer & EFER_LMA)
-- rsvd = CR3_L_MODE_RESERVED_BITS;
-+ rsvd = CR3_L_MODE_RESERVED_BITS & ~CR3_PCID_INVD;
-
- if (new_val & rsvd)
- return emulate_gp(ctxt, 0);
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
-index b8345dd..f225d71 100644
+index d52dcf0..cec7e84 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -55,7 +55,7 @@
@@ -28746,10 +28708,10 @@ index fd49c86..77e1aa0 100644
goto error;
walker->ptep_user[walker->level - 1] = ptep_user;
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
-index 7527cef..c63a838e 100644
+index 41dd038..de331cf 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
-@@ -3564,7 +3564,11 @@ static void reload_tss(struct kvm_vcpu *vcpu)
+@@ -3568,7 +3568,11 @@ static void reload_tss(struct kvm_vcpu *vcpu)
int cpu = raw_smp_processor_id();
struct svm_cpu_data *sd = per_cpu(svm_data, cpu);
@@ -28761,7 +28723,7 @@ index 7527cef..c63a838e 100644
load_TR_desc();
}
-@@ -3965,6 +3969,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -3969,6 +3973,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
#endif
#endif
@@ -28773,10 +28735,10 @@ index 7527cef..c63a838e 100644
local_irq_disable();
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
-index ed70394..c629a68 100644
+index d4c58d8..eaf2568 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
-@@ -1366,12 +1366,12 @@ static void vmcs_write64(unsigned long field, u64 value)
+@@ -1380,12 +1380,12 @@ static void vmcs_write64(unsigned long field, u64 value)
#endif
}
@@ -28791,7 +28753,7 @@ index ed70394..c629a68 100644
{
vmcs_writel(field, vmcs_readl(field) | mask);
}
-@@ -1631,7 +1631,11 @@ static void reload_tss(void)
+@@ -1645,7 +1645,11 @@ static void reload_tss(void)
struct desc_struct *descs;
descs = (void *)gdt->address;
@@ -28803,7 +28765,7 @@ index ed70394..c629a68 100644
load_TR_desc();
}
-@@ -1859,6 +1863,10 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
+@@ -1881,6 +1885,10 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
vmcs_writel(HOST_TR_BASE, kvm_read_tr_base()); /* 22.2.4 */
vmcs_writel(HOST_GDTR_BASE, gdt->address); /* 22.2.4 */
@@ -28814,7 +28776,7 @@ index ed70394..c629a68 100644
rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp);
vmcs_writel(HOST_IA32_SYSENTER_ESP, sysenter_esp); /* 22.2.3 */
vmx->loaded_vmcs->cpu = cpu;
-@@ -2148,7 +2156,7 @@ static void setup_msrs(struct vcpu_vmx *vmx)
+@@ -2170,7 +2178,7 @@ static void setup_msrs(struct vcpu_vmx *vmx)
* reads and returns guest's timestamp counter "register"
* guest_tsc = host_tsc + tsc_offset -- 21.3
*/
@@ -28823,7 +28785,27 @@ index ed70394..c629a68 100644
{
u64 host_tsc, tsc_offset;
-@@ -3146,11 +3154,16 @@ static __init int hardware_setup(void)
+@@ -4252,7 +4260,10 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
+ unsigned long cr4;
+
+ vmcs_writel(HOST_CR0, read_cr0() & ~X86_CR0_TS); /* 22.2.3 */
++
++#ifndef CONFIG_PAX_PER_CPU_PGD
+ vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 FIXME: shadow tables */
++#endif
+
+ /* Save the most likely value for this task's CR4 in the VMCS. */
+ cr4 = read_cr4();
+@@ -4279,7 +4290,7 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
+ vmcs_writel(HOST_IDTR_BASE, dt.address); /* 22.2.4 */
+ vmx->host_idt_base = dt.address;
+
+- vmcs_writel(HOST_RIP, vmx_return); /* 22.2.5 */
++ vmcs_writel(HOST_RIP, ktla_ktva(vmx_return)); /* 22.2.5 */
+
+ rdmsr(MSR_IA32_SYSENTER_CS, low32, high32);
+ vmcs_write32(HOST_IA32_SYSENTER_CS, low32);
+@@ -5876,11 +5887,16 @@ static __init int hardware_setup(void)
* page upon invalidation. No need to do anything if the
* processor does not have the APIC_ACCESS_ADDR VMCS field.
*/
@@ -28843,7 +28825,7 @@ index ed70394..c629a68 100644
if (enable_ept && !cpu_has_vmx_ept_2m_page())
kvm_disable_largepages();
-@@ -3161,13 +3174,15 @@ static __init int hardware_setup(void)
+@@ -5891,13 +5907,15 @@ static __init int hardware_setup(void)
if (!cpu_has_vmx_apicv())
enable_apicv = 0;
@@ -28863,27 +28845,7 @@ index ed70394..c629a68 100644
if (nested)
nested_vmx_setup_ctls_msrs();
-@@ -4274,7 +4289,10 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
- unsigned long cr4;
-
- vmcs_writel(HOST_CR0, read_cr0() & ~X86_CR0_TS); /* 22.2.3 */
-+
-+#ifndef CONFIG_PAX_PER_CPU_PGD
- vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 FIXME: shadow tables */
-+#endif
-
- /* Save the most likely value for this task's CR4 in the VMCS. */
- cr4 = read_cr4();
-@@ -4301,7 +4319,7 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
- vmcs_writel(HOST_IDTR_BASE, dt.address); /* 22.2.4 */
- vmx->host_idt_base = dt.address;
-
-- vmcs_writel(HOST_RIP, vmx_return); /* 22.2.5 */
-+ vmcs_writel(HOST_RIP, ktla_ktva(vmx_return)); /* 22.2.5 */
-
- rdmsr(MSR_IA32_SYSENTER_CS, low32, high32);
- vmcs_write32(HOST_IA32_SYSENTER_CS, low32);
-@@ -7622,6 +7640,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -7846,6 +7864,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
"jmp 2f \n\t"
"1: " __ex(ASM_VMX_VMRESUME) "\n\t"
"2: "
@@ -28896,7 +28858,7 @@ index ed70394..c629a68 100644
/* Save guest registers, load host registers, keep flags */
"mov %0, %c[wordsize](%%" _ASM_SP ") \n\t"
"pop %0 \n\t"
-@@ -7674,6 +7698,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -7898,6 +7922,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
#endif
[cr2]"i"(offsetof(struct vcpu_vmx, vcpu.arch.cr2)),
[wordsize]"i"(sizeof(ulong))
@@ -28908,7 +28870,7 @@ index ed70394..c629a68 100644
: "cc", "memory"
#ifdef CONFIG_X86_64
, "rax", "rbx", "rdi", "rsi"
-@@ -7687,7 +7716,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -7911,7 +7940,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
if (debugctlmsr)
update_debugctlmsr(debugctlmsr);
@@ -28917,7 +28879,7 @@ index ed70394..c629a68 100644
/*
* The sysexit path does not restore ds/es, so we must set them to
* a reasonable value ourselves.
-@@ -7696,8 +7725,18 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -7920,8 +7949,18 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
* may be executed in interrupt context, which saves and restore segments
* around it, nullifying its effect.
*/
@@ -28939,19 +28901,10 @@ index ed70394..c629a68 100644
vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
-index 8b92cf4..ee50439 100644
+index c259814..9a0345b 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
-@@ -732,6 +732,8 @@ EXPORT_SYMBOL_GPL(kvm_set_cr4);
-
- int kvm_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
- {
-+ cr3 &= ~CR3_PCID_INVD;
-+
- if (cr3 == kvm_read_cr3(vcpu) && !pdptrs_changed(vcpu)) {
- kvm_mmu_sync_roots(vcpu);
- kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu);
-@@ -1879,8 +1881,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
+@@ -1882,8 +1882,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
{
struct kvm *kvm = vcpu->kvm;
int lm = is_long_mode(vcpu);
@@ -28962,7 +28915,7 @@ index 8b92cf4..ee50439 100644
u8 blob_size = lm ? kvm->arch.xen_hvm_config.blob_size_64
: kvm->arch.xen_hvm_config.blob_size_32;
u32 page_num = data & ~PAGE_MASK;
-@@ -2807,6 +2809,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
+@@ -2810,6 +2810,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
if (n < msr_list.nmsrs)
goto out;
r = -EFAULT;
@@ -28971,7 +28924,7 @@ index 8b92cf4..ee50439 100644
if (copy_to_user(user_msr_list->indices, &msrs_to_save,
num_msrs_to_save * sizeof(u32)))
goto out;
-@@ -5744,7 +5748,7 @@ static struct notifier_block pvclock_gtod_notifier = {
+@@ -5746,7 +5748,7 @@ static struct notifier_block pvclock_gtod_notifier = {
};
#endif
@@ -28981,7 +28934,7 @@ index 8b92cf4..ee50439 100644
int r;
struct kvm_x86_ops *ops = opaque;
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
-index aae9413..d11e829 100644
+index c1c1544..f90c9d5 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -1206,9 +1206,10 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count)
@@ -30322,7 +30275,7 @@ index a451235..1daa956 100644
CFI_ENDPROC
END(bad_get_user_8)
diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
-index 54fcffe..7be149e 100644
+index 1313ae6..84f25ea 100644
--- a/arch/x86/lib/insn.c
+++ b/arch/x86/lib/insn.c
@@ -20,8 +20,10 @@
@@ -30336,14 +30289,16 @@ index 54fcffe..7be149e 100644
#endif
#include <asm/inat.h>
#include <asm/insn.h>
-@@ -53,8 +55,8 @@
- void insn_init(struct insn *insn, const void *kaddr, int x86_64)
+@@ -53,9 +55,9 @@
+ void insn_init(struct insn *insn, const void *kaddr, int buf_len, int x86_64)
{
memset(insn, 0, sizeof(*insn));
- insn->kaddr = kaddr;
+- insn->end_kaddr = kaddr + buf_len;
- insn->next_byte = kaddr;
+ insn->kaddr = ktla_ktva(kaddr);
-+ insn->next_byte = ktla_ktva(kaddr);
++ insn->end_kaddr = insn->kaddr + buf_len;
++ insn->next_byte = insn->kaddr;
insn->x86_64 = x86_64 ? 1 : 0;
insn->opnd_bytes = 4;
if (x86_64)
@@ -31712,13 +31667,13 @@ index c905e89..01ab928 100644
return len;
}
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
-index 6a19ad9..1c48f9a 100644
+index ecfdc46..55b9309 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
-@@ -30,3 +30,7 @@ obj-$(CONFIG_ACPI_NUMA) += srat.o
- obj-$(CONFIG_NUMA_EMU) += numa_emulation.o
-
+@@ -32,3 +32,7 @@ obj-$(CONFIG_NUMA_EMU) += numa_emulation.o
obj-$(CONFIG_MEMTEST) += memtest.o
+
+ obj-$(CONFIG_X86_INTEL_MPX) += mpx.o
+
+quote:="
+obj-$(CONFIG_X86_64) += uderef_64.o
@@ -31778,7 +31733,7 @@ index 903ec1e..c4166b2 100644
}
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
-index 4d8ee82..ffc1011 100644
+index e3ff27a..f38f7c0 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -13,12 +13,19 @@
@@ -32242,7 +32197,7 @@ index 4d8ee82..ffc1011 100644
if (unlikely(expand_stack(vma, address))) {
bad_area(regs, error_code, address);
return;
-@@ -1327,3 +1562,292 @@ trace_do_page_fault(struct pt_regs *regs, unsigned long error_code)
+@@ -1329,3 +1564,292 @@ trace_do_page_fault(struct pt_regs *regs, unsigned long error_code)
}
NOKPROBE_SYMBOL(trace_do_page_fault);
#endif /* CONFIG_TRACING */
@@ -32536,7 +32491,7 @@ index 4d8ee82..ffc1011 100644
+ return ret ? -EFAULT : 0;
+}
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
-index 448ee89..88fe381 100644
+index 224b142..c2c9423 100644
--- a/arch/x86/mm/gup.c
+++ b/arch/x86/mm/gup.c
@@ -268,7 +268,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
@@ -32678,7 +32633,7 @@ index 006cc91..bf05a83 100644
#endif /* CONFIG_HUGETLB_PAGE */
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
-index 66dba36..f8082ec 100644
+index 079c3b6..7069023 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -4,6 +4,7 @@
@@ -32698,7 +32653,7 @@ index 66dba36..f8082ec 100644
/*
* We need to define the tracepoints somewhere, and tlb.c
-@@ -570,7 +573,18 @@ void __init init_mem_mapping(void)
+@@ -596,7 +599,18 @@ void __init init_mem_mapping(void)
early_ioremap_page_table_range_init();
#endif
@@ -32717,7 +32672,7 @@ index 66dba36..f8082ec 100644
__flush_tlb_all();
early_memtest(0, max_pfn_mapped << PAGE_SHIFT);
-@@ -586,10 +600,40 @@ void __init init_mem_mapping(void)
+@@ -612,10 +626,40 @@ void __init init_mem_mapping(void)
* Access has to be given to non-kernel-ram areas as well, these contain the PCI
* mmio resources as well as potential bios/acpi data regions.
*/
@@ -32759,7 +32714,7 @@ index 66dba36..f8082ec 100644
if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
return 0;
if (!page_is_ram(pagenr))
-@@ -635,8 +679,117 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
+@@ -661,8 +705,117 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
#endif
}
@@ -33131,10 +33086,10 @@ index c8140e1..59257fc 100644
printk(KERN_INFO "Write protecting the kernel text: %luk\n",
size >> 10);
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
-index 4e5dfec..6fd6dc5 100644
+index 30eb05a..ae671ac 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
-@@ -151,7 +151,7 @@ early_param("gbpages", parse_direct_gbpages_on);
+@@ -150,7 +150,7 @@ early_param("gbpages", parse_direct_gbpages_on);
* around without checking the pgd every time.
*/
@@ -33143,7 +33098,7 @@ index 4e5dfec..6fd6dc5 100644
EXPORT_SYMBOL_GPL(__supported_pte_mask);
int force_personality32;
-@@ -184,7 +184,12 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
+@@ -183,7 +183,12 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
for (address = start; address <= end; address += PGDIR_SIZE) {
const pgd_t *pgd_ref = pgd_offset_k(address);
@@ -33156,7 +33111,7 @@ index 4e5dfec..6fd6dc5 100644
/*
* When it is called after memory hot remove, pgd_none()
-@@ -195,6 +200,25 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
+@@ -194,6 +199,25 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
continue;
spin_lock(&pgd_lock);
@@ -33182,7 +33137,7 @@ index 4e5dfec..6fd6dc5 100644
list_for_each_entry(page, &pgd_list, lru) {
pgd_t *pgd;
spinlock_t *pgt_lock;
-@@ -203,6 +227,7 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
+@@ -202,6 +226,7 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
/* the pgt_lock only for Xen */
pgt_lock = &pgd_page_get_mm(page)->page_table_lock;
spin_lock(pgt_lock);
@@ -33190,7 +33145,7 @@ index 4e5dfec..6fd6dc5 100644
if (!pgd_none(*pgd_ref) && !pgd_none(*pgd))
BUG_ON(pgd_page_vaddr(*pgd)
-@@ -216,7 +241,10 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
+@@ -215,7 +240,10 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
set_pgd(pgd, *pgd_ref);
}
@@ -33201,7 +33156,7 @@ index 4e5dfec..6fd6dc5 100644
}
spin_unlock(&pgd_lock);
}
-@@ -249,7 +277,7 @@ static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
+@@ -248,7 +276,7 @@ static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
{
if (pgd_none(*pgd)) {
pud_t *pud = (pud_t *)spp_getpage();
@@ -33210,7 +33165,7 @@ index 4e5dfec..6fd6dc5 100644
if (pud != pud_offset(pgd, 0))
printk(KERN_ERR "PAGETABLE BUG #00! %p <-> %p\n",
pud, pud_offset(pgd, 0));
-@@ -261,7 +289,7 @@ static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
+@@ -260,7 +288,7 @@ static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
{
if (pud_none(*pud)) {
pmd_t *pmd = (pmd_t *) spp_getpage();
@@ -33219,7 +33174,7 @@ index 4e5dfec..6fd6dc5 100644
if (pmd != pmd_offset(pud, 0))
printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
pmd, pmd_offset(pud, 0));
-@@ -290,7 +318,9 @@ void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte)
+@@ -289,7 +317,9 @@ void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte)
pmd = fill_pmd(pud, vaddr);
pte = fill_pte(pmd, vaddr);
@@ -33229,7 +33184,7 @@ index 4e5dfec..6fd6dc5 100644
/*
* It's enough to flush this one mapping.
-@@ -349,14 +379,12 @@ static void __init __init_extra_mapping(unsigned long phys, unsigned long size,
+@@ -351,14 +381,12 @@ static void __init __init_extra_mapping(unsigned long phys, unsigned long size,
pgd = pgd_offset_k((unsigned long)__va(phys));
if (pgd_none(*pgd)) {
pud = (pud_t *) spp_getpage();
@@ -33246,7 +33201,7 @@ index 4e5dfec..6fd6dc5 100644
}
pmd = pmd_offset(pud, phys);
BUG_ON(!pmd_none(*pmd));
-@@ -597,7 +625,7 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end,
+@@ -599,7 +627,7 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end,
prot);
spin_lock(&init_mm.page_table_lock);
@@ -33255,7 +33210,7 @@ index 4e5dfec..6fd6dc5 100644
spin_unlock(&init_mm.page_table_lock);
}
__flush_tlb_all();
-@@ -638,7 +666,7 @@ kernel_physical_mapping_init(unsigned long start,
+@@ -640,7 +668,7 @@ kernel_physical_mapping_init(unsigned long start,
page_size_mask);
spin_lock(&init_mm.page_table_lock);
@@ -33264,19 +33219,8 @@ index 4e5dfec..6fd6dc5 100644
spin_unlock(&init_mm.page_table_lock);
pgd_changed = true;
}
-@@ -1217,8 +1245,8 @@ static struct vm_operations_struct gate_vma_ops = {
- static struct vm_area_struct gate_vma = {
- .vm_start = VSYSCALL_ADDR,
- .vm_end = VSYSCALL_ADDR + PAGE_SIZE,
-- .vm_page_prot = PAGE_READONLY_EXEC,
-- .vm_flags = VM_READ | VM_EXEC,
-+ .vm_page_prot = PAGE_READONLY,
-+ .vm_flags = VM_READ,
- .vm_ops = &gate_vma_ops,
- };
-
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c
-index 7b179b49..6bd17777 100644
+index 9ca35fc..4b2b7b7 100644
--- a/arch/x86/mm/iomap_32.c
+++ b/arch/x86/mm/iomap_32.c
@@ -64,7 +64,11 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot)
@@ -33292,7 +33236,7 @@ index 7b179b49..6bd17777 100644
return (void *)vaddr;
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
-index af78e50..4f1fe56 100644
+index fdf617c..b9e85bc 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -56,8 +56,8 @@ static int __ioremap_check_ram(unsigned long start_pfn, unsigned long nr_pages,
@@ -33306,7 +33250,7 @@ index af78e50..4f1fe56 100644
return 1;
WARN_ONCE(1, "ioremap on RAM pfn 0x%lx\n", start_pfn);
-@@ -280,7 +280,7 @@ EXPORT_SYMBOL(ioremap_prot);
+@@ -283,7 +283,7 @@ EXPORT_SYMBOL(ioremap_prot);
*
* Caller must ensure there is only one unmapping for the same pointer.
*/
@@ -33315,9 +33259,9 @@ index af78e50..4f1fe56 100644
{
struct vm_struct *p, *o;
-@@ -329,30 +329,29 @@ EXPORT_SYMBOL(iounmap);
+@@ -332,30 +332,29 @@ EXPORT_SYMBOL(iounmap);
*/
- void *xlate_dev_mem_ptr(unsigned long phys)
+ void *xlate_dev_mem_ptr(phys_addr_t phys)
{
- void *addr;
- unsigned long start = phys & PAGE_MASK;
@@ -33338,7 +33282,7 @@ index af78e50..4f1fe56 100644
+ return (void __force *)ioremap_cache(phys, PAGE_SIZE);
}
- void unxlate_dev_mem_ptr(unsigned long phys, void *addr)
+ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr)
{
if (page_is_ram(phys >> PAGE_SHIFT))
+#ifdef CONFIG_HIGHMEM
@@ -33355,7 +33299,7 @@ index af78e50..4f1fe56 100644
static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
{
-@@ -388,8 +387,7 @@ void __init early_ioremap_init(void)
+@@ -391,8 +390,7 @@ void __init early_ioremap_init(void)
early_ioremap_setup();
pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN));
@@ -33521,7 +33465,7 @@ index 1a88370..3f598b5 100644
unsigned long uninitialized_var(pfn_align);
int i, nid;
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
-index 36de293..b820ddc 100644
+index 536ea2f..f42c293 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -262,7 +262,7 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
@@ -33568,7 +33512,7 @@ index 36de293..b820ddc 100644
prot = __pgprot(pgprot_val(prot) & ~pgprot_val(forbidden));
return prot;
-@@ -420,23 +429,37 @@ EXPORT_SYMBOL_GPL(slow_virt_to_phys);
+@@ -440,23 +449,37 @@ EXPORT_SYMBOL_GPL(slow_virt_to_phys);
static void __set_pmd_pte(pte_t *kpte, unsigned long address, pte_t pte)
{
/* change init_mm */
@@ -33609,10 +33553,28 @@ index 36de293..b820ddc 100644
static int
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
-index 6574388..87e9bef 100644
+index 7ac6869..c0ba541 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
-@@ -376,7 +376,7 @@ int free_memtype(u64 start, u64 end)
+@@ -89,7 +89,7 @@ static inline enum page_cache_mode get_page_memtype(struct page *pg)
+ unsigned long pg_flags = pg->flags & _PGMT_MASK;
+
+ if (pg_flags == _PGMT_DEFAULT)
+- return -1;
++ return _PAGE_CACHE_MODE_NUM;
+ else if (pg_flags == _PGMT_WC)
+ return _PAGE_CACHE_MODE_WC;
+ else if (pg_flags == _PGMT_UC_MINUS)
+@@ -346,7 +346,7 @@ static int reserve_ram_pages_type(u64 start, u64 end,
+
+ page = pfn_to_page(pfn);
+ type = get_page_memtype(page);
+- if (type != -1) {
++ if (type != _PAGE_CACHE_MODE_NUM) {
+ pr_info("reserve_ram_pages_type failed [mem %#010Lx-%#010Lx], track 0x%x, req 0x%x\n",
+ start, end - 1, type, req_type);
+ if (new_type)
+@@ -498,7 +498,7 @@ int free_memtype(u64 start, u64 end)
if (!entry) {
printk(KERN_INFO "%s:%d freeing invalid memtype [mem %#010Lx-%#010Lx]\n",
@@ -33621,7 +33583,20 @@ index 6574388..87e9bef 100644
return -EINVAL;
}
-@@ -506,8 +506,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
+@@ -532,10 +532,10 @@ static enum page_cache_mode lookup_memtype(u64 paddr)
+ page = pfn_to_page(paddr >> PAGE_SHIFT);
+ rettype = get_page_memtype(page);
+ /*
+- * -1 from get_page_memtype() implies RAM page is in its
++ * _PAGE_CACHE_MODE_NUM from get_page_memtype() implies RAM page is in its
+ * default state and not reserved, and hence of type WB
+ */
+- if (rettype == -1)
++ if (rettype == _PAGE_CACHE_MODE_NUM)
+ rettype = _PAGE_CACHE_MODE_WB;
+
+ return rettype;
+@@ -628,8 +628,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
while (cursor < to) {
if (!devmem_is_allowed(pfn)) {
@@ -33632,38 +33607,38 @@ index 6574388..87e9bef 100644
return 0;
}
cursor += PAGE_SIZE;
-@@ -577,7 +577,7 @@ int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags)
- if (ioremap_change_attr((unsigned long)__va(base), id_sz, flags) < 0) {
+@@ -700,7 +700,7 @@ int kernel_map_sync_memtype(u64 base, unsigned long size,
+ if (ioremap_change_attr((unsigned long)__va(base), id_sz, pcm) < 0) {
printk(KERN_INFO "%s:%d ioremap_change_attr failed %s "
"for [mem %#010Lx-%#010Lx]\n",
- current->comm, current->pid,
+ current->comm, task_pid_nr(current),
- cattr_name(flags),
+ cattr_name(pcm),
base, (unsigned long long)(base + size-1));
return -EINVAL;
-@@ -612,7 +612,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
- flags = lookup_memtype(paddr);
- if (want_flags != flags) {
+@@ -735,7 +735,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
+ pcm = lookup_memtype(paddr);
+ if (want_pcm != pcm) {
printk(KERN_WARNING "%s:%d map pfn RAM range req %s for [mem %#010Lx-%#010Lx], got %s\n",
- current->comm, current->pid,
+ current->comm, task_pid_nr(current),
- cattr_name(want_flags),
+ cattr_name(want_pcm),
(unsigned long long)paddr,
(unsigned long long)(paddr + size - 1),
-@@ -634,7 +634,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
+@@ -757,7 +757,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
free_memtype(paddr, paddr + size);
printk(KERN_ERR "%s:%d map pfn expected mapping type %s"
" for [mem %#010Lx-%#010Lx], got %s\n",
- current->comm, current->pid,
+ current->comm, task_pid_nr(current),
- cattr_name(want_flags),
+ cattr_name(want_pcm),
(unsigned long long)paddr,
(unsigned long long)(paddr + size - 1),
diff --git a/arch/x86/mm/pat_rbtree.c b/arch/x86/mm/pat_rbtree.c
-index 415f6c4..d319983 100644
+index 6582adc..fcc5d0b 100644
--- a/arch/x86/mm/pat_rbtree.c
+++ b/arch/x86/mm/pat_rbtree.c
-@@ -160,7 +160,7 @@ success:
+@@ -161,7 +161,7 @@ success:
failure:
printk(KERN_INFO "%s:%d conflicting memory types "
@@ -34219,7 +34194,7 @@ index 6440221..f84b5c7 100644
+ pax_force_retaddr
ret
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
-index 3f62734..a57894f 100644
+index 9875143..00f6656 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -13,7 +13,11 @@
@@ -34234,7 +34209,7 @@ index 3f62734..a57894f 100644
/*
* assembly code in arch/x86/net/bpf_jit.S
-@@ -174,7 +178,9 @@ static inline u8 add_2reg(u8 byte, u32 dst_reg, u32 src_reg)
+@@ -174,7 +178,9 @@ static u8 add_2reg(u8 byte, u32 dst_reg, u32 src_reg)
static void jit_fill_hole(void *area, unsigned int size)
{
/* fill whole space with int3 instructions */
@@ -34244,7 +34219,7 @@ index 3f62734..a57894f 100644
}
struct jit_context {
-@@ -894,7 +900,9 @@ common_load:
+@@ -896,7 +902,9 @@ common_load:
pr_err("bpf_jit_compile fatal error\n");
return -EFAULT;
}
@@ -34254,7 +34229,7 @@ index 3f62734..a57894f 100644
}
proglen += ilen;
addrs[i] = proglen;
-@@ -966,7 +974,6 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
+@@ -968,7 +976,6 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
if (image) {
bpf_flush_icache(header, image + proglen);
@@ -34262,7 +34237,7 @@ index 3f62734..a57894f 100644
prog->bpf_func = (void *)image;
prog->jited = true;
}
-@@ -979,12 +986,8 @@ void bpf_jit_free(struct bpf_prog *fp)
+@@ -981,12 +988,8 @@ void bpf_jit_free(struct bpf_prog *fp)
unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK;
struct bpf_binary_header *header = (void *)addr;
@@ -34397,10 +34372,10 @@ index 71e8a67..6a313bb 100644
struct op_counter_config;
diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c
-index b9958c3..24229ab 100644
+index 44b9271..4c5a988 100644
--- a/arch/x86/pci/intel_mid_pci.c
+++ b/arch/x86/pci/intel_mid_pci.c
-@@ -250,7 +250,7 @@ int __init intel_mid_pci_init(void)
+@@ -258,7 +258,7 @@ int __init intel_mid_pci_init(void)
pci_mmcfg_late_init();
pcibios_enable_irq = intel_mid_pci_irq_enable;
pcibios_disable_irq = intel_mid_pci_irq_disable;
@@ -34410,7 +34385,7 @@ index b9958c3..24229ab 100644
/* Continue with standard init */
return 1;
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
-index eb500c2..eab9e70 100644
+index 5dc6ca5..25c03f5 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -51,7 +51,7 @@ struct irq_router {
@@ -34804,10 +34779,10 @@ index 40e7cda..c7e6672 100644
local_irq_restore(efi_rt_eflags);
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
-index 35aecb6..46177db 100644
+index 17e80d8..9fa6e41 100644
--- a/arch/x86/platform/efi/efi_64.c
+++ b/arch/x86/platform/efi/efi_64.c
-@@ -99,6 +99,11 @@ void __init efi_call_phys_prolog(void)
+@@ -98,6 +98,11 @@ void __init efi_call_phys_prolog(void)
vaddress = (unsigned long)__va(pgd * PGDIR_SIZE);
set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress));
}
@@ -34819,7 +34794,7 @@ index 35aecb6..46177db 100644
__flush_tlb_all();
}
-@@ -116,6 +121,11 @@ void __init efi_call_phys_epilog(void)
+@@ -115,6 +120,11 @@ void __init efi_call_phys_epilog(void)
for (pgd = 0; pgd < n_pgds; pgd++)
set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), save_pgd[pgd]);
kfree(save_pgd);
@@ -34831,7 +34806,7 @@ index 35aecb6..46177db 100644
__flush_tlb_all();
local_irq_restore(efi_flags);
early_code_mapping_set_exec(0);
-@@ -146,8 +156,23 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
+@@ -145,8 +155,23 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
unsigned npages;
pgd_t *pgd;
@@ -35262,7 +35237,7 @@ index 604a37e..e49702a 100644
relocs-objs := relocs_32.o relocs_64.o relocs_common.o
PHONY += relocs
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
-index a5efb21..97490e9 100644
+index 0c2fae8..88036b7 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -1,5 +1,7 @@
@@ -35281,7 +35256,7 @@ index a5efb21..97490e9 100644
struct relocs {
uint32_t *offset;
-@@ -383,9 +386,39 @@ static void read_ehdr(FILE *fp)
+@@ -386,9 +389,39 @@ static void read_ehdr(FILE *fp)
}
}
@@ -35322,7 +35297,7 @@ index a5efb21..97490e9 100644
Elf_Shdr shdr;
secs = calloc(ehdr.e_shnum, sizeof(struct section));
-@@ -420,7 +453,7 @@ static void read_shdrs(FILE *fp)
+@@ -423,7 +456,7 @@ static void read_shdrs(FILE *fp)
static void read_strtabs(FILE *fp)
{
@@ -35331,7 +35306,7 @@ index a5efb21..97490e9 100644
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_STRTAB) {
-@@ -445,7 +478,7 @@ static void read_strtabs(FILE *fp)
+@@ -448,7 +481,7 @@ static void read_strtabs(FILE *fp)
static void read_symtabs(FILE *fp)
{
@@ -35340,7 +35315,7 @@ index a5efb21..97490e9 100644
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_SYMTAB) {
-@@ -476,9 +509,11 @@ static void read_symtabs(FILE *fp)
+@@ -479,9 +512,11 @@ static void read_symtabs(FILE *fp)
}
@@ -35354,7 +35329,7 @@ index a5efb21..97490e9 100644
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_REL_TYPE) {
-@@ -498,9 +533,22 @@ static void read_relocs(FILE *fp)
+@@ -501,9 +536,22 @@ static void read_relocs(FILE *fp)
die("Cannot read symbol table: %s\n",
strerror(errno));
}
@@ -35378,7 +35353,7 @@ index a5efb21..97490e9 100644
rel->r_info = elf_xword_to_cpu(rel->r_info);
#if (SHT_REL_TYPE == SHT_RELA)
rel->r_addend = elf_xword_to_cpu(rel->r_addend);
-@@ -512,7 +560,7 @@ static void read_relocs(FILE *fp)
+@@ -515,7 +563,7 @@ static void read_relocs(FILE *fp)
static void print_absolute_symbols(void)
{
@@ -35387,7 +35362,7 @@ index a5efb21..97490e9 100644
const char *format;
if (ELF_BITS == 64)
-@@ -525,7 +573,7 @@ static void print_absolute_symbols(void)
+@@ -528,7 +576,7 @@ static void print_absolute_symbols(void)
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
char *sym_strtab;
@@ -35396,7 +35371,7 @@ index a5efb21..97490e9 100644
if (sec->shdr.sh_type != SHT_SYMTAB) {
continue;
-@@ -552,7 +600,7 @@ static void print_absolute_symbols(void)
+@@ -555,7 +603,7 @@ static void print_absolute_symbols(void)
static void print_absolute_relocs(void)
{
@@ -35405,7 +35380,7 @@ index a5efb21..97490e9 100644
const char *format;
if (ELF_BITS == 64)
-@@ -565,7 +613,7 @@ static void print_absolute_relocs(void)
+@@ -568,7 +616,7 @@ static void print_absolute_relocs(void)
struct section *sec_applies, *sec_symtab;
char *sym_strtab;
Elf_Sym *sh_symtab;
@@ -35414,7 +35389,7 @@ index a5efb21..97490e9 100644
if (sec->shdr.sh_type != SHT_REL_TYPE) {
continue;
}
-@@ -642,13 +690,13 @@ static void add_reloc(struct relocs *r, uint32_t offset)
+@@ -645,13 +693,13 @@ static void add_reloc(struct relocs *r, uint32_t offset)
static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel,
Elf_Sym *sym, const char *symname))
{
@@ -35430,7 +35405,7 @@ index a5efb21..97490e9 100644
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_REL_TYPE) {
-@@ -822,6 +870,23 @@ static int do_reloc32(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
+@@ -830,6 +878,23 @@ static int do_reloc32(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
{
unsigned r_type = ELF32_R_TYPE(rel->r_info);
int shn_abs = (sym->st_shndx == SHN_ABS) && !is_reloc(S_REL, symname);
@@ -35454,7 +35429,7 @@ index a5efb21..97490e9 100644
switch (r_type) {
case R_386_NONE:
-@@ -960,7 +1025,7 @@ static int write32_as_text(uint32_t v, FILE *f)
+@@ -968,7 +1033,7 @@ static int write32_as_text(uint32_t v, FILE *f)
static void emit_relocs(int as_text, int use_real_mode)
{
@@ -35463,7 +35438,7 @@ index a5efb21..97490e9 100644
int (*write_reloc)(uint32_t, FILE *) = write32;
int (*do_reloc)(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
const char *symname);
-@@ -1060,10 +1125,11 @@ void process(FILE *fp, int use_real_mode, int as_text,
+@@ -1078,10 +1143,11 @@ void process(FILE *fp, int use_real_mode, int as_text,
{
regex_init(use_real_mode);
read_ehdr(fp);
@@ -35541,22 +35516,22 @@ index e904c27..b9eaa03 100644
#ifdef CONFIG_COMPAT_VDSO
#define VDSO_DEFAULT 0
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
-index 208c220..54f1447 100644
+index 1c9f750..cfddb1a 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
-@@ -16,10 +16,9 @@
- #include <asm/vdso.h>
+@@ -19,10 +19,7 @@
#include <asm/page.h>
#include <asm/hpet.h>
-+#include <asm/mman.h>
-
- #if defined(CONFIG_X86_64)
--unsigned int __read_mostly vdso64_enabled = 1;
+ #include <asm/desc.h>
-
- extern unsigned short vdso_sync_cpuid;
- #endif
+-#if defined(CONFIG_X86_64)
+-unsigned int __read_mostly vdso64_enabled = 1;
+-#endif
++#include <asm/mman.h>
-@@ -114,6 +113,11 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
+ void __init init_vdso_image(const struct vdso_image *image)
+ {
+@@ -101,6 +98,11 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
.pages = no_pages,
};
@@ -35568,7 +35543,7 @@ index 208c220..54f1447 100644
if (calculate_addr) {
addr = vdso_addr(current->mm->start_stack,
image->size - image->sym_vvar_start);
-@@ -124,14 +128,14 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
+@@ -111,14 +113,14 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
down_write(&mm->mmap_sem);
addr = get_unmapped_area(NULL, addr,
@@ -35585,7 +35560,7 @@ index 208c220..54f1447 100644
/*
* MAYWRITE to allow gdb to COW and set breakpoints
-@@ -176,15 +180,12 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
+@@ -163,15 +165,12 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
hpet_address >> PAGE_SHIFT,
PAGE_SIZE,
pgprot_noncached(PAGE_READONLY));
@@ -35602,7 +35577,7 @@ index 208c220..54f1447 100644
up_write(&mm->mmap_sem);
return ret;
-@@ -204,8 +205,8 @@ static int load_vdso32(void)
+@@ -191,8 +190,8 @@ static int load_vdso32(void)
if (selected_vdso32->sym_VDSO32_SYSENTER_RETURN)
current_thread_info()->sysenter_return =
@@ -35613,7 +35588,7 @@ index 208c220..54f1447 100644
return 0;
}
-@@ -214,9 +215,6 @@ static int load_vdso32(void)
+@@ -201,9 +200,6 @@ static int load_vdso32(void)
#ifdef CONFIG_X86_64
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
{
@@ -35623,7 +35598,7 @@ index 208c220..54f1447 100644
return map_vdso(&vdso_image_64, true);
}
-@@ -225,12 +223,8 @@ int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
+@@ -212,12 +208,8 @@ int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
int uses_interp)
{
#ifdef CONFIG_X86_X32_ABI
@@ -35637,12 +35612,10 @@ index 208c220..54f1447 100644
#endif
return load_vdso32();
-@@ -242,12 +236,3 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
- return load_vdso32();
- }
+@@ -231,15 +223,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
#endif
--
--#ifdef CONFIG_X86_64
+
+ #ifdef CONFIG_X86_64
-static __init int vdso_setup(char *s)
-{
- vdso64_enabled = simple_strtoul(s, NULL, 0);
@@ -35650,6 +35623,11 @@ index 208c220..54f1447 100644
-}
-__setup("vdso=", vdso_setup);
-#endif
+-
+-#ifdef CONFIG_X86_64
+ static void vgetcpu_cpu_init(void *arg)
+ {
+ int cpu = smp_processor_id();
diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
index e88fda8..76ce7ce 100644
--- a/arch/x86/xen/Kconfig
@@ -35663,10 +35641,10 @@ index e88fda8..76ce7ce 100644
This is the Linux Xen port. Enabling this will allow the
kernel to boot in a paravirtualized environment under the
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
-index fac5e4f..89c3525 100644
+index 78a881b..9994bbb 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
-@@ -123,8 +123,6 @@ EXPORT_SYMBOL_GPL(xen_start_info);
+@@ -125,8 +125,6 @@ EXPORT_SYMBOL_GPL(xen_start_info);
struct shared_info xen_dummy_shared_info;
@@ -35675,7 +35653,7 @@ index fac5e4f..89c3525 100644
RESERVE_BRK(shared_info_page_brk, PAGE_SIZE);
__read_mostly int xen_have_vector_callback;
EXPORT_SYMBOL_GPL(xen_have_vector_callback);
-@@ -542,8 +540,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr)
+@@ -544,8 +542,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr)
{
unsigned long va = dtr->address;
unsigned int size = dtr->size + 1;
@@ -35685,7 +35663,7 @@ index fac5e4f..89c3525 100644
int f;
/*
-@@ -591,8 +588,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
+@@ -593,8 +590,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
{
unsigned long va = dtr->address;
unsigned int size = dtr->size + 1;
@@ -35695,7 +35673,7 @@ index fac5e4f..89c3525 100644
int f;
/*
-@@ -600,7 +596,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
+@@ -602,7 +598,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
* 8-byte entries, or 16 4k pages..
*/
@@ -35704,7 +35682,7 @@ index fac5e4f..89c3525 100644
BUG_ON(va & ~PAGE_MASK);
for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) {
-@@ -989,7 +985,7 @@ static u32 xen_safe_apic_wait_icr_idle(void)
+@@ -991,7 +987,7 @@ static u32 xen_safe_apic_wait_icr_idle(void)
return 0;
}
@@ -35713,7 +35691,7 @@ index fac5e4f..89c3525 100644
{
apic->read = xen_apic_read;
apic->write = xen_apic_write;
-@@ -1295,30 +1291,30 @@ static const struct pv_apic_ops xen_apic_ops __initconst = {
+@@ -1291,30 +1287,30 @@ static const struct pv_apic_ops xen_apic_ops __initconst = {
#endif
};
@@ -35751,7 +35729,7 @@ index fac5e4f..89c3525 100644
{
if (pm_power_off)
pm_power_off();
-@@ -1456,8 +1452,11 @@ static void __ref xen_setup_gdt(int cpu)
+@@ -1467,8 +1463,11 @@ static void __ref xen_setup_gdt(int cpu)
pv_cpu_ops.write_gdt_entry = xen_write_gdt_entry_boot;
pv_cpu_ops.load_gdt = xen_load_gdt_boot;
@@ -35765,7 +35743,7 @@ index fac5e4f..89c3525 100644
pv_cpu_ops.write_gdt_entry = xen_write_gdt_entry;
pv_cpu_ops.load_gdt = xen_load_gdt;
-@@ -1573,7 +1572,17 @@ asmlinkage __visible void __init xen_start_kernel(void)
+@@ -1583,7 +1582,17 @@ asmlinkage __visible void __init xen_start_kernel(void)
__userpte_alloc_gfp &= ~__GFP_HIGHMEM;
/* Work out if we support NX */
@@ -35784,7 +35762,7 @@ index fac5e4f..89c3525 100644
/* Get mfn list */
xen_build_dynamic_phys_to_machine();
-@@ -1601,13 +1610,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
+@@ -1611,13 +1620,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
machine_ops = xen_machine_ops;
@@ -35799,7 +35777,7 @@ index fac5e4f..89c3525 100644
#ifdef CONFIG_ACPI_NUMA
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
-index a8a1a3d..8216142 100644
+index 5c1f9ac..0e15f5c 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -379,7 +379,7 @@ static pteval_t pte_mfn_to_pfn(pteval_t val)
@@ -35811,7 +35789,7 @@ index a8a1a3d..8216142 100644
{
if (val & _PAGE_PRESENT) {
unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT;
-@@ -1867,7 +1867,11 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
+@@ -1836,7 +1836,11 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
* L3_k[511] -> level2_fixmap_pgt */
convert_pfn_mfn(level3_kernel_pgt);
@@ -35823,7 +35801,7 @@ index a8a1a3d..8216142 100644
convert_pfn_mfn(level2_fixmap_pgt);
}
/* We get [511][511] and have Xen's version of level2_kernel_pgt */
-@@ -1892,11 +1896,16 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
+@@ -1861,11 +1865,16 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
set_page_prot(init_level4_pgt, PAGE_KERNEL_RO);
set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);
set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);
@@ -35840,7 +35818,7 @@ index a8a1a3d..8216142 100644
/* Pin down new L4 */
pin_pagetable_pfn(MMUEXT_PIN_L4_TABLE,
-@@ -2080,6 +2089,7 @@ static void __init xen_post_allocator_init(void)
+@@ -2049,6 +2058,7 @@ static void __init xen_post_allocator_init(void)
pv_mmu_ops.set_pud = xen_set_pud;
#if PAGETABLE_LEVELS == 4
pv_mmu_ops.set_pgd = xen_set_pgd;
@@ -35848,7 +35826,7 @@ index a8a1a3d..8216142 100644
#endif
/* This will work as long as patching hasn't happened yet
-@@ -2158,6 +2168,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = {
+@@ -2127,6 +2137,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = {
.pud_val = PV_CALLEE_SAVE(xen_pud_val),
.make_pud = PV_CALLEE_SAVE(xen_make_pud),
.set_pgd = xen_set_pgd_hyper,
@@ -35962,7 +35940,7 @@ index 674b2225..f1f5dc1 100644
mov %rsi,xen_start_info
mov $init_thread_union+THREAD_SIZE,%rsp
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
-index 28c7e0b..2acfec7 100644
+index 5686bd9..0c8b6ee 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -10,8 +10,6 @@
@@ -36012,34 +35990,11 @@ index 2f33760..835e50a 100644
#define XCHAL_ICACHE_SIZE 8192 /* I-cache size in bytes or 0 */
#define XCHAL_DCACHE_SIZE 8192 /* D-cache size in bytes or 0 */
-diff --git a/arch/xtensa/variants/s6000/include/variant/core.h b/arch/xtensa/variants/s6000/include/variant/core.h
-index af00795..2bb8105 100644
---- a/arch/xtensa/variants/s6000/include/variant/core.h
-+++ b/arch/xtensa/variants/s6000/include/variant/core.h
-@@ -11,6 +11,7 @@
- #ifndef _XTENSA_CORE_CONFIGURATION_H
- #define _XTENSA_CORE_CONFIGURATION_H
-
-+#include <linux/const.h>
-
- /****************************************************************************
- Parameters Useful for Any Code, USER or PRIVILEGED
-@@ -118,9 +119,9 @@
- ----------------------------------------------------------------------*/
-
- #define XCHAL_ICACHE_LINESIZE 16 /* I-cache line size in bytes */
--#define XCHAL_DCACHE_LINESIZE 16 /* D-cache line size in bytes */
- #define XCHAL_ICACHE_LINEWIDTH 4 /* log2(I line size in bytes) */
- #define XCHAL_DCACHE_LINEWIDTH 4 /* log2(D line size in bytes) */
-+#define XCHAL_DCACHE_LINESIZE (_AC(1,UL) << XCHAL_DCACHE_LINEWIDTH) /* D-cache line size in bytes */
-
- #define XCHAL_ICACHE_SIZE 32768 /* I-cache size in bytes or 0 */
- #define XCHAL_DCACHE_SIZE 32768 /* D-cache size in bytes or 0 */
diff --git a/block/bio.c b/block/bio.c
-index 3e6e198..5c65199 100644
+index 471d738..bd3da0d 100644
--- a/block/bio.c
+++ b/block/bio.c
-@@ -1163,7 +1163,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
+@@ -1169,7 +1169,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
/*
* Overflow, abort
*/
@@ -36048,7 +36003,7 @@ index 3e6e198..5c65199 100644
return ERR_PTR(-EINVAL);
nr_pages += end - start;
-@@ -1297,7 +1297,7 @@ static struct bio *__bio_map_user_iov(struct request_queue *q,
+@@ -1303,7 +1303,7 @@ static struct bio *__bio_map_user_iov(struct request_queue *q,
/*
* Overflow, abort
*/
@@ -36057,7 +36012,7 @@ index 3e6e198..5c65199 100644
return ERR_PTR(-EINVAL);
nr_pages += end - start;
-@@ -1559,7 +1559,7 @@ static void bio_copy_kern_endio(struct bio *bio, int err)
+@@ -1565,7 +1565,7 @@ static void bio_copy_kern_endio(struct bio *bio, int err)
const int read = bio_data_dir(bio) == READ;
struct bio_map_data *bmd = bio->bi_private;
int i;
@@ -36216,7 +36171,7 @@ index 56d08fd..2e07090 100644
(u8 *) pte, count) < count) {
kfree(pte);
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
-index b0c2a61..10bb6ec 100644
+index 28163fa..07190a06 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -67,7 +67,7 @@ static int scsi_get_bus(struct request_queue *q, int __user *p)
@@ -36350,7 +36305,7 @@ index 16129c7..8b675cd 100644
struct apei_exec_context {
u32 ip;
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
-index fc5f780..e5ac91a 100644
+index e82d097..0c855c1 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -478,7 +478,7 @@ static void __ghes_print_estatus(const char *pfx,
@@ -36389,7 +36344,7 @@ index a83e3c6..c3d617f 100644
bgrt_kobj = kobject_create_and_add("bgrt", acpi_kobj);
if (!bgrt_kobj)
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
-index 7556e7c..89a96bd 100644
+index 9b693d5..8953d54 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -51,7 +51,7 @@ struct acpi_blacklist_item {
@@ -36426,10 +36381,10 @@ index c68e724..e863008 100644
/* parse the table header to get the table length */
if (count <= sizeof(struct acpi_table_header))
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
-index 6341e66..ebcf59c 100644
+index c0d44d3..5ad8f9a 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
-@@ -1029,6 +1029,8 @@ EXPORT_SYMBOL_GPL(acpi_subsys_freeze);
+@@ -1025,6 +1025,8 @@ EXPORT_SYMBOL_GPL(acpi_subsys_freeze);
#endif /* CONFIG_PM_SLEEP */
@@ -36437,16 +36392,16 @@ index 6341e66..ebcf59c 100644
+
static struct dev_pm_domain acpi_general_pm_domain = {
.ops = {
- #ifdef CONFIG_PM_RUNTIME
-@@ -1047,6 +1049,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
- .restore_early = acpi_subsys_resume_early,
+ #ifdef CONFIG_PM
+@@ -1043,6 +1045,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
+ #endif
#endif
},
+ .detach = acpi_dev_pm_detach
};
/**
-@@ -1116,7 +1119,6 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
+@@ -1112,7 +1115,6 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
acpi_device_wakeup(adev, ACPI_STATE_S0, false);
}
@@ -36455,7 +36410,7 @@ index 6341e66..ebcf59c 100644
}
EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
-index 17f9ec5..d9a455e 100644
+index 87b704e..2d1d0c1 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -952,7 +952,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
@@ -36486,7 +36441,7 @@ index 13e577c..cef11ee 100644
static void delete_gpe_attr_array(void)
{
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
-index 97683e4..655f6ba 100644
+index 61a9c07..ea98fa1 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1252,7 +1252,7 @@ int ahci_kick_engine(struct ata_port *ap)
@@ -36499,7 +36454,7 @@ index 97683e4..655f6ba 100644
unsigned long timeout_msec)
{
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
-index 485f7ea..9a8df4a 100644
+index d1a05f9..eb70e10 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -99,7 +99,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
@@ -36511,7 +36466,7 @@ index 485f7ea..9a8df4a 100644
struct ata_force_param {
const char *name;
-@@ -4800,7 +4800,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
+@@ -4831,7 +4831,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
struct ata_port *ap;
unsigned int tag;
@@ -36520,7 +36475,7 @@ index 485f7ea..9a8df4a 100644
ap = qc->ap;
qc->flags = 0;
-@@ -4816,7 +4816,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
+@@ -4847,7 +4847,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
struct ata_port *ap;
struct ata_link *link;
@@ -36529,7 +36484,7 @@ index 485f7ea..9a8df4a 100644
WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE));
ap = qc->ap;
link = qc->dev->link;
-@@ -5920,6 +5920,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
+@@ -5951,6 +5951,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
return;
spin_lock(&lock);
@@ -36537,7 +36492,7 @@ index 485f7ea..9a8df4a 100644
for (cur = ops->inherits; cur; cur = cur->inherits) {
void **inherit = (void **)cur;
-@@ -5933,8 +5934,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
+@@ -5964,8 +5965,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
if (IS_ERR(*pp))
*pp = NULL;
@@ -36548,7 +36503,7 @@ index 485f7ea..9a8df4a 100644
spin_unlock(&lock);
}
-@@ -6130,7 +6132,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
+@@ -6161,7 +6163,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
/* give ports names and add SCSI hosts */
for (i = 0; i < host->n_ports; i++) {
@@ -36558,10 +36513,10 @@ index 485f7ea..9a8df4a 100644
}
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
-index 0586f66..1a8f74a 100644
+index 6abd17a..9961bf7 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
-@@ -4151,7 +4151,7 @@ int ata_sas_port_init(struct ata_port *ap)
+@@ -4169,7 +4169,7 @@ int ata_sas_port_init(struct ata_port *ap)
if (rc)
return rc;
@@ -36584,7 +36539,7 @@ index 5f4e0cc..ff2c347 100644
extern int libata_fua;
extern int libata_noacpi;
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
-index 38216b9..4ec6aeb 100644
+index a9b0c82..207d97d 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -865,7 +865,9 @@ static int arasan_cf_probe(struct platform_device *pdev)
@@ -36705,10 +36660,10 @@ index 480fa6f..947067c 100644
if (vcc->pop) vcc->pop(vcc,skb);
else dev_kfree_skb(skb);
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
-index d65975a..0b87e20 100644
+index c7fab3e..68d0965 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
-@@ -522,7 +522,7 @@ static int rx_aal0(struct atm_vcc *vcc)
+@@ -525,7 +525,7 @@ static int rx_aal0(struct atm_vcc *vcc)
DPRINTK(DEV_LABEL "(itf %d): trashing empty cell\n",
vcc->dev->number);
length = 0;
@@ -36717,7 +36672,7 @@ index d65975a..0b87e20 100644
}
else {
length = ATM_CELL_SIZE-1; /* no HEC */
-@@ -577,7 +577,7 @@ static int rx_aal5(struct atm_vcc *vcc)
+@@ -580,7 +580,7 @@ static int rx_aal5(struct atm_vcc *vcc)
size);
}
eff = length = 0;
@@ -36726,7 +36681,7 @@ index d65975a..0b87e20 100644
}
else {
size = (descr & MID_RED_COUNT)*(ATM_CELL_PAYLOAD >> 2);
-@@ -594,7 +594,7 @@ static int rx_aal5(struct atm_vcc *vcc)
+@@ -597,7 +597,7 @@ static int rx_aal5(struct atm_vcc *vcc)
"(VCI=%d,length=%ld,size=%ld (descr 0x%lx))\n",
vcc->dev->number,vcc->vci,length,size << 2,descr);
length = eff = 0;
@@ -36735,7 +36690,7 @@ index d65975a..0b87e20 100644
}
}
skb = eff ? atm_alloc_charge(vcc,eff << 2,GFP_ATOMIC) : NULL;
-@@ -767,7 +767,7 @@ rx_dequeued++;
+@@ -770,7 +770,7 @@ rx_dequeued++;
vcc->push(vcc,skb);
pushed++;
}
@@ -36744,7 +36699,7 @@ index d65975a..0b87e20 100644
}
wake_up(&eni_dev->rx_wait);
}
-@@ -1227,7 +1227,7 @@ static void dequeue_tx(struct atm_dev *dev)
+@@ -1230,7 +1230,7 @@ static void dequeue_tx(struct atm_dev *dev)
PCI_DMA_TODEVICE);
if (vcc->pop) vcc->pop(vcc,skb);
else dev_kfree_skb_irq(skb);
@@ -36791,7 +36746,7 @@ index 82f2ae0..f205c02 100644
default: /* Hmm. Haven't written the code to handle the others yet... -- REW */
printk (KERN_WARNING "Don't know what to do with RX status %x: %s.\n",
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
-index d4725fc..2d4ea65 100644
+index d5d9eaf..65c0d53 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -931,9 +931,9 @@ fore200e_tx_irq(struct fore200e* fore200e)
@@ -37645,10 +37600,10 @@ index 25798db..15f130e 100644
while (1) {
spin_lock(&req_lock);
diff --git a/drivers/base/node.c b/drivers/base/node.c
-index 472168c..4af587e 100644
+index a3b82e9..f90a8ce 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
-@@ -620,7 +620,7 @@ static ssize_t print_nodes_state(enum node_states state, char *buf)
+@@ -614,7 +614,7 @@ static ssize_t print_nodes_state(enum node_states state, char *buf)
struct node_attr {
struct device_attribute attr;
enum node_states state;
@@ -37658,7 +37613,7 @@ index 472168c..4af587e 100644
static ssize_t show_node_state(struct device *dev,
struct device_attribute *attr, char *buf)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index fb83d4a..e1797b3 100644
+index 0d8780c..0b5df3f 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1725,7 +1725,7 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
@@ -37679,7 +37634,7 @@ index fb83d4a..e1797b3 100644
int ret = 0;
if (IS_ERR_OR_NULL(genpd))
-@@ -2215,7 +2215,9 @@ int genpd_dev_pm_attach(struct device *dev)
+@@ -2222,7 +2222,10 @@ int genpd_dev_pm_attach(struct device *dev)
return ret;
}
@@ -37687,14 +37642,15 @@ index fb83d4a..e1797b3 100644
+ pax_open_kernel();
+ *(void **)&dev->pm_domain->detach = genpd_dev_pm_detach;
+ pax_close_kernel();
++
+ pm_genpd_poweron(pd);
return 0;
- }
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
-index a9d26ed..74b8405 100644
+index d2be3f9..0a3167a 100644
--- a/drivers/base/power/sysfs.c
+++ b/drivers/base/power/sysfs.c
-@@ -182,7 +182,7 @@ static ssize_t rtpm_status_show(struct device *dev,
+@@ -181,7 +181,7 @@ static ssize_t rtpm_status_show(struct device *dev,
return -EIO;
}
}
@@ -38085,7 +38041,7 @@ index 434c77d..6d3219a 100644
}
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
-index 9b22f8f..f2932af 100644
+index b905e98..0812ed8 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -385,7 +385,7 @@ struct drbd_epoch {
@@ -38117,17 +38073,8 @@ index 9b22f8f..f2932af 100644
int rs_last_sect_ev; /* counter to compare with */
int rs_last_events; /* counter of read or write "events" (unit sectors)
* on the lower level device when we last looked. */
-@@ -1567,7 +1567,7 @@ static inline int drbd_setsockopt(struct socket *sock, int level, int optname,
- char __user *uoptval;
- int err;
-
-- uoptval = (char __user __force *)optval;
-+ uoptval = (char __force_user *)optval;
-
- set_fs(KERNEL_DS);
- if (level == SOL_SOCKET)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
-index 973c185..05d8b1a 100644
+index 1fc8342..7e7742b 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1328,7 +1328,7 @@ static int _drbd_send_ack(struct drbd_peer_device *peer_device, enum drbd_packet
@@ -38159,7 +38106,7 @@ index 973c185..05d8b1a 100644
atomic_set(&device->ap_in_flight, 0);
atomic_set(&device->md_io.in_use, 0);
-@@ -2688,8 +2688,8 @@ void drbd_destroy_connection(struct kref *kref)
+@@ -2684,8 +2684,8 @@ void drbd_destroy_connection(struct kref *kref)
struct drbd_connection *connection = container_of(kref, struct drbd_connection, kref);
struct drbd_resource *resource = connection->resource;
@@ -38171,10 +38118,10 @@ index 973c185..05d8b1a 100644
idr_destroy(&connection->peer_devices);
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
-index 1cd47df..57c53c0 100644
+index 74df8cf..e41fc24 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
-@@ -3645,13 +3645,13 @@ finish:
+@@ -3637,13 +3637,13 @@ finish:
void drbd_bcast_event(struct drbd_device *device, const struct sib_info *sib)
{
@@ -38191,7 +38138,7 @@ index 1cd47df..57c53c0 100644
if (!msg)
goto failed;
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
-index 6960fb0..215d76b 100644
+index d169b4a..481463f 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -870,7 +870,7 @@ int drbd_connected(struct drbd_peer_device *peer_device)
@@ -38288,7 +38235,7 @@ index 6960fb0..215d76b 100644
+ atomic_read_unchecked(&device->rs_sect_ev);
if (atomic_read(&device->ap_actlog_cnt)
- || !device->rs_last_events || curr_events - device->rs_last_events > 64) {
+ || curr_events - device->rs_last_events > 64) {
@@ -2618,7 +2618,7 @@ static int receive_DataRequest(struct drbd_connection *connection, struct packet
device->use_csums = true;
} else if (pi->cmd == P_OV_REPLY) {
@@ -38344,7 +38291,7 @@ index 6960fb0..215d76b 100644
static struct asender_cmd asender_tbl[] = {
[P_PING] = { 0, got_Ping },
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
-index d2d1f97..6a1188f 100644
+index d0fae55..4469096 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -408,7 +408,7 @@ static int read_for_csum(struct drbd_peer_device *peer_device, sector_t sector,
@@ -38365,8 +38312,8 @@ index d2d1f97..6a1188f 100644
device->rs_in_flight -= sect_in;
rcu_read_lock();
-@@ -1594,8 +1594,8 @@ void drbd_rs_controller_reset(struct drbd_device *device)
- {
+@@ -1595,8 +1595,8 @@ void drbd_rs_controller_reset(struct drbd_device *device)
+ struct gendisk *disk = device->ldev->backing_bdev->bd_contains->bd_disk;
struct fifo_buffer *plan;
- atomic_set(&device->rs_sect_in, 0);
@@ -38374,8 +38321,8 @@ index d2d1f97..6a1188f 100644
+ atomic_set_unchecked(&device->rs_sect_in, 0);
+ atomic_set_unchecked(&device->rs_sect_ev, 0);
device->rs_in_flight = 0;
-
- /* Updating the RCU protected object in place is necessary since
+ device->rs_last_events =
+ (int)part_stat_read(&disk->part0, sectors[0]) +
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 6cb1beb..bf490f7 100644
--- a/drivers/block/loop.c
@@ -38390,36 +38337,25 @@ index 6cb1beb..bf490f7 100644
file_end_write(file);
if (likely(bw == len))
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
-index e2bb8af..44b8aef 100644
+index d826bf3..8eb406c 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
-@@ -73,7 +73,6 @@ static LIST_HEAD(dev_list);
+@@ -76,7 +76,6 @@ static LIST_HEAD(dev_list);
static struct task_struct *nvme_thread;
static struct workqueue_struct *nvme_workq;
static wait_queue_head_t nvme_kthread_wait;
-static struct notifier_block nvme_nb;
static void nvme_reset_failed_dev(struct work_struct *ws);
-
-@@ -2926,6 +2925,10 @@ static struct pci_driver nvme_driver = {
- .err_handler = &nvme_err_handler,
- };
-
-+static struct notifier_block nvme_nb = {
-+ .notifier_call = &nvme_cpu_notify,
-+};
-+
- static int __init nvme_init(void)
- {
- int result;
-@@ -2942,7 +2945,6 @@ static int __init nvme_init(void)
- else if (result > 0)
- nvme_major = result;
-
-- nvme_nb.notifier_call = &nvme_cpu_notify;
- result = register_hotcpu_notifier(&nvme_nb);
- if (result)
- goto unregister_blkdev;
+ static int nvme_process_cq(struct nvme_queue *nvmeq);
+@@ -2955,7 +2954,6 @@ static int __init nvme_init(void)
+ static void __exit nvme_exit(void)
+ {
+ pci_unregister_driver(&nvme_driver);
+- unregister_hotcpu_notifier(&nvme_nb);
+ unregister_blkdev(nvme_major, "nvme");
+ destroy_workqueue(nvme_workq);
+ BUG_ON(nvme_thread && !IS_ERR(nvme_thread));
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 09e628da..7607aaa 100644
--- a/drivers/block/pktcdvd.c
@@ -38442,6 +38378,19 @@ index 09e628da..7607aaa 100644
if (ti.nwa_v) {
pd->nwa = be32_to_cpu(ti.next_writable);
+diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
+index 8a86b62..f54c87e 100644
+--- a/drivers/block/rbd.c
++++ b/drivers/block/rbd.c
+@@ -63,7 +63,7 @@
+ * If the counter is already at its maximum value returns
+ * -EINVAL without updating it.
+ */
+-static int atomic_inc_return_safe(atomic_t *v)
++static int __intentional_overflow(-1) atomic_inc_return_safe(atomic_t *v)
+ {
+ unsigned int counter;
+
diff --git a/drivers/block/smart1,2.h b/drivers/block/smart1,2.h
index e5565fb..71be10b4 100644
--- a/drivers/block/smart1,2.h
@@ -38513,7 +38462,7 @@ index e5565fb..71be10b4 100644
+ .command_completed = smart1_completed,
};
diff --git a/drivers/bluetooth/btwilink.c b/drivers/bluetooth/btwilink.c
-index f038dba..bb74c08 100644
+index 55c135b..9f8d60c 100644
--- a/drivers/bluetooth/btwilink.c
+++ b/drivers/bluetooth/btwilink.c
@@ -288,7 +288,7 @@ static int ti_st_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
@@ -38672,10 +38621,10 @@ index d5d4cd8..22d561d 100644
{
struct hpet_timer __iomem *timer;
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
-index f816211..89eadea 100644
+index 6b65fa4..8ebbc99 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
-@@ -438,7 +438,7 @@ struct ipmi_smi {
+@@ -436,7 +436,7 @@ struct ipmi_smi {
struct proc_dir_entry *proc_dir;
char proc_dir_name[10];
@@ -38684,7 +38633,7 @@ index f816211..89eadea 100644
/*
* run_to_completion duplicate of smb_info, smi_info
-@@ -470,9 +470,9 @@ static LIST_HEAD(smi_watchers);
+@@ -468,9 +468,9 @@ static LIST_HEAD(smi_watchers);
static DEFINE_MUTEX(smi_watchers_mutex);
#define ipmi_inc_stat(intf, stat) \
@@ -38694,9 +38643,9 @@ index f816211..89eadea 100644
- ((unsigned int) atomic_read(&(intf)->stats[IPMI_STAT_ ## stat]))
+ ((unsigned int) atomic_read_unchecked(&(intf)->stats[IPMI_STAT_ ## stat]))
- static int is_lan_addr(struct ipmi_addr *addr)
- {
-@@ -2925,7 +2925,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
+ static char *addr_src_to_str[] = { "invalid", "hotmod", "hardcoded", "SPMI",
+ "ACPI", "SMBIOS", "PCI",
+@@ -2837,7 +2837,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
INIT_LIST_HEAD(&intf->cmd_rcvrs);
init_waitqueue_head(&intf->waitq);
for (i = 0; i < IPMI_NUM_STATS; i++)
@@ -38706,10 +38655,10 @@ index f816211..89eadea 100644
intf->proc_dir = NULL;
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
-index 5c4e1f6..0ea58f9 100644
+index 967b73a..946e94c 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
-@@ -285,7 +285,7 @@ struct smi_info {
+@@ -284,7 +284,7 @@ struct smi_info {
unsigned char slave_addr;
/* Counters and things for the proc filesystem. */
@@ -38718,7 +38667,7 @@ index 5c4e1f6..0ea58f9 100644
struct task_struct *thread;
-@@ -294,9 +294,9 @@ struct smi_info {
+@@ -293,9 +293,9 @@ struct smi_info {
};
#define smi_inc_stat(smi, stat) \
@@ -38730,7 +38679,7 @@ index 5c4e1f6..0ea58f9 100644
#define SI_MAX_PARMS 4
-@@ -3377,7 +3377,7 @@ static int try_smi_init(struct smi_info *new_smi)
+@@ -3412,7 +3412,7 @@ static int try_smi_init(struct smi_info *new_smi)
atomic_set(&new_smi->req_events, 0);
new_smi->run_to_completion = false;
for (i = 0; i < SI_NUM_STATS; i++)
@@ -38738,9 +38687,9 @@ index 5c4e1f6..0ea58f9 100644
+ atomic_set_unchecked(&new_smi->stats[i], 0);
new_smi->interrupt_disabled = true;
- atomic_set(&new_smi->stop_operation, 0);
+ atomic_set(&new_smi->need_watch, 0);
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
-index 524b707..62a3d70 100644
+index 4c58333..d5cca27 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -18,6 +18,7 @@
@@ -38788,7 +38737,7 @@ index 524b707..62a3d70 100644
#else
static inline int range_is_allowed(unsigned long pfn, unsigned long size)
{
-@@ -121,7 +135,8 @@ static ssize_t read_mem(struct file *file, char __user *buf,
+@@ -124,7 +138,8 @@ static ssize_t read_mem(struct file *file, char __user *buf,
#endif
while (count > 0) {
@@ -38798,7 +38747,7 @@ index 524b707..62a3d70 100644
sz = size_inside_page(p, count);
-@@ -137,7 +152,24 @@ static ssize_t read_mem(struct file *file, char __user *buf,
+@@ -140,7 +155,24 @@ static ssize_t read_mem(struct file *file, char __user *buf,
if (!ptr)
return -EFAULT;
@@ -38824,7 +38773,7 @@ index 524b707..62a3d70 100644
unxlate_dev_mem_ptr(p, ptr);
if (remaining)
return -EFAULT;
-@@ -369,9 +401,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -372,9 +404,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
unsigned long p = *ppos;
@@ -38835,7 +38784,7 @@ index 524b707..62a3d70 100644
read = 0;
if (p < (unsigned long) high_memory) {
-@@ -393,6 +424,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -396,6 +427,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
}
#endif
while (low_count > 0) {
@@ -38844,9 +38793,9 @@ index 524b707..62a3d70 100644
sz = size_inside_page(p, low_count);
/*
-@@ -402,7 +435,23 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -405,7 +438,23 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
*/
- kbuf = xlate_dev_kmem_ptr((char *)p);
+ kbuf = xlate_dev_kmem_ptr((void *)p);
- if (copy_to_user(buf, kbuf, sz))
+#ifdef CONFIG_PAX_USERCOPY
@@ -38869,7 +38818,7 @@ index 524b707..62a3d70 100644
return -EFAULT;
buf += sz;
p += sz;
-@@ -797,6 +846,9 @@ static const struct memdev {
+@@ -800,6 +849,9 @@ static const struct memdev {
#ifdef CONFIG_PRINTK
[11] = { "kmsg", 0644, &kmsg_fops, NULL },
#endif
@@ -38879,7 +38828,7 @@ index 524b707..62a3d70 100644
};
static int memory_open(struct inode *inode, struct file *filp)
-@@ -868,7 +920,7 @@ static int __init chr_dev_init(void)
+@@ -871,7 +923,7 @@ static int __init chr_dev_init(void)
continue;
device_create(mem_class, NULL, MKDEV(MEM_MAJOR, minor),
@@ -39037,7 +38986,7 @@ index 9cd6968..6416f00 100644
entropy_count = *(int *)table->data >> ENTROPY_SHIFT;
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
-index 7cc1fe22..b602d6b 100644
+index e496dae..b793e7d 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -54,6 +54,7 @@
@@ -39129,10 +39078,10 @@ index 3a56a13..f8cbd25 100644
return 0;
}
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
-index cf7a561..c319ce0 100644
+index de03df9..0a309a9 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
-@@ -684,7 +684,7 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count,
+@@ -684,7 +684,7 @@ static ssize_t fill_readbuf(struct port *port, char __user *out_buf,
if (to_user) {
ssize_t ret;
@@ -39141,7 +39090,7 @@ index cf7a561..c319ce0 100644
if (ret)
return -EFAULT;
} else {
-@@ -787,7 +787,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
+@@ -788,7 +788,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
if (!port_has_data(port) && !port->host_connected)
return 0;
@@ -39151,10 +39100,10 @@ index cf7a561..c319ce0 100644
static int wait_port_writable(struct port *port, bool nonblock)
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
-index b9355da..9611f4e 100644
+index 4386697..754ceca 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
-@@ -191,7 +191,7 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
+@@ -192,7 +192,7 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
struct clk *clk;
struct clk_init_data init;
struct clk_composite *composite;
@@ -39274,10 +39223,10 @@ index b0c18ed..1713a80 100644
cpu_notifier_register_begin();
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
-index f657c57..31d97ae 100644
+index fde97d6..3631eca 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
-@@ -362,7 +362,9 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
+@@ -393,7 +393,9 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
if (!IS_ERR(cpu_reg))
regulator_put(cpu_reg);
@@ -39289,10 +39238,10 @@ index f657c57..31d97ae 100644
ret = cpufreq_register_driver(&dt_cpufreq_driver);
if (ret)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
-index e3bf702..4dbf06c 100644
+index 7030c40..3a97de6 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
-@@ -2122,7 +2122,7 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor)
+@@ -2135,7 +2135,7 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor)
}
mutex_lock(&cpufreq_governor_mutex);
@@ -39301,7 +39250,7 @@ index e3bf702..4dbf06c 100644
mutex_unlock(&cpufreq_governor_mutex);
return;
}
-@@ -2338,7 +2338,7 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb,
+@@ -2351,7 +2351,7 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}
@@ -39310,7 +39259,7 @@ index e3bf702..4dbf06c 100644
.notifier_call = cpufreq_cpu_callback,
};
-@@ -2378,13 +2378,17 @@ int cpufreq_boost_trigger_state(int state)
+@@ -2391,13 +2391,17 @@ int cpufreq_boost_trigger_state(int state)
return 0;
write_lock_irqsave(&cpufreq_driver_lock, flags);
@@ -39330,7 +39279,7 @@ index e3bf702..4dbf06c 100644
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
pr_err("%s: Cannot %s BOOST\n",
-@@ -2441,8 +2445,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
+@@ -2454,8 +2458,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
pr_debug("trying to register driver %s\n", driver_data->name);
@@ -39344,7 +39293,7 @@ index e3bf702..4dbf06c 100644
write_lock_irqsave(&cpufreq_driver_lock, flags);
if (cpufreq_driver) {
-@@ -2457,8 +2464,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
+@@ -2470,8 +2477,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
* Check if driver provides function to enable boost -
* if not, use cpufreq_boost_set_sw as default
*/
@@ -39446,7 +39395,7 @@ index ad3f38f..8f086cd 100644
}
EXPORT_SYMBOL_GPL(od_unregister_powersave_bias_handler);
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
-index 27bb6d3..4cf595c 100644
+index 742eefb..e2fcfc8 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -133,10 +133,10 @@ struct pstate_funcs {
@@ -39459,10 +39408,10 @@ index 27bb6d3..4cf595c 100644
static struct pstate_adjust_policy pid_params;
-static struct pstate_funcs pstate_funcs;
+static struct pstate_funcs *pstate_funcs;
+ static int hwp_active;
struct perf_limits {
- int no_turbo;
-@@ -594,18 +594,18 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate)
+@@ -653,18 +653,18 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate)
cpu->pstate.current_pstate = pstate;
@@ -39488,7 +39437,7 @@ index 27bb6d3..4cf595c 100644
intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate);
}
-@@ -875,9 +875,9 @@ static int intel_pstate_msrs_not_valid(void)
+@@ -988,9 +988,9 @@ static int intel_pstate_msrs_not_valid(void)
rdmsrl(MSR_IA32_APERF, aperf);
rdmsrl(MSR_IA32_MPERF, mperf);
@@ -39501,7 +39450,7 @@ index 27bb6d3..4cf595c 100644
return -ENODEV;
rdmsrl(MSR_IA32_APERF, tmp);
-@@ -891,7 +891,7 @@ static int intel_pstate_msrs_not_valid(void)
+@@ -1004,7 +1004,7 @@ static int intel_pstate_msrs_not_valid(void)
return 0;
}
@@ -39510,7 +39459,7 @@ index 27bb6d3..4cf595c 100644
{
pid_params.sample_rate_ms = policy->sample_rate_ms;
pid_params.p_gain_pct = policy->p_gain_pct;
-@@ -903,12 +903,7 @@ static void copy_pid_params(struct pstate_adjust_policy *policy)
+@@ -1016,12 +1016,7 @@ static void copy_pid_params(struct pstate_adjust_policy *policy)
static void copy_cpu_funcs(struct pstate_funcs *funcs)
{
@@ -39685,7 +39634,7 @@ index 7d4a315..21bb886 100644
if (policy->cpu != 0)
return -ENODEV;
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
-index e431d11..d0b997e 100644
+index 2697e87..c32476c 100644
--- a/drivers/cpuidle/driver.c
+++ b/drivers/cpuidle/driver.c
@@ -194,7 +194,7 @@ static int poll_idle(struct cpuidle_device *dev,
@@ -39768,7 +39717,7 @@ index 30b538d8..1610d75 100644
mutex_unlock(&devfreq_list_lock);
diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
-index 42d4974..2714f36 100644
+index 3a2adb1..b3be9a3 100644
--- a/drivers/dma/sh/shdma-base.c
+++ b/drivers/dma/sh/shdma-base.c
@@ -228,8 +228,8 @@ static int shdma_alloc_chan_resources(struct dma_chan *chan)
@@ -39783,7 +39732,7 @@ index 42d4974..2714f36 100644
ret = -ENOMEM;
goto edescalloc;
diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c
-index 58eb857..d7e42c8 100644
+index aec8a84..7b45a1f 100644
--- a/drivers/dma/sh/shdmac.c
+++ b/drivers/dma/sh/shdmac.c
@@ -513,7 +513,7 @@ static int sh_dmae_nmi_handler(struct notifier_block *self,
@@ -39812,7 +39761,7 @@ index 592af5f..bb1d583 100644
EXPORT_SYMBOL_GPL(edac_device_alloc_index);
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
-index a6cd361..7bdbf53 100644
+index 670d282..6675f4d 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -154,7 +154,7 @@ static const char * const edac_caps[] = {
@@ -39868,10 +39817,10 @@ index 2cf44b4d..6dd2dc7 100644
EXPORT_SYMBOL_GPL(edac_pci_alloc_index);
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
-index e8658e4..22746d6 100644
+index 24d877f..4e30133 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
-@@ -26,8 +26,8 @@ static int edac_pci_log_pe = 1; /* log PCI parity errors */
+@@ -23,8 +23,8 @@ static int edac_pci_log_pe = 1; /* log PCI parity errors */
static int edac_pci_log_npe = 1; /* log PCI non-parity error errors */
static int edac_pci_poll_msec = 1000; /* one second workq period */
@@ -39882,7 +39831,7 @@ index e8658e4..22746d6 100644
static struct kobject *edac_pci_top_main_kobj;
static atomic_t edac_pci_sysfs_refcount = ATOMIC_INIT(0);
-@@ -235,7 +235,7 @@ struct edac_pci_dev_attribute {
+@@ -232,7 +232,7 @@ struct edac_pci_dev_attribute {
void *value;
ssize_t(*show) (void *, char *);
ssize_t(*store) (void *, const char *, size_t);
@@ -39891,7 +39840,7 @@ index e8658e4..22746d6 100644
/* Set of show/store abstract level functions for PCI Parity object */
static ssize_t edac_pci_dev_show(struct kobject *kobj, struct attribute *attr,
-@@ -579,7 +579,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -576,7 +576,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
edac_printk(KERN_CRIT, EDAC_PCI,
"Signaled System Error on %s\n",
pci_name(dev));
@@ -39900,7 +39849,7 @@ index e8658e4..22746d6 100644
}
if (status & (PCI_STATUS_PARITY)) {
-@@ -587,7 +587,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -584,7 +584,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
"Master Data Parity Error on %s\n",
pci_name(dev));
@@ -39909,7 +39858,7 @@ index e8658e4..22746d6 100644
}
if (status & (PCI_STATUS_DETECTED_PARITY)) {
-@@ -595,7 +595,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -592,7 +592,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
"Detected Parity Error on %s\n",
pci_name(dev));
@@ -39918,7 +39867,7 @@ index e8658e4..22746d6 100644
}
}
-@@ -618,7 +618,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -615,7 +615,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
"Signaled System Error on %s\n",
pci_name(dev));
@@ -39927,7 +39876,7 @@ index e8658e4..22746d6 100644
}
if (status & (PCI_STATUS_PARITY)) {
-@@ -626,7 +626,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -623,7 +623,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
"Master Data Parity Error on "
"%s\n", pci_name(dev));
@@ -39936,7 +39885,7 @@ index e8658e4..22746d6 100644
}
if (status & (PCI_STATUS_DETECTED_PARITY)) {
-@@ -634,7 +634,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -631,7 +631,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
"Detected Parity Error on %s\n",
pci_name(dev));
@@ -39945,7 +39894,7 @@ index e8658e4..22746d6 100644
}
}
}
-@@ -672,7 +672,7 @@ void edac_pci_do_parity_check(void)
+@@ -669,7 +669,7 @@ void edac_pci_do_parity_check(void)
if (!check_pci_errors)
return;
@@ -39954,7 +39903,7 @@ index e8658e4..22746d6 100644
/* scan all PCI devices looking for a Parity Error on devices and
* bridges.
-@@ -684,7 +684,7 @@ void edac_pci_do_parity_check(void)
+@@ -681,7 +681,7 @@ void edac_pci_do_parity_check(void)
/* Only if operator has selected panic on PCI Error */
if (edac_pci_get_panic_on_pe()) {
/* If the count is different 'after' from 'before' */
@@ -39964,10 +39913,10 @@ index e8658e4..22746d6 100644
}
}
diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h
-index 51b7e3a..aa8a3e8 100644
+index c2359a1..8bd119d 100644
--- a/drivers/edac/mce_amd.h
+++ b/drivers/edac/mce_amd.h
-@@ -77,7 +77,7 @@ struct amd_decoder_ops {
+@@ -74,7 +74,7 @@ struct amd_decoder_ops {
bool (*mc0_mce)(u16, u8);
bool (*mc1_mce)(u16, u8);
bool (*mc2_mce)(u16, u8);
@@ -40002,10 +39951,10 @@ index 57ea7f4..af06b76 100644
card->driver->update_phy_reg(card, 4,
PHY_LINK_ACTIVE | PHY_CONTENDER, 0);
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c
-index 2c6d5e1..a2cca6b 100644
+index f9e3aee..269dbdb 100644
--- a/drivers/firewire/core-device.c
+++ b/drivers/firewire/core-device.c
-@@ -253,7 +253,7 @@ EXPORT_SYMBOL(fw_device_enable_phys_dma);
+@@ -256,7 +256,7 @@ EXPORT_SYMBOL(fw_device_enable_phys_dma);
struct config_rom_attribute {
struct device_attribute attr;
u32 key;
@@ -40039,10 +39988,10 @@ index e1480ff6..1a429bd 100644
void fw_card_initialize(struct fw_card *card,
const struct fw_card_driver *driver, struct device *device);
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
-index a66a321..f6caf20 100644
+index aff9018..fc87ded 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
-@@ -2056,10 +2056,12 @@ static void bus_reset_work(struct work_struct *work)
+@@ -2054,10 +2054,12 @@ static void bus_reset_work(struct work_struct *work)
be32_to_cpu(ohci->next_header));
}
@@ -40055,7 +40004,7 @@ index a66a321..f6caf20 100644
spin_unlock_irq(&ohci->lock);
-@@ -2591,8 +2593,10 @@ static int ohci_enable_phys_dma(struct fw_card *card,
+@@ -2589,8 +2591,10 @@ static int ohci_enable_phys_dma(struct fw_card *card,
unsigned long flags;
int n, ret = 0;
@@ -40080,10 +40029,10 @@ index 94a58a0..f5eba42 100644
container_of(_dev_attr, struct dmi_device_attribute, dev_attr)
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
-index 17afc51..0ef90cd 100644
+index c5f7b4e..74bc7c9 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
-@@ -835,7 +835,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *),
+@@ -900,7 +900,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *),
if (buf == NULL)
return -1;
@@ -40093,7 +40042,7 @@ index 17afc51..0ef90cd 100644
dmi_unmap(buf);
return 0;
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
-index 5b53d61..72cee96 100644
+index 4fd9961..52d60ce 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
@@ -44,12 +44,12 @@ static char rcd_decode_str[CPER_REC_LEN];
@@ -40114,10 +40063,10 @@ index 5b53d61..72cee96 100644
EXPORT_SYMBOL_GPL(cper_next_record_id);
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
-index 8590099..d83627a 100644
+index 9035c1b..aff45f8 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
-@@ -148,14 +148,16 @@ static struct attribute_group efi_subsys_attr_group = {
+@@ -151,14 +151,16 @@ static struct attribute_group efi_subsys_attr_group = {
};
static struct efivars generic_efivars;
@@ -40169,7 +40118,7 @@ index 2f569aa..c95f4fb 100644
}
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
-index fe49ec3..1ade794 100644
+index 3cfcfc6..09d6f117 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -278,7 +278,7 @@ static int em_gio_probe(struct platform_device *pdev)
@@ -40182,7 +40131,7 @@ index fe49ec3..1ade794 100644
int ret;
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
-index 3784e81..73637b5 100644
+index 7818cd1..1be40e5 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -94,7 +94,7 @@ struct ichx_desc {
@@ -40195,10 +40144,10 @@ index 3784e81..73637b5 100644
static struct {
spinlock_t lock;
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
-index 415682f..08438b8 100644
+index f476ae2..05e1bdd 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
-@@ -1162,7 +1162,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
+@@ -1188,7 +1188,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
const struct omap_gpio_platform_data *pdata;
struct resource *res;
struct gpio_bank *bank;
@@ -40208,10 +40157,10 @@ index 415682f..08438b8 100644
match = of_match_device(of_match_ptr(omap_gpio_match), dev);
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
-index bf6c094..6573caf 100644
+index 584484e..e26ebd6 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
-@@ -357,7 +357,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
+@@ -366,7 +366,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
struct gpio_rcar_priv *p;
struct resource *io, *irq;
struct gpio_chip *gpio_chip;
@@ -40221,7 +40170,7 @@ index bf6c094..6573caf 100644
const char *name = dev_name(dev);
int ret;
diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c
-index dbf28fa..04dad4e 100644
+index c1caa45..f0f97d2 100644
--- a/drivers/gpio/gpio-vr41xx.c
+++ b/drivers/gpio/gpio-vr41xx.c
@@ -224,7 +224,7 @@ static int giu_get_irq(unsigned int irq)
@@ -40234,10 +40183,10 @@ index dbf28fa..04dad4e 100644
return -EINVAL;
}
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
-index c81bda0..a8ccd9f 100644
+index 568aa2b..d1204d8 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
-@@ -539,8 +539,10 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
+@@ -554,8 +554,10 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
}
if (gpiochip->irqchip) {
@@ -40250,7 +40199,7 @@ index c81bda0..a8ccd9f 100644
gpiochip->irqchip = NULL;
}
}
-@@ -606,8 +608,11 @@ int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
+@@ -621,8 +623,11 @@ int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
gpiochip->irqchip = NULL;
return -EINVAL;
}
@@ -40265,10 +40214,10 @@ index c81bda0..a8ccd9f 100644
/*
* Prepare the mapping since the irqchip shall be orthogonal to
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
-index e79c8d3..a9370bc 100644
+index 5213da4..7ef736e 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
-@@ -3900,7 +3900,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
+@@ -3961,7 +3961,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
goto done;
}
@@ -40278,10 +40227,10 @@ index e79c8d3..a9370bc 100644
ret = -EFAULT;
goto done;
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
-index bc3da32..7289357 100644
+index 4f41377..ee33f40 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
-@@ -443,7 +443,7 @@ void drm_unplug_dev(struct drm_device *dev)
+@@ -444,7 +444,7 @@ void drm_unplug_dev(struct drm_device *dev)
drm_device_set_unplugged(dev);
@@ -40290,34 +40239,8 @@ index bc3da32..7289357 100644
drm_put_dev(dev);
}
mutex_unlock(&drm_global_mutex);
-diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
-index e9a2827..5df4716 100644
---- a/drivers/gpu/drm/drm_fb_helper.c
-+++ b/drivers/gpu/drm/drm_fb_helper.c
-@@ -771,7 +771,9 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info)
- int i, j, rc = 0;
- int start;
-
-- drm_modeset_lock_all(dev);
-+ if (__drm_modeset_lock_all(dev, !!oops_in_progress)) {
-+ return -EBUSY;
-+ }
- if (!drm_fb_helper_is_bound(fb_helper)) {
- drm_modeset_unlock_all(dev);
- return -EBUSY;
-@@ -945,7 +947,9 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
- int ret = 0;
- int i;
-
-- drm_modeset_lock_all(dev);
-+ if (__drm_modeset_lock_all(dev, !!oops_in_progress)) {
-+ return -EBUSY;
-+ }
- if (!drm_fb_helper_is_bound(fb_helper)) {
- drm_modeset_unlock_all(dev);
- return -EBUSY;
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
-index ed7bc68..0d536af 100644
+index 0b9514b..6acd174 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -89,7 +89,7 @@ int drm_open(struct inode *inode, struct file *filp)
@@ -40542,10 +40465,10 @@ index 93ec5dc..82acbaf 100644
int front_offset;
} drm_i810_private_t;
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
-index 318ade9..1f5de55 100644
+index ecee3bc..ad5ae67 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
-@@ -1294,7 +1294,7 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
+@@ -356,7 +356,7 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
* locking inversion with the driver load path. And the access here is
* completely racy anyway. So don't bother with locking for now.
*/
@@ -40555,10 +40478,10 @@ index 318ade9..1f5de55 100644
static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
-index 1a0611b..dd1fbfc 100644
+index 1173831..7dfb389 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
-@@ -866,12 +866,12 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec)
+@@ -863,12 +863,12 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec)
static int
validate_exec_list(struct drm_device *dev,
struct drm_i915_gem_exec_object2 *exec,
@@ -40574,7 +40497,7 @@ index 1a0611b..dd1fbfc 100644
invalid_flags = __EXEC_OBJECT_UNKNOWN_FLAGS;
if (USES_FULL_PPGTT(dev))
diff --git a/drivers/gpu/drm/i915/i915_ioc32.c b/drivers/gpu/drm/i915/i915_ioc32.c
-index 2e0613e..a8b94d9 100644
+index 176de63..1ef9ac7 100644
--- a/drivers/gpu/drm/i915/i915_ioc32.c
+++ b/drivers/gpu/drm/i915/i915_ioc32.c
@@ -181,7 +181,7 @@ static int compat_i915_alloc(struct file *file, unsigned int cmd,
@@ -40586,7 +40509,7 @@ index 2e0613e..a8b94d9 100644
[DRM_I915_BATCHBUFFER] = compat_i915_batchbuffer,
[DRM_I915_CMDBUFFER] = compat_i915_cmdbuffer,
[DRM_I915_GETPARAM] = compat_i915_getparam,
-@@ -202,18 +202,15 @@ static drm_ioctl_compat_t *i915_compat_ioctls[] = {
+@@ -201,18 +201,15 @@ static drm_ioctl_compat_t *i915_compat_ioctls[] = {
long i915_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
unsigned int nr = DRM_IOCTL_NR(cmd);
@@ -40609,10 +40532,10 @@ index 2e0613e..a8b94d9 100644
return ret;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
-index 31b9664..5d478d3 100644
+index e7a16f1..e0d82e8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
-@@ -12811,13 +12811,13 @@ struct intel_quirk {
+@@ -12935,13 +12935,13 @@ struct intel_quirk {
int subsystem_vendor;
int subsystem_device;
void (*hook)(struct drm_device *dev);
@@ -40628,7 +40551,7 @@ index 31b9664..5d478d3 100644
static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
{
-@@ -12825,18 +12825,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
+@@ -12949,18 +12949,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
return 1;
}
@@ -40659,6 +40582,19 @@ index 31b9664..5d478d3 100644
.hook = quirk_invert_brightness,
},
};
+diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
+index b250130..98df2a4 100644
+--- a/drivers/gpu/drm/imx/imx-drm-core.c
++++ b/drivers/gpu/drm/imx/imx-drm-core.c
+@@ -356,7 +356,7 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
+ if (imxdrm->pipes >= MAX_CRTC)
+ return -EINVAL;
+
+- if (imxdrm->drm->open_count)
++ if (local_read(&imxdrm->drm->open_count))
+ return -EBUSY;
+
+ imx_drm_crtc = kzalloc(sizeof(*imx_drm_crtc), GFP_KERNEL);
diff --git a/drivers/gpu/drm/mga/mga_drv.h b/drivers/gpu/drm/mga/mga_drv.h
index b4a2014..219ab78 100644
--- a/drivers/gpu/drm/mga/mga_drv.h
@@ -40751,7 +40687,7 @@ index 1b071b8..de8601a 100644
*sequence = cur_fence;
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
-index dae2c96..324dbe4 100644
+index 7df6acc..84bbe52 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -963,7 +963,7 @@ static int parse_bit_tmds_tbl_entry(struct drm_device *dev, struct nvbios *bios,
@@ -41168,7 +41104,7 @@ index c2ae496..30b5993 100644
return IRQ_HANDLED;
}
diff --git a/drivers/gpu/drm/r128/r128_state.c b/drivers/gpu/drm/r128/r128_state.c
-index 575e986..66e62ca 100644
+index 8fd2d9f..18c9660 100644
--- a/drivers/gpu/drm/r128/r128_state.c
+++ b/drivers/gpu/drm/r128/r128_state.c
@@ -320,10 +320,10 @@ static void r128_clear_box(drm_r128_private_t *dev_priv,
@@ -41185,7 +41121,7 @@ index 575e986..66e62ca 100644
#endif
diff --git a/drivers/gpu/drm/radeon/mkregtable.c b/drivers/gpu/drm/radeon/mkregtable.c
-index 4a85bb6..aaea819 100644
+index b928c17..e5d9400 100644
--- a/drivers/gpu/drm/radeon/mkregtable.c
+++ b/drivers/gpu/drm/radeon/mkregtable.c
@@ -624,14 +624,14 @@ static int parser_auth(struct table *t, const char *filename)
@@ -41206,10 +41142,10 @@ index 4a85bb6..aaea819 100644
if (regcomp
(&mask_rex, "(0x[0-9a-fA-F]*) *([_a-zA-Z0-9]*)", REG_EXTENDED)) {
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
-index bdf263a..0305446 100644
+index bd7519f..e1c2cd95 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
-@@ -1216,7 +1216,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev)
+@@ -1247,7 +1247,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev)
* locking inversion with the driver load path. And the access here is
* completely racy anyway. So don't bother with locking for now.
*/
@@ -41300,7 +41236,7 @@ index 244b19b..c19226d 100644
dev->max_vblank_count = 0x001fffff;
diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c
-index 535403e..5dd655b 100644
+index 15aee72..cda326e 100644
--- a/drivers/gpu/drm/radeon/radeon_state.c
+++ b/drivers/gpu/drm/radeon/radeon_state.c
@@ -2168,7 +2168,7 @@ static int radeon_cp_clear(struct drm_device *dev, void *data, struct drm_file *
@@ -41322,10 +41258,10 @@ index 535403e..5dd655b 100644
DRM_DEBUG("pid=%d\n", DRM_CURRENTPID);
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
-index d2510cf..63bd4ed 100644
+index d02aa1d..ca19e2c 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
-@@ -936,7 +936,7 @@ void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size)
+@@ -959,7 +959,7 @@ void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size)
man->size = size >> PAGE_SHIFT;
}
@@ -41334,7 +41270,7 @@ index d2510cf..63bd4ed 100644
static const struct vm_operations_struct *ttm_vm_ops = NULL;
static int radeon_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-@@ -977,8 +977,10 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
+@@ -1000,8 +1000,10 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
}
if (unlikely(ttm_vm_ops == NULL)) {
ttm_vm_ops = vma->vm_ops;
@@ -41346,10 +41282,10 @@ index d2510cf..63bd4ed 100644
vma->vm_ops = &radeon_ttm_vm_ops;
return 0;
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
-index 054a79f..30d9ac4 100644
+index 978993f..e36e50e 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
-@@ -1242,7 +1242,7 @@ static int tegra_dc_debugfs_init(struct tegra_dc *dc, struct drm_minor *minor)
+@@ -1416,7 +1416,7 @@ static int tegra_dc_debugfs_init(struct tegra_dc *dc, struct drm_minor *minor)
}
for (i = 0; i < ARRAY_SIZE(debugfs_files); i++)
@@ -41359,10 +41295,10 @@ index 054a79f..30d9ac4 100644
err = drm_debugfs_create_files(dc->debugfs_files,
ARRAY_SIZE(debugfs_files),
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
-index f787445..2df2c65 100644
+index 33f67fd..55ee9761 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
-@@ -41,7 +41,7 @@ struct tegra_dsi {
+@@ -39,7 +39,7 @@ struct tegra_dsi {
struct clk *clk_lp;
struct clk *clk;
@@ -41385,10 +41321,10 @@ index ffe2654..03c7b1c 100644
struct dentry *debugfs;
};
diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
-index 964387f..4eafc00 100644
+index aa0bd054..aea6a01 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
-@@ -146,10 +146,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
+@@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
}
const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
@@ -41841,10 +41777,10 @@ index 37ac7b5..d52a5c9 100644
/* copy over all the bus versions */
if (dev->bus && dev->bus->pm) {
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
-index dfaccfc..bfea740 100644
+index 8b63879..a5a5e72 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
-@@ -2507,7 +2507,7 @@ EXPORT_SYMBOL_GPL(hid_ignore);
+@@ -2508,7 +2508,7 @@ EXPORT_SYMBOL_GPL(hid_ignore);
int hid_add_device(struct hid_device *hdev)
{
@@ -41853,7 +41789,7 @@ index dfaccfc..bfea740 100644
int ret;
if (WARN_ON(hdev->status & HID_STAT_ADDED))
-@@ -2549,7 +2549,7 @@ int hid_add_device(struct hid_device *hdev)
+@@ -2551,7 +2551,7 @@ int hid_add_device(struct hid_device *hdev)
/* XXX hack, any other cleaner solution after the driver core
* is converted to allow more than 20 bytes as the device name? */
dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus,
@@ -41863,12 +41799,12 @@ index dfaccfc..bfea740 100644
hid_debug_register(hdev, dev_name(&hdev->dev));
ret = device_add(&hdev->dev);
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
-index 71f5692..147d3da 100644
+index 5bc6d80..e47b55a 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
-@@ -658,6 +658,12 @@ static int logi_dj_raw_event(struct hid_device *hdev,
- * device (via hid_input_report() ) and return 1 so hid-core does not do
- * anything else with it.
+@@ -853,6 +853,12 @@ static int logi_dj_dj_event(struct hid_device *hdev,
+ * case we forward it to the correct hid device (via hid_input_report()
+ * ) and return 1 so hid-core does not anything else with it.
*/
+ if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) ||
+ (dj_report->device_index > DJ_DEVICE_INDEX_MAX)) {
@@ -41877,306 +41813,8 @@ index 71f5692..147d3da 100644
+ return false;
+ }
- /* case 1) */
- if (data[0] != REPORT_ID_DJ_SHORT)
-diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
-index bc4269e..b6e6102 100644
---- a/drivers/hid/hid-sony.c
-+++ b/drivers/hid/hid-sony.c
-@@ -798,6 +798,12 @@ union sixaxis_output_report_01 {
- __u8 buf[36];
- };
-
-+#define DS4_REPORT_0x02_SIZE 37
-+#define DS4_REPORT_0x05_SIZE 32
-+#define DS4_REPORT_0x11_SIZE 78
-+#define DS4_REPORT_0x81_SIZE 7
-+#define SIXAXIS_REPORT_0xF2_SIZE 18
-+
- static spinlock_t sony_dev_list_lock;
- static LIST_HEAD(sony_device_list);
- static DEFINE_IDA(sony_device_id_allocator);
-@@ -811,6 +817,7 @@ struct sony_sc {
- struct work_struct state_worker;
- struct power_supply battery;
- int device_id;
-+ __u8 *output_report_dmabuf;
-
- #ifdef CONFIG_SONY_FF
- __u8 left;
-@@ -1142,9 +1149,20 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
-
- static int sixaxis_set_operational_bt(struct hid_device *hdev)
- {
-- unsigned char buf[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 };
-- return hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf),
-+ static const __u8 report[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 };
-+ __u8 *buf;
-+ int ret;
-+
-+ buf = kmemdup(report, sizeof(report), GFP_KERNEL);
-+ if (!buf)
-+ return -ENOMEM;
-+
-+ ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(report),
- HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
-+
-+ kfree(buf);
-+
-+ return ret;
- }
-
- /*
-@@ -1153,10 +1171,19 @@ static int sixaxis_set_operational_bt(struct hid_device *hdev)
- */
- static int dualshock4_set_operational_bt(struct hid_device *hdev)
- {
-- __u8 buf[37] = { 0 };
-+ __u8 *buf;
-+ int ret;
-
-- return hid_hw_raw_request(hdev, 0x02, buf, sizeof(buf),
-+ buf = kmalloc(DS4_REPORT_0x02_SIZE, GFP_KERNEL);
-+ if (!buf)
-+ return -ENOMEM;
-+
-+ ret = hid_hw_raw_request(hdev, 0x02, buf, DS4_REPORT_0x02_SIZE,
- HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
-+
-+ kfree(buf);
-+
-+ return ret;
- }
-
- static void sixaxis_set_leds_from_id(int id, __u8 values[MAX_LEDS])
-@@ -1471,9 +1498,7 @@ error_leds:
-
- static void sixaxis_state_worker(struct work_struct *work)
- {
-- struct sony_sc *sc = container_of(work, struct sony_sc, state_worker);
-- int n;
-- union sixaxis_output_report_01 report = {
-+ static const union sixaxis_output_report_01 default_report = {
- .buf = {
- 0x01,
- 0x00, 0xff, 0x00, 0xff, 0x00,
-@@ -1485,20 +1510,27 @@ static void sixaxis_state_worker(struct work_struct *work)
- 0x00, 0x00, 0x00, 0x00, 0x00
- }
- };
-+ struct sony_sc *sc = container_of(work, struct sony_sc, state_worker);
-+ struct sixaxis_output_report *report =
-+ (struct sixaxis_output_report *)sc->output_report_dmabuf;
-+ int n;
-+
-+ /* Initialize the report with default values */
-+ memcpy(report, &default_report, sizeof(struct sixaxis_output_report));
-
- #ifdef CONFIG_SONY_FF
-- report.data.rumble.right_motor_on = sc->right ? 1 : 0;
-- report.data.rumble.left_motor_force = sc->left;
-+ report->rumble.right_motor_on = sc->right ? 1 : 0;
-+ report->rumble.left_motor_force = sc->left;
- #endif
-
-- report.data.leds_bitmap |= sc->led_state[0] << 1;
-- report.data.leds_bitmap |= sc->led_state[1] << 2;
-- report.data.leds_bitmap |= sc->led_state[2] << 3;
-- report.data.leds_bitmap |= sc->led_state[3] << 4;
-+ report->leds_bitmap |= sc->led_state[0] << 1;
-+ report->leds_bitmap |= sc->led_state[1] << 2;
-+ report->leds_bitmap |= sc->led_state[2] << 3;
-+ report->leds_bitmap |= sc->led_state[3] << 4;
-
- /* Set flag for all leds off, required for 3rd party INTEC controller */
-- if ((report.data.leds_bitmap & 0x1E) == 0)
-- report.data.leds_bitmap |= 0x20;
-+ if ((report->leds_bitmap & 0x1E) == 0)
-+ report->leds_bitmap |= 0x20;
-
- /*
- * The LEDs in the report are indexed in reverse order to their
-@@ -1511,28 +1543,30 @@ static void sixaxis_state_worker(struct work_struct *work)
- */
- for (n = 0; n < 4; n++) {
- if (sc->led_delay_on[n] || sc->led_delay_off[n]) {
-- report.data.led[3 - n].duty_off = sc->led_delay_off[n];
-- report.data.led[3 - n].duty_on = sc->led_delay_on[n];
-+ report->led[3 - n].duty_off = sc->led_delay_off[n];
-+ report->led[3 - n].duty_on = sc->led_delay_on[n];
- }
- }
-
-- hid_hw_raw_request(sc->hdev, report.data.report_id, report.buf,
-- sizeof(report), HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
-+ hid_hw_raw_request(sc->hdev, report->report_id, (__u8 *)report,
-+ sizeof(struct sixaxis_output_report),
-+ HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
- }
-
- static void dualshock4_state_worker(struct work_struct *work)
- {
- struct sony_sc *sc = container_of(work, struct sony_sc, state_worker);
- struct hid_device *hdev = sc->hdev;
-+ __u8 *buf = sc->output_report_dmabuf;
- int offset;
-
-- __u8 buf[78] = { 0 };
--
- if (sc->quirks & DUALSHOCK4_CONTROLLER_USB) {
-+ memset(buf, 0, DS4_REPORT_0x05_SIZE);
- buf[0] = 0x05;
- buf[1] = 0xFF;
- offset = 4;
- } else {
-+ memset(buf, 0, DS4_REPORT_0x11_SIZE);
- buf[0] = 0x11;
- buf[1] = 0xB0;
- buf[3] = 0x0F;
-@@ -1560,12 +1594,33 @@ static void dualshock4_state_worker(struct work_struct *work)
- buf[offset++] = sc->led_delay_off[3];
-
- if (sc->quirks & DUALSHOCK4_CONTROLLER_USB)
-- hid_hw_output_report(hdev, buf, 32);
-+ hid_hw_output_report(hdev, buf, DS4_REPORT_0x05_SIZE);
- else
-- hid_hw_raw_request(hdev, 0x11, buf, 78,
-+ hid_hw_raw_request(hdev, 0x11, buf, DS4_REPORT_0x11_SIZE,
- HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
- }
-
-+static int sony_allocate_output_report(struct sony_sc *sc)
-+{
-+ if (sc->quirks & SIXAXIS_CONTROLLER)
-+ sc->output_report_dmabuf =
-+ kmalloc(sizeof(union sixaxis_output_report_01),
-+ GFP_KERNEL);
-+ else if (sc->quirks & DUALSHOCK4_CONTROLLER_BT)
-+ sc->output_report_dmabuf = kmalloc(DS4_REPORT_0x11_SIZE,
-+ GFP_KERNEL);
-+ else if (sc->quirks & DUALSHOCK4_CONTROLLER_USB)
-+ sc->output_report_dmabuf = kmalloc(DS4_REPORT_0x05_SIZE,
-+ GFP_KERNEL);
-+ else
-+ return 0;
-+
-+ if (!sc->output_report_dmabuf)
-+ return -ENOMEM;
-+
-+ return 0;
-+}
-+
- #ifdef CONFIG_SONY_FF
- static int sony_play_effect(struct input_dev *dev, void *data,
- struct ff_effect *effect)
-@@ -1754,6 +1809,7 @@ static int sony_get_bt_devaddr(struct sony_sc *sc)
-
- static int sony_check_add(struct sony_sc *sc)
- {
-+ __u8 *buf = NULL;
- int n, ret;
-
- if ((sc->quirks & DUALSHOCK4_CONTROLLER_BT) ||
-@@ -1769,36 +1825,44 @@ static int sony_check_add(struct sony_sc *sc)
- return 0;
- }
- } else if (sc->quirks & DUALSHOCK4_CONTROLLER_USB) {
-- __u8 buf[7];
-+ buf = kmalloc(DS4_REPORT_0x81_SIZE, GFP_KERNEL);
-+ if (!buf)
-+ return -ENOMEM;
-
- /*
- * The MAC address of a DS4 controller connected via USB can be
- * retrieved with feature report 0x81. The address begins at
- * offset 1.
- */
-- ret = hid_hw_raw_request(sc->hdev, 0x81, buf, sizeof(buf),
-- HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
-+ ret = hid_hw_raw_request(sc->hdev, 0x81, buf,
-+ DS4_REPORT_0x81_SIZE, HID_FEATURE_REPORT,
-+ HID_REQ_GET_REPORT);
-
-- if (ret != 7) {
-+ if (ret != DS4_REPORT_0x81_SIZE) {
- hid_err(sc->hdev, "failed to retrieve feature report 0x81 with the DualShock 4 MAC address\n");
-- return ret < 0 ? ret : -EINVAL;
-+ ret = ret < 0 ? ret : -EINVAL;
-+ goto out_free;
- }
-
- memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address));
- } else if (sc->quirks & SIXAXIS_CONTROLLER_USB) {
-- __u8 buf[18];
-+ buf = kmalloc(SIXAXIS_REPORT_0xF2_SIZE, GFP_KERNEL);
-+ if (!buf)
-+ return -ENOMEM;
-
- /*
- * The MAC address of a Sixaxis controller connected via USB can
- * be retrieved with feature report 0xf2. The address begins at
- * offset 4.
- */
-- ret = hid_hw_raw_request(sc->hdev, 0xf2, buf, sizeof(buf),
-- HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
-+ ret = hid_hw_raw_request(sc->hdev, 0xf2, buf,
-+ SIXAXIS_REPORT_0xF2_SIZE, HID_FEATURE_REPORT,
-+ HID_REQ_GET_REPORT);
-
-- if (ret != 18) {
-+ if (ret != SIXAXIS_REPORT_0xF2_SIZE) {
- hid_err(sc->hdev, "failed to retrieve feature report 0xf2 with the Sixaxis MAC address\n");
-- return ret < 0 ? ret : -EINVAL;
-+ ret = ret < 0 ? ret : -EINVAL;
-+ goto out_free;
- }
-
- /*
-@@ -1811,7 +1875,13 @@ static int sony_check_add(struct sony_sc *sc)
- return 0;
- }
-
-- return sony_check_add_dev_list(sc);
-+ ret = sony_check_add_dev_list(sc);
-+
-+out_free:
-+
-+ kfree(buf);
-+
-+ return ret;
- }
-
- static int sony_set_device_id(struct sony_sc *sc)
-@@ -1895,6 +1965,12 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
- return ret;
- }
-
-+ ret = sony_allocate_output_report(sc);
-+ if (ret < 0) {
-+ hid_err(hdev, "failed to allocate the output report buffer\n");
-+ goto err_stop;
-+ }
-+
- ret = sony_set_device_id(sc);
- if (ret < 0) {
- hid_err(hdev, "failed to allocate the device id\n");
-@@ -1984,6 +2060,7 @@ err_stop:
- if (sc->quirks & SONY_BATTERY_SUPPORT)
- sony_battery_remove(sc);
- sony_cancel_work_sync(sc);
-+ kfree(sc->output_report_dmabuf);
- sony_remove_dev_list(sc);
- sony_release_device_id(sc);
- hid_hw_stop(hdev);
-@@ -2004,6 +2081,8 @@ static void sony_remove(struct hid_device *hdev)
-
- sony_cancel_work_sync(sc);
-
-+ kfree(sc->output_report_dmabuf);
-+
- sony_remove_dev_list(sc);
-
- sony_release_device_id(sc);
+ if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) ||
+ (dj_report->device_index > DJ_DEVICE_INDEX_MAX)) {
diff --git a/drivers/hid/hid-wiimote-debug.c b/drivers/hid/hid-wiimote-debug.c
index c13fb5b..55a3802 100644
--- a/drivers/hid/hid-wiimote-debug.c
@@ -42228,7 +41866,7 @@ index 3e4235c..877d0e5 100644
if (!virtaddr)
goto cleanup;
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
-index 5e90c5d..d8fcefb 100644
+index b958ded..b2452bb 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -470,7 +470,7 @@ MODULE_PARM_DESC(hot_add, "If set attempt memory hot_add");
@@ -42267,7 +41905,7 @@ index 5e90c5d..d8fcefb 100644
return;
/*
-@@ -1129,7 +1129,7 @@ static void balloon_up(struct work_struct *dummy)
+@@ -1133,7 +1133,7 @@ static void balloon_up(struct work_struct *dummy)
*/
do {
@@ -42276,7 +41914,7 @@ index 5e90c5d..d8fcefb 100644
ret = vmbus_sendpacket(dm_device.dev->channel,
bl_resp,
bl_resp->hdr.size,
-@@ -1175,7 +1175,7 @@ static void balloon_down(struct hv_dynmem_device *dm,
+@@ -1179,7 +1179,7 @@ static void balloon_down(struct hv_dynmem_device *dm,
memset(&resp, 0, sizeof(struct dm_unballoon_response));
resp.hdr.type = DM_UNBALLOON_RESPONSE;
@@ -42285,7 +41923,7 @@ index 5e90c5d..d8fcefb 100644
resp.hdr.size = sizeof(struct dm_unballoon_response);
vmbus_sendpacket(dm_device.dev->channel, &resp,
-@@ -1239,7 +1239,7 @@ static void version_resp(struct hv_dynmem_device *dm,
+@@ -1243,7 +1243,7 @@ static void version_resp(struct hv_dynmem_device *dm,
memset(&version_req, 0, sizeof(struct dm_version_request));
version_req.hdr.type = DM_VERSION_REQUEST;
version_req.hdr.size = sizeof(struct dm_version_request);
@@ -42294,7 +41932,7 @@ index 5e90c5d..d8fcefb 100644
version_req.version.version = DYNMEM_PROTOCOL_VERSION_WIN7;
version_req.is_last_attempt = 1;
-@@ -1409,7 +1409,7 @@ static int balloon_probe(struct hv_device *dev,
+@@ -1413,7 +1413,7 @@ static int balloon_probe(struct hv_device *dev,
memset(&version_req, 0, sizeof(struct dm_version_request));
version_req.hdr.type = DM_VERSION_REQUEST;
version_req.hdr.size = sizeof(struct dm_version_request);
@@ -42303,7 +41941,7 @@ index 5e90c5d..d8fcefb 100644
version_req.version.version = DYNMEM_PROTOCOL_VERSION_WIN8;
version_req.is_last_attempt = 0;
-@@ -1440,7 +1440,7 @@ static int balloon_probe(struct hv_device *dev,
+@@ -1444,7 +1444,7 @@ static int balloon_probe(struct hv_device *dev,
memset(&cap_msg, 0, sizeof(struct dm_capabilities));
cap_msg.hdr.type = DM_CAPABILITIES_REPORT;
cap_msg.hdr.size = sizeof(struct dm_capabilities);
@@ -42365,10 +42003,10 @@ index 579bdf9..75118b5 100644
int res = 0;
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
-index 3288f13..71cfb4e 100644
+index 0af63da..05a183a 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
-@@ -1106,7 +1106,7 @@ static int applesmc_create_nodes(struct applesmc_node_group *groups, int num)
+@@ -1105,7 +1105,7 @@ static int applesmc_create_nodes(struct applesmc_node_group *groups, int num)
{
struct applesmc_node_group *grp;
struct applesmc_dev_attr *node;
@@ -42406,10 +42044,10 @@ index cccef87..06ce8ec 100644
{
sysfs_attr_init(&attr->attr);
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
-index d76f0b7..55ae976 100644
+index 5b7fec8..05c957a 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
-@@ -784,7 +784,7 @@ static int coretemp_cpu_callback(struct notifier_block *nfb,
+@@ -783,7 +783,7 @@ static int coretemp_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}
@@ -42432,7 +42070,7 @@ index 7a8a6fb..015c1fd 100644
/* Set up read-only sensors */
diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
-index 14c82da..09b25d7 100644
+index 17ae2eb..21b71dd 100644
--- a/drivers/hwmon/iio_hwmon.c
+++ b/drivers/hwmon/iio_hwmon.c
@@ -61,7 +61,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
@@ -42442,10 +42080,10 @@ index 14c82da..09b25d7 100644
- struct sensor_device_attribute *a;
+ sensor_device_attribute_no_const *a;
int ret, i;
- int in_i = 1, temp_i = 1, curr_i = 1;
+ int in_i = 1, temp_i = 1, curr_i = 1, humidity_i = 1;
enum iio_chan_type type;
diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c
-index 7710f46..427a28d 100644
+index f3830db..9f4d6d5 100644
--- a/drivers/hwmon/nct6683.c
+++ b/drivers/hwmon/nct6683.c
@@ -397,11 +397,11 @@ static struct attribute_group *
@@ -42464,10 +42102,10 @@ index 7710f46..427a28d 100644
int i, j, count;
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
-index 504cbdd..35d6f25 100644
+index 1be4117..88ae1e1 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
-@@ -943,10 +943,10 @@ static struct attribute_group *
+@@ -952,10 +952,10 @@ static struct attribute_group *
nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg,
int repeat)
{
@@ -42482,10 +42120,10 @@ index 504cbdd..35d6f25 100644
struct sensor_device_template **t;
int i, count;
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
-index 291d11f..3f0dbbd 100644
+index f2e47c7..45d7941 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
-@@ -783,7 +783,7 @@ static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr)
+@@ -816,7 +816,7 @@ static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr)
return 0;
}
@@ -42494,7 +42132,7 @@ index 291d11f..3f0dbbd 100644
const char *name,
umode_t mode,
ssize_t (*show)(struct device *dev,
-@@ -800,7 +800,7 @@ static void pmbus_dev_attr_init(struct device_attribute *dev_attr,
+@@ -833,7 +833,7 @@ static void pmbus_dev_attr_init(struct device_attribute *dev_attr,
dev_attr->store = store;
}
@@ -42503,7 +42141,7 @@ index 291d11f..3f0dbbd 100644
const char *name,
umode_t mode,
ssize_t (*show)(struct device *dev,
-@@ -822,7 +822,7 @@ static int pmbus_add_boolean(struct pmbus_data *data,
+@@ -855,7 +855,7 @@ static int pmbus_add_boolean(struct pmbus_data *data,
u16 reg, u8 mask)
{
struct pmbus_boolean *boolean;
@@ -42512,7 +42150,7 @@ index 291d11f..3f0dbbd 100644
boolean = devm_kzalloc(data->dev, sizeof(*boolean), GFP_KERNEL);
if (!boolean)
-@@ -847,7 +847,7 @@ static struct pmbus_sensor *pmbus_add_sensor(struct pmbus_data *data,
+@@ -880,7 +880,7 @@ static struct pmbus_sensor *pmbus_add_sensor(struct pmbus_data *data,
bool update, bool readonly)
{
struct pmbus_sensor *sensor;
@@ -42521,7 +42159,7 @@ index 291d11f..3f0dbbd 100644
sensor = devm_kzalloc(data->dev, sizeof(*sensor), GFP_KERNEL);
if (!sensor)
-@@ -878,7 +878,7 @@ static int pmbus_add_label(struct pmbus_data *data,
+@@ -911,7 +911,7 @@ static int pmbus_add_label(struct pmbus_data *data,
const char *lstring, int index)
{
struct pmbus_label *label;
@@ -42531,7 +42169,7 @@ index 291d11f..3f0dbbd 100644
label = devm_kzalloc(data->dev, sizeof(*label), GFP_KERNEL);
if (!label)
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
-index 97cd45a..ac54d8b 100644
+index d4f0935..7420593 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -169,7 +169,7 @@ struct sht15_data {
@@ -42583,10 +42221,10 @@ index 97cd45a..ac54d8b 100644
}
diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c
-index 8df43c5..b07b91d 100644
+index ac91c07..8e69663 100644
--- a/drivers/hwmon/via-cputemp.c
+++ b/drivers/hwmon/via-cputemp.c
-@@ -296,7 +296,7 @@ static int via_cputemp_cpu_callback(struct notifier_block *nfb,
+@@ -295,7 +295,7 @@ static int via_cputemp_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}
@@ -42888,10 +42526,10 @@ index 9f5ad7c..588cd84 100644
}
}
diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
-index ec7a298..8742e59 100644
+index cb43c22..2e12dd7 100644
--- a/drivers/infiniband/hw/cxgb4/mem.c
+++ b/drivers/infiniband/hw/cxgb4/mem.c
-@@ -249,7 +249,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
+@@ -256,7 +256,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
int err;
struct fw_ri_tpte tpt;
u32 stag_idx;
@@ -42900,7 +42538,7 @@ index ec7a298..8742e59 100644
if (c4iw_fatal_error(rdev))
return -EIO;
-@@ -270,7 +270,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
+@@ -277,7 +277,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
if (rdev->stats.stag.cur > rdev->stats.stag.max)
rdev->stats.stag.max = rdev->stats.stag.cur;
mutex_unlock(&rdev->stats.lock);
@@ -43504,7 +43142,7 @@ index 49eb511..a774366 100644
/**
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
-index fef067c..6a25ccd 100644
+index c0d0296..3185f57 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -46,9 +46,9 @@
@@ -43564,36 +43202,36 @@ index cdc7df4..a2fdfdb 100644
.maxtype = IFLA_IPOIB_MAX,
.policy = ipoib_policy,
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
-index e29c04e..adbf68c 100644
+index e853a21..56fc5a8 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -527,14 +527,14 @@ EXPORT_SYMBOL(gameport_set_phys);
*/
static void gameport_init_port(struct gameport *gameport)
{
-- static atomic_t gameport_no = ATOMIC_INIT(0);
-+ static atomic_unchecked_t gameport_no = ATOMIC_INIT(0);
+- static atomic_t gameport_no = ATOMIC_INIT(-1);
++ static atomic_unchecked_t gameport_no = ATOMIC_INIT(-1);
__module_get(THIS_MODULE);
mutex_init(&gameport->drv_mutex);
device_initialize(&gameport->dev);
dev_set_name(&gameport->dev, "gameport%lu",
-- (unsigned long)atomic_inc_return(&gameport_no) - 1);
-+ (unsigned long)atomic_inc_return_unchecked(&gameport_no) - 1);
+- (unsigned long)atomic_inc_return(&gameport_no));
++ (unsigned long)atomic_inc_return_unchecked(&gameport_no));
gameport->dev.bus = &gameport_bus;
gameport->dev.release = gameport_release_port;
if (gameport->parent)
diff --git a/drivers/input/input.c b/drivers/input/input.c
-index 0f175f5..4c481c0 100644
+index 213e3a1..4fea837 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1775,7 +1775,7 @@ EXPORT_SYMBOL_GPL(input_class);
*/
struct input_dev *input_allocate_device(void)
{
-- static atomic_t input_no = ATOMIC_INIT(0);
-+ static atomic_unchecked_t input_no = ATOMIC_INIT(0);
+- static atomic_t input_no = ATOMIC_INIT(-1);
++ static atomic_unchecked_t input_no = ATOMIC_INIT(-1);
struct input_dev *dev;
dev = kzalloc(sizeof(struct input_dev), GFP_KERNEL);
@@ -43601,8 +43239,8 @@ index 0f175f5..4c481c0 100644
INIT_LIST_HEAD(&dev->node);
dev_set_name(&dev->dev, "input%lu",
-- (unsigned long) atomic_inc_return(&input_no) - 1);
-+ (unsigned long) atomic_inc_return_unchecked(&input_no) - 1);
+- (unsigned long)atomic_inc_return(&input_no));
++ (unsigned long)atomic_inc_return_unchecked(&input_no));
__module_get(THIS_MODULE);
}
@@ -43619,37 +43257,37 @@ index 4a95b22..874c182 100644
#include <linux/gameport.h>
#include <linux/jiffies.h>
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
-index fc55f0d..11e2aa6 100644
+index 3aa2f3f..53c00ea 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -886,7 +886,7 @@ static void xpad_led_set(struct led_classdev *led_cdev,
static int xpad_led_probe(struct usb_xpad *xpad)
{
-- static atomic_t led_seq = ATOMIC_INIT(0);
-+ static atomic_unchecked_t led_seq = ATOMIC_INIT(0);
- long led_no;
+- static atomic_t led_seq = ATOMIC_INIT(-1);
++ static atomic_unchecked_t led_seq = ATOMIC_INIT(-1);
+ unsigned long led_no;
struct xpad_led *led;
struct led_classdev *led_cdev;
@@ -899,7 +899,7 @@ static int xpad_led_probe(struct usb_xpad *xpad)
if (!led)
return -ENOMEM;
-- led_no = (long)atomic_inc_return(&led_seq) - 1;
-+ led_no = (long)atomic_inc_return_unchecked(&led_seq) - 1;
+- led_no = atomic_inc_return(&led_seq);
++ led_no = atomic_inc_return_unchecked(&led_seq);
- snprintf(led->name, sizeof(led->name), "xpad%ld", led_no);
+ snprintf(led->name, sizeof(led->name), "xpad%lu", led_no);
led->xpad = xpad;
diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c
-index afed8e2..3aa8a18 100644
+index ac1fa5f..5f7502c 100644
--- a/drivers/input/misc/ims-pcu.c
+++ b/drivers/input/misc/ims-pcu.c
@@ -1851,7 +1851,7 @@ static int ims_pcu_identify_type(struct ims_pcu *pcu, u8 *device_id)
static int ims_pcu_init_application_mode(struct ims_pcu *pcu)
{
-- static atomic_t device_no = ATOMIC_INIT(0);
-+ static atomic_unchecked_t device_no = ATOMIC_INIT(0);
+- static atomic_t device_no = ATOMIC_INIT(-1);
++ static atomic_unchecked_t device_no = ATOMIC_INIT(-1);
const struct ims_pcu_device_info *info;
int error;
@@ -43657,8 +43295,8 @@ index afed8e2..3aa8a18 100644
}
/* Device appears to be operable, complete initialization */
-- pcu->device_no = atomic_inc_return(&device_no) - 1;
-+ pcu->device_no = atomic_inc_return_unchecked(&device_no) - 1;
+- pcu->device_no = atomic_inc_return(&device_no);
++ pcu->device_no = atomic_inc_return_unchecked(&device_no);
/*
* PCU-B devices, both GEN_1 and GEN_2 do not have OFN sensor
@@ -43689,15 +43327,15 @@ index b604564..3f14ae4 100644
return count;
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
-index d399b8b..4913ede 100644
+index a05a517..323a2fd 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -514,7 +514,7 @@ static void serio_release_port(struct device *dev)
*/
static void serio_init_port(struct serio *serio)
{
-- static atomic_t serio_no = ATOMIC_INIT(0);
-+ static atomic_unchecked_t serio_no = ATOMIC_INIT(0);
+- static atomic_t serio_no = ATOMIC_INIT(-1);
++ static atomic_unchecked_t serio_no = ATOMIC_INIT(-1);
__module_get(THIS_MODULE);
@@ -43705,21 +43343,21 @@ index d399b8b..4913ede 100644
mutex_init(&serio->drv_mutex);
device_initialize(&serio->dev);
dev_set_name(&serio->dev, "serio%lu",
-- (unsigned long)atomic_inc_return(&serio_no) - 1);
-+ (unsigned long)atomic_inc_return_unchecked(&serio_no) - 1);
+- (unsigned long)atomic_inc_return(&serio_no));
++ (unsigned long)atomic_inc_return_unchecked(&serio_no));
serio->dev.bus = &serio_bus;
serio->dev.release = serio_release_port;
serio->dev.groups = serio_device_attr_groups;
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
-index c9a02fe..0debc75 100644
+index 71ef5d6..93380a9 100644
--- a/drivers/input/serio/serio_raw.c
+++ b/drivers/input/serio/serio_raw.c
@@ -292,7 +292,7 @@ static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,
static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
{
-- static atomic_t serio_raw_no = ATOMIC_INIT(0);
-+ static atomic_unchecked_t serio_raw_no = ATOMIC_INIT(0);
+- static atomic_t serio_raw_no = ATOMIC_INIT(-1);
++ static atomic_unchecked_t serio_raw_no = ATOMIC_INIT(-1);
struct serio_raw *serio_raw;
int err;
@@ -43727,13 +43365,13 @@ index c9a02fe..0debc75 100644
}
snprintf(serio_raw->name, sizeof(serio_raw->name),
-- "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no) - 1);
-+ "serio_raw%ld", (long)atomic_inc_return_unchecked(&serio_raw_no) - 1);
+- "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no));
++ "serio_raw%ld", (long)atomic_inc_return_unchecked(&serio_raw_no));
kref_init(&serio_raw->kref);
INIT_LIST_HEAD(&serio_raw->client_list);
init_waitqueue_head(&serio_raw->wait);
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
-index 505a9ad..356734c 100644
+index 9802485..2e9941d 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -823,11 +823,21 @@ static void copy_cmd_to_buffer(struct amd_iommu *iommu,
@@ -43761,10 +43399,10 @@ index 505a9ad..356734c 100644
CMD_SET_TYPE(cmd, CMD_COMPL_WAIT);
}
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
-index 60558f7..5a02369 100644
+index 6cd47b7..264d14a 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
-@@ -934,7 +934,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
+@@ -968,7 +968,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
cfg->irptndx = cfg->cbndx;
}
@@ -43774,7 +43412,7 @@ index 60558f7..5a02369 100644
spin_unlock_irqrestore(&smmu_domain->lock, flags);
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
-index ed8b048..7fbcc01 100644
+index f7718d7..3ef740b 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -802,7 +802,7 @@ static int iommu_bus_notifier(struct notifier_block *nb,
@@ -43787,10 +43425,10 @@ index ed8b048..7fbcc01 100644
.ops = ops,
};
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
-index 74a1767..5a359e8 100644
+index 89c4846..1de796f 100644
--- a/drivers/iommu/irq_remapping.c
+++ b/drivers/iommu/irq_remapping.c
-@@ -361,7 +361,7 @@ int setup_hpet_msi_remapped(unsigned int irq, unsigned int id)
+@@ -353,7 +353,7 @@ int setup_hpet_msi_remapped(unsigned int irq, unsigned int id)
void panic_if_irq_remap(const char *msg)
{
if (irq_remapping_enabled)
@@ -43799,7 +43437,7 @@ index 74a1767..5a359e8 100644
}
static void ir_ack_apic_edge(struct irq_data *data)
-@@ -382,10 +382,12 @@ static void ir_print_prefix(struct irq_data *data, struct seq_file *p)
+@@ -374,10 +374,12 @@ static void ir_print_prefix(struct irq_data *data, struct seq_file *p)
void irq_remap_modify_chip_defaults(struct irq_chip *chip)
{
@@ -43817,7 +43455,7 @@ index 74a1767..5a359e8 100644
bool setup_remapped_irq(int irq, struct irq_cfg *cfg, struct irq_chip *chip)
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
-index 38493ff..001538b 100644
+index d617ee5..df8be8b 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -84,7 +84,7 @@ static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly;
@@ -43839,7 +43477,7 @@ index 38493ff..001538b 100644
.irq_mask = gic_mask_irq,
.irq_unmask = gic_unmask_irq,
diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c
-index 542e850..1bb094c 100644
+index 078cac5..fb0f846 100644
--- a/drivers/irqchip/irq-renesas-intc-irqpin.c
+++ b/drivers/irqchip/irq-renesas-intc-irqpin.c
@@ -353,7 +353,7 @@ static int intc_irqpin_probe(struct platform_device *pdev)
@@ -43852,7 +43490,7 @@ index 542e850..1bb094c 100644
void (*disable_fn)(struct irq_data *d);
const char *name = dev_name(dev);
diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
-index 8777065..a4a9967 100644
+index 384e6ed..7a771b2 100644
--- a/drivers/irqchip/irq-renesas-irqc.c
+++ b/drivers/irqchip/irq-renesas-irqc.c
@@ -151,7 +151,7 @@ static int irqc_probe(struct platform_device *pdev)
@@ -44020,10 +43658,10 @@ index 8c91fd5..14f13ce 100644
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
-index a8e652d..edadaa4 100644
+index 5f306e2..5342f88 100644
--- a/drivers/isdn/gigaset/usb-gigaset.c
+++ b/drivers/isdn/gigaset/usb-gigaset.c
-@@ -548,7 +548,7 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
+@@ -543,7 +543,7 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
gigaset_dbg_buffer(DEBUG_USBREQ, "brkchars", 6, buf);
memcpy(cs->hw.usb->bchars, buf, 6);
return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x19, 0x41,
@@ -44032,7 +43670,7 @@ index a8e652d..edadaa4 100644
}
static void gigaset_freebcshw(struct bc_state *bcs)
-@@ -867,22 +867,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
+@@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
}
static const struct gigaset_ops ops = {
@@ -44093,19 +43731,6 @@ index 4d9b195..455075c 100644
return -EFAULT;
} else {
memcpy(buf, dp, left);
-diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
-index a82e542..f766a79 100644
---- a/drivers/isdn/hardware/eicon/message.c
-+++ b/drivers/isdn/hardware/eicon/message.c
-@@ -1474,7 +1474,7 @@ static byte connect_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
- add_ai(plci, &parms[5]);
- sig_req(plci, REJECT, 0);
- }
-- else if (Reject == 1 || Reject > 9)
-+ else if (Reject == 1 || Reject >= 9)
- {
- add_ai(plci, &parms[5]);
- sig_req(plci, HANGUP, 0);
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 9b856e1..fa03c92 100644
--- a/drivers/isdn/i4l/isdn_common.c
@@ -44255,7 +43880,7 @@ index 87f7dff..7300125 100644
{
struct dsp_conf *conf;
diff --git a/drivers/leds/leds-clevo-mail.c b/drivers/leds/leds-clevo-mail.c
-index f58a354..fbae176 100644
+index 0f9ed1e..2715d6f 100644
--- a/drivers/leds/leds-clevo-mail.c
+++ b/drivers/leds/leds-clevo-mail.c
@@ -40,7 +40,7 @@ static int __init clevo_mail_led_dmi_callback(const struct dmi_system_id *id)
@@ -44445,10 +44070,10 @@ index a08e3ee..df8ade2 100644
cl->fn = fn;
cl->wq = wq;
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
-index da3604e..7789cb4c 100644
+index 1695ee5..89f18ab 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
-@@ -1771,7 +1771,7 @@ void bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
+@@ -1784,7 +1784,7 @@ void bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
chunk_kb ? "KB" : "B");
if (bitmap->storage.file) {
seq_printf(seq, ", file: ");
@@ -44458,10 +44083,10 @@ index da3604e..7789cb4c 100644
seq_printf(seq, "\n");
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
-index 0be9381..114262b 100644
+index 73f791b..8c5d3ac 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
-@@ -1769,7 +1769,7 @@ static int validate_params(uint cmd, struct dm_ioctl *param)
+@@ -1772,7 +1772,7 @@ static int validate_params(uint cmd, struct dm_ioctl *param)
cmd == DM_LIST_VERSIONS_CMD)
return 0;
@@ -44547,7 +44172,7 @@ index 7dfdb5c..4caada6 100644
return (test_bit(DM_RAID1_FLUSH_ERROR, &(m->error_type))) ? 'F' :
diff --git a/drivers/md/dm-stats.c b/drivers/md/dm-stats.c
-index 87f86c7..a1a4100 100644
+index f478a4c..4b8e5ef 100644
--- a/drivers/md/dm-stats.c
+++ b/drivers/md/dm-stats.c
@@ -382,7 +382,7 @@ do_sync_free:
@@ -44613,7 +44238,7 @@ index f8b37d4..5c5cafd 100644
schedule_work(&sc->trigger_event);
}
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
-index b2bd1eb..38f7a44 100644
+index 3afae9e..4e1c954 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -303,7 +303,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
@@ -44626,7 +44251,7 @@ index b2bd1eb..38f7a44 100644
"start=%llu, len=%llu, dev_size=%llu",
dm_device_name(ti->table->md), bdevname(bdev, b),
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
-index e9d33ad..dae9880d 100644
+index 43adbb8..7b34305 100644
--- a/drivers/md/dm-thin-metadata.c
+++ b/drivers/md/dm-thin-metadata.c
@@ -404,7 +404,7 @@ static void __setup_btree_details(struct dm_pool_metadata *pmd)
@@ -44648,10 +44273,10 @@ index e9d33ad..dae9880d 100644
pmd->bl_info.value_type.inc = data_block_inc;
pmd->bl_info.value_type.dec = data_block_dec;
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
-index 62c5136..aede7f1 100644
+index 2caf5b3..104f98f 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
-@@ -183,9 +183,9 @@ struct mapped_device {
+@@ -185,9 +185,9 @@ struct mapped_device {
/*
* Event handling.
*/
@@ -44663,7 +44288,7 @@ index 62c5136..aede7f1 100644
struct list_head uevent_list;
spinlock_t uevent_lock; /* Protect access to uevent_list */
-@@ -2071,8 +2071,8 @@ static struct mapped_device *alloc_dev(int minor)
+@@ -2070,8 +2070,8 @@ static struct mapped_device *alloc_dev(int minor)
spin_lock_init(&md->deferred_lock);
atomic_set(&md->holders, 1);
atomic_set(&md->open_count, 0);
@@ -44674,7 +44299,7 @@ index 62c5136..aede7f1 100644
INIT_LIST_HEAD(&md->uevent_list);
INIT_LIST_HEAD(&md->table_devices);
spin_lock_init(&md->uevent_lock);
-@@ -2228,7 +2228,7 @@ static void event_callback(void *context)
+@@ -2227,7 +2227,7 @@ static void event_callback(void *context)
dm_send_uevents(&uevents, &disk_to_dev(md->disk)->kobj);
@@ -44683,7 +44308,7 @@ index 62c5136..aede7f1 100644
wake_up(&md->eventq);
}
-@@ -2921,18 +2921,18 @@ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
+@@ -3041,18 +3041,18 @@ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
uint32_t dm_next_uevent_seq(struct mapped_device *md)
{
@@ -44706,7 +44331,7 @@ index 62c5136..aede7f1 100644
void dm_uevent_add(struct mapped_device *md, struct list_head *elist)
diff --git a/drivers/md/md.c b/drivers/md/md.c
-index 9233c71..ed5243a 100644
+index 709755f..5bc3fa4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -190,10 +190,10 @@ EXPORT_SYMBOL_GPL(bio_clone_mddev);
@@ -44731,7 +44356,7 @@ index 9233c71..ed5243a 100644
wake_up(&md_event_waiters);
}
-@@ -1426,7 +1426,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_
+@@ -1422,7 +1422,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_
if ((le32_to_cpu(sb->feature_map) & MD_FEATURE_RESHAPE_ACTIVE) &&
(le32_to_cpu(sb->feature_map) & MD_FEATURE_NEW_OFFSET))
rdev->new_data_offset += (s32)le32_to_cpu(sb->new_offset);
@@ -44740,7 +44365,7 @@ index 9233c71..ed5243a 100644
rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256;
bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1;
-@@ -1677,7 +1677,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev)
+@@ -1673,7 +1673,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev)
else
sb->resync_offset = cpu_to_le64(0);
@@ -44749,7 +44374,7 @@ index 9233c71..ed5243a 100644
sb->raid_disks = cpu_to_le32(mddev->raid_disks);
sb->size = cpu_to_le64(mddev->dev_sectors);
-@@ -2547,7 +2547,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store);
+@@ -2543,7 +2543,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store);
static ssize_t
errors_show(struct md_rdev *rdev, char *page)
{
@@ -44758,7 +44383,7 @@ index 9233c71..ed5243a 100644
}
static ssize_t
-@@ -2556,7 +2556,7 @@ errors_store(struct md_rdev *rdev, const char *buf, size_t len)
+@@ -2552,7 +2552,7 @@ errors_store(struct md_rdev *rdev, const char *buf, size_t len)
char *e;
unsigned long n = simple_strtoul(buf, &e, 10);
if (*buf && (*e == 0 || *e == '\n')) {
@@ -44767,7 +44392,7 @@ index 9233c71..ed5243a 100644
return len;
}
return -EINVAL;
-@@ -3000,8 +3000,8 @@ int md_rdev_init(struct md_rdev *rdev)
+@@ -2997,8 +2997,8 @@ int md_rdev_init(struct md_rdev *rdev)
rdev->sb_loaded = 0;
rdev->bb_page = NULL;
atomic_set(&rdev->nr_pending, 0);
@@ -44778,7 +44403,7 @@ index 9233c71..ed5243a 100644
INIT_LIST_HEAD(&rdev->same_set);
init_waitqueue_head(&rdev->blocked_wait);
-@@ -6855,7 +6855,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
+@@ -6865,7 +6865,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
spin_unlock(&pers_lock);
seq_printf(seq, "\n");
@@ -44787,7 +44412,7 @@ index 9233c71..ed5243a 100644
return 0;
}
if (v == (void*)2) {
-@@ -6958,7 +6958,7 @@ static int md_seq_open(struct inode *inode, struct file *file)
+@@ -6968,7 +6968,7 @@ static int md_seq_open(struct inode *inode, struct file *file)
return error;
seq = file->private_data;
@@ -44796,7 +44421,7 @@ index 9233c71..ed5243a 100644
return error;
}
-@@ -6975,7 +6975,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
+@@ -6985,7 +6985,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
/* always allow read */
mask = POLLIN | POLLRDNORM;
@@ -44805,7 +44430,7 @@ index 9233c71..ed5243a 100644
mask |= POLLERR | POLLPRI;
return mask;
}
-@@ -7022,7 +7022,7 @@ static int is_mddev_idle(struct mddev *mddev, int init)
+@@ -7032,7 +7032,7 @@ static int is_mddev_idle(struct mddev *mddev, int init)
struct gendisk *disk = rdev->bdev->bd_contains->bd_disk;
curr_events = (int)part_stat_read(&disk->part0, sectors[0]) +
(int)part_stat_read(&disk->part0, sectors[1]) -
@@ -44844,10 +44469,10 @@ index 03cec5b..0a658c1 100644
struct md_personality
diff --git a/drivers/md/persistent-data/dm-space-map-metadata.c b/drivers/md/persistent-data/dm-space-map-metadata.c
-index f4e22bc..8f83114 100644
+index e8a9042..35bd145 100644
--- a/drivers/md/persistent-data/dm-space-map-metadata.c
+++ b/drivers/md/persistent-data/dm-space-map-metadata.c
-@@ -681,7 +681,7 @@ static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks)
+@@ -683,7 +683,7 @@ static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks)
* Flick into a mode where all blocks get allocated in the new area.
*/
smm->begin = old_len;
@@ -44856,7 +44481,7 @@ index f4e22bc..8f83114 100644
/*
* Extend.
-@@ -712,7 +712,7 @@ out:
+@@ -714,7 +714,7 @@ out:
/*
* Switch back to normal behaviour.
*/
@@ -45089,7 +44714,7 @@ index 84cc103..5780c54 100644
#if IS_ENABLED(CONFIG_DVB_DIB8000)
void *dib8000_attach(struct dib8000_ops *ops);
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
-index ce27e6d..b70435a 100644
+index 860c98fc..497fa25 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -50,9 +50,9 @@ MODULE_VERSION(CX88_VERSION);
@@ -45158,10 +44783,10 @@ index 8c84846..27b4f83 100644
p2m_id = -p2m_id;
}
diff --git a/drivers/media/pci/solo6x10/solo6x10.h b/drivers/media/pci/solo6x10/solo6x10.h
-index 72017b7..dd37ae6 100644
+index bd8edfa..e82ed85 100644
--- a/drivers/media/pci/solo6x10/solo6x10.h
+++ b/drivers/media/pci/solo6x10/solo6x10.h
-@@ -219,7 +219,7 @@ struct solo_dev {
+@@ -220,7 +220,7 @@ struct solo_dev {
/* P2M DMA Engine */
struct solo_p2m_dev p2m_dev[SOLO_NR_P2M];
@@ -45171,7 +44796,7 @@ index 72017b7..dd37ae6 100644
unsigned int p2m_timeouts;
diff --git a/drivers/media/pci/tw68/tw68-core.c b/drivers/media/pci/tw68/tw68-core.c
-index 63f0b64..a017c1c 100644
+index c135165..dc69499 100644
--- a/drivers/media/pci/tw68/tw68-core.c
+++ b/drivers/media/pci/tw68/tw68-core.c
@@ -60,7 +60,7 @@ static unsigned int card[] = {[0 ... (TW68_MAXBOARDS - 1)] = UNSET };
@@ -45184,7 +44809,7 @@ index 63f0b64..a017c1c 100644
/* ------------------------------------------------------------------ */
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
-index 64ab6fb..ef4a8b9 100644
+index ba2d8f9..1566684 100644
--- a/drivers/media/platform/omap/omap_vout.c
+++ b/drivers/media/platform/omap/omap_vout.c
@@ -63,7 +63,6 @@ enum omap_vout_channels {
@@ -45436,7 +45061,7 @@ index 8654e0d..0608a64 100644
static int shark_write_reg(struct radio_tea5777 *tea, u64 reg)
{
diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c
-index 633022b..7f10754 100644
+index dccf586..d5db411 100644
--- a/drivers/media/radio/radio-si476x.c
+++ b/drivers/media/radio/radio-si476x.c
@@ -1445,7 +1445,7 @@ static int si476x_radio_probe(struct platform_device *pdev)
@@ -45448,6 +45073,19 @@ index 633022b..7f10754 100644
radio = devm_kzalloc(&pdev->dev, sizeof(*radio), GFP_KERNEL);
if (!radio)
+diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl128x/fmdrv_common.c
+index 704397f..4d05977 100644
+--- a/drivers/media/radio/wl128x/fmdrv_common.c
++++ b/drivers/media/radio/wl128x/fmdrv_common.c
+@@ -71,7 +71,7 @@ module_param(default_rds_buf, uint, 0444);
+ MODULE_PARM_DESC(rds_buf, "RDS buffer entries");
+
+ /* Radio Nr */
+-static u32 radio_nr = -1;
++static int radio_nr = -1;
+ module_param(radio_nr, int, 0444);
+ MODULE_PARM_DESC(radio_nr, "Radio Nr");
+
diff --git a/drivers/media/usb/dvb-usb/cinergyT2-core.c b/drivers/media/usb/dvb-usb/cinergyT2-core.c
index 9fd1527..8927230 100644
--- a/drivers/media/usb/dvb-usb/cinergyT2-core.c
@@ -45962,7 +45600,7 @@ index 1a3df10..57997a5 100644
/* debug */
static int dvb_usb_dw2102_debug;
diff --git a/drivers/media/usb/dvb-usb/technisat-usb2.c b/drivers/media/usb/dvb-usb/technisat-usb2.c
-index 6b0b8b6b..4038398 100644
+index 5801ae7..83f71fa 100644
--- a/drivers/media/usb/dvb-usb/technisat-usb2.c
+++ b/drivers/media/usb/dvb-usb/technisat-usb2.c
@@ -87,8 +87,11 @@ struct technisat_usb2_state {
@@ -46117,7 +45755,7 @@ index 6b0b8b6b..4038398 100644
return 0;
}
-@@ -591,10 +615,15 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a)
+@@ -594,10 +618,15 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a)
static int technisat_usb2_get_ir(struct dvb_usb_device *d)
{
@@ -46134,7 +45772,7 @@ index 6b0b8b6b..4038398 100644
buf[0] = GET_IR_DATA_VENDOR_REQUEST;
buf[1] = 0x08;
buf[2] = 0x8f;
-@@ -617,16 +646,20 @@ static int technisat_usb2_get_ir(struct dvb_usb_device *d)
+@@ -620,16 +649,20 @@ static int technisat_usb2_get_ir(struct dvb_usb_device *d)
GET_IR_DATA_VENDOR_REQUEST,
USB_TYPE_VENDOR | USB_DIR_IN,
0x8080, 0,
@@ -46158,7 +45796,7 @@ index 6b0b8b6b..4038398 100644
/* decoding */
b = buf+1;
-@@ -653,6 +686,8 @@ unlock:
+@@ -656,6 +689,8 @@ unlock:
ir_raw_event_handle(d->rc_dev);
@@ -46168,10 +45806,10 @@ index 6b0b8b6b..4038398 100644
}
diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
-index e502a5f..2a27f40 100644
+index af63543..0436f20 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
-@@ -427,7 +427,7 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
+@@ -429,7 +429,7 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
* by passing a very big num_planes value */
uplane = compat_alloc_user_space(num_planes *
sizeof(struct v4l2_plane));
@@ -46180,7 +45818,7 @@ index e502a5f..2a27f40 100644
while (--num_planes >= 0) {
ret = get_v4l2_plane32(uplane, uplane32, kp->memory);
-@@ -498,7 +498,7 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
+@@ -500,7 +500,7 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
if (num_planes == 0)
return 0;
@@ -46189,7 +45827,7 @@ index e502a5f..2a27f40 100644
if (get_user(p, &up->m.planes))
return -EFAULT;
uplane32 = compat_ptr(p);
-@@ -562,7 +562,7 @@ static int get_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame
+@@ -564,7 +564,7 @@ static int get_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame
get_user(kp->flags, &up->flags) ||
copy_from_user(&kp->fmt, &up->fmt, sizeof(up->fmt)))
return -EFAULT;
@@ -46198,7 +45836,7 @@ index e502a5f..2a27f40 100644
return 0;
}
-@@ -667,7 +667,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
+@@ -669,7 +669,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
n * sizeof(struct v4l2_ext_control32)))
return -EFAULT;
kcontrols = compat_alloc_user_space(n * sizeof(struct v4l2_ext_control));
@@ -46207,7 +45845,7 @@ index e502a5f..2a27f40 100644
while (--n >= 0) {
u32 id;
-@@ -694,7 +694,7 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
+@@ -696,7 +696,7 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
{
struct v4l2_ext_control32 __user *ucontrols;
struct v4l2_ext_control __user *kcontrols =
@@ -46216,7 +45854,7 @@ index e502a5f..2a27f40 100644
int n = kp->count;
compat_caddr_t p;
-@@ -778,7 +778,7 @@ static int get_v4l2_edid32(struct v4l2_edid *kp, struct v4l2_edid32 __user *up)
+@@ -780,7 +780,7 @@ static int get_v4l2_edid32(struct v4l2_edid *kp, struct v4l2_edid32 __user *up)
get_user(tmp, &up->edid) ||
copy_from_user(kp->reserved, up->reserved, sizeof(kp->reserved)))
return -EFAULT;
@@ -46242,10 +45880,10 @@ index 015f92a..59e311e 100644
if (basename[len - 1] >= '0' && basename[len - 1] <= '9')
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
-index 9ccb19a..d131468 100644
+index faac2f4..e39dcd9 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
-@@ -2142,7 +2142,8 @@ struct v4l2_ioctl_info {
+@@ -2151,7 +2151,8 @@ struct v4l2_ioctl_info {
struct file *file, void *fh, void *p);
} u;
void (*debug)(const void *arg, bool write_only);
@@ -46255,7 +45893,7 @@ index 9ccb19a..d131468 100644
/* This control needs a priority check */
#define INFO_FL_PRIO (1 << 0)
-@@ -2326,7 +2327,7 @@ static long __video_do_ioctl(struct file *file,
+@@ -2335,7 +2336,7 @@ static long __video_do_ioctl(struct file *file,
struct video_device *vfd = video_devdata(file);
const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
bool write_only = false;
@@ -46264,7 +45902,7 @@ index 9ccb19a..d131468 100644
const struct v4l2_ioctl_info *info;
void *fh = file->private_data;
struct v4l2_fh *vfh = NULL;
-@@ -2413,7 +2414,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
+@@ -2422,7 +2423,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
ret = -EINVAL;
break;
}
@@ -46273,7 +45911,7 @@ index 9ccb19a..d131468 100644
*kernel_ptr = (void **)&buf->m.planes;
*array_size = sizeof(struct v4l2_plane) * buf->length;
ret = 1;
-@@ -2430,7 +2431,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
+@@ -2439,7 +2440,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
ret = -EINVAL;
break;
}
@@ -46282,7 +45920,7 @@ index 9ccb19a..d131468 100644
*kernel_ptr = (void **)&edid->edid;
*array_size = edid->blocks * 128;
ret = 1;
-@@ -2448,7 +2449,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
+@@ -2457,7 +2458,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
ret = -EINVAL;
break;
}
@@ -46291,7 +45929,7 @@ index 9ccb19a..d131468 100644
*kernel_ptr = (void **)&ctrls->controls;
*array_size = sizeof(struct v4l2_ext_control)
* ctrls->count;
-@@ -2549,7 +2550,7 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
+@@ -2558,7 +2559,7 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
}
if (has_array_args) {
@@ -46300,6 +45938,52 @@ index 9ccb19a..d131468 100644
if (copy_to_user(user_ptr, mbuf, array_size))
err = -EFAULT;
goto out_array_args;
+diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
+index 24696f5..3637780 100644
+--- a/drivers/memory/omap-gpmc.c
++++ b/drivers/memory/omap-gpmc.c
+@@ -211,7 +211,6 @@ struct omap3_gpmc_regs {
+ };
+
+ static struct gpmc_client_irq gpmc_client_irq[GPMC_NR_IRQ];
+-static struct irq_chip gpmc_irq_chip;
+ static int gpmc_irq_start;
+
+ static struct resource gpmc_mem_root;
+@@ -939,6 +938,17 @@ static void gpmc_irq_noop(struct irq_data *data) { }
+
+ static unsigned int gpmc_irq_noop_ret(struct irq_data *data) { return 0; }
+
++static struct irq_chip gpmc_irq_chip = {
++ .name = "gpmc",
++ .irq_startup = gpmc_irq_noop_ret,
++ .irq_enable = gpmc_irq_enable,
++ .irq_disable = gpmc_irq_disable,
++ .irq_shutdown = gpmc_irq_noop,
++ .irq_ack = gpmc_irq_noop,
++ .irq_mask = gpmc_irq_noop,
++ .irq_unmask = gpmc_irq_noop,
++};
++
+ static int gpmc_setup_irq(void)
+ {
+ int i;
+@@ -953,15 +963,6 @@ static int gpmc_setup_irq(void)
+ return gpmc_irq_start;
+ }
+
+- gpmc_irq_chip.name = "gpmc";
+- gpmc_irq_chip.irq_startup = gpmc_irq_noop_ret;
+- gpmc_irq_chip.irq_enable = gpmc_irq_enable;
+- gpmc_irq_chip.irq_disable = gpmc_irq_disable;
+- gpmc_irq_chip.irq_shutdown = gpmc_irq_noop;
+- gpmc_irq_chip.irq_ack = gpmc_irq_noop;
+- gpmc_irq_chip.irq_mask = gpmc_irq_noop;
+- gpmc_irq_chip.irq_unmask = gpmc_irq_noop;
+-
+ gpmc_client_irq[0].bitmask = GPMC_IRQ_FIFOEVENTENABLE;
+ gpmc_client_irq[1].bitmask = GPMC_IRQ_COUNT_EVENT;
+
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 187f836..679544b 100644
--- a/drivers/message/fusion/mptbase.c
@@ -46331,7 +46015,7 @@ index 187f836..679544b 100644
seq_printf(m, " {CurRepSz=%d} x {CurRepDepth=%d} = %d bytes ^= 0x%x\n",
ioc->reply_sz, ioc->reply_depth, ioc->reply_sz*ioc->reply_depth, sz);
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
-index 0707fa2..70ca794 100644
+index 5bdaae1..eced16f 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -446,6 +446,23 @@ mptsas_is_end_device(struct mptsas_devinfo * attached)
@@ -46574,7 +46258,7 @@ index 92752fb..a7494f6 100644
#endif
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
-index b2c7e3b..85aa4764 100644
+index 9a8e185..27ff17d 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -100,7 +100,7 @@ static int irq_last;
@@ -46656,7 +46340,7 @@ index 464419b..64bae8d 100644
c2dev->dev = device_create(c2port_class, NULL, 0, c2dev,
"c2port%d", c2dev->id);
diff --git a/drivers/misc/eeprom/sunxi_sid.c b/drivers/misc/eeprom/sunxi_sid.c
-index 3f2b625..945e179 100644
+index 8385177..2f54635 100644
--- a/drivers/misc/eeprom/sunxi_sid.c
+++ b/drivers/misc/eeprom/sunxi_sid.c
@@ -126,7 +126,9 @@ static int sunxi_sid_probe(struct platform_device *pdev)
@@ -47049,10 +46733,10 @@ index 82dc574..8539ab2 100644
break;
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
-index a11451f..9e1bbad 100644
+index 4409d79..d7766d0 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
-@@ -574,7 +574,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
+@@ -577,7 +577,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
if (idata->ic.postsleep_min_us)
usleep_range(idata->ic.postsleep_min_us, idata->ic.postsleep_max_us);
@@ -47061,24 +46745,11 @@ index a11451f..9e1bbad 100644
err = -EFAULT;
goto cmd_rel_host;
}
-diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
-index 7911e05..d0f9dda 100644
---- a/drivers/mmc/core/mmc_ops.c
-+++ b/drivers/mmc/core/mmc_ops.c
-@@ -267,7 +267,7 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host,
- void *data_buf;
- int is_on_stack;
-
-- is_on_stack = object_is_on_stack(buf);
-+ is_on_stack = object_starts_on_stack(buf);
- if (is_on_stack) {
- /*
- * dma onto stack is unsafe/nonportable, but callers to this
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
-index 01b99e8..5c325e3 100644
+index 0d0f7a2..45b8d60 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
-@@ -265,5 +265,5 @@ struct dw_mci_drv_data {
+@@ -276,5 +276,5 @@ struct dw_mci_drv_data {
int (*parse_dt)(struct dw_mci *host);
int (*execute_tuning)(struct dw_mci_slot *slot, u32 opcode,
struct dw_mci_tuning_data *tuning_data);
@@ -47086,10 +46757,10 @@ index 01b99e8..5c325e3 100644
+} __do_const;
#endif /* _DW_MMC_H_ */
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
-index 43af791..86f4c48 100644
+index 8232e9a..7776006 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
-@@ -1628,7 +1628,9 @@ static int mmci_probe(struct amba_device *dev,
+@@ -1635,7 +1635,9 @@ static int mmci_probe(struct amba_device *dev,
mmc->caps |= MMC_CAP_CMD23;
if (variant->busy_detect) {
@@ -47101,10 +46772,10 @@ index 43af791..86f4c48 100644
mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY;
mmc->max_busy_timeout = 0;
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
-index 9c2b9cb..cebb09a 100644
+index 7c71dcd..74cb746 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
-@@ -2113,7 +2113,9 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
+@@ -2120,7 +2120,9 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
if (host->pdata->controller_flags & OMAP_HSMMC_BROKEN_MULTIBLOCK_READ) {
dev_info(&pdev->dev, "multiblock reads disabled due to 35xx erratum 2.1.1.128; MMC read performance may suffer\n");
@@ -47116,10 +46787,10 @@ index 9c2b9cb..cebb09a 100644
pm_runtime_enable(host->dev);
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
-index 587ee0e..b3bbcab 100644
+index af1f7c0..00d368a 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
-@@ -1054,9 +1054,12 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
+@@ -989,9 +989,12 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
host->mmc->caps |= MMC_CAP_1_8V_DDR;
}
@@ -47135,10 +46806,10 @@ index 587ee0e..b3bbcab 100644
if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING)
writel(readl(host->ioaddr + ESDHC_TUNING_CTRL) |
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
-index 0ce6eb1..8dcce1b 100644
+index c45b893..fba0144 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
-@@ -584,9 +584,11 @@ static int sdhci_s3c_probe(struct platform_device *pdev)
+@@ -590,9 +590,11 @@ static int sdhci_s3c_probe(struct platform_device *pdev)
* we can use overriding functions instead of default.
*/
if (sc->no_divider) {
@@ -47179,7 +46850,7 @@ index b3b7ca1..5dd4634 100644
#include "denali.h"
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
-index 959cb9b..8520fe5 100644
+index 4f3851a..f477a23 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -386,7 +386,7 @@ void prepare_data_dma(struct gpmi_nand_data *this, enum dma_data_direction dr)
@@ -47216,21 +46887,8 @@ index c23184a..4115c41 100644
struct attribute **attributes;
struct sm_sysfs_attribute *vendor_attribute;
char *vendor;
-diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
-index a5115fb..81b03f6 100644
---- a/drivers/net/bonding/bond_main.c
-+++ b/drivers/net/bonding/bond_main.c
-@@ -3749,7 +3749,7 @@ int bond_3ad_xor_xmit(struct sk_buff *skb, struct net_device *dev)
- bond_dev_queue_xmit(bond, skb, slave->dev);
- } else {
- dev_kfree_skb_any(skb);
-- atomic_long_inc(&dev->tx_dropped);
-+ atomic_long_inc_unchecked(&dev->tx_dropped);
- }
-
- return NETDEV_TX_OK;
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
-index 45f09a6..f154f8d 100644
+index 7b11243..b3278a3 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -585,7 +585,7 @@ nla_put_failure:
@@ -47243,10 +46901,10 @@ index 45f09a6..f154f8d 100644
.priv_size = sizeof(struct bonding),
.setup = bond_setup,
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
-index 5e40a8b..126bfda 100644
+index b3b922a..80bba38 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
-@@ -1445,7 +1445,7 @@ err:
+@@ -1444,7 +1444,7 @@ err:
return -ENODEV;
}
@@ -47269,10 +46927,10 @@ index 98d73aa..63ef9da 100644
Say Y here if you want to support for Freescale FlexCAN.
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
-index 4b008c9..2b1151f 100644
+index 847c1f8..69a0df3 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
-@@ -872,7 +872,7 @@ static int can_newlink(struct net *src_net, struct net_device *dev,
+@@ -950,7 +950,7 @@ static int can_newlink(struct net *src_net, struct net_device *dev,
return -EOPNOTSUPP;
}
@@ -47282,10 +46940,10 @@ index 4b008c9..2b1151f 100644
.maxtype = IFLA_CAN_MAX,
.policy = can_policy,
diff --git a/drivers/net/can/vcan.c b/drivers/net/can/vcan.c
-index 4e94057..32032ff 100644
+index 674f367..ec3a31f 100644
--- a/drivers/net/can/vcan.c
+++ b/drivers/net/can/vcan.c
-@@ -166,7 +166,7 @@ static void vcan_setup(struct net_device *dev)
+@@ -163,7 +163,7 @@ static void vcan_setup(struct net_device *dev)
dev->destructor = free_netdev;
}
@@ -47295,20 +46953,20 @@ index 4e94057..32032ff 100644
.setup = vcan_setup,
};
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
-index ff435fb..d408b1f 100644
+index 49adbf1..fff7ff8 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
-@@ -149,7 +149,7 @@ static int dummy_validate(struct nlattr *tb[], struct nlattr *data[])
+@@ -164,7 +164,7 @@ static int dummy_validate(struct nlattr *tb[], struct nlattr *data[])
return 0;
}
-static struct rtnl_link_ops dummy_link_ops __read_mostly = {
+static struct rtnl_link_ops dummy_link_ops = {
- .kind = "dummy",
+ .kind = DRV_NAME,
.setup = dummy_setup,
.validate = dummy_validate,
diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
-index 1d162cc..b546a75 100644
+index 0443654..4f0aa18 100644
--- a/drivers/net/ethernet/8390/ax88796.c
+++ b/drivers/net/ethernet/8390/ax88796.c
@@ -889,9 +889,11 @@ static int ax_probe(struct platform_device *pdev)
@@ -47325,10 +46983,10 @@ index 1d162cc..b546a75 100644
if (!request_mem_region(mem->start, mem_size, pdev->name)) {
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
-index 4efc435..4ab9e14 100644
+index 760c72c..a99728c 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
-@@ -1224,7 +1224,7 @@ static int tse_shutdown(struct net_device *dev)
+@@ -1217,7 +1217,7 @@ static int tse_shutdown(struct net_device *dev)
return 0;
}
@@ -47337,7 +46995,7 @@ index 4efc435..4ab9e14 100644
.ndo_open = tse_open,
.ndo_stop = tse_shutdown,
.ndo_start_xmit = tse_start_xmit,
-@@ -1461,11 +1461,13 @@ static int altera_tse_probe(struct platform_device *pdev)
+@@ -1454,11 +1454,13 @@ static int altera_tse_probe(struct platform_device *pdev)
ndev->netdev_ops = &altera_tse_netdev_ops;
altera_tse_set_ethtool_ops(ndev);
@@ -47352,10 +47010,10 @@ index 4efc435..4ab9e14 100644
/* Scatter/gather IO is not supported,
* so it is turned off
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-common.h b/drivers/net/ethernet/amd/xgbe/xgbe-common.h
-index caade30..3e257d9 100644
+index 29a0927..5a348e24 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-common.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-common.h
-@@ -1072,14 +1072,14 @@ do { \
+@@ -1122,14 +1122,14 @@ do { \
* operations, everything works on mask values.
*/
#define XMDIO_READ(_pdata, _mmd, _reg) \
@@ -47395,10 +47053,10 @@ index 8a50b01..39c1ad0 100644
return 0;
}
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-desc.c b/drivers/net/ethernet/amd/xgbe/xgbe-desc.c
-index 6fc5da0..61ac2cb 100644
+index a50891f..b26fe24 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-desc.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-desc.c
-@@ -235,7 +235,7 @@ err_ring:
+@@ -347,7 +347,7 @@ static int xgbe_map_rx_buffer(struct xgbe_prv_data *pdata,
static void xgbe_wrapper_tx_descriptor_init(struct xgbe_prv_data *pdata)
{
@@ -47407,7 +47065,7 @@ index 6fc5da0..61ac2cb 100644
struct xgbe_channel *channel;
struct xgbe_ring *ring;
struct xgbe_ring_data *rdata;
-@@ -276,7 +276,7 @@ static void xgbe_wrapper_tx_descriptor_init(struct xgbe_prv_data *pdata)
+@@ -388,7 +388,7 @@ static void xgbe_wrapper_tx_descriptor_init(struct xgbe_prv_data *pdata)
static void xgbe_wrapper_rx_descriptor_init(struct xgbe_prv_data *pdata)
{
@@ -47416,17 +47074,17 @@ index 6fc5da0..61ac2cb 100644
struct xgbe_channel *channel;
struct xgbe_ring *ring;
struct xgbe_ring_desc *rdesc;
-@@ -505,7 +505,7 @@ err_out:
- static void xgbe_realloc_skb(struct xgbe_channel *channel)
+@@ -624,7 +624,7 @@ err_out:
+ static void xgbe_realloc_rx_buffer(struct xgbe_channel *channel)
{
struct xgbe_prv_data *pdata = channel->pdata;
- struct xgbe_hw_if *hw_if = &pdata->hw_if;
+ struct xgbe_hw_if *hw_if = pdata->hw_if;
struct xgbe_ring *ring = channel->rx_ring;
struct xgbe_ring_data *rdata;
- struct sk_buff *skb = NULL;
-@@ -546,17 +546,12 @@ static void xgbe_realloc_skb(struct xgbe_channel *channel)
- DBGPR("<--xgbe_realloc_skb\n");
+ int i;
+@@ -650,17 +650,12 @@ static void xgbe_realloc_rx_buffer(struct xgbe_channel *channel)
+ DBGPR("<--xgbe_realloc_rx_buffer\n");
}
-void xgbe_init_function_ptrs_desc(struct xgbe_desc_if *desc_if)
@@ -47436,8 +47094,8 @@ index 6fc5da0..61ac2cb 100644
- desc_if->alloc_ring_resources = xgbe_alloc_ring_resources;
- desc_if->free_ring_resources = xgbe_free_ring_resources;
- desc_if->map_tx_skb = xgbe_map_tx_skb;
-- desc_if->realloc_skb = xgbe_realloc_skb;
-- desc_if->unmap_skb = xgbe_unmap_skb;
+- desc_if->realloc_rx_buffer = xgbe_realloc_rx_buffer;
+- desc_if->unmap_rdata = xgbe_unmap_rdata;
- desc_if->wrapper_tx_desc_init = xgbe_wrapper_tx_descriptor_init;
- desc_if->wrapper_rx_desc_init = xgbe_wrapper_rx_descriptor_init;
-
@@ -47447,16 +47105,16 @@ index 6fc5da0..61ac2cb 100644
+ .alloc_ring_resources = xgbe_alloc_ring_resources,
+ .free_ring_resources = xgbe_free_ring_resources,
+ .map_tx_skb = xgbe_map_tx_skb,
-+ .realloc_skb = xgbe_realloc_skb,
-+ .unmap_skb = xgbe_unmap_skb,
++ .realloc_rx_buffer = xgbe_realloc_rx_buffer,
++ .unmap_rdata = xgbe_unmap_rdata,
+ .wrapper_tx_desc_init = xgbe_wrapper_tx_descriptor_init,
+ .wrapper_rx_desc_init = xgbe_wrapper_rx_descriptor_init,
+};
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
-index 9da3a03..022f15c 100644
+index 4c66cd1..1a20aab 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
-@@ -2462,7 +2462,7 @@ static void xgbe_powerdown_rx(struct xgbe_prv_data *pdata)
+@@ -2703,7 +2703,7 @@ static void xgbe_powerdown_rx(struct xgbe_prv_data *pdata)
static int xgbe_init(struct xgbe_prv_data *pdata)
{
@@ -47465,7 +47123,7 @@ index 9da3a03..022f15c 100644
int ret;
DBGPR("-->xgbe_init\n");
-@@ -2524,101 +2524,96 @@ static int xgbe_init(struct xgbe_prv_data *pdata)
+@@ -2767,108 +2767,103 @@ static int xgbe_init(struct xgbe_prv_data *pdata)
return 0;
}
@@ -47506,7 +47164,7 @@ index 9da3a03..022f15c 100644
- hw_if->powerup_rx = xgbe_powerup_rx;
- hw_if->powerdown_rx = xgbe_powerdown_rx;
-
-- hw_if->pre_xmit = xgbe_pre_xmit;
+- hw_if->dev_xmit = xgbe_dev_xmit;
- hw_if->dev_read = xgbe_dev_read;
- hw_if->enable_int = xgbe_enable_int;
- hw_if->disable_int = xgbe_disable_int;
@@ -47546,7 +47204,7 @@ index 9da3a03..022f15c 100644
+ .powerup_rx = xgbe_powerup_rx,
+ .powerdown_rx = xgbe_powerdown_rx,
+
-+ .pre_xmit = xgbe_pre_xmit,
++ .dev_xmit = xgbe_dev_xmit,
+ .dev_read = xgbe_dev_read,
+ .enable_int = xgbe_enable_int,
+ .disable_int = xgbe_disable_int,
@@ -47560,12 +47218,14 @@ index 9da3a03..022f15c 100644
- hw_if->rx_desc_reset = xgbe_rx_desc_reset;
- hw_if->is_last_desc = xgbe_is_last_desc;
- hw_if->is_context_desc = xgbe_is_context_desc;
+- hw_if->tx_start_xmit = xgbe_tx_start_xmit;
+ .tx_desc_init = xgbe_tx_desc_init,
+ .rx_desc_init = xgbe_rx_desc_init,
+ .tx_desc_reset = xgbe_tx_desc_reset,
+ .rx_desc_reset = xgbe_rx_desc_reset,
+ .is_last_desc = xgbe_is_last_desc,
+ .is_context_desc = xgbe_is_context_desc,
++ .tx_start_xmit = xgbe_tx_start_xmit,
/* For FLOW ctrl */
- hw_if->config_tx_flow_control = xgbe_config_tx_flow_control;
@@ -47634,17 +47294,36 @@ index 9da3a03..022f15c 100644
/* For Data Center Bridging config */
- hw_if->config_dcb_tc = xgbe_config_dcb_tc;
- hw_if->config_dcb_pfc = xgbe_config_dcb_pfc;
++ .config_dcb_tc = xgbe_config_dcb_tc,
++ .config_dcb_pfc = xgbe_config_dcb_pfc,
+
+ /* For Receive Side Scaling */
+- hw_if->enable_rss = xgbe_enable_rss;
+- hw_if->disable_rss = xgbe_disable_rss;
+- hw_if->set_rss_hash_key = xgbe_set_rss_hash_key;
+- hw_if->set_rss_lookup_table = xgbe_set_rss_lookup_table;
-
- DBGPR("<--xgbe_init_function_ptrs\n");
-}
-+ .config_dcb_tc = xgbe_config_dcb_tc,
-+ .config_dcb_pfc = xgbe_config_dcb_pfc,
++ .enable_rss = xgbe_enable_rss,
++ .disable_rss = xgbe_disable_rss,
++ .set_rss_hash_key = xgbe_set_rss_hash_key,
++ .set_rss_lookup_table = xgbe_set_rss_lookup_table,
+};
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
-index 2349ea9..a83a677 100644
+index e5ffb2c..e56d30b 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
-@@ -154,7 +154,7 @@ static int xgbe_calc_rx_buf_size(struct net_device *netdev, unsigned int mtu)
+@@ -239,7 +239,7 @@ static int xgbe_maybe_stop_tx_queue(struct xgbe_channel *channel,
+ * support, tell it now
+ */
+ if (ring->tx.xmit_more)
+- pdata->hw_if.tx_start_xmit(channel, ring);
++ pdata->hw_if->tx_start_xmit(channel, ring);
+
+ return NETDEV_TX_BUSY;
+ }
+@@ -267,7 +267,7 @@ static int xgbe_calc_rx_buf_size(struct net_device *netdev, unsigned int mtu)
static void xgbe_enable_rx_tx_ints(struct xgbe_prv_data *pdata)
{
@@ -47653,7 +47332,7 @@ index 2349ea9..a83a677 100644
struct xgbe_channel *channel;
enum xgbe_int int_id;
unsigned int i;
-@@ -176,7 +176,7 @@ static void xgbe_enable_rx_tx_ints(struct xgbe_prv_data *pdata)
+@@ -289,7 +289,7 @@ static void xgbe_enable_rx_tx_ints(struct xgbe_prv_data *pdata)
static void xgbe_disable_rx_tx_ints(struct xgbe_prv_data *pdata)
{
@@ -47662,7 +47341,7 @@ index 2349ea9..a83a677 100644
struct xgbe_channel *channel;
enum xgbe_int int_id;
unsigned int i;
-@@ -199,7 +199,7 @@ static void xgbe_disable_rx_tx_ints(struct xgbe_prv_data *pdata)
+@@ -312,7 +312,7 @@ static void xgbe_disable_rx_tx_ints(struct xgbe_prv_data *pdata)
static irqreturn_t xgbe_isr(int irq, void *data)
{
struct xgbe_prv_data *pdata = data;
@@ -47671,7 +47350,7 @@ index 2349ea9..a83a677 100644
struct xgbe_channel *channel;
unsigned int dma_isr, dma_ch_isr;
unsigned int mac_isr, mac_tssr;
-@@ -446,7 +446,7 @@ static void xgbe_napi_disable(struct xgbe_prv_data *pdata, unsigned int del)
+@@ -611,7 +611,7 @@ static void xgbe_napi_disable(struct xgbe_prv_data *pdata, unsigned int del)
void xgbe_init_tx_coalesce(struct xgbe_prv_data *pdata)
{
@@ -47680,7 +47359,7 @@ index 2349ea9..a83a677 100644
DBGPR("-->xgbe_init_tx_coalesce\n");
-@@ -460,7 +460,7 @@ void xgbe_init_tx_coalesce(struct xgbe_prv_data *pdata)
+@@ -625,7 +625,7 @@ void xgbe_init_tx_coalesce(struct xgbe_prv_data *pdata)
void xgbe_init_rx_coalesce(struct xgbe_prv_data *pdata)
{
@@ -47689,25 +47368,25 @@ index 2349ea9..a83a677 100644
DBGPR("-->xgbe_init_rx_coalesce\n");
-@@ -474,7 +474,7 @@ void xgbe_init_rx_coalesce(struct xgbe_prv_data *pdata)
+@@ -639,7 +639,7 @@ void xgbe_init_rx_coalesce(struct xgbe_prv_data *pdata)
- static void xgbe_free_tx_skbuff(struct xgbe_prv_data *pdata)
+ static void xgbe_free_tx_data(struct xgbe_prv_data *pdata)
{
- struct xgbe_desc_if *desc_if = &pdata->desc_if;
+ struct xgbe_desc_if *desc_if = pdata->desc_if;
struct xgbe_channel *channel;
struct xgbe_ring *ring;
struct xgbe_ring_data *rdata;
-@@ -499,7 +499,7 @@ static void xgbe_free_tx_skbuff(struct xgbe_prv_data *pdata)
+@@ -664,7 +664,7 @@ static void xgbe_free_tx_data(struct xgbe_prv_data *pdata)
- static void xgbe_free_rx_skbuff(struct xgbe_prv_data *pdata)
+ static void xgbe_free_rx_data(struct xgbe_prv_data *pdata)
{
- struct xgbe_desc_if *desc_if = &pdata->desc_if;
+ struct xgbe_desc_if *desc_if = pdata->desc_if;
struct xgbe_channel *channel;
struct xgbe_ring *ring;
struct xgbe_ring_data *rdata;
-@@ -525,7 +525,7 @@ static void xgbe_free_rx_skbuff(struct xgbe_prv_data *pdata)
+@@ -690,7 +690,7 @@ static void xgbe_free_rx_data(struct xgbe_prv_data *pdata)
static void xgbe_adjust_link(struct net_device *netdev)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -47716,7 +47395,7 @@ index 2349ea9..a83a677 100644
struct phy_device *phydev = pdata->phydev;
int new_state = 0;
-@@ -633,7 +633,7 @@ static void xgbe_phy_exit(struct xgbe_prv_data *pdata)
+@@ -798,7 +798,7 @@ static void xgbe_phy_exit(struct xgbe_prv_data *pdata)
int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -47725,7 +47404,7 @@ index 2349ea9..a83a677 100644
unsigned long flags;
DBGPR("-->xgbe_powerdown\n");
-@@ -671,7 +671,7 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
+@@ -836,7 +836,7 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
int xgbe_powerup(struct net_device *netdev, unsigned int caller)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -47734,7 +47413,7 @@ index 2349ea9..a83a677 100644
unsigned long flags;
DBGPR("-->xgbe_powerup\n");
-@@ -708,7 +708,7 @@ int xgbe_powerup(struct net_device *netdev, unsigned int caller)
+@@ -873,7 +873,7 @@ int xgbe_powerup(struct net_device *netdev, unsigned int caller)
static int xgbe_start(struct xgbe_prv_data *pdata)
{
@@ -47743,25 +47422,25 @@ index 2349ea9..a83a677 100644
struct net_device *netdev = pdata->netdev;
DBGPR("-->xgbe_start\n");
-@@ -734,7 +734,7 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
+@@ -899,7 +899,7 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
static void xgbe_stop(struct xgbe_prv_data *pdata)
{
- struct xgbe_hw_if *hw_if = &pdata->hw_if;
+ struct xgbe_hw_if *hw_if = pdata->hw_if;
+ struct xgbe_channel *channel;
struct net_device *netdev = pdata->netdev;
-
- DBGPR("-->xgbe_stop\n");
-@@ -754,7 +754,7 @@ static void xgbe_stop(struct xgbe_prv_data *pdata)
-
+ struct netdev_queue *txq;
+@@ -932,7 +932,7 @@ static void xgbe_stop(struct xgbe_prv_data *pdata)
static void xgbe_restart_dev(struct xgbe_prv_data *pdata, unsigned int reset)
{
+ struct xgbe_channel *channel;
- struct xgbe_hw_if *hw_if = &pdata->hw_if;
+ struct xgbe_hw_if *hw_if = pdata->hw_if;
+ unsigned int i;
DBGPR("-->xgbe_restart_dev\n");
-
-@@ -951,7 +951,7 @@ static int xgbe_set_hwtstamp_settings(struct xgbe_prv_data *pdata,
+@@ -1135,7 +1135,7 @@ static int xgbe_set_hwtstamp_settings(struct xgbe_prv_data *pdata,
return -ERANGE;
}
@@ -47770,7 +47449,7 @@ index 2349ea9..a83a677 100644
memcpy(&pdata->tstamp_config, &config, sizeof(config));
-@@ -1089,8 +1089,8 @@ static void xgbe_packet_info(struct xgbe_prv_data *pdata,
+@@ -1284,8 +1284,8 @@ static void xgbe_packet_info(struct xgbe_prv_data *pdata,
static int xgbe_open(struct net_device *netdev)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -47778,10 +47457,10 @@ index 2349ea9..a83a677 100644
- struct xgbe_desc_if *desc_if = &pdata->desc_if;
+ struct xgbe_hw_if *hw_if = pdata->hw_if;
+ struct xgbe_desc_if *desc_if = pdata->desc_if;
+ struct xgbe_channel *channel = NULL;
+ unsigned int i = 0;
int ret;
-
- DBGPR("-->xgbe_open\n");
-@@ -1170,8 +1170,8 @@ err_phy_init:
+@@ -1400,8 +1400,8 @@ err_phy_init:
static int xgbe_close(struct net_device *netdev)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -47789,10 +47468,10 @@ index 2349ea9..a83a677 100644
- struct xgbe_desc_if *desc_if = &pdata->desc_if;
+ struct xgbe_hw_if *hw_if = pdata->hw_if;
+ struct xgbe_desc_if *desc_if = pdata->desc_if;
+ struct xgbe_channel *channel;
+ unsigned int i;
- DBGPR("-->xgbe_close\n");
-
-@@ -1205,8 +1205,8 @@ static int xgbe_close(struct net_device *netdev)
+@@ -1442,8 +1442,8 @@ static int xgbe_close(struct net_device *netdev)
static int xgbe_xmit(struct sk_buff *skb, struct net_device *netdev)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -47803,7 +47482,7 @@ index 2349ea9..a83a677 100644
struct xgbe_channel *channel;
struct xgbe_ring *ring;
struct xgbe_packet_data *packet;
-@@ -1275,7 +1275,7 @@ tx_netdev_return:
+@@ -1518,7 +1518,7 @@ tx_netdev_return:
static void xgbe_set_rx_mode(struct net_device *netdev)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -47812,7 +47491,7 @@ index 2349ea9..a83a677 100644
unsigned int pr_mode, am_mode;
DBGPR("-->xgbe_set_rx_mode\n");
-@@ -1294,7 +1294,7 @@ static void xgbe_set_rx_mode(struct net_device *netdev)
+@@ -1537,7 +1537,7 @@ static void xgbe_set_rx_mode(struct net_device *netdev)
static int xgbe_set_mac_address(struct net_device *netdev, void *addr)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -47821,7 +47500,7 @@ index 2349ea9..a83a677 100644
struct sockaddr *saddr = addr;
DBGPR("-->xgbe_set_mac_address\n");
-@@ -1361,7 +1361,7 @@ static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev,
+@@ -1604,7 +1604,7 @@ static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev,
DBGPR("-->%s\n", __func__);
@@ -47830,7 +47509,7 @@ index 2349ea9..a83a677 100644
s->rx_packets = pstats->rxframecount_gb;
s->rx_bytes = pstats->rxoctetcount_gb;
-@@ -1388,7 +1388,7 @@ static int xgbe_vlan_rx_add_vid(struct net_device *netdev, __be16 proto,
+@@ -1631,7 +1631,7 @@ static int xgbe_vlan_rx_add_vid(struct net_device *netdev, __be16 proto,
u16 vid)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -47839,7 +47518,7 @@ index 2349ea9..a83a677 100644
DBGPR("-->%s\n", __func__);
-@@ -1404,7 +1404,7 @@ static int xgbe_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto,
+@@ -1647,7 +1647,7 @@ static int xgbe_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto,
u16 vid)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -47848,16 +47527,16 @@ index 2349ea9..a83a677 100644
DBGPR("-->%s\n", __func__);
-@@ -1464,7 +1464,7 @@ static int xgbe_set_features(struct net_device *netdev,
+@@ -1713,7 +1713,7 @@ static int xgbe_set_features(struct net_device *netdev,
netdev_features_t features)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
- struct xgbe_hw_if *hw_if = &pdata->hw_if;
+ struct xgbe_hw_if *hw_if = pdata->hw_if;
- netdev_features_t rxcsum, rxvlan, rxvlan_filter;
+ netdev_features_t rxhash, rxcsum, rxvlan, rxvlan_filter;
+ int ret = 0;
- rxcsum = pdata->netdev_features & NETIF_F_RXCSUM;
-@@ -1520,7 +1520,7 @@ struct net_device_ops *xgbe_get_netdev_ops(void)
+@@ -1778,7 +1778,7 @@ struct net_device_ops *xgbe_get_netdev_ops(void)
static void xgbe_rx_refresh(struct xgbe_channel *channel)
{
struct xgbe_prv_data *pdata = channel->pdata;
@@ -47866,7 +47545,7 @@ index 2349ea9..a83a677 100644
struct xgbe_ring *ring = channel->rx_ring;
struct xgbe_ring_data *rdata;
-@@ -1536,8 +1536,8 @@ static void xgbe_rx_refresh(struct xgbe_channel *channel)
+@@ -1819,8 +1819,8 @@ static struct sk_buff *xgbe_create_skb(struct xgbe_prv_data *pdata,
static int xgbe_tx_poll(struct xgbe_channel *channel)
{
struct xgbe_prv_data *pdata = channel->pdata;
@@ -47877,7 +47556,7 @@ index 2349ea9..a83a677 100644
struct xgbe_ring *ring = channel->tx_ring;
struct xgbe_ring_data *rdata;
struct xgbe_ring_desc *rdesc;
-@@ -1589,7 +1589,7 @@ static int xgbe_tx_poll(struct xgbe_channel *channel)
+@@ -1891,7 +1891,7 @@ unlock:
static int xgbe_rx_poll(struct xgbe_channel *channel, int budget)
{
struct xgbe_prv_data *pdata = channel->pdata;
@@ -47887,7 +47566,7 @@ index 2349ea9..a83a677 100644
struct xgbe_ring_data *rdata;
struct xgbe_packet_data *packet;
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
-index 49508ec..2617cca 100644
+index ebf4893..28108c7 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
@@ -203,7 +203,7 @@ static void xgbe_get_ethtool_stats(struct net_device *netdev,
@@ -47918,10 +47597,10 @@ index 49508ec..2617cca 100644
unsigned int tx_frames, tx_usecs;
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
-index f5a8fa0..0bb58ff 100644
+index dbd3850..4e31b38 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
-@@ -209,12 +209,6 @@ static void xgbe_default_config(struct xgbe_prv_data *pdata)
+@@ -155,12 +155,6 @@ static void xgbe_default_config(struct xgbe_prv_data *pdata)
DBGPR("<--xgbe_default_config\n");
}
@@ -47934,7 +47613,7 @@ index f5a8fa0..0bb58ff 100644
static int xgbe_probe(struct platform_device *pdev)
{
struct xgbe_prv_data *pdata;
-@@ -327,9 +321,8 @@ static int xgbe_probe(struct platform_device *pdev)
+@@ -281,9 +275,8 @@ static int xgbe_probe(struct platform_device *pdev)
netdev->base_addr = (unsigned long)pdata->xgmac_regs;
/* Set all the function pointers */
@@ -47991,12 +47670,12 @@ index a1bf9d1c..84adcab 100644
spin_unlock_irqrestore(&pdata->tstamp_lock, flags);
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h
-index 789957d..d7d0245 100644
+index f9ec762..988c969 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe.h
-@@ -583,8 +583,8 @@ struct xgbe_prv_data {
-
- int irq_number;
+@@ -668,8 +668,8 @@ struct xgbe_prv_data {
+ int dev_irq;
+ unsigned int per_channel_irq;
- struct xgbe_hw_if hw_if;
- struct xgbe_desc_if desc_if;
@@ -48005,7 +47684,7 @@ index 789957d..d7d0245 100644
/* AXI DMA settings */
unsigned int axdomain;
-@@ -697,6 +697,9 @@ struct xgbe_prv_data {
+@@ -787,6 +787,9 @@ struct xgbe_prv_data {
#endif
};
@@ -48029,7 +47708,7 @@ index adcacda..fa6e0ae 100644
/* multicast configuration controlling object */
bnx2x_init_mcast_obj(bp, &bp->mcast_obj, bp->fp->cl_id, bp->fp->cid,
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
-index 7bc2924..2112002 100644
+index 07cdf9b..b08ecc7 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
@@ -2329,15 +2329,14 @@ int bnx2x_config_rx_mode(struct bnx2x *bp,
@@ -48054,10 +47733,10 @@ index 7bc2924..2112002 100644
}
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
-index e97275f..52e28bc 100644
+index 86baecb..ff3bb46 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
-@@ -1409,8 +1409,7 @@ int bnx2x_vlan_mac_move(struct bnx2x *bp,
+@@ -1411,8 +1411,7 @@ int bnx2x_vlan_mac_move(struct bnx2x *bp,
/********************* RX MODE ****************/
@@ -48112,10 +47791,10 @@ index 8cffcdf..aadf043 100644
#define L2T_SKB_CB(skb) ((struct l2t_skb_cb *)(skb)->cb)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
-index 279873c..11e1921 100644
+index ccf3436..b720d77 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
-@@ -2365,7 +2365,7 @@ static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
+@@ -2277,7 +2277,7 @@ static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
int i;
struct adapter *ap = netdev2adap(dev);
@@ -48125,10 +47804,10 @@ index 279873c..11e1921 100644
if (is_t4(ap->params.chip)) {
diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c
-index cf8b6ff..274271e 100644
+index badff18..e15c4ec 100644
--- a/drivers/net/ethernet/dec/tulip/de4x5.c
+++ b/drivers/net/ethernet/dec/tulip/de4x5.c
-@@ -5387,7 +5387,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+@@ -5373,7 +5373,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
for (i=0; i<ETH_ALEN; i++) {
tmp.addr[i] = dev->dev_addr[i];
}
@@ -48137,7 +47816,7 @@ index cf8b6ff..274271e 100644
break;
case DE4X5_SET_HWADDR: /* Set the hardware address */
-@@ -5427,7 +5427,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+@@ -5413,7 +5413,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
spin_lock_irqsave(&lp->lock, flags);
memcpy(&statbuf, &lp->pktStats, ioc->len);
spin_unlock_irqrestore(&lp->lock, flags);
@@ -48147,7 +47826,7 @@ index cf8b6ff..274271e 100644
break;
}
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
-index d2975fa..8aaec07 100644
+index d48806b..41cd80f 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -537,7 +537,7 @@ static void accumulate_16bit_val(u32 *acc, u16 val)
@@ -48160,7 +47839,7 @@ index d2975fa..8aaec07 100644
static void populate_erx_stats(struct be_adapter *adapter,
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
-index c77fa4a..7fd42fc 100644
+index 6d0c5d5..55be363 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -30,6 +30,8 @@
@@ -48173,7 +47852,7 @@ index c77fa4a..7fd42fc 100644
#include "ftgmac100.h"
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
-index 4ff1adc..0ea6bf4 100644
+index dce5f7b..2433466 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -31,6 +31,8 @@
@@ -48185,24 +47864,11 @@ index 4ff1adc..0ea6bf4 100644
#include "ftmac100.h"
-diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
-index 76d7070..f6971182 100644
---- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
-+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
-@@ -1581,7 +1581,7 @@ static int gfar_write_filer_table(struct gfar_private *priv,
- return -EBUSY;
-
- /* Fill regular entries */
-- for (; i < MAX_FILER_IDX - 1 && (tab->fe[i].ctrl | tab->fe[i].ctrl);
-+ for (; i < MAX_FILER_IDX - 1 && (tab->fe[i].ctrl | tab->fe[i].prop);
- i++)
- gfar_write_filer(priv, i, tab->fe[i].ctrl, tab->fe[i].prop);
- /* Fill the rest with fall-troughs */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
-index 537b621..07f87ce 100644
+index 6d1ec92..4d5d97d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
-@@ -401,7 +401,7 @@ void i40e_ptp_set_increment(struct i40e_pf *pf)
+@@ -407,7 +407,7 @@ void i40e_ptp_set_increment(struct i40e_pf *pf)
wr32(hw, I40E_PRTTSYN_INC_H, incval >> 32);
/* Update the base adjustement value. */
@@ -48225,10 +47891,10 @@ index 5fd4b52..87aa34b 100644
/* need lock to prevent incorrect read while modifying cyclecounter */
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
-index 11ff28b..375d659 100644
+index e3357bf..d4d5348 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
-@@ -458,8 +458,8 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev,
+@@ -466,8 +466,8 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev,
wmb();
/* we want to dirty this cache line once */
@@ -48239,56 +47905,6 @@ index 11ff28b..375d659 100644
netdev_tx_completed_queue(ring->tx_queue, packets, bytes);
-diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
-index de10dbb..8b54f29 100644
---- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
-+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
-@@ -233,7 +233,8 @@ do { \
- extern int mlx4_log_num_mgm_entry_size;
- extern int log_mtts_per_seg;
-
--#define MLX4_MAX_NUM_SLAVES (MLX4_MAX_NUM_PF + MLX4_MAX_NUM_VF)
-+#define MLX4_MAX_NUM_SLAVES (min(MLX4_MAX_NUM_PF + MLX4_MAX_NUM_VF, \
-+ MLX4_MFUNC_MAX))
- #define ALL_SLAVES 0xff
-
- struct mlx4_bitmap {
-diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
-index f5e4b82..db0c7a9 100644
---- a/drivers/net/ethernet/neterion/s2io.c
-+++ b/drivers/net/ethernet/neterion/s2io.c
-@@ -6987,7 +6987,9 @@ static int s2io_add_isr(struct s2io_nic *sp)
- if (sp->s2io_entries[i].in_use == MSIX_FLG) {
- if (sp->s2io_entries[i].type ==
- MSIX_RING_TYPE) {
-- sprintf(sp->desc[i], "%s:MSI-X-%d-RX",
-+ snprintf(sp->desc[i],
-+ sizeof(sp->desc[i]),
-+ "%s:MSI-X-%d-RX",
- dev->name, i);
- err = request_irq(sp->entries[i].vector,
- s2io_msix_ring_handle,
-@@ -6996,7 +6998,9 @@ static int s2io_add_isr(struct s2io_nic *sp)
- sp->s2io_entries[i].arg);
- } else if (sp->s2io_entries[i].type ==
- MSIX_ALARM_TYPE) {
-- sprintf(sp->desc[i], "%s:MSI-X-%d-TX",
-+ snprintf(sp->desc[i],
-+ sizeof(sp->desc[i]),
-+ "%s:MSI-X-%d-TX",
- dev->name, i);
- err = request_irq(sp->entries[i].vector,
- s2io_msix_fifo_handle,
-@@ -8154,7 +8158,8 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
- "%s: UDP Fragmentation Offload(UFO) enabled\n",
- dev->name);
- /* Initialize device name */
-- sprintf(sp->name, "%s Neterion %s", dev->name, sp->product_name);
-+ snprintf(sp->name, sizeof(sp->name), "%s Neterion %s", dev->name,
-+ sp->product_name);
-
- if (vlan_tag_strip)
- sp->vlan_strip_flag = 1;
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c
index 2bbd01f..e8baa64 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.c
@@ -48374,7 +47990,7 @@ index c9f57fb..208bdc1 100644
u32 entry_offset, dump, no_entries, buf_offset = 0;
int i, k, ops_cnt, ops_index, dump_size = 0;
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
-index cf154f7..c948d1b 100644
+index 14a1c5c..38a141d 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -788,22 +788,22 @@ struct rtl8169_private {
@@ -48433,7 +48049,7 @@ index 08c483b..2c4a553 100644
/* To mask all all interrupts.*/
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
-index 2f48f79..8ae1a1a 100644
+index 384ca4f..dd7d4f9 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -171,7 +171,7 @@ struct rndis_device {
@@ -48446,7 +48062,7 @@ index 2f48f79..8ae1a1a 100644
spinlock_t request_lock;
struct list_head req_list;
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
-index 2b86f0b..ecc996f 100644
+index ec0c40a..c9e42eb 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -102,7 +102,7 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
@@ -48458,7 +48074,7 @@ index 2b86f0b..ecc996f 100644
/* Add to the request list */
spin_lock_irqsave(&dev->request_lock, flags);
-@@ -911,7 +911,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
+@@ -912,7 +912,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
/* Setup the rndis set */
halt = &request->request_msg.msg.halt_req;
@@ -48467,19 +48083,6 @@ index 2b86f0b..ecc996f 100644
/* Ignore return since this msg is optional. */
rndis_filter_send_request(dev, request);
-diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c
-index 6cbc56a..5f7e6c8 100644
---- a/drivers/net/ieee802154/fakehard.c
-+++ b/drivers/net/ieee802154/fakehard.c
-@@ -365,7 +365,7 @@ static int ieee802154fake_probe(struct platform_device *pdev)
- phy->transmit_power = 0xbf;
-
- dev->netdev_ops = &fake_ops;
-- dev->ml_priv = &fake_mlme;
-+ dev->ml_priv = (void *)&fake_mlme;
-
- priv = netdev_priv(dev);
- priv->phy = phy;
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 34f846b..4a0d5b1 100644
--- a/drivers/net/ifb.c
@@ -48494,7 +48097,7 @@ index 34f846b..4a0d5b1 100644
.priv_size = sizeof(struct ifb_private),
.setup = ifb_setup,
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
-index bfb0b6e..5c396ce 100644
+index 612e073..a9f5eda 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -335,7 +335,7 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port,
@@ -48506,7 +48109,7 @@ index bfb0b6e..5c396ce 100644
}
static void macvlan_flush_sources(struct macvlan_port *port,
-@@ -1454,13 +1454,15 @@ static const struct nla_policy macvlan_policy[IFLA_MACVLAN_MAX + 1] = {
+@@ -1459,13 +1459,15 @@ static const struct nla_policy macvlan_policy[IFLA_MACVLAN_MAX + 1] = {
int macvlan_link_register(struct rtnl_link_ops *ops)
{
/* common fields */
@@ -48529,7 +48132,7 @@ index bfb0b6e..5c396ce 100644
return rtnl_link_register(ops);
};
-@@ -1540,7 +1542,7 @@ static int macvlan_device_event(struct notifier_block *unused,
+@@ -1545,7 +1547,7 @@ static int macvlan_device_event(struct notifier_block *unused,
return NOTIFY_DONE;
}
@@ -48539,10 +48142,10 @@ index bfb0b6e..5c396ce 100644
};
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
-index 880cc09..764aee1 100644
+index 919f4fc..012f6dd 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
-@@ -422,7 +422,7 @@ static void macvtap_setup(struct net_device *dev)
+@@ -436,7 +436,7 @@ static void macvtap_setup(struct net_device *dev)
dev->tx_queue_len = TUN_READQ_SIZE;
}
@@ -48551,7 +48154,7 @@ index 880cc09..764aee1 100644
.kind = "macvtap",
.setup = macvtap_setup,
.newlink = macvtap_newlink,
-@@ -637,12 +637,15 @@ static void macvtap_skb_to_vnet_hdr(const struct sk_buff *skb,
+@@ -654,11 +654,14 @@ static void macvtap_skb_to_vnet_hdr(struct macvtap_queue *q,
} /* else everything is zero */
}
@@ -48560,16 +48163,15 @@ index 880cc09..764aee1 100644
+
/* Get packet from user space buffer */
static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
- const struct iovec *iv, unsigned long total_len,
- size_t count, int noblock)
+ struct iov_iter *from, int noblock)
{
- int good_linear = SKB_MAX_HEAD(NET_IP_ALIGN);
+ int good_linear = SKB_MAX_HEAD(MACVTAP_RESERVE);
struct sk_buff *skb;
struct macvlan_dev *vlan;
- unsigned long len = total_len;
-@@ -701,7 +704,7 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
- linear = vnet_hdr.hdr_len;
+ unsigned long total_len = iov_iter_count(from);
+@@ -722,7 +725,7 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
+ linear = macvtap16_to_cpu(q, vnet_hdr.hdr_len);
}
- skb = macvtap_alloc_skb(&q->sk, NET_IP_ALIGN, copylen,
@@ -48577,16 +48179,16 @@ index 880cc09..764aee1 100644
linear, noblock, &err);
if (!skb)
goto err;
-@@ -1020,7 +1023,7 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
- }
+@@ -1030,7 +1033,7 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
ret = 0;
+ u = q->flags;
- if (copy_to_user(&ifr->ifr_name, vlan->dev->name, IFNAMSIZ) ||
+ if (copy_to_user(ifr->ifr_name, vlan->dev->name, IFNAMSIZ) ||
- put_user(q->flags, &ifr->ifr_flags))
+ put_user(u, &ifr->ifr_flags))
ret = -EFAULT;
macvtap_put_vlan(vlan);
-@@ -1190,7 +1193,7 @@ static int macvtap_device_event(struct notifier_block *unused,
+@@ -1214,7 +1217,7 @@ static int macvtap_device_event(struct notifier_block *unused,
return NOTIFY_DONE;
}
@@ -48608,11 +48210,42 @@ index 34924df..a747360 100644
.kind = "nlmon",
.priv_size = sizeof(struct nlmon),
.setup = nlmon_setup,
+diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
+index 3fc91e8..6c36337 100644
+--- a/drivers/net/phy/phy_device.c
++++ b/drivers/net/phy/phy_device.c
+@@ -218,7 +218,7 @@ EXPORT_SYMBOL(phy_device_create);
+ * zero on success.
+ *
+ */
+-static int get_phy_c45_ids(struct mii_bus *bus, int addr, u32 *phy_id,
++static int get_phy_c45_ids(struct mii_bus *bus, int addr, int *phy_id,
+ struct phy_c45_device_ids *c45_ids) {
+ int phy_reg;
+ int i, reg_addr;
+@@ -288,7 +288,7 @@ static int get_phy_c45_ids(struct mii_bus *bus, int addr, u32 *phy_id,
+ * its return value is in turn returned.
+ *
+ */
+-static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id,
++static int get_phy_id(struct mii_bus *bus, int addr, int *phy_id,
+ bool is_c45, struct phy_c45_device_ids *c45_ids)
+ {
+ int phy_reg;
+@@ -326,7 +326,7 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id,
+ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45)
+ {
+ struct phy_c45_device_ids c45_ids = {0};
+- u32 phy_id = 0;
++ int phy_id = 0;
+ int r;
+
+ r = get_phy_id(bus, addr, &phy_id, is_c45, &c45_ids);
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
-index 794a473..9fd437b 100644
+index af034db..1611c0b2 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
-@@ -1020,7 +1020,6 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+@@ -1022,7 +1022,6 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
void __user *addr = (void __user *) ifr->ifr_ifru.ifru_data;
struct ppp_stats stats;
struct ppp_comp_stats cstats;
@@ -48620,7 +48253,7 @@ index 794a473..9fd437b 100644
switch (cmd) {
case SIOCGPPPSTATS:
-@@ -1042,8 +1041,7 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+@@ -1044,8 +1043,7 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
break;
case SIOCGPPPVER:
@@ -48644,10 +48277,10 @@ index 079f7ad..b2a2bfa7 100644
/* We've got a compressed packet; read the change byte */
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
-index 9c505c4..5d0c879 100644
+index f7ff493..153e0198 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
-@@ -2102,7 +2102,7 @@ static unsigned int team_get_num_rx_queues(void)
+@@ -2105,7 +2105,7 @@ static unsigned int team_get_num_rx_queues(void)
return TEAM_DEFAULT_NUM_RX_QUEUES;
}
@@ -48656,7 +48289,7 @@ index 9c505c4..5d0c879 100644
.kind = DRV_NAME,
.priv_size = sizeof(struct team),
.setup = team_setup,
-@@ -2892,7 +2892,7 @@ static int team_device_event(struct notifier_block *unused,
+@@ -2895,7 +2895,7 @@ static int team_device_event(struct notifier_block *unused,
return NOTIFY_DONE;
}
@@ -48666,10 +48299,10 @@ index 9c505c4..5d0c879 100644
};
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
-index 9dd3746..74f191e 100644
+index 10f9e40..3515e7e 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
-@@ -1426,7 +1426,7 @@ static int tun_validate(struct nlattr *tb[], struct nlattr *data[])
+@@ -1425,7 +1425,7 @@ static int tun_validate(struct nlattr *tb[], struct nlattr *data[])
return -EINVAL;
}
@@ -48678,7 +48311,7 @@ index 9dd3746..74f191e 100644
.kind = DRV_NAME,
.priv_size = sizeof(struct tun_struct),
.setup = tun_setup,
-@@ -1868,7 +1868,7 @@ unlock:
+@@ -1827,7 +1827,7 @@ unlock:
}
static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
@@ -48687,8 +48320,8 @@ index 9dd3746..74f191e 100644
{
struct tun_file *tfile = file->private_data;
struct tun_struct *tun;
-@@ -1881,6 +1881,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
- unsigned int ifindex;
+@@ -1841,6 +1841,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
+ int le;
int ret;
+ if (ifreq_len > sizeof ifr)
@@ -48698,7 +48331,7 @@ index 9dd3746..74f191e 100644
if (copy_from_user(&ifr, argp, ifreq_len))
return -EFAULT;
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
-index babda7d..e40c90a 100644
+index 9c5aa92..8cd0405 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -71,7 +71,7 @@
@@ -48779,7 +48412,7 @@ index babda7d..e40c90a 100644
/* Setup and send a ctrl req read on
* port i */
if (!serial->rx_urb_filled[0]) {
-@@ -3047,7 +3046,7 @@ static int hso_resume(struct usb_interface *iface)
+@@ -3046,7 +3045,7 @@ static int hso_resume(struct usb_interface *iface)
/* Start all serial ports */
for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
if (serial_table[i] && (serial_table[i]->interface == iface)) {
@@ -48789,10 +48422,10 @@ index babda7d..e40c90a 100644
hso_start_serial_device(serial_table[i], GFP_NOIO);
hso_kick_transmit(dev2ser(serial_table[i]));
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
-index c6554c7..7e2ebd7 100644
+index bf405f1..fd847ee 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -577,7 +577,7 @@ struct r8152 {
+@@ -571,7 +571,7 @@ struct r8152 {
void (*unload)(struct r8152 *);
int (*eee_get)(struct r8152 *, struct ethtool_eee *);
int (*eee_set)(struct r8152 *, struct ethtool_eee *);
@@ -48824,7 +48457,7 @@ index a2515887..6d13233 100644
/* we will have to manufacture ethernet headers, prepare template */
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
-index b0bc8ea..3af931b5 100644
+index 059fdf1..7543217 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -48,7 +48,7 @@ module_param(gso, bool, 0444);
@@ -48837,10 +48470,10 @@ index b0bc8ea..3af931b5 100644
#define VIRTNET_DRIVER_VERSION "1.0.0"
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
-index 42b2d6a5..2a2cb41 100644
+index a8c755d..a988b71 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
-@@ -2695,7 +2695,7 @@ nla_put_failure:
+@@ -2702,7 +2702,7 @@ nla_put_failure:
return -EMSGSIZE;
}
@@ -48849,7 +48482,7 @@ index 42b2d6a5..2a2cb41 100644
.kind = "vxlan",
.maxtype = IFLA_VXLAN_MAX,
.policy = vxlan_policy,
-@@ -2742,7 +2742,7 @@ static int vxlan_lowerdev_event(struct notifier_block *unused,
+@@ -2749,7 +2749,7 @@ static int vxlan_lowerdev_event(struct notifier_block *unused,
return NOTIFY_DONE;
}
@@ -49066,10 +48699,10 @@ index da92bfa..5a9001a 100644
return msecs_to_jiffies((s->poll_timeout[2] << 16)
| (s->poll_timeout[1] << 8)
diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
-index 676bd4e..0b807a3 100644
+index f1946a6..cd367fb 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
-@@ -848,7 +848,10 @@ int ath10k_htc_start(struct ath10k_htc *htc)
+@@ -851,7 +851,10 @@ int ath10k_htc_start(struct ath10k_htc *htc)
/* registered target arrival callback from the HIF layer */
int ath10k_htc_init(struct ath10k *ar)
{
@@ -49081,7 +48714,7 @@ index 676bd4e..0b807a3 100644
struct ath10k_htc_ep *ep = NULL;
struct ath10k_htc *htc = &ar->htc;
-@@ -857,8 +860,6 @@ int ath10k_htc_init(struct ath10k *ar)
+@@ -860,8 +863,6 @@ int ath10k_htc_init(struct ath10k *ar)
ath10k_htc_reset_endpoint_states(htc);
/* setup HIF layer callbacks */
@@ -49111,7 +48744,7 @@ index 527179c..a890150 100644
/* service connection information */
struct ath10k_htc_svc_conn_req {
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_mac.c b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
-index 2a93519..7052786 100644
+index f816909..e56cd8b 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
@@ -220,8 +220,8 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
@@ -49166,7 +48799,7 @@ index 2a93519..7052786 100644
- ACCESS_ONCE(ads->ds_ctl0) = (i->pkt_len & AR_FrameLen)
+ ACCESS_ONCE_RW(ads->ds_ctl0) = (i->pkt_len & AR_FrameLen)
| (i->flags & ATH9K_TXDESC_VMF ? AR_VirtMoreFrag : 0)
- | SM(i->txpower, AR_XmitPower0)
+ | SM(i->txpower[0], AR_XmitPower0)
| (i->flags & ATH9K_TXDESC_VEOL ? AR_VEOL : 0)
@@ -289,27 +289,27 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
| (i->flags & ATH9K_TXDESC_RTSENA ? AR_RTSEnable :
@@ -49195,17 +48828,17 @@ index 2a93519..7052786 100644
| set11nRateFlags(i->rates, 3)
| SM(i->rtscts_rate, AR_RTSCTSRate);
-- ACCESS_ONCE(ads->ds_ctl9) = SM(i->txpower, AR_XmitPower1);
-- ACCESS_ONCE(ads->ds_ctl10) = SM(i->txpower, AR_XmitPower2);
-- ACCESS_ONCE(ads->ds_ctl11) = SM(i->txpower, AR_XmitPower3);
-+ ACCESS_ONCE_RW(ads->ds_ctl9) = SM(i->txpower, AR_XmitPower1);
-+ ACCESS_ONCE_RW(ads->ds_ctl10) = SM(i->txpower, AR_XmitPower2);
-+ ACCESS_ONCE_RW(ads->ds_ctl11) = SM(i->txpower, AR_XmitPower3);
+- ACCESS_ONCE(ads->ds_ctl9) = SM(i->txpower[1], AR_XmitPower1);
+- ACCESS_ONCE(ads->ds_ctl10) = SM(i->txpower[2], AR_XmitPower2);
+- ACCESS_ONCE(ads->ds_ctl11) = SM(i->txpower[3], AR_XmitPower3);
++ ACCESS_ONCE_RW(ads->ds_ctl9) = SM(i->txpower[1], AR_XmitPower1);
++ ACCESS_ONCE_RW(ads->ds_ctl10) = SM(i->txpower[2], AR_XmitPower2);
++ ACCESS_ONCE_RW(ads->ds_ctl11) = SM(i->txpower[3], AR_XmitPower3);
}
static int ar9002_hw_proc_txdesc(struct ath_hw *ah, void *ds,
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
-index 057b165..98ae88f 100644
+index da84b70..83e4978 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -39,47 +39,47 @@ ar9003_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
@@ -49295,7 +48928,7 @@ index 057b165..98ae88f 100644
- ACCESS_ONCE(ads->ctl11) = (i->pkt_len & AR_FrameLen)
+ ACCESS_ONCE_RW(ads->ctl11) = (i->pkt_len & AR_FrameLen)
| (i->flags & ATH9K_TXDESC_VMF ? AR_VirtMoreFrag : 0)
- | SM(i->txpower, AR_XmitPower0)
+ | SM(i->txpower[0], AR_XmitPower0)
| (i->flags & ATH9K_TXDESC_VEOL ? AR_VEOL : 0)
@@ -135,26 +135,26 @@ ar9003_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
val = (i->flags & ATH9K_TXDESC_PAPRD) >> ATH9K_TXDESC_PAPRD_S;
@@ -49324,20 +48957,20 @@ index 057b165..98ae88f 100644
- ACCESS_ONCE(ads->ctl19) = AR_Not_Sounding;
+ ACCESS_ONCE_RW(ads->ctl19) = AR_Not_Sounding;
-- ACCESS_ONCE(ads->ctl20) = SM(i->txpower, AR_XmitPower1);
-- ACCESS_ONCE(ads->ctl21) = SM(i->txpower, AR_XmitPower2);
-- ACCESS_ONCE(ads->ctl22) = SM(i->txpower, AR_XmitPower3);
-+ ACCESS_ONCE_RW(ads->ctl20) = SM(i->txpower, AR_XmitPower1);
-+ ACCESS_ONCE_RW(ads->ctl21) = SM(i->txpower, AR_XmitPower2);
-+ ACCESS_ONCE_RW(ads->ctl22) = SM(i->txpower, AR_XmitPower3);
+- ACCESS_ONCE(ads->ctl20) = SM(i->txpower[1], AR_XmitPower1);
+- ACCESS_ONCE(ads->ctl21) = SM(i->txpower[2], AR_XmitPower2);
+- ACCESS_ONCE(ads->ctl22) = SM(i->txpower[3], AR_XmitPower3);
++ ACCESS_ONCE_RW(ads->ctl20) = SM(i->txpower[1], AR_XmitPower1);
++ ACCESS_ONCE_RW(ads->ctl21) = SM(i->txpower[2], AR_XmitPower2);
++ ACCESS_ONCE_RW(ads->ctl22) = SM(i->txpower[3], AR_XmitPower3);
}
static u16 ar9003_calc_ptr_chksum(struct ar9003_txc *ads)
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
-index e8e8dd2..030f80e 100644
+index 1cbd335..27dfb40 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -630,7 +630,7 @@ struct ath_hw_private_ops {
+@@ -640,7 +640,7 @@ struct ath_hw_private_ops {
/* ANI */
void (*ani_cache_ini_regs)(struct ath_hw *ah);
@@ -49346,7 +48979,7 @@ index e8e8dd2..030f80e 100644
/**
* struct ath_spec_scan - parameters for Atheros spectral scan
-@@ -708,7 +708,7 @@ struct ath_hw_ops {
+@@ -716,7 +716,7 @@ struct ath_hw_ops {
#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
void (*set_bt_ant_diversity)(struct ath_hw *hw, bool enable);
#endif
@@ -49356,10 +48989,10 @@ index e8e8dd2..030f80e 100644
struct ath_nf_limits {
s16 max;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
-index 4f18a6b..b07d92f 100644
+index 62b0bf4..4ae094c 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -2454,16 +2454,18 @@ void ath9k_fill_chanctx_ops(void)
+@@ -2546,16 +2546,18 @@ void ath9k_fill_chanctx_ops(void)
if (!ath9k_is_chanctx_enabled())
return;
@@ -49553,10 +49186,10 @@ index 0ffb6ff..c0b7f0e 100644
memset(buf, 0, sizeof(buf));
buf_size = min(count, sizeof(buf) - 1);
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
-index dd2f3f8..fb1ae88 100644
+index 523fe0c..0d9473b 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
-@@ -1689,7 +1689,7 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file,
+@@ -1781,7 +1781,7 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file,
struct isr_statistics *isr_stats = &trans_pcie->isr_stats;
char buf[8];
@@ -49565,7 +49198,7 @@ index dd2f3f8..fb1ae88 100644
u32 reset_flag;
memset(buf, 0, sizeof(buf));
-@@ -1710,7 +1710,7 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file,
+@@ -1802,7 +1802,7 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file,
{
struct iwl_trans *trans = file->private_data;
char buf[8];
@@ -49575,10 +49208,10 @@ index dd2f3f8..fb1ae88 100644
memset(buf, 0, sizeof(buf));
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
-index c9ad4cf..49a2fa0 100644
+index ef58a88..fafa731 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
-@@ -2577,20 +2577,20 @@ static int __init init_mac80211_hwsim(void)
+@@ -3066,20 +3066,20 @@ static int __init init_mac80211_hwsim(void)
if (channels < 1)
return -EINVAL;
@@ -49627,7 +49260,7 @@ index 1a4facd..a2ecbbd 100644
tmp = cpu_to_le32(rts_threshold);
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
-index d13f25c..2573994 100644
+index 9bb398b..b0cc047 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -375,7 +375,7 @@ struct rt2x00_intf {
@@ -49682,7 +49315,7 @@ index b661f896..ddf7d2b 100644
wl1251_info("using SDIO interrupt");
}
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
-index 0bccf12..3d95068 100644
+index d6d0d6d..60c23a0 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -656,7 +656,9 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
@@ -49708,7 +49341,7 @@ index 0bccf12..3d95068 100644
wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER,
WL127X_IFTYPE_SR_VER, WL127X_MAJOR_SR_VER,
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
-index 7af1936..128bb35 100644
+index 8e56261..9140678 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -1916,8 +1916,10 @@ static int wl18xx_setup(struct wl1271 *wl)
@@ -49737,42 +49370,8 @@ index a912dc0..a8225ba 100644
u16 int_num;
ZD_ASSERT(in_interrupt());
-diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
-index d752d1c..23e3203 100644
---- a/drivers/net/xen-netback/interface.c
-+++ b/drivers/net/xen-netback/interface.c
-@@ -578,6 +578,7 @@ int xenvif_connect(struct xenvif_queue *queue, unsigned long tx_ring_ref,
- goto err_rx_unbind;
- }
- queue->task = task;
-+ get_task_struct(task);
-
- task = kthread_create(xenvif_dealloc_kthread,
- (void *)queue, "%s-dealloc", queue->name);
-@@ -634,6 +635,7 @@ void xenvif_disconnect(struct xenvif *vif)
-
- if (queue->task) {
- kthread_stop(queue->task);
-+ put_task_struct(queue->task);
- queue->task = NULL;
- }
-
-diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
-index c39aace..e18728d 100644
---- a/drivers/net/xen-netback/netback.c
-+++ b/drivers/net/xen-netback/netback.c
-@@ -2111,8 +2111,7 @@ int xenvif_kthread_guest_rx(void *data)
- */
- if (unlikely(vif->disabled && queue->id == 0)) {
- xenvif_carrier_off(vif);
-- xenvif_rx_queue_purge(queue);
-- continue;
-+ break;
- }
-
- if (!skb_queue_empty(&queue->rx_queue))
diff --git a/drivers/nfc/nfcwilink.c b/drivers/nfc/nfcwilink.c
-index 683671a..4519fc2 100644
+index ce2e2cf..f81e500 100644
--- a/drivers/nfc/nfcwilink.c
+++ b/drivers/nfc/nfcwilink.c
@@ -497,7 +497,7 @@ static struct nci_ops nfcwilink_ops = {
@@ -49784,6 +49383,34 @@ index 683671a..4519fc2 100644
int rc;
__u32 protocols;
+diff --git a/drivers/nfc/st21nfca/st21nfca.c b/drivers/nfc/st21nfca/st21nfca.c
+index f2596c8..50d53af 100644
+--- a/drivers/nfc/st21nfca/st21nfca.c
++++ b/drivers/nfc/st21nfca/st21nfca.c
+@@ -559,7 +559,7 @@ static int st21nfca_get_iso14443_3_uid(struct nfc_hci_dev *hdev, u8 *gate,
+ goto exit;
+ }
+
+- gate = uid_skb->data;
++ memcpy(gate, uid_skb->data, uid_skb->len);
+ *len = uid_skb->len;
+ exit:
+ kfree_skb(uid_skb);
+diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
+index 5100742..6ad4e6d 100644
+--- a/drivers/of/fdt.c
++++ b/drivers/of/fdt.c
+@@ -1118,7 +1118,9 @@ static int __init of_fdt_raw_init(void)
+ pr_warn("fdt: not creating '/sys/firmware/fdt': CRC check failed\n");
+ return 0;
+ }
+- of_fdt_raw_attr.size = fdt_totalsize(initial_boot_params);
++ pax_open_kernel();
++ *(size_t *)&of_fdt_raw_attr.size = fdt_totalsize(initial_boot_params);
++ pax_close_kernel();
+ return sysfs_create_bin_file(firmware_kobj, &of_fdt_raw_attr);
+ }
+ late_initcall(of_fdt_raw_init);
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index d93b2b6..ae50401 100644
--- a/drivers/oprofile/buffer_sync.c
@@ -50100,10 +49727,10 @@ index 07aa722..84514b4 100644
int retval = -ENOMEM;
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
-index 084587d..4a8f9df 100644
+index fd60806..ab6c565 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
-@@ -488,8 +488,8 @@ static int populate_msi_sysfs(struct pci_dev *pdev)
+@@ -513,8 +513,8 @@ static int populate_msi_sysfs(struct pci_dev *pdev)
{
struct attribute **msi_attrs;
struct attribute *msi_attr;
@@ -50114,7 +49741,7 @@ index 084587d..4a8f9df 100644
const struct attribute_group **msi_irq_groups;
struct msi_desc *entry;
int ret = -ENOMEM;
-@@ -549,7 +549,7 @@ error_attrs:
+@@ -573,7 +573,7 @@ error_attrs:
count = 0;
msi_attr = msi_attrs[count];
while (msi_attr) {
@@ -50124,10 +49751,10 @@ index 084587d..4a8f9df 100644
kfree(msi_dev_attr);
++count;
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
-index 2c6643f..3a6d8e0 100644
+index aa012fb..63fac5d 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
-@@ -1133,7 +1133,7 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine)
+@@ -1139,7 +1139,7 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine)
{
/* allocate attribute structure, piggyback attribute name */
int name_len = write_combine ? 13 : 10;
@@ -50136,7 +49763,7 @@ index 2c6643f..3a6d8e0 100644
int retval;
res_attr = kzalloc(sizeof(*res_attr) + name_len, GFP_ATOMIC);
-@@ -1310,7 +1310,7 @@ static struct device_attribute reset_attr = __ATTR(reset, 0200, NULL, reset_stor
+@@ -1316,7 +1316,7 @@ static struct device_attribute reset_attr = __ATTR(reset, 0200, NULL, reset_stor
static int pci_create_capabilities_sysfs(struct pci_dev *dev)
{
int retval;
@@ -50145,7 +49772,7 @@ index 2c6643f..3a6d8e0 100644
/* If the device has VPD, try to expose it in sysfs. */
if (dev->vpd) {
-@@ -1357,7 +1357,7 @@ int __must_check pci_create_sysfs_dev_files(struct pci_dev *pdev)
+@@ -1363,7 +1363,7 @@ int __must_check pci_create_sysfs_dev_files(struct pci_dev *pdev)
{
int retval;
int rom_size = 0;
@@ -50155,7 +49782,7 @@ index 2c6643f..3a6d8e0 100644
if (!sysfs_initialized)
return -EACCES;
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
-index b5defca..e3664cc 100644
+index d54632a..198c84d 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -93,7 +93,7 @@ struct pci_vpd_ops {
@@ -50185,12 +49812,12 @@ index e1e7026..d28dd33 100644
#define ASPM_STATE_ALL (ASPM_STATE_L0S | ASPM_STATE_L1)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
-index 3010ffc..5e2e133 100644
+index 23212f8..65e945b 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
-@@ -177,7 +177,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
+@@ -175,7 +175,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
+ u16 orig_cmd;
struct pci_bus_region region, inverted_region;
- bool bar_too_big = false, bar_too_high = false, bar_invalid = false;
- mask = type ? PCI_ROM_ADDRESS_MASK : ~0;
+ mask = type ? (u32)PCI_ROM_ADDRESS_MASK : ~0;
@@ -50219,7 +49846,7 @@ index 3f155e7..0f4b1f0 100644
&proc_bus_pci_dev_operations);
proc_initialized = 1;
diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c
-index d866db8..c827d1f 100644
+index b84fdd6..b89d829 100644
--- a/drivers/platform/chrome/chromeos_laptop.c
+++ b/drivers/platform/chrome/chromeos_laptop.c
@@ -479,7 +479,7 @@ static struct chromeos_laptop cr48 = {
@@ -50232,7 +49859,7 @@ index d866db8..c827d1f 100644
.ident = "Samsung Series 5 550",
.matches = {
diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c
-index c5af23b..3d62d5e 100644
+index 1e1e594..8fe59c5 100644
--- a/drivers/platform/x86/alienware-wmi.c
+++ b/drivers/platform/x86/alienware-wmi.c
@@ -150,7 +150,7 @@ struct wmax_led_args {
@@ -50244,7 +49871,7 @@ index c5af23b..3d62d5e 100644
static struct attribute **zone_attrs;
static struct platform_zone *zone_data;
-@@ -161,7 +161,7 @@ static struct platform_driver platform_driver = {
+@@ -160,7 +160,7 @@ static struct platform_driver platform_driver = {
}
};
@@ -50254,10 +49881,10 @@ index c5af23b..3d62d5e 100644
};
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
-index 21fc932..ee9394a 100644
+index 7543a56..367ca8ed 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
-@@ -1590,6 +1590,10 @@ static int show_dsts(struct seq_file *m, void *data)
+@@ -1589,6 +1589,10 @@ static int show_dsts(struct seq_file *m, void *data)
int err;
u32 retval = -1;
@@ -50268,7 +49895,7 @@ index 21fc932..ee9394a 100644
err = asus_wmi_get_devstate(asus, asus->debug.dev_id, &retval);
if (err < 0)
-@@ -1606,6 +1610,10 @@ static int show_devs(struct seq_file *m, void *data)
+@@ -1605,6 +1609,10 @@ static int show_devs(struct seq_file *m, void *data)
int err;
u32 retval = -1;
@@ -50279,7 +49906,7 @@ index 21fc932..ee9394a 100644
err = asus_wmi_set_devstate(asus->debug.dev_id, asus->debug.ctrl_param,
&retval);
-@@ -1630,6 +1638,10 @@ static int show_call(struct seq_file *m, void *data)
+@@ -1629,6 +1637,10 @@ static int show_call(struct seq_file *m, void *data)
union acpi_object *obj;
acpi_status status;
@@ -50291,10 +49918,10 @@ index 21fc932..ee9394a 100644
1, asus->debug.method_id,
&input, &output);
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
-index 62f8030..c7f2a45 100644
+index 0859877..1cf7d08 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
-@@ -1000,12 +1000,14 @@ static int __init load_scm_model_init(struct platform_device *sdev)
+@@ -999,12 +999,14 @@ static int __init load_scm_model_init(struct platform_device *sdev)
if (!quirks->ec_read_only) {
/* allow userland write sysfs file */
@@ -50316,7 +49943,7 @@ index 62f8030..c7f2a45 100644
/* disable hardware control by fn key */
diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c
-index 70222f2..8c8ce66 100644
+index 6d2bac0..ec2b029 100644
--- a/drivers/platform/x86/msi-wmi.c
+++ b/drivers/platform/x86/msi-wmi.c
@@ -183,7 +183,7 @@ static const struct backlight_ops msi_backlight_ops = {
@@ -50329,10 +49956,10 @@ index 70222f2..8c8ce66 100644
acpi_status status;
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
-index 26ad9ff..7c52909 100644
+index 6dd1c0e..5d602c7 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
-@@ -2527,7 +2527,7 @@ static void sony_nc_gfx_switch_cleanup(struct platform_device *pd)
+@@ -2526,7 +2526,7 @@ static void sony_nc_gfx_switch_cleanup(struct platform_device *pd)
}
/* High speed charging function */
@@ -50341,7 +49968,7 @@ index 26ad9ff..7c52909 100644
static ssize_t sony_nc_highspeed_charging_store(struct device *dev,
struct device_attribute *attr,
-@@ -2601,7 +2601,7 @@ static void sony_nc_highspeed_charging_cleanup(struct platform_device *pd)
+@@ -2600,7 +2600,7 @@ static void sony_nc_highspeed_charging_cleanup(struct platform_device *pd)
}
/* low battery function */
@@ -50350,7 +49977,7 @@ index 26ad9ff..7c52909 100644
static ssize_t sony_nc_lowbatt_store(struct device *dev,
struct device_attribute *attr,
-@@ -2667,7 +2667,7 @@ static void sony_nc_lowbatt_cleanup(struct platform_device *pd)
+@@ -2666,7 +2666,7 @@ static void sony_nc_lowbatt_cleanup(struct platform_device *pd)
}
/* fan speed function */
@@ -50359,7 +49986,7 @@ index 26ad9ff..7c52909 100644
static ssize_t sony_nc_hsfan_store(struct device *dev,
struct device_attribute *attr,
-@@ -2774,7 +2774,7 @@ static void sony_nc_fanspeed_cleanup(struct platform_device *pd)
+@@ -2773,7 +2773,7 @@ static void sony_nc_fanspeed_cleanup(struct platform_device *pd)
}
/* USB charge function */
@@ -50368,7 +49995,7 @@ index 26ad9ff..7c52909 100644
static ssize_t sony_nc_usb_charge_store(struct device *dev,
struct device_attribute *attr,
-@@ -2848,7 +2848,7 @@ static void sony_nc_usb_charge_cleanup(struct platform_device *pd)
+@@ -2847,7 +2847,7 @@ static void sony_nc_usb_charge_cleanup(struct platform_device *pd)
}
/* Panel ID function */
@@ -50377,7 +50004,7 @@ index 26ad9ff..7c52909 100644
static ssize_t sony_nc_panelid_show(struct device *dev,
struct device_attribute *attr, char *buffer)
-@@ -2895,7 +2895,7 @@ static void sony_nc_panelid_cleanup(struct platform_device *pd)
+@@ -2894,7 +2894,7 @@ static void sony_nc_panelid_cleanup(struct platform_device *pd)
}
/* smart connect function */
@@ -50387,10 +50014,10 @@ index 26ad9ff..7c52909 100644
static ssize_t sony_nc_smart_conn_store(struct device *dev,
struct device_attribute *attr,
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
-index cf0f893..5955997 100644
+index c3d11fa..f83cded 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
-@@ -2094,7 +2094,7 @@ static int hotkey_mask_get(void)
+@@ -2092,7 +2092,7 @@ static int hotkey_mask_get(void)
return 0;
}
@@ -50399,7 +50026,7 @@ index cf0f893..5955997 100644
{
/* log only what the user can fix... */
const u32 wantedmask = hotkey_driver_mask &
-@@ -2438,10 +2438,10 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
+@@ -2436,10 +2436,10 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
&& !tp_features.bright_unkfw)
TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNHOME);
}
@@ -50780,10 +50407,10 @@ index 302e626..12579af 100644
da->attr.name = info->pin_config[i].name;
da->attr.mode = 0644;
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
-index fc6fb54..b8c794ba 100644
+index 9c48fb3..5b494fa 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
-@@ -3569,7 +3569,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
+@@ -3587,7 +3587,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
{
const struct regulation_constraints *constraints = NULL;
const struct regulator_init_data *init_data;
@@ -50792,7 +50419,7 @@ index fc6fb54..b8c794ba 100644
struct regulator_dev *rdev;
struct device *dev;
int ret, i;
-@@ -3643,7 +3643,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
+@@ -3661,7 +3661,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
rdev->dev.class = &regulator_class;
rdev->dev.parent = dev;
dev_set_name(&rdev->dev, "regulator.%d",
@@ -50819,7 +50446,7 @@ index 7eee2ca..4024513 100644
/*
diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c
-index dbedf17..18ff6b7 100644
+index c3d55c2..0dddfe6 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c
@@ -403,9 +403,11 @@ static int max8973_probe(struct i2c_client *client,
@@ -50838,7 +50465,7 @@ index dbedf17..18ff6b7 100644
if (pdata) {
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
-index 793b662..01c20fc 100644
+index 0d17c92..a29f627 100644
--- a/drivers/regulator/mc13892-regulator.c
+++ b/drivers/regulator/mc13892-regulator.c
@@ -584,10 +584,12 @@ static int mc13892_regulator_probe(struct platform_device *pdev)
@@ -50894,7 +50521,7 @@ index d049393..bb20be0 100644
case RTC_PIE_ON:
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
-index bb43cf7..ee4d274 100644
+index 4ffabb3..1f87fca 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -107,7 +107,7 @@ struct ds1307 {
@@ -50907,7 +50534,7 @@ index bb43cf7..ee4d274 100644
unsigned long flags;
#define HAS_NVRAM 0 /* bit 0 == sysfs file active */
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c
-index 11880c1..b823aa4 100644
+index 90abb5b..e0bf6dd 100644
--- a/drivers/rtc/rtc-m48t59.c
+++ b/drivers/rtc/rtc-m48t59.c
@@ -483,7 +483,9 @@ static int m48t59_rtc_probe(struct platform_device *pdev)
@@ -51094,7 +50721,7 @@ index 045c4e1..13de803 100644
error = bus_register(&fcoe_bus_type);
if (error)
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
-index 6de80e3..a11e0ac 100644
+index 8bb173e..20236b4 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -42,7 +42,7 @@
@@ -51116,11 +50743,11 @@ index 6de80e3..a11e0ac 100644
/* These three are default values which can be overridden */
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
-index cef5d49..01e280e 100644
+index 6bb4611..0203251 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -701,10 +701,10 @@ static inline u32 next_command(struct ctlr_info *h, u8 q)
- unsigned long flags;
+ struct reply_queue_buffer *rq = &h->reply_queue[q];
if (h->transMethod & CFGTBL_Trans_io_accel1)
- return h->access.command_completed(h, q);
@@ -51132,7 +50759,7 @@ index cef5d49..01e280e 100644
if ((rq->head[rq->current_entry] & 1) == rq->wraparound) {
a = rq->head[rq->current_entry];
-@@ -5454,7 +5454,7 @@ static void start_io(struct ctlr_info *h, unsigned long *flags)
+@@ -5360,7 +5360,7 @@ static void start_io(struct ctlr_info *h, unsigned long *flags)
while (!list_empty(&h->reqQ)) {
c = list_entry(h->reqQ.next, struct CommandList, list);
/* can't do anything if fifo is full */
@@ -51141,16 +50768,16 @@ index cef5d49..01e280e 100644
h->fifo_recently_full = 1;
dev_warn(&h->pdev->dev, "fifo full\n");
break;
-@@ -5476,7 +5476,7 @@ static void start_io(struct ctlr_info *h, unsigned long *flags)
-
- /* Tell the controller execute command */
+@@ -5376,7 +5376,7 @@ static void start_io(struct ctlr_info *h, unsigned long *flags)
+ atomic_inc(&h->commands_outstanding);
spin_unlock_irqrestore(&h->lock, *flags);
+ /* Tell the controller execute command */
- h->access.submit_command(h, c);
+ h->access->submit_command(h, c);
spin_lock_irqsave(&h->lock, *flags);
}
}
-@@ -5492,17 +5492,17 @@ static void lock_and_start_io(struct ctlr_info *h)
+@@ -5392,17 +5392,17 @@ static void lock_and_start_io(struct ctlr_info *h)
static inline unsigned long get_next_completion(struct ctlr_info *h, u8 q)
{
@@ -51171,7 +50798,7 @@ index cef5d49..01e280e 100644
(h->interrupts_enabled == 0);
}
-@@ -6445,7 +6445,7 @@ static int hpsa_pci_init(struct ctlr_info *h)
+@@ -6343,7 +6343,7 @@ static int hpsa_pci_init(struct ctlr_info *h)
if (prod_index < 0)
return -ENODEV;
h->product_name = products[prod_index].product_name;
@@ -51180,7 +50807,7 @@ index cef5d49..01e280e 100644
pci_disable_link_state(h->pdev, PCIE_LINK_STATE_L0S |
PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_CLKPM);
-@@ -6790,7 +6790,7 @@ static void controller_lockup_detected(struct ctlr_info *h)
+@@ -6690,7 +6690,7 @@ static void controller_lockup_detected(struct ctlr_info *h)
unsigned long flags;
u32 lockup_detected;
@@ -51189,7 +50816,7 @@ index cef5d49..01e280e 100644
spin_lock_irqsave(&h->lock, flags);
lockup_detected = readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
if (!lockup_detected) {
-@@ -7037,7 +7037,7 @@ reinit_after_soft_reset:
+@@ -6937,7 +6937,7 @@ reinit_after_soft_reset:
}
/* make sure the board interrupts are off */
@@ -51198,7 +50825,7 @@ index cef5d49..01e280e 100644
if (hpsa_request_irq(h, do_hpsa_intr_msi, do_hpsa_intr_intx))
goto clean2;
-@@ -7072,7 +7072,7 @@ reinit_after_soft_reset:
+@@ -6972,7 +6972,7 @@ reinit_after_soft_reset:
* fake ones to scoop up any residual completions.
*/
spin_lock_irqsave(&h->lock, flags);
@@ -51207,7 +50834,7 @@ index cef5d49..01e280e 100644
spin_unlock_irqrestore(&h->lock, flags);
free_irqs(h);
rc = hpsa_request_irq(h, hpsa_msix_discard_completions,
-@@ -7091,9 +7091,9 @@ reinit_after_soft_reset:
+@@ -6991,9 +6991,9 @@ reinit_after_soft_reset:
dev_info(&h->pdev->dev, "Board READY.\n");
dev_info(&h->pdev->dev,
"Waiting for stale completions to drain.\n");
@@ -51219,7 +50846,7 @@ index cef5d49..01e280e 100644
rc = controller_reset_failed(h->cfgtable);
if (rc)
-@@ -7119,7 +7119,7 @@ reinit_after_soft_reset:
+@@ -7019,7 +7019,7 @@ reinit_after_soft_reset:
h->drv_req_rescan = 0;
/* Turn the interrupts on so we can service requests */
@@ -51228,7 +50855,7 @@ index cef5d49..01e280e 100644
hpsa_hba_inquiry(h);
hpsa_register_scsi(h); /* hook ourselves into SCSI subsystem */
-@@ -7184,7 +7184,7 @@ static void hpsa_shutdown(struct pci_dev *pdev)
+@@ -7084,7 +7084,7 @@ static void hpsa_shutdown(struct pci_dev *pdev)
* To write all data in the battery backed cache to disks
*/
hpsa_flush_cache(h);
@@ -51237,7 +50864,7 @@ index cef5d49..01e280e 100644
hpsa_free_irqs_and_disable_msix(h);
}
-@@ -7302,7 +7302,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
+@@ -7202,7 +7202,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
CFGTBL_Trans_enable_directed_msix |
(trans_support & (CFGTBL_Trans_io_accel1 |
CFGTBL_Trans_io_accel2));
@@ -51246,7 +50873,7 @@ index cef5d49..01e280e 100644
/* This is a bit complicated. There are 8 registers on
* the controller which we write to to tell it 8 different
-@@ -7344,7 +7344,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
+@@ -7244,7 +7244,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
* perform the superfluous readl() after each command submission.
*/
if (trans_support & (CFGTBL_Trans_io_accel1 | CFGTBL_Trans_io_accel2))
@@ -51255,7 +50882,7 @@ index cef5d49..01e280e 100644
/* Controller spec: zero out this buffer. */
for (i = 0; i < h->nreply_queues; i++)
-@@ -7374,12 +7374,12 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
+@@ -7274,12 +7274,12 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
* enable outbound interrupt coalescing in accelerator mode;
*/
if (trans_support & CFGTBL_Trans_io_accel1) {
@@ -51271,7 +50898,7 @@ index cef5d49..01e280e 100644
writel(4, &h->cfgtable->HostWrite.CoalIntCount);
}
diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
-index 24472ce..8782caf 100644
+index 8e06d9e..396e0a1 100644
--- a/drivers/scsi/hpsa.h
+++ b/drivers/scsi/hpsa.h
@@ -127,7 +127,7 @@ struct ctlr_info {
@@ -51283,7 +50910,7 @@ index 24472ce..8782caf 100644
char hba_mode_enabled;
/* queue and queue Info */
-@@ -536,43 +536,43 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
+@@ -523,43 +523,43 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
}
static struct access_method SA5_access = {
@@ -51498,10 +51125,10 @@ index 1b3a094..068e683 100644
}
EXPORT_SYMBOL(fc_exch_update_stats);
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
-index 766098a..1c6c971 100644
+index 932d9cc..50c7ee9 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
-@@ -554,7 +554,7 @@ static struct ata_port_operations sas_sata_ops = {
+@@ -535,7 +535,7 @@ static struct ata_port_operations sas_sata_ops = {
.postreset = ata_std_postreset,
.error_handler = ata_std_error_handler,
.post_internal_cmd = sas_ata_post_internal,
@@ -51544,7 +51171,7 @@ index 434e903..5a4a79b 100644
struct dentry *idiag_root;
struct dentry *idiag_pci_cfg;
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
-index 786a2af..562c6a2 100644
+index 5633e7d..8272114 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -106,7 +106,7 @@ MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc,
@@ -51644,10 +51271,10 @@ index 0b2c53a..aec2b45 100644
lpfc_transport_template =
fc_attach_transport(&lpfc_transport_functions);
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
-index b99399f..d29dc75 100644
+index 4f9222e..f1850e3 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
-@@ -383,7 +383,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba)
+@@ -261,7 +261,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba)
unsigned long expires;
spin_lock_irqsave(&phba->hbalock, flags);
@@ -51656,7 +51283,7 @@ index b99399f..d29dc75 100644
phba->last_rsrc_error_time = jiffies;
expires = phba->last_ramp_down_time + QUEUE_RAMP_DOWN_INTERVAL;
-@@ -425,8 +425,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
+@@ -303,8 +303,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
unsigned long num_rsrc_err, num_cmd_success;
int i;
@@ -51667,7 +51294,7 @@ index b99399f..d29dc75 100644
/*
* The error and success command counters are global per
-@@ -454,8 +454,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
+@@ -331,8 +331,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
}
}
lpfc_destroy_vport_work_array(phba, vports);
@@ -51679,10 +51306,10 @@ index b99399f..d29dc75 100644
/**
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
-index c80ed04..e674f01 100644
+index 6a1c036..38e0e8d 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
-@@ -1561,7 +1561,7 @@ _scsih_get_resync(struct device *dev)
+@@ -1508,7 +1508,7 @@ _scsih_get_resync(struct device *dev)
{
struct scsi_device *sdev = to_scsi_device(dev);
struct MPT2SAS_ADAPTER *ioc = shost_priv(sdev->host);
@@ -51691,7 +51318,7 @@ index c80ed04..e674f01 100644
unsigned long flags;
Mpi2RaidVolPage0_t vol_pg0;
Mpi2ConfigReply_t mpi_reply;
-@@ -1613,7 +1613,7 @@ _scsih_get_state(struct device *dev)
+@@ -1560,7 +1560,7 @@ _scsih_get_state(struct device *dev)
{
struct scsi_device *sdev = to_scsi_device(dev);
struct MPT2SAS_ADAPTER *ioc = shost_priv(sdev->host);
@@ -51700,7 +51327,7 @@ index c80ed04..e674f01 100644
unsigned long flags;
Mpi2RaidVolPage0_t vol_pg0;
Mpi2ConfigReply_t mpi_reply;
-@@ -6663,7 +6663,7 @@ _scsih_sas_ir_operation_status_event(struct MPT2SAS_ADAPTER *ioc,
+@@ -6602,7 +6602,7 @@ _scsih_sas_ir_operation_status_event(struct MPT2SAS_ADAPTER *ioc,
Mpi2EventDataIrOperationStatus_t *event_data =
(Mpi2EventDataIrOperationStatus_t *)
fw_event->event_data;
@@ -51709,7 +51336,7 @@ index c80ed04..e674f01 100644
unsigned long flags;
u16 handle;
-@@ -7134,7 +7134,7 @@ _scsih_scan_for_devices_after_reset(struct MPT2SAS_ADAPTER *ioc)
+@@ -7073,7 +7073,7 @@ _scsih_scan_for_devices_after_reset(struct MPT2SAS_ADAPTER *ioc)
u64 sas_address;
struct _sas_device *sas_device;
struct _sas_node *expander_device;
@@ -51719,7 +51346,7 @@ index c80ed04..e674f01 100644
unsigned long flags;
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
-index bcb64eb..f08cf71 100644
+index 8c27b6a..607f56e 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -200,8 +200,8 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev)
@@ -51733,7 +51360,7 @@ index bcb64eb..f08cf71 100644
rc = 0;
}
spin_unlock_irqrestore(&pinstance->resource_lock, lock_flags);
-@@ -2687,9 +2687,9 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd)
+@@ -2646,9 +2646,9 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd)
/* If this was a SCSI read/write command keep count of errors */
if (SCSI_CMD_TYPE(scsi_cmd->cmnd[0]) == SCSI_READ_CMD)
@@ -51745,7 +51372,7 @@ index bcb64eb..f08cf71 100644
if (!RES_IS_GSCSI(res->cfg_entry) &&
masked_ioasc != PMCRAID_IOASC_HW_DEVICE_BUS_STATUS_ERROR) {
-@@ -3545,7 +3545,7 @@ static int pmcraid_queuecommand_lck(
+@@ -3474,7 +3474,7 @@ static int pmcraid_queuecommand_lck(
* block of scsi_cmd which is re-used (e.g. cancel/abort), which uses
* hrrq_id assigned here in queuecommand
*/
@@ -51754,7 +51381,7 @@ index bcb64eb..f08cf71 100644
pinstance->num_hrrq;
cmd->cmd_done = pmcraid_io_done;
-@@ -3857,7 +3857,7 @@ static long pmcraid_ioctl_passthrough(
+@@ -3788,7 +3788,7 @@ static long pmcraid_ioctl_passthrough(
* block of scsi_cmd which is re-used (e.g. cancel/abort), which uses
* hrrq_id assigned here in queuecommand
*/
@@ -51763,7 +51390,7 @@ index bcb64eb..f08cf71 100644
pinstance->num_hrrq;
if (request_size) {
-@@ -4495,7 +4495,7 @@ static void pmcraid_worker_function(struct work_struct *workp)
+@@ -4426,7 +4426,7 @@ static void pmcraid_worker_function(struct work_struct *workp)
pinstance = container_of(workp, struct pmcraid_instance, worker_q);
/* add resources only after host is added into system */
@@ -51772,7 +51399,7 @@ index bcb64eb..f08cf71 100644
return;
fw_version = be16_to_cpu(pinstance->inq_data->fw_version);
-@@ -5312,8 +5312,8 @@ static int pmcraid_init_instance(struct pci_dev *pdev, struct Scsi_Host *host,
+@@ -5243,8 +5243,8 @@ static int pmcraid_init_instance(struct pci_dev *pdev, struct Scsi_Host *host,
init_waitqueue_head(&pinstance->reset_wait_q);
atomic_set(&pinstance->outstanding_cmds, 0);
@@ -51783,7 +51410,7 @@ index bcb64eb..f08cf71 100644
INIT_LIST_HEAD(&pinstance->free_res_q);
INIT_LIST_HEAD(&pinstance->used_res_q);
-@@ -6026,7 +6026,7 @@ static int pmcraid_probe(struct pci_dev *pdev,
+@@ -5957,7 +5957,7 @@ static int pmcraid_probe(struct pci_dev *pdev,
/* Schedule worker thread to handle CCN and take care of adding and
* removing devices to OS
*/
@@ -51848,7 +51475,7 @@ index 82b92c4..3178171 100644
.show_host_node_name = 1,
.show_host_port_name = 1,
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
-index b1865a7..a7723d3 100644
+index 7686bfe..4710893 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -571,8 +571,8 @@ extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *, size_t);
@@ -51863,10 +51490,10 @@ index b1865a7..a7723d3 100644
extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *, bool);
extern void qla2x00_init_host_attr(scsi_qla_host_t *);
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
-index db3dbd9..2492392 100644
+index cce1cbc..5b9f0fe 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
-@@ -1507,8 +1507,10 @@ qla2x00_config_dma_addressing(struct qla_hw_data *ha)
+@@ -1435,8 +1435,10 @@ qla2x00_config_dma_addressing(struct qla_hw_data *ha)
!pci_set_consistent_dma_mask(ha->pdev, DMA_BIT_MASK(64))) {
/* Ok, a 64bit DMA mask is applicable. */
ha->flags.enable_64bit_addressing = 1;
@@ -51893,10 +51520,10 @@ index 8f6d0fb..1b21097 100644
uint32_t default_time2wait; /* Default Min time between
* relogins (+aens) */
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
-index 199fcf7..3c3a918 100644
+index 6d25879..3031a9f 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
-@@ -4496,12 +4496,12 @@ static void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess)
+@@ -4491,12 +4491,12 @@ static void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess)
*/
if (!iscsi_is_session_online(cls_sess)) {
/* Reset retry relogin timer */
@@ -51911,7 +51538,7 @@ index 199fcf7..3c3a918 100644
ddb_entry->default_time2wait + 4));
set_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags);
atomic_set(&ddb_entry->retry_relogin_timer,
-@@ -6609,7 +6609,7 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha,
+@@ -6604,7 +6604,7 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha,
atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY);
atomic_set(&ddb_entry->relogin_timer, 0);
@@ -51920,24 +51547,11 @@ index 199fcf7..3c3a918 100644
def_timeout = le16_to_cpu(ddb_entry->fw_ddb_entry.def_timeout);
ddb_entry->default_relogin_timeout =
(def_timeout > LOGIN_TOV) && (def_timeout < LOGIN_TOV * 10) ?
-diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
-index 79c77b4..ef6ec0b 100644
---- a/drivers/scsi/scsi.c
-+++ b/drivers/scsi/scsi.c
-@@ -645,7 +645,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
- struct Scsi_Host *host = cmd->device->host;
- int rtn = 0;
-
-- atomic_inc(&cmd->device->iorequest_cnt);
-+ atomic_inc_unchecked(&cmd->device->iorequest_cnt);
-
- /* check if the device is still usable */
- if (unlikely(cmd->device->sdev_state == SDEV_DEL)) {
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
-index 17fb051..937fbbd 100644
+index 17bb541..85f4508 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
-@@ -1583,7 +1583,7 @@ static void scsi_kill_request(struct request *req, struct request_queue *q)
+@@ -1595,7 +1595,7 @@ static void scsi_kill_request(struct request *req, struct request_queue *q)
shost = sdev->host;
scsi_init_cmd_errh(cmd);
cmd->result = DID_NO_CONNECT << 16;
@@ -51946,7 +51560,7 @@ index 17fb051..937fbbd 100644
/*
* SCSI request completion path will do scsi_device_unbusy(),
-@@ -1606,9 +1606,9 @@ static void scsi_softirq_done(struct request *rq)
+@@ -1618,9 +1618,9 @@ static void scsi_softirq_done(struct request *rq)
INIT_LIST_HEAD(&cmd->eh_entry);
@@ -51958,11 +51572,20 @@ index 17fb051..937fbbd 100644
disposition = scsi_decide_disposition(cmd);
if (disposition != SUCCESS &&
+@@ -1661,7 +1661,7 @@ static int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
+ struct Scsi_Host *host = cmd->device->host;
+ int rtn = 0;
+
+- atomic_inc(&cmd->device->iorequest_cnt);
++ atomic_inc_unchecked(&cmd->device->iorequest_cnt);
+
+ /* check if the device is still usable */
+ if (unlikely(cmd->device->sdev_state == SDEV_DEL)) {
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
-index f4cb7b3..dfa79c4 100644
+index 1ac38e7..6acc656 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
-@@ -805,7 +805,7 @@ show_iostat_##field(struct device *dev, struct device_attribute *attr, \
+@@ -788,7 +788,7 @@ show_iostat_##field(struct device *dev, struct device_attribute *attr, \
char *buf) \
{ \
struct scsi_device *sdev = to_scsi_device(dev); \
@@ -52074,10 +51697,10 @@ index ae45bd9..c32a586 100644
transport_setup_device(&rport->dev);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
-index dd8c8d6..4cdf6a1 100644
+index 05ea0d4..5af8049 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
-@@ -3024,7 +3024,7 @@ static int sd_probe(struct device *dev)
+@@ -3006,7 +3006,7 @@ static int sd_probe(struct device *dev)
sdkp->disk = gd;
sdkp->index = index;
atomic_set(&sdkp->openers, 0);
@@ -52087,10 +51710,10 @@ index dd8c8d6..4cdf6a1 100644
if (!sdp->request_queue->rq_timeout) {
if (sdp->type != TYPE_MOD)
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
-index 843594c..b1dc3b2 100644
+index 763bffe..e0eacf4 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
-@@ -1138,7 +1138,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
+@@ -1098,7 +1098,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
sdp->disk->disk_name,
MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
NULL,
@@ -52100,10 +51723,10 @@ index 843594c..b1dc3b2 100644
return blk_trace_startstop(sdp->device->request_queue, 1);
case BLKTRACESTOP:
diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
-index 11a5043..e36f04c 100644
+index 011a336..fb2b7a0 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra.c
-@@ -70,7 +70,7 @@ static ssize_t fuse_read(struct file *fd, struct kobject *kobj,
+@@ -71,7 +71,7 @@ static ssize_t fuse_read(struct file *fd, struct kobject *kobj,
return i;
}
@@ -52113,10 +51736,10 @@ index 11a5043..e36f04c 100644
.read = fuse_read,
};
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
-index 50f20f2..6bd81e0 100644
+index 66a70e9..f82cea4 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
-@@ -2224,7 +2224,7 @@ int spi_bus_unlock(struct spi_master *master)
+@@ -2238,7 +2238,7 @@ int spi_bus_unlock(struct spi_master *master)
EXPORT_SYMBOL_GPL(spi_bus_unlock);
/* portable code must never pass more than 32 bytes */
@@ -52156,6 +51779,39 @@ index b41429f..2de5373 100644
tdev->dev = device_create(timed_output_class, NULL,
MKDEV(0, tdev->index), NULL, "%s", tdev->name);
if (IS_ERR(tdev->dev))
+diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
+index f143cb6..6fb8255 100644
+--- a/drivers/staging/comedi/comedi_fops.c
++++ b/drivers/staging/comedi/comedi_fops.c
+@@ -273,8 +273,8 @@ static void comedi_file_reset(struct file *file)
+ }
+ cfp->last_attached = dev->attached;
+ cfp->last_detach_count = dev->detach_count;
+- ACCESS_ONCE(cfp->read_subdev) = read_s;
+- ACCESS_ONCE(cfp->write_subdev) = write_s;
++ ACCESS_ONCE_RW(cfp->read_subdev) = read_s;
++ ACCESS_ONCE_RW(cfp->write_subdev) = write_s;
+ }
+
+ static void comedi_file_check(struct file *file)
+@@ -1885,7 +1885,7 @@ static int do_setrsubd_ioctl(struct comedi_device *dev, unsigned long arg,
+ !(s_old->async->cmd.flags & CMDF_WRITE))
+ return -EBUSY;
+
+- ACCESS_ONCE(cfp->read_subdev) = s_new;
++ ACCESS_ONCE_RW(cfp->read_subdev) = s_new;
+ return 0;
+ }
+
+@@ -1927,7 +1927,7 @@ static int do_setwsubd_ioctl(struct comedi_device *dev, unsigned long arg,
+ (s_old->async->cmd.flags & CMDF_WRITE))
+ return -EBUSY;
+
+- ACCESS_ONCE(cfp->write_subdev) = s_new;
++ ACCESS_ONCE_RW(cfp->write_subdev) = s_new;
+ return 0;
+ }
+
diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
index 001348c..cfaac8a 100644
--- a/drivers/staging/gdm724x/gdm_tty.c
@@ -52169,19 +51825,6 @@ index 001348c..cfaac8a 100644
static struct tty_driver *gdm_driver[TTY_MAX_COUNT];
static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR];
-diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c
-index 9cb222e..8766f26 100644
---- a/drivers/staging/imx-drm/imx-drm-core.c
-+++ b/drivers/staging/imx-drm/imx-drm-core.c
-@@ -357,7 +357,7 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
- if (imxdrm->pipes >= MAX_CRTC)
- return -EINVAL;
-
-- if (imxdrm->drm->open_count)
-+ if (local_read(&imxdrm->drm->open_count))
- return -EBUSY;
-
- imx_drm_crtc = kzalloc(sizeof(*imx_drm_crtc), GFP_KERNEL);
diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 503b2d7..c904931 100644
--- a/drivers/staging/line6/driver.c
@@ -52318,7 +51961,7 @@ index 6943715..0a93632 100644
/* enable device: */
toneport_send_cmd(usbdev, 0x0301, 0x0000);
diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
-index a94f336..6a1924d 100644
+index 463da07..e791ce9 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -488,13 +488,11 @@ brw_server_handle(struct srpc_server_rpc *rpc)
@@ -52341,10 +51984,10 @@ index a94f336..6a1924d 100644
srpc_service_t brw_test_service;
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
-index df04ab7..1deb1ac 100644
+index cc9d182..8fabce3 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
-@@ -1632,12 +1632,10 @@ static srpc_service_t sfw_services[] = {
+@@ -1628,12 +1628,10 @@ static srpc_service_t sfw_services[] = {
extern sfw_test_client_ops_t ping_test_client;
extern srpc_service_t ping_test_service;
@@ -52357,7 +52000,7 @@ index df04ab7..1deb1ac 100644
extern void brw_init_test_service(void);
-@@ -1681,12 +1679,10 @@ sfw_startup (void)
+@@ -1675,12 +1673,10 @@ sfw_startup (void)
INIT_LIST_HEAD(&sfw_data.fw_zombie_rpcs);
INIT_LIST_HEAD(&sfw_data.fw_zombie_sessions);
@@ -52371,7 +52014,7 @@ index df04ab7..1deb1ac 100644
rc = sfw_register_test(&ping_test_service, &ping_test_client);
LASSERT (rc == 0);
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
-index 750cac4..e4d751f 100644
+index d8c0df6..5041cbb 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -211,14 +211,12 @@ ping_server_handle(struct srpc_server_rpc *rpc)
@@ -52396,7 +52039,7 @@ index 750cac4..e4d751f 100644
srpc_service_t ping_test_service;
void ping_init_test_service(void)
diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h
-index 14ac46f..eca2c16 100644
+index 83bc0a9..12ba00a 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -1139,7 +1139,7 @@ struct ldlm_callback_suite {
@@ -52422,7 +52065,7 @@ index 2a88b80..62e7e5f 100644
struct lsm_operations {
void (*lsm_free)(struct lov_stripe_md *);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
-index b798daa..b28ca8f 100644
+index a4c252f..b21acac 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
@@ -258,7 +258,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,
@@ -52432,10 +52075,10 @@ index b798daa..b28ca8f 100644
- const struct ldlm_callback_suite null_cbs = { NULL };
+ const struct ldlm_callback_suite null_cbs = { };
- CDEBUG(D_DLMTRACE, "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
- *flags, new->l_policy_data.l_flock.owner,
+ CDEBUG(D_DLMTRACE,
+ "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
-index bbe2c68..c6b4275 100644
+index 83d3f08..b03adad 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
@@ -236,7 +236,7 @@ int proc_console_max_delay_cs(struct ctl_table *table, int write,
@@ -52486,56 +52129,47 @@ index 2c4fc74..b04ca79 100644
};
extern int insert_proc(void);
-diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
-index b0bb709..0117c96 100644
---- a/drivers/staging/lustre/lustre/llite/dir.c
-+++ b/drivers/staging/lustre/lustre/llite/dir.c
-@@ -661,7 +661,7 @@ int ll_dir_setdirstripe(struct inode *dir, struct lmv_user_md *lump,
- int mode;
- int err;
-
-- mode = (0755 & (S_IRWXUGO|S_ISVTX) & ~current->fs->umask) | S_IFDIR;
-+ mode = (0755 & (S_IRWXUGO|S_ISVTX) & ~current_umask()) | S_IFDIR;
- op_data = ll_prep_md_op_data(NULL, dir, NULL, filename,
- strlen(filename), mode, LUSTRE_OPC_MKDIR,
- lump);
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
-index b2b6c3c..302e4e4 100644
+index fcbe836..8a7ada4 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
-@@ -416,11 +416,11 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
+@@ -352,14 +352,14 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
/* Increment RX stats for virtual ports */
if (work->ipprt >= CVMX_PIP_NUM_INPUT_PORTS) {
#ifdef CONFIG_64BIT
-- atomic64_add(1, (atomic64_t *)&priv->stats.rx_packets);
-- atomic64_add(skb->len, (atomic64_t *)&priv->stats.rx_bytes);
-+ atomic64_add_unchecked(1, (atomic64_unchecked_t *)&priv->stats.rx_packets);
-+ atomic64_add_unchecked(skb->len, (atomic64_unchecked_t *)&priv->stats.rx_bytes);
+- atomic64_add(1,
++ atomic64_add_unchecked(1,
+ (atomic64_t *)&priv->stats.rx_packets);
+- atomic64_add(skb->len,
++ atomic64_add_unchecked(skb->len,
+ (atomic64_t *)&priv->stats.rx_bytes);
#else
-- atomic_add(1, (atomic_t *)&priv->stats.rx_packets);
-- atomic_add(skb->len, (atomic_t *)&priv->stats.rx_bytes);
-+ atomic_add_unchecked(1, (atomic_unchecked_t *)&priv->stats.rx_packets);
-+ atomic_add_unchecked(skb->len, (atomic_unchecked_t *)&priv->stats.rx_bytes);
+- atomic_add(1,
++ atomic_add_unchecked(1,
+ (atomic_t *)&priv->stats.rx_packets);
+- atomic_add(skb->len,
++ atomic_add_unchecked(skb->len,
+ (atomic_t *)&priv->stats.rx_bytes);
#endif
}
- netif_receive_skb(skb);
-@@ -431,9 +431,9 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
+@@ -371,10 +371,10 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
dev->name);
*/
#ifdef CONFIG_64BIT
-- atomic64_add(1, (atomic64_t *)&priv->stats.rx_dropped);
-+ atomic64_add_unchecked(1, (atomic64_unchecked_t *)&priv->stats.rx_dropped);
+- atomic64_add(1,
++ atomic64_add_unchecked(1,
+ (atomic64_t *)&priv->stats.rx_dropped);
#else
-- atomic_add(1, (atomic_t *)&priv->stats.rx_dropped);
-+ atomic_add_unchecked(1, (atomic_unchecked_t *)&priv->stats.rx_dropped);
+- atomic_add(1,
++ atomic_add_unchecked(1,
+ (atomic_t *)&priv->stats.rx_dropped);
#endif
dev_kfree_skb_irq(skb);
- }
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
-index 8f9e3fb..d283fb9 100644
+index ee32149..052d1836 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
-@@ -247,11 +247,11 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev)
+@@ -241,11 +241,11 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev)
* since the RX tasklet also increments it.
*/
#ifdef CONFIG_64BIT
@@ -52552,7 +52186,7 @@ index 8f9e3fb..d283fb9 100644
}
diff --git a/drivers/staging/rtl8188eu/include/hal_intf.h b/drivers/staging/rtl8188eu/include/hal_intf.h
-index 9191993..30e9817 100644
+index 3b476d8..f522d68 100644
--- a/drivers/staging/rtl8188eu/include/hal_intf.h
+++ b/drivers/staging/rtl8188eu/include/hal_intf.h
@@ -225,7 +225,7 @@ struct hal_ops {
@@ -52578,59 +52212,29 @@ index 070cc03..6806e37 100644
struct io_req {
struct list_head list;
diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h b/drivers/staging/unisys/visorchipset/visorchipset.h
-index 2bf2e2f..84421c9 100644
+index 46dad63..fe4acdc 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
-@@ -228,7 +228,7 @@ typedef struct {
- void (*device_resume)(ulong busNo, ulong devNo);
- int (*get_channel_info)(uuid_le typeGuid, ulong *minSize,
- ulong *maxSize);
--} VISORCHIPSET_BUSDEV_NOTIFIERS;
-+} __no_const VISORCHIPSET_BUSDEV_NOTIFIERS;
+@@ -226,7 +226,7 @@ struct visorchipset_busdev_notifiers {
+ void (*device_resume)(ulong bus_no, ulong dev_no);
+ int (*get_channel_info)(uuid_le type_uuid, ulong *min_size,
+ ulong *max_size);
+-};
++} __no_const;
/* These functions live inside visorchipset, and will be called to indicate
* responses to specific events (by code outside of visorchipset).
-@@ -243,7 +243,7 @@ typedef struct {
- void (*device_destroy)(ulong busNo, ulong devNo, int response);
- void (*device_pause)(ulong busNo, ulong devNo, int response);
- void (*device_resume)(ulong busNo, ulong devNo, int response);
--} VISORCHIPSET_BUSDEV_RESPONDERS;
-+} __no_const VISORCHIPSET_BUSDEV_RESPONDERS;
+@@ -241,7 +241,7 @@ struct visorchipset_busdev_responders {
+ void (*device_destroy)(ulong bus_no, ulong dev_no, int response);
+ void (*device_pause)(ulong bus_no, ulong dev_no, int response);
+ void (*device_resume)(ulong bus_no, ulong dev_no, int response);
+-};
++} __no_const;
/** Register functions (in the bus driver) to get called by visorchipset
* whenever a bus or device appears for which this service partition is
-diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
-index ae0dade..803d53a 100644
---- a/drivers/staging/vt6655/hostap.c
-+++ b/drivers/staging/vt6655/hostap.c
-@@ -65,14 +65,13 @@
- *
- */
-
-+static net_device_ops_no_const apdev_netdev_ops;
-+
- static int hostap_enable_hostapd(struct vnt_private *pDevice, int rtnl_locked)
- {
- struct vnt_private *apdev_priv;
- struct net_device *dev = pDevice->dev;
- int ret;
-- const struct net_device_ops apdev_netdev_ops = {
-- .ndo_start_xmit = pDevice->tx_80211,
-- };
-
- pr_debug("%s: Enabling hostapd mode\n", dev->name);
-
-@@ -84,6 +83,8 @@ static int hostap_enable_hostapd(struct vnt_private *pDevice, int rtnl_locked)
- *apdev_priv = *pDevice;
- eth_hw_addr_inherit(pDevice->apdev, dev);
-
-+ /* only half broken now */
-+ apdev_netdev_ops.ndo_start_xmit = pDevice->tx_80211;
- pDevice->apdev->netdev_ops = &apdev_netdev_ops;
-
- pDevice->apdev->type = ARPHRD_IEEE80211;
diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
-index e7e9372..161f530 100644
+index 9512af6..045bf5a 100644
--- a/drivers/target/sbp/sbp_target.c
+++ b/drivers/target/sbp/sbp_target.c
@@ -62,7 +62,7 @@ static const u32 sbp_unit_directory_template[] = {
@@ -52652,10 +52256,10 @@ index e7e9372..161f530 100644
login->tgt_agt = sbp_target_agent_register(login);
if (IS_ERR(login->tgt_agt)) {
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
-index 24fa5d1..fae56f1 100644
+index 58f49ff..2669604 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
-@@ -1532,7 +1532,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
+@@ -1469,7 +1469,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
spin_lock_init(&dev->se_tmr_lock);
spin_lock_init(&dev->qf_cmd_lock);
sema_init(&dev->caw_sem, 1);
@@ -52665,7 +52269,7 @@ index 24fa5d1..fae56f1 100644
spin_lock_init(&dev->t10_wwn.t10_vpd_lock);
INIT_LIST_HEAD(&dev->t10_pr.registration_list);
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
-index be877bf..7be9cd4 100644
+index 0adc0f6..7757bfe 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1168,7 +1168,7 @@ transport_check_alloc_task_attr(struct se_cmd *cmd)
@@ -52678,10 +52282,10 @@ index be877bf..7be9cd4 100644
cmd->se_ordered_id, cmd->sam_task_attr,
dev->transport->name);
diff --git a/drivers/thermal/int340x_thermal/int3400_thermal.c b/drivers/thermal/int340x_thermal/int3400_thermal.c
-index edc1cce..769e4cb 100644
+index 65a98a9..d93d3a8 100644
--- a/drivers/thermal/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/int340x_thermal/int3400_thermal.c
-@@ -209,8 +209,10 @@ static int int3400_thermal_probe(struct platform_device *pdev)
+@@ -277,8 +277,10 @@ static int int3400_thermal_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, priv);
if (priv->uuid_bitmap & 1 << INT3400_THERMAL_PASSIVE_1) {
@@ -52695,43 +52299,47 @@ index edc1cce..769e4cb 100644
priv->thermal = thermal_zone_device_register("INT3400 Thermal", 0, 0,
priv, &int3400_thermal_ops,
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
-index 62143ba..ae21165 100644
+index d717f3d..cae1cc3e 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
-@@ -30,6 +30,7 @@
- #include <linux/err.h>
+@@ -31,6 +31,7 @@
#include <linux/export.h>
#include <linux/string.h>
+ #include <linux/thermal.h>
+#include <linux/mm.h>
#include "thermal_core.h"
-@@ -341,8 +342,10 @@ thermal_zone_of_add_sensor(struct device_node *zone,
- tz->get_trend = get_trend;
+@@ -412,9 +413,11 @@ thermal_zone_of_add_sensor(struct device_node *zone,
+ tz->ops = ops;
tz->sensor_data = data;
- tzd->ops->get_temp = of_thermal_get_temp;
- tzd->ops->get_trend = of_thermal_get_trend;
+- tzd->ops->set_emul_temp = of_thermal_set_emul_temp;
+ pax_open_kernel();
+ *(void **)&tzd->ops->get_temp = of_thermal_get_temp;
+ *(void **)&tzd->ops->get_trend = of_thermal_get_trend;
++ *(void **)&tzd->ops->set_emul_temp = of_thermal_set_emul_temp;
+ pax_close_kernel();
mutex_unlock(&tzd->lock);
return tzd;
-@@ -473,8 +476,10 @@ void thermal_zone_of_sensor_unregister(struct device *dev,
+@@ -541,9 +544,11 @@ void thermal_zone_of_sensor_unregister(struct device *dev,
return;
mutex_lock(&tzd->lock);
- tzd->ops->get_temp = NULL;
- tzd->ops->get_trend = NULL;
+- tzd->ops->set_emul_temp = NULL;
+ pax_open_kernel();
+ *(void **)&tzd->ops->get_temp = NULL;
+ *(void **)&tzd->ops->get_trend = NULL;
++ *(void **)&tzd->ops->set_emul_temp = NULL;
+ pax_close_kernel();
- tz->get_temp = NULL;
- tz->get_trend = NULL;
+ tz->ops = NULL;
+ tz->sensor_data = NULL;
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
index fd66f57..48e6376 100644
--- a/drivers/tty/cyclades.c
@@ -52817,7 +52425,7 @@ index 4fcec1d..5a036f7 100644
spin_lock_irqsave(&hp->lock, flags);
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
-index 81e939e..95ead10 100644
+index 81ff7e1..dfb7b71 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -83,6 +83,7 @@
@@ -53011,7 +52619,7 @@ index 4190199..06d5bfa 100644
spin_unlock_irqrestore(&hp->lock, flags);
}
diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c
-index 7ae6c29..05c6dba 100644
+index a270f04..7c77b5d 100644
--- a/drivers/tty/hvc/hvsi_lib.c
+++ b/drivers/tty/hvc/hvsi_lib.c
@@ -8,7 +8,7 @@
@@ -53185,7 +52793,7 @@ index c434376..114ce13 100644
dlci->modem_rx = 0;
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
-index 47ca0f3..3c0b803 100644
+index 4ddfa60..1b7e112 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -115,7 +115,7 @@ struct n_tty_data {
@@ -53197,7 +52805,7 @@ index 47ca0f3..3c0b803 100644
size_t line_start;
/* protected by output lock */
-@@ -2523,6 +2523,7 @@ void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
+@@ -2503,6 +2503,7 @@ void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
{
*ops = tty_ldisc_N_TTY;
ops->owner = NULL;
@@ -53207,10 +52815,10 @@ index 47ca0f3..3c0b803 100644
}
EXPORT_SYMBOL_GPL(n_tty_inherit_ops);
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
-index 082304d..d8360ec 100644
+index 6e1f150..c3ba598 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
-@@ -833,8 +833,10 @@ static void __init unix98_pty_init(void)
+@@ -850,8 +850,10 @@ static void __init unix98_pty_init(void)
panic("Couldn't register Unix98 pts driver");
/* Now create the /dev/ptmx special device */
@@ -53406,7 +53014,7 @@ index a260cde..6b2b5ce 100644
/* This is only available if kgdboc is a built in for early debugging */
static int __init kgdboc_early_init(char *opt)
diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
-index 4b6c783..9a19db3 100644
+index c88b522..e763029 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -1028,7 +1028,7 @@ static struct uart_driver msm_uart_driver = {
@@ -53418,20 +53026,20 @@ index 4b6c783..9a19db3 100644
static const struct of_device_id msm_uartdm_table[] = {
{ .compatible = "qcom,msm-uartdm-v1.1", .data = (void *)UARTDM_1P1 },
-@@ -1047,7 +1047,7 @@ static int msm_serial_probe(struct platform_device *pdev)
- int irq;
+@@ -1052,7 +1052,7 @@ static int msm_serial_probe(struct platform_device *pdev)
+ line = pdev->id;
- if (pdev->id == -1)
-- pdev->id = atomic_inc_return(&msm_uart_next_id) - 1;
-+ pdev->id = atomic_inc_return_unchecked(&msm_uart_next_id) - 1;
+ if (line < 0)
+- line = atomic_inc_return(&msm_uart_next_id) - 1;
++ line = atomic_inc_return_unchecked(&msm_uart_next_id) - 1;
- if (unlikely(pdev->id < 0 || pdev->id >= UART_NR))
+ if (unlikely(line < 0 || line >= UART_NR))
return -ENXIO;
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
-index 587d63b..48423a6 100644
+index 107e807..d4a02fa 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
-@@ -478,11 +478,16 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
+@@ -480,11 +480,16 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
}
}
@@ -53448,7 +53056,7 @@ index 587d63b..48423a6 100644
dbg("s3c24xx_serial_startup: port=%p (%08llx,%p)\n",
port, (unsigned long long)port->mapbase, port->membase);
-@@ -1159,10 +1164,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
+@@ -1169,10 +1174,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
/* setup info for port */
port->dev = &platdev->dev;
@@ -53460,10 +53068,19 @@ index 587d63b..48423a6 100644
if (cfg->uart_flags & UPF_CONS_FLOW) {
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
-index a28dee9..168ba47 100644
+index 984605b..e538330 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
-@@ -1339,7 +1339,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
+@@ -1396,7 +1396,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
+ state = drv->state + tty->index;
+ port = &state->port;
+ spin_lock_irq(&port->lock);
+- --port->count;
++ atomic_dec(&port->count);
+ spin_unlock_irq(&port->lock);
+ return;
+ }
+@@ -1406,7 +1406,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
pr_debug("uart_close(%d) called\n", uport ? uport->line : -1);
@@ -53472,7 +53089,7 @@ index a28dee9..168ba47 100644
return;
/*
-@@ -1466,7 +1466,7 @@ static void uart_hangup(struct tty_struct *tty)
+@@ -1530,7 +1530,7 @@ static void uart_hangup(struct tty_struct *tty)
uart_flush_buffer(tty);
uart_shutdown(tty, state);
spin_lock_irqsave(&port->lock, flags);
@@ -53481,24 +53098,15 @@ index a28dee9..168ba47 100644
clear_bit(ASYNCB_NORMAL_ACTIVE, &port->flags);
spin_unlock_irqrestore(&port->lock, flags);
tty_port_tty_set(port, NULL);
-@@ -1564,7 +1564,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
- goto end;
- }
+@@ -1617,7 +1617,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
+ pr_debug("uart_open(%d) called\n", line);
-- port->count++;
+ spin_lock_irq(&port->lock);
+- ++port->count;
+ atomic_inc(&port->count);
- if (!state->uart_port || state->uart_port->flags & UPF_DEAD) {
- retval = -ENXIO;
- goto err_dec_count;
-@@ -1596,7 +1596,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
- end:
- return retval;
- err_dec_count:
-- port->count--;
-+ atomic_dec(&port->count);
- mutex_unlock(&port->mutex);
- goto end;
- }
+ spin_unlock_irq(&port->lock);
+
+ /*
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
index b799170..87dafd5 100644
--- a/drivers/tty/synclink.c
@@ -53898,10 +53506,21 @@ index 42bad18..447d7a2 100644
if (get_user(c, buf))
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
-index 0508a1d..b610592 100644
+index 51f066a..a7f6e86 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
-@@ -3498,7 +3498,7 @@ EXPORT_SYMBOL_GPL(get_current_tty);
+@@ -1028,8 +1028,8 @@ EXPORT_SYMBOL(start_tty);
+ /* We limit tty time update visibility to every 8 seconds or so. */
+ static void tty_update_time(struct timespec *time)
+ {
+- unsigned long sec = get_seconds() & ~7;
+- if ((long)(sec - time->tv_sec) > 0)
++ unsigned long sec = get_seconds();
++ if (abs(sec - time->tv_sec) & ~7)
+ time->tv_sec = sec;
+ }
+
+@@ -3503,7 +3503,7 @@ EXPORT_SYMBOL(tty_devnum);
void tty_default_fops(struct file_operations *fops)
{
@@ -53910,8 +53529,33 @@ index 0508a1d..b610592 100644
}
/*
+diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
+index 1787fa4..552076b 100644
+--- a/drivers/tty/tty_ioctl.c
++++ b/drivers/tty/tty_ioctl.c
+@@ -217,11 +217,17 @@ void tty_wait_until_sent(struct tty_struct *tty, long timeout)
+ #endif
+ if (!timeout)
+ timeout = MAX_SCHEDULE_TIMEOUT;
++
+ if (wait_event_interruptible_timeout(tty->write_wait,
+- !tty_chars_in_buffer(tty), timeout) >= 0) {
+- if (tty->ops->wait_until_sent)
+- tty->ops->wait_until_sent(tty, timeout);
++ !tty_chars_in_buffer(tty), timeout) < 0) {
++ return;
+ }
++
++ if (timeout == MAX_SCHEDULE_TIMEOUT)
++ timeout = 0;
++
++ if (tty->ops->wait_until_sent)
++ tty->ops->wait_until_sent(tty, timeout);
+ }
+ EXPORT_SYMBOL(tty_wait_until_sent);
+
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
-index 2d822aa..a566234 100644
+index 3737f55..7cef448 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -71,7 +71,7 @@ int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc)
@@ -53951,10 +53595,10 @@ index 2d822aa..a566234 100644
raw_spin_unlock_irqrestore(&tty_ldiscs_lock, flags);
}
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
-index 1b93357..ea9f82c 100644
+index 40b31835..94d92ae 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
-@@ -237,7 +237,7 @@ void tty_port_hangup(struct tty_port *port)
+@@ -236,7 +236,7 @@ void tty_port_hangup(struct tty_port *port)
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
@@ -53963,7 +53607,7 @@ index 1b93357..ea9f82c 100644
port->flags &= ~ASYNC_NORMAL_ACTIVE;
tty = port->tty;
if (tty)
-@@ -399,7 +399,7 @@ int tty_port_block_til_ready(struct tty_port *port,
+@@ -398,7 +398,7 @@ int tty_port_block_til_ready(struct tty_port *port,
/* The port lock protects the port counts */
spin_lock_irqsave(&port->lock, flags);
@@ -53972,7 +53616,7 @@ index 1b93357..ea9f82c 100644
port->blocked_open++;
spin_unlock_irqrestore(&port->lock, flags);
-@@ -441,7 +441,7 @@ int tty_port_block_til_ready(struct tty_port *port,
+@@ -440,7 +440,7 @@ int tty_port_block_til_ready(struct tty_port *port,
we must not mess that up further */
spin_lock_irqsave(&port->lock, flags);
if (!tty_hung_up_p(filp))
@@ -53981,10 +53625,10 @@ index 1b93357..ea9f82c 100644
port->blocked_open--;
if (retval == 0)
port->flags |= ASYNC_NORMAL_ACTIVE;
-@@ -479,19 +479,19 @@ int tty_port_close_start(struct tty_port *port,
+@@ -476,19 +476,19 @@ int tty_port_close_start(struct tty_port *port,
return 0;
- }
+ spin_lock_irqsave(&port->lock, flags);
- if (tty->count == 1 && port->count != 1) {
+ if (tty->count == 1 && atomic_read(&port->count) != 1) {
printk(KERN_WARNING
@@ -54008,7 +53652,7 @@ index 1b93357..ea9f82c 100644
spin_unlock_irqrestore(&port->lock, flags);
return 0;
}
-@@ -592,7 +592,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
+@@ -590,7 +590,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
struct file *filp)
{
spin_lock_irq(&port->lock);
@@ -54018,7 +53662,7 @@ index 1b93357..ea9f82c 100644
tty_port_tty_set(port, tty);
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
-index c039cfe..0b463b0 100644
+index 8a89f6e..50b32af 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -641,6 +641,16 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag)
@@ -54079,7 +53723,7 @@ index c039cfe..0b463b0 100644
ret = -EPERM;
goto reterr;
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
-index 60fa627..7214965 100644
+index 6276f13..84f2449 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -25,6 +25,7 @@
@@ -54327,7 +53971,7 @@ index 0b59731..46ee7d1 100644
dev->rawdescriptors[i] + (*ppos - pos),
min(len, alloclen))) {
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
-index 0009fc8..483f7e5 100644
+index 45a915c..09f9735 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1551,7 +1551,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags)
@@ -54349,7 +53993,7 @@ index 0009fc8..483f7e5 100644
wake_up(&usb_kill_urb_queue);
usb_put_urb(urb);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
-index 2246954..d75b0b1 100644
+index b4bfa3a..008f926 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -26,6 +26,7 @@
@@ -54360,7 +54004,7 @@ index 2246954..d75b0b1 100644
#include <asm/uaccess.h>
#include <asm/byteorder.h>
-@@ -4666,6 +4667,10 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
+@@ -4664,6 +4665,10 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
goto done;
return;
}
@@ -54403,7 +54047,7 @@ index f368d20..0c30ac5 100644
{
struct urb *urb;
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
-index 1236c60..d47a51c 100644
+index d269738..7340cd7 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -244,7 +244,7 @@ static ssize_t urbnum_show(struct device *dev, struct device_attribute *attr,
@@ -54416,10 +54060,10 @@ index 1236c60..d47a51c 100644
static DEVICE_ATTR_RO(urbnum);
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
-index 29ee936..55e3f99 100644
+index b1fb9ae..4224885 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
-@@ -433,7 +433,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
+@@ -431,7 +431,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
set_dev_node(&dev->dev, dev_to_node(bus->controller));
dev->state = USB_STATE_ATTACHED;
dev->lpm_disable_count = 1;
@@ -54470,7 +54114,7 @@ index 8cfc319..4868255 100644
return 0;
}
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
-index f7b2032..fbb340c 100644
+index e971584..03495ab 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -14,6 +14,7 @@
@@ -54567,7 +54211,7 @@ index 491082a..dfd7d17 100644
gs_free_requests(gser->out, &port->read_pool, NULL);
gs_free_requests(gser->out, &port->read_queue, NULL);
diff --git a/drivers/usb/gadget/function/u_uac1.c b/drivers/usb/gadget/function/u_uac1.c
-index a44a07f..ecea924 100644
+index 53842a1..2bef3b6 100644
--- a/drivers/usb/gadget/function/u_uac1.c
+++ b/drivers/usb/gadget/function/u_uac1.c
@@ -17,6 +17,7 @@
@@ -54579,10 +54223,10 @@ index a44a07f..ecea924 100644
#include "u_uac1.h"
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
-index 5728829..fefc6bf 100644
+index 118edb7..7a6415f 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
-@@ -771,7 +771,7 @@ static struct urb *request_single_step_set_feature_urb(
+@@ -769,7 +769,7 @@ static struct urb *request_single_step_set_feature_urb(
urb->transfer_flags = URB_DIR_IN;
usb_get_urb(urb);
atomic_inc(&urb->use_count);
@@ -54591,7 +54235,7 @@ index 5728829..fefc6bf 100644
urb->setup_dma = dma_map_single(
hcd->self.controller,
urb->setup_packet,
-@@ -838,7 +838,7 @@ static int ehset_single_step_set_feature(struct usb_hcd *hcd, int port)
+@@ -836,7 +836,7 @@ static int ehset_single_step_set_feature(struct usb_hcd *hcd, int port)
urb->status = -EINPROGRESS;
usb_get_urb(urb);
atomic_inc(&urb->use_count);
@@ -54692,6 +54336,29 @@ index 29fa1c3..a57b08e 100644
struct usb_serial_port *port = info->port;
struct usb_serial *serial;
int retval = -ENODEV;
+diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
+index ccf1df7..54e170d 100644
+--- a/drivers/usb/serial/generic.c
++++ b/drivers/usb/serial/generic.c
+@@ -258,7 +258,8 @@ void usb_serial_generic_wait_until_sent(struct tty_struct *tty, long timeout)
+ * character or at least one jiffy.
+ */
+ period = max_t(unsigned long, (10 * HZ / bps), 1);
+- period = min_t(unsigned long, period, timeout);
++ if (timeout)
++ period = min_t(unsigned long, period, timeout);
+
+ dev_dbg(&port->dev, "%s - timeout = %u ms, period = %u ms\n",
+ __func__, jiffies_to_msecs(timeout),
+@@ -268,7 +269,7 @@ void usb_serial_generic_wait_until_sent(struct tty_struct *tty, long timeout)
+ schedule_timeout_interruptible(period);
+ if (signal_pending(current))
+ break;
+- if (time_after(jiffies, expire))
++ if (timeout && time_after(jiffies, expire))
+ break;
+ }
+ }
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 307e339..6aa97cb 100644
--- a/drivers/usb/storage/usb.h
@@ -54719,7 +54386,7 @@ index a863a98..d272795 100644
/*
* NOTE:
diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
-index c02374b..32d47a9 100644
+index 1ae9d40..c62604b 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -439,7 +439,7 @@ static void vhci_tx_urb(struct urb *urb)
@@ -54731,7 +54398,7 @@ index c02374b..32d47a9 100644
if (priv->seqnum == 0xffff)
dev_info(&urb->dev->dev, "seqnum max\n");
-@@ -686,7 +686,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
+@@ -684,7 +684,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
return -ENOMEM;
}
@@ -54740,7 +54407,7 @@ index c02374b..32d47a9 100644
if (unlink->seqnum == 0xffff)
pr_info("seqnum max\n");
-@@ -891,7 +891,7 @@ static int vhci_start(struct usb_hcd *hcd)
+@@ -888,7 +888,7 @@ static int vhci_start(struct usb_hcd *hcd)
vdev->rhport = rhport;
}
@@ -54810,22 +54477,41 @@ index f018d8d..ccab63f 100644
iommu_group_id(group->iommu_group));
return 0;
+diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
+index 9484d56..d415d69 100644
+--- a/drivers/vhost/net.c
++++ b/drivers/vhost/net.c
+@@ -650,10 +650,8 @@ static void handle_rx(struct vhost_net *net)
+ break;
+ }
+ /* TODO: Should check and handle checksum. */
+-
+- hdr.num_buffers = cpu_to_vhost16(vq, headcount);
+ if (likely(mergeable) &&
+- memcpy_toiovecend(nvq->hdr, (void *)&hdr.num_buffers,
++ memcpy_toiovecend(nvq->hdr, (unsigned char *)&headcount,
+ offsetof(typeof(hdr), num_buffers),
+ sizeof hdr.num_buffers)) {
+ vq_err(vq, "Failed num_buffers write");
diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
-index 5174eba..451e6bc 100644
+index 3bb02c6..a01ff38 100644
--- a/drivers/vhost/vringh.c
+++ b/drivers/vhost/vringh.c
-@@ -530,17 +530,17 @@ static inline void __vringh_notify_disable(struct vringh *vrh,
- /* Userspace access helpers: in this case, addresses are really userspace. */
- static inline int getu16_user(u16 *val, const u16 *p)
+@@ -551,7 +551,7 @@ static inline void __vringh_notify_disable(struct vringh *vrh,
+ static inline int getu16_user(const struct vringh *vrh, u16 *val, const __virtio16 *p)
{
-- return get_user(*val, (__force u16 __user *)p);
-+ return get_user(*val, (u16 __force_user *)p);
+ __virtio16 v = 0;
+- int rc = get_user(v, (__force __virtio16 __user *)p);
++ int rc = get_user(v, (__force_user __virtio16 *)p);
+ *val = vringh16_to_cpu(vrh, v);
+ return rc;
}
-
- static inline int putu16_user(u16 *p, u16 val)
+@@ -559,12 +559,12 @@ static inline int getu16_user(const struct vringh *vrh, u16 *val, const __virtio
+ static inline int putu16_user(const struct vringh *vrh, __virtio16 *p, u16 val)
{
-- return put_user(val, (__force u16 __user *)p);
-+ return put_user(val, (u16 __force_user *)p);
+ __virtio16 v = cpu_to_vringh16(vrh, val);
+- return put_user(v, (__force __virtio16 __user *)p);
++ return put_user(v, (__force_user __virtio16 *)p);
}
static inline int copydesc_user(void *dst, const void *src, size_t len)
@@ -54835,7 +54521,7 @@ index 5174eba..451e6bc 100644
-EFAULT : 0;
}
-@@ -548,19 +548,19 @@ static inline int putused_user(struct vring_used_elem *dst,
+@@ -572,19 +572,19 @@ static inline int putused_user(struct vring_used_elem *dst,
const struct vring_used_elem *src,
unsigned int num)
{
@@ -54858,7 +54544,7 @@ index 5174eba..451e6bc 100644
-EFAULT : 0;
}
-@@ -596,9 +596,9 @@ int vringh_init_user(struct vringh *vrh, u32 features,
+@@ -621,9 +621,9 @@ int vringh_init_user(struct vringh *vrh, u64 features,
vrh->last_used_idx = 0;
vrh->vring.num = num;
/* vring expects kernel addresses, but only used via accessors. */
@@ -54871,12 +54557,12 @@ index 5174eba..451e6bc 100644
return 0;
}
EXPORT_SYMBOL(vringh_init_user);
-@@ -800,7 +800,7 @@ static inline int getu16_kern(u16 *val, const u16 *p)
+@@ -826,7 +826,7 @@ static inline int getu16_kern(const struct vringh *vrh,
- static inline int putu16_kern(u16 *p, u16 val)
+ static inline int putu16_kern(const struct vringh *vrh, __virtio16 *p, u16 val)
{
-- ACCESS_ONCE(*p) = val;
-+ ACCESS_ONCE_RW(*p) = val;
+- ACCESS_ONCE(*p) = cpu_to_vringh16(vrh, val);
++ ACCESS_ONCE_RW(*p) = cpu_to_vringh16(vrh, val);
return 0;
}
@@ -55196,7 +54882,7 @@ index 83433cb..71e9b98 100644
FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA;
break;
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
-index 2bcc84a..29dd1ea 100644
+index d3013cd..95b8285 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -439,9 +439,9 @@ static unsigned long lcdc_sys_read_data(void *handle)
@@ -55213,10 +54899,10 @@ index 2bcc84a..29dd1ea 100644
static int sh_mobile_lcdc_sginit(struct fb_info *info,
diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c
-index d513ed6..90b0de9 100644
+index 9279e5f..d5f5276 100644
--- a/drivers/video/fbdev/smscufx.c
+++ b/drivers/video/fbdev/smscufx.c
-@@ -1175,7 +1175,9 @@ static int ufx_ops_release(struct fb_info *info, int user)
+@@ -1174,7 +1174,9 @@ static int ufx_ops_release(struct fb_info *info, int user)
fb_deferred_io_cleanup(info);
kfree(info->fbdefio);
info->fbdefio = NULL;
@@ -55228,7 +54914,7 @@ index d513ed6..90b0de9 100644
pr_debug("released /dev/fb%d user=%d count=%d",
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
-index 046d51d..be564da 100644
+index ff2b873..626a8d5 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -623,11 +623,11 @@ static int dlfb_handle_damage(struct dlfb_data *dev, int x, int y,
@@ -55263,7 +54949,7 @@ index 046d51d..be564da 100644
>> 10)), /* Kcycles */
&dev->cpu_kcycles_used);
}
-@@ -993,7 +993,9 @@ static int dlfb_ops_release(struct fb_info *info, int user)
+@@ -991,7 +991,9 @@ static int dlfb_ops_release(struct fb_info *info, int user)
fb_deferred_io_cleanup(info);
kfree(info->fbdefio);
info->fbdefio = NULL;
@@ -55274,7 +54960,7 @@ index 046d51d..be564da 100644
}
pr_warn("released /dev/fb%d user=%d count=%d\n",
-@@ -1376,7 +1378,7 @@ static ssize_t metrics_bytes_rendered_show(struct device *fbdev,
+@@ -1373,7 +1375,7 @@ static ssize_t metrics_bytes_rendered_show(struct device *fbdev,
struct fb_info *fb_info = dev_get_drvdata(fbdev);
struct dlfb_data *dev = fb_info->par;
return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -55283,7 +54969,7 @@ index 046d51d..be564da 100644
}
static ssize_t metrics_bytes_identical_show(struct device *fbdev,
-@@ -1384,7 +1386,7 @@ static ssize_t metrics_bytes_identical_show(struct device *fbdev,
+@@ -1381,7 +1383,7 @@ static ssize_t metrics_bytes_identical_show(struct device *fbdev,
struct fb_info *fb_info = dev_get_drvdata(fbdev);
struct dlfb_data *dev = fb_info->par;
return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -55292,7 +54978,7 @@ index 046d51d..be564da 100644
}
static ssize_t metrics_bytes_sent_show(struct device *fbdev,
-@@ -1392,7 +1394,7 @@ static ssize_t metrics_bytes_sent_show(struct device *fbdev,
+@@ -1389,7 +1391,7 @@ static ssize_t metrics_bytes_sent_show(struct device *fbdev,
struct fb_info *fb_info = dev_get_drvdata(fbdev);
struct dlfb_data *dev = fb_info->par;
return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -55301,7 +54987,7 @@ index 046d51d..be564da 100644
}
static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
-@@ -1400,7 +1402,7 @@ static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
+@@ -1397,7 +1399,7 @@ static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
struct fb_info *fb_info = dev_get_drvdata(fbdev);
struct dlfb_data *dev = fb_info->par;
return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -55310,7 +54996,7 @@ index 046d51d..be564da 100644
}
static ssize_t edid_show(
-@@ -1460,10 +1462,10 @@ static ssize_t metrics_reset_store(struct device *fbdev,
+@@ -1457,10 +1459,10 @@ static ssize_t metrics_reset_store(struct device *fbdev,
struct fb_info *fb_info = dev_get_drvdata(fbdev);
struct dlfb_data *dev = fb_info->par;
@@ -55326,7 +55012,7 @@ index 046d51d..be564da 100644
return count;
}
diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
-index 509d452..7c9d2de 100644
+index d32d1c4..46722e6 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -19,6 +19,7 @@
@@ -55387,7 +55073,7 @@ index 509d452..7c9d2de 100644
}
#else
/* The protected mode interface is not available on non-x86. */
-@@ -1453,8 +1477,11 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
+@@ -1452,8 +1476,11 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
info->fix.ywrapstep = (par->ypan > 1) ? 1 : 0;
/* Disable blanking if the user requested so. */
@@ -55401,7 +55087,7 @@ index 509d452..7c9d2de 100644
/*
* Find out how much IO memory is required for the mode with
-@@ -1525,8 +1552,11 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
+@@ -1524,8 +1551,11 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
info->flags = FBINFO_FLAG_DEFAULT |
(par->ypan ? FBINFO_HWACCEL_YPAN : 0);
@@ -55415,32 +55101,32 @@ index 509d452..7c9d2de 100644
}
static void uvesafb_init_mtrr(struct fb_info *info)
-@@ -1787,6 +1817,11 @@ out_mode:
+@@ -1786,6 +1816,11 @@ out_mode:
out:
kfree(par->vbe_modes);
+#if defined(CONFIG_MODULES) && defined(CONFIG_PAX_KERNEXEC)
+ if (par->pmi_code)
-+ module_free_exec(NULL, par->pmi_code);
++ module_memfree_exec(par->pmi_code);
+#endif
+
framebuffer_release(info);
return err;
}
-@@ -1811,6 +1846,11 @@ static int uvesafb_remove(struct platform_device *dev)
+@@ -1810,6 +1845,11 @@ static int uvesafb_remove(struct platform_device *dev)
kfree(par->vbe_state_orig);
kfree(par->vbe_state_saved);
+#if defined(CONFIG_MODULES) && defined(CONFIG_PAX_KERNEXEC)
+ if (par->pmi_code)
-+ module_free_exec(NULL, par->pmi_code);
++ module_memfree_exec(par->pmi_code);
+#endif
+
framebuffer_release(info);
}
return 0;
diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c
-index 6170e7f..dd63031 100644
+index d7