summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2016-04-29 20:52:52 -0400
committerAnthony G. Basile <blueness@gentoo.org>2016-04-29 20:52:52 -0400
commitc724961ddb517e3d599cc88d13ae5b5c7614753e (patch)
treef758340d57bc4106c4fd60377b9dde4a9d3e5386
parentgrsecurity-3.1-4.4.8-201604252206 (diff)
downloadhardened-patchset-20160428.tar.gz
hardened-patchset-20160428.tar.bz2
hardened-patchset-20160428.zip
grsecurity-3.1-4.5.2-20160428205820160428
-rw-r--r--4.4.8/4427_force_XATTR_PAX_tmpfs.patch35
-rw-r--r--4.5.2/0000_README (renamed from 4.4.8/0000_README)6
-rw-r--r--4.5.2/1001_linux-4.5.2.patch (renamed from 4.4.8/1007_linux-4.4.8.patch)2008
-rw-r--r--4.5.2/4420_grsecurity-3.1-4.5.2-201604282058.patch (renamed from 4.4.8/4420_grsecurity-3.1-4.4.8-201604252206.patch)41813
-rw-r--r--4.5.2/4425_grsec_remove_EI_PAX.patch (renamed from 4.4.8/4425_grsec_remove_EI_PAX.patch)0
-rw-r--r--4.5.2/4427_force_XATTR_PAX_tmpfs.patch57
-rw-r--r--4.5.2/4430_grsec-remove-localversion-grsec.patch (renamed from 4.4.8/4430_grsec-remove-localversion-grsec.patch)0
-rw-r--r--4.5.2/4435_grsec-mute-warnings.patch (renamed from 4.4.8/4435_grsec-mute-warnings.patch)0
-rw-r--r--4.5.2/4440_grsec-remove-protected-paths.patch (renamed from 4.4.8/4440_grsec-remove-protected-paths.patch)0
-rw-r--r--4.5.2/4450_grsec-kconfig-default-gids.patch (renamed from 4.4.8/4450_grsec-kconfig-default-gids.patch)0
-rw-r--r--4.5.2/4465_selinux-avc_audit-log-curr_ip.patch (renamed from 4.4.8/4465_selinux-avc_audit-log-curr_ip.patch)0
-rw-r--r--4.5.2/4470_disable-compat_vdso.patch (renamed from 4.4.8/4470_disable-compat_vdso.patch)2
-rw-r--r--4.5.2/4475_emutramp_default_on.patch (renamed from 4.4.8/4475_emutramp_default_on.patch)0
13 files changed, 35965 insertions, 7956 deletions
diff --git a/4.4.8/4427_force_XATTR_PAX_tmpfs.patch b/4.4.8/4427_force_XATTR_PAX_tmpfs.patch
deleted file mode 100644
index f6aea64..0000000
--- a/4.4.8/4427_force_XATTR_PAX_tmpfs.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Anthony G. Basile <blueness@gentoo.org>
-
-For users that emerge without XATTR_PAX support enabled, we still want user.pax.flags
-namespace supported on tmpfs so that the PaX markings survive emerge.
-
-diff -Naur a/mm/shmem.c b/mm/shmem.c
---- a/mm/shmem.c 2013-06-11 21:00:18.000000000 -0400
-+++ b/mm/shmem.c 2013-06-11 21:08:18.000000000 -0400
-@@ -2564,11 +2564,7 @@
- static int shmem_xattr_validate(const char *name)
- {
- struct { const char *prefix; size_t len; } arr[] = {
--
--#ifdef CONFIG_PAX_XATTR_PAX_FLAGS
- { XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN},
--#endif
--
- { XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN },
- { XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN }
- };
-@@ -2624,14 +2620,12 @@
- if (err)
- return err;
-
--#ifdef CONFIG_PAX_XATTR_PAX_FLAGS
- if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) {
- if (strcmp(name, XATTR_NAME_PAX_FLAGS))
- return -EOPNOTSUPP;
- if (size > 8)
- return -EINVAL;
- }
--#endif
-
- return simple_xattr_set(&info->xattrs, name, value, size, flags);
- }
diff --git a/4.4.8/0000_README b/4.5.2/0000_README
index 31bb556..6857874 100644
--- a/4.4.8/0000_README
+++ b/4.5.2/0000_README
@@ -2,11 +2,11 @@ README
-----------------------------------------------------------------------------
Individual Patch Descriptions:
-----------------------------------------------------------------------------
-Patch: 1007_linux-4.4.8.patch
+Patch: 1001_linux-4.5.2.patch
From: http://www.kernel.org
-Desc: Linux 4.4.8
+Desc: Linux 4.5.2
-Patch: 4420_grsecurity-3.1-4.4.8-201604252206.patch
+Patch: 4420_grsecurity-3.1-4.5.2-201604282058.patch
From: http://www.grsecurity.net
Desc: hardened-sources base patch from upstream grsecurity
diff --git a/4.4.8/1007_linux-4.4.8.patch b/4.5.2/1001_linux-4.5.2.patch
index e8c236b..2c2064e 100644
--- a/4.4.8/1007_linux-4.4.8.patch
+++ b/4.5.2/1001_linux-4.5.2.patch
@@ -22,10 +22,10 @@ index 08a4a32..0326154 100644
trstn
tdi
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 742f69d..0e4102a 100644
+index 9a53c92..21e4b48 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
-@@ -3928,6 +3928,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -4016,6 +4016,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
sector if the number is odd);
i = IGNORE_DEVICE (don't bind to this
device);
@@ -35,17 +35,35 @@ index 742f69d..0e4102a 100644
unlock ejectable media);
m = MAX_SECTORS_64 (don't transfer more
diff --git a/Makefile b/Makefile
-index 5a493e7..1928fcd 100644
+index c621889..1ecaaeb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION = 4
- PATCHLEVEL = 4
--SUBLEVEL = 7
-+SUBLEVEL = 8
+ PATCHLEVEL = 5
+-SUBLEVEL = 1
++SUBLEVEL = 2
EXTRAVERSION =
NAME = Blurry Fish Butt
+diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
+index 7d0cba6f..c86ea8a 100644
+--- a/arch/arm/kernel/setup.c
++++ b/arch/arm/kernel/setup.c
+@@ -430,11 +430,13 @@ static void __init patch_aeabi_idiv(void)
+ pr_info("CPU: div instructions available: patching division code\n");
+
+ fn_addr = ((uintptr_t)&__aeabi_uidiv) & ~1;
++ asm ("" : "+g" (fn_addr));
+ ((u32 *)fn_addr)[0] = udiv_instruction();
+ ((u32 *)fn_addr)[1] = bx_lr_instruction();
+ flush_icache_range(fn_addr, fn_addr + 8);
+
+ fn_addr = ((uintptr_t)&__aeabi_idiv) & ~1;
++ asm ("" : "+g" (fn_addr));
+ ((u32 *)fn_addr)[0] = sdiv_instruction();
+ ((u32 *)fn_addr)[1] = bx_lr_instruction();
+ flush_icache_range(fn_addr, fn_addr + 8);
diff --git a/arch/arm64/include/asm/opcodes.h b/arch/arm64/include/asm/opcodes.h
index 4e603ea..123f45d 100644
--- a/arch/arm64/include/asm/opcodes.h
@@ -57,7 +75,7 @@ index 4e603ea..123f45d 100644
+
#include <../../arm/include/asm/opcodes.h>
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
-index 8aee3ae..c1492ba 100644
+index c536c9e..0931155 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -186,20 +186,21 @@ static void clear_regs_spsr_ss(struct pt_regs *regs)
@@ -177,7 +195,7 @@ index bdeed9d..433c4b9 100644
irq_set_irq_type(s1, IRQ_TYPE_LEVEL_LOW);
diff --git a/arch/mips/alchemy/devboards/db1550.c b/arch/mips/alchemy/devboards/db1550.c
-index 5740bcf..6c37b93 100644
+index b518f02..1c01d6e 100644
--- a/arch/mips/alchemy/devboards/db1550.c
+++ b/arch/mips/alchemy/devboards/db1550.c
@@ -514,7 +514,7 @@ static void __init db1550_devices(void)
@@ -268,6 +286,60 @@ index 490cea5..5c62065 100644
break;
case msa_st_op:
+diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
+index 14f655c..86ed376 100644
+--- a/arch/parisc/Kconfig
++++ b/arch/parisc/Kconfig
+@@ -29,6 +29,7 @@ config PARISC
+ select TTY # Needed for pdc_cons.c
+ select HAVE_DEBUG_STACKOVERFLOW
+ select HAVE_ARCH_AUDITSYSCALL
++ select HAVE_ARCH_SECCOMP_FILTER
+ select ARCH_NO_COHERENT_DMA_MMAP
+
+ help
+diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h
+index 0448a2c..3387307 100644
+--- a/arch/parisc/include/asm/compat.h
++++ b/arch/parisc/include/asm/compat.h
+@@ -183,6 +183,13 @@ typedef struct compat_siginfo {
+ int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ int _fd;
+ } _sigpoll;
++
++ /* SIGSYS */
++ struct {
++ compat_uptr_t _call_addr; /* calling user insn */
++ int _syscall; /* triggering system call number */
++ compat_uint_t _arch; /* AUDIT_ARCH_* of syscall */
++ } _sigsys;
+ } _sifields;
+ } compat_siginfo_t;
+
+diff --git a/arch/parisc/include/asm/syscall.h b/arch/parisc/include/asm/syscall.h
+index a5eba95..637ce8d 100644
+--- a/arch/parisc/include/asm/syscall.h
++++ b/arch/parisc/include/asm/syscall.h
+@@ -39,6 +39,19 @@ static inline void syscall_get_arguments(struct task_struct *tsk,
+ }
+ }
+
++static inline void syscall_set_return_value(struct task_struct *task,
++ struct pt_regs *regs,
++ int error, long val)
++{
++ regs->gr[28] = error ? error : val;
++}
++
++static inline void syscall_rollback(struct task_struct *task,
++ struct pt_regs *regs)
++{
++ /* do nothing */
++}
++
+ static inline int syscall_get_arch(void)
+ {
+ int arch = AUDIT_ARCH_PARISC;
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
index 0abdd4c..1960b87 100644
--- a/arch/parisc/include/asm/uaccess.h
@@ -313,6 +385,69 @@ index 568b2c6..3cad8aa 100644
EXPORT_SYMBOL(fixup_get_user_skip_1);
EXPORT_SYMBOL(fixup_get_user_skip_2);
EXPORT_SYMBOL(fixup_put_user_skip_1);
+diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
+index ce0b2b4..8fb81a3 100644
+--- a/arch/parisc/kernel/ptrace.c
++++ b/arch/parisc/kernel/ptrace.c
+@@ -270,7 +270,8 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
+ long do_syscall_trace_enter(struct pt_regs *regs)
+ {
+ /* Do the secure computing check first. */
+- secure_computing_strict(regs->gr[20]);
++ if (secure_computing() == -1)
++ return -1;
+
+ if (test_thread_flag(TIF_SYSCALL_TRACE) &&
+ tracehook_report_syscall_entry(regs)) {
+@@ -296,7 +297,11 @@ long do_syscall_trace_enter(struct pt_regs *regs)
+ regs->gr[23] & 0xffffffff);
+
+ out:
+- return regs->gr[20];
++ /*
++ * Sign extend the syscall number to 64bit since it may have been
++ * modified by a compat ptrace call
++ */
++ return (int) ((u32) regs->gr[20]);
+ }
+
+ void do_syscall_trace_exit(struct pt_regs *regs)
+diff --git a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c
+index 984abbe..c342b2e 100644
+--- a/arch/parisc/kernel/signal32.c
++++ b/arch/parisc/kernel/signal32.c
+@@ -371,6 +371,11 @@ copy_siginfo_to_user32 (compat_siginfo_t __user *to, const siginfo_t *from)
+ val = (compat_int_t)from->si_int;
+ err |= __put_user(val, &to->si_int);
+ break;
++ case __SI_SYS >> 16:
++ err |= __put_user(ptr_to_compat(from->si_call_addr), &to->si_call_addr);
++ err |= __put_user(from->si_syscall, &to->si_syscall);
++ err |= __put_user(from->si_arch, &to->si_arch);
++ break;
+ }
+ }
+ return err;
+diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
+index fbafa0d..c976ebf 100644
+--- a/arch/parisc/kernel/syscall.S
++++ b/arch/parisc/kernel/syscall.S
+@@ -329,6 +329,7 @@ tracesys_next:
+
+ ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
+ LDREG TI_TASK(%r1), %r1
++ LDREG TASK_PT_GR28(%r1), %r28 /* Restore return value */
+ LDREG TASK_PT_GR26(%r1), %r26 /* Restore the users args */
+ LDREG TASK_PT_GR25(%r1), %r25
+ LDREG TASK_PT_GR24(%r1), %r24
+@@ -342,6 +343,7 @@ tracesys_next:
+ stw %r21, -56(%r30) /* 6th argument */
+ #endif
+
++ cmpib,COND(=),n -1,%r20,tracesys_exit /* seccomp may have returned -1 */
+ comiclr,>>= __NR_Linux_syscalls, %r20, %r0
+ b,n .Ltracesys_nosys
+
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 553b098..77e2262 100644
--- a/arch/parisc/kernel/traps.c
@@ -371,11 +506,24 @@ index a762864..f906444 100644
d->fault_space = regs->isr;
d->fault_addr = regs->ior;
+diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
+index 3c5736e..54ed9c7 100644
+--- a/arch/powerpc/kernel/process.c
++++ b/arch/powerpc/kernel/process.c
+@@ -854,7 +854,7 @@ void restore_tm_state(struct pt_regs *regs)
+ static inline void save_sprs(struct thread_struct *t)
+ {
+ #ifdef CONFIG_ALTIVEC
+- if (cpu_has_feature(cpu_has_feature(CPU_FTR_ALTIVEC)))
++ if (cpu_has_feature(CPU_FTR_ALTIVEC))
+ t->vrsave = mfspr(SPRN_VRSAVE);
+ #endif
+ #ifdef CONFIG_PPC_BOOK3S_64
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
-index 9833fee..807f159 100644
+index 744e24b..4a811ca 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
-@@ -486,13 +486,13 @@ static void hugepd_free(struct mmu_gather *tlb, void *hugepte)
+@@ -414,13 +414,13 @@ static void hugepd_free(struct mmu_gather *tlb, void *hugepte)
{
struct hugepd_freelist **batchp;
@@ -391,11 +539,43 @@ index 9833fee..807f159 100644
return;
}
+diff --git a/arch/s390/mm/gup.c b/arch/s390/mm/gup.c
+index 13dab0c..3776aca 100644
+--- a/arch/s390/mm/gup.c
++++ b/arch/s390/mm/gup.c
+@@ -20,9 +20,9 @@
+ static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
+ unsigned long end, int write, struct page **pages, int *nr)
+ {
++ struct page *head, *page;
+ unsigned long mask;
+ pte_t *ptep, pte;
+- struct page *page;
+
+ mask = (write ? _PAGE_PROTECT : 0) | _PAGE_INVALID | _PAGE_SPECIAL;
+
+@@ -37,12 +37,14 @@ static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
+ return 0;
+ VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
+ page = pte_page(pte);
+- if (!page_cache_get_speculative(page))
++ head = compound_head(page);
++ if (!page_cache_get_speculative(head))
+ return 0;
+ if (unlikely(pte_val(pte) != pte_val(*ptep))) {
+- put_page(page);
++ put_page(head);
+ return 0;
+ }
++ VM_BUG_ON_PAGE(compound_head(page) != head, page);
+ pages[*nr] = page;
+ (*nr)++;
+
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
-index 30cfd64..9d2abb2 100644
+index 44adbb8..f8dba20 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
-@@ -41,7 +41,7 @@
+@@ -42,7 +42,7 @@
#define KVM_PIO_PAGE_OFFSET 1
#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
@@ -404,24 +584,11 @@ index 30cfd64..9d2abb2 100644
#define KVM_IRQCHIP_NUM_PINS KVM_IOAPIC_NUM_PINS
-diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
-index fa1195d..164e3f8 100644
---- a/arch/x86/include/asm/pci_x86.h
-+++ b/arch/x86/include/asm/pci_x86.h
-@@ -93,6 +93,8 @@ extern raw_spinlock_t pci_config_lock;
- extern int (*pcibios_enable_irq)(struct pci_dev *dev);
- extern void (*pcibios_disable_irq)(struct pci_dev *dev);
-
-+extern bool mp_should_keep_irq(struct device *dev);
-+
- struct pci_raw_ops {
- int (*read)(unsigned int domain, unsigned int bus, unsigned int devfn,
- int reg, int len, u32 *val);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
-index 8bfc5fc..7eb4ebd 100644
+index d47d231..eca5bd9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
-@@ -6024,12 +6024,10 @@ static int inject_pending_event(struct kvm_vcpu *vcpu, bool req_int_win)
+@@ -6074,12 +6074,10 @@ static int inject_pending_event(struct kvm_vcpu *vcpu, bool req_int_win)
}
/* try to inject new event if pending */
@@ -438,7 +605,7 @@ index 8bfc5fc..7eb4ebd 100644
} else if (kvm_cpu_has_injectable_intr(vcpu)) {
/*
* Because interrupts can be injected asynchronously, we are
-@@ -6474,10 +6472,12 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
+@@ -6548,10 +6546,12 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
if (inject_pending_event(vcpu, req_int_win) != 0)
req_immediate_exit = true;
/* enable NMI/IRQ window open exits if needed */
@@ -455,128 +622,6 @@ index 8bfc5fc..7eb4ebd 100644
if (kvm_lapic_enabled(vcpu)) {
update_cr8_intercept(vcpu);
-diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
-index eccd4d9..8fd6f44 100644
---- a/arch/x86/pci/common.c
-+++ b/arch/x86/pci/common.c
-@@ -673,28 +673,22 @@ int pcibios_add_device(struct pci_dev *dev)
- return 0;
- }
-
--int pcibios_alloc_irq(struct pci_dev *dev)
-+int pcibios_enable_device(struct pci_dev *dev, int mask)
- {
-- /*
-- * If the PCI device was already claimed by core code and has
-- * MSI enabled, probing of the pcibios IRQ will overwrite
-- * dev->irq. So bail out if MSI is already enabled.
-- */
-- if (pci_dev_msi_enabled(dev))
-- return -EBUSY;
-+ int err;
-
-- return pcibios_enable_irq(dev);
--}
-+ if ((err = pci_enable_resources(dev, mask)) < 0)
-+ return err;
-
--void pcibios_free_irq(struct pci_dev *dev)
--{
-- if (pcibios_disable_irq)
-- pcibios_disable_irq(dev);
-+ if (!pci_dev_msi_enabled(dev))
-+ return pcibios_enable_irq(dev);
-+ return 0;
- }
-
--int pcibios_enable_device(struct pci_dev *dev, int mask)
-+void pcibios_disable_device (struct pci_dev *dev)
- {
-- return pci_enable_resources(dev, mask);
-+ if (!pci_dev_msi_enabled(dev) && pcibios_disable_irq)
-+ pcibios_disable_irq(dev);
- }
-
- int pci_ext_cfg_avail(void)
-diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c
-index 0d24e7c..8b93e63 100644
---- a/arch/x86/pci/intel_mid_pci.c
-+++ b/arch/x86/pci/intel_mid_pci.c
-@@ -215,7 +215,7 @@ static int intel_mid_pci_irq_enable(struct pci_dev *dev)
- int polarity;
- int ret;
-
-- if (pci_has_managed_irq(dev))
-+ if (dev->irq_managed && dev->irq > 0)
- return 0;
-
- switch (intel_mid_identify_cpu()) {
-@@ -256,13 +256,10 @@ static int intel_mid_pci_irq_enable(struct pci_dev *dev)
-
- static void intel_mid_pci_irq_disable(struct pci_dev *dev)
- {
-- if (pci_has_managed_irq(dev)) {
-+ if (!mp_should_keep_irq(&dev->dev) && dev->irq_managed &&
-+ dev->irq > 0) {
- mp_unmap_irq(dev->irq);
- dev->irq_managed = 0;
-- /*
-- * Don't reset dev->irq here, otherwise
-- * intel_mid_pci_irq_enable() will fail on next call.
-- */
- }
- }
-
-diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
-index 32e7034..9bd1154 100644
---- a/arch/x86/pci/irq.c
-+++ b/arch/x86/pci/irq.c
-@@ -1202,7 +1202,7 @@ static int pirq_enable_irq(struct pci_dev *dev)
- struct pci_dev *temp_dev;
- int irq;
-
-- if (pci_has_managed_irq(dev))
-+ if (dev->irq_managed && dev->irq > 0)
- return 0;
-
- irq = IO_APIC_get_PCI_irq_vector(dev->bus->number,
-@@ -1230,7 +1230,8 @@ static int pirq_enable_irq(struct pci_dev *dev)
- }
- dev = temp_dev;
- if (irq >= 0) {
-- pci_set_managed_irq(dev, irq);
-+ dev->irq_managed = 1;
-+ dev->irq = irq;
- dev_info(&dev->dev, "PCI->APIC IRQ transform: "
- "INT %c -> IRQ %d\n", 'A' + pin - 1, irq);
- return 0;
-@@ -1256,10 +1257,24 @@ static int pirq_enable_irq(struct pci_dev *dev)
- return 0;
- }
-
-+bool mp_should_keep_irq(struct device *dev)
-+{
-+ if (dev->power.is_prepared)
-+ return true;
-+#ifdef CONFIG_PM
-+ if (dev->power.runtime_status == RPM_SUSPENDING)
-+ return true;
-+#endif
-+
-+ return false;
-+}
-+
- static void pirq_disable_irq(struct pci_dev *dev)
- {
-- if (io_apic_assign_pci_irqs && pci_has_managed_irq(dev)) {
-+ if (io_apic_assign_pci_irqs && !mp_should_keep_irq(&dev->dev) &&
-+ dev->irq_managed && dev->irq) {
- mp_unmap_irq(dev->irq);
-- pci_reset_managed_irq(dev);
-+ dev->irq = 0;
-+ dev->irq_managed = 0;
- }
- }
diff --git a/crypto/asymmetric_keys/pkcs7_trust.c b/crypto/asymmetric_keys/pkcs7_trust.c
index 90d6d47..ecdb5a2 100644
--- a/crypto/asymmetric_keys/pkcs7_trust.c
@@ -590,58 +635,8 @@ index 90d6d47..ecdb5a2 100644
for (p = pkcs7->certs; p; p = p->next)
p->seen = false;
-diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
-index c933675..8a10a7a 100644
---- a/drivers/acpi/pci_irq.c
-+++ b/drivers/acpi/pci_irq.c
-@@ -409,7 +409,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
- return 0;
- }
-
-- if (pci_has_managed_irq(dev))
-+ if (dev->irq_managed && dev->irq > 0)
- return 0;
-
- entry = acpi_pci_irq_lookup(dev, pin);
-@@ -454,7 +454,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
- kfree(entry);
- return rc;
- }
-- pci_set_managed_irq(dev, rc);
-+ dev->irq = rc;
-+ dev->irq_managed = 1;
-
- if (link)
- snprintf(link_desc, sizeof(link_desc), " -> Link[%s]", link);
-@@ -477,9 +478,17 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
- u8 pin;
-
- pin = dev->pin;
-- if (!pin || !pci_has_managed_irq(dev))
-+ if (!pin || !dev->irq_managed || dev->irq <= 0)
- return;
-
-+ /* Keep IOAPIC pin configuration when suspending */
-+ if (dev->dev.power.is_prepared)
-+ return;
-+#ifdef CONFIG_PM
-+ if (dev->dev.power.runtime_status == RPM_SUSPENDING)
-+ return;
-+#endif
-+
- entry = acpi_pci_irq_lookup(dev, pin);
- if (!entry)
- return;
-@@ -499,6 +508,6 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
- dev_dbg(&dev->dev, "PCI INT %c disabled\n", pin_name(pin));
- if (gsi >= 0) {
- acpi_unregister_gsi(gsi);
-- pci_reset_managed_irq(dev);
-+ dev->irq_managed = 0;
- }
- }
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
-index 81ea69f..fbdddd6 100644
+index 4a87678..9745cf9 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1955,7 +1955,7 @@ static struct ceph_osd_request *rbd_osd_req_create(
@@ -671,11 +666,89 @@ index 81ea69f..fbdddd6 100644
if (!obj_request->bio_list)
goto out_unwind;
} else if (type == OBJ_REQUEST_PAGES) {
+diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
+index 99b375c..90c1511 100644
+--- a/drivers/gpio/gpio-pca953x.c
++++ b/drivers/gpio/gpio-pca953x.c
+@@ -18,6 +18,7 @@
+ #include <linux/i2c.h>
+ #include <linux/platform_data/pca953x.h>
+ #include <linux/slab.h>
++#include <asm/unaligned.h>
+ #include <linux/of_platform.h>
+ #include <linux/acpi.h>
+
+@@ -159,7 +160,7 @@ static int pca953x_write_regs(struct pca953x_chip *chip, int reg, u8 *val)
+ switch (chip->chip_type) {
+ case PCA953X_TYPE:
+ ret = i2c_smbus_write_word_data(chip->client,
+- reg << 1, (u16) *val);
++ reg << 1, cpu_to_le16(get_unaligned((u16 *)val)));
+ break;
+ case PCA957X_TYPE:
+ ret = i2c_smbus_write_byte_data(chip->client, reg << 1,
+diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
+index b2b7b78..76ac906 100644
+--- a/drivers/gpio/gpio-pxa.c
++++ b/drivers/gpio/gpio-pxa.c
+@@ -283,8 +283,8 @@ static int pxa_gpio_direction_output(struct gpio_chip *chip,
+ writel_relaxed(mask, base + (value ? GPSR_OFFSET : GPCR_OFFSET));
+
+ ret = pinctrl_gpio_direction_output(chip->base + offset);
+- if (!ret)
+- return 0;
++ if (ret)
++ return ret;
+
+ spin_lock_irqsave(&gpio_lock, flags);
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+index 7a4b101..75cb5b9 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+@@ -816,10 +816,13 @@ static int amdgpu_cgs_get_active_displays_info(void *cgs_device,
+ struct drm_device *ddev = adev->ddev;
+ struct drm_crtc *crtc;
+ uint32_t line_time_us, vblank_lines;
++ struct cgs_mode_info *mode_info;
+
+ if (info == NULL)
+ return -EINVAL;
+
++ mode_info = info->mode_info;
++
+ if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {
+ list_for_each_entry(crtc,
+ &ddev->mode_config.crtc_list, head) {
+@@ -828,7 +831,7 @@ static int amdgpu_cgs_get_active_displays_info(void *cgs_device,
+ info->active_display_mask |= (1 << amdgpu_crtc->crtc_id);
+ info->display_count++;
+ }
+- if (info->mode_info != NULL &&
++ if (mode_info != NULL &&
+ crtc->enabled && amdgpu_crtc->enabled &&
+ amdgpu_crtc->hw_mode.clock) {
+ line_time_us = (amdgpu_crtc->hw_mode.crtc_htotal * 1000) /
+@@ -836,10 +839,10 @@ static int amdgpu_cgs_get_active_displays_info(void *cgs_device,
+ vblank_lines = amdgpu_crtc->hw_mode.crtc_vblank_end -
+ amdgpu_crtc->hw_mode.crtc_vdisplay +
+ (amdgpu_crtc->v_border * 2);
+- info->mode_info->vblank_time_us = vblank_lines * line_time_us;
+- info->mode_info->refresh_rate = drm_mode_vrefresh(&amdgpu_crtc->hw_mode);
+- info->mode_info->ref_clock = adev->clock.spll.reference_freq;
+- info->mode_info++;
++ mode_info->vblank_time_us = vblank_lines * line_time_us;
++ mode_info->refresh_rate = drm_mode_vrefresh(&amdgpu_crtc->hw_mode);
++ mode_info->ref_clock = adev->clock.spll.reference_freq;
++ mode_info = NULL;
+ }
+ }
+ }
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
-index 272110c..ea87033 100644
+index b806079..53964b1 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
-@@ -898,14 +898,6 @@ static int gmc_v7_0_early_init(void *handle)
+@@ -902,14 +902,6 @@ static int gmc_v7_0_early_init(void *handle)
gmc_v7_0_set_gart_funcs(adev);
gmc_v7_0_set_irq_funcs(adev);
@@ -690,7 +763,7 @@ index 272110c..ea87033 100644
return 0;
}
-@@ -926,6 +918,14 @@ static int gmc_v7_0_sw_init(void *handle)
+@@ -930,6 +922,14 @@ static int gmc_v7_0_sw_init(void *handle)
if (r)
return r;
@@ -706,10 +779,10 @@ index 272110c..ea87033 100644
if (r)
return r;
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
-index ba4ad00..0842308 100644
+index 3efd455..e59251f 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
-@@ -852,14 +852,6 @@ static int gmc_v8_0_early_init(void *handle)
+@@ -856,14 +856,6 @@ static int gmc_v8_0_early_init(void *handle)
gmc_v8_0_set_gart_funcs(adev);
gmc_v8_0_set_irq_funcs(adev);
@@ -724,7 +797,7 @@ index ba4ad00..0842308 100644
return 0;
}
-@@ -870,6 +862,8 @@ static int gmc_v8_0_late_init(void *handle)
+@@ -874,6 +866,8 @@ static int gmc_v8_0_late_init(void *handle)
return amdgpu_irq_get(adev, &adev->mc.vm_fault, 0);
}
@@ -733,7 +806,7 @@ index ba4ad00..0842308 100644
static int gmc_v8_0_sw_init(void *handle)
{
int r;
-@@ -880,6 +874,19 @@ static int gmc_v8_0_sw_init(void *handle)
+@@ -884,6 +878,19 @@ static int gmc_v8_0_sw_init(void *handle)
if (r)
return r;
@@ -875,10 +948,10 @@ index a82b891..7285adb 100644
if (rps->vce_active) {
rps->evclk = rdev->pm.dpm.vce_states[rdev->pm.dpm.vce_level].evclk;
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
-index 62c7b1d..73e41a8 100644
+index 200419d..18a2acb 100644
--- a/drivers/gpu/drm/udl/udl_fb.c
+++ b/drivers/gpu/drm/udl/udl_fb.c
-@@ -539,7 +539,7 @@ static int udlfb_create(struct drm_fb_helper *helper,
+@@ -538,7 +538,7 @@ static int udlfb_create(struct drm_fb_helper *helper,
out_destroy_fbi:
drm_fb_helper_release_fbi(helper);
out_gfree:
@@ -901,7 +974,7 @@ index 2a0a784..d7528e0 100644
return 0;
}
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
-index 5dd426f..0df32fe 100644
+index ad71160..ae83af6 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -951,14 +951,6 @@ static int usbhid_output_report(struct hid_device *hid, __u8 *buf, size_t count)
@@ -1029,10 +1102,10 @@ index 5dd426f..0df32fe 100644
if (status >= 0 && hid->driver && hid->driver->reset_resume) {
int ret = hid->driver->reset_resume(hid);
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
-index 01a4f05..3c0f47a 100644
+index 99ef77f..94a8875 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
-@@ -2493,6 +2493,17 @@ void wacom_setup_device_quirks(struct wacom *wacom)
+@@ -2409,6 +2409,17 @@ void wacom_setup_device_quirks(struct wacom *wacom)
}
/*
@@ -1075,7 +1148,7 @@ index 36544c4..303d0c9 100644
sysfs_remove_group(&spi->dev.kobj, &max1110_attr_group);
sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group);
diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
-index 2d33f1e..291c61a 100644
+index c73331f7..2072a31 100644
--- a/drivers/iio/accel/bmc150-accel-core.c
+++ b/drivers/iio/accel/bmc150-accel-core.c
@@ -547,7 +547,7 @@ static int bmc150_accel_get_axis(struct bmc150_accel_data *data,
@@ -1113,7 +1186,7 @@ index 2d33f1e..291c61a 100644
.event_spec = &bmc150_accel_event, \
.num_event_specs = 1 \
diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c
-index 02ff789..acb3b30 100644
+index bbce3b0..4dac567 100644
--- a/drivers/iio/gyro/bmg160_core.c
+++ b/drivers/iio/gyro/bmg160_core.c
@@ -452,7 +452,7 @@ static int bmg160_get_temp(struct bmg160_data *data, int *val)
@@ -1160,6 +1233,18 @@ index 02ff789..acb3b30 100644
}
mutex_unlock(&data->mutex);
+diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
+index 139ae91..5b6abc5 100644
+--- a/drivers/iio/industrialio-buffer.c
++++ b/drivers/iio/industrialio-buffer.c
+@@ -645,6 +645,7 @@ static int iio_verify_update(struct iio_dev *indio_dev,
+ unsigned int modes;
+
+ memset(config, 0, sizeof(*config));
++ config->watermark = ~0;
+
+ /*
+ * If there is just one buffer and we are removing it there is nothing
diff --git a/drivers/iio/magnetometer/st_magn.h b/drivers/iio/magnetometer/st_magn.h
index 06a4d9c..9daca46 100644
--- a/drivers/iio/magnetometer/st_magn.h
@@ -1187,10 +1272,10 @@ index 0e3b009..515bb8b 100644
ret = iommu_group_add_device(group, dev);
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
-index 15516a6..323aad3 100644
+index 2d782ce..7ae89c6 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
-@@ -2119,14 +2119,12 @@ static int coda_probe(struct platform_device *pdev)
+@@ -2118,14 +2118,12 @@ static int coda_probe(struct platform_device *pdev)
pdev_id = of_id ? of_id->data : platform_get_device_id(pdev);
@@ -1222,10 +1307,10 @@ index 6310aca..d41ae95 100644
vsp1_sru_write(sru, VI6_SRU_CTRL1, VI6_SRU_CTRL1_PARAM5);
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
-index 0934024..d91ded7 100644
+index 9e29e70..d898880 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
-@@ -159,7 +159,7 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
+@@ -192,7 +192,7 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
Set the status so poll routines can check and avoid
access after disconnect.
*/
@@ -1257,7 +1342,7 @@ index b0f0679..3d6687f 100644
au8522_rc_clear(ir, 0xe0, 1 << 4);
}
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
-index 45c622e..7b2fe1b 100644
+index a136257..8bc69af 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -104,14 +104,13 @@ static inline void print_err_status(struct au0828_dev *dev,
@@ -1289,7 +1374,7 @@ index 45c622e..7b2fe1b 100644
return 0;
if (urb->status < 0) {
-@@ -766,10 +765,10 @@ static int au0828_stream_interrupt(struct au0828_dev *dev)
+@@ -822,10 +821,10 @@ static int au0828_stream_interrupt(struct au0828_dev *dev)
int ret = 0;
dev->stream_state = STREAM_INTERRUPT;
@@ -1302,7 +1387,7 @@ index 45c622e..7b2fe1b 100644
dprintk(1, "%s device is misconfigured!\n", __func__);
return ret;
}
-@@ -958,7 +957,7 @@ static int au0828_v4l2_open(struct file *filp)
+@@ -1014,7 +1013,7 @@ static int au0828_v4l2_open(struct file *filp)
int ret;
dprintk(1,
@@ -1311,7 +1396,7 @@ index 45c622e..7b2fe1b 100644
__func__, dev->std_set_in_tuner_core, dev->dev_state,
dev->streaming_users, dev->users);
-@@ -977,7 +976,7 @@ static int au0828_v4l2_open(struct file *filp)
+@@ -1033,7 +1032,7 @@ static int au0828_v4l2_open(struct file *filp)
au0828_analog_stream_enable(dev);
au0828_analog_stream_reset(dev);
dev->stream_state = STREAM_OFF;
@@ -1320,7 +1405,7 @@ index 45c622e..7b2fe1b 100644
}
dev->users++;
mutex_unlock(&dev->lock);
-@@ -991,7 +990,7 @@ static int au0828_v4l2_close(struct file *filp)
+@@ -1047,7 +1046,7 @@ static int au0828_v4l2_close(struct file *filp)
struct video_device *vdev = video_devdata(filp);
dprintk(1,
@@ -1329,7 +1414,7 @@ index 45c622e..7b2fe1b 100644
__func__, dev->std_set_in_tuner_core, dev->dev_state,
dev->streaming_users, dev->users);
-@@ -1007,7 +1006,7 @@ static int au0828_v4l2_close(struct file *filp)
+@@ -1063,7 +1062,7 @@ static int au0828_v4l2_close(struct file *filp)
del_timer_sync(&dev->vbi_timeout);
}
@@ -1338,7 +1423,7 @@ index 45c622e..7b2fe1b 100644
goto end;
if (dev->users == 1) {
-@@ -1036,7 +1035,7 @@ static void au0828_init_tuner(struct au0828_dev *dev)
+@@ -1092,7 +1091,7 @@ static void au0828_init_tuner(struct au0828_dev *dev)
.type = V4L2_TUNER_ANALOG_TV,
};
@@ -1347,7 +1432,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
if (dev->std_set_in_tuner_core)
-@@ -1108,7 +1107,7 @@ static int vidioc_querycap(struct file *file, void *priv,
+@@ -1164,7 +1163,7 @@ static int vidioc_querycap(struct file *file, void *priv,
struct video_device *vdev = video_devdata(file);
struct au0828_dev *dev = video_drvdata(file);
@@ -1356,7 +1441,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
strlcpy(cap->driver, "au0828", sizeof(cap->driver));
-@@ -1151,7 +1150,7 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
+@@ -1207,7 +1206,7 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
{
struct au0828_dev *dev = video_drvdata(file);
@@ -1365,7 +1450,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
f->fmt.pix.width = dev->width;
-@@ -1170,7 +1169,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
+@@ -1226,7 +1225,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
{
struct au0828_dev *dev = video_drvdata(file);
@@ -1374,7 +1459,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
return au0828_set_format(dev, VIDIOC_TRY_FMT, f);
-@@ -1182,7 +1181,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
+@@ -1238,7 +1237,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
struct au0828_dev *dev = video_drvdata(file);
int rc;
@@ -1383,7 +1468,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
rc = check_dev(dev);
-@@ -1204,7 +1203,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
+@@ -1260,7 +1259,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
{
struct au0828_dev *dev = video_drvdata(file);
@@ -1392,7 +1477,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
if (norm == dev->std)
-@@ -1236,7 +1235,7 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm)
+@@ -1292,7 +1291,7 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm)
{
struct au0828_dev *dev = video_drvdata(file);
@@ -1401,7 +1486,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
*norm = dev->std;
-@@ -1259,7 +1258,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
+@@ -1315,7 +1314,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
[AU0828_VMUX_DEBUG] = "tv debug"
};
@@ -1410,7 +1495,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
tmp = input->index;
-@@ -1289,7 +1288,7 @@ static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
+@@ -1345,7 +1344,7 @@ static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
{
struct au0828_dev *dev = video_drvdata(file);
@@ -1419,7 +1504,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
*i = dev->ctrl_input;
-@@ -1300,7 +1299,7 @@ static void au0828_s_input(struct au0828_dev *dev, int index)
+@@ -1356,7 +1355,7 @@ static void au0828_s_input(struct au0828_dev *dev, int index)
{
int i;
@@ -1428,7 +1513,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
switch (AUVI_INPUT(index).type) {
-@@ -1385,7 +1384,7 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
+@@ -1441,7 +1440,7 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
{
struct au0828_dev *dev = video_drvdata(file);
@@ -1437,7 +1522,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
a->index = dev->ctrl_ainput;
-@@ -1405,7 +1404,7 @@ static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio
+@@ -1461,7 +1460,7 @@ static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio
if (a->index != dev->ctrl_ainput)
return -EINVAL;
@@ -1446,7 +1531,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
return 0;
}
-@@ -1417,7 +1416,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
+@@ -1473,7 +1472,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
if (t->index != 0)
return -EINVAL;
@@ -1455,7 +1540,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
strcpy(t->name, "Auvitek tuner");
-@@ -1437,7 +1436,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
+@@ -1493,7 +1492,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
if (t->index != 0)
return -EINVAL;
@@ -1464,7 +1549,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
au0828_init_tuner(dev);
-@@ -1459,7 +1458,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
+@@ -1515,7 +1514,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
if (freq->tuner != 0)
return -EINVAL;
@@ -1473,7 +1558,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
freq->frequency = dev->ctrl_freq;
return 0;
-@@ -1474,7 +1473,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
+@@ -1530,7 +1529,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
if (freq->tuner != 0)
return -EINVAL;
@@ -1482,7 +1567,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
au0828_init_tuner(dev);
-@@ -1500,7 +1499,7 @@ static int vidioc_g_fmt_vbi_cap(struct file *file, void *priv,
+@@ -1556,7 +1555,7 @@ static int vidioc_g_fmt_vbi_cap(struct file *file, void *priv,
{
struct au0828_dev *dev = video_drvdata(file);
@@ -1491,7 +1576,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
format->fmt.vbi.samples_per_line = dev->vbi_width;
-@@ -1526,7 +1525,7 @@ static int vidioc_cropcap(struct file *file, void *priv,
+@@ -1582,7 +1581,7 @@ static int vidioc_cropcap(struct file *file, void *priv,
if (cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
@@ -1500,7 +1585,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
cc->bounds.left = 0;
-@@ -1548,7 +1547,7 @@ static int vidioc_g_register(struct file *file, void *priv,
+@@ -1604,7 +1603,7 @@ static int vidioc_g_register(struct file *file, void *priv,
{
struct au0828_dev *dev = video_drvdata(file);
@@ -1509,7 +1594,7 @@ index 45c622e..7b2fe1b 100644
dev->std_set_in_tuner_core, dev->dev_state);
reg->val = au0828_read(dev, reg->reg);
-@@ -1561,7 +1560,7 @@ static int vidioc_s_register(struct file *file, void *priv,
+@@ -1617,7 +1616,7 @@ static int vidioc_s_register(struct file *file, void *priv,
{
struct au0828_dev *dev = video_drvdata(file);
@@ -1519,7 +1604,7 @@ index 45c622e..7b2fe1b 100644
return au0828_writereg(dev, reg->reg, reg->val);
diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h
-index 60b5939..d1b6405a 100644
+index 8276072..b28a05d 100644
--- a/drivers/media/usb/au0828/au0828.h
+++ b/drivers/media/usb/au0828/au0828.h
@@ -21,6 +21,7 @@
@@ -1552,37 +1637,8 @@ index 60b5939..d1b6405a 100644
enum au0828_stream_state stream_state;
wait_queue_head_t open;
-diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
-index b693206..d1dc1a1 100644
---- a/drivers/media/usb/usbvision/usbvision-video.c
-+++ b/drivers/media/usb/usbvision/usbvision-video.c
-@@ -1463,9 +1463,23 @@ static int usbvision_probe(struct usb_interface *intf,
-
- if (usbvision_device_data[model].interface >= 0)
- interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0];
-- else
-+ else if (ifnum < dev->actconfig->desc.bNumInterfaces)
- interface = &dev->actconfig->interface[ifnum]->altsetting[0];
-+ else {
-+ dev_err(&intf->dev, "interface %d is invalid, max is %d\n",
-+ ifnum, dev->actconfig->desc.bNumInterfaces - 1);
-+ ret = -ENODEV;
-+ goto err_usb;
-+ }
-+
-+ if (interface->desc.bNumEndpoints < 2) {
-+ dev_err(&intf->dev, "interface %d has %d endpoints, but must"
-+ " have minimum 2\n", ifnum, interface->desc.bNumEndpoints);
-+ ret = -ENODEV;
-+ goto err_usb;
-+ }
- endpoint = &interface->endpoint[1].desc;
-+
- if (!usb_endpoint_xfer_isoc(endpoint)) {
- dev_err(&intf->dev, "%s: interface %d. has non-ISO endpoint!\n",
- __func__, ifnum);
diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
-index 45ee07d..6101548 100644
+index df3b8ec..a04d0f7 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -390,6 +390,7 @@ static int byt_sd_probe_slot(struct sdhci_pci_slot *slot)
@@ -1638,11 +1694,142 @@ index d1a0b4d..89e7151 100644
#define PCI_DEVICE_ID_INTEL_APL_SD 0x5aca
#define PCI_DEVICE_ID_INTEL_APL_EMMC 0x5acc
#define PCI_DEVICE_ID_INTEL_APL_SDIO 0x5ad0
+diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
+index c7f27fe..452bf500 100644
+--- a/drivers/mmc/host/sdhci-pxav3.c
++++ b/drivers/mmc/host/sdhci-pxav3.c
+@@ -309,8 +309,30 @@ static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
+ __func__, uhs, ctrl_2);
+ }
+
++static void pxav3_set_power(struct sdhci_host *host, unsigned char mode,
++ unsigned short vdd)
++{
++ struct mmc_host *mmc = host->mmc;
++ u8 pwr = host->pwr;
++
++ sdhci_set_power(host, mode, vdd);
++
++ if (host->pwr == pwr)
++ return;
++
++ if (host->pwr == 0)
++ vdd = 0;
++
++ if (!IS_ERR(mmc->supply.vmmc)) {
++ spin_unlock_irq(&host->lock);
++ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
++ spin_lock_irq(&host->lock);
++ }
++}
++
+ static const struct sdhci_ops pxav3_sdhci_ops = {
+ .set_clock = sdhci_set_clock,
++ .set_power = pxav3_set_power,
+ .platform_send_init_74_clocks = pxav3_gen_init_74_clocks,
+ .get_max_clock = sdhci_pltfm_clk_get_max_clock,
+ .set_bus_width = sdhci_set_bus_width,
+diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
+index 8059d72..6d485b5 100644
+--- a/drivers/mmc/host/sdhci.c
++++ b/drivers/mmc/host/sdhci.c
+@@ -1250,10 +1250,24 @@ clock_set:
+ }
+ EXPORT_SYMBOL_GPL(sdhci_set_clock);
+
+-static void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
+- unsigned short vdd)
++static void sdhci_set_power_reg(struct sdhci_host *host, unsigned char mode,
++ unsigned short vdd)
+ {
+ struct mmc_host *mmc = host->mmc;
++
++ spin_unlock_irq(&host->lock);
++ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
++ spin_lock_irq(&host->lock);
++
++ if (mode != MMC_POWER_OFF)
++ sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL);
++ else
++ sdhci_writeb(host, 0, SDHCI_POWER_CONTROL);
++}
++
++void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
++ unsigned short vdd)
++{
+ u8 pwr = 0;
+
+ if (mode != MMC_POWER_OFF) {
+@@ -1285,7 +1299,6 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
+ sdhci_writeb(host, 0, SDHCI_POWER_CONTROL);
+ if (host->quirks2 & SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON)
+ sdhci_runtime_pm_bus_off(host);
+- vdd = 0;
+ } else {
+ /*
+ * Spec says that we should clear the power reg before setting
+@@ -1316,12 +1329,20 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
+ if (host->quirks & SDHCI_QUIRK_DELAY_AFTER_POWER)
+ mdelay(10);
+ }
++}
++EXPORT_SYMBOL_GPL(sdhci_set_power);
+
+- if (!IS_ERR(mmc->supply.vmmc)) {
+- spin_unlock_irq(&host->lock);
+- mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
+- spin_lock_irq(&host->lock);
+- }
++static void __sdhci_set_power(struct sdhci_host *host, unsigned char mode,
++ unsigned short vdd)
++{
++ struct mmc_host *mmc = host->mmc;
++
++ if (host->ops->set_power)
++ host->ops->set_power(host, mode, vdd);
++ else if (!IS_ERR(mmc->supply.vmmc))
++ sdhci_set_power_reg(host, mode, vdd);
++ else
++ sdhci_set_power(host, mode, vdd);
+ }
+
+ /*****************************************************************************\
+@@ -1471,7 +1492,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
+ }
+ }
+
+- sdhci_set_power(host, ios->power_mode, ios->vdd);
++ __sdhci_set_power(host, ios->power_mode, ios->vdd);
+
+ if (host->ops->platform_send_init_74_clocks)
+ host->ops->platform_send_init_74_clocks(host, ios->power_mode);
+diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
+index 0115e99..033d72b 100644
+--- a/drivers/mmc/host/sdhci.h
++++ b/drivers/mmc/host/sdhci.h
+@@ -529,6 +529,8 @@ struct sdhci_ops {
+ #endif
+
+ void (*set_clock)(struct sdhci_host *host, unsigned int clock);
++ void (*set_power)(struct sdhci_host *host, unsigned char mode,
++ unsigned short vdd);
+
+ int (*enable_dma)(struct sdhci_host *host);
+ unsigned int (*get_max_clock)(struct sdhci_host *host);
+@@ -660,6 +662,8 @@ static inline bool sdhci_sdio_irq_enabled(struct sdhci_host *host)
+ }
+
+ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock);
++void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
++ unsigned short vdd);
+ void sdhci_set_bus_width(struct sdhci_host *host, int width);
+ void sdhci_reset(struct sdhci_host *host, u8 mask);
+ void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing);
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
-index 28bbca0..b3d70a7 100644
+index b7f1a99..5ec8195 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
-@@ -3260,6 +3260,30 @@ static int bond_close(struct net_device *bond_dev)
+@@ -3308,6 +3308,30 @@ static int bond_close(struct net_device *bond_dev)
return 0;
}
@@ -1673,7 +1860,7 @@ index 28bbca0..b3d70a7 100644
static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
struct rtnl_link_stats64 *stats)
{
-@@ -3268,43 +3292,23 @@ static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
+@@ -3316,43 +3340,23 @@ static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
struct list_head *iter;
struct slave *slave;
@@ -1727,7 +1914,7 @@ index 28bbca0..b3d70a7 100644
return stats;
}
-@@ -4118,6 +4122,7 @@ void bond_setup(struct net_device *bond_dev)
+@@ -4166,6 +4170,7 @@ void bond_setup(struct net_device *bond_dev)
struct bonding *bond = netdev_priv(bond_dev);
spin_lock_init(&bond->mode_lock);
@@ -1736,7 +1923,7 @@ index 28bbca0..b3d70a7 100644
/* Initialize pointers */
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
-index 17f017a..0fb3f8d 100644
+index d7e01a7..6746fd0 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -1197,7 +1197,7 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev,
@@ -1757,31 +1944,46 @@ index 17f017a..0fb3f8d 100644
length_status = (skb_len << DMA_BUFLENGTH_SHIFT) | dma_desc_flags |
(priv->hw_params->qtag_mask << DMA_TX_QTAG_SHIFT) |
DMA_TX_APPEND_CRC;
-diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
-index 060dd39..973dade 100644
---- a/drivers/net/ethernet/jme.c
-+++ b/drivers/net/ethernet/jme.c
-@@ -3312,13 +3312,14 @@ jme_resume(struct device *dev)
- jme_reset_phy_processor(jme);
- jme_phy_calibration(jme);
- jme_phy_setEA(jme);
-- jme_start_irq(jme);
- netif_device_attach(netdev);
-
- atomic_inc(&jme->link_changing);
-
- jme_reset_link(jme);
-
-+ jme_start_irq(jme);
+diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
+index acb1c5b..2ee05ce 100644
+--- a/drivers/net/ethernet/marvell/mvneta.c
++++ b/drivers/net/ethernet/marvell/mvneta.c
+@@ -3070,17 +3070,17 @@ static int mvneta_stop(struct net_device *dev)
+ struct mvneta_port *pp = netdev_priv(dev);
+
+ /* Inform that we are stopping so we don't want to setup the
+- * driver for new CPUs in the notifiers
++ * driver for new CPUs in the notifiers. The code of the
++ * notifier for CPU online is protected by the same spinlock,
++ * so when we get the lock, the notifer work is done.
+ */
+ spin_lock(&pp->lock);
+ pp->is_stopped = true;
++ spin_unlock(&pp->lock);
+
- return 0;
- }
+ mvneta_stop_dev(pp);
+ mvneta_mdio_remove(pp);
+ unregister_cpu_notifier(&pp->cpu_notifier);
+- /* Now that the notifier are unregistered, we can release le
+- * lock
+- */
+- spin_unlock(&pp->lock);
+ on_each_cpu(mvneta_percpu_disable, pp, true);
+ free_percpu_irq(dev->irq, pp->ports);
+ mvneta_cleanup_rxqs(pp);
+@@ -3612,6 +3612,7 @@ static int mvneta_probe(struct platform_device *pdev)
+ dev->ethtool_ops = &mvneta_eth_tool_ops;
+
+ pp = netdev_priv(dev);
++ spin_lock_init(&pp->lock);
+ pp->phy_node = phy_node;
+ pp->phy_interface = phy_mode;
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
-index cad6c44..d314d96 100644
+index 25ce1b0..cd9b2b2 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
-@@ -3132,7 +3132,7 @@ static int verify_qp_parameters(struct mlx4_dev *dev,
+@@ -3141,7 +3141,7 @@ static int verify_qp_parameters(struct mlx4_dev *dev,
case QP_TRANS_RTS2RTS:
case QP_TRANS_SQD2SQD:
case QP_TRANS_SQD2RTS:
@@ -1790,7 +1992,7 @@ index cad6c44..d314d96 100644
if (optpar & MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH) {
port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1;
if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB)
-@@ -3151,6 +3151,7 @@ static int verify_qp_parameters(struct mlx4_dev *dev,
+@@ -3160,6 +3160,7 @@ static int verify_qp_parameters(struct mlx4_dev *dev,
if (qp_ctx->alt_path.mgid_index >= num_gids)
return -EINVAL;
}
@@ -1799,10 +2001,10 @@ index cad6c44..d314d96 100644
default:
break;
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
-index 4365c8b..605f641 100644
+index 3b89ed2..65a115f 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
-@@ -61,6 +61,8 @@ struct mlxsw_sp {
+@@ -118,6 +118,8 @@ struct mlxsw_sp {
#define MLXSW_SP_DEFAULT_LEARNING_INTERVAL 100
unsigned int interval; /* ms */
} fdb_notify;
@@ -1810,12 +2012,12 @@ index 4365c8b..605f641 100644
+#define MLXSW_SP_MAX_AGEING_TIME 1000000
#define MLXSW_SP_DEFAULT_AGEING_TIME 300
u32 ageing_time;
- struct {
+ struct mlxsw_sp_upper master_bridge;
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
-index 7dbeafa..d4c4c2b 100644
+index 7b56098..e1c74ef 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
-@@ -232,8 +232,13 @@ static int mlxsw_sp_port_attr_br_ageing_set(struct mlxsw_sp_port *mlxsw_sp_port,
+@@ -311,8 +311,13 @@ static int mlxsw_sp_port_attr_br_ageing_set(struct mlxsw_sp_port *mlxsw_sp_port,
unsigned long ageing_jiffies = clock_t_to_jiffies(ageing_clock_t);
u32 ageing_time = jiffies_to_msecs(ageing_jiffies) / 1000;
@@ -1972,24 +2174,11 @@ index 9979764..b28e73e 100644
skb = new_skb;
/* Frame error, so drop the packet. */
-diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
-index 689a4a5..1ef0393 100644
---- a/drivers/net/ethernet/qualcomm/qca_spi.c
-+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
-@@ -811,7 +811,7 @@ qcaspi_netdev_setup(struct net_device *dev)
- dev->netdev_ops = &qcaspi_netdev_ops;
- qcaspi_set_ethtool_ops(dev);
- dev->watchdog_timeo = QCASPI_TX_TIMEOUT;
-- dev->flags = IFF_MULTICAST;
-+ dev->priv_flags &= ~IFF_TX_SKB_SHARING;
- dev->tx_queue_len = 100;
-
- qca = netdev_priv(dev);
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 6a8fc0f..36fc942 100644
+index 7384499..01f6d5b 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -1185,11 +1185,8 @@ static void sh_eth_ring_format(struct net_device *ndev)
+@@ -1136,11 +1136,8 @@ static void sh_eth_ring_format(struct net_device *ndev)
break;
sh_eth_set_receive_align(skb);
@@ -1997,33 +2186,33 @@ index 6a8fc0f..36fc942 100644
- rxdesc = &mdp->rx_ring[i];
/* The size of the buffer is a multiple of 32 bytes. */
buf_len = ALIGN(mdp->rx_buf_sz, 32);
-- rxdesc->len = cpu_to_edmac(mdp, buf_len << 16);
+- rxdesc->len = cpu_to_le32(buf_len << 16);
dma_addr = dma_map_single(&ndev->dev, skb->data, buf_len,
DMA_FROM_DEVICE);
if (dma_mapping_error(&ndev->dev, dma_addr)) {
-@@ -1197,6 +1194,10 @@ static void sh_eth_ring_format(struct net_device *ndev)
+@@ -1148,6 +1145,10 @@ static void sh_eth_ring_format(struct net_device *ndev)
break;
}
mdp->rx_skbuff[i] = skb;
+
+ /* RX descriptor */
+ rxdesc = &mdp->rx_ring[i];
-+ rxdesc->len = cpu_to_edmac(mdp, buf_len << 16);
- rxdesc->addr = cpu_to_edmac(mdp, dma_addr);
- rxdesc->status = cpu_to_edmac(mdp, RD_RACT | RD_RFP);
++ rxdesc->len = cpu_to_le32(buf_len << 16);
+ rxdesc->addr = cpu_to_le32(dma_addr);
+ rxdesc->status = cpu_to_le32(RD_RACT | RD_RFP);
-@@ -1212,7 +1213,8 @@ static void sh_eth_ring_format(struct net_device *ndev)
+@@ -1163,7 +1164,8 @@ static void sh_eth_ring_format(struct net_device *ndev)
mdp->dirty_rx = (u32) (i - mdp->num_rx_ring);
/* Mark the last entry as wrapping the ring. */
-- rxdesc->status |= cpu_to_edmac(mdp, RD_RDLE);
+- rxdesc->status |= cpu_to_le32(RD_RDLE);
+ if (rxdesc)
-+ rxdesc->status |= cpu_to_edmac(mdp, RD_RDLE);
++ rxdesc->status |= cpu_to_le32(RD_RDLE);
memset(mdp->tx_ring, 0, tx_ringsize);
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
-index 52ec3d6..2b34622 100644
+index 166a7fc..f39e719 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -239,6 +239,7 @@ struct rocker {
@@ -2071,7 +2260,7 @@ index 52ec3d6..2b34622 100644
if (err) {
dev_err(&pdev->dev, "failed to probe ports\n");
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
-index 0fc5219..159a687 100644
+index d636d05..95394ed 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -760,6 +760,8 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
@@ -2099,10 +2288,10 @@ index 0fc5219..159a687 100644
skb = macvtap_alloc_skb(&q->sk, MACVTAP_RESERVE, copylen,
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
-index 9a863c6..174e06e 100644
+index d61da9ec..aafe237 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
-@@ -567,7 +567,7 @@ static int get_filter(void __user *arg, struct sock_filter **p)
+@@ -575,7 +575,7 @@ static int get_filter(void __user *arg, struct sock_filter **p)
static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
@@ -2111,7 +2300,7 @@ index 9a863c6..174e06e 100644
struct ppp *ppp;
int err = -EFAULT, val, val2, i;
struct ppp_idle idle;
-@@ -577,9 +577,14 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+@@ -585,9 +585,14 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
void __user *argp = (void __user *)arg;
int __user *p = argp;
@@ -2129,7 +2318,7 @@ index 9a863c6..174e06e 100644
if (cmd == PPPIOCDETACH) {
/*
-@@ -594,7 +599,6 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+@@ -602,7 +607,6 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
* this fd and reopening /dev/ppp.
*/
err = -EINVAL;
@@ -2137,7 +2326,7 @@ index 9a863c6..174e06e 100644
if (pf->kind == INTERFACE) {
ppp = PF_TO_PPP(pf);
rtnl_lock();
-@@ -608,15 +612,13 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+@@ -616,15 +620,13 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
} else
pr_warn("PPPIOCDETACH file->f_count=%ld\n",
atomic_long_read(&file->f_count));
@@ -2154,7 +2343,7 @@ index 9a863c6..174e06e 100644
pch = PF_TO_CHANNEL(pf);
switch (cmd) {
-@@ -638,17 +640,16 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+@@ -646,17 +648,16 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
err = chan->ops->ioctl(chan, cmd, arg);
up_read(&pch->chan_sem);
}
@@ -2175,7 +2364,7 @@ index 9a863c6..174e06e 100644
ppp = PF_TO_PPP(pf);
switch (cmd) {
case PPPIOCSMRU:
-@@ -823,7 +824,10 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+@@ -831,7 +832,10 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
default:
err = -ENOTTY;
}
@@ -2186,7 +2375,7 @@ index 9a863c6..174e06e 100644
return err;
}
-@@ -836,7 +840,6 @@ static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf,
+@@ -844,7 +848,6 @@ static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf,
struct ppp_net *pn;
int __user *p = (int __user *)arg;
@@ -2194,7 +2383,7 @@ index 9a863c6..174e06e 100644
switch (cmd) {
case PPPIOCNEWUNIT:
/* Create a new ppp unit */
-@@ -886,7 +889,7 @@ static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf,
+@@ -894,7 +897,7 @@ static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf,
default:
err = -ENOTTY;
}
@@ -2203,7 +2392,7 @@ index 9a863c6..174e06e 100644
return err;
}
-@@ -2290,7 +2293,7 @@ int ppp_register_net_channel(struct net *net, struct ppp_channel *chan)
+@@ -2304,7 +2307,7 @@ int ppp_register_net_channel(struct net *net, struct ppp_channel *chan)
pch->ppp = NULL;
pch->chan = chan;
@@ -2212,7 +2401,7 @@ index 9a863c6..174e06e 100644
chan->ppp = pch;
init_ppp_file(&pch->file, CHANNEL);
pch->file.hdrlen = chan->hdrlen;
-@@ -2387,6 +2390,8 @@ ppp_unregister_channel(struct ppp_channel *chan)
+@@ -2401,6 +2404,8 @@ ppp_unregister_channel(struct ppp_channel *chan)
spin_lock_bh(&pn->all_channels_lock);
list_del(&pch->list);
spin_unlock_bh(&pn->all_channels_lock);
@@ -2221,16 +2410,8 @@ index 9a863c6..174e06e 100644
pch->file.dead = 1;
wake_up_interruptible(&pch->file.rwait);
-@@ -2803,6 +2808,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,
-
- out2:
- mutex_unlock(&pn->all_ppp_mutex);
-+ rtnl_unlock();
- free_netdev(dev);
- out1:
- *retp = ret;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
-index f0db770..2d186bd 100644
+index 88bb8cc..81ecc2e 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -621,7 +621,8 @@ static int tun_attach(struct tun_struct *tun, struct file *file, bool skip_filte
@@ -2259,7 +2440,7 @@ index f0db770..2d186bd 100644
break;
}
}
-@@ -1463,6 +1462,8 @@ static void tun_setup(struct net_device *dev)
+@@ -1466,6 +1465,8 @@ static void tun_setup(struct net_device *dev)
dev->ethtool_ops = &tun_ethtool_ops;
dev->destructor = tun_free_netdev;
@@ -2268,7 +2449,7 @@ index f0db770..2d186bd 100644
}
/* Trivial set of netlink ops to allow deleting tun or tap
-@@ -1804,7 +1805,7 @@ static void tun_detach_filter(struct tun_struct *tun, int n)
+@@ -1807,7 +1808,7 @@ static void tun_detach_filter(struct tun_struct *tun, int n)
for (i = 0; i < n; i++) {
tfile = rtnl_dereference(tun->tfiles[i]);
@@ -2277,7 +2458,7 @@ index f0db770..2d186bd 100644
}
tun->filter_attached = false;
-@@ -1817,7 +1818,8 @@ static int tun_attach_filter(struct tun_struct *tun)
+@@ -1820,7 +1821,8 @@ static int tun_attach_filter(struct tun_struct *tun)
for (i = 0; i < tun->numqueues; i++) {
tfile = rtnl_dereference(tun->tfiles[i]);
@@ -2287,54 +2468,11 @@ index f0db770..2d186bd 100644
if (ret) {
tun_detach_filter(tun, i);
return ret;
-diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
-index 3da70bf..7cba2c3 100644
---- a/drivers/net/usb/cdc_ether.c
-+++ b/drivers/net/usb/cdc_ether.c
-@@ -160,6 +160,12 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
- info->u = header.usb_cdc_union_desc;
- info->header = header.usb_cdc_header_desc;
- info->ether = header.usb_cdc_ether_desc;
-+ if (!info->u) {
-+ if (rndis)
-+ goto skip;
-+ else /* in that case a quirk is mandatory */
-+ goto bad_desc;
-+ }
- /* we need a master/control interface (what we're
- * probed with) and a slave/data interface; union
- * descriptors sort this all out.
-@@ -256,7 +262,7 @@ skip:
- goto bad_desc;
- }
-
-- } else if (!info->header || !info->u || (!rndis && !info->ether)) {
-+ } else if (!info->header || (!rndis && !info->ether)) {
- dev_dbg(&intf->dev, "missing cdc %s%s%sdescriptor\n",
- info->header ? "" : "header ",
- info->u ? "" : "union ",
-diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
-index e8a1144..8c2bb77 100644
---- a/drivers/net/usb/cdc_ncm.c
-+++ b/drivers/net/usb/cdc_ncm.c
-@@ -794,7 +794,11 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
-
- iface_no = ctx->data->cur_altsetting->desc.bInterfaceNumber;
-
-- /* reset data interface */
-+ /* Reset data interface. Some devices will not reset properly
-+ * unless they are configured first. Toggle the altsetting to
-+ * force a reset
-+ */
-+ usb_set_interface(dev->udev, iface_no, data_altsetting);
- temp = usb_set_interface(dev->udev, iface_no, 0);
- if (temp) {
- dev_dbg(&intf->dev, "set interface failed\n");
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
-index 982e0acd..a34f491 100644
+index a3a4ccf..1232a8c6 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
-@@ -699,6 +699,7 @@ static const struct usb_device_id products[] = {
+@@ -844,6 +844,7 @@ static const struct usb_device_id products[] = {
{QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */
{QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */
{QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */
@@ -2342,86 +2480,6 @@ index 982e0acd..a34f491 100644
{QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
{QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */
{QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
-@@ -718,8 +719,10 @@ static const struct usb_device_id products[] = {
- {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */
- {QMI_FIXED_INTF(0x1199, 0x9070, 8)}, /* Sierra Wireless MC74xx/EM74xx */
- {QMI_FIXED_INTF(0x1199, 0x9070, 10)}, /* Sierra Wireless MC74xx/EM74xx */
-- {QMI_FIXED_INTF(0x1199, 0x9071, 8)}, /* Sierra Wireless MC74xx/EM74xx */
-- {QMI_FIXED_INTF(0x1199, 0x9071, 10)}, /* Sierra Wireless MC74xx/EM74xx */
-+ {QMI_FIXED_INTF(0x1199, 0x9071, 8)}, /* Sierra Wireless MC74xx */
-+ {QMI_FIXED_INTF(0x1199, 0x9071, 10)}, /* Sierra Wireless MC74xx */
-+ {QMI_FIXED_INTF(0x1199, 0x9079, 8)}, /* Sierra Wireless EM74xx */
-+ {QMI_FIXED_INTF(0x1199, 0x9079, 10)}, /* Sierra Wireless EM74xx */
- {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
- {QMI_FIXED_INTF(0x1bbb, 0x0203, 2)}, /* Alcatel L800MA */
- {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
-diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
-index 0744bf2..c2ea4e5 100644
---- a/drivers/net/usb/usbnet.c
-+++ b/drivers/net/usb/usbnet.c
-@@ -1766,6 +1766,13 @@ out3:
- if (info->unbind)
- info->unbind (dev, udev);
- out1:
-+ /* subdrivers must undo all they did in bind() if they
-+ * fail it, but we may fail later and a deferred kevent
-+ * may trigger an error resubmitting itself and, worse,
-+ * schedule a timer. So we kill it all just in case.
-+ */
-+ cancel_work_sync(&dev->kevent);
-+ del_timer_sync(&dev->delay);
- free_netdev(net);
- out:
- return status;
-diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
-index 0a242b2..903bda4 100644
---- a/drivers/net/vrf.c
-+++ b/drivers/net/vrf.c
-@@ -114,20 +114,23 @@ static struct dst_ops vrf_dst_ops = {
- #if IS_ENABLED(CONFIG_IPV6)
- static bool check_ipv6_frame(const struct sk_buff *skb)
- {
-- const struct ipv6hdr *ipv6h = (struct ipv6hdr *)skb->data;
-- size_t hlen = sizeof(*ipv6h);
-+ const struct ipv6hdr *ipv6h;
-+ struct ipv6hdr _ipv6h;
- bool rc = true;
-
-- if (skb->len < hlen)
-+ ipv6h = skb_header_pointer(skb, 0, sizeof(_ipv6h), &_ipv6h);
-+ if (!ipv6h)
- goto out;
-
- if (ipv6h->nexthdr == NEXTHDR_ICMP) {
- const struct icmp6hdr *icmph;
-+ struct icmp6hdr _icmph;
-
-- if (skb->len < hlen + sizeof(*icmph))
-+ icmph = skb_header_pointer(skb, sizeof(_ipv6h),
-+ sizeof(_icmph), &_icmph);
-+ if (!icmph)
- goto out;
-
-- icmph = (struct icmp6hdr *)(skb->data + sizeof(*ipv6h));
- switch (icmph->icmp6_type) {
- case NDISC_ROUTER_SOLICITATION:
- case NDISC_ROUTER_ADVERTISEMENT:
-diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
-index e0fcda4..3c0df70 100644
---- a/drivers/net/vxlan.c
-+++ b/drivers/net/vxlan.c
-@@ -1306,8 +1306,10 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
- gbp = (struct vxlanhdr_gbp *)vxh;
- md->gbp = ntohs(gbp->policy_id);
-
-- if (tun_dst)
-+ if (tun_dst) {
- tun_dst->u.tun_info.key.tun_flags |= TUNNEL_VXLAN_OPT;
-+ tun_dst->u.tun_info.options_len = sizeof(*md);
-+ }
-
- if (gbp->dont_learn)
- md->gbp |= VXLAN_GBP_DONT_LEARN;
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index 44541dbc..69b994f 100644
--- a/drivers/net/wan/farsync.c
@@ -2436,10 +2494,10 @@ index 44541dbc..69b994f 100644
dev->irq = card->irq;
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c
-index cc81482..113a43f 100644
+index 73fb423..a794157 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
-@@ -403,10 +403,9 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah,
+@@ -477,10 +477,9 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah,
if (match) {
if (AR_SREV_9287(ah)) {
@@ -2451,7 +2509,7 @@ index cc81482..113a43f 100644
ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
data_9287[idxL].pwrPdg[i],
data_9287[idxL].vpdPdg[i],
-@@ -416,7 +415,7 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah,
+@@ -490,7 +489,7 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah,
} else if (eeprom_4k) {
for (i = 0; i < numXpdGains; i++) {
minPwrT4[i] = data_4k[idxL].pwrPdg[i][0];
@@ -2460,7 +2518,7 @@ index cc81482..113a43f 100644
ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
data_4k[idxL].pwrPdg[i],
data_4k[idxL].vpdPdg[i],
-@@ -426,7 +425,7 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah,
+@@ -500,7 +499,7 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah,
} else {
for (i = 0; i < numXpdGains; i++) {
minPwrT4[i] = data_def[idxL].pwrPdg[i][0];
@@ -2470,7 +2528,7 @@ index cc81482..113a43f 100644
data_def[idxL].pwrPdg[i],
data_def[idxL].vpdPdg[i],
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
-index 496b9b6..5f47356 100644
+index 576eb70..cdbab06 100644
--- a/drivers/nvdimm/bus.c
+++ b/drivers/nvdimm/bus.c
@@ -335,7 +335,7 @@ static const struct nd_cmd_desc __nd_cmd_dimm_descs[] = {
@@ -2483,10 +2541,10 @@ index 496b9b6..5f47356 100644
[ND_CMD_SMART_THRESHOLD] = {
.out_num = 2,
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
-index 71805a1..9d39745 100644
+index ae81a2f..f0b56b3 100644
--- a/drivers/nvdimm/pfn_devs.c
+++ b/drivers/nvdimm/pfn_devs.c
-@@ -275,7 +275,7 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn)
+@@ -315,7 +315,7 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn)
} else {
/* from init we validate */
if (memcmp(nd_pfn->uuid, pfn_sb->uuid, 16) != 0)
@@ -2494,7 +2552,7 @@ index 71805a1..9d39745 100644
+ return -ENODEV;
}
- /*
+ if (nd_pfn->align > nvdimm_namespace_capacity(ndns)) {
diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index 4c2fa05..944674e 100644
--- a/drivers/pcmcia/db1xxx_ss.c
@@ -2566,10 +2624,10 @@ index a5bb939..1029aa7 100644
imx_pinctrl_desc.name = dev_name(&pdev->dev);
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
-index eebfae0..f844b4a 100644
+index 3524061..c8969dd 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
-@@ -995,7 +995,7 @@ static void nmk_gpio_dbg_show_one(struct seq_file *s,
+@@ -990,7 +990,7 @@ static void nmk_gpio_dbg_show_one(struct seq_file *s,
int val;
if (pull)
@@ -2579,7 +2637,7 @@ index eebfae0..f844b4a 100644
seq_printf(s, " gpio-%-3d (%-20.20s) in %s %s",
gpio,
diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c
-index 85c9046..6b1a47f 100644
+index 856f736..2673cd9 100644
--- a/drivers/pinctrl/pinctrl-pistachio.c
+++ b/drivers/pinctrl/pinctrl-pistachio.c
@@ -469,27 +469,27 @@ static const char * const pistachio_mips_pll_lock_groups[] = {
@@ -2676,7 +2734,7 @@ index 00265f0..8b381d6 100644
static int sun8i_a33_pinctrl_probe(struct platform_device *pdev)
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
-index dead97d..a4a5b50 100644
+index 7a2465f..884c2b3 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -578,7 +578,7 @@ static void sunxi_pinctrl_irq_release_resources(struct irq_data *d)
@@ -2808,8 +2866,23 @@ index e248e81..0afce1a 100644
}
static inline u32 sunxi_irq_status_offset(u16 irq)
+diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
+index b1bf42b..1deb6ad 100644
+--- a/drivers/scsi/scsi.c
++++ b/drivers/scsi/scsi.c
+@@ -784,8 +784,9 @@ void scsi_attach_vpd(struct scsi_device *sdev)
+ int pg83_supported = 0;
+ unsigned char __rcu *vpd_buf, *orig_vpd_buf = NULL;
+
+- if (sdev->skip_vpd_pages)
++ if (!scsi_device_supports_vpd(sdev))
+ return;
++
+ retry_pg0:
+ vpd_buf = kmalloc(vpd_len, GFP_KERNEL);
+ if (!vpd_buf)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
-index cc84ea7..0d7c6e8 100644
+index 5a5457a..974ca5b 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1275,18 +1275,19 @@ static int sd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
@@ -2853,10 +2926,27 @@ index cc84ea7..0d7c6e8 100644
blk_queue_physical_block_size(sdp->request_queue,
sdkp->physical_block_size);
sdkp->device->sector_size = sector_size;
-@@ -2812,11 +2805,6 @@ static int sd_try_extended_inquiry(struct scsi_device *sdp)
- return 0;
+@@ -2795,28 +2788,6 @@ static void sd_read_write_same(struct scsi_disk *sdkp, unsigned char *buffer)
+ sdkp->ws10 = 1;
}
+-static int sd_try_extended_inquiry(struct scsi_device *sdp)
+-{
+- /* Attempt VPD inquiry if the device blacklist explicitly calls
+- * for it.
+- */
+- if (sdp->try_vpd_pages)
+- return 1;
+- /*
+- * Although VPD inquiries can go to SCSI-2 type devices,
+- * some USB ones crash on receiving them, and the pages
+- * we currently ask for are for SPC-3 and beyond
+- */
+- if (sdp->scsi_level > SCSI_SPC_2 && !sdp->skip_vpd_pages)
+- return 1;
+- return 0;
+-}
+-
-static inline u32 logical_to_sectors(struct scsi_device *sdev, u32 blocks)
-{
- return blocks << (ilog2(sdev->sector_size) - 9);
@@ -2865,7 +2955,16 @@ index cc84ea7..0d7c6e8 100644
/**
* sd_revalidate_disk - called the first time a new disk is seen,
* performs disk spin up, read_capacity, etc.
-@@ -2900,7 +2888,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
+@@ -2856,7 +2827,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
+ if (sdkp->media_present) {
+ sd_read_capacity(sdkp, buffer);
+
+- if (sd_try_extended_inquiry(sdp)) {
++ if (scsi_device_supports_vpd(sdp)) {
+ sd_read_block_provisioning(sdkp);
+ sd_read_block_limits(sdkp);
+ sd_read_block_characteristics(sdkp);
+@@ -2900,7 +2871,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
/* Combine with controller limits */
q->limits.max_sectors = min(rw_max, queue_max_hw_sectors(q));
@@ -2915,32 +3014,6 @@ index e237e9f..df56021 100644
mutex_lock(&dev->buffer_lock);
ion_buffer_add(dev, buffer);
mutex_unlock(&dev->buffer_lock);
-diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
-index 2a27488..84df093 100644
---- a/drivers/usb/core/hub.c
-+++ b/drivers/usb/core/hub.c
-@@ -5392,6 +5392,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
- }
-
- bos = udev->bos;
-+ udev->bos = NULL;
-
- for (i = 0; i < SET_CONFIG_TRIES; ++i) {
-
-@@ -5484,11 +5485,8 @@ done:
- usb_set_usb2_hardware_lpm(udev, 1);
- usb_unlocked_enable_lpm(udev);
- usb_enable_ltm(udev);
-- /* release the new BOS descriptor allocated by hub_port_init() */
-- if (udev->bos != bos) {
-- usb_release_bos_descriptor(udev);
-- udev->bos = bos;
-- }
-+ usb_release_bos_descriptor(udev);
-+ udev->bos = bos;
- return 0;
-
- re_enumerate:
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index c0f5c65..f1893e0 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
@@ -2964,7 +3037,7 @@ index c0f5c65..f1893e0 100644
schedule_work(&pkt->work);
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
-index 8f7a78e..fa14198 100644
+index 657f967..2510535 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -158,10 +158,14 @@ static void usbhsg_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
@@ -2984,7 +3057,7 @@ index 8f7a78e..fa14198 100644
static void usbhsg_queue_push(struct usbhsg_uep *uep,
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
-index ce0cd6e..9baf081 100644
+index c90a7e4..e4ade8d 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -2,7 +2,7 @@
@@ -3085,7 +3158,7 @@ index 43576ed..9de988a 100644
f |= US_FL_NOT_LOCKABLE;
break;
diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
-index 8e5cf19..4469202 100644
+index 7760fc1..1f413a2 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -17,6 +17,7 @@
@@ -3162,10 +3235,10 @@ index 524c221..4436778 100644
}
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
-index 0f09526..5e5db36 100644
+index 098bb8f..9a30ca6 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
-@@ -1885,7 +1885,7 @@ static int start_ordered_ops(struct inode *inode, loff_t start, loff_t end)
+@@ -1883,7 +1883,7 @@ static int start_ordered_ops(struct inode *inode, loff_t start, loff_t end)
*/
int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
{
@@ -3175,10 +3248,10 @@ index 0f09526..5e5db36 100644
struct btrfs_root *root = BTRFS_I(inode)->root;
struct btrfs_trans_handle *trans;
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
-index 323e12c..0e044d7 100644
+index 978c3a8..849a30a 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
-@@ -4406,6 +4406,127 @@ static int btrfs_log_trailing_hole(struct btrfs_trans_handle *trans,
+@@ -4414,6 +4414,127 @@ static int btrfs_log_trailing_hole(struct btrfs_trans_handle *trans,
return ret;
}
@@ -3306,7 +3379,7 @@ index 323e12c..0e044d7 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.
-@@ -4578,6 +4699,22 @@ again:
+@@ -4586,6 +4707,22 @@ again:
if (min_key.type == BTRFS_INODE_ITEM_KEY)
need_log_inode_item = false;
@@ -3330,10 +3403,10 @@ index 323e12c..0e044d7 100644
if (min_key.type == BTRFS_XATTR_ITEM_KEY) {
if (ins_nr == 0)
diff --git a/fs/dcache.c b/fs/dcache.c
-index 877bcbb..18effa3 100644
+index 2398f9f9..7566b26 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
-@@ -1666,7 +1666,8 @@ void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op)
+@@ -1667,7 +1667,8 @@ void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op)
DCACHE_OP_REVALIDATE |
DCACHE_OP_WEAK_REVALIDATE |
DCACHE_OP_DELETE |
@@ -3343,7 +3416,7 @@ index 877bcbb..18effa3 100644
dentry->d_op = op;
if (!op)
return;
-@@ -1684,6 +1685,8 @@ void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op)
+@@ -1685,6 +1686,8 @@ void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op)
dentry->d_flags |= DCACHE_OP_PRUNE;
if (op->d_select_inode)
dentry->d_flags |= DCACHE_OP_SELECT_INODE;
@@ -3352,11 +3425,44 @@ index 877bcbb..18effa3 100644
}
EXPORT_SYMBOL(d_set_d_op);
+diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c
+index 38f7562..ecb5439 100644
+--- a/fs/ext4/crypto.c
++++ b/fs/ext4/crypto.c
+@@ -475,13 +475,16 @@ uint32_t ext4_validate_encryption_key_size(uint32_t mode, uint32_t size)
+ */
+ static int ext4_d_revalidate(struct dentry *dentry, unsigned int flags)
+ {
+- struct inode *dir = d_inode(dentry->d_parent);
+- struct ext4_crypt_info *ci = EXT4_I(dir)->i_crypt_info;
++ struct dentry *dir;
++ struct ext4_crypt_info *ci;
+ int dir_has_key, cached_with_key;
+
+- if (!ext4_encrypted_inode(dir))
++ dir = dget_parent(dentry);
++ if (!ext4_encrypted_inode(d_inode(dir))) {
++ dput(dir);
+ return 0;
+-
++ }
++ ci = EXT4_I(d_inode(dir))->i_crypt_info;
+ if (ci && ci->ci_keyring_key &&
+ (ci->ci_keyring_key->flags & ((1 << KEY_FLAG_INVALIDATED) |
+ (1 << KEY_FLAG_REVOKED) |
+@@ -491,6 +494,7 @@ static int ext4_d_revalidate(struct dentry *dentry, unsigned int flags)
+ /* this should eventually be an flag in d_flags */
+ cached_with_key = dentry->d_fsdata != NULL;
+ dir_has_key = (ci != NULL);
++ dput(dir);
+
+ /*
+ * If the dentry was cached without the key, and it is a
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
-index cc7ca4e..d4156e1 100644
+index 157b458a..b213449 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
-@@ -850,6 +850,29 @@ do { \
+@@ -900,6 +900,29 @@ do { \
#include "extents_status.h"
/*
@@ -3386,8 +3492,43 @@ index cc7ca4e..d4156e1 100644
* fourth extended file system inode data in memory
*/
struct ext4_inode_info {
+diff --git a/fs/ext4/file.c b/fs/ext4/file.c
+index 4cd318f..38847f3 100644
+--- a/fs/ext4/file.c
++++ b/fs/ext4/file.c
+@@ -335,7 +335,7 @@ static int ext4_file_open(struct inode * inode, struct file * filp)
+ struct super_block *sb = inode->i_sb;
+ struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
+ struct vfsmount *mnt = filp->f_path.mnt;
+- struct inode *dir = filp->f_path.dentry->d_parent->d_inode;
++ struct dentry *dir;
+ struct path path;
+ char buf[64], *cp;
+ int ret;
+@@ -379,14 +379,18 @@ static int ext4_file_open(struct inode * inode, struct file * filp)
+ if (ext4_encryption_info(inode) == NULL)
+ return -ENOKEY;
+ }
+- if (ext4_encrypted_inode(dir) &&
+- !ext4_is_child_context_consistent_with_parent(dir, inode)) {
++
++ dir = dget_parent(file_dentry(filp));
++ if (ext4_encrypted_inode(d_inode(dir)) &&
++ !ext4_is_child_context_consistent_with_parent(d_inode(dir), inode)) {
+ ext4_warning(inode->i_sb,
+ "Inconsistent encryption contexts: %lu/%lu\n",
+- (unsigned long) dir->i_ino,
++ (unsigned long) d_inode(dir)->i_ino,
+ (unsigned long) inode->i_ino);
++ dput(dir);
+ return -EPERM;
+ }
++ dput(dir);
+ /*
+ * Set up the jbd2_inode if we are opening the inode for
+ * writing and the journal is present
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
-index e032a04..9bdbf98 100644
+index 4098acc..796ff0e 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -60,10 +60,10 @@ ext4_double_down_write_data_sem(struct inode *first, struct inode *second)
@@ -3403,7 +3544,7 @@ index e032a04..9bdbf98 100644
}
}
-@@ -483,6 +483,13 @@ mext_check_arguments(struct inode *orig_inode,
+@@ -484,6 +484,13 @@ mext_check_arguments(struct inode *orig_inode,
return -EBUSY;
}
@@ -3418,10 +3559,10 @@ index e032a04..9bdbf98 100644
if (!(ext4_test_inode_flag(orig_inode, EXT4_INODE_EXTENTS))) {
ext4_debug("ext4 move extent: orig file is not extents "
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index c9ab67d..ba1cf0b 100644
+index 3ed01ec..a76ca67 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
-@@ -1292,9 +1292,9 @@ static int set_qf_name(struct super_block *sb, int qtype, substring_t *args)
+@@ -1324,9 +1324,9 @@ static int set_qf_name(struct super_block *sb, int qtype, substring_t *args)
return -1;
}
if (ext4_has_feature_quota(sb)) {
@@ -3434,7 +3575,7 @@ index c9ab67d..ba1cf0b 100644
}
qname = match_strdup(args);
if (!qname) {
-@@ -1657,10 +1657,10 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
+@@ -1689,10 +1689,10 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
return -1;
}
if (ext4_has_feature_quota(sb)) {
@@ -3448,7 +3589,7 @@ index c9ab67d..ba1cf0b 100644
}
sbi->s_jquota_fmt = m->mount_opt;
#endif
-@@ -1721,11 +1721,11 @@ static int parse_options(char *options, struct super_block *sb,
+@@ -1753,11 +1753,11 @@ static int parse_options(char *options, struct super_block *sb,
#ifdef CONFIG_QUOTA
if (ext4_has_feature_quota(sb) &&
(test_opt(sb, USRQUOTA) || test_opt(sb, GRPQUOTA))) {
@@ -3465,7 +3606,7 @@ index c9ab67d..ba1cf0b 100644
if (test_opt(sb, USRQUOTA) && sbi->s_qf_names[USRQUOTA])
clear_opt(sb, USRQUOTA);
-@@ -4936,6 +4936,20 @@ static int ext4_quota_on_mount(struct super_block *sb, int type)
+@@ -5021,6 +5021,20 @@ static int ext4_quota_on_mount(struct super_block *sb, int type)
EXT4_SB(sb)->s_jquota_fmt, type);
}
@@ -3486,7 +3627,7 @@ index c9ab67d..ba1cf0b 100644
/*
* Standard function to be called on quota_on
*/
-@@ -4975,8 +4989,12 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
+@@ -5060,8 +5074,12 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
if (err)
return err;
}
@@ -3501,7 +3642,7 @@ index c9ab67d..ba1cf0b 100644
}
static int ext4_quota_enable(struct super_block *sb, int type, int format_id,
-@@ -5002,8 +5020,11 @@ static int ext4_quota_enable(struct super_block *sb, int type, int format_id,
+@@ -5088,8 +5106,11 @@ static int ext4_quota_enable(struct super_block *sb, int type, int format_id,
/* Don't account quota for quota files to avoid recursion */
qf_inode->i_flags |= S_NOQUOTA;
@@ -3514,7 +3655,7 @@ index c9ab67d..ba1cf0b 100644
return err;
}
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
-index ce5a218..5fc2162 100644
+index 9cce670..7ded177 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -377,7 +377,7 @@ int nfs_readdir_xdr_filler(struct page **pages, nfs_readdir_descriptor_t *desc,
@@ -3545,10 +3686,10 @@ index ce5a218..5fc2162 100644
nfs_readdir_descriptor_t my_desc,
*desc = &my_desc;
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
-index 3e2071a..f714b98 100644
+index 86faecf..847b678 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
-@@ -927,7 +927,7 @@ int nfs_open(struct inode *inode, struct file *filp)
+@@ -940,7 +940,7 @@ int nfs_open(struct inode *inode, struct file *filp)
{
struct nfs_open_context *ctx;
@@ -3558,7 +3699,7 @@ index 3e2071a..f714b98 100644
return PTR_ERR(ctx);
nfs_file_set_open_context(filp, ctx);
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
-index db9b5fe..679e003 100644
+index 57ca1c8..2a9ff14 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -26,7 +26,7 @@ static int
@@ -3580,10 +3721,10 @@ index db9b5fe..679e003 100644
if (IS_ERR(ctx))
goto out;
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
-index 000b2ed..a1acc60 100644
+index 619ad4b..4399ea8 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
-@@ -276,6 +276,37 @@ static void ovl_dentry_release(struct dentry *dentry)
+@@ -295,6 +295,37 @@ static void ovl_dentry_release(struct dentry *dentry)
}
}
@@ -3621,7 +3762,7 @@ index 000b2ed..a1acc60 100644
static int ovl_dentry_revalidate(struct dentry *dentry, unsigned int flags)
{
struct ovl_entry *oe = dentry->d_fsdata;
-@@ -320,11 +351,13 @@ static int ovl_dentry_weak_revalidate(struct dentry *dentry, unsigned int flags)
+@@ -339,11 +370,13 @@ static int ovl_dentry_weak_revalidate(struct dentry *dentry, unsigned int flags)
static const struct dentry_operations ovl_dentry_operations = {
.d_release = ovl_dentry_release,
.d_select_inode = ovl_d_select_inode,
@@ -3649,7 +3790,7 @@ index 22ab246..eeae401 100644
#endif /* GCC_VERSION >= 40500 */
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
-index 8a2e009..f513dd8 100644
+index c4b5f4b..03dda7b 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -161,6 +161,7 @@ struct dentry_operations {
@@ -3682,16 +3823,18 @@ index 8a2e009..f513dd8 100644
+
#endif /* __LINUX_DCACHE_H */
diff --git a/include/linux/filter.h b/include/linux/filter.h
-index 5972ffe..5110d42 100644
+index 43aa1f8..a51a536 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
-@@ -446,8 +446,12 @@ int bpf_prog_create_from_user(struct bpf_prog **pfp, struct sock_fprog *fprog,
+@@ -465,10 +465,14 @@ int bpf_prog_create_from_user(struct bpf_prog **pfp, struct sock_fprog *fprog,
void bpf_prog_destroy(struct bpf_prog *fp);
int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
+int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk,
+ bool locked);
int sk_attach_bpf(u32 ufd, struct sock *sk);
+ int sk_reuseport_attach_filter(struct sock_fprog *fprog, struct sock *sk);
+ int sk_reuseport_attach_bpf(u32 ufd, struct sock *sk);
int sk_detach_filter(struct sock *sk);
+int __sk_detach_filter(struct sock *sk, bool locked);
+
@@ -3699,10 +3842,10 @@ index 5972ffe..5110d42 100644
unsigned int len);
diff --git a/include/linux/fs.h b/include/linux/fs.h
-index 22c5a0c..ab3d8d9 100644
+index 2c7f8d9..83c77b0 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
-@@ -1207,6 +1207,16 @@ static inline struct inode *file_inode(const struct file *f)
+@@ -1234,6 +1234,16 @@ static inline struct inode *file_inode(const struct file *f)
return f->f_inode;
}
@@ -3735,10 +3878,10 @@ index a338a688..dcb89e3 100644
extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
-index 3143c84..04c068e 100644
+index 5440b7b..6d1d8f4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -265,6 +265,7 @@ struct header_ops {
+@@ -267,6 +267,7 @@ struct header_ops {
void (*cache_update)(struct hh_cache *hh,
const struct net_device *dev,
const unsigned char *haddr);
@@ -3746,7 +3889,7 @@ index 3143c84..04c068e 100644
};
/* These flag bits are private to the generic network queueing
-@@ -1398,8 +1399,7 @@ enum netdev_priv_flags {
+@@ -1420,8 +1421,7 @@ enum netdev_priv_flags {
* @dma: DMA channel
* @mtu: Interface MTU value
* @type: Interface hardware type
@@ -3756,7 +3899,7 @@ index 3143c84..04c068e 100644
*
* @needed_headroom: Extra headroom the hardware may need, but not in all
* cases can this be guaranteed
-@@ -2493,6 +2493,24 @@ static inline int dev_parse_header(const struct sk_buff *skb,
+@@ -2627,6 +2627,24 @@ static inline int dev_parse_header(const struct sk_buff *skb,
return dev->header_ops->parse(skb, haddr);
}
@@ -3781,93 +3924,6 @@ index 3143c84..04c068e 100644
typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
int register_gifconf(unsigned int family, gifconf_func_t *gifconf);
static inline int unregister_gifconf(unsigned int family)
-diff --git a/include/linux/pci.h b/include/linux/pci.h
-index 4e554bf..e89c7ee 100644
---- a/include/linux/pci.h
-+++ b/include/linux/pci.h
-@@ -989,23 +989,6 @@ static inline int pci_is_managed(struct pci_dev *pdev)
- return pdev->is_managed;
- }
-
--static inline void pci_set_managed_irq(struct pci_dev *pdev, unsigned int irq)
--{
-- pdev->irq = irq;
-- pdev->irq_managed = 1;
--}
--
--static inline void pci_reset_managed_irq(struct pci_dev *pdev)
--{
-- pdev->irq = 0;
-- pdev->irq_managed = 0;
--}
--
--static inline bool pci_has_managed_irq(struct pci_dev *pdev)
--{
-- return pdev->irq_managed && pdev->irq > 0;
--}
--
- void pci_disable_device(struct pci_dev *dev);
-
- extern unsigned int pcibios_max_latency;
-diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
-index 75f136a..4fde618 100644
---- a/include/linux/skbuff.h
-+++ b/include/linux/skbuff.h
-@@ -1908,6 +1908,30 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
- skb->tail += len;
- }
-
-+/**
-+ * skb_tailroom_reserve - adjust reserved_tailroom
-+ * @skb: buffer to alter
-+ * @mtu: maximum amount of headlen permitted
-+ * @needed_tailroom: minimum amount of reserved_tailroom
-+ *
-+ * Set reserved_tailroom so that headlen can be as large as possible but
-+ * not larger than mtu and tailroom cannot be smaller than
-+ * needed_tailroom.
-+ * The required headroom should already have been reserved before using
-+ * this function.
-+ */
-+static inline void skb_tailroom_reserve(struct sk_buff *skb, unsigned int mtu,
-+ unsigned int needed_tailroom)
-+{
-+ SKB_LINEAR_ASSERT(skb);
-+ if (mtu < skb_tailroom(skb) - needed_tailroom)
-+ /* use at most mtu */
-+ skb->reserved_tailroom = skb_tailroom(skb) - mtu;
-+ else
-+ /* use up to all available space */
-+ skb->reserved_tailroom = needed_tailroom;
-+}
-+
- #define ENCAP_TYPE_ETHER 0
- #define ENCAP_TYPE_IPPROTO 1
-
-@@ -2724,6 +2748,23 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,
-
- unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len);
-
-+static inline void skb_postpush_rcsum(struct sk_buff *skb,
-+ const void *start, unsigned int len)
-+{
-+ /* For performing the reverse operation to skb_postpull_rcsum(),
-+ * we can instead of ...
-+ *
-+ * skb->csum = csum_add(skb->csum, csum_partial(start, len, 0));
-+ *
-+ * ... just use this equivalent version here to save a few
-+ * instructions. Feeding csum of 0 in csum_partial() and later
-+ * on adding skb->csum is equivalent to feed skb->csum in the
-+ * first place.
-+ */
-+ if (skb->ip_summed == CHECKSUM_COMPLETE)
-+ skb->csum = csum_partial(start, len, skb->csum);
-+}
-+
- /**
- * pskb_trim_rcsum - trim received skb and update checksum
- * @skb: buffer to trim
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 7f5f78b..245f57d 100644
--- a/include/linux/usb_usual.h
@@ -3882,10 +3938,10 @@ index 7f5f78b..245f57d 100644
#define US_FLAG(name, value) US_FL_##name = value ,
enum { US_DO_ALL_FLAGS };
diff --git a/include/net/bonding.h b/include/net/bonding.h
-index c1740a2..93abe5f 100644
+index ee6c520..791800d 100644
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
-@@ -214,6 +214,7 @@ struct bonding {
+@@ -215,6 +215,7 @@ struct bonding {
* ALB mode (6) - to sync the use and modifications of its hash table
*/
spinlock_t mode_lock;
@@ -3893,6 +3949,42 @@ index c1740a2..93abe5f 100644
u8 send_peer_notif;
u8 igmp_retrans;
#ifdef CONFIG_PROC_FS
+diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
+index f63a167..ba93c0f 100644
+--- a/include/scsi/scsi_device.h
++++ b/include/scsi/scsi_device.h
+@@ -513,6 +513,31 @@ static inline int scsi_device_tpgs(struct scsi_device *sdev)
+ return sdev->inquiry ? (sdev->inquiry[5] >> 4) & 0x3 : 0;
+ }
+
++/**
++ * scsi_device_supports_vpd - test if a device supports VPD pages
++ * @sdev: the &struct scsi_device to test
++ *
++ * If the 'try_vpd_pages' flag is set it takes precedence.
++ * Otherwise we will assume VPD pages are supported if the
++ * SCSI level is at least SPC-3 and 'skip_vpd_pages' is not set.
++ */
++static inline int scsi_device_supports_vpd(struct scsi_device *sdev)
++{
++ /* Attempt VPD inquiry if the device blacklist explicitly calls
++ * for it.
++ */
++ if (sdev->try_vpd_pages)
++ return 1;
++ /*
++ * Although VPD inquiries can go to SCSI-2 type devices,
++ * some USB ones crash on receiving them, and the pages
++ * we currently ask for are for SPC-3 and beyond
++ */
++ if (sdev->scsi_level > SCSI_SPC_2 && !sdev->skip_vpd_pages)
++ return 1;
++ return 0;
++}
++
+ #define MODULE_ALIAS_SCSI_DEVICE(type) \
+ MODULE_ALIAS("scsi:t-" __stringify(type) "*")
+ #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x"
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index 4504ca6..50da680 100644
--- a/kernel/bpf/helpers.c
@@ -3906,47 +3998,11 @@ index 4504ca6..50da680 100644
return 0;
}
-diff --git a/kernel/events/core.c b/kernel/events/core.c
-index faf2067..1e889a0 100644
---- a/kernel/events/core.c
-+++ b/kernel/events/core.c
-@@ -1580,14 +1580,14 @@ event_sched_out(struct perf_event *event,
-
- perf_pmu_disable(event->pmu);
-
-+ event->tstamp_stopped = tstamp;
-+ event->pmu->del(event, 0);
-+ event->oncpu = -1;
- event->state = PERF_EVENT_STATE_INACTIVE;
- if (event->pending_disable) {
- event->pending_disable = 0;
- event->state = PERF_EVENT_STATE_OFF;
- }
-- event->tstamp_stopped = tstamp;
-- event->pmu->del(event, 0);
-- event->oncpu = -1;
-
- if (!is_software_event(event))
- cpuctx->active_oncpu--;
-@@ -8583,7 +8583,12 @@ err_context:
- perf_unpin_context(ctx);
- put_ctx(ctx);
- err_alloc:
-- free_event(event);
-+ /*
-+ * If event_file is set, the fput() above will have called ->release()
-+ * and that will take care of freeing the event.
-+ */
-+ if (!event_file)
-+ free_event(event);
- err_cpus:
- put_online_cpus();
- err_task:
diff --git a/mm/page_isolation.c b/mm/page_isolation.c
-index 4568fd5..00c9646 100644
+index 92c4c36..31555b6 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
-@@ -283,11 +283,11 @@ struct page *alloc_migrate_target(struct page *page, unsigned long private,
+@@ -289,11 +289,11 @@ struct page *alloc_migrate_target(struct page *page, unsigned long private,
* now as a simple work-around, we use the next node for destination.
*/
if (PageHuge(page)) {
@@ -3991,10 +4047,10 @@ index b563a3f..2fa3be9 100644
EXPORT_SYMBOL(ax25_header_ops);
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
-index 5f3f645..eff69cb 100644
+index b3cca12..e2670c5 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
-@@ -567,6 +567,14 @@ int br_set_max_age(struct net_bridge *br, unsigned long val)
+@@ -568,6 +568,14 @@ int br_set_max_age(struct net_bridge *br, unsigned long val)
}
@@ -4009,7 +4065,7 @@ index 5f3f645..eff69cb 100644
int br_set_ageing_time(struct net_bridge *br, u32 ageing_time)
{
struct switchdev_attr attr = {
-@@ -577,11 +585,8 @@ int br_set_ageing_time(struct net_bridge *br, u32 ageing_time)
+@@ -579,11 +587,8 @@ int br_set_ageing_time(struct net_bridge *br, u32 ageing_time)
unsigned long t = clock_t_to_jiffies(ageing_time);
int err;
@@ -4023,10 +4079,10 @@ index 5f3f645..eff69cb 100644
br->ageing_time = t;
diff --git a/net/core/filter.c b/net/core/filter.c
-index 37157c4..f393a22 100644
+index bba502f..fb2951c 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
-@@ -1139,7 +1139,8 @@ void bpf_prog_destroy(struct bpf_prog *fp)
+@@ -1147,7 +1147,8 @@ void bpf_prog_destroy(struct bpf_prog *fp)
}
EXPORT_SYMBOL_GPL(bpf_prog_destroy);
@@ -4036,7 +4092,7 @@ index 37157c4..f393a22 100644
{
struct sk_filter *fp, *old_fp;
-@@ -1155,10 +1156,8 @@ static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk)
+@@ -1163,10 +1164,8 @@ static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk)
return -ENOMEM;
}
@@ -4048,7 +4104,7 @@ index 37157c4..f393a22 100644
if (old_fp)
sk_filter_uncharge(sk, old_fp);
-@@ -1175,7 +1174,8 @@ static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk)
+@@ -1245,7 +1244,8 @@ struct bpf_prog *__get_filter(struct sock_fprog *fprog, struct sock *sk)
* occurs or there is insufficient memory for the filter a negative
* errno code is returned. On success the return is zero.
*/
@@ -4056,9 +4112,9 @@ index 37157c4..f393a22 100644
+int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk,
+ bool locked)
{
- unsigned int fsize = bpf_classic_proglen(fprog);
- unsigned int bpf_fsize = bpf_prog_size(fprog->len);
-@@ -1213,7 +1213,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
+ struct bpf_prog *prog = __get_filter(fprog, sk);
+ int err;
+@@ -1253,7 +1253,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
if (IS_ERR(prog))
return PTR_ERR(prog);
@@ -4067,7 +4123,7 @@ index 37157c4..f393a22 100644
if (err < 0) {
__bpf_prog_release(prog);
return err;
-@@ -1221,7 +1221,12 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
+@@ -1261,7 +1261,12 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
return 0;
}
@@ -4079,18 +4135,18 @@ index 37157c4..f393a22 100644
+ return __sk_attach_filter(fprog, sk, sock_owned_by_user(sk));
+}
- int sk_attach_bpf(u32 ufd, struct sock *sk)
+ int sk_reuseport_attach_filter(struct sock_fprog *fprog, struct sock *sk)
{
-@@ -1240,7 +1245,7 @@ int sk_attach_bpf(u32 ufd, struct sock *sk)
- return -EINVAL;
- }
+@@ -1307,7 +1312,7 @@ int sk_attach_bpf(u32 ufd, struct sock *sk)
+ if (IS_ERR(prog))
+ return PTR_ERR(prog);
- err = __sk_attach_prog(prog, sk);
+ err = __sk_attach_prog(prog, sk, sock_owned_by_user(sk));
if (err < 0) {
bpf_prog_put(prog);
return err;
-@@ -1913,7 +1918,7 @@ static int __init register_sk_filter_ops(void)
+@@ -2105,7 +2110,7 @@ static int __init register_sk_filter_ops(void)
}
late_initcall(register_sk_filter_ops);
@@ -4099,7 +4155,7 @@ index 37157c4..f393a22 100644
{
int ret = -ENOENT;
struct sk_filter *filter;
-@@ -1921,8 +1926,7 @@ int sk_detach_filter(struct sock *sk)
+@@ -2113,8 +2118,7 @@ int sk_detach_filter(struct sock *sk)
if (sock_flag(sk, SOCK_FILTER_LOCKED))
return -EPERM;
@@ -4109,7 +4165,7 @@ index 37157c4..f393a22 100644
if (filter) {
RCU_INIT_POINTER(sk->sk_filter, NULL);
sk_filter_uncharge(sk, filter);
-@@ -1931,7 +1935,12 @@ int sk_detach_filter(struct sock *sk)
+@@ -2123,7 +2127,12 @@ int sk_detach_filter(struct sock *sk)
return ret;
}
@@ -4124,7 +4180,7 @@ index 37157c4..f393a22 100644
int sk_get_filter(struct sock *sk, struct sock_filter __user *ubuf,
unsigned int len)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
-index 34ba7a0..ca966f7 100644
+index 8261d95..215e613 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -905,6 +905,7 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev,
@@ -4135,47 +4191,6 @@ index 34ba7a0..ca966f7 100644
+ nla_total_size(1); /* IFLA_PROTO_DOWN */
}
-diff --git a/net/core/skbuff.c b/net/core/skbuff.c
-index 5bf88f5..8616d11 100644
---- a/net/core/skbuff.c
-+++ b/net/core/skbuff.c
-@@ -2948,6 +2948,24 @@ int skb_append_pagefrags(struct sk_buff *skb, struct page *page,
- EXPORT_SYMBOL_GPL(skb_append_pagefrags);
-
- /**
-+ * skb_push_rcsum - push skb and update receive checksum
-+ * @skb: buffer to update
-+ * @len: length of data pulled
-+ *
-+ * This function performs an skb_push on the packet and updates
-+ * the CHECKSUM_COMPLETE checksum. It should be used on
-+ * receive path processing instead of skb_push unless you know
-+ * that the checksum difference is zero (e.g., a valid IP header)
-+ * or you are setting ip_summed to CHECKSUM_NONE.
-+ */
-+static unsigned char *skb_push_rcsum(struct sk_buff *skb, unsigned len)
-+{
-+ skb_push(skb, len);
-+ skb_postpush_rcsum(skb, skb->data, len);
-+ return skb->data;
-+}
-+
-+/**
- * skb_pull_rcsum - pull skb and update receive checksum
- * @skb: buffer to update
- * @len: length of data pulled
-@@ -4084,9 +4102,9 @@ struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb,
- if (!pskb_may_pull(skb_chk, offset))
- goto err;
-
-- __skb_pull(skb_chk, offset);
-+ skb_pull_rcsum(skb_chk, offset);
- ret = skb_chkf(skb_chk);
-- __skb_push(skb_chk, offset);
-+ skb_push_rcsum(skb_chk, offset);
-
- if (ret)
- goto err;
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 902d606..8be8f27 100644
--- a/net/dccp/ipv4.c
@@ -4189,6 +4204,40 @@ index 902d606..8be8f27 100644
if (!between48(seq, dccp_rsk(req)->dreq_iss, dccp_rsk(req)->dreq_gss)) {
NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
} else {
+diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
+index fa4daba..d8fb47f 100644
+--- a/net/dsa/dsa.c
++++ b/net/dsa/dsa.c
+@@ -935,6 +935,14 @@ static void dsa_remove_dst(struct dsa_switch_tree *dst)
+ {
+ int i;
+
++ dst->master_netdev->dsa_ptr = NULL;
++
++ /* If we used a tagging format that doesn't have an ethertype
++ * field, make sure that all packets from this point get sent
++ * without the tag and go through the regular receive path.
++ */
++ wmb();
++
+ for (i = 0; i < dst->pd->nr_chips; i++) {
+ struct dsa_switch *ds = dst->ds[i];
+
+@@ -988,14 +996,6 @@ static int dsa_suspend(struct device *d)
+ struct dsa_switch_tree *dst = platform_get_drvdata(pdev);
+ int i, ret = 0;
+
+- dst->master_netdev->dsa_ptr = NULL;
+-
+- /* If we used a tagging format that doesn't have an ethertype
+- * field, make sure that all packets from this point get sent
+- * without the tag and go through the regular receive path.
+- */
+- wmb();
+-
+ for (i = 0; i < dst->pd->nr_chips; i++) {
+ struct dsa_switch *ds = dst->ds[i];
+
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index f6303b1..0212591 100644
--- a/net/ipv4/devinet.c
@@ -4263,64 +4312,6 @@ index 4734475..8a9246d 100644
if (!(ok & BRD_OK))
fib_magic(RTM_DELROUTE, RTN_BROADCAST, ifa->ifa_broadcast, 32, prim);
if (subnet && ifa->ifa_prefixlen < 31) {
-diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
-index 05e4cba..b3086cf 100644
---- a/net/ipv4/igmp.c
-+++ b/net/ipv4/igmp.c
-@@ -356,9 +356,8 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, unsigned int mtu)
- skb_dst_set(skb, &rt->dst);
- skb->dev = dev;
-
-- skb->reserved_tailroom = skb_end_offset(skb) -
-- min(mtu, skb_end_offset(skb));
- skb_reserve(skb, hlen);
-+ skb_tailroom_reserve(skb, mtu, tlen);
-
- skb_reset_network_header(skb);
- pip = ip_hdr(skb);
-diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
-index 49f0285..f2ad521 100644
---- a/net/ipv4/ip_output.c
-+++ b/net/ipv4/ip_output.c
-@@ -1237,13 +1237,16 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page,
- if (!skb)
- return -EINVAL;
-
-- cork->length += size;
- if ((size + skb->len > mtu) &&
- (sk->sk_protocol == IPPROTO_UDP) &&
- (rt->dst.dev->features & NETIF_F_UFO)) {
-+ if (skb->ip_summed != CHECKSUM_PARTIAL)
-+ return -EOPNOTSUPP;
-+
- skb_shinfo(skb)->gso_size = mtu - fragheaderlen;
- skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
- }
-+ cork->length += size;
-
- while (size > 0) {
- if (skb_is_gso(skb)) {
-diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
-index cbb51f3..ce30c8b 100644
---- a/net/ipv4/ip_tunnel.c
-+++ b/net/ipv4/ip_tunnel.c
-@@ -663,6 +663,8 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
- inner_iph = (const struct iphdr *)skb_inner_network_header(skb);
- connected = (tunnel->parms.iph.daddr != 0);
-
-+ memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
-+
- dst = tnl_params->daddr;
- if (dst == 0) {
- /* NBMA tunnel */
-@@ -760,7 +762,6 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
- tunnel->err_time + IPTUNNEL_ERR_TIMEO)) {
- tunnel->err_count--;
-
-- memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
- dst_link_failure(skb);
- } else
- tunnel->err_count = 0;
diff --git a/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c b/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c
index c6eb421..ea91058 100644
--- a/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c
@@ -4347,10 +4338,10 @@ index c6eb421..ea91058 100644
}
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
-index 8c7e631..048418b 100644
+index 487ac67..a7b1a90 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
-@@ -320,8 +320,6 @@ void tcp_req_err(struct sock *sk, u32 seq, bool abort)
+@@ -319,8 +319,6 @@ void tcp_req_err(struct sock *sk, u32 seq, bool abort)
/* ICMPs are not backlogged, hence we cannot get
* an established socket here.
*/
@@ -4359,45 +4350,11 @@ index 8c7e631..048418b 100644
if (seq != tcp_rsk(req)->snt_isn) {
NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
} else if (abort) {
-diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
-index c8cbc2b..a726d78 100644
---- a/net/ipv4/tcp_metrics.c
-+++ b/net/ipv4/tcp_metrics.c
-@@ -550,7 +550,7 @@ reset:
- */
- if (crtt > tp->srtt_us) {
- /* Set RTO like tcp_rtt_estimator(), but from cached RTT. */
-- crtt /= 8 * USEC_PER_MSEC;
-+ crtt /= 8 * USEC_PER_SEC / HZ;
- inet_csk(sk)->icsk_rto = crtt + max(2 * crtt, tcp_rto_min(sk));
- } else if (tp->srtt_us == 0) {
- /* RFC6298: 5.7 We've failed to get a valid RTT sample from
-diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
-index ac6b196..9475a27 100644
---- a/net/ipv4/tcp_minisocks.c
-+++ b/net/ipv4/tcp_minisocks.c
-@@ -458,7 +458,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
-
- newtp->rcv_wup = newtp->copied_seq =
- newtp->rcv_nxt = treq->rcv_isn + 1;
-- newtp->segs_in = 0;
-+ newtp->segs_in = 1;
-
- newtp->snd_sml = newtp->snd_una =
- newtp->snd_nxt = newtp->snd_up = treq->snt_isn + 1;
-@@ -818,6 +818,7 @@ int tcp_child_process(struct sock *parent, struct sock *child,
- int ret = 0;
- int state = child->sk_state;
-
-+ tcp_sk(child)->segs_in += max_t(u16, 1, skb_shinfo(skb)->gso_segs);
- if (!sock_owned_by_user(child)) {
- ret = tcp_rcv_state_process(child, skb);
- /* Wakeup parent, send SIGIO */
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
-index 7f8ab46..21fbb54 100644
+index 95d2f19..eb8933b 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
-@@ -1990,10 +1990,14 @@ void udp_v4_early_demux(struct sk_buff *skb)
+@@ -2082,10 +2082,14 @@ void udp_v4_early_demux(struct sk_buff *skb)
if (!in_dev)
return;
@@ -4416,51 +4373,8 @@ index 7f8ab46..21fbb54 100644
sk = __udp4_lib_mcast_demux_lookup(net, uh->dest, iph->daddr,
uh->source, iph->saddr, dif);
} else if (skb->pkt_type == PACKET_HOST) {
-diff --git a/net/ipv4/udp_tunnel.c b/net/ipv4/udp_tunnel.c
-index aba4286..280a9bd 100644
---- a/net/ipv4/udp_tunnel.c
-+++ b/net/ipv4/udp_tunnel.c
-@@ -89,6 +89,8 @@ int udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb,
- uh->source = src_port;
- uh->len = htons(skb->len);
-
-+ memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
-+
- udp_set_csum(nocheck, skb, src, dst, skb->len);
-
- return iptunnel_xmit(sk, rt, skb, src, dst, IPPROTO_UDP,
-diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c
-index 5c5d23e..9508a20 100644
---- a/net/ipv6/exthdrs_core.c
-+++ b/net/ipv6/exthdrs_core.c
-@@ -257,7 +257,11 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
- *fragoff = _frag_off;
- return hp->nexthdr;
- }
-- return -ENOENT;
-+ if (!found)
-+ return -ENOENT;
-+ if (fragoff)
-+ *fragoff = _frag_off;
-+ break;
- }
- hdrlen = 8;
- } else if (nexthdr == NEXTHDR_AUTH) {
-diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
-index e5ea177..4650c68 100644
---- a/net/ipv6/ip6_gre.c
-+++ b/net/ipv6/ip6_gre.c
-@@ -778,6 +778,8 @@ static inline int ip6gre_xmit_ipv4(struct sk_buff *skb, struct net_device *dev)
- __u32 mtu;
- int err;
-
-+ memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
-+
- if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT))
- encap_limit = t->parms.encap_limit;
-
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
-index 31144c4..a175152 100644
+index a163102..2a6606c 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1091,8 +1091,8 @@ static inline int ip6_ufo_append_data(struct sock *sk,
@@ -4493,7 +4407,7 @@ index 31144c4..a175152 100644
if (err)
goto error;
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
-index 137fca4..3991b21 100644
+index 6c5dfec..3991b21 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -343,12 +343,12 @@ static int ip6_tnl_create2(struct net_device *dev)
@@ -4510,35 +4424,11 @@ index 137fca4..3991b21 100644
dev_hold(dev);
ip6_tnl_link(ip6n, t);
-@@ -1180,6 +1180,8 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
- u8 tproto;
- int err;
-
-+ memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
-+
- tproto = ACCESS_ONCE(t->parms.proto);
- if (tproto != IPPROTO_IPIP && tproto != 0)
- return -1;
-diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
-index 5ee56d0..d64ee7e 100644
---- a/net/ipv6/mcast.c
-+++ b/net/ipv6/mcast.c
-@@ -1574,9 +1574,8 @@ static struct sk_buff *mld_newpack(struct inet6_dev *idev, unsigned int mtu)
- return NULL;
-
- skb->priority = TC_PRIO_CONTROL;
-- skb->reserved_tailroom = skb_end_offset(skb) -
-- min(mtu, skb_end_offset(skb));
- skb_reserve(skb, hlen);
-+ skb_tailroom_reserve(skb, mtu, tlen);
-
- if (__ipv6_get_lladdr(idev, &addr_buf, IFA_F_TENTATIVE)) {
- /* <draft-ietf-magma-mld-source-05.txt>:
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
-index 9da3287..6665e1a 100644
+index 422dd01..6794120 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
-@@ -837,8 +837,8 @@ start_lookup:
+@@ -883,8 +883,8 @@ start_lookup:
flush_stack(stack, count, skb, count - 1);
} else {
if (!inner_flushed)
@@ -4549,20 +4439,6 @@ index 9da3287..6665e1a 100644
consume_skb(skb);
}
return 0;
-@@ -916,11 +916,9 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
- ret = udpv6_queue_rcv_skb(sk, skb);
- sock_put(sk);
-
-- /* a return value > 0 means to resubmit the input, but
-- * it wants the return to be -protocol, or 0
-- */
-+ /* a return value > 0 means to resubmit the input */
- if (ret > 0)
-- return -ret;
-+ return ret;
-
- return 0;
- }
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index ec22078..42de4cc 100644
--- a/net/l2tp/l2tp_ip.c
@@ -4622,7 +4498,7 @@ index a2c8747..9ee4ddb 100644
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, ptr, length);
}
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
-index 6a12b0f..980e9e9 100644
+index 978d3bc..1b33d89 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -7,6 +7,7 @@
@@ -4633,7 +4509,7 @@ index 6a12b0f..980e9e9 100644
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
-@@ -1484,14 +1485,21 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
+@@ -1485,14 +1486,21 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
sdata_info(sdata, "Trigger new scan to find an IBSS to join\n");
@@ -4678,10 +4554,10 @@ index c9e325d..7a2b791 100644
}
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
-index 4cbf36c..a3bb8f7 100644
+index 60d093f..261df74 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
-@@ -2250,7 +2250,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
+@@ -2249,7 +2249,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
struct ieee80211_local *local = rx->local;
struct ieee80211_sub_if_data *sdata = rx->sdata;
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
@@ -4690,7 +4566,7 @@ index 4cbf36c..a3bb8f7 100644
hdr = (struct ieee80211_hdr *) skb->data;
hdrlen = ieee80211_hdrlen(hdr->frame_control);
-@@ -2319,7 +2319,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
+@@ -2318,7 +2318,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
ether_addr_equal(sdata->vif.addr, hdr->addr3))
return RX_CONTINUE;
@@ -4701,10 +4577,10 @@ index 4cbf36c..a3bb8f7 100644
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion);
return RX_DROP_MONITOR;
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
-index f91d187..67066d0 100644
+index a4a4f89..23ed038 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
-@@ -256,11 +256,11 @@ void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
+@@ -257,11 +257,11 @@ void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
}
/* Caller must hold local->sta_mtx */
@@ -4720,7 +4596,7 @@ index f91d187..67066d0 100644
}
static void sta_deliver_ps_frames(struct work_struct *wk)
-@@ -484,11 +484,17 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
+@@ -498,11 +498,17 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
{
struct ieee80211_local *local = sta->local;
struct ieee80211_sub_if_data *sdata = sta->sdata;
@@ -4739,7 +4615,7 @@ index f91d187..67066d0 100644
/* check if STA exists already */
if (sta_info_get_bss(sdata, sta->sta.addr)) {
err = -EEXIST;
-@@ -503,7 +509,9 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
+@@ -517,7 +523,9 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
set_sta_flag(sta, WLAN_STA_BLOCK_BA);
/* make the station visible */
@@ -4750,7 +4626,7 @@ index f91d187..67066d0 100644
list_add_tail_rcu(&sta->list, &local->sta_list);
-@@ -520,10 +528,9 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
+@@ -534,10 +542,9 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
ieee80211_sta_debugfs_add(sta);
rate_control_add_sta_debugfs(sta);
@@ -4764,7 +4640,7 @@ index f91d187..67066d0 100644
sta_dbg(sdata, "Inserted STA %pM\n", sta->sta.addr);
-@@ -538,6 +545,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
+@@ -552,6 +559,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
out_remove:
sta_info_hash_del(local, sta);
list_del_rcu(&sta->list);
@@ -4772,7 +4648,7 @@ index f91d187..67066d0 100644
local->num_sta--;
synchronize_net();
__cleanup_single_sta(sta);
-@@ -882,7 +890,7 @@ static void __sta_info_destroy_part2(struct sta_info *sta)
+@@ -898,7 +906,7 @@ static void __sta_info_destroy_part2(struct sta_info *sta)
{
struct ieee80211_local *local = sta->local;
struct ieee80211_sub_if_data *sdata = sta->sdata;
@@ -4781,7 +4657,7 @@ index f91d187..67066d0 100644
int ret;
/*
-@@ -920,8 +928,11 @@ static void __sta_info_destroy_part2(struct sta_info *sta)
+@@ -936,8 +944,11 @@ static void __sta_info_destroy_part2(struct sta_info *sta)
sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr);
@@ -4796,10 +4672,10 @@ index f91d187..67066d0 100644
rate_control_remove_sta_debugfs(sta);
ieee80211_sta_debugfs_remove(sta);
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
-index c32fc41..881bc20 100644
+index b18c5ed..0b80a71 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
-@@ -518,6 +518,9 @@ static struct net_device *find_outdev(struct net *net,
+@@ -543,6 +543,9 @@ static struct net_device *find_outdev(struct net *net,
if (!dev)
return ERR_PTR(-ENODEV);
@@ -4892,25 +4768,12 @@ index 992396a..da1ae0e1 100644
sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags);
if (!gso_type && (len > dev->mtu + reserve + extra_len) &&
-diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
-index ec52912..ce46f1c 100644
---- a/net/sctp/ipv6.c
-+++ b/net/sctp/ipv6.c
-@@ -526,6 +526,8 @@ static int sctp_v6_cmp_addr(const union sctp_addr *addr1,
- }
- return 0;
- }
-+ if (addr1->v6.sin6_port != addr2->v6.sin6_port)
-+ return 0;
- if (!ipv6_addr_equal(&addr1->v6.sin6_addr, &addr2->v6.sin6_addr))
- return 0;
- /* If this is a linklocal address, compare the scope_id. */
diff --git a/net/socket.c b/net/socket.c
-index d730ef9..263b334 100644
+index c044d1e..db13ae8 100644
--- a/net/socket.c
+++ b/net/socket.c
-@@ -2238,31 +2238,31 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
- break;
+@@ -2240,31 +2240,31 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
+ cond_resched();
}
-out_put:
@@ -4960,136 +4823,6 @@ index d730ef9..263b334 100644
}
SYSCALL_DEFINE5(recvmmsg, int, fd, struct mmsghdr __user *, mmsg,
-diff --git a/net/tipc/socket.c b/net/tipc/socket.c
-index b53246f..e53003c 100644
---- a/net/tipc/socket.c
-+++ b/net/tipc/socket.c
-@@ -673,7 +673,7 @@ static int tipc_sendmcast(struct socket *sock, struct tipc_name_seq *seq,
- struct tipc_sock *tsk = tipc_sk(sk);
- struct net *net = sock_net(sk);
- struct tipc_msg *mhdr = &tsk->phdr;
-- struct sk_buff_head *pktchain = &sk->sk_write_queue;
-+ struct sk_buff_head pktchain;
- struct iov_iter save = msg->msg_iter;
- uint mtu;
- int rc;
-@@ -687,14 +687,16 @@ static int tipc_sendmcast(struct socket *sock, struct tipc_name_seq *seq,
- msg_set_nameupper(mhdr, seq->upper);
- msg_set_hdr_sz(mhdr, MCAST_H_SIZE);
-
-+ skb_queue_head_init(&pktchain);
-+
- new_mtu:
- mtu = tipc_bcast_get_mtu(net);
-- rc = tipc_msg_build(mhdr, msg, 0, dsz, mtu, pktchain);
-+ rc = tipc_msg_build(mhdr, msg, 0, dsz, mtu, &pktchain);
- if (unlikely(rc < 0))
- return rc;
-
- do {
-- rc = tipc_bcast_xmit(net, pktchain);
-+ rc = tipc_bcast_xmit(net, &pktchain);
- if (likely(!rc))
- return dsz;
-
-@@ -704,7 +706,7 @@ new_mtu:
- if (!rc)
- continue;
- }
-- __skb_queue_purge(pktchain);
-+ __skb_queue_purge(&pktchain);
- if (rc == -EMSGSIZE) {
- msg->msg_iter = save;
- goto new_mtu;
-@@ -863,7 +865,7 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dsz)
- struct net *net = sock_net(sk);
- struct tipc_msg *mhdr = &tsk->phdr;
- u32 dnode, dport;
-- struct sk_buff_head *pktchain = &sk->sk_write_queue;
-+ struct sk_buff_head pktchain;
- struct sk_buff *skb;
- struct tipc_name_seq *seq;
- struct iov_iter save;
-@@ -924,17 +926,18 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dsz)
- msg_set_hdr_sz(mhdr, BASIC_H_SIZE);
- }
-
-+ skb_queue_head_init(&pktchain);
- save = m->msg_iter;
- new_mtu:
- mtu = tipc_node_get_mtu(net, dnode, tsk->portid);
-- rc = tipc_msg_build(mhdr, m, 0, dsz, mtu, pktchain);
-+ rc = tipc_msg_build(mhdr, m, 0, dsz, mtu, &pktchain);
- if (rc < 0)
- return rc;
-
- do {
-- skb = skb_peek(pktchain);
-+ skb = skb_peek(&pktchain);
- TIPC_SKB_CB(skb)->wakeup_pending = tsk->link_cong;
-- rc = tipc_node_xmit(net, pktchain, dnode, tsk->portid);
-+ rc = tipc_node_xmit(net, &pktchain, dnode, tsk->portid);
- if (likely(!rc)) {
- if (sock->state != SS_READY)
- sock->state = SS_CONNECTING;
-@@ -946,7 +949,7 @@ new_mtu:
- if (!rc)
- continue;
- }
-- __skb_queue_purge(pktchain);
-+ __skb_queue_purge(&pktchain);
- if (rc == -EMSGSIZE) {
- m->msg_iter = save;
- goto new_mtu;
-@@ -1016,7 +1019,7 @@ static int __tipc_send_stream(struct socket *sock, struct msghdr *m, size_t dsz)
- struct net *net = sock_net(sk);
- struct tipc_sock *tsk = tipc_sk(sk);
- struct tipc_msg *mhdr = &tsk->phdr;
-- struct sk_buff_head *pktchain = &sk->sk_write_queue;
-+ struct sk_buff_head pktchain;
- DECLARE_SOCKADDR(struct sockaddr_tipc *, dest, m->msg_name);
- u32 portid = tsk->portid;
- int rc = -EINVAL;
-@@ -1044,17 +1047,19 @@ static int __tipc_send_stream(struct socket *sock, struct msghdr *m, size_t dsz)
-
- timeo = sock_sndtimeo(sk, m->msg_flags & MSG_DONTWAIT);
- dnode = tsk_peer_node(tsk);
-+ skb_queue_head_init(&pktchain);
-
- next:
- save = m->msg_iter;
- mtu = tsk->max_pkt;
- send = min_t(uint, dsz - sent, TIPC_MAX_USER_MSG_SIZE);
-- rc = tipc_msg_build(mhdr, m, sent, send, mtu, pktchain);
-+ rc = tipc_msg_build(mhdr, m, sent, send, mtu, &pktchain);
- if (unlikely(rc < 0))
- return rc;
-+
- do {
- if (likely(!tsk_conn_cong(tsk))) {
-- rc = tipc_node_xmit(net, pktchain, dnode, portid);
-+ rc = tipc_node_xmit(net, &pktchain, dnode, portid);
- if (likely(!rc)) {
- tsk->sent_unacked++;
- sent += send;
-@@ -1063,7 +1068,7 @@ next:
- goto next;
- }
- if (rc == -EMSGSIZE) {
-- __skb_queue_purge(pktchain);
-+ __skb_queue_purge(&pktchain);
- tsk->max_pkt = tipc_node_get_mtu(net, dnode,
- portid);
- m->msg_iter = save;
-@@ -1077,7 +1082,7 @@ next:
- rc = tipc_wait_for_sndpkt(sock, &timeo);
- } while (!rc);
-
-- __skb_queue_purge(pktchain);
-+ __skb_queue_purge(&pktchain);
- return sent ? sent : rc;
- }
-
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index ad7f5b3..1c4ad47 100644
--- a/net/xfrm/xfrm_input.c
@@ -5111,10 +4844,10 @@ index ad7f5b3..1c4ad47 100644
if (nexthdr <= 0) {
if (nexthdr == -EBADMSG) {
diff --git a/sound/core/timer.c b/sound/core/timer.c
-index f24c9fc..b982d1b 100644
+index dca817f..e5e7e43 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
-@@ -1051,8 +1051,8 @@ static int snd_timer_s_start(struct snd_timer * timer)
+@@ -1041,8 +1041,8 @@ static int snd_timer_s_start(struct snd_timer * timer)
njiff += timer->sticks - priv->correction;
priv->correction = 0;
}
@@ -5125,63 +4858,36 @@ index f24c9fc..b982d1b 100644
return 0;
}
+diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
+index e68fa44..0c95856 100644
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -1623,6 +1623,8 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
+
+ mutex_lock(&per_pin->lock);
+ pin_eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE);
++ eld->monitor_present = pin_eld->monitor_present;
++
+ if (pin_eld->monitor_present)
+ eld->eld_valid = !!(present & AC_PINSENSE_ELDV);
+ else
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
-index 6968b79..1402ba9 100644
+index 4f5ca0b..1402ba9 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
-@@ -3801,6 +3801,10 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
-
- static void alc_headset_mode_default(struct hda_codec *codec)
- {
-+ static struct coef_fw coef0225[] = {
-+ UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
-+ {}
-+ };
- static struct coef_fw coef0255[] = {
- WRITE_COEF(0x45, 0xc089),
- WRITE_COEF(0x45, 0xc489),
-@@ -3842,6 +3846,9 @@ static void alc_headset_mode_default(struct hda_codec *codec)
- };
-
- switch (codec->core.vendor_id) {
-+ case 0x10ec0225:
-+ alc_process_coef_fw(codec, coef0225);
-+ break;
- case 0x10ec0255:
- case 0x10ec0256:
- alc_process_coef_fw(codec, coef0255);
-@@ -4750,6 +4757,10 @@ enum {
- ALC293_FIXUP_LENOVO_SPK_NOISE,
- ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
+@@ -4759,6 +4759,8 @@ enum {
ALC255_FIXUP_DELL_SPK_NOISE,
-+ ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
-+ ALC280_FIXUP_HP_HEADSET_MIC,
+ ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
+ ALC280_FIXUP_HP_HEADSET_MIC,
+ ALC221_FIXUP_HP_FRONT_MIC,
+ ALC292_FIXUP_TPT460,
};
static const struct hda_fixup alc269_fixups[] = {
-@@ -5375,6 +5386,36 @@ static const struct hda_fixup alc269_fixups[] = {
+@@ -5401,6 +5403,19 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
- .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
+ .chain_id = ALC269_FIXUP_HEADSET_MIC,
},
-+ [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
-+ .type = HDA_FIXUP_VERBS,
-+ .v.verbs = (const struct hda_verb[]) {
-+ /* Disable pass-through path for FRONT 14h */
-+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
-+ { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
-+ {}
-+ },
-+ .chained = true,
-+ .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
-+ },
-+ [ALC280_FIXUP_HP_HEADSET_MIC] = {
-+ .type = HDA_FIXUP_FUNC,
-+ .v.func = alc_fixup_disable_aamix,
-+ .chained = true,
-+ .chain_id = ALC269_FIXUP_HEADSET_MIC,
-+ },
+ [ALC221_FIXUP_HP_FRONT_MIC] = {
+ .type = HDA_FIXUP_PINS,
+ .v.pins = (const struct hda_pintbl[]) {
@@ -5198,16 +4904,15 @@ index 6968b79..1402ba9 100644
};
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
-@@ -5479,6 +5520,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
- SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
+@@ -5506,6 +5521,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-+ SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
+ SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
+ SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
-@@ -5527,7 +5570,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
+@@ -5554,7 +5570,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
@@ -5216,7 +4921,7 @@ index 6968b79..1402ba9 100644
SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
-@@ -5622,6 +5665,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
+@@ -5649,6 +5665,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
{.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
{.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
{.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
@@ -5224,20 +4929,7 @@ index 6968b79..1402ba9 100644
{}
};
#define ALC225_STANDARD_PINS \
-@@ -5648,10 +5692,10 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
- {0x21, 0x03211020}
-
- static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
-- SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
-+ SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
- ALC225_STANDARD_PINS,
- {0x14, 0x901701a0}),
-- SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
-+ SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
- ALC225_STANDARD_PINS,
- {0x14, 0x901701b0}),
- SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
-@@ -6379,6 +6423,7 @@ enum {
+@@ -6406,6 +6423,7 @@ enum {
ALC668_FIXUP_AUTO_MUTE,
ALC668_FIXUP_DELL_DISABLE_AAMIX,
ALC668_FIXUP_DELL_XPS13,
@@ -5245,7 +4937,7 @@ index 6968b79..1402ba9 100644
};
static const struct hda_fixup alc662_fixups[] = {
-@@ -6619,6 +6664,12 @@ static const struct hda_fixup alc662_fixups[] = {
+@@ -6646,6 +6664,12 @@ static const struct hda_fixup alc662_fixups[] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc_fixup_bass_chmap,
},
@@ -5258,7 +4950,7 @@ index 6968b79..1402ba9 100644
};
static const struct snd_pci_quirk alc662_fixup_tbl[] = {
-@@ -6641,8 +6692,9 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
+@@ -6668,8 +6692,9 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
diff --git a/4.4.8/4420_grsecurity-3.1-4.4.8-201604252206.patch b/4.5.2/4420_grsecurity-3.1-4.5.2-201604282058.patch
index a7a3280..00a02a9 100644
--- a/4.4.8/4420_grsecurity-3.1-4.4.8-201604252206.patch
+++ b/4.5.2/4420_grsecurity-3.1-4.5.2-201604282058.patch
@@ -311,10 +311,10 @@ index 13f888a..250729b 100644
A typical pattern in a Kbuild file looks like this:
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 0e4102a..d24a808 100644
+index 21e4b48..82bb512 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
-@@ -1282,6 +1282,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -1300,6 +1300,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
[KNL] Should the hard-lockup detector generate
backtraces on all cpus.
Format: <integer>
@@ -327,7 +327,7 @@ index 0e4102a..d24a808 100644
hashdist= [KNL,NUMA] Large hashes allocated during boot
are distributed across NUMA nodes. Defaults on
-@@ -2418,6 +2424,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -2476,6 +2482,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 0e4102a..d24a808 100644
nosmap [X86]
Disable SMAP (Supervisor Mode Access Prevention)
even if it is supported by processor.
-@@ -2716,6 +2726,35 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -2772,6 +2782,35 @@ 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.
@@ -374,49 +374,8 @@ index 0e4102a..d24a808 100644
pcbit= [HW,ISDN]
pcd. [PARIDE]
-diff --git a/Documentation/sysctl/fs.txt b/Documentation/sysctl/fs.txt
-index 88152f2..302b5ed 100644
---- a/Documentation/sysctl/fs.txt
-+++ b/Documentation/sysctl/fs.txt
-@@ -32,6 +32,8 @@ Currently, these files are in /proc/sys/fs:
- - nr_open
- - overflowuid
- - overflowgid
-+- pipe-user-pages-hard
-+- pipe-user-pages-soft
- - protected_hardlinks
- - protected_symlinks
- - suid_dumpable
-@@ -159,6 +161,27 @@ The default is 65534.
-
- ==============================================================
-
-+pipe-user-pages-hard:
-+
-+Maximum total number of pages a non-privileged user may allocate for pipes.
-+Once this limit is reached, no new pipes may be allocated until usage goes
-+below the limit again. When set to 0, no limit is applied, which is the default
-+setting.
-+
-+==============================================================
-+
-+pipe-user-pages-soft:
-+
-+Maximum total number of pages a non-privileged user may allocate for pipes
-+before the pipe size gets limited to a single page. Once this limit is reached,
-+new pipes will be limited to a single page in size for this user in order to
-+limit total memory usage, and trying to increase them using fcntl() will be
-+denied until usage goes below the limit again. The default value allows to
-+allocate up to 1024 pipes at their default size. When set to 0, no limit is
-+applied.
-+
-+==============================================================
-+
- protected_hardlinks:
-
- A long-standing class of security issues is the hardlink-based
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
-index af70d15..ccd3786 100644
+index a93b414..f50a50b 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -42,6 +42,7 @@ show up in /proc/sys/kernel:
@@ -449,7 +408,7 @@ index af70d15..ccd3786 100644
A toggle value indicating if modules are allowed to be loaded
diff --git a/Makefile b/Makefile
-index 1928fcd..e58439b 100644
+index 1ecaaeb..8e81686 100644
--- a/Makefile
+++ b/Makefile
@@ -298,7 +298,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
@@ -474,7 +433,7 @@ index 1928fcd..e58439b 100644
$(Q)$(MAKE) $(build)=scripts/basic
$(Q)rm -f .tmp_quiet_recordmcount
-@@ -616,6 +618,8 @@ endif
+@@ -622,6 +624,8 @@ endif
# Tell gcc to never replace conditional load with a non-conditional one
KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
@@ -483,7 +442,7 @@ index 1928fcd..e58439b 100644
ifdef CONFIG_READABLE_ASM
# Disable optimizations that make assembler listings hard to read.
# reorder blocks reorders the control in the function
-@@ -708,7 +712,7 @@ KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g)
+@@ -714,7 +718,7 @@ KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g)
else
KBUILD_CFLAGS += -g
endif
@@ -492,7 +451,7 @@ index 1928fcd..e58439b 100644
endif
ifdef CONFIG_DEBUG_INFO_DWARF4
KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,)
-@@ -879,7 +883,7 @@ export mod_sign_cmd
+@@ -886,7 +890,7 @@ export mod_sign_cmd
ifeq ($(KBUILD_EXTMOD),)
@@ -501,7 +460,7 @@ index 1928fcd..e58439b 100644
vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-@@ -930,6 +934,8 @@ endif
+@@ -937,6 +941,8 @@ endif
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
@@ -510,7 +469,7 @@ index 1928fcd..e58439b 100644
$(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
# Handle descending into subdirectories listed in $(vmlinux-dirs)
-@@ -939,7 +945,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
+@@ -946,7 +952,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
# Error messages still appears in the original language
PHONY += $(vmlinux-dirs)
@@ -519,7 +478,7 @@ index 1928fcd..e58439b 100644
$(Q)$(MAKE) $(build)=$@
define filechk_kernel.release
-@@ -982,10 +988,13 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
+@@ -989,10 +995,13 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
archprepare: archheaders archscripts prepare1 scripts_basic
@@ -533,7 +492,7 @@ index 1928fcd..e58439b 100644
prepare: prepare0
# Generate some files
-@@ -1096,6 +1105,8 @@ all: modules
+@@ -1103,6 +1112,8 @@ all: modules
# using awk while concatenating to the final file.
PHONY += modules
@@ -542,7 +501,7 @@ index 1928fcd..e58439b 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.';
-@@ -1111,7 +1122,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
+@@ -1118,7 +1129,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
# Target to prepare building external modules
PHONY += modules_prepare
@@ -551,7 +510,7 @@ index 1928fcd..e58439b 100644
# Target to install modules
PHONY += modules_install
-@@ -1177,7 +1188,11 @@ MRPROPER_FILES += .config .config.old .version .old_version \
+@@ -1184,7 +1195,11 @@ MRPROPER_FILES += .config .config.old .version .old_version \
Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
signing_key.pem signing_key.priv signing_key.x509 \
x509.genkey extra_certificates signing_key.x509.keyid \
@@ -564,7 +523,7 @@ index 1928fcd..e58439b 100644
# clean - Delete most, but leave enough to build external modules
#
-@@ -1216,7 +1231,7 @@ distclean: mrproper
+@@ -1223,7 +1238,7 @@ distclean: mrproper
@find $(srctree) $(RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
@@ -573,7 +532,7 @@ index 1928fcd..e58439b 100644
-type f -print | xargs rm -f
-@@ -1383,6 +1398,8 @@ PHONY += $(module-dirs) modules
+@@ -1390,6 +1405,8 @@ PHONY += $(module-dirs) modules
$(module-dirs): crmodverdir $(objtree)/Module.symvers
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
@@ -582,7 +541,7 @@ index 1928fcd..e58439b 100644
modules: $(module-dirs)
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
-@@ -1524,17 +1541,21 @@ else
+@@ -1531,17 +1548,21 @@ else
target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
endif
@@ -608,7 +567,7 @@ index 1928fcd..e58439b 100644
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.symtypes: %.c prepare scripts FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
-@@ -1546,11 +1567,15 @@ endif
+@@ -1553,11 +1574,15 @@ endif
$(build)=$(build-dir)
# Make sure the latest headers are built for Documentation
Documentation/: headers_install
@@ -729,15 +688,15 @@ index a9a1195..e9b8417 100644
#define _PAGE_NORMAL(x) __pgprot(_PAGE_VALID | __ACCESS_BITS | (x))
diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
-index 2fd00b7..cfd5069 100644
+index 936bc8f..bb1859f 100644
--- a/arch/alpha/kernel/module.c
+++ b/arch/alpha/kernel/module.c
@@ -160,7 +160,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
/* The small sections were sorted to the end of the segment.
The following should definitely cover them. */
-- gp = (u64)me->module_core + me->core_size - 0x8000;
-+ gp = (u64)me->module_core_rw + me->core_size_rw - 0x8000;
+- gp = (u64)me->core_layout.base + me->core_layout.size - 0x8000;
++ gp = (u64)me->core_layout.base_rw + me->core_layout.size_rw - 0x8000;
got = sechdrs[me->arch.gotsecindex].sh_addr;
for (i = 0; i < n; i++) {
@@ -957,7 +916,7 @@ index 4a905bd..0a4da53 100644
/* Allow reads even for write-only mappings */
if (!(vma->vm_flags & (VM_READ | VM_WRITE)))
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
-index 6312f60..bd07545 100644
+index 8a188bc..26608f1 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -528,6 +528,7 @@ config ARC_DBG_TLB_MISS_COUNT
@@ -969,10 +928,10 @@ index 6312f60..bd07545 100644
Counts number of I and D TLB Misses and exports them via Debugfs
The counters can be cleared via Debugfs as well
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index 34e1569..b48ad87 100644
+index 4f799e5..261490f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -1690,6 +1690,7 @@ config HIGHPTE
+@@ -1622,6 +1622,7 @@ config HIGHPTE
config CPU_SW_DOMAIN_PAN
bool "Enable use of CPU domains to implement privileged no-access"
depends on MMU && !ARM_LPAE
@@ -980,7 +939,7 @@ index 34e1569..b48ad87 100644
default y
help
Increase kernel security by ensuring that normal kernel accesses
-@@ -1766,7 +1767,7 @@ config ALIGNMENT_TRAP
+@@ -1698,7 +1699,7 @@ config ALIGNMENT_TRAP
config UACCESS_WITH_MEMCPY
bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user()"
@@ -989,7 +948,7 @@ index 34e1569..b48ad87 100644
default y if CPU_FEROCEON
help
Implement faster copy_to_user and clear_user methods for CPU
-@@ -2001,6 +2002,7 @@ config KEXEC
+@@ -1953,6 +1954,7 @@ config KEXEC
depends on (!SMP || PM_SLEEP_SMP)
depends on !CPU_V7M
select KEXEC_CORE
@@ -998,7 +957,7 @@ index 34e1569..b48ad87 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/arm/Kconfig.debug b/arch/arm/Kconfig.debug
-index ddbb361..caf403d 100644
+index c6b6175..2884505 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -7,6 +7,7 @@ config ARM_PTDUMP
@@ -1663,12 +1622,12 @@ index 97882f9..0cc6ef1 100644
#include <asm-generic/cmpxchg-local.h>
diff --git a/arch/arm/include/asm/cpuidle.h b/arch/arm/include/asm/cpuidle.h
-index 0f84249..8e83c55 100644
+index 3848259..bee9d84 100644
--- a/arch/arm/include/asm/cpuidle.h
+++ b/arch/arm/include/asm/cpuidle.h
@@ -32,7 +32,7 @@ struct device_node;
struct cpuidle_ops {
- int (*suspend)(int cpu, unsigned long arg);
+ int (*suspend)(unsigned long arg);
int (*init)(struct device_node *, int cpu);
-};
+} __no_const;
@@ -1828,7 +1787,7 @@ index 9e614a1..3302cca 100644
struct dma_struct {
void *addr; /* single DMA address */
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
-index f98c7f3..e5c626d 100644
+index 9b7c328..2dfe68b 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -23,17 +23,19 @@ struct map_desc {
@@ -1988,7 +1947,7 @@ index aeddd28..207745c 100644
* These are the memory types, defined to be compatible with
* pre-ARMv6 CPUs cacheable and bufferable bits: n/a,n/a,C,B
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
-index a745a2a..481350a 100644
+index dc46398..70dab92 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -80,6 +80,7 @@
@@ -1999,8 +1958,8 @@ index a745a2a..481350a 100644
#define L_PTE_XN (_AT(pteval_t, 1) << 54) /* XN */
#define L_PTE_DIRTY (_AT(pteval_t, 1) << 55)
#define L_PTE_SPECIAL (_AT(pteval_t, 1) << 56)
-@@ -91,10 +92,12 @@
- #define L_PMD_SECT_SPLITTING (_AT(pmdval_t, 1) << 56)
+@@ -90,10 +91,12 @@
+ #define L_PMD_SECT_DIRTY (_AT(pmdval_t, 1) << 55)
#define L_PMD_SECT_NONE (_AT(pmdval_t, 1) << 57)
#define L_PMD_SECT_RDONLY (_AT(pteval_t, 1) << 58)
+#define PMD_SECT_RDONLY PMD_SECT_AP2
@@ -2393,10 +2352,10 @@ index 5af0ed1..cea83883 100644
#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
-index f89811f..1d110d1 100644
+index 7e45f69..2c047db 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
-@@ -58,7 +58,7 @@ EXPORT_SYMBOL(arm_delay_ops);
+@@ -59,7 +59,7 @@ EXPORT_SYMBOL(arm_delay_ops);
/* networking */
EXPORT_SYMBOL(csum_partial);
@@ -2406,7 +2365,7 @@ index f89811f..1d110d1 100644
EXPORT_SYMBOL(__csum_ipv6_magic);
diff --git a/arch/arm/kernel/cpuidle.c b/arch/arm/kernel/cpuidle.c
-index 318da33..373689f 100644
+index 703926e..39aa432 100644
--- a/arch/arm/kernel/cpuidle.c
+++ b/arch/arm/kernel/cpuidle.c
@@ -19,7 +19,7 @@ extern struct of_cpuidle_method __cpuidle_method_of_table[];
@@ -2791,7 +2750,7 @@ index 059c3da..8e45cfc 100644
flush_icache_range((unsigned long)base + offset, offset +
length);
diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-plts.c
-index 097e2e2..3927085 100644
+index 0c7efc3..3927085 100644
--- a/arch/arm/kernel/module-plts.c
+++ b/arch/arm/kernel/module-plts.c
@@ -30,17 +30,12 @@ struct plt_entries {
@@ -2800,7 +2759,7 @@ index 097e2e2..3927085 100644
-static bool in_init(const struct module *mod, u32 addr)
-{
-- return addr - (u32)mod->module_init < mod->init_size;
+- return addr - (u32)mod->init_layout.base < mod->init_layout.size;
-}
-
u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val)
@@ -3066,10 +3025,10 @@ index 3826935..8ed63ed 100644
/*
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
-index 20edd34..e18ac81 100644
+index c86ea8a..fd03a2d 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
-@@ -110,21 +110,23 @@ EXPORT_SYMBOL(elf_hwcap);
+@@ -113,21 +113,23 @@ EXPORT_SYMBOL(elf_hwcap);
unsigned int elf_hwcap2 __read_mostly;
EXPORT_SYMBOL(elf_hwcap2);
@@ -3098,7 +3057,7 @@ index 20edd34..e18ac81 100644
EXPORT_SYMBOL(outer_cache);
#endif
-@@ -255,9 +257,13 @@ static int __get_cpu_architecture(void)
+@@ -258,9 +260,13 @@ static int __get_cpu_architecture(void)
* Register 0 and check for VMSAv7 or PMSAv7 */
unsigned int mmfr0 = read_cpuid_ext(CPUID_EXT_MMFR0);
if ((mmfr0 & 0x0000000f) >= 0x00000003 ||
@@ -3172,10 +3131,10 @@ index 7b8f214..ece8e28 100644
- return page;
-}
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
-index b263613..93419ed 100644
+index 37312f6..bb32c9b 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
-@@ -78,7 +78,7 @@ enum ipi_msg_type {
+@@ -82,7 +82,7 @@ enum ipi_msg_type {
static DECLARE_COMPLETION(cpu_running);
@@ -3271,19 +3230,19 @@ index 8b60fde..8d986dd 100644
# ifdef CONFIG_ARM_KERNMEM_PERMS
. = ALIGN(1<<SECTION_SHIFT);
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
-index e06fd29..0d3f8ab 100644
+index dda1959..0de41b4 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
-@@ -57,7 +57,7 @@ static unsigned long hyp_default_vectors;
+@@ -58,7 +58,7 @@ static unsigned long hyp_default_vectors;
static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_arm_running_vcpu);
/* The VMID used in the VTTBR */
-static atomic64_t kvm_vmid_gen = ATOMIC64_INIT(1);
+static atomic64_unchecked_t kvm_vmid_gen = ATOMIC64_INIT(1);
- static u8 kvm_next_vmid;
+ static u32 kvm_next_vmid;
+ static unsigned int kvm_vmid_bits __read_mostly;
static DEFINE_SPINLOCK(kvm_vmid_lock);
-
-@@ -380,7 +380,7 @@ void force_vm_exit(const cpumask_t *mask)
+@@ -387,7 +387,7 @@ void force_vm_exit(const cpumask_t *mask)
*/
static bool need_new_vmid_gen(struct kvm *kvm)
{
@@ -3292,7 +3251,7 @@ index e06fd29..0d3f8ab 100644
}
/**
-@@ -413,7 +413,7 @@ static void update_vttbr(struct kvm *kvm)
+@@ -420,7 +420,7 @@ static void update_vttbr(struct kvm *kvm)
/* First user of a new VMID generation? */
if (unlikely(kvm_next_vmid == 0)) {
@@ -3301,7 +3260,7 @@ index e06fd29..0d3f8ab 100644
kvm_next_vmid = 1;
/*
-@@ -430,7 +430,7 @@ static void update_vttbr(struct kvm *kvm)
+@@ -437,7 +437,7 @@ static void update_vttbr(struct kvm *kvm)
kvm_call_hyp(__kvm_flush_vm_context);
}
@@ -3309,7 +3268,7 @@ index e06fd29..0d3f8ab 100644
+ kvm->arch.vmid_gen = atomic64_read_unchecked(&kvm_vmid_gen);
kvm->arch.vmid = kvm_next_vmid;
kvm_next_vmid++;
-
+ kvm_next_vmid &= (1 << kvm_vmid_bits) - 1;
diff --git a/arch/arm/lib/copy_page.S b/arch/arm/lib/copy_page.S
index 6ee2f67..d1cce76 100644
--- a/arch/arm/lib/copy_page.S
@@ -3351,10 +3310,10 @@ index 8044591..c9b2609 100644
.const_udelay = __loop_const_udelay,
.udelay = __loop_udelay,
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c
-index 588bbc2..4f57e0b 100644
+index 6bd1089..e999400 100644
--- a/arch/arm/lib/uaccess_with_memcpy.c
+++ b/arch/arm/lib/uaccess_with_memcpy.c
-@@ -85,7 +85,7 @@ pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp)
+@@ -84,7 +84,7 @@ pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp)
return 1;
}
@@ -3363,7 +3322,7 @@ index 588bbc2..4f57e0b 100644
__copy_to_user_memcpy(void __user *to, const void *from, unsigned long n)
{
unsigned long ua_flags;
-@@ -158,7 +158,7 @@ arm_copy_to_user(void __user *to, const void *from, unsigned long n)
+@@ -157,7 +157,7 @@ arm_copy_to_user(void __user *to, const void *from, unsigned long n)
return n;
}
@@ -3447,7 +3406,7 @@ index 65024af..70bf184 100644
.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 79e1f87..6dd91e3 100644
+index c625cc1..3f47aae 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -19,6 +19,7 @@
@@ -3459,10 +3418,10 @@ index 79e1f87..6dd91e3 100644
#include <asm/smp_scu.h>
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
-index 72ebc4c..18c4406 100644
+index f7ff3b9..e6d5420 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
-@@ -504,7 +504,7 @@ void omap_device_delete(struct omap_device *od)
+@@ -515,7 +515,7 @@ void omap_device_delete(struct omap_device *od)
struct platform_device __init *omap_device_build(const char *pdev_name,
int pdev_id,
struct omap_hwmod *oh,
@@ -3471,7 +3430,7 @@ index 72ebc4c..18c4406 100644
{
struct omap_hwmod *ohs[] = { oh };
-@@ -532,7 +532,7 @@ struct platform_device __init *omap_device_build(const char *pdev_name,
+@@ -543,7 +543,7 @@ struct platform_device __init *omap_device_build(const char *pdev_name,
struct platform_device __init *omap_device_build_ss(const char *pdev_name,
int pdev_id,
struct omap_hwmod **ohs,
@@ -3500,7 +3459,7 @@ 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 8e0bd59..1d0b85e 100644
+index b6d62e4..6ba9f74 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -200,10 +200,10 @@ struct omap_hwmod_soc_ops {
@@ -3564,7 +3523,7 @@ 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-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
-index 911884f..2f3aa90 100644
+index aba75c8..b55a9d7 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -22,6 +22,7 @@
@@ -3575,7 +3534,7 @@ index 911884f..2f3aa90 100644
#include "common.h"
#include "platsmp-apmu.h"
-@@ -233,6 +234,8 @@ static int shmobile_smp_apmu_enter_suspend(suspend_state_t state)
+@@ -232,6 +233,8 @@ static int shmobile_smp_apmu_enter_suspend(suspend_state_t state)
void __init shmobile_smp_apmu_suspend_init(void)
{
@@ -3623,7 +3582,7 @@ index 8538910..2f39bc4 100644
#include <linux/delay.h>
#include <linux/io.h>
diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
-index f66816c..228b951 100644
+index 7cd9865..a00b6ab 100644
--- a/arch/arm/mach-zynq/platsmp.c
+++ b/arch/arm/mach-zynq/platsmp.c
@@ -24,6 +24,7 @@
@@ -3635,7 +3594,7 @@ index f66816c..228b951 100644
#include "common.h"
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
-index 4121886..d24c0a1 100644
+index 549f6d3..909a9dc 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -442,6 +442,7 @@ config CPU_32v5
@@ -3682,7 +3641,7 @@ index 4121886..d24c0a1 100644
select GENERIC_TIME_VSYSCALL
help
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
-index 493692d..42a4504 100644
+index 9f9d542..5189649 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -44,7 +44,7 @@ struct l2c_init_data {
@@ -3993,10 +3952,10 @@ index 05ec5e0..0b70277 100644
unsigned long search_exception_table(unsigned long addr);
void early_abt_enable(void);
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
-index 7f8cd1b..6ac64cd 100644
+index 49bd081..a4502de 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
-@@ -742,7 +742,46 @@ void free_tcmmem(void)
+@@ -745,7 +745,46 @@ void free_tcmmem(void)
{
#ifdef CONFIG_HAVE_TCM
extern char __tcm_start, __tcm_end;
@@ -4044,10 +4003,10 @@ index 7f8cd1b..6ac64cd 100644
free_reserved_area(&__tcm_start, &__tcm_end, -1, "TCM link");
#endif
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
-index 0c81056..97279f7 100644
+index 66a978d..e808c4b 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
-@@ -405,9 +405,9 @@ __arm_ioremap_exec(phys_addr_t phys_addr, size_t size, bool cached)
+@@ -406,9 +406,9 @@ __arm_ioremap_exec(phys_addr_t phys_addr, size_t size, bool cached)
unsigned int mtype;
if (cached)
@@ -4060,7 +4019,7 @@ index 0c81056..97279f7 100644
return __arm_ioremap_caller(phys_addr, size, mtype,
__builtin_return_address(0));
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
-index 407dc78..047ce9d 100644
+index 66353ca..8aad9f8 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -59,6 +59,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
@@ -4092,7 +4051,7 @@ index 407dc78..047ce9d 100644
return addr;
}
-@@ -99,6 +103,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -99,19 +103,21 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
info.high_limit = TASK_SIZE;
info.align_mask = do_align ? (PAGE_MASK & (SHMLBA - 1)) : 0;
info.align_offset = pgoff << PAGE_SHIFT;
@@ -4100,7 +4059,16 @@ index 407dc78..047ce9d 100644
return vm_unmapped_area(&info);
}
-@@ -112,6 +117,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+ unsigned long
+-arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+- const unsigned long len, const unsigned long pgoff,
+- const unsigned long flags)
++arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr0,
++ unsigned long len, unsigned long pgoff,
++ unsigned long flags)
+ {
+ struct vm_area_struct *vma;
+ struct mm_struct *mm = current->mm;
unsigned long addr = addr0;
int do_align = 0;
int aliasing = cache_is_vipt_aliasing();
@@ -4137,7 +4105,7 @@ index 407dc78..047ce9d 100644
addr = vm_unmapped_area(&info);
/*
-@@ -183,14 +193,30 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
+@@ -182,14 +192,30 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
{
unsigned long random_factor = 0UL;
@@ -4169,7 +4137,7 @@ index 407dc78..047ce9d 100644
}
}
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
-index 4867f5d..dbfed1e 100644
+index 434d76f..af843d5 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -243,7 +243,15 @@ __setup("noalign", noalign_setup);
@@ -4374,7 +4342,7 @@ index 4867f5d..dbfed1e 100644
break;
}
pr_info("Memory policy: %sData cache %s\n",
-@@ -896,7 +937,7 @@ static void __init create_mapping(struct map_desc *md)
+@@ -958,7 +999,7 @@ static void __init create_mapping(struct map_desc *md)
return;
}
@@ -4383,7 +4351,7 @@ index 4867f5d..dbfed1e 100644
md->virtual >= PAGE_OFFSET && md->virtual < FIXADDR_START &&
(md->virtual < VMALLOC_START || md->virtual >= VMALLOC_END)) {
pr_warn("BUG: mapping for 0x%08llx at 0x%08lx out of vmalloc space\n",
-@@ -1266,18 +1307,15 @@ void __init arm_mm_memblock_reserve(void)
+@@ -1309,18 +1350,15 @@ void __init arm_mm_memblock_reserve(void)
* Any other function or debugging method which may touch any device _will_
* crash the kernel.
*/
@@ -4406,7 +4374,7 @@ index 4867f5d..dbfed1e 100644
/*
* Clear page table except top pmd used by early fixmaps
-@@ -1293,7 +1331,7 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
+@@ -1336,7 +1374,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;
@@ -4415,7 +4383,7 @@ index 4867f5d..dbfed1e 100644
create_mapping(&map);
#endif
-@@ -1304,14 +1342,14 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
+@@ -1347,14 +1385,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;
@@ -4432,7 +4400,7 @@ index 4867f5d..dbfed1e 100644
create_mapping(&map);
#endif
-@@ -1320,7 +1358,7 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
+@@ -1363,7 +1401,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.
*/
@@ -4441,7 +4409,7 @@ index 4867f5d..dbfed1e 100644
map.virtual = 0xffff0000;
map.length = PAGE_SIZE;
#ifdef CONFIG_KUSER_HELPERS
-@@ -1383,8 +1421,10 @@ static void __init kmap_init(void)
+@@ -1426,8 +1464,10 @@ static void __init kmap_init(void)
static void __init map_lowmem(void)
{
struct memblock_region *reg;
@@ -4452,7 +4420,7 @@ index 4867f5d..dbfed1e 100644
/* Map all the lowmem memory banks. */
for_each_memblock(memory, reg) {
-@@ -1397,11 +1437,48 @@ static void __init map_lowmem(void)
+@@ -1443,11 +1483,48 @@ static void __init map_lowmem(void)
if (start >= end)
break;
@@ -4502,7 +4470,7 @@ index 4867f5d..dbfed1e 100644
create_mapping(&map);
} else if (start >= kernel_x_end) {
-@@ -1425,7 +1502,7 @@ static void __init map_lowmem(void)
+@@ -1471,7 +1548,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;
@@ -4511,7 +4479,7 @@ index 4867f5d..dbfed1e 100644
create_mapping(&map);
-@@ -1438,6 +1515,7 @@ static void __init map_lowmem(void)
+@@ -1484,6 +1561,7 @@ static void __init map_lowmem(void)
create_mapping(&map);
}
}
@@ -4519,20 +4487,6 @@ index 4867f5d..dbfed1e 100644
}
}
-diff --git a/arch/arm/mm/pageattr.c b/arch/arm/mm/pageattr.c
-index cf30daf..d19b1ad 100644
---- a/arch/arm/mm/pageattr.c
-+++ b/arch/arm/mm/pageattr.c
-@@ -49,6 +49,9 @@ static int change_memory_common(unsigned long addr, int numpages,
- WARN_ON_ONCE(1);
- }
-
-+ if (!numpages)
-+ return 0;
-+
- if (start < MODULES_VADDR || start >= MODULES_END)
- return -EINVAL;
-
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index 93d0b6d..2db6d99 100644
--- a/arch/arm/net/bpf_jit_32.c
@@ -4677,7 +4631,7 @@ index a5bc92d..0bb4730 100644
+ pax_close_kernel();
}
diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug
-index 04fb73b..368beca 100644
+index e13c4bf..3feaea7 100644
--- a/arch/arm64/Kconfig.debug
+++ b/arch/arm64/Kconfig.debug
@@ -6,6 +6,7 @@ config ARM64_PTDUMP
@@ -4762,7 +4716,7 @@ index b2ede967..865eed5 100644
#define user_addr_max get_fs
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
-index 354144e..f8c556b 100644
+index a6e757c..00fc586 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -132,7 +132,7 @@ static void __dma_free_coherent(struct device *dev, size_t size,
@@ -5036,10 +4990,10 @@ index 69952c18..4fa2908 100644
#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
-index eb0249e..388ff32 100644
+index fb0515e..ca9715a 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
-@@ -519,6 +519,7 @@ config KEXEC
+@@ -518,6 +518,7 @@ config KEXEC
bool "kexec system call"
depends on !IA64_HP_SIM && (!SMP || HOTPLUG_CPU)
select KEXEC_CORE
@@ -5261,84 +5215,57 @@ index 4f3fb6cc..254055e 100644
})
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
-index b15933c..098b1c8 100644
+index 6ab0ae7..88f1b60 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
-@@ -484,15 +484,39 @@ module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings,
- }
-
+@@ -486,13 +486,13 @@ module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings,
static inline int
-+in_init_rx (const struct module *mod, uint64_t addr)
-+{
-+ return addr - (uint64_t) mod->module_init_rx < mod->init_size_rx;
-+}
-+
-+static inline int
-+in_init_rw (const struct module *mod, uint64_t addr)
-+{
-+ return addr - (uint64_t) mod->module_init_rw < mod->init_size_rw;
-+}
-+
-+static inline int
in_init (const struct module *mod, uint64_t addr)
{
-- return addr - (uint64_t) mod->module_init < mod->init_size;
-+ return in_init_rx(mod, addr) || in_init_rw(mod, addr);
-+}
-+
-+static inline int
-+in_core_rx (const struct module *mod, uint64_t addr)
-+{
-+ return addr - (uint64_t) mod->module_core_rx < mod->core_size_rx;
-+}
-+
-+static inline int
-+in_core_rw (const struct module *mod, uint64_t addr)
-+{
-+ return addr - (uint64_t) mod->module_core_rw < mod->core_size_rw;
+- return addr - (uint64_t) mod->init_layout.base < mod->init_layout.size;
++ return within_module_init(addr, mod);
}
static inline int
in_core (const struct module *mod, uint64_t addr)
{
-- return addr - (uint64_t) mod->module_core < mod->core_size;
-+ return in_core_rx(mod, addr) || in_core_rw(mod, addr);
+- return addr - (uint64_t) mod->core_layout.base < mod->core_layout.size;
++ return within_module_core(addr, mod);
}
static inline int
-@@ -675,7 +699,14 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
- break;
+@@ -676,6 +676,14 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
case RV_BDREL:
-- val -= (uint64_t) (in_init(mod, val) ? mod->module_init : mod->module_core);
-+ if (in_init_rx(mod, val))
-+ val -= (uint64_t) mod->module_init_rx;
-+ else if (in_init_rw(mod, val))
-+ val -= (uint64_t) mod->module_init_rw;
-+ else if (in_core_rx(mod, val))
-+ val -= (uint64_t) mod->module_core_rx;
-+ else if (in_core_rw(mod, val))
-+ val -= (uint64_t) mod->module_core_rw;
+ val -= (uint64_t) (in_init(mod, val) ? mod->init_layout.base : mod->core_layout.base);
++ if (within_module_rx(val, &mod->init_layout))
++ val -= mod->init_layout.base_rx;
++ else if (within_module_rw(val, &mod->init_layout))
++ val -= mod->init_layout.base_rw;
++ else if (within_module_rx(val, &mod->core_layout))
++ val -= mod->core_layout.base_rx;
++ else if (within_module_rw(val, &mod->core_layout))
++ val -= mod->core_layout.base_rw;
break;
case RV_LTV:
-@@ -810,15 +841,15 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
+@@ -810,15 +818,15 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
* addresses have been selected...
*/
uint64_t gp;
-- if (mod->core_size > MAX_LTOFF)
-+ if (mod->core_size_rx + mod->core_size_rw > MAX_LTOFF)
+- if (mod->core_layout.size > MAX_LTOFF)
++ if (mod->core_layout.size_rx + mod->core_layout.size_rw > MAX_LTOFF)
/*
* This takes advantage of fact that SHF_ARCH_SMALL gets allocated
* at the end of the module.
*/
-- gp = mod->core_size - MAX_LTOFF / 2;
-+ gp = mod->core_size_rx + mod->core_size_rw - MAX_LTOFF / 2;
+- gp = mod->core_layout.size - MAX_LTOFF / 2;
++ gp = mod->core_layout.size_rx + mod->core_layout.size_rw - MAX_LTOFF / 2;
else
-- gp = mod->core_size / 2;
-- gp = (uint64_t) mod->module_core + ((gp + 7) & -8);
-+ gp = (mod->core_size_rx + mod->core_size_rw) / 2;
-+ gp = (uint64_t) mod->module_core_rx + ((gp + 7) & -8);
+- gp = mod->core_layout.size / 2;
+- gp = (uint64_t) mod->core_layout.base + ((gp + 7) & -8);
++ gp = (mod->core_layout.size_rx + mod->core_layout.size_rw) / 2;
++ gp = (uint64_t) mod->core_layout.base_rx + ((gp + 7) & -8);
mod->arch.gp = gp;
DEBUGP("%s: placing gp at 0x%lx\n", __func__, gp);
}
@@ -5594,10 +5521,10 @@ index 4efe96a..60e8699 100644
#define SMP_CACHE_BYTES L1_CACHE_BYTES
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
-index db45961..6932668 100644
+index d3da79d..e607104 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -2642,6 +2642,7 @@ source "kernel/Kconfig.preempt"
+@@ -2656,6 +2656,7 @@ source "kernel/Kconfig.preempt"
config KEXEC
bool "Kexec system call"
select KEXEC_CORE
@@ -6255,10 +6182,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 b01a6ff..aa29db0 100644
+index e090fc3..eae24400 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
-@@ -420,6 +420,13 @@ extern const char *__elf_platform;
+@@ -425,6 +425,13 @@ extern const char *__elf_platform;
#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
#endif
@@ -6418,7 +6345,7 @@ index b336037..5b874cc 100644
/*
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
-index 18826aa..f5a6216 100644
+index 9a4fe01..3aa92e9 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -20,6 +20,9 @@
@@ -6486,7 +6413,7 @@ index 095ecaf..f1da6ff 100644
likely(__access_ok((addr), (size), __access_mask))
diff --git a/arch/mips/kernel/binfmt_elfn32.c b/arch/mips/kernel/binfmt_elfn32.c
-index 1188e00..41cf144 100644
+index 1b992c6..4f250db 100644
--- a/arch/mips/kernel/binfmt_elfn32.c
+++ b/arch/mips/kernel/binfmt_elfn32.c
@@ -50,6 +50,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
@@ -6504,7 +6431,7 @@ index 1188e00..41cf144 100644
#include <linux/module.h>
#include <linux/elfcore.h>
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
-index 9287678..f870e47 100644
+index abd3aff..ab1b84a 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
@@ -70,6 +70,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
@@ -6590,10 +6517,10 @@ index f63a289..53037c22 100644
/* Run the generated entry code */
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
-index f2975d4..f61d355 100644
+index eddd5fd..97314be 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
-@@ -541,18 +541,6 @@ out:
+@@ -539,18 +539,6 @@ out:
return pc;
}
@@ -6613,10 +6540,10 @@ index f2975d4..f61d355 100644
{
struct pt_regs *regs;
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
-index 4f0ac78..491124a 100644
+index a5279b2..50b73be 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
-@@ -873,6 +873,10 @@ long arch_ptrace(struct task_struct *child, long request,
+@@ -870,6 +870,10 @@ long arch_ptrace(struct task_struct *child, long request,
return ret;
}
@@ -6627,7 +6554,7 @@ index 4f0ac78..491124a 100644
/*
* Notification of system call entry/exit
* - triggered by current->work.syscall_trace
-@@ -891,6 +895,11 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
+@@ -888,6 +892,11 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
tracehook_report_syscall_entry(regs))
ret = -1;
@@ -6640,21 +6567,21 @@ index 4f0ac78..491124a 100644
trace_sys_enter(regs, regs->regs[2]);
diff --git a/arch/mips/kernel/sync-r4k.c b/arch/mips/kernel/sync-r4k.c
-index 2242bdd..b284048 100644
+index 4472a7f..c5905e6 100644
--- a/arch/mips/kernel/sync-r4k.c
+++ b/arch/mips/kernel/sync-r4k.c
@@ -18,8 +18,8 @@
#include <asm/mipsregs.h>
- static atomic_t count_start_flag = ATOMIC_INIT(0);
+ static unsigned int initcount = 0;
-static atomic_t count_count_start = ATOMIC_INIT(0);
-static atomic_t count_count_stop = ATOMIC_INIT(0);
+static atomic_unchecked_t count_count_start = ATOMIC_INIT(0);
+static atomic_unchecked_t count_count_stop = ATOMIC_INIT(0);
- static atomic_t count_reference = ATOMIC_INIT(0);
#define COUNTON 100
-@@ -58,13 +58,13 @@ void synchronise_count_master(int cpu)
+ #define NR_LOOPS 3
+@@ -46,13 +46,13 @@ void synchronise_count_master(int cpu)
for (i = 0; i < NR_LOOPS; i++) {
/* slaves loop on '!= 2' */
@@ -6665,15 +6592,15 @@ index 2242bdd..b284048 100644
+ atomic_set_unchecked(&count_count_stop, 0);
smp_wmb();
- /* this lets the slaves write their count register */
+ /* Let the slave writes its count register */
- atomic_inc(&count_count_start);
+ atomic_inc_unchecked(&count_count_start);
+ /* Count will be initialised to current timer */
+ if (i == 1)
+@@ -67,11 +67,11 @@ void synchronise_count_master(int cpu)
/*
- * Everyone initialises count in the last loop:
-@@ -75,11 +75,11 @@ void synchronise_count_master(int cpu)
- /*
- * Wait for all slaves to leave the synchronization point:
+ * Wait for slave to leave the synchronization point:
*/
- while (atomic_read(&count_count_stop) != 1)
+ while (atomic_read_unchecked(&count_count_stop) != 1)
@@ -6686,8 +6613,8 @@ index 2242bdd..b284048 100644
}
/* Arrange for an interrupt in a short while */
write_c0_compare(read_c0_count() + COUNTON);
-@@ -112,8 +112,8 @@ void synchronise_count_slave(int cpu)
- initcount = atomic_read(&count_reference);
+@@ -96,8 +96,8 @@ void synchronise_count_slave(int cpu)
+ */
for (i = 0; i < NR_LOOPS; i++) {
- atomic_inc(&count_count_start);
@@ -6697,7 +6624,7 @@ index 2242bdd..b284048 100644
mb();
/*
-@@ -122,8 +122,8 @@ void synchronise_count_slave(int cpu)
+@@ -106,8 +106,8 @@ void synchronise_count_slave(int cpu)
if (i == NR_LOOPS-1)
write_c0_count(initcount);
@@ -6709,7 +6636,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 ca9a810..e00a026 100644
+index bf14da9..d1e0ded 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -697,7 +697,18 @@ asmlinkage void do_ov(struct pt_regs *regs)
@@ -6903,8 +6830,25 @@ index 4b88fa0..b16bc17 100644
tsk->thread.cp0_badvaddr = address;
tsk->thread.error_code = write;
if (show_unhandled_signals &&
+diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
+index 7e5fa09..65c1072 100644
+--- a/arch/mips/mm/init.c
++++ b/arch/mips/mm/init.c
+@@ -468,10 +468,10 @@ void __init mem_init(void)
+
+ #ifdef CONFIG_64BIT
+ if ((unsigned long) &_text > (unsigned long) CKSEG0)
+- /* The -4 is a hack so that user tools don't have to handle
++ /* The -0x2000-4 is a hack so that user tools don't have to handle
+ the overflow. */
+ kclist_add(&kcore_kseg0, (void *) CKSEG0,
+- 0x80000000 - 4, KCORE_TEXT);
++ 0x80000000 - 0x2000 - 4, KCORE_TEXT);
+ #endif
+ }
+ #endif /* !CONFIG_NEED_MULTIPLE_NODES */
diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c
-index 5c81fdd..db158d3 100644
+index 3530376..81fb96b 100644
--- a/arch/mips/mm/mmap.c
+++ b/arch/mips/mm/mmap.c
@@ -59,6 +59,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
@@ -6978,7 +6922,7 @@ index 5c81fdd..db158d3 100644
-static inline unsigned long brk_rnd(void)
-{
-- unsigned long rnd = get_random_int();
+- unsigned long rnd = get_random_long();
-
- rnd = rnd << PAGE_SHIFT;
- /* 8MB for 32bit, 256MB for 64bit */
@@ -7120,6 +7064,19 @@ index bcb5df2..84fabd2 100644
#define L1_CACHE_WAYDISP 0x1000 /* distance from one way to the next */
#define L1_CACHE_TAG_VALID 0x00000001 /* cache tag valid bit */
+diff --git a/arch/nios2/lib/memset.c b/arch/nios2/lib/memset.c
+index c2cfcb1..2fcefe7 100644
+--- a/arch/nios2/lib/memset.c
++++ b/arch/nios2/lib/memset.c
+@@ -68,7 +68,7 @@ void *memset(void *s, int c, size_t count)
+ "=r" (charcnt), /* %1 Output */
+ "=r" (dwordcnt), /* %2 Output */
+ "=r" (fill8reg), /* %3 Output */
+- "=r" (wrkrega) /* %4 Output */
++ "=&r" (wrkrega) /* %4 Output only */
+ : "r" (c), /* %5 Input */
+ "0" (s), /* %0 Input/Output */
+ "1" (count) /* %1 Input/Output */
diff --git a/arch/openrisc/include/asm/cache.h b/arch/openrisc/include/asm/cache.h
index 4ce7a01..449202a 100644
--- a/arch/openrisc/include/asm/cache.h
@@ -7263,105 +7220,79 @@ index 1960b87..e8f57e3 100644
else
copy_from_user_overflow();
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
-index 3c63a82..b1d6ee9 100644
+index b9d75d9..dae5c9a 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
-@@ -98,16 +98,38 @@
-
- /* three functions to determine where in the module core
+@@ -100,14 +100,12 @@
* or init pieces the location is */
-+static inline int in_init_rx(struct module *me, void *loc)
-+{
-+ return (loc >= me->module_init_rx &&
-+ loc < (me->module_init_rx + me->init_size_rx));
-+}
-+
-+static inline int in_init_rw(struct module *me, void *loc)
-+{
-+ return (loc >= me->module_init_rw &&
-+ loc < (me->module_init_rw + me->init_size_rw));
-+}
-+
static inline int in_init(struct module *me, void *loc)
{
-- return (loc >= me->module_init &&
-- loc <= (me->module_init + me->init_size));
-+ return in_init_rx(me, loc) || in_init_rw(me, loc);
-+}
-+
-+static inline int in_core_rx(struct module *me, void *loc)
-+{
-+ return (loc >= me->module_core_rx &&
-+ loc < (me->module_core_rx + me->core_size_rx));
-+}
-+
-+static inline int in_core_rw(struct module *me, void *loc)
-+{
-+ return (loc >= me->module_core_rw &&
-+ loc < (me->module_core_rw + me->core_size_rw));
+- return (loc >= me->init_layout.base &&
+- loc <= (me->init_layout.base + me->init_layout.size));
++ within_module_init((unsigned long)loc, me);
}
static inline int in_core(struct module *me, void *loc)
{
-- return (loc >= me->module_core &&
-- loc <= (me->module_core + me->core_size));
-+ return in_core_rx(me, loc) || in_core_rw(me, loc);
+- return (loc >= me->core_layout.base &&
+- loc <= (me->core_layout.base + me->core_layout.size));
++ within_module_core((unsigned long)loc, me);
}
static inline int in_local(struct module *me, void *loc)
-@@ -367,13 +389,13 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr,
+@@ -367,13 +365,13 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr,
}
/* align things a bit */
-- me->core_size = ALIGN(me->core_size, 16);
-- me->arch.got_offset = me->core_size;
-- me->core_size += gots * sizeof(struct got_entry);
-+ me->core_size_rw = ALIGN(me->core_size_rw, 16);
-+ me->arch.got_offset = me->core_size_rw;
-+ me->core_size_rw += gots * sizeof(struct got_entry);
-
-- me->core_size = ALIGN(me->core_size, 16);
-- me->arch.fdesc_offset = me->core_size;
-- me->core_size += fdescs * sizeof(Elf_Fdesc);
-+ me->core_size_rw = ALIGN(me->core_size_rw, 16);
-+ me->arch.fdesc_offset = me->core_size_rw;
-+ me->core_size_rw += fdescs * sizeof(Elf_Fdesc);
+- me->core_layout.size = ALIGN(me->core_layout.size, 16);
+- me->arch.got_offset = me->core_layout.size;
+- me->core_layout.size += gots * sizeof(struct got_entry);
++ me->core_layout.size_rw = ALIGN(me->core_layout.size_rw, 16);
++ me->arch.got_offset = me->core_layout.size_rw;
++ me->core_layout.size_rw += gots * sizeof(struct got_entry);
+
+- me->core_layout.size = ALIGN(me->core_layout.size, 16);
+- me->arch.fdesc_offset = me->core_layout.size;
+- me->core_layout.size += fdescs * sizeof(Elf_Fdesc);
++ me->core_layout.size_rw = ALIGN(me->core_layout.size_rw, 16);
++ me->arch.fdesc_offset = me->core_layout.size_rw;
++ me->core_layout.size_rw += fdescs * sizeof(Elf_Fdesc);
me->arch.got_max = gots;
me->arch.fdesc_max = fdescs;
-@@ -391,7 +413,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend)
+@@ -391,7 +389,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend)
BUG_ON(value == 0);
-- got = me->module_core + me->arch.got_offset;
-+ got = me->module_core_rw + me->arch.got_offset;
+- got = me->core_layout.base + me->arch.got_offset;
++ got = me->core_layout.base_rw + me->arch.got_offset;
for (i = 0; got[i].addr; i++)
if (got[i].addr == value)
goto out;
-@@ -409,7 +431,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend)
+@@ -409,7 +407,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)
{
-- Elf_Fdesc *fdesc = me->module_core + me->arch.fdesc_offset;
-+ Elf_Fdesc *fdesc = me->module_core_rw + me->arch.fdesc_offset;
+- Elf_Fdesc *fdesc = me->core_layout.base + me->arch.fdesc_offset;
++ Elf_Fdesc *fdesc = me->core_layout.base_rw + me->arch.fdesc_offset;
if (!value) {
printk(KERN_ERR "%s: zero OPD requested!\n", me->name);
-@@ -427,7 +449,7 @@ static Elf_Addr get_fdesc(struct module *me, unsigned long value)
+@@ -427,7 +425,7 @@ static Elf_Addr get_fdesc(struct module *me, unsigned long value)
/* Create new one */
fdesc->addr = value;
-- fdesc->gp = (Elf_Addr)me->module_core + me->arch.got_offset;
-+ fdesc->gp = (Elf_Addr)me->module_core_rw + me->arch.got_offset;
+- fdesc->gp = (Elf_Addr)me->core_layout.base + me->arch.got_offset;
++ fdesc->gp = (Elf_Addr)me->core_layout.base_rw + me->arch.got_offset;
return (Elf_Addr)fdesc;
}
#endif /* CONFIG_64BIT */
-@@ -839,7 +861,7 @@ register_unwind_table(struct module *me,
+@@ -839,7 +837,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;
-- gp = (Elf_Addr)me->module_core + me->arch.got_offset;
-+ gp = (Elf_Addr)me->module_core_rw + me->arch.got_offset;
+- gp = (Elf_Addr)me->core_layout.base + me->arch.got_offset;
++ gp = (Elf_Addr)me->core_layout.base_rw + me->arch.got_offset;
DEBUGP("register_unwind_table(), sect = %d at 0x%p - 0x%p (gp=0x%lx)\n",
me->arch.unwind_section, table, end, gp);
@@ -7626,10 +7557,10 @@ index f906444..0bb73ae 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 db49e0d..de977a0 100644
+index 9faa18c..6061610 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
-@@ -421,6 +421,7 @@ config KEXEC
+@@ -419,6 +419,7 @@ config KEXEC
bool "kexec system call"
depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP)) || PPC_BOOK3E
select KEXEC_CORE
@@ -8150,6 +8081,18 @@ index 55f106e..70cc82a 100644
" subf %0,%2,%0 \n\
2:"
: "=&r" (t)
+diff --git a/arch/powerpc/include/asm/book3s/32/hash.h b/arch/powerpc/include/asm/book3s/32/hash.h
+index 264b754..187b7f6 100644
+--- a/arch/powerpc/include/asm/book3s/32/hash.h
++++ b/arch/powerpc/include/asm/book3s/32/hash.h
+@@ -20,6 +20,7 @@
+ #define _PAGE_HASHPTE 0x002 /* hash_page has made an HPTE for this pte */
+ #define _PAGE_USER 0x004 /* usermode access allowed */
+ #define _PAGE_GUARDED 0x008 /* G: prohibit speculative access */
++#define _PAGE_EXEC _PAGE_GUARDED
+ #define _PAGE_COHERENT 0x010 /* M: enforce memory coherence (SMP systems) */
+ #define _PAGE_NO_CACHE 0x020 /* I: cache inhibit */
+ #define _PAGE_WRITETHRU 0x040 /* W: cache write-through */
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
index 5f8229e..385d90b 100644
--- a/arch/powerpc/include/asm/cache.h
@@ -8313,7 +8256,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 3140c19..0c43168 100644
+index e34124f..c146c14 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -230,8 +230,9 @@ extern long long virt_phys_offset;
@@ -8364,13 +8307,13 @@ index d908a46..3753f71 100644
#include <asm-generic/getorder.h>
diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h
-index 4b0be20..c15a27d 100644
+index 69ef28a..216486d 100644
--- a/arch/powerpc/include/asm/pgalloc-64.h
+++ b/arch/powerpc/include/asm/pgalloc-64.h
@@ -54,6 +54,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
#ifndef CONFIG_PPC_64K_PAGES
- #define pgd_populate(MM, PGD, PUD) pgd_set(PGD, PUD)
+ #define pgd_populate(MM, PGD, PUD) pgd_set(PGD, (unsigned long)PUD)
+#define pgd_populate_kernel(MM, PGD, PUD) pgd_populate((MM), (PGD), (PUD))
static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
@@ -8384,10 +8327,10 @@ index 4b0be20..c15a27d 100644
+ pud_populate(mm, pud, pmd);
+}
+
- #define pmd_populate(mm, pmd, pte_page) \
- pmd_populate_kernel(mm, pmd, page_address(pte_page))
- #define pmd_populate_kernel(mm, pmd, pte) pmd_set(pmd, (unsigned long)(pte))
-@@ -173,6 +179,7 @@ extern void __tlb_remove_table(void *_table);
+ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
+ pte_t *pte)
+ {
+@@ -172,6 +178,7 @@ extern void __tlb_remove_table(void *_table);
#endif
#define pud_populate(mm, pud, pmd) pud_set(pud, (unsigned long)pmd)
@@ -8396,31 +8339,19 @@ 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 b64b421..cc8447a 100644
+index ac9fb11..4efa476 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
-@@ -2,6 +2,7 @@
+@@ -1,6 +1,7 @@
+ #ifndef _ASM_POWERPC_PGTABLE_H
#define _ASM_POWERPC_PGTABLE_H
- #ifdef __KERNEL__
+#include <linux/const.h>
#ifndef __ASSEMBLY__
#include <linux/mmdebug.h>
#include <linux/mmzone.h>
-diff --git a/arch/powerpc/include/asm/pte-hash32.h b/arch/powerpc/include/asm/pte-hash32.h
-index 62cfb0c..50c6402 100644
---- a/arch/powerpc/include/asm/pte-hash32.h
-+++ b/arch/powerpc/include/asm/pte-hash32.h
-@@ -20,6 +20,7 @@
- #define _PAGE_HASHPTE 0x002 /* hash_page has made an HPTE for this pte */
- #define _PAGE_USER 0x004 /* usermode access allowed */
- #define _PAGE_GUARDED 0x008 /* G: prohibit speculative access */
-+#define _PAGE_EXEC _PAGE_GUARDED
- #define _PAGE_COHERENT 0x010 /* M: enforce memory coherence (SMP systems) */
- #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 2220f7a..5a9420e 100644
+index c4cb2ff..b04130e 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -253,6 +253,7 @@
@@ -8537,7 +8468,7 @@ index 7efee4a..48d47cc 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 2a8ebae..5643c6f 100644
+index b7c20f0..4adc0f1 100644
--- a/arch/powerpc/include/asm/uaccess.h
+++ b/arch/powerpc/include/asm/uaccess.h
@@ -58,6 +58,7 @@
@@ -8548,7 +8479,7 @@ index 2a8ebae..5643c6f 100644
#define access_ok(type, addr, size) \
(__chk_user_ptr(addr), \
__access_ok((__force unsigned long)(addr), (size), get_fs()))
-@@ -318,52 +319,6 @@ do { \
+@@ -303,52 +304,6 @@ do { \
extern unsigned long __copy_tofrom_user(void __user *to,
const void __user *from, unsigned long size);
@@ -8601,7 +8532,7 @@ index 2a8ebae..5643c6f 100644
static inline unsigned long __copy_from_user_inatomic(void *to,
const void __user *from, unsigned long n)
{
-@@ -387,6 +342,10 @@ static inline unsigned long __copy_from_user_inatomic(void *to,
+@@ -372,6 +327,10 @@ static inline unsigned long __copy_from_user_inatomic(void *to,
if (ret == 0)
return 0;
}
@@ -8612,7 +8543,7 @@ index 2a8ebae..5643c6f 100644
return __copy_tofrom_user((__force void __user *)to, from, n);
}
-@@ -413,6 +372,10 @@ static inline unsigned long __copy_to_user_inatomic(void __user *to,
+@@ -398,6 +357,10 @@ static inline unsigned long __copy_to_user_inatomic(void __user *to,
if (ret == 0)
return 0;
}
@@ -8623,7 +8554,7 @@ index 2a8ebae..5643c6f 100644
return __copy_tofrom_user(to, (__force const void __user *)from, n);
}
-@@ -430,6 +393,92 @@ static inline unsigned long __copy_to_user(void __user *to,
+@@ -415,6 +378,92 @@ static inline unsigned long __copy_to_user(void __user *to,
return __copy_to_user_inatomic(to, from, size);
}
@@ -8717,7 +8648,7 @@ index 2a8ebae..5643c6f 100644
static inline unsigned long clear_user(void __user *addr, unsigned long size)
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
-index ba33693..d8db875 100644
+index 794f22a..f8de42b 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -14,6 +14,11 @@ CFLAGS_prom_init.o += -fPIC
@@ -8764,10 +8695,10 @@ index 488e631..6cdd928 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 0a0399c2..262a2e6 100644
+index 7716ceb..6018173 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
-@@ -1591,10 +1591,10 @@ handle_page_fault:
+@@ -1572,10 +1572,10 @@ handle_page_fault:
11: ld r4,_DAR(r1)
ld r5,_DSISR(r1)
addi r3,r1,STACK_FRAME_OVERHEAD
@@ -8801,7 +8732,7 @@ index 290559d..0094ddb 100644
#endif
}
diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c
-index c94d2e0..992a9ce 100644
+index 2c01665..85a54a8 100644
--- a/arch/powerpc/kernel/module_32.c
+++ b/arch/powerpc/kernel/module_32.c
@@ -158,7 +158,7 @@ int module_frob_arch_sections(Elf32_Ehdr *hdr,
@@ -8817,14 +8748,14 @@ index c94d2e0..992a9ce 100644
pr_debug("Doing plt for call to 0x%x at 0x%x\n", val, (unsigned int)location);
/* Init, or core PLT? */
-- if (location >= mod->module_core
-- && location < mod->module_core + mod->core_size)
-+ if ((location >= mod->module_core_rx && location < mod->module_core_rx + mod->core_size_rx) ||
-+ (location >= mod->module_core_rw && location < mod->module_core_rw + mod->core_size_rw))
+- if (location >= mod->core_layout.base
+- && location < mod->core_layout.base + mod->core_layout.size)
++ if ((location >= mod->core_layout.base_rx && location < mod->core_layout.base_rx + mod->core_layout.size_rx) ||
++ (location >= mod->core_layout.base_rw && location < mod->core_layout.base_rw + mod->core_layout.size_rw))
entry = (void *)sechdrs[mod->arch.core_plt_section].sh_addr;
- else
-+ else if ((location >= mod->module_init_rx && location < mod->module_init_rx + mod->init_size_rx) ||
-+ (location >= mod->module_init_rw && location < mod->module_init_rw + mod->init_size_rw))
++ else if ((location >= mod->init_layout.base_rx && location < mod->init_layout.base_rx + mod->init_layout.size_rx) ||
++ (location >= mod->init_layout.base_rw && location < mod->init_layout.base_rw + mod->init_layout.size_rw))
entry = (void *)sechdrs[mod->arch.init_plt_section].sh_addr;
+ else {
+ printk(KERN_ERR "%s: invalid R_PPC_REL24 entry found\n", mod->name);
@@ -8837,16 +8768,16 @@ index c94d2e0..992a9ce 100644
}
#ifdef CONFIG_DYNAMIC_FTRACE
module->arch.tramp =
-- do_plt_call(module->module_core,
-+ do_plt_call(module->module_core_rx,
+- do_plt_call(module->core_layout.base,
++ do_plt_call(module->core_layout.base_rx,
(unsigned long)ftrace_caller,
sechdrs, module);
#endif
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
-index ef2ad2d..645e131 100644
+index 54ed9c7..f7d6e72 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
-@@ -1069,8 +1069,8 @@ void show_regs(struct pt_regs * regs)
+@@ -1185,8 +1185,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
*/
@@ -8857,7 +8788,7 @@ index ef2ad2d..645e131 100644
#endif
show_stack(current, (unsigned long *) regs->gpr[1]);
if (!user_mode(regs))
-@@ -1586,10 +1586,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
+@@ -1695,10 +1695,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
newsp = stack[0];
ip = stack[STACK_FRAME_LR_SAVE];
if (!firstframe || ip != lr) {
@@ -8870,7 +8801,7 @@ index ef2ad2d..645e131 100644
(void *)current->ret_stack[curr_frame].ret);
curr_frame--;
}
-@@ -1609,7 +1609,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
+@@ -1718,7 +1718,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;
@@ -8879,7 +8810,7 @@ index ef2ad2d..645e131 100644
regs->trap, (void *)regs->nip, (void *)lr);
firstframe = 1;
}
-@@ -1645,49 +1645,3 @@ void notrace __ppc64_runlatch_off(void)
+@@ -1754,49 +1754,3 @@ void notrace __ppc64_runlatch_off(void)
mtspr(SPRN_CTRLT, ctrl);
}
#endif /* CONFIG_PPC64 */
@@ -8897,9 +8828,9 @@ index ef2ad2d..645e131 100644
-
- /* 8MB for 32bit, 1GB for 64bit */
- if (is_32bit_task())
-- rnd = (long)(get_random_int() % (1<<(23-PAGE_SHIFT)));
+- rnd = (get_random_long() % (1UL<<(23-PAGE_SHIFT)));
- else
-- rnd = (long)(get_random_int() % (1<<(30-PAGE_SHIFT)));
+- rnd = (get_random_long() % (1UL<<(30-PAGE_SHIFT)));
-
- return rnd << PAGE_SHIFT;
-}
@@ -8930,10 +8861,10 @@ index ef2ad2d..645e131 100644
-}
-
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
-index 737c0d0..59c7417 100644
+index 30a03c0..e2d507b 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
-@@ -1800,6 +1800,10 @@ static int do_seccomp(struct pt_regs *regs)
+@@ -1801,6 +1801,10 @@ static int do_seccomp(struct pt_regs *regs)
static inline int do_seccomp(struct pt_regs *regs) { return 0; }
#endif /* CONFIG_SECCOMP */
@@ -8944,7 +8875,7 @@ index 737c0d0..59c7417 100644
/**
* do_syscall_trace_enter() - Do syscall tracing on kernel entry.
* @regs: the pt_regs of the task to trace (current)
-@@ -1828,6 +1832,11 @@ long do_syscall_trace_enter(struct pt_regs *regs)
+@@ -1829,6 +1833,11 @@ long do_syscall_trace_enter(struct pt_regs *regs)
if (do_seccomp(regs))
return -1;
@@ -8956,7 +8887,7 @@ index 737c0d0..59c7417 100644
if (test_thread_flag(TIF_SYSCALL_TRACE)) {
/*
* The tracer may decide to abort the syscall, if so tracehook
-@@ -1870,6 +1879,11 @@ void do_syscall_trace_leave(struct pt_regs *regs)
+@@ -1871,6 +1880,11 @@ void do_syscall_trace_leave(struct pt_regs *regs)
{
int step;
@@ -8969,10 +8900,10 @@ index 737c0d0..59c7417 100644
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
-index ef7c24e..755a485 100644
+index b6aa378..a491f51 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
-@@ -1018,7 +1018,7 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
+@@ -1000,7 +1000,7 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
/* Save user registers on the stack */
frame = &rt_sf->uc.uc_mcontext;
addr = frame;
@@ -8982,10 +8913,10 @@ index ef7c24e..755a485 100644
tramp = current->mm->context.vdso_base + vdso32_rt_sigtramp;
} else {
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
-index c676ece..188c057 100644
+index 2552079..a290dc8a 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
-@@ -769,7 +769,7 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs
+@@ -751,7 +751,7 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs
current->thread.fp_state.fpscr = 0;
/* Set up to return from userspace. */
@@ -8995,7 +8926,7 @@ index c676ece..188c057 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 37de90f..12472ac 100644
+index b6becc7..31a89c4 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -36,6 +36,7 @@
@@ -9053,7 +8984,7 @@ index 37de90f..12472ac 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 b457bfa..9018cde 100644
+index def1b8b..51ae209 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -34,6 +34,7 @@
@@ -9218,7 +9149,7 @@ index a67c6d7..a662e6d 100644
goto bail;
}
diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c
-index 0f0502e..bc3e7a3 100644
+index 4087705..7e75693 100644
--- a/arch/powerpc/mm/mmap.c
+++ b/arch/powerpc/mm/mmap.c
@@ -86,6 +86,10 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
@@ -9255,7 +9186,7 @@ index 0f0502e..bc3e7a3 100644
}
}
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
-index 0f432a7..abfe841 100644
+index 42954f0..a8252e2 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -105,7 +105,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr,
@@ -9267,7 +9198,7 @@ index 0f432a7..abfe841 100644
}
static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice)
-@@ -277,6 +277,12 @@ static unsigned long slice_find_area_bottomup(struct mm_struct *mm,
+@@ -276,6 +276,12 @@ static unsigned long slice_find_area_bottomup(struct mm_struct *mm,
info.align_offset = 0;
addr = TASK_UNMAPPED_BASE;
@@ -9280,7 +9211,7 @@ index 0f432a7..abfe841 100644
while (addr < TASK_SIZE) {
info.low_limit = addr;
if (!slice_scan_available(addr, available, 1, &addr))
-@@ -410,6 +416,11 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
+@@ -409,6 +415,11 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
if (fixed && addr > (mm->task_size - len))
return -ENOMEM;
@@ -9292,8 +9223,23 @@ index 0f432a7..abfe841 100644
/* If hint, make sure it matches our alignment restrictions */
if (!fixed && addr) {
addr = _ALIGN_UP(addr, 1ul << pshift);
+@@ -554,10 +565,10 @@ unsigned long arch_get_unmapped_area(struct file *filp,
+ }
+
+ unsigned long arch_get_unmapped_area_topdown(struct file *filp,
+- const unsigned long addr0,
+- const unsigned long len,
+- const unsigned long pgoff,
+- const unsigned long flags)
++ unsigned long addr0,
++ unsigned long len,
++ unsigned long pgoff,
++ unsigned long flags)
+ {
+ return slice_get_unmapped_area(addr0, len, flags,
+ current->mm->context.user_psize, 1);
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
-index 5038fd5..87a2033 100644
+index 2936a00..2e73ed6 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -263,9 +263,9 @@ spufs_mem_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
@@ -9309,10 +9255,10 @@ index 5038fd5..87a2033 100644
struct spu_context *ctx = vma->vm_file->private_data;
unsigned long offset = address - vma->vm_start;
diff --git a/arch/s390/Kconfig.debug b/arch/s390/Kconfig.debug
-index c56878e..073d04e 100644
+index 26c5d5be..a308c28 100644
--- a/arch/s390/Kconfig.debug
+++ b/arch/s390/Kconfig.debug
-@@ -21,6 +21,7 @@ config S390_PTDUMP
+@@ -9,6 +9,7 @@ config S390_PTDUMP
bool "Export kernel pagetable layout to userspace via debugfs"
depends on DEBUG_KERNEL
select DEBUG_FS
@@ -9356,10 +9302,10 @@ index 4d7ccac..d03d0ad 100644
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
-index bab6739..f0d5493 100644
+index 563ab9f..65d8bd4 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
-@@ -163,6 +163,13 @@ extern unsigned int vdso_enabled;
+@@ -167,6 +167,13 @@ extern unsigned int vdso_enabled;
(STACK_TOP / 3 * 2) : \
(STACK_TOP / 3 * 2) & ~((1UL << 32) - 1))
@@ -9426,23 +9372,23 @@ index 9dd4cc4..36f4b84 100644
return n;
}
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
-index 0c1a679..e1df357 100644
+index 7873e17..d21af5b 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
@@ -159,11 +159,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. */
-- me->core_size = ALIGN(me->core_size, 4);
-- me->arch.got_offset = me->core_size;
-- me->core_size += me->arch.got_size;
-- me->arch.plt_offset = me->core_size;
-- me->core_size += me->arch.plt_size;
-+ me->core_size_rw = ALIGN(me->core_size_rw, 4);
-+ me->arch.got_offset = me->core_size_rw;
-+ me->core_size_rw += me->arch.got_size;
-+ me->arch.plt_offset = me->core_size_rx;
-+ me->core_size_rx += me->arch.plt_size;
+- me->core_layout.size = ALIGN(me->core_layout.size, 4);
+- me->arch.got_offset = me->core_layout.size;
+- me->core_layout.size += me->arch.got_size;
+- me->arch.plt_offset = me->core_layout.size;
+- me->core_layout.size += me->arch.plt_size;
++ me->core_layout.size_rw = ALIGN(me->core_layout.size_rw, 4);
++ me->arch.got_offset = me->core_layout.size_rw;
++ me->core_layout.size_rw += me->arch.got_size;
++ me->arch.plt_offset = me->core_layout.size_rx;
++ me->core_layout.size_rx += me->arch.plt_size;
return 0;
}
@@ -9450,8 +9396,8 @@ index 0c1a679..e1df357 100644
if (info->got_initialized == 0) {
Elf_Addr *gotent;
-- gotent = me->module_core + me->arch.got_offset +
-+ gotent = me->module_core_rw + me->arch.got_offset +
+- gotent = me->core_layout.base + me->arch.got_offset +
++ gotent = me->core_layout.base_rw + me->arch.got_offset +
info->got_offset;
*gotent = val;
info->got_initialized = 1;
@@ -9459,8 +9405,8 @@ index 0c1a679..e1df357 100644
rc = apply_rela_bits(loc, val, 0, 64, 0);
else if (r_type == R_390_GOTENT ||
r_type == R_390_GOTPLTENT) {
-- val += (Elf_Addr) me->module_core - loc;
-+ val += (Elf_Addr) me->module_core_rw - loc;
+- val += (Elf_Addr) me->core_layout.base - loc;
++ val += (Elf_Addr) me->core_layout.base_rw - loc;
rc = apply_rela_bits(loc, val, 1, 32, 1);
}
break;
@@ -9468,8 +9414,8 @@ index 0c1a679..e1df357 100644
case R_390_PLTOFF64: /* 16 bit offset from GOT to PLT. */
if (info->plt_initialized == 0) {
unsigned int *ip;
-- ip = me->module_core + me->arch.plt_offset +
-+ ip = me->module_core_rx + me->arch.plt_offset +
+- ip = me->core_layout.base + me->arch.plt_offset +
++ ip = me->core_layout.base_rx + me->arch.plt_offset +
info->plt_offset;
ip[0] = 0x0d10e310; /* basr 1,0; lg 1,10(1); br 1 */
ip[1] = 0x100a0004;
@@ -9477,8 +9423,8 @@ index 0c1a679..e1df357 100644
val - loc + 0xffffUL < 0x1ffffeUL) ||
(r_type == R_390_PLT32DBL &&
val - loc + 0xffffffffULL < 0x1fffffffeULL)))
-- val = (Elf_Addr) me->module_core +
-+ val = (Elf_Addr) me->module_core_rx +
+- val = (Elf_Addr) me->core_layout.base +
++ val = (Elf_Addr) me->core_layout.base_rx +
me->arch.plt_offset +
info->plt_offset;
val += rela->r_addend - loc;
@@ -9486,8 +9432,8 @@ index 0c1a679..e1df357 100644
case R_390_GOTOFF32: /* 32 bit offset to GOT. */
case R_390_GOTOFF64: /* 64 bit offset to GOT. */
val = val + rela->r_addend -
-- ((Elf_Addr) me->module_core + me->arch.got_offset);
-+ ((Elf_Addr) me->module_core_rw + me->arch.got_offset);
+- ((Elf_Addr) me->core_layout.base + me->arch.got_offset);
++ ((Elf_Addr) me->core_layout.base_rw + me->arch.got_offset);
if (r_type == R_390_GOTOFF16)
rc = apply_rela_bits(loc, val, 0, 16, 0);
else if (r_type == R_390_GOTOFF32)
@@ -9495,13 +9441,13 @@ index 0c1a679..e1df357 100644
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. */
-- val = (Elf_Addr) me->module_core + me->arch.got_offset +
-+ val = (Elf_Addr) me->module_core_rw + me->arch.got_offset +
+- val = (Elf_Addr) me->core_layout.base + me->arch.got_offset +
++ val = (Elf_Addr) me->core_layout.base_rw + me->arch.got_offset +
rela->r_addend - loc;
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 114ee8b..7d1123f 100644
+index 2bba7df..587489f 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -233,23 +233,3 @@ unsigned long get_wchan(struct task_struct *p)
@@ -9529,9 +9475,22 @@ index 114ee8b..7d1123f 100644
- return (ret > mm->brk) ? ret : mm->brk;
-}
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
-index ea01477..ff5ec44 100644
+index 45c4daa..42703fb 100644
--- a/arch/s390/mm/mmap.c
+++ b/arch/s390/mm/mmap.c
+@@ -200,9 +200,9 @@ s390_get_unmapped_area(struct file *filp, unsigned long addr,
+ }
+
+ static unsigned long
+-s390_get_unmapped_area_topdown(struct file *filp, const unsigned long addr,
+- const unsigned long len, const unsigned long pgoff,
+- const unsigned long flags)
++s390_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
++ unsigned long len, unsigned long pgoff,
++ unsigned long flags)
+ {
+ struct mm_struct *mm = current->mm;
+ unsigned long area;
@@ -229,6 +229,10 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
{
unsigned long random_factor = 0UL;
@@ -9623,7 +9582,7 @@ index ef9e555..331bd29 100644
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c
-index 6777177..cb5e44f 100644
+index 6777177..d44b592 100644
--- a/arch/sh/mm/mmap.c
+++ b/arch/sh/mm/mmap.c
@@ -36,6 +36,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
@@ -9662,7 +9621,18 @@ index 6777177..cb5e44f 100644
info.high_limit = TASK_SIZE;
info.align_mask = do_colour_align ? (PAGE_MASK & shm_align_mask) : 0;
info.align_offset = pgoff << PAGE_SHIFT;
-@@ -85,6 +89,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -77,14 +81,15 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
+ }
+
+ unsigned long
+-arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+- const unsigned long len, const unsigned long pgoff,
+- const unsigned long flags)
++arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr0,
++ unsigned long len, unsigned long pgoff,
++ unsigned long flags)
+ {
+ struct vm_area_struct *vma;
struct mm_struct *mm = current->mm;
unsigned long addr = addr0;
int do_colour_align;
@@ -10232,7 +10202,7 @@ index bd56c28..4b63d83 100644
#include <asm/uaccess_64.h>
#else
diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h
-index 64ee103..388aef0 100644
+index 57aca27..a87e6eb 100644
--- a/arch/sparc/include/asm/uaccess_32.h
+++ b/arch/sparc/include/asm/uaccess_32.h
@@ -47,6 +47,7 @@
@@ -10243,7 +10213,7 @@ index 64ee103..388aef0 100644
#define access_ok(type, addr, size) \
({ (void)(type); __access_ok((unsigned long)(addr), size); })
-@@ -313,27 +314,46 @@ unsigned long __copy_user(void __user *to, const void __user *from, unsigned lon
+@@ -248,27 +249,46 @@ unsigned long __copy_user(void __user *to, const void __user *from, unsigned lon
static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
{
@@ -10295,7 +10265,7 @@ index 64ee103..388aef0 100644
}
diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h
-index ea6e9a2..5703598 100644
+index e9a51d6..3ef910c 100644
--- a/arch/sparc/include/asm/uaccess_64.h
+++ b/arch/sparc/include/asm/uaccess_64.h
@@ -10,6 +10,7 @@
@@ -10318,7 +10288,7 @@ index ea6e9a2..5703598 100644
static inline int access_ok(int type, const void __user * addr, unsigned long size)
{
return 1;
-@@ -250,8 +256,15 @@ unsigned long copy_from_user_fixup(void *to, const void __user *from,
+@@ -210,8 +216,15 @@ unsigned long copy_from_user_fixup(void *to, const void __user *from,
static inline unsigned long __must_check
copy_from_user(void *to, const void __user *from, unsigned long size)
{
@@ -10335,7 +10305,7 @@ index ea6e9a2..5703598 100644
if (unlikely(ret))
ret = copy_from_user_fixup(to, from, size);
-@@ -267,8 +280,15 @@ unsigned long copy_to_user_fixup(void __user *to, const void *from,
+@@ -227,8 +240,15 @@ unsigned long copy_to_user_fixup(void __user *to, const void *from,
static inline unsigned long __must_check
copy_to_user(void __user *to, const void *from, unsigned long size)
{
@@ -10541,7 +10511,7 @@ index 646988d..b88905f 100644
info.flags = 0;
info.length = len;
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
-index c690c8e..1d5798e 100644
+index b489e97..44620ad 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -89,13 +89,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
@@ -10603,7 +10573,19 @@ index c690c8e..1d5798e 100644
info.high_limit = task_size;
addr = vm_unmapped_area(&info);
}
-@@ -150,6 +161,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -141,15 +152,16 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
+ }
+
+ unsigned long
+-arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+- const unsigned long len, const unsigned long pgoff,
+- const unsigned long flags)
++arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr0,
++ unsigned long len, unsigned long pgoff,
++ unsigned long flags)
+ {
+ struct vm_area_struct *vma;
+ struct mm_struct *mm = current->mm;
unsigned long task_size = STACK_TOP32;
unsigned long addr = addr0;
int do_color_align;
@@ -10676,7 +10658,7 @@ index c690c8e..1d5798e 100644
+#endif
+
if (current->flags & PF_RANDOMIZE) {
- unsigned long val = get_random_int();
+ unsigned long val = get_random_long();
if (test_thread_flag(TIF_32BIT))
@@ -275,7 +301,7 @@ static unsigned long mmap_rnd(void)
@@ -10714,7 +10696,7 @@ index c690c8e..1d5798e 100644
}
}
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
-index bb00089..e0ea580 100644
+index c4a1b5c..c5e0ef3 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
@@ -62,7 +62,7 @@ sys32_rt_sigreturn:
@@ -10726,7 +10708,7 @@ index bb00089..e0ea580 100644
be,pt %icc, rtrap
nop
call syscall_trace_leave
-@@ -194,7 +194,7 @@ linux_sparc_syscall32:
+@@ -230,7 +230,7 @@ linux_sparc_syscall32:
srl %i3, 0, %o3 ! IEU0
srl %i2, 0, %o2 ! IEU0 Group
@@ -10735,7 +10717,7 @@ index bb00089..e0ea580 100644
bne,pn %icc, linux_syscall_trace32 ! CTI
mov %i0, %l5 ! IEU1
5: call %l7 ! CTI Group brk forced
-@@ -218,7 +218,7 @@ linux_sparc_syscall:
+@@ -254,7 +254,7 @@ linux_sparc_syscall:
mov %i3, %o3 ! IEU1
mov %i4, %o4 ! IEU0 Group
@@ -10744,7 +10726,7 @@ index bb00089..e0ea580 100644
bne,pn %icc, linux_syscall_trace ! CTI Group
mov %i0, %l5 ! IEU0
2: call %l7 ! CTI Group brk forced
-@@ -233,7 +233,7 @@ ret_sys_call:
+@@ -269,7 +269,7 @@ ret_sys_call:
cmp %o0, -ERESTART_RESTARTBLOCK
bgeu,pn %xcc, 1f
@@ -11478,7 +11460,7 @@ index c399e7b..2387414 100644
if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
goto bad_area;
diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c
-index dbabe57..d34d315 100644
+index cb841a3..f2061fb 100644
--- a/arch/sparc/mm/fault_64.c
+++ b/arch/sparc/mm/fault_64.c
@@ -23,6 +23,9 @@
@@ -11500,7 +11482,7 @@ index dbabe57..d34d315 100644
printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr);
dump_stack();
unhandled_fault(regs->tpc, current, regs);
-@@ -279,6 +282,466 @@ static void noinline __kprobes bogus_32bit_fault_tpc(struct pt_regs *regs)
+@@ -276,6 +279,466 @@ static void noinline __kprobes bogus_32bit_fault_tpc(struct pt_regs *regs)
show_regs(regs);
}
@@ -11967,7 +11949,7 @@ index dbabe57..d34d315 100644
asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
{
enum ctx_state prev_state = exception_enter();
-@@ -353,6 +816,29 @@ retry:
+@@ -350,6 +813,29 @@ retry:
if (!vma)
goto bad_area;
@@ -11998,7 +11980,7 @@ index dbabe57..d34d315 100644
* load/store/atomic was a write or not, it only says that there
* was no match. So in such a case we (carefully) read the
diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
-index 131eaf4..285ea31 100644
+index 131eaf4..4ad6678 100644
--- a/arch/sparc/mm/hugetlbpage.c
+++ b/arch/sparc/mm/hugetlbpage.c
@@ -25,8 +25,10 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp,
@@ -12037,13 +12019,19 @@ index 131eaf4..285ea31 100644
info.high_limit = task_size;
addr = vm_unmapped_area(&info);
}
-@@ -55,7 +64,8 @@ static unsigned long
- hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- const unsigned long len,
- const unsigned long pgoff,
+@@ -52,10 +61,11 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp,
+ }
+
+ static unsigned long
+-hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+- const unsigned long len,
+- const unsigned long pgoff,
- const unsigned long flags)
-+ const unsigned long flags,
-+ const unsigned long offset)
++hugetlb_get_unmapped_area_topdown(struct file *filp, unsigned long addr0,
++ unsigned long len,
++ unsigned long pgoff,
++ unsigned long flags,
++ unsigned long offset)
{
struct mm_struct *mm = current->mm;
unsigned long addr = addr0;
@@ -12104,7 +12092,7 @@ index 131eaf4..285ea31 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 3025bd5..4934c29 100644
+index 6f21685..5831fed 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -189,9 +189,9 @@ unsigned long sparc64_kern_sec_context __read_mostly;
@@ -12142,10 +12130,10 @@ index 3025bd5..4934c29 100644
#endif /* CONFIG_DEBUG_DCFLUSH */
}
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
-index 8ec7a45..b0c6dc1 100644
+index de4a4ff..477c014 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
-@@ -205,6 +205,7 @@ source "kernel/Kconfig.hz"
+@@ -203,6 +203,7 @@ source "kernel/Kconfig.hz"
config KEXEC
bool "kexec system call"
select KEXEC_CORE
@@ -12276,7 +12264,7 @@ index 2e0a6b1..a64d0f5 100644
#endif
diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h
-index 71c5d13..4c7b9f1 100644
+index f878bec..ca09300 100644
--- a/arch/um/include/asm/page.h
+++ b/arch/um/include/asm/page.h
@@ -14,6 +14,9 @@
@@ -12290,7 +12278,7 @@ index 71c5d13..4c7b9f1 100644
struct page;
diff --git a/arch/um/include/asm/pgtable-3level.h b/arch/um/include/asm/pgtable-3level.h
-index 2b4274e..754fe06 100644
+index bae8523..ba9484b 100644
--- a/arch/um/include/asm/pgtable-3level.h
+++ b/arch/um/include/asm/pgtable-3level.h
@@ -58,6 +58,7 @@
@@ -12346,10 +12334,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 436639a..3d211bb 100644
+index 3bf45a0..7b04039 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -36,14 +36,13 @@ config X86
+@@ -38,14 +38,13 @@ config X86
select ARCH_MIGHT_HAVE_PC_SERIO
select ARCH_SUPPORTS_ATOMIC_RMW
select ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT
@@ -12365,7 +12353,7 @@ index 436639a..3d211bb 100644
select ARCH_WANT_FRAME_POINTERS
select ARCH_WANT_IPC_PARSE_VERSION if X86_32
select ARCH_WANT_OPTIONAL_GPIOLIB
-@@ -87,7 +86,7 @@ config X86
+@@ -91,7 +90,7 @@ config X86
select HAVE_ARCH_TRACEHOOK
select HAVE_ARCH_TRANSPARENT_HUGEPAGE
select HAVE_BPF_JIT if X86_64
@@ -12374,7 +12362,7 @@ index 436639a..3d211bb 100644
select HAVE_CMPXCHG_DOUBLE
select HAVE_CMPXCHG_LOCAL
select HAVE_CONTEXT_TRACKING if X86_64
-@@ -276,7 +275,7 @@ config X86_64_SMP
+@@ -290,7 +289,7 @@ config X86_64_SMP
config X86_32_LAZY_GS
def_bool y
@@ -12383,7 +12371,7 @@ index 436639a..3d211bb 100644
config ARCH_HWEIGHT_CFLAGS
string
-@@ -648,6 +647,7 @@ config SCHED_OMIT_FRAME_POINTER
+@@ -674,6 +673,7 @@ config SCHED_OMIT_FRAME_POINTER
menuconfig HYPERVISOR_GUEST
bool "Linux guest support"
@@ -12391,7 +12379,7 @@ index 436639a..3d211bb 100644
---help---
Say Y here to enable options for running Linux under various hyper-
visors. This option enables basic hypervisor detection and platform
-@@ -1039,6 +1039,7 @@ config VM86
+@@ -1073,6 +1073,7 @@ config VM86
config X86_16BIT
bool "Enable support for 16-bit segments" if EXPERT
@@ -12399,7 +12387,7 @@ index 436639a..3d211bb 100644
default y
depends on MODIFY_LDT_SYSCALL
---help---
-@@ -1193,6 +1194,7 @@ choice
+@@ -1227,6 +1228,7 @@ choice
config NOHIGHMEM
bool "off"
@@ -12407,7 +12395,7 @@ index 436639a..3d211bb 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
-@@ -1229,6 +1231,7 @@ config NOHIGHMEM
+@@ -1263,6 +1265,7 @@ config NOHIGHMEM
config HIGHMEM4G
bool "4GB"
@@ -12415,7 +12403,7 @@ index 436639a..3d211bb 100644
---help---
Select this if you have a 32-bit processor and between 1 and 4
gigabytes of physical RAM.
-@@ -1281,7 +1284,7 @@ config PAGE_OFFSET
+@@ -1315,7 +1318,7 @@ config PAGE_OFFSET
hex
default 0xB0000000 if VMSPLIT_3G_OPT
default 0x80000000 if VMSPLIT_2G
@@ -12424,7 +12412,7 @@ index 436639a..3d211bb 100644
default 0x40000000 if VMSPLIT_1G
default 0xC0000000
depends on X86_32
-@@ -1302,7 +1305,6 @@ config X86_PAE
+@@ -1336,7 +1339,6 @@ config X86_PAE
config ARCH_PHYS_ADDR_T_64BIT
def_bool y
@@ -12432,7 +12420,7 @@ index 436639a..3d211bb 100644
config ARCH_DMA_ADDR_T_64BIT
def_bool y
-@@ -1433,7 +1435,7 @@ config ARCH_PROC_KCORE_TEXT
+@@ -1467,7 +1469,7 @@ config ARCH_PROC_KCORE_TEXT
config ILLEGAL_POINTER_VALUE
hex
@@ -12441,7 +12429,7 @@ index 436639a..3d211bb 100644
default 0xdead000000000000 if X86_64
source "mm/Kconfig"
-@@ -1742,6 +1744,7 @@ source kernel/Kconfig.hz
+@@ -1776,6 +1778,7 @@ source kernel/Kconfig.hz
config KEXEC
bool "kexec system call"
select KEXEC_CORE
@@ -12449,7 +12437,7 @@ index 436639a..3d211bb 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
-@@ -1924,7 +1927,9 @@ config X86_NEED_RELOCS
+@@ -1958,7 +1961,9 @@ config X86_NEED_RELOCS
config PHYSICAL_ALIGN
hex "Alignment value to which kernel should be aligned"
@@ -12460,7 +12448,7 @@ index 436639a..3d211bb 100644
range 0x2000 0x1000000 if X86_32
range 0x200000 0x1000000 if X86_64
---help---
-@@ -2007,6 +2012,7 @@ config COMPAT_VDSO
+@@ -2041,6 +2046,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
@@ -12468,7 +12456,7 @@ index 436639a..3d211bb 100644
---help---
Certain buggy versions of glibc will crash if they are
presented with a 32-bit vDSO that is not mapped at the address
-@@ -2047,15 +2053,6 @@ choice
+@@ -2081,15 +2087,6 @@ choice
If unsure, select "Emulate".
@@ -12484,7 +12472,7 @@ index 436639a..3d211bb 100644
config LEGACY_VSYSCALL_EMULATE
bool "Emulate"
help
-@@ -2136,6 +2133,22 @@ config MODIFY_LDT_SYSCALL
+@@ -2170,6 +2167,22 @@ config MODIFY_LDT_SYSCALL
Saying 'N' here may make sense for embedded or server kernels.
@@ -12539,18 +12527,18 @@ index 3ba5ff2..44bdacc 100644
config X86_MINIMUM_CPU_FAMILY
int
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
-index 137dfa9..6efdd4e 100644
+index 9b18ed9..9528749 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
-@@ -72,6 +72,7 @@ config X86_PTDUMP
- bool "Export kernel pagetable layout to userspace via debugfs"
+@@ -55,6 +55,7 @@ config X86_PTDUMP
+ tristate "Export kernel pagetable layout to userspace via debugfs"
depends on DEBUG_KERNEL
select DEBUG_FS
+ depends on !GRKERNSEC_KMEM
select X86_PTDUMP_CORE
---help---
Say Y here if you want to show the kernel pagetable layout in a
-@@ -94,7 +95,7 @@ config EFI_PGT_DUMP
+@@ -77,7 +78,7 @@ config EFI_PGT_DUMP
config DEBUG_RODATA
bool "Write protect kernel read-only data structures"
default y
@@ -12559,7 +12547,7 @@ index 137dfa9..6efdd4e 100644
---help---
Mark the kernel read-only data as write-protected in the pagetables,
in order to catch accidental (and incorrect) writes to such const
-@@ -140,7 +141,7 @@ config DEBUG_WX
+@@ -123,7 +124,7 @@ config DEBUG_WX
config DEBUG_SET_MODULE_RONX
bool "Set loadable kernel module data as NX and text as RO"
@@ -12568,7 +12556,7 @@ index 137dfa9..6efdd4e 100644
---help---
This option helps catch unintended modifications to loadable
kernel module's text and read-only data. It also prevents execution
-@@ -392,6 +393,7 @@ config X86_DEBUG_FPU
+@@ -375,6 +376,7 @@ config X86_DEBUG_FPU
config PUNIT_ATOM_DEBUG
tristate "ATOM Punit debug driver"
select DEBUG_FS
@@ -12619,7 +12607,7 @@ index 4086abc..52a0a9b 100644
+*** Please upgrade your binutils to 2.18 or newer
+endef
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
-index 2ee62db..5f320a9 100644
+index bbe1a62..ec6a3ec 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -58,6 +58,9 @@ clean-files += cpustr.h
@@ -12631,7 +12619,7 @@ index 2ee62db..5f320a9 100644
+endif
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
-
+ UBSAN_SANITIZE := n
diff --git a/arch/x86/boot/bitops.h b/arch/x86/boot/bitops.h
index 878e4b9..20537ab 100644
--- a/arch/x86/boot/bitops.h
@@ -12668,16 +12656,33 @@ index 9011a88..06aa820 100644
}
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
-index 0a291cd..9686efc 100644
+index f9ce75d..0b1600d 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
-@@ -30,6 +30,9 @@ KBUILD_CFLAGS += $(cflags-y)
+@@ -30,6 +30,26 @@ KBUILD_CFLAGS += $(cflags-y)
KBUILD_CFLAGS += -mno-mmx -mno-sse
KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
+ifdef CONSTIFY_PLUGIN
+KBUILD_CFLAGS += -fplugin-arg-constify_plugin-no-constify
+endif
++
++ifdef CONFIG_DEBUG_INFO
++ifdef CONFIG_DEBUG_INFO_SPLIT
++KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g)
++else
++KBUILD_CFLAGS += -g
++endif
++KBUILD_AFLAGS += -Wa,--gdwarf-2
++endif
++ifdef CONFIG_DEBUG_INFO_DWARF4
++KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,)
++endif
++
++ifdef CONFIG_DEBUG_INFO_REDUCED
++KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \
++ $(call cc-option,-fno-var-tracking)
++endif
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
@@ -12971,7 +12976,7 @@ index 9105655..41779c1 100644
movq r1,r2; \
movq r3,r4; \
diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S
-index 6bd2c6c..368c93e 100644
+index 6bd2c6c..cd46c9d 100644
--- a/arch/x86/crypto/aesni-intel_asm.S
+++ b/arch/x86/crypto/aesni-intel_asm.S
@@ -31,6 +31,7 @@
@@ -13253,7 +13258,7 @@ index 6bd2c6c..368c93e 100644
ret
ENDPROC(_key_expansion_256b)
-@@ -1905,6 +1912,7 @@ ENTRY(aesni_set_key)
+@@ -1905,13 +1912,14 @@ ENTRY(aesni_set_key)
#ifndef __x86_64__
popl KEYP
#endif
@@ -13261,6 +13266,14 @@ index 6bd2c6c..368c93e 100644
ret
ENDPROC(aesni_set_key)
+ /*
+ * void aesni_enc(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
+ */
+-ENTRY(aesni_enc)
++RAP_ENTRY(aesni_enc)
+ #ifndef __x86_64__
+ pushl KEYP
+ pushl KLEN
@@ -1927,6 +1935,7 @@ ENTRY(aesni_enc)
popl KLEN
popl KEYP
@@ -13277,7 +13290,7 @@ index 6bd2c6c..368c93e 100644
ret
ENDPROC(_aesni_enc1)
-@@ -2094,6 +2104,7 @@ _aesni_enc4:
+@@ -2094,13 +2104,14 @@ _aesni_enc4:
AESENCLAST KEY STATE2
AESENCLAST KEY STATE3
AESENCLAST KEY STATE4
@@ -13285,6 +13298,14 @@ index 6bd2c6c..368c93e 100644
ret
ENDPROC(_aesni_enc4)
+ /*
+ * void aesni_dec (struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
+ */
+-ENTRY(aesni_dec)
++RAP_ENTRY(aesni_dec)
+ #ifndef __x86_64__
+ pushl KEYP
+ pushl KLEN
@@ -2117,6 +2128,7 @@ ENTRY(aesni_dec)
popl KLEN
popl KEYP
@@ -13373,8 +13394,24 @@ index 6bd2c6c..368c93e 100644
ret
ENDPROC(aesni_xts_crypt8)
+diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
+index 3633ad6..2bf146f 100644
+--- a/arch/x86/crypto/aesni-intel_glue.c
++++ b/arch/x86/crypto/aesni-intel_glue.c
+@@ -82,9 +82,9 @@ struct aesni_xts_ctx {
+
+ asmlinkage int aesni_set_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
+ unsigned int key_len);
+-asmlinkage void aesni_enc(struct crypto_aes_ctx *ctx, u8 *out,
++asmlinkage void aesni_enc(void *ctx, u8 *out,
+ const u8 *in);
+-asmlinkage void aesni_dec(struct crypto_aes_ctx *ctx, u8 *out,
++asmlinkage void aesni_dec(void *ctx, u8 *out,
+ const u8 *in);
+ asmlinkage void aesni_ecb_enc(struct crypto_aes_ctx *ctx, u8 *out,
+ const u8 *in, unsigned int len);
diff --git a/arch/x86/crypto/blowfish-x86_64-asm_64.S b/arch/x86/crypto/blowfish-x86_64-asm_64.S
-index 246c670..466e2d6 100644
+index 246c670..4fb7603 100644
--- a/arch/x86/crypto/blowfish-x86_64-asm_64.S
+++ b/arch/x86/crypto/blowfish-x86_64-asm_64.S
@@ -21,6 +21,7 @@
@@ -13385,7 +13422,7 @@ index 246c670..466e2d6 100644
.file "blowfish-x86_64-asm.S"
.text
-@@ -149,9 +150,11 @@ ENTRY(__blowfish_enc_blk)
+@@ -149,13 +150,15 @@ ENTRY(__blowfish_enc_blk)
jnz .L__enc_xor;
write_block();
@@ -13397,6 +13434,11 @@ index 246c670..466e2d6 100644
ret;
ENDPROC(__blowfish_enc_blk)
+-ENTRY(blowfish_dec_blk)
++RAP_ENTRY(blowfish_dec_blk)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
@@ -183,6 +186,7 @@ ENTRY(blowfish_dec_blk)
movq %r11, %rbp;
@@ -13413,7 +13455,7 @@ index 246c670..466e2d6 100644
ret;
.L__enc_xor4:
-@@ -341,6 +346,7 @@ ENTRY(__blowfish_enc_blk_4way)
+@@ -341,10 +346,11 @@ ENTRY(__blowfish_enc_blk_4way)
popq %rbx;
popq %rbp;
@@ -13421,6 +13463,11 @@ index 246c670..466e2d6 100644
ret;
ENDPROC(__blowfish_enc_blk_4way)
+-ENTRY(blowfish_dec_blk_4way)
++RAP_ENTRY(blowfish_dec_blk_4way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
@@ -375,5 +381,6 @@ ENTRY(blowfish_dec_blk_4way)
popq %rbx;
popq %rbp;
@@ -13429,7 +13476,7 @@ index 246c670..466e2d6 100644
ret;
ENDPROC(blowfish_dec_blk_4way)
diff --git a/arch/x86/crypto/camellia-aesni-avx-asm_64.S b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
-index ce71f92..1dce7ec 100644
+index ce71f92..059975a 100644
--- a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
+++ b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
@@ -16,6 +16,7 @@
@@ -13472,7 +13519,16 @@ index ce71f92..1dce7ec 100644
ret;
.align 8
-@@ -904,6 +909,7 @@ ENTRY(camellia_ecb_enc_16way)
+@@ -884,7 +889,7 @@ __camellia_dec_blk16:
+ jmp .Ldec_max24;
+ ENDPROC(__camellia_dec_blk16)
+
+-ENTRY(camellia_ecb_enc_16way)
++RAP_ENTRY(camellia_ecb_enc_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (16 blocks)
+@@ -904,10 +909,11 @@ ENTRY(camellia_ecb_enc_16way)
%xmm15, %xmm14, %xmm13, %xmm12, %xmm11, %xmm10, %xmm9,
%xmm8, %rsi);
@@ -13480,7 +13536,12 @@ index ce71f92..1dce7ec 100644
ret;
ENDPROC(camellia_ecb_enc_16way)
-@@ -932,6 +938,7 @@ ENTRY(camellia_ecb_dec_16way)
+-ENTRY(camellia_ecb_dec_16way)
++RAP_ENTRY(camellia_ecb_dec_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (16 blocks)
+@@ -932,10 +938,11 @@ ENTRY(camellia_ecb_dec_16way)
%xmm15, %xmm14, %xmm13, %xmm12, %xmm11, %xmm10, %xmm9,
%xmm8, %rsi);
@@ -13488,6 +13549,11 @@ index ce71f92..1dce7ec 100644
ret;
ENDPROC(camellia_ecb_dec_16way)
+-ENTRY(camellia_cbc_dec_16way)
++RAP_ENTRY(camellia_cbc_dec_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (16 blocks)
@@ -981,6 +988,7 @@ ENTRY(camellia_cbc_dec_16way)
%xmm15, %xmm14, %xmm13, %xmm12, %xmm11, %xmm10, %xmm9,
%xmm8, %rsi);
@@ -13496,6 +13562,15 @@ index ce71f92..1dce7ec 100644
ret;
ENDPROC(camellia_cbc_dec_16way)
+@@ -990,7 +998,7 @@ ENDPROC(camellia_cbc_dec_16way)
+ vpslldq $8, tmp, tmp; \
+ vpsubq tmp, x, x;
+
+-ENTRY(camellia_ctr_16way)
++RAP_ENTRY(camellia_ctr_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (16 blocks)
@@ -1092,6 +1100,7 @@ ENTRY(camellia_ctr_16way)
%xmm15, %xmm14, %xmm13, %xmm12, %xmm11, %xmm10, %xmm9,
%xmm8, %rsi);
@@ -13504,7 +13579,7 @@ index ce71f92..1dce7ec 100644
ret;
ENDPROC(camellia_ctr_16way)
-@@ -1234,6 +1243,7 @@ camellia_xts_crypt_16way:
+@@ -1234,10 +1243,11 @@ camellia_xts_crypt_16way:
%xmm15, %xmm14, %xmm13, %xmm12, %xmm11, %xmm10, %xmm9,
%xmm8, %rsi);
@@ -13512,8 +13587,22 @@ index ce71f92..1dce7ec 100644
ret;
ENDPROC(camellia_xts_crypt_16way)
+-ENTRY(camellia_xts_enc_16way)
++RAP_ENTRY(camellia_xts_enc_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (16 blocks)
+@@ -1251,7 +1261,7 @@ ENTRY(camellia_xts_enc_16way)
+ jmp camellia_xts_crypt_16way;
+ ENDPROC(camellia_xts_enc_16way)
+
+-ENTRY(camellia_xts_dec_16way)
++RAP_ENTRY(camellia_xts_dec_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (16 blocks)
diff --git a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
-index 0e0b886..5a3123c 100644
+index 0e0b886..7bad080 100644
--- a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
+++ b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
@@ -11,6 +11,7 @@
@@ -13556,7 +13645,16 @@ index 0e0b886..5a3123c 100644
ret;
.align 8
-@@ -948,6 +953,7 @@ ENTRY(camellia_ecb_enc_32way)
+@@ -924,7 +929,7 @@ __camellia_dec_blk32:
+ jmp .Ldec_max24;
+ ENDPROC(__camellia_dec_blk32)
+
+-ENTRY(camellia_ecb_enc_32way)
++RAP_ENTRY(camellia_ecb_enc_32way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (32 blocks)
+@@ -948,10 +953,11 @@ ENTRY(camellia_ecb_enc_32way)
vzeroupper;
@@ -13564,7 +13662,12 @@ index 0e0b886..5a3123c 100644
ret;
ENDPROC(camellia_ecb_enc_32way)
-@@ -980,6 +986,7 @@ ENTRY(camellia_ecb_dec_32way)
+-ENTRY(camellia_ecb_dec_32way)
++RAP_ENTRY(camellia_ecb_dec_32way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (32 blocks)
+@@ -980,10 +986,11 @@ ENTRY(camellia_ecb_dec_32way)
vzeroupper;
@@ -13572,6 +13675,11 @@ index 0e0b886..5a3123c 100644
ret;
ENDPROC(camellia_ecb_dec_32way)
+-ENTRY(camellia_cbc_dec_32way)
++RAP_ENTRY(camellia_cbc_dec_32way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (32 blocks)
@@ -1046,6 +1053,7 @@ ENTRY(camellia_cbc_dec_32way)
vzeroupper;
@@ -13580,6 +13688,15 @@ index 0e0b886..5a3123c 100644
ret;
ENDPROC(camellia_cbc_dec_32way)
+@@ -1063,7 +1071,7 @@ ENDPROC(camellia_cbc_dec_32way)
+ vpslldq $8, tmp1, tmp1; \
+ vpsubq tmp1, x, x;
+
+-ENTRY(camellia_ctr_32way)
++RAP_ENTRY(camellia_ctr_32way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (32 blocks)
@@ -1184,6 +1192,7 @@ ENTRY(camellia_ctr_32way)
vzeroupper;
@@ -13588,7 +13705,7 @@ index 0e0b886..5a3123c 100644
ret;
ENDPROC(camellia_ctr_32way)
-@@ -1349,6 +1358,7 @@ camellia_xts_crypt_32way:
+@@ -1349,10 +1358,11 @@ camellia_xts_crypt_32way:
vzeroupper;
@@ -13596,8 +13713,22 @@ index 0e0b886..5a3123c 100644
ret;
ENDPROC(camellia_xts_crypt_32way)
+-ENTRY(camellia_xts_enc_32way)
++RAP_ENTRY(camellia_xts_enc_32way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (32 blocks)
+@@ -1367,7 +1377,7 @@ ENTRY(camellia_xts_enc_32way)
+ jmp camellia_xts_crypt_32way;
+ ENDPROC(camellia_xts_enc_32way)
+
+-ENTRY(camellia_xts_dec_32way)
++RAP_ENTRY(camellia_xts_dec_32way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (32 blocks)
diff --git a/arch/x86/crypto/camellia-x86_64-asm_64.S b/arch/x86/crypto/camellia-x86_64-asm_64.S
-index 310319c..db3d7b5 100644
+index 310319c..9253a8f 100644
--- a/arch/x86/crypto/camellia-x86_64-asm_64.S
+++ b/arch/x86/crypto/camellia-x86_64-asm_64.S
@@ -21,6 +21,7 @@
@@ -13608,7 +13739,7 @@ index 310319c..db3d7b5 100644
.file "camellia-x86_64-asm_64.S"
.text
-@@ -228,12 +229,14 @@ ENTRY(__camellia_enc_blk)
+@@ -228,16 +229,18 @@ ENTRY(__camellia_enc_blk)
enc_outunpack(mov, RT1);
movq RRBP, %rbp;
@@ -13623,6 +13754,11 @@ index 310319c..db3d7b5 100644
ret;
ENDPROC(__camellia_enc_blk)
+-ENTRY(camellia_dec_blk)
++RAP_ENTRY(camellia_dec_blk)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
@@ -272,6 +275,7 @@ ENTRY(camellia_dec_blk)
dec_outunpack();
@@ -13639,7 +13775,7 @@ index 310319c..db3d7b5 100644
ret;
.L__enc2_xor:
-@@ -470,6 +475,7 @@ ENTRY(__camellia_enc_blk_2way)
+@@ -470,10 +475,11 @@ ENTRY(__camellia_enc_blk_2way)
movq RRBP, %rbp;
popq %rbx;
@@ -13647,6 +13783,11 @@ index 310319c..db3d7b5 100644
ret;
ENDPROC(__camellia_enc_blk_2way)
+-ENTRY(camellia_dec_blk_2way)
++RAP_ENTRY(camellia_dec_blk_2way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
@@ -510,5 +516,6 @@ ENTRY(camellia_dec_blk_2way)
movq RRBP, %rbp;
@@ -13654,8 +13795,118 @@ index 310319c..db3d7b5 100644
+ pax_force_retaddr
ret;
ENDPROC(camellia_dec_blk_2way)
+diff --git a/arch/x86/crypto/camellia_aesni_avx2_glue.c b/arch/x86/crypto/camellia_aesni_avx2_glue.c
+index d844569..edaf489 100644
+--- a/arch/x86/crypto/camellia_aesni_avx2_glue.c
++++ b/arch/x86/crypto/camellia_aesni_avx2_glue.c
+@@ -27,20 +27,20 @@
+ #define CAMELLIA_AESNI_AVX2_PARALLEL_BLOCKS 32
+
+ /* 32-way AVX2/AES-NI parallel cipher functions */
+-asmlinkage void camellia_ecb_enc_32way(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_ecb_enc_32way(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void camellia_ecb_dec_32way(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_ecb_dec_32way(void *ctx, u8 *dst,
+ const u8 *src);
+
+-asmlinkage void camellia_cbc_dec_32way(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_cbc_dec_32way(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void camellia_ctr_32way(struct camellia_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void camellia_ctr_32way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+
+-asmlinkage void camellia_xts_enc_32way(struct camellia_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
+-asmlinkage void camellia_xts_dec_32way(struct camellia_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void camellia_xts_enc_32way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
++asmlinkage void camellia_xts_dec_32way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+
+ static const struct common_glue_ctx camellia_enc = {
+ .num_funcs = 4,
+diff --git a/arch/x86/crypto/camellia_aesni_avx_glue.c b/arch/x86/crypto/camellia_aesni_avx_glue.c
+index 93d8f29..4218a74 100644
+--- a/arch/x86/crypto/camellia_aesni_avx_glue.c
++++ b/arch/x86/crypto/camellia_aesni_avx_glue.c
+@@ -26,28 +26,28 @@
+ #define CAMELLIA_AESNI_PARALLEL_BLOCKS 16
+
+ /* 16-way parallel cipher functions (avx/aes-ni) */
+-asmlinkage void camellia_ecb_enc_16way(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_ecb_enc_16way(void *ctx, u8 *dst,
+ const u8 *src);
+ EXPORT_SYMBOL_GPL(camellia_ecb_enc_16way);
+
+-asmlinkage void camellia_ecb_dec_16way(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_ecb_dec_16way(void *ctx, u8 *dst,
+ const u8 *src);
+ EXPORT_SYMBOL_GPL(camellia_ecb_dec_16way);
+
+-asmlinkage void camellia_cbc_dec_16way(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_cbc_dec_16way(void *ctx, u8 *dst,
+ const u8 *src);
+ EXPORT_SYMBOL_GPL(camellia_cbc_dec_16way);
+
+-asmlinkage void camellia_ctr_16way(struct camellia_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void camellia_ctr_16way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+ EXPORT_SYMBOL_GPL(camellia_ctr_16way);
+
+-asmlinkage void camellia_xts_enc_16way(struct camellia_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void camellia_xts_enc_16way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+ EXPORT_SYMBOL_GPL(camellia_xts_enc_16way);
+
+-asmlinkage void camellia_xts_dec_16way(struct camellia_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void camellia_xts_dec_16way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+ EXPORT_SYMBOL_GPL(camellia_xts_dec_16way);
+
+ void camellia_xts_enc(void *ctx, u128 *dst, const u128 *src, le128 *iv)
+diff --git a/arch/x86/crypto/camellia_glue.c b/arch/x86/crypto/camellia_glue.c
+index 5c8b626..934a4b6 100644
+--- a/arch/x86/crypto/camellia_glue.c
++++ b/arch/x86/crypto/camellia_glue.c
+@@ -39,7 +39,7 @@
+ asmlinkage void __camellia_enc_blk(struct camellia_ctx *ctx, u8 *dst,
+ const u8 *src, bool xor);
+ EXPORT_SYMBOL_GPL(__camellia_enc_blk);
+-asmlinkage void camellia_dec_blk(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_dec_blk(void *ctx, u8 *dst,
+ const u8 *src);
+ EXPORT_SYMBOL_GPL(camellia_dec_blk);
+
+@@ -47,7 +47,7 @@ EXPORT_SYMBOL_GPL(camellia_dec_blk);
+ asmlinkage void __camellia_enc_blk_2way(struct camellia_ctx *ctx, u8 *dst,
+ const u8 *src, bool xor);
+ EXPORT_SYMBOL_GPL(__camellia_enc_blk_2way);
+-asmlinkage void camellia_dec_blk_2way(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_dec_blk_2way(void *ctx, u8 *dst,
+ const u8 *src);
+ EXPORT_SYMBOL_GPL(camellia_dec_blk_2way);
+
+@@ -1279,8 +1279,10 @@ static int camellia_setkey(struct crypto_tfm *tfm, const u8 *in_key,
+ &tfm->crt_flags);
+ }
+
+-void camellia_decrypt_cbc_2way(void *ctx, u128 *dst, const u128 *src)
++void camellia_decrypt_cbc_2way(void *ctx, u8 *_dst, const u8 *_src)
+ {
++ u128 *dst = (u128 *)_dst;
++ u128 *src = (u128 *)_src;
+ u128 iv = *src;
+
+ camellia_dec_blk_2way(ctx, (u8 *)dst, (u8 *)src);
diff --git a/arch/x86/crypto/cast5-avx-x86_64-asm_64.S b/arch/x86/crypto/cast5-avx-x86_64-asm_64.S
-index c35fd5d..2d8c7db 100644
+index c35fd5d..563138e 100644
--- a/arch/x86/crypto/cast5-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/cast5-avx-x86_64-asm_64.S
@@ -24,6 +24,7 @@
@@ -13682,7 +13933,16 @@ index c35fd5d..2d8c7db 100644
ret;
.L__skip_dec:
-@@ -388,6 +391,7 @@ ENTRY(cast5_ecb_enc_16way)
+@@ -359,7 +362,7 @@ __cast5_dec_blk16:
+ jmp .L__dec_tail;
+ ENDPROC(__cast5_dec_blk16)
+
+-ENTRY(cast5_ecb_enc_16way)
++RAP_ENTRY(cast5_ecb_enc_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -388,10 +391,11 @@ ENTRY(cast5_ecb_enc_16way)
vmovdqu RR4, (6*4*4)(%r11);
vmovdqu RL4, (7*4*4)(%r11);
@@ -13690,6 +13950,11 @@ index c35fd5d..2d8c7db 100644
ret;
ENDPROC(cast5_ecb_enc_16way)
+-ENTRY(cast5_ecb_dec_16way)
++RAP_ENTRY(cast5_ecb_dec_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
@@ -420,6 +424,7 @@ ENTRY(cast5_ecb_dec_16way)
vmovdqu RR4, (6*4*4)(%r11);
vmovdqu RL4, (7*4*4)(%r11);
@@ -13794,7 +14059,7 @@ index c35fd5d..2d8c7db 100644
ret;
ENDPROC(cast5_ctr_16way)
diff --git a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
-index e3531f8..e123f35 100644
+index e3531f8..564f08b 100644
--- a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
@@ -24,6 +24,7 @@
@@ -13813,7 +14078,7 @@ index e3531f8..e123f35 100644
ret;
ENDPROC(__cast6_enc_blk8)
-@@ -340,6 +342,7 @@ __cast6_dec_blk8:
+@@ -340,10 +342,11 @@ __cast6_dec_blk8:
outunpack_blocks(RA1, RB1, RC1, RD1, RTMP, RX, RKRF, RKM);
outunpack_blocks(RA2, RB2, RC2, RD2, RTMP, RX, RKRF, RKM);
@@ -13821,7 +14086,12 @@ index e3531f8..e123f35 100644
ret;
ENDPROC(__cast6_dec_blk8)
-@@ -358,6 +361,7 @@ ENTRY(cast6_ecb_enc_8way)
+-ENTRY(cast6_ecb_enc_8way)
++RAP_ENTRY(cast6_ecb_enc_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -358,10 +361,11 @@ ENTRY(cast6_ecb_enc_8way)
store_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -13829,7 +14099,12 @@ index e3531f8..e123f35 100644
ret;
ENDPROC(cast6_ecb_enc_8way)
-@@ -376,6 +380,7 @@ ENTRY(cast6_ecb_dec_8way)
+-ENTRY(cast6_ecb_dec_8way)
++RAP_ENTRY(cast6_ecb_dec_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -376,33 +380,35 @@ ENTRY(cast6_ecb_dec_8way)
store_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -13837,7 +14112,11 @@ index e3531f8..e123f35 100644
ret;
ENDPROC(cast6_ecb_dec_8way)
-@@ -386,19 +391,20 @@ ENTRY(cast6_cbc_dec_8way)
+-ENTRY(cast6_cbc_dec_8way)
++RAP_ENTRY(cast6_cbc_dec_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
* %rdx: src
*/
@@ -13862,7 +14141,12 @@ index e3531f8..e123f35 100644
ret;
ENDPROC(cast6_cbc_dec_8way)
-@@ -410,20 +416,21 @@ ENTRY(cast6_ctr_8way)
+-ENTRY(cast6_ctr_8way)
++RAP_ENTRY(cast6_ctr_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -410,24 +416,25 @@ ENTRY(cast6_ctr_8way)
* %rcx: iv (little endian, 128bit)
*/
@@ -13888,7 +14172,12 @@ index e3531f8..e123f35 100644
ret;
ENDPROC(cast6_ctr_8way)
-@@ -446,6 +453,7 @@ ENTRY(cast6_xts_enc_8way)
+-ENTRY(cast6_xts_enc_8way)
++RAP_ENTRY(cast6_xts_enc_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -446,10 +453,11 @@ ENTRY(cast6_xts_enc_8way)
/* dst <= regs xor IVs(in dst) */
store_xts_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -13896,6 +14185,11 @@ index e3531f8..e123f35 100644
ret;
ENDPROC(cast6_xts_enc_8way)
+-ENTRY(cast6_xts_dec_8way)
++RAP_ENTRY(cast6_xts_dec_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
@@ -468,5 +476,6 @@ ENTRY(cast6_xts_dec_8way)
/* dst <= regs xor IVs(in dst) */
store_xts_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -13903,6 +14197,39 @@ index e3531f8..e123f35 100644
+ pax_force_retaddr
ret;
ENDPROC(cast6_xts_dec_8way)
+diff --git a/arch/x86/crypto/cast6_avx_glue.c b/arch/x86/crypto/cast6_avx_glue.c
+index fca4595..e5d2127 100644
+--- a/arch/x86/crypto/cast6_avx_glue.c
++++ b/arch/x86/crypto/cast6_avx_glue.c
+@@ -41,20 +41,20 @@
+
+ #define CAST6_PARALLEL_BLOCKS 8
+
+-asmlinkage void cast6_ecb_enc_8way(struct cast6_ctx *ctx, u8 *dst,
++asmlinkage void cast6_ecb_enc_8way(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void cast6_ecb_dec_8way(struct cast6_ctx *ctx, u8 *dst,
++asmlinkage void cast6_ecb_dec_8way(void *ctx, u8 *dst,
+ const u8 *src);
+
+-asmlinkage void cast6_cbc_dec_8way(struct cast6_ctx *ctx, u8 *dst,
++asmlinkage void cast6_cbc_dec_8way(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void cast6_ctr_8way(struct cast6_ctx *ctx, u8 *dst, const u8 *src,
++asmlinkage void cast6_ctr_8way(void *ctx, u128 *dst, const u128 *src,
+ le128 *iv);
+
+-asmlinkage void cast6_xts_enc_8way(struct cast6_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
+-asmlinkage void cast6_xts_dec_8way(struct cast6_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void cast6_xts_enc_8way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
++asmlinkage void cast6_xts_dec_8way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+
+ static void cast6_xts_enc(void *ctx, u128 *dst, const u128 *src, le128 *iv)
+ {
diff --git a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
index 4fe27e0..2885e731 100644
--- a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
@@ -13958,6 +14285,19 @@ index 5d1e007..098cb4f 100644
+ pax_force_retaddr
ret
ENDPROC(clmul_ghash_update)
+diff --git a/arch/x86/crypto/glue_helper.c b/arch/x86/crypto/glue_helper.c
+index 6a85598..fed2ada 100644
+--- a/arch/x86/crypto/glue_helper.c
++++ b/arch/x86/crypto/glue_helper.c
+@@ -165,7 +165,7 @@ __glue_cbc_decrypt_128bit(const struct common_glue_ctx *gctx,
+ src -= num_blocks - 1;
+ dst -= num_blocks - 1;
+
+- gctx->funcs[i].fn_u.cbc(ctx, dst, src);
++ gctx->funcs[i].fn_u.cbc(ctx, (u8 *)dst, (u8 *)src);
+
+ nbytes -= bsize;
+ if (nbytes < bsize)
diff --git a/arch/x86/crypto/salsa20-x86_64-asm_64.S b/arch/x86/crypto/salsa20-x86_64-asm_64.S
index 9279e0b..c4b3d2c 100644
--- a/arch/x86/crypto/salsa20-x86_64-asm_64.S
@@ -13992,7 +14332,7 @@ index 9279e0b..c4b3d2c 100644
ret
ENDPROC(salsa20_ivsetup)
diff --git a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
-index 2f202f4..d9164d6 100644
+index 2f202f4..e671172 100644
--- a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
@@ -24,6 +24,7 @@
@@ -14011,7 +14351,7 @@ index 2f202f4..d9164d6 100644
ret;
ENDPROC(__serpent_enc_blk8_avx)
-@@ -672,6 +674,7 @@ __serpent_dec_blk8_avx:
+@@ -672,10 +674,11 @@ __serpent_dec_blk8_avx:
write_blocks(RC1, RD1, RB1, RE1, RK0, RK1, RK2);
write_blocks(RC2, RD2, RB2, RE2, RK0, RK1, RK2);
@@ -14019,7 +14359,12 @@ index 2f202f4..d9164d6 100644
ret;
ENDPROC(__serpent_dec_blk8_avx)
-@@ -688,6 +691,7 @@ ENTRY(serpent_ecb_enc_8way_avx)
+-ENTRY(serpent_ecb_enc_8way_avx)
++RAP_ENTRY(serpent_ecb_enc_8way_avx)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -688,10 +691,11 @@ ENTRY(serpent_ecb_enc_8way_avx)
store_8way(%rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -14027,7 +14372,12 @@ index 2f202f4..d9164d6 100644
ret;
ENDPROC(serpent_ecb_enc_8way_avx)
-@@ -704,6 +708,7 @@ ENTRY(serpent_ecb_dec_8way_avx)
+-ENTRY(serpent_ecb_dec_8way_avx)
++RAP_ENTRY(serpent_ecb_dec_8way_avx)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -704,10 +708,11 @@ ENTRY(serpent_ecb_dec_8way_avx)
store_8way(%rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2);
@@ -14035,7 +14385,12 @@ index 2f202f4..d9164d6 100644
ret;
ENDPROC(serpent_ecb_dec_8way_avx)
-@@ -720,6 +725,7 @@ ENTRY(serpent_cbc_dec_8way_avx)
+-ENTRY(serpent_cbc_dec_8way_avx)
++RAP_ENTRY(serpent_cbc_dec_8way_avx)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -720,10 +725,11 @@ ENTRY(serpent_cbc_dec_8way_avx)
store_cbc_8way(%rdx, %rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2);
@@ -14043,7 +14398,12 @@ index 2f202f4..d9164d6 100644
ret;
ENDPROC(serpent_cbc_dec_8way_avx)
-@@ -738,6 +744,7 @@ ENTRY(serpent_ctr_8way_avx)
+-ENTRY(serpent_ctr_8way_avx)
++RAP_ENTRY(serpent_ctr_8way_avx)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -738,10 +744,11 @@ ENTRY(serpent_ctr_8way_avx)
store_ctr_8way(%rdx, %rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -14051,7 +14411,12 @@ index 2f202f4..d9164d6 100644
ret;
ENDPROC(serpent_ctr_8way_avx)
-@@ -758,6 +765,7 @@ ENTRY(serpent_xts_enc_8way_avx)
+-ENTRY(serpent_xts_enc_8way_avx)
++RAP_ENTRY(serpent_xts_enc_8way_avx)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -758,10 +765,11 @@ ENTRY(serpent_xts_enc_8way_avx)
/* dst <= regs xor IVs(in dst) */
store_xts_8way(%rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -14059,6 +14424,11 @@ index 2f202f4..d9164d6 100644
ret;
ENDPROC(serpent_xts_enc_8way_avx)
+-ENTRY(serpent_xts_dec_8way_avx)
++RAP_ENTRY(serpent_xts_dec_8way_avx)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
@@ -778,5 +786,6 @@ ENTRY(serpent_xts_dec_8way_avx)
/* dst <= regs xor IVs(in dst) */
store_xts_8way(%rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2);
@@ -14067,7 +14437,7 @@ index 2f202f4..d9164d6 100644
ret;
ENDPROC(serpent_xts_dec_8way_avx)
diff --git a/arch/x86/crypto/serpent-avx2-asm_64.S b/arch/x86/crypto/serpent-avx2-asm_64.S
-index b222085..abd483c 100644
+index b222085..c43efce 100644
--- a/arch/x86/crypto/serpent-avx2-asm_64.S
+++ b/arch/x86/crypto/serpent-avx2-asm_64.S
@@ -15,6 +15,7 @@
@@ -14086,7 +14456,7 @@ index b222085..abd483c 100644
ret;
ENDPROC(__serpent_enc_blk16)
-@@ -664,6 +666,7 @@ __serpent_dec_blk16:
+@@ -664,10 +666,11 @@ __serpent_dec_blk16:
write_blocks(RC1, RD1, RB1, RE1, RK0, RK1, RK2);
write_blocks(RC2, RD2, RB2, RE2, RK0, RK1, RK2);
@@ -14094,7 +14464,12 @@ index b222085..abd483c 100644
ret;
ENDPROC(__serpent_dec_blk16)
-@@ -684,6 +687,7 @@ ENTRY(serpent_ecb_enc_16way)
+-ENTRY(serpent_ecb_enc_16way)
++RAP_ENTRY(serpent_ecb_enc_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -684,10 +687,11 @@ ENTRY(serpent_ecb_enc_16way)
vzeroupper;
@@ -14102,7 +14477,12 @@ index b222085..abd483c 100644
ret;
ENDPROC(serpent_ecb_enc_16way)
-@@ -704,6 +708,7 @@ ENTRY(serpent_ecb_dec_16way)
+-ENTRY(serpent_ecb_dec_16way)
++RAP_ENTRY(serpent_ecb_dec_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -704,10 +708,11 @@ ENTRY(serpent_ecb_dec_16way)
vzeroupper;
@@ -14110,7 +14490,12 @@ index b222085..abd483c 100644
ret;
ENDPROC(serpent_ecb_dec_16way)
-@@ -725,6 +730,7 @@ ENTRY(serpent_cbc_dec_16way)
+-ENTRY(serpent_cbc_dec_16way)
++RAP_ENTRY(serpent_cbc_dec_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -725,10 +730,11 @@ ENTRY(serpent_cbc_dec_16way)
vzeroupper;
@@ -14118,7 +14503,12 @@ index b222085..abd483c 100644
ret;
ENDPROC(serpent_cbc_dec_16way)
-@@ -748,6 +754,7 @@ ENTRY(serpent_ctr_16way)
+-ENTRY(serpent_ctr_16way)
++RAP_ENTRY(serpent_ctr_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (16 blocks)
+@@ -748,10 +754,11 @@ ENTRY(serpent_ctr_16way)
vzeroupper;
@@ -14126,7 +14516,12 @@ index b222085..abd483c 100644
ret;
ENDPROC(serpent_ctr_16way)
-@@ -772,6 +779,7 @@ ENTRY(serpent_xts_enc_16way)
+-ENTRY(serpent_xts_enc_16way)
++RAP_ENTRY(serpent_xts_enc_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (16 blocks)
+@@ -772,10 +779,11 @@ ENTRY(serpent_xts_enc_16way)
vzeroupper;
@@ -14134,6 +14529,11 @@ index b222085..abd483c 100644
ret;
ENDPROC(serpent_xts_enc_16way)
+-ENTRY(serpent_xts_dec_16way)
++RAP_ENTRY(serpent_xts_dec_16way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst (16 blocks)
@@ -796,5 +804,6 @@ ENTRY(serpent_xts_dec_16way)
vzeroupper;
@@ -14175,6 +14575,94 @@ index acc066c..1559cc4 100644
+ pax_force_retaddr
ret;
ENDPROC(serpent_dec_blk_8way)
+diff --git a/arch/x86/crypto/serpent_avx2_glue.c b/arch/x86/crypto/serpent_avx2_glue.c
+index 6d19834..a08fbe9 100644
+--- a/arch/x86/crypto/serpent_avx2_glue.c
++++ b/arch/x86/crypto/serpent_avx2_glue.c
+@@ -27,18 +27,18 @@
+ #define SERPENT_AVX2_PARALLEL_BLOCKS 16
+
+ /* 16-way AVX2 parallel cipher functions */
+-asmlinkage void serpent_ecb_enc_16way(struct serpent_ctx *ctx, u8 *dst,
++asmlinkage void serpent_ecb_enc_16way(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void serpent_ecb_dec_16way(struct serpent_ctx *ctx, u8 *dst,
++asmlinkage void serpent_ecb_dec_16way(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void serpent_cbc_dec_16way(void *ctx, u128 *dst, const u128 *src);
++asmlinkage void serpent_cbc_dec_16way(void *ctx, u8 *dst, const u8 *src);
+
+ asmlinkage void serpent_ctr_16way(void *ctx, u128 *dst, const u128 *src,
+ le128 *iv);
+-asmlinkage void serpent_xts_enc_16way(struct serpent_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
+-asmlinkage void serpent_xts_dec_16way(struct serpent_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void serpent_xts_enc_16way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
++asmlinkage void serpent_xts_dec_16way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+
+ static const struct common_glue_ctx serpent_enc = {
+ .num_funcs = 3,
+diff --git a/arch/x86/crypto/serpent_avx_glue.c b/arch/x86/crypto/serpent_avx_glue.c
+index 5dc3702..10f232a 100644
+--- a/arch/x86/crypto/serpent_avx_glue.c
++++ b/arch/x86/crypto/serpent_avx_glue.c
+@@ -41,28 +41,28 @@
+ #include <asm/crypto/glue_helper.h>
+
+ /* 8-way parallel cipher functions */
+-asmlinkage void serpent_ecb_enc_8way_avx(struct serpent_ctx *ctx, u8 *dst,
++asmlinkage void serpent_ecb_enc_8way_avx(void *ctx, u8 *dst,
+ const u8 *src);
+ EXPORT_SYMBOL_GPL(serpent_ecb_enc_8way_avx);
+
+-asmlinkage void serpent_ecb_dec_8way_avx(struct serpent_ctx *ctx, u8 *dst,
++asmlinkage void serpent_ecb_dec_8way_avx(void *ctx, u8 *dst,
+ const u8 *src);
+ EXPORT_SYMBOL_GPL(serpent_ecb_dec_8way_avx);
+
+-asmlinkage void serpent_cbc_dec_8way_avx(struct serpent_ctx *ctx, u8 *dst,
++asmlinkage void serpent_cbc_dec_8way_avx(void *ctx, u8 *dst,
+ const u8 *src);
+ EXPORT_SYMBOL_GPL(serpent_cbc_dec_8way_avx);
+
+-asmlinkage void serpent_ctr_8way_avx(struct serpent_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void serpent_ctr_8way_avx(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+ EXPORT_SYMBOL_GPL(serpent_ctr_8way_avx);
+
+-asmlinkage void serpent_xts_enc_8way_avx(struct serpent_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void serpent_xts_enc_8way_avx(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+ EXPORT_SYMBOL_GPL(serpent_xts_enc_8way_avx);
+
+-asmlinkage void serpent_xts_dec_8way_avx(struct serpent_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void serpent_xts_dec_8way_avx(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+ EXPORT_SYMBOL_GPL(serpent_xts_dec_8way_avx);
+
+ void __serpent_crypt_ctr(void *ctx, u128 *dst, const u128 *src, le128 *iv)
+diff --git a/arch/x86/crypto/serpent_sse2_glue.c b/arch/x86/crypto/serpent_sse2_glue.c
+index 3643dd5..17d5e30 100644
+--- a/arch/x86/crypto/serpent_sse2_glue.c
++++ b/arch/x86/crypto/serpent_sse2_glue.c
+@@ -45,8 +45,10 @@
+ #include <asm/crypto/serpent-sse2.h>
+ #include <asm/crypto/glue_helper.h>
+
+-static void serpent_decrypt_cbc_xway(void *ctx, u128 *dst, const u128 *src)
++static void serpent_decrypt_cbc_xway(void *ctx, u8 *_dst, const u8 *_src)
+ {
++ u128 *dst = (u128 *)_dst;
++ const u128 *src = (const u128 *)_src;
+ u128 ivs[SERPENT_PARALLEL_BLOCKS - 1];
+ unsigned int j;
+
diff --git a/arch/x86/crypto/sha-mb/sha1_mb.c b/arch/x86/crypto/sha-mb/sha1_mb.c
index a841e97..8381c09d 100644
--- a/arch/x86/crypto/sha-mb/sha1_mb.c
@@ -14193,7 +14681,7 @@ index a841e97..8381c09d 100644
}
}
diff --git a/arch/x86/crypto/sha1_ssse3_asm.S b/arch/x86/crypto/sha1_ssse3_asm.S
-index a410950..9dfe7ad 100644
+index a410950..02d2056 100644
--- a/arch/x86/crypto/sha1_ssse3_asm.S
+++ b/arch/x86/crypto/sha1_ssse3_asm.S
@@ -29,6 +29,7 @@
@@ -14204,7 +14692,13 @@ index a410950..9dfe7ad 100644
#define CTX %rdi // arg1
#define BUF %rsi // arg2
-@@ -75,9 +76,9 @@
+@@ -71,13 +72,14 @@
+ * param: function's name
+ */
+ .macro SHA1_VECTOR_ASM name
+- ENTRY(\name)
++ALIGN
++ RAP_ENTRY(\name)
push %rbx
push %rbp
@@ -14216,7 +14710,7 @@ index a410950..9dfe7ad 100644
sub $64, %rsp # allocate workspace
and $~15, %rsp # align stack
-@@ -99,11 +100,12 @@
+@@ -99,11 +101,12 @@
xor %rax, %rax
rep stosq
@@ -14231,8 +14725,161 @@ index a410950..9dfe7ad 100644
ret
ENDPROC(\name)
+diff --git a/arch/x86/crypto/sha1_ssse3_glue.c b/arch/x86/crypto/sha1_ssse3_glue.c
+index dd14616..53358bb 100644
+--- a/arch/x86/crypto/sha1_ssse3_glue.c
++++ b/arch/x86/crypto/sha1_ssse3_glue.c
+@@ -31,8 +31,8 @@
+ #include <crypto/sha1_base.h>
+ #include <asm/fpu/api.h>
+
+-typedef void (sha1_transform_fn)(u32 *digest, const char *data,
+- unsigned int rounds);
++typedef void (sha1_transform_fn)(struct sha1_state *digest, const u8 *data,
++ int rounds);
+
+ static int sha1_update(struct shash_desc *desc, const u8 *data,
+ unsigned int len, sha1_transform_fn *sha1_xform)
+@@ -47,8 +47,7 @@ static int sha1_update(struct shash_desc *desc, const u8 *data,
+ BUILD_BUG_ON(offsetof(struct sha1_state, state) != 0);
+
+ kernel_fpu_begin();
+- sha1_base_do_update(desc, data, len,
+- (sha1_block_fn *)sha1_xform);
++ sha1_base_do_update(desc, data, len, sha1_xform);
+ kernel_fpu_end();
+
+ return 0;
+@@ -62,29 +61,26 @@ static int sha1_finup(struct shash_desc *desc, const u8 *data,
+
+ kernel_fpu_begin();
+ if (len)
+- sha1_base_do_update(desc, data, len,
+- (sha1_block_fn *)sha1_xform);
+- sha1_base_do_finalize(desc, (sha1_block_fn *)sha1_xform);
++ sha1_base_do_update(desc, data, len, sha1_xform);
++ sha1_base_do_finalize(desc, sha1_xform);
+ kernel_fpu_end();
+
+ return sha1_base_finish(desc, out);
+ }
+
+-asmlinkage void sha1_transform_ssse3(u32 *digest, const char *data,
+- unsigned int rounds);
++asmlinkage void sha1_transform_ssse3(struct sha1_state *digest, const u8 *data,
++ int rounds);
+
+ static int sha1_ssse3_update(struct shash_desc *desc, const u8 *data,
+ unsigned int len)
+ {
+- return sha1_update(desc, data, len,
+- (sha1_transform_fn *) sha1_transform_ssse3);
++ return sha1_update(desc, data, len, sha1_transform_ssse3);
+ }
+
+ static int sha1_ssse3_finup(struct shash_desc *desc, const u8 *data,
+ unsigned int len, u8 *out)
+ {
+- return sha1_finup(desc, data, len, out,
+- (sha1_transform_fn *) sha1_transform_ssse3);
++ return sha1_finup(desc, data, len, out, sha1_transform_ssse3);
+ }
+
+ /* Add padding and return the message digest. */
+@@ -124,21 +120,19 @@ static void unregister_sha1_ssse3(void)
+ }
+
+ #ifdef CONFIG_AS_AVX
+-asmlinkage void sha1_transform_avx(u32 *digest, const char *data,
+- unsigned int rounds);
++asmlinkage void sha1_transform_avx(struct sha1_state *digest, const u8 *data,
++ int rounds);
+
+ static int sha1_avx_update(struct shash_desc *desc, const u8 *data,
+ unsigned int len)
+ {
+- return sha1_update(desc, data, len,
+- (sha1_transform_fn *) sha1_transform_avx);
++ return sha1_update(desc, data, len, sha1_transform_avx);
+ }
+
+ static int sha1_avx_finup(struct shash_desc *desc, const u8 *data,
+ unsigned int len, u8 *out)
+ {
+- return sha1_finup(desc, data, len, out,
+- (sha1_transform_fn *) sha1_transform_avx);
++ return sha1_finup(desc, data, len, out, sha1_transform_avx);
+ }
+
+ static int sha1_avx_final(struct shash_desc *desc, u8 *out)
+@@ -196,8 +190,8 @@ static inline void unregister_sha1_avx(void) { }
+ #if defined(CONFIG_AS_AVX2) && (CONFIG_AS_AVX)
+ #define SHA1_AVX2_BLOCK_OPTSIZE 4 /* optimal 4*64 bytes of SHA1 blocks */
+
+-asmlinkage void sha1_transform_avx2(u32 *digest, const char *data,
+- unsigned int rounds);
++asmlinkage void sha1_transform_avx2(struct sha1_state *digest, const u8 *data,
++ int rounds);
+
+ static bool avx2_usable(void)
+ {
+@@ -209,8 +203,8 @@ static bool avx2_usable(void)
+ return false;
+ }
+
+-static void sha1_apply_transform_avx2(u32 *digest, const char *data,
+- unsigned int rounds)
++static void sha1_apply_transform_avx2(struct sha1_state *digest, const u8 *data,
++ int rounds)
+ {
+ /* Select the optimal transform based on data block size */
+ if (rounds >= SHA1_AVX2_BLOCK_OPTSIZE)
+@@ -222,15 +216,13 @@ static void sha1_apply_transform_avx2(u32 *digest, const char *data,
+ static int sha1_avx2_update(struct shash_desc *desc, const u8 *data,
+ unsigned int len)
+ {
+- return sha1_update(desc, data, len,
+- (sha1_transform_fn *) sha1_apply_transform_avx2);
++ return sha1_update(desc, data, len, sha1_apply_transform_avx2);
+ }
+
+ static int sha1_avx2_finup(struct shash_desc *desc, const u8 *data,
+ unsigned int len, u8 *out)
+ {
+- return sha1_finup(desc, data, len, out,
+- (sha1_transform_fn *) sha1_apply_transform_avx2);
++ return sha1_finup(desc, data, len, out, sha1_apply_transform_avx2);
+ }
+
+ static int sha1_avx2_final(struct shash_desc *desc, u8 *out)
+@@ -274,21 +266,19 @@ static inline void unregister_sha1_avx2(void) { }
+ #endif
+
+ #ifdef CONFIG_AS_SHA1_NI
+-asmlinkage void sha1_ni_transform(u32 *digest, const char *data,
+- unsigned int rounds);
++asmlinkage void sha1_ni_transform(struct sha1_state *digest, const u8 *data,
++ int rounds);
+
+ static int sha1_ni_update(struct shash_desc *desc, const u8 *data,
+ unsigned int len)
+ {
+- return sha1_update(desc, data, len,
+- (sha1_transform_fn *) sha1_ni_transform);
++ return sha1_update(desc, data, len, sha1_ni_transform);
+ }
+
+ static int sha1_ni_finup(struct shash_desc *desc, const u8 *data,
+ unsigned int len, u8 *out)
+ {
+- return sha1_finup(desc, data, len, out,
+- (sha1_transform_fn *) sha1_ni_transform);
++ return sha1_finup(desc, data, len, out, sha1_ni_transform);
+ }
+
+ static int sha1_ni_final(struct shash_desc *desc, u8 *out)
diff --git a/arch/x86/crypto/sha256-avx-asm.S b/arch/x86/crypto/sha256-avx-asm.S
-index 92b3b5d..0dc1dcb 100644
+index 92b3b5d..8732479 100644
--- a/arch/x86/crypto/sha256-avx-asm.S
+++ b/arch/x86/crypto/sha256-avx-asm.S
@@ -49,6 +49,7 @@
@@ -14243,7 +14890,17 @@ index 92b3b5d..0dc1dcb 100644
## assume buffers not aligned
#define VMOVDQ vmovdqu
-@@ -460,6 +461,7 @@ done_hash:
+@@ -347,8 +348,7 @@ a = TMP_
+ ## arg 3 : Num blocks
+ ########################################################################
+ .text
+-ENTRY(sha256_transform_avx)
+-.align 32
++RAP_ENTRY(sha256_transform_avx)
+ pushq %rbx
+ pushq %rbp
+ pushq %r13
+@@ -460,6 +460,7 @@ done_hash:
popq %r13
popq %rbp
popq %rbx
@@ -14252,7 +14909,7 @@ index 92b3b5d..0dc1dcb 100644
ENDPROC(sha256_transform_avx)
diff --git a/arch/x86/crypto/sha256-avx2-asm.S b/arch/x86/crypto/sha256-avx2-asm.S
-index 570ec5e..cf2b625 100644
+index 570ec5e..9bcfa25 100644
--- a/arch/x86/crypto/sha256-avx2-asm.S
+++ b/arch/x86/crypto/sha256-avx2-asm.S
@@ -50,6 +50,7 @@
@@ -14263,7 +14920,17 @@ index 570ec5e..cf2b625 100644
## assume buffers not aligned
#define VMOVDQ vmovdqu
-@@ -720,6 +721,7 @@ done_hash:
+@@ -528,8 +529,7 @@ STACK_SIZE = _RSP + _RSP_SIZE
+ ## arg 3 : Num blocks
+ ########################################################################
+ .text
+-ENTRY(sha256_transform_rorx)
+-.align 32
++RAP_ENTRY(sha256_transform_rorx)
+ pushq %rbx
+ pushq %rbp
+ pushq %r12
+@@ -720,6 +720,7 @@ done_hash:
popq %r12
popq %rbp
popq %rbx
@@ -14272,7 +14939,7 @@ index 570ec5e..cf2b625 100644
ENDPROC(sha256_transform_rorx)
diff --git a/arch/x86/crypto/sha256-ssse3-asm.S b/arch/x86/crypto/sha256-ssse3-asm.S
-index 2cedc44..5144899 100644
+index 2cedc44..6fb8582 100644
--- a/arch/x86/crypto/sha256-ssse3-asm.S
+++ b/arch/x86/crypto/sha256-ssse3-asm.S
@@ -47,6 +47,7 @@
@@ -14283,7 +14950,18 @@ index 2cedc44..5144899 100644
## assume buffers not aligned
#define MOVDQ movdqu
-@@ -471,6 +472,7 @@ done_hash:
+@@ -352,9 +353,7 @@ a = TMP_
+ ## arg 2 : pointer to input data
+ ## arg 3 : Num blocks
+ ########################################################################
+-.text
+-ENTRY(sha256_transform_ssse3)
+-.align 32
++RAP_ENTRY(sha256_transform_ssse3)
+ pushq %rbx
+ pushq %rbp
+ pushq %r13
+@@ -471,6 +470,7 @@ done_hash:
popq %rbp
popq %rbx
@@ -14291,8 +14969,80 @@ index 2cedc44..5144899 100644
ret
ENDPROC(sha256_transform_ssse3)
+diff --git a/arch/x86/crypto/sha256_ssse3_glue.c b/arch/x86/crypto/sha256_ssse3_glue.c
+index 5f4d608..ddce00d 100644
+--- a/arch/x86/crypto/sha256_ssse3_glue.c
++++ b/arch/x86/crypto/sha256_ssse3_glue.c
+@@ -40,9 +40,9 @@
+ #include <asm/fpu/api.h>
+ #include <linux/string.h>
+
+-asmlinkage void sha256_transform_ssse3(u32 *digest, const char *data,
+- u64 rounds);
+-typedef void (sha256_transform_fn)(u32 *digest, const char *data, u64 rounds);
++asmlinkage void sha256_transform_ssse3(struct sha256_state *digest, const u8 *data,
++ int rounds);
++typedef void (sha256_transform_fn)(struct sha256_state *digest, const u8 *data, int rounds);
+
+ static int sha256_update(struct shash_desc *desc, const u8 *data,
+ unsigned int len, sha256_transform_fn *sha256_xform)
+@@ -57,8 +57,7 @@ static int sha256_update(struct shash_desc *desc, const u8 *data,
+ BUILD_BUG_ON(offsetof(struct sha256_state, state) != 0);
+
+ kernel_fpu_begin();
+- sha256_base_do_update(desc, data, len,
+- (sha256_block_fn *)sha256_xform);
++ sha256_base_do_update(desc, data, len, sha256_xform);
+ kernel_fpu_end();
+
+ return 0;
+@@ -72,9 +71,8 @@ static int sha256_finup(struct shash_desc *desc, const u8 *data,
+
+ kernel_fpu_begin();
+ if (len)
+- sha256_base_do_update(desc, data, len,
+- (sha256_block_fn *)sha256_xform);
+- sha256_base_do_finalize(desc, (sha256_block_fn *)sha256_xform);
++ sha256_base_do_update(desc, data, len, sha256_xform);
++ sha256_base_do_finalize(desc, sha256_xform);
+ kernel_fpu_end();
+
+ return sha256_base_finish(desc, out);
+@@ -146,8 +144,8 @@ static void unregister_sha256_ssse3(void)
+ }
+
+ #ifdef CONFIG_AS_AVX
+-asmlinkage void sha256_transform_avx(u32 *digest, const char *data,
+- u64 rounds);
++asmlinkage void sha256_transform_avx(struct sha256_state *digest, const u8 *data,
++ int rounds);
+
+ static int sha256_avx_update(struct shash_desc *desc, const u8 *data,
+ unsigned int len)
+@@ -230,8 +228,8 @@ static inline void unregister_sha256_avx(void) { }
+ #endif
+
+ #if defined(CONFIG_AS_AVX2) && defined(CONFIG_AS_AVX)
+-asmlinkage void sha256_transform_rorx(u32 *digest, const char *data,
+- u64 rounds);
++asmlinkage void sha256_transform_rorx(struct sha256_state *digest, const u8 *data,
++ int rounds);
+
+ static int sha256_avx2_update(struct shash_desc *desc, const u8 *data,
+ unsigned int len)
+@@ -312,8 +310,8 @@ static inline void unregister_sha256_avx2(void) { }
+ #endif
+
+ #ifdef CONFIG_AS_SHA256_NI
+-asmlinkage void sha256_ni_transform(u32 *digest, const char *data,
+- u64 rounds); /*unsigned int rounds);*/
++asmlinkage void sha256_ni_transform(struct sha256_state *digest, const u8 *data,
++ int rounds); /*unsigned int rounds);*/
+
+ static int sha256_ni_update(struct shash_desc *desc, const u8 *data,
+ unsigned int len)
diff --git a/arch/x86/crypto/sha512-avx-asm.S b/arch/x86/crypto/sha512-avx-asm.S
-index 565274d..af6bc08 100644
+index 565274d..779d34a 100644
--- a/arch/x86/crypto/sha512-avx-asm.S
+++ b/arch/x86/crypto/sha512-avx-asm.S
@@ -49,6 +49,7 @@
@@ -14303,7 +15053,17 @@ index 565274d..af6bc08 100644
.text
-@@ -364,6 +365,7 @@ updateblock:
+@@ -277,7 +278,8 @@ frame_size = frame_GPRSAVE + GPRSAVE_SIZE
+ # message blocks.
+ # L is the message length in SHA512 blocks
+ ########################################################################
+-ENTRY(sha512_transform_avx)
++ALIGN
++RAP_ENTRY(sha512_transform_avx)
+ cmp $0, msglen
+ je nowork
+
+@@ -364,6 +366,7 @@ updateblock:
mov frame_RSPSAVE(%rsp), %rsp
nowork:
@@ -14312,7 +15072,7 @@ index 565274d..af6bc08 100644
ENDPROC(sha512_transform_avx)
diff --git a/arch/x86/crypto/sha512-avx2-asm.S b/arch/x86/crypto/sha512-avx2-asm.S
-index 1f20b35..f25c8c1 100644
+index 1f20b35..ab1f3a8 100644
--- a/arch/x86/crypto/sha512-avx2-asm.S
+++ b/arch/x86/crypto/sha512-avx2-asm.S
@@ -51,6 +51,7 @@
@@ -14323,7 +15083,17 @@ index 1f20b35..f25c8c1 100644
.text
-@@ -678,6 +679,7 @@ done_hash:
+@@ -568,7 +569,8 @@ frame_size = frame_GPRSAVE + GPRSAVE_SIZE
+ # message blocks.
+ # L is the message length in SHA512 blocks
+ ########################################################################
+-ENTRY(sha512_transform_rorx)
++ALIGN
++RAP_ENTRY(sha512_transform_rorx)
+ # Allocate Stack Space
+ mov %rsp, %rax
+ sub $frame_size, %rsp
+@@ -678,6 +680,7 @@ done_hash:
# Restore Stack Pointer
mov frame_RSPSAVE(%rsp), %rsp
@@ -14332,7 +15102,7 @@ index 1f20b35..f25c8c1 100644
ENDPROC(sha512_transform_rorx)
diff --git a/arch/x86/crypto/sha512-ssse3-asm.S b/arch/x86/crypto/sha512-ssse3-asm.S
-index e610e29..ffcb5ed 100644
+index e610e29..83f1cde 100644
--- a/arch/x86/crypto/sha512-ssse3-asm.S
+++ b/arch/x86/crypto/sha512-ssse3-asm.S
@@ -48,6 +48,7 @@
@@ -14343,7 +15113,17 @@ index e610e29..ffcb5ed 100644
.text
-@@ -363,6 +364,7 @@ updateblock:
+@@ -275,7 +276,8 @@ frame_size = frame_GPRSAVE + GPRSAVE_SIZE
+ # message blocks.
+ # L is the message length in SHA512 blocks.
+ ########################################################################
+-ENTRY(sha512_transform_ssse3)
++ALIGN
++RAP_ENTRY(sha512_transform_ssse3)
+
+ cmp $0, msglen
+ je nowork
+@@ -363,6 +365,7 @@ updateblock:
mov frame_RSPSAVE(%rsp), %rsp
nowork:
@@ -14351,8 +15131,70 @@ index e610e29..ffcb5ed 100644
ret
ENDPROC(sha512_transform_ssse3)
+diff --git a/arch/x86/crypto/sha512_ssse3_glue.c b/arch/x86/crypto/sha512_ssse3_glue.c
+index 34e5083..eb57a5e 100644
+--- a/arch/x86/crypto/sha512_ssse3_glue.c
++++ b/arch/x86/crypto/sha512_ssse3_glue.c
+@@ -39,10 +39,10 @@
+
+ #include <linux/string.h>
+
+-asmlinkage void sha512_transform_ssse3(u64 *digest, const char *data,
+- u64 rounds);
++asmlinkage void sha512_transform_ssse3(struct sha512_state *digest, const u8 *data,
++ int rounds);
+
+-typedef void (sha512_transform_fn)(u64 *digest, const char *data, u64 rounds);
++typedef void (sha512_transform_fn)(struct sha512_state *digest, const u8 *data, int rounds);
+
+ static int sha512_update(struct shash_desc *desc, const u8 *data,
+ unsigned int len, sha512_transform_fn *sha512_xform)
+@@ -57,8 +57,7 @@ static int sha512_update(struct shash_desc *desc, const u8 *data,
+ BUILD_BUG_ON(offsetof(struct sha512_state, state) != 0);
+
+ kernel_fpu_begin();
+- sha512_base_do_update(desc, data, len,
+- (sha512_block_fn *)sha512_xform);
++ sha512_base_do_update(desc, data, len, sha512_xform);
+ kernel_fpu_end();
+
+ return 0;
+@@ -72,9 +71,8 @@ static int sha512_finup(struct shash_desc *desc, const u8 *data,
+
+ kernel_fpu_begin();
+ if (len)
+- sha512_base_do_update(desc, data, len,
+- (sha512_block_fn *)sha512_xform);
+- sha512_base_do_finalize(desc, (sha512_block_fn *)sha512_xform);
++ sha512_base_do_update(desc, data, len, sha512_xform);
++ sha512_base_do_finalize(desc, sha512_xform);
+ kernel_fpu_end();
+
+ return sha512_base_finish(desc, out);
+@@ -146,8 +144,8 @@ static void unregister_sha512_ssse3(void)
+ }
+
+ #ifdef CONFIG_AS_AVX
+-asmlinkage void sha512_transform_avx(u64 *digest, const char *data,
+- u64 rounds);
++asmlinkage void sha512_transform_avx(struct sha512_state *digest, const u8 *data,
++ int rounds);
+ static bool avx_usable(void)
+ {
+ if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) {
+@@ -229,8 +227,8 @@ static inline void unregister_sha512_avx(void) { }
+ #endif
+
+ #if defined(CONFIG_AS_AVX2) && defined(CONFIG_AS_AVX)
+-asmlinkage void sha512_transform_rorx(u64 *digest, const char *data,
+- u64 rounds);
++asmlinkage void sha512_transform_rorx(struct sha512_state *digest, const u8 *data,
++ int rounds);
+
+ static int sha512_avx2_update(struct shash_desc *desc, const u8 *data,
+ unsigned int len)
diff --git a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
-index 0505813..b067311 100644
+index 0505813..912c9c1 100644
--- a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
@@ -24,6 +24,7 @@
@@ -14371,7 +15213,7 @@ index 0505813..b067311 100644
ret;
ENDPROC(__twofish_enc_blk8)
-@@ -324,6 +326,7 @@ __twofish_dec_blk8:
+@@ -324,10 +326,11 @@ __twofish_dec_blk8:
outunpack_blocks(RA1, RB1, RC1, RD1, RK1, RX0, RY0, RK2);
outunpack_blocks(RA2, RB2, RC2, RD2, RK1, RX0, RY0, RK2);
@@ -14379,7 +15221,12 @@ index 0505813..b067311 100644
ret;
ENDPROC(__twofish_dec_blk8)
-@@ -342,6 +345,7 @@ ENTRY(twofish_ecb_enc_8way)
+-ENTRY(twofish_ecb_enc_8way)
++RAP_ENTRY(twofish_ecb_enc_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -342,10 +345,11 @@ ENTRY(twofish_ecb_enc_8way)
store_8way(%r11, RC1, RD1, RA1, RB1, RC2, RD2, RA2, RB2);
@@ -14387,7 +15234,12 @@ index 0505813..b067311 100644
ret;
ENDPROC(twofish_ecb_enc_8way)
-@@ -360,6 +364,7 @@ ENTRY(twofish_ecb_dec_8way)
+-ENTRY(twofish_ecb_dec_8way)
++RAP_ENTRY(twofish_ecb_dec_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -360,33 +364,35 @@ ENTRY(twofish_ecb_dec_8way)
store_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -14395,7 +15247,11 @@ index 0505813..b067311 100644
ret;
ENDPROC(twofish_ecb_dec_8way)
-@@ -370,19 +375,20 @@ ENTRY(twofish_cbc_dec_8way)
+-ENTRY(twofish_cbc_dec_8way)
++RAP_ENTRY(twofish_cbc_dec_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
* %rdx: src
*/
@@ -14420,7 +15276,12 @@ index 0505813..b067311 100644
ret;
ENDPROC(twofish_cbc_dec_8way)
-@@ -394,20 +400,21 @@ ENTRY(twofish_ctr_8way)
+-ENTRY(twofish_ctr_8way)
++RAP_ENTRY(twofish_ctr_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -394,24 +400,25 @@ ENTRY(twofish_ctr_8way)
* %rcx: iv (little endian, 128bit)
*/
@@ -14446,7 +15307,12 @@ index 0505813..b067311 100644
ret;
ENDPROC(twofish_ctr_8way)
-@@ -430,6 +437,7 @@ ENTRY(twofish_xts_enc_8way)
+-ENTRY(twofish_xts_enc_8way)
++RAP_ENTRY(twofish_xts_enc_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
+@@ -430,10 +437,11 @@ ENTRY(twofish_xts_enc_8way)
/* dst <= regs xor IVs(in dst) */
store_xts_8way(%r11, RC1, RD1, RA1, RB1, RC2, RD2, RA2, RB2);
@@ -14454,6 +15320,11 @@ index 0505813..b067311 100644
ret;
ENDPROC(twofish_xts_enc_8way)
+-ENTRY(twofish_xts_dec_8way)
++RAP_ENTRY(twofish_xts_dec_8way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
@@ -452,5 +460,6 @@ ENTRY(twofish_xts_dec_8way)
/* dst <= regs xor IVs(in dst) */
store_xts_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -14461,8 +15332,21 @@ index 0505813..b067311 100644
+ pax_force_retaddr
ret;
ENDPROC(twofish_xts_dec_8way)
+diff --git a/arch/x86/crypto/twofish-i586-asm_32.S b/arch/x86/crypto/twofish-i586-asm_32.S
+index 694ea45..91cc5b2 100644
+--- a/arch/x86/crypto/twofish-i586-asm_32.S
++++ b/arch/x86/crypto/twofish-i586-asm_32.S
+@@ -220,7 +220,7 @@
+ xor %esi, d ## D;\
+ ror $1, d ## D;
+
+-ENTRY(twofish_enc_blk)
++RAP_ENTRY(twofish_enc_blk)
+ push %ebp /* save registers according to calling convention*/
+ push %ebx
+ push %esi
diff --git a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
-index 1c3b7ce..02f578d 100644
+index 1c3b7ce..c9912c7 100644
--- a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
+++ b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
@@ -21,6 +21,7 @@
@@ -14481,7 +15365,7 @@ index 1c3b7ce..02f578d 100644
ret;
.L__enc_xor3:
-@@ -269,6 +271,7 @@ ENTRY(__twofish_enc_blk_3way)
+@@ -269,10 +271,11 @@ ENTRY(__twofish_enc_blk_3way)
popq %r13;
popq %r14;
popq %r15;
@@ -14489,6 +15373,11 @@ index 1c3b7ce..02f578d 100644
ret;
ENDPROC(__twofish_enc_blk_3way)
+-ENTRY(twofish_dec_blk_3way)
++RAP_ENTRY(twofish_dec_blk_3way)
+ /* input:
+ * %rdi: ctx, CTX
+ * %rsi: dst
@@ -308,5 +311,6 @@ ENTRY(twofish_dec_blk_3way)
popq %r13;
popq %r14;
@@ -14497,7 +15386,7 @@ index 1c3b7ce..02f578d 100644
ret;
ENDPROC(twofish_dec_blk_3way)
diff --git a/arch/x86/crypto/twofish-x86_64-asm_64.S b/arch/x86/crypto/twofish-x86_64-asm_64.S
-index a350c99..c1bac24 100644
+index a350c99..080c5ab 100644
--- a/arch/x86/crypto/twofish-x86_64-asm_64.S
+++ b/arch/x86/crypto/twofish-x86_64-asm_64.S
@@ -22,6 +22,7 @@
@@ -14508,7 +15397,16 @@ index a350c99..c1bac24 100644
#define a_offset 0
#define b_offset 4
-@@ -265,6 +266,7 @@ ENTRY(twofish_enc_blk)
+@@ -215,7 +216,7 @@
+ xor %r8d, d ## D;\
+ ror $1, d ## D;
+
+-ENTRY(twofish_enc_blk)
++RAP_ENTRY(twofish_enc_blk)
+ pushq R1
+
+ /* %rdi contains the ctx address */
+@@ -265,10 +266,11 @@ ENTRY(twofish_enc_blk)
popq R1
movl $1,%eax
@@ -14516,6 +15414,11 @@ index a350c99..c1bac24 100644
ret
ENDPROC(twofish_enc_blk)
+-ENTRY(twofish_dec_blk)
++RAP_ENTRY(twofish_dec_blk)
+ pushq R1
+
+ /* %rdi contains the ctx address */
@@ -317,5 +319,6 @@ ENTRY(twofish_dec_blk)
popq R1
@@ -14523,11 +15426,121 @@ index a350c99..c1bac24 100644
+ pax_force_retaddr
ret
ENDPROC(twofish_dec_blk)
+diff --git a/arch/x86/crypto/twofish_avx_glue.c b/arch/x86/crypto/twofish_avx_glue.c
+index b7a3904b..3e4d0d6 100644
+--- a/arch/x86/crypto/twofish_avx_glue.c
++++ b/arch/x86/crypto/twofish_avx_glue.c
+@@ -46,24 +46,25 @@
+ #define TWOFISH_PARALLEL_BLOCKS 8
+
+ /* 8-way parallel cipher functions */
+-asmlinkage void twofish_ecb_enc_8way(struct twofish_ctx *ctx, u8 *dst,
++asmlinkage void twofish_ecb_enc_8way(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void twofish_ecb_dec_8way(struct twofish_ctx *ctx, u8 *dst,
++asmlinkage void twofish_ecb_dec_8way(void *ctx, u8 *dst,
+ const u8 *src);
+
+-asmlinkage void twofish_cbc_dec_8way(struct twofish_ctx *ctx, u8 *dst,
++asmlinkage void twofish_cbc_dec_8way(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void twofish_ctr_8way(struct twofish_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void twofish_ctr_8way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+
+-asmlinkage void twofish_xts_enc_8way(struct twofish_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
+-asmlinkage void twofish_xts_dec_8way(struct twofish_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void twofish_xts_enc_8way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
++asmlinkage void twofish_xts_dec_8way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+
+-static inline void twofish_enc_blk_3way(struct twofish_ctx *ctx, u8 *dst,
++static inline void twofish_enc_blk_3way(void *_ctx, u8 *dst,
+ const u8 *src)
+ {
++ struct twofish_ctx *ctx = _ctx;
+ __twofish_enc_blk_3way(ctx, dst, src, false);
+ }
+
+diff --git a/arch/x86/crypto/twofish_glue.c b/arch/x86/crypto/twofish_glue.c
+index 77e06c2..a45c27b 100644
+--- a/arch/x86/crypto/twofish_glue.c
++++ b/arch/x86/crypto/twofish_glue.c
+@@ -44,10 +44,10 @@
+ #include <linux/module.h>
+ #include <linux/types.h>
+
+-asmlinkage void twofish_enc_blk(struct twofish_ctx *ctx, u8 *dst,
++asmlinkage void twofish_enc_blk(void *ctx, u8 *dst,
+ const u8 *src);
+ EXPORT_SYMBOL_GPL(twofish_enc_blk);
+-asmlinkage void twofish_dec_blk(struct twofish_ctx *ctx, u8 *dst,
++asmlinkage void twofish_dec_blk(void *ctx, u8 *dst,
+ const u8 *src);
+ EXPORT_SYMBOL_GPL(twofish_dec_blk);
+
+diff --git a/arch/x86/crypto/twofish_glue_3way.c b/arch/x86/crypto/twofish_glue_3way.c
+index 56d8a08..a9f21f5 100644
+--- a/arch/x86/crypto/twofish_glue_3way.c
++++ b/arch/x86/crypto/twofish_glue_3way.c
+@@ -36,21 +36,21 @@
+ EXPORT_SYMBOL_GPL(__twofish_enc_blk_3way);
+ EXPORT_SYMBOL_GPL(twofish_dec_blk_3way);
+
+-static inline void twofish_enc_blk_3way(struct twofish_ctx *ctx, u8 *dst,
++static inline void twofish_enc_blk_3way(void *ctx, u8 *dst,
+ const u8 *src)
+ {
+ __twofish_enc_blk_3way(ctx, dst, src, false);
+ }
+
+-static inline void twofish_enc_blk_xor_3way(struct twofish_ctx *ctx, u8 *dst,
++static inline void twofish_enc_blk_xor_3way(void *ctx, u8 *dst,
+ const u8 *src)
+ {
+ __twofish_enc_blk_3way(ctx, dst, src, true);
+ }
+
+-void twofish_dec_blk_cbc_3way(void *ctx, u128 *dst, const u128 *src)
++void twofish_dec_blk_cbc_3way(void *ctx, u8 *_dst, const u8 *_src)
+ {
+- u128 ivs[2];
++ u128 ivs[2], *dst = (u128 *)_dst, *src = (u128 *)_src;
+
+ ivs[0] = src[0];
+ ivs[1] = src[1];
+@@ -118,10 +118,10 @@ static const struct common_glue_ctx twofish_ctr = {
+
+ .funcs = { {
+ .num_blocks = 3,
+- .fn_u = { .ecb = GLUE_FUNC_CAST(twofish_enc_blk_ctr_3way) }
++ .fn_u = { .ctr = GLUE_CTR_FUNC_CAST(twofish_enc_blk_ctr_3way) }
+ }, {
+ .num_blocks = 1,
+- .fn_u = { .ecb = GLUE_FUNC_CAST(twofish_enc_blk_ctr) }
++ .fn_u = { .ctr = GLUE_CTR_FUNC_CAST(twofish_enc_blk_ctr) }
+ } }
+ };
+
+diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
+index bd55ded..1310c8e 100644
+--- a/arch/x86/entry/Makefile
++++ b/arch/x86/entry/Makefile
+@@ -9,3 +9,5 @@ obj-y += vsyscall/
+
+ obj-$(CONFIG_IA32_EMULATION) += entry_64_compat.o syscall_32.o
+
++CFLAGS_REMOVE_syscall_32.o = $(RAP_PLUGIN_ABS_CFLAGS)
++CFLAGS_REMOVE_syscall_64.o = $(RAP_PLUGIN_ABS_CFLAGS)
diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h
-index 3c71dd9..008b8db 100644
+index e32206e0..809adae 100644
--- a/arch/x86/entry/calling.h
+++ b/arch/x86/entry/calling.h
-@@ -93,23 +93,26 @@ For 32-bit we have the following conventions - kernel is built with
+@@ -95,23 +95,26 @@ For 32-bit we have the following conventions - kernel is built with
.endm
.macro SAVE_C_REGS_HELPER offset=0 rax=1 rcx=1 r8910=1 r11=1
@@ -14563,7 +15576,7 @@ index 3c71dd9..008b8db 100644
.endm
.macro SAVE_C_REGS offset=0
SAVE_C_REGS_HELPER \offset, 1, 1, 1, 1
-@@ -128,67 +131,78 @@ For 32-bit we have the following conventions - kernel is built with
+@@ -130,67 +133,78 @@ For 32-bit we have the following conventions - kernel is built with
.endm
.macro SAVE_EXTRA_REGS offset=0
@@ -14670,7 +15683,7 @@ index 3c71dd9..008b8db 100644
.macro REMOVE_PT_GPREGS_FROM_STACK addskip=0
diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
-index 1a4477c..9bc8a3a 100644
+index 1a4477c..0031513 100644
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -32,9 +32,7 @@
@@ -14761,7 +15774,60 @@ index 1a4477c..9bc8a3a 100644
/*
* First do one-time work. If these work items are enabled, we
* want to run them exactly once per syscall exit with IRQs on.
-@@ -415,6 +432,7 @@ __visible long do_fast_syscall_32(struct pt_regs *regs)
+@@ -387,10 +404,52 @@ __always_inline void do_syscall_32_irqs_on(struct pt_regs *regs)
+ * the high bits are zero. Make sure we zero-extend all
+ * of the args.
+ */
++#ifdef CONFIG_PAX_RAP
++#ifdef CONFIG_X86_64
++ asm volatile("movl %[param1],%%edi\n\t"
++ "movl %[param2],%%esi\n\t"
++ "movl %[param3],%%edx\n\t"
++ "movl %[param4],%%ecx\n\t"
++ "movl %[param5],%%r8d\n\t"
++ "movl %[param6],%%r9d\n\t"
++ "call *%P[syscall]\n\t"
++ "mov %%rax,%[result]\n\t"
++ : [result] "=m" (regs->ax)
++ : [syscall] "m" (ia32_sys_call_table[nr]),
++ [param1] "m" (regs->bx),
++ [param2] "m" (regs->cx),
++ [param3] "m" (regs->dx),
++ [param4] "m" (regs->si),
++ [param5] "m" (regs->di),
++ [param6] "m" (regs->bp)
++ : "di", "si", "dx", "cx", "r8", "r9", "memory");
++#else
++#error XXX VERIFY
++ asm volatile("pushl %[param6]\n\t"
++ "pushl %[param5]\n\t"
++ "pushl %[param4]\n\t"
++ "pushl %[param3]\n\t"
++ "pushl %[param2]\n\t"
++ "pushl %[param1]\n\t"
++ "call *%P[syscall]\n\t"
++ "addl $6*8,%%esp\n\t"
++ "mov %%eax,%[result]\n\t"
++ : [result] "=m" (regs->ax)
++ : [syscall] "m" (ia32_sys_call_table[nr]),
++ [param1] "m" (regs->bx),
++ [param2] "m" (regs->cx),
++ [param3] "m" (regs->dx),
++ [param4] "m" (regs->si),
++ [param5] "m" (regs->di),
++ [param6] "m" (regs->bp)
++ : "ax", "dx", "cx", "memory");
++#endif
++#else
+ regs->ax = ia32_sys_call_table[nr](
+ (unsigned int)regs->bx, (unsigned int)regs->cx,
+ (unsigned int)regs->dx, (unsigned int)regs->si,
+ (unsigned int)regs->di, (unsigned int)regs->bp);
++#endif
+ }
+
+ syscall_return_slowpath(regs);
+@@ -415,6 +474,7 @@ __visible long do_fast_syscall_32(struct pt_regs *regs)
unsigned long landing_pad = (unsigned long)current->mm->context.vdso +
vdso_image_32.sym_int80_landing_pad;
@@ -14769,7 +15835,7 @@ index 1a4477c..9bc8a3a 100644
/*
* SYSENTER loses EIP, and even SYSCALL32 needs us to skip forward
-@@ -435,11 +453,9 @@ __visible long do_fast_syscall_32(struct pt_regs *regs)
+@@ -435,11 +495,9 @@ __visible long do_fast_syscall_32(struct pt_regs *regs)
* Micro-optimization: the pointer we're following is explicitly
* 32 bits, so it can't be out of range.
*/
@@ -14784,7 +15850,7 @@ index 1a4477c..9bc8a3a 100644
) {
diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
-index f3b6d54..d41929e 100644
+index bb3e376..567eb30 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -147,13 +147,157 @@
@@ -15015,7 +16081,7 @@ index f3b6d54..d41929e 100644
#endif
# SYSENTER call handler stub
-@@ -300,6 +461,10 @@ sysenter_past_esp:
+@@ -301,6 +462,10 @@ sysenter_past_esp:
pushl %eax /* pt_regs->orig_ax */
SAVE_ALL pt_regs_ax=$-ENOSYS /* save rest */
@@ -15026,7 +16092,7 @@ index f3b6d54..d41929e 100644
/*
* User mode is traced as though IRQs are on, and SYSENTER
* turned them off.
-@@ -312,11 +477,20 @@ sysenter_past_esp:
+@@ -313,11 +478,20 @@ sysenter_past_esp:
ALTERNATIVE "testl %eax, %eax; jz .Lsyscall_32_done", \
"jmp .Lsyscall_32_done", X86_FEATURE_XENPV
@@ -15047,8 +16113,8 @@ index f3b6d54..d41929e 100644
PTGS_TO_GS
popl %ebx /* pt_regs->bx */
addl $2*4, %esp /* skip pt_regs->cx and pt_regs->dx */
-@@ -332,10 +506,16 @@ sysenter_past_esp:
- ENABLE_INTERRUPTS_SYSEXIT
+@@ -334,10 +508,16 @@ sysenter_past_esp:
+ sysexit
.pushsection .fixup, "ax"
-2: movl $0, PT_FS(%esp)
@@ -15066,7 +16132,7 @@ index f3b6d54..d41929e 100644
PTGS_TO_GS_EX
ENDPROC(entry_SYSENTER_32)
-@@ -345,6 +525,10 @@ ENTRY(entry_INT80_32)
+@@ -347,6 +527,10 @@ ENTRY(entry_INT80_32)
pushl %eax /* pt_regs->orig_ax */
SAVE_ALL pt_regs_ax=$-ENOSYS /* save rest */
@@ -15077,7 +16143,7 @@ index f3b6d54..d41929e 100644
/*
* User mode is traced as though IRQs are on. Unlike the 64-bit
* case, INT80 is a trap gate on 32-bit kernels, so interrupts
-@@ -355,6 +539,13 @@ ENTRY(entry_INT80_32)
+@@ -357,6 +541,13 @@ ENTRY(entry_INT80_32)
call do_syscall_32_irqs_on
.Lsyscall_32_done:
@@ -15091,7 +16157,7 @@ index f3b6d54..d41929e 100644
restore_all:
TRACE_IRQS_IRET
restore_all_notrace:
-@@ -409,14 +600,34 @@ ldt_ss:
+@@ -411,14 +602,34 @@ ldt_ss:
* compensating for the offset by changing to the ESPFIX segment with
* a base address that matches for the difference.
*/
@@ -15129,7 +16195,7 @@ index f3b6d54..d41929e 100644
pushl $__ESPFIX_SS
pushl %eax /* new kernel esp */
/*
-@@ -440,8 +651,15 @@ ENDPROC(entry_INT80_32)
+@@ -442,8 +653,15 @@ ENDPROC(entry_INT80_32)
*/
#ifdef CONFIG_X86_ESPFIX32
/* fixup the stack */
@@ -15147,7 +16213,7 @@ index f3b6d54..d41929e 100644
shl $16, %eax
addl %esp, %eax /* the adjusted stack pointer */
pushl $__KERNEL_DS
-@@ -477,7 +695,7 @@ ENTRY(irq_entries_start)
+@@ -479,7 +697,7 @@ ENTRY(irq_entries_start)
jmp common_interrupt
.align 8
.endr
@@ -15156,7 +16222,7 @@ index f3b6d54..d41929e 100644
/*
* the CPU automatically disables interrupts when executing an IRQ vector,
-@@ -524,7 +742,7 @@ ENTRY(coprocessor_error)
+@@ -526,7 +744,7 @@ ENTRY(coprocessor_error)
pushl $0
pushl $do_coprocessor_error
jmp error_code
@@ -15165,7 +16231,7 @@ index f3b6d54..d41929e 100644
ENTRY(simd_coprocessor_error)
ASM_CLAC
-@@ -538,25 +756,25 @@ ENTRY(simd_coprocessor_error)
+@@ -540,7 +758,7 @@ ENTRY(simd_coprocessor_error)
pushl $do_simd_coprocessor_error
#endif
jmp error_code
@@ -15174,28 +16240,16 @@ index f3b6d54..d41929e 100644
ENTRY(device_not_available)
ASM_CLAC
- pushl $-1 # mark this as an int
- pushl $do_device_not_available
- jmp error_code
--END(device_not_available)
-+ENDPROC(device_not_available)
-
- #ifdef CONFIG_PARAVIRT
+@@ -553,7 +771,7 @@ END(device_not_available)
ENTRY(native_iret)
iret
_ASM_EXTABLE(native_iret, iret_exc)
-END(native_iret)
+ENDPROC(native_iret)
-
- ENTRY(native_irq_enable_sysexit)
- sti
- sysexit
--END(native_irq_enable_sysexit)
-+ENDPROC(native_irq_enable_sysexit)
#endif
ENTRY(overflow)
-@@ -564,59 +782,59 @@ ENTRY(overflow)
+@@ -561,59 +779,59 @@ ENTRY(overflow)
pushl $0
pushl $do_overflow
jmp error_code
@@ -15264,7 +16318,7 @@ index f3b6d54..d41929e 100644
#ifdef CONFIG_X86_MCE
ENTRY(machine_check)
-@@ -624,7 +842,7 @@ ENTRY(machine_check)
+@@ -621,7 +839,7 @@ ENTRY(machine_check)
pushl $0
pushl machine_check_vector
jmp error_code
@@ -15273,7 +16327,7 @@ index f3b6d54..d41929e 100644
#endif
ENTRY(spurious_interrupt_bug)
-@@ -632,7 +850,7 @@ ENTRY(spurious_interrupt_bug)
+@@ -629,7 +847,7 @@ ENTRY(spurious_interrupt_bug)
pushl $0
pushl $do_spurious_interrupt_bug
jmp error_code
@@ -15282,7 +16336,7 @@ index f3b6d54..d41929e 100644
#ifdef CONFIG_XEN
/*
-@@ -739,7 +957,7 @@ BUILD_INTERRUPT3(hyperv_callback_vector, HYPERVISOR_CALLBACK_VECTOR,
+@@ -736,7 +954,7 @@ BUILD_INTERRUPT3(hyperv_callback_vector, HYPERVISOR_CALLBACK_VECTOR,
ENTRY(mcount)
ret
@@ -15291,7 +16345,7 @@ index f3b6d54..d41929e 100644
ENTRY(ftrace_caller)
pushl %eax
-@@ -769,7 +987,7 @@ ftrace_graph_call:
+@@ -766,7 +984,7 @@ ftrace_graph_call:
.globl ftrace_stub
ftrace_stub:
ret
@@ -15300,7 +16354,7 @@ index f3b6d54..d41929e 100644
ENTRY(ftrace_regs_caller)
pushf /* push flags before compare (in cs location) */
-@@ -867,7 +1085,7 @@ trace:
+@@ -864,7 +1082,7 @@ trace:
popl %ecx
popl %eax
jmp ftrace_stub
@@ -15309,7 +16363,7 @@ index f3b6d54..d41929e 100644
#endif /* CONFIG_DYNAMIC_FTRACE */
#endif /* CONFIG_FUNCTION_TRACER */
-@@ -885,7 +1103,7 @@ ENTRY(ftrace_graph_caller)
+@@ -882,7 +1100,7 @@ ENTRY(ftrace_graph_caller)
popl %ecx
popl %eax
ret
@@ -15318,7 +16372,7 @@ index f3b6d54..d41929e 100644
.globl return_to_handler
return_to_handler:
-@@ -904,7 +1122,7 @@ ENTRY(trace_page_fault)
+@@ -901,7 +1119,7 @@ ENTRY(trace_page_fault)
ASM_CLAC
pushl $trace_do_page_fault
jmp error_code
@@ -15327,7 +16381,7 @@ index f3b6d54..d41929e 100644
#endif
ENTRY(page_fault)
-@@ -933,14 +1151,17 @@ error_code:
+@@ -930,14 +1148,17 @@ error_code:
movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart
REG_TO_PTGS %ecx
SET_KERNEL_GS %ecx
@@ -15347,16 +16401,25 @@ index f3b6d54..d41929e 100644
/*
* Debug traps and NMI can happen at the one SYSENTER instruction
-@@ -978,7 +1199,7 @@ debug_stack_correct:
+@@ -962,7 +1183,7 @@ END(page_fault)
+ pushl $sysenter_past_esp
+ .endm
+
+-ENTRY(debug)
++ENTRY(int1)
+ ASM_CLAC
+ cmpl $entry_SYSENTER_32, (%esp)
+ jne debug_stack_correct
+@@ -975,7 +1196,7 @@ debug_stack_correct:
movl %esp, %eax # pt_regs pointer
call do_debug
jmp ret_from_exception
-END(debug)
-+ENDPROC(debug)
++ENDPROC(int1)
/*
* NMI is doubly nasty. It can happen _while_ we're handling
-@@ -1017,6 +1238,9 @@ nmi_stack_correct:
+@@ -1014,6 +1235,9 @@ nmi_stack_correct:
xorl %edx, %edx # zero error code
movl %esp, %eax # pt_regs pointer
call do_nmi
@@ -15366,7 +16429,16 @@ index f3b6d54..d41929e 100644
jmp restore_all_notrace
nmi_stack_fixup:
-@@ -1050,11 +1274,14 @@ nmi_espfix_stack:
+@@ -1023,7 +1247,7 @@ nmi_stack_fixup:
+ nmi_debug_stack_check:
+ cmpw $__KERNEL_CS, 16(%esp)
+ jne nmi_stack_correct
+- cmpl $debug, (%esp)
++ cmpl $int1, (%esp)
+ jb nmi_stack_correct
+ cmpl $debug_esp_fix_insn, (%esp)
+ ja nmi_stack_correct
+@@ -1047,11 +1271,14 @@ nmi_espfix_stack:
FIXUP_ESPFIX_STACK # %eax == %esp
xorl %edx, %edx # zero error code
call do_nmi
@@ -15382,7 +16454,7 @@ index f3b6d54..d41929e 100644
ENTRY(int3)
ASM_CLAC
-@@ -1065,17 +1292,17 @@ ENTRY(int3)
+@@ -1062,17 +1289,17 @@ ENTRY(int3)
movl %esp, %eax # pt_regs pointer
call do_int3
jmp ret_from_exception
@@ -15404,7 +16476,7 @@ index f3b6d54..d41929e 100644
+ENDPROC(async_page_fault)
#endif
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
-index a55697d..66473ae 100644
+index 9d34d3c..2398c40 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -36,6 +36,8 @@
@@ -16012,9 +17084,9 @@ index a55697d..66473ae 100644
/*
* We need to tell lockdep that IRQs are off. We can't do this until
* we fix gsbase, and we should do it before enter_from_user_mode
-@@ -524,7 +951,9 @@ END(irq_entries_start)
- call enter_from_user_mode
- #endif
+@@ -522,7 +949,9 @@ END(irq_entries_start)
+
+ CALL_enter_from_user_mode
-1:
+ jmp 2f
@@ -16023,7 +17095,7 @@ index a55697d..66473ae 100644
/*
* Save previous stack pointer, optionally switch to interrupt stack.
* irq_count is used to check if a CPU is already on an interrupt stack
-@@ -536,6 +965,7 @@ END(irq_entries_start)
+@@ -534,6 +963,7 @@ END(irq_entries_start)
incl PER_CPU_VAR(irq_count)
cmovzq PER_CPU_VAR(irq_stack_ptr), %rsp
pushq %rdi
@@ -16031,7 +17103,7 @@ index a55697d..66473ae 100644
/* We entered an interrupt context - irqs are off: */
TRACE_IRQS_OFF
-@@ -567,6 +997,8 @@ ret_from_intr:
+@@ -565,6 +995,8 @@ ret_from_intr:
GLOBAL(retint_user)
mov %rsp,%rdi
call prepare_exit_to_usermode
@@ -16040,7 +17112,7 @@ index a55697d..66473ae 100644
TRACE_IRQS_IRETQ
SWAPGS
jmp restore_regs_and_iret
-@@ -584,6 +1016,21 @@ retint_kernel:
+@@ -582,6 +1014,21 @@ retint_kernel:
jmp 0b
1:
#endif
@@ -16062,7 +17134,7 @@ index a55697d..66473ae 100644
/*
* The iretq could re-enable interrupts:
*/
-@@ -627,15 +1074,15 @@ native_irq_return_ldt:
+@@ -625,15 +1072,15 @@ native_irq_return_ldt:
SWAPGS
movq PER_CPU_VAR(espfix_waddr), %rdi
movq %rax, (0*8)(%rdi) /* RAX */
@@ -16083,7 +17155,7 @@ index a55697d..66473ae 100644
movq %rax, (4*8)(%rdi)
andl $0xffff0000, %eax
popq %rdi
-@@ -645,7 +1092,7 @@ native_irq_return_ldt:
+@@ -643,7 +1090,7 @@ native_irq_return_ldt:
popq %rax
jmp native_irq_return_iret
#endif
@@ -16092,7 +17164,7 @@ index a55697d..66473ae 100644
/*
* APIC interrupts.
-@@ -657,7 +1104,7 @@ ENTRY(\sym)
+@@ -655,7 +1102,7 @@ ENTRY(\sym)
.Lcommon_\sym:
interrupt \do_sym
jmp ret_from_intr
@@ -16101,7 +17173,7 @@ index a55697d..66473ae 100644
.endm
#ifdef CONFIG_TRACING
-@@ -722,7 +1169,7 @@ apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt
+@@ -720,7 +1167,7 @@ apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt
/*
* Exception entry points.
*/
@@ -16110,7 +17182,7 @@ index a55697d..66473ae 100644
.macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1
ENTRY(\sym)
-@@ -769,6 +1216,12 @@ ENTRY(\sym)
+@@ -767,6 +1214,12 @@ ENTRY(\sym)
.endif
.if \shift_ist != -1
@@ -16123,7 +17195,7 @@ index a55697d..66473ae 100644
subq $EXCEPTION_STKSZ, CPU_TSS_IST(\shift_ist)
.endif
-@@ -812,7 +1265,7 @@ ENTRY(\sym)
+@@ -810,7 +1263,7 @@ ENTRY(\sym)
jmp error_exit /* %ebx: no swapgs flag */
.endif
@@ -16132,7 +17204,7 @@ index a55697d..66473ae 100644
.endm
#ifdef CONFIG_TRACING
-@@ -854,8 +1307,9 @@ gs_change:
+@@ -852,8 +1305,9 @@ gs_change:
2: mfence /* workaround */
SWAPGS
popfq
@@ -16143,7 +17215,7 @@ index a55697d..66473ae 100644
_ASM_EXTABLE(gs_change, bad_gs)
.section .fixup, "ax"
-@@ -877,8 +1331,9 @@ ENTRY(do_softirq_own_stack)
+@@ -875,8 +1329,9 @@ ENTRY(do_softirq_own_stack)
call __do_softirq
leaveq
decl PER_CPU_VAR(irq_count)
@@ -16154,7 +17226,7 @@ index a55697d..66473ae 100644
#ifdef CONFIG_XEN
idtentry xen_hypervisor_callback xen_do_hypervisor_callback has_error_code=0
-@@ -914,7 +1369,7 @@ ENTRY(xen_do_hypervisor_callback) /* do_hypervisor_callback(struct *pt_regs) */
+@@ -912,7 +1367,7 @@ ENTRY(xen_do_hypervisor_callback) /* do_hypervisor_callback(struct *pt_regs) */
call xen_maybe_preempt_hcall
#endif
jmp error_exit
@@ -16163,7 +17235,7 @@ index a55697d..66473ae 100644
/*
* Hypervisor uses this for application faults while it executes.
-@@ -959,7 +1414,7 @@ ENTRY(xen_failsafe_callback)
+@@ -957,7 +1412,7 @@ ENTRY(xen_failsafe_callback)
SAVE_C_REGS
SAVE_EXTRA_REGS
jmp error_exit
@@ -16172,7 +17244,16 @@ index a55697d..66473ae 100644
apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \
xen_hvm_callback_vector xen_evtchn_do_upcall
-@@ -1008,8 +1463,34 @@ ENTRY(paranoid_entry)
+@@ -969,7 +1424,7 @@ apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \
+ hyperv_callback_vector hyperv_vector_handler
+ #endif /* CONFIG_HYPERV */
+
+-idtentry debug do_debug has_error_code=0 paranoid=1 shift_ist=DEBUG_STACK
++idtentry int1 do_debug has_error_code=0 paranoid=1 shift_ist=DEBUG_STACK
+ idtentry int3 do_int3 has_error_code=0 paranoid=1 shift_ist=DEBUG_STACK
+ idtentry stack_segment do_stack_segment has_error_code=1
+
+@@ -1006,8 +1461,34 @@ ENTRY(paranoid_entry)
js 1f /* negative -> in kernel */
SWAPGS
xorl %ebx, %ebx
@@ -16209,7 +17290,7 @@ index a55697d..66473ae 100644
/*
* "Paranoid" exit path from exception stack. This is invoked
-@@ -1026,19 +1507,26 @@ END(paranoid_entry)
+@@ -1024,19 +1505,26 @@ END(paranoid_entry)
ENTRY(paranoid_exit)
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF_DEBUG
@@ -16238,7 +17319,7 @@ index a55697d..66473ae 100644
/*
* Save all registers in pt_regs, and switch gs if needed.
-@@ -1052,13 +1540,18 @@ ENTRY(error_entry)
+@@ -1050,13 +1538,18 @@ ENTRY(error_entry)
testb $3, CS+8(%rsp)
jz .Lerror_kernelspace
@@ -16258,10 +17339,10 @@ index a55697d..66473ae 100644
.Lerror_entry_from_usermode_after_swapgs:
/*
* We need to tell lockdep that IRQs are off. We can't do this until
-@@ -1069,10 +1562,12 @@ ENTRY(error_entry)
- #ifdef CONFIG_CONTEXT_TRACKING
- call enter_from_user_mode
- #endif
+@@ -1065,10 +1558,12 @@ ENTRY(error_entry)
+ */
+ TRACE_IRQS_OFF
+ CALL_enter_from_user_mode
+ pax_force_retaddr
ret
@@ -16271,7 +17352,7 @@ index a55697d..66473ae 100644
ret
/*
-@@ -1090,14 +1585,16 @@ ENTRY(error_entry)
+@@ -1086,14 +1581,16 @@ ENTRY(error_entry)
cmpq %rax, RIP+8(%rsp)
je .Lbstep_iret
cmpq $gs_change, RIP+8(%rsp)
@@ -16290,7 +17371,7 @@ index a55697d..66473ae 100644
.Lbstep_iret:
/* Fix truncated RIP */
-@@ -1111,6 +1608,12 @@ ENTRY(error_entry)
+@@ -1107,6 +1604,12 @@ ENTRY(error_entry)
*/
SWAPGS
@@ -16303,7 +17384,7 @@ index a55697d..66473ae 100644
/*
* Pretend that the exception came from user mode: set up pt_regs
* as if we faulted immediately after IRET and clear EBX so that
-@@ -1121,11 +1624,11 @@ ENTRY(error_entry)
+@@ -1117,11 +1620,11 @@ ENTRY(error_entry)
mov %rax, %rsp
decl %ebx
jmp .Lerror_entry_from_usermode_after_swapgs
@@ -16317,7 +17398,7 @@ index a55697d..66473ae 100644
* 1: already in kernel mode, don't need SWAPGS
* 0: user gsbase is loaded, we need SWAPGS and standard preparation for return to usermode
*/
-@@ -1133,10 +1636,10 @@ ENTRY(error_exit)
+@@ -1129,10 +1632,10 @@ ENTRY(error_exit)
movl %ebx, %eax
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF
@@ -16330,7 +17411,7 @@ index a55697d..66473ae 100644
/* Runs on exception stack */
ENTRY(nmi)
-@@ -1190,6 +1693,8 @@ ENTRY(nmi)
+@@ -1186,6 +1689,8 @@ ENTRY(nmi)
* other IST entries.
*/
@@ -16339,7 +17420,7 @@ index a55697d..66473ae 100644
/* Use %rdx as our temp variable throughout */
pushq %rdx
-@@ -1233,6 +1738,12 @@ ENTRY(nmi)
+@@ -1229,6 +1734,12 @@ ENTRY(nmi)
pushq %r14 /* pt_regs->r14 */
pushq %r15 /* pt_regs->r15 */
@@ -16352,7 +17433,7 @@ index a55697d..66473ae 100644
/*
* At this point we no longer need to worry about stack damage
* due to nesting -- we're on the normal thread stack and we're
-@@ -1243,12 +1754,19 @@ ENTRY(nmi)
+@@ -1239,12 +1750,19 @@ ENTRY(nmi)
movq $-1, %rsi
call do_nmi
@@ -16372,7 +17453,7 @@ index a55697d..66473ae 100644
jmp restore_c_regs_and_iret
.Lnmi_from_kernel:
-@@ -1370,6 +1888,7 @@ nested_nmi_out:
+@@ -1366,6 +1884,7 @@ nested_nmi_out:
popq %rdx
/* We are returning to kernel mode, so this cannot result in a fault. */
@@ -16380,7 +17461,7 @@ index a55697d..66473ae 100644
INTERRUPT_RETURN
first_nmi:
-@@ -1398,7 +1917,7 @@ first_nmi:
+@@ -1394,7 +1913,7 @@ first_nmi:
pushq %rsp /* RSP (minus 8 because of the previous push) */
addq $8, (%rsp) /* Fix up RSP */
pushfq /* RFLAGS */
@@ -16389,7 +17470,7 @@ index a55697d..66473ae 100644
pushq $1f /* RIP */
INTERRUPT_RETURN /* continues at repeat_nmi below */
1:
-@@ -1443,20 +1962,22 @@ end_repeat_nmi:
+@@ -1439,20 +1958,22 @@ end_repeat_nmi:
ALLOC_PT_GPREGS_ON_STACK
/*
@@ -16415,7 +17496,7 @@ index a55697d..66473ae 100644
jnz nmi_restore
nmi_swapgs:
SWAPGS_UNSAFE_STACK
-@@ -1467,6 +1988,8 @@ nmi_restore:
+@@ -1463,6 +1984,8 @@ nmi_restore:
/* Point RSP at the "iret" frame. */
REMOVE_PT_GPREGS_FROM_STACK 6*8
@@ -16424,7 +17505,7 @@ index a55697d..66473ae 100644
/*
* Clear "NMI executing". Set DF first so that we can easily
* distinguish the remaining code between here and IRET from
-@@ -1484,9 +2007,9 @@ nmi_restore:
+@@ -1480,9 +2003,9 @@ nmi_restore:
* mode, so this cannot result in a fault.
*/
INTERRUPT_RETURN
@@ -16437,10 +17518,10 @@ index a55697d..66473ae 100644
-END(ignore_sysret)
+ENDPROC(ignore_sysret)
diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
-index 15cfeba..da22a57 100644
+index 3c990ee..d49c8f4 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
-@@ -13,8 +13,10 @@
+@@ -13,11 +13,39 @@
#include <asm/irqflags.h>
#include <asm/asm.h>
#include <asm/smap.h>
@@ -16451,10 +17532,6 @@ index 15cfeba..da22a57 100644
.section .entry.text, "ax"
-@@ -25,6 +27,32 @@ ENTRY(native_usergs_sysret32)
- ENDPROC(native_usergs_sysret32)
- #endif
-
+ .macro pax_enter_kernel_user
+ pax_set_fptr_mask
+#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -16484,7 +17561,7 @@ index 15cfeba..da22a57 100644
/*
* 32-bit SYSENTER instruction entry.
*
-@@ -76,26 +104,36 @@ ENTRY(entry_SYSENTER_compat)
+@@ -69,26 +97,36 @@ ENTRY(entry_SYSENTER_compat)
ASM_CLAC /* Clear AC after saving FLAGS */
pushq $__USER32_CS /* pt_regs->cs */
@@ -16531,7 +17608,7 @@ index 15cfeba..da22a57 100644
/*
* Sysenter doesn't filter flags, so we need to clear NT
* ourselves. To save a few cycles, we can check whether
-@@ -181,17 +219,27 @@ ENTRY(entry_SYSCALL_compat)
+@@ -174,17 +212,27 @@ ENTRY(entry_SYSCALL_compat)
pushq %rdx /* pt_regs->dx */
pushq %rbp /* pt_regs->cx (stashed in bp) */
pushq $-ENOSYS /* pt_regs->ax */
@@ -16568,7 +17645,7 @@ index 15cfeba..da22a57 100644
/*
* User mode is traced as though IRQs are on, and SYSENTER
-@@ -207,11 +255,18 @@ ENTRY(entry_SYSCALL_compat)
+@@ -200,11 +248,18 @@ ENTRY(entry_SYSCALL_compat)
/* Opportunistic SYSRET */
sysret32_from_system_call:
@@ -16587,16 +17664,16 @@ index 15cfeba..da22a57 100644
addq $RAX, %rsp /* Skip r8-r15 */
popq %rax /* pt_regs->rax */
popq %rdx /* Skip pt_regs->cx */
-@@ -239,7 +294,7 @@ sysret32_from_system_call:
- xorq %r10, %r10
+@@ -233,7 +288,7 @@ sysret32_from_system_call:
movq RSP-ORIG_RAX(%rsp), %rsp
- USERGS_SYSRET32
+ swapgs
+ sysretl
-END(entry_SYSCALL_compat)
+ENDPROC(entry_SYSCALL_compat)
/*
* Emulated IA32 system calls via int 0x80.
-@@ -286,11 +341,11 @@ ENTRY(entry_INT80_compat)
+@@ -280,11 +335,11 @@ ENTRY(entry_INT80_compat)
pushq %rdx /* pt_regs->dx */
pushq %rcx /* pt_regs->cx */
pushq $-ENOSYS /* pt_regs->ax */
@@ -16613,7 +17690,7 @@ index 15cfeba..da22a57 100644
pushq %rbx /* pt_regs->rbx */
pushq %rbp /* pt_regs->rbp */
pushq %r12 /* pt_regs->r12 */
-@@ -299,6 +354,12 @@ ENTRY(entry_INT80_compat)
+@@ -293,6 +348,12 @@ ENTRY(entry_INT80_compat)
pushq %r15 /* pt_regs->r15 */
cld
@@ -16626,7 +17703,7 @@ index 15cfeba..da22a57 100644
/*
* User mode is traced as though IRQs are on, and the interrupt
* gate turned them off.
-@@ -310,10 +371,12 @@ ENTRY(entry_INT80_compat)
+@@ -304,10 +365,12 @@ ENTRY(entry_INT80_compat)
.Lsyscall_32_done:
/* Go back to user mode. */
@@ -16661,10 +17738,10 @@ index efb2b93..8a9cb8e 100644
_ASM_NOKPROBE(restore)
#endif
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
-index 265c0ed..a706eb9 100644
+index c854541..1786538 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
-@@ -69,7 +69,7 @@ CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \
+@@ -70,7 +70,7 @@ CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \
-fno-omit-frame-pointer -foptimize-sibling-calls \
-DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
@@ -16673,7 +17750,7 @@ index 265c0ed..a706eb9 100644
#
# vDSO code runs in userspace and -pg doesn't help with profiling anyway.
-@@ -139,6 +139,7 @@ KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS))
+@@ -140,6 +140,7 @@ KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS))
KBUILD_CFLAGS_32 := $(filter-out -mcmodel=kernel,$(KBUILD_CFLAGS_32))
KBUILD_CFLAGS_32 := $(filter-out -fno-pic,$(KBUILD_CFLAGS_32))
KBUILD_CFLAGS_32 := $(filter-out -mfentry,$(KBUILD_CFLAGS_32))
@@ -16681,7 +17758,7 @@ index 265c0ed..a706eb9 100644
KBUILD_CFLAGS_32 += -m32 -msoft-float -mregparm=0 -fpic
KBUILD_CFLAGS_32 += $(call cc-option, -fno-stack-protector)
KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls)
-@@ -162,7 +163,7 @@ quiet_cmd_vdso = VDSO $@
+@@ -163,7 +164,7 @@ quiet_cmd_vdso = VDSO $@
-Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
@@ -16690,6 +17767,17 @@ index 265c0ed..a706eb9 100644
$(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic $(LTO_CFLAGS)
GCOV_PROFILE := n
+diff --git a/arch/x86/entry/vdso/vclock_gettime.c b/arch/x86/entry/vdso/vclock_gettime.c
+index 1a50e09..3e25e7a 100644
+--- a/arch/x86/entry/vdso/vclock_gettime.c
++++ b/arch/x86/entry/vdso/vclock_gettime.c
+@@ -330,5 +330,5 @@ notrace time_t __vdso_time(time_t *t)
+ *t = result;
+ return result;
+ }
+-int time(time_t *t)
++time_t time(time_t *t)
+ __attribute__((weak, alias("__vdso_time")));
diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86/entry/vdso/vdso2c.h
index 0224987..0359810 100644
--- a/arch/x86/entry/vdso/vdso2c.h
@@ -16731,10 +17819,10 @@ index 0224987..0359810 100644
fprintf(outfile, "const struct vdso_image %s = {\n", name);
diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
-index 64df471..8346804 100644
+index b8f69e2..2489643 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
-@@ -19,10 +19,7 @@
+@@ -20,10 +20,7 @@
#include <asm/page.h>
#include <asm/hpet.h>
#include <asm/desc.h>
@@ -16746,9 +17834,9 @@ index 64df471..8346804 100644
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,
+@@ -103,6 +100,11 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
};
+ struct pvclock_vsyscall_time_info *pvti;
+#ifdef CONFIG_PAX_RANDMMAP
+ if (mm->pax_flags & MF_PAX_RANDMMAP)
@@ -16758,7 +17846,7 @@ index 64df471..8346804 100644
if (calculate_addr) {
addr = vdso_addr(current->mm->start_stack,
image->size - image->sym_vvar_start);
-@@ -111,14 +113,14 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
+@@ -113,14 +115,14 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
down_write(&mm->mmap_sem);
addr = get_unmapped_area(NULL, addr,
@@ -16775,15 +17863,14 @@ index 64df471..8346804 100644
/*
* MAYWRITE to allow gdb to COW and set breakpoints
-@@ -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));
+@@ -178,14 +180,11 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
+ __pa(pvti) >> PAGE_SHIFT,
+ PAGE_SIZE,
+ PAGE_READONLY);
-
- if (ret)
- goto up_fail;
}
- #endif
up_fail:
if (ret)
@@ -16792,7 +17879,7 @@ index 64df471..8346804 100644
up_write(&mm->mmap_sem);
return ret;
-@@ -190,9 +189,6 @@ static int load_vdso32(void)
+@@ -204,9 +203,6 @@ static int load_vdso32(void)
#ifdef CONFIG_X86_64
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
{
@@ -16802,7 +17889,7 @@ index 64df471..8346804 100644
return map_vdso(&vdso_image_64, true);
}
-@@ -201,12 +197,8 @@ int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
+@@ -215,12 +211,8 @@ int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
int uses_interp)
{
#ifdef CONFIG_X86_X32_ABI
@@ -16816,7 +17903,7 @@ index 64df471..8346804 100644
#endif
#ifdef CONFIG_IA32_EMULATION
return load_vdso32();
-@@ -223,15 +215,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
+@@ -237,15 +229,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
#endif
#ifdef CONFIG_X86_64
@@ -17179,10 +18266,10 @@ index 7bfc85b..65d1ec4 100644
ALTINSTR_REPLACEMENT(newinstr2, feature2, 2) \
".popsection"
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
-index 163769d..d41133e 100644
+index e8c4fba..8d42c8c 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
-@@ -45,7 +45,7 @@ static inline void generic_apic_probe(void)
+@@ -50,7 +50,7 @@ static inline void generic_apic_probe(void)
#ifdef CONFIG_X86_LOCAL_APIC
@@ -17214,10 +18301,10 @@ 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 ae5fb83..f6a093d 100644
+index 3e86742..1b19554 100644
--- a/arch/x86/include/asm/atomic.h
+++ b/arch/x86/include/asm/atomic.h
-@@ -28,6 +28,17 @@ static __always_inline int atomic_read(const atomic_t *v)
+@@ -27,6 +27,17 @@ static __always_inline int atomic_read(const atomic_t *v)
}
/**
@@ -17235,7 +18322,7 @@ index ae5fb83..f6a093d 100644
* atomic_set - set atomic variable
* @v: pointer of type atomic_t
* @i: required value
-@@ -40,6 +51,18 @@ static __always_inline void atomic_set(atomic_t *v, int i)
+@@ -39,6 +50,18 @@ static __always_inline void atomic_set(atomic_t *v, int i)
}
/**
@@ -17254,7 +18341,7 @@ index ae5fb83..f6a093d 100644
* atomic_add - add integer to atomic variable
* @i: integer value to add
* @v: pointer of type atomic_t
-@@ -48,7 +71,29 @@ static __always_inline void atomic_set(atomic_t *v, int i)
+@@ -47,7 +70,29 @@ static __always_inline void atomic_set(atomic_t *v, int i)
*/
static __always_inline void atomic_add(int i, atomic_t *v)
{
@@ -17285,7 +18372,7 @@ index ae5fb83..f6a093d 100644
: "+m" (v->counter)
: "ir" (i));
}
-@@ -62,7 +107,29 @@ static __always_inline void atomic_add(int i, atomic_t *v)
+@@ -61,7 +106,29 @@ static __always_inline void atomic_add(int i, atomic_t *v)
*/
static __always_inline void atomic_sub(int i, atomic_t *v)
{
@@ -17316,7 +18403,7 @@ index ae5fb83..f6a093d 100644
: "+m" (v->counter)
: "ir" (i));
}
-@@ -78,7 +145,7 @@ static __always_inline void atomic_sub(int i, atomic_t *v)
+@@ -77,7 +144,7 @@ static __always_inline void atomic_sub(int i, atomic_t *v)
*/
static __always_inline int atomic_sub_and_test(int i, atomic_t *v)
{
@@ -17325,7 +18412,7 @@ index ae5fb83..f6a093d 100644
}
/**
-@@ -89,7 +156,27 @@ static __always_inline int atomic_sub_and_test(int i, atomic_t *v)
+@@ -88,7 +155,27 @@ static __always_inline int atomic_sub_and_test(int i, atomic_t *v)
*/
static __always_inline void atomic_inc(atomic_t *v)
{
@@ -17354,7 +18441,7 @@ index ae5fb83..f6a093d 100644
: "+m" (v->counter));
}
-@@ -101,7 +188,27 @@ static __always_inline void atomic_inc(atomic_t *v)
+@@ -100,7 +187,27 @@ static __always_inline void atomic_inc(atomic_t *v)
*/
static __always_inline void atomic_dec(atomic_t *v)
{
@@ -17383,7 +18470,7 @@ index ae5fb83..f6a093d 100644
: "+m" (v->counter));
}
-@@ -115,7 +222,7 @@ static __always_inline void atomic_dec(atomic_t *v)
+@@ -114,7 +221,7 @@ static __always_inline void atomic_dec(atomic_t *v)
*/
static __always_inline int atomic_dec_and_test(atomic_t *v)
{
@@ -17392,7 +18479,7 @@ index ae5fb83..f6a093d 100644
}
/**
-@@ -128,7 +235,20 @@ static __always_inline int atomic_dec_and_test(atomic_t *v)
+@@ -127,7 +234,20 @@ static __always_inline int atomic_dec_and_test(atomic_t *v)
*/
static __always_inline int atomic_inc_and_test(atomic_t *v)
{
@@ -17414,7 +18501,7 @@ index ae5fb83..f6a093d 100644
}
/**
-@@ -142,7 +262,7 @@ static __always_inline int atomic_inc_and_test(atomic_t *v)
+@@ -141,7 +261,7 @@ static __always_inline int atomic_inc_and_test(atomic_t *v)
*/
static __always_inline int atomic_add_negative(int i, atomic_t *v)
{
@@ -17423,7 +18510,7 @@ index ae5fb83..f6a093d 100644
}
/**
-@@ -152,7 +272,19 @@ static __always_inline int atomic_add_negative(int i, atomic_t *v)
+@@ -151,7 +271,19 @@ static __always_inline int atomic_add_negative(int i, atomic_t *v)
*
* Atomically adds @i to @v and returns @i + @v
*/
@@ -17444,7 +18531,7 @@ index ae5fb83..f6a093d 100644
{
return i + xadd(&v->counter, i);
}
-@@ -164,15 +296,24 @@ static __always_inline int atomic_add_return(int i, atomic_t *v)
+@@ -163,15 +295,24 @@ static __always_inline int atomic_add_return(int i, atomic_t *v)
*
* Atomically subtracts @i from @v and returns @v - @i
*/
@@ -17471,7 +18558,7 @@ index ae5fb83..f6a093d 100644
{
return cmpxchg(&v->counter, old, new);
}
-@@ -182,6 +323,11 @@ static inline int atomic_xchg(atomic_t *v, int new)
+@@ -181,6 +322,11 @@ static inline int atomic_xchg(atomic_t *v, int new)
return xchg(&v->counter, new);
}
@@ -17483,7 +18570,7 @@ index ae5fb83..f6a093d 100644
#define ATOMIC_OP(op) \
static inline void atomic_##op(int i, atomic_t *v) \
{ \
-@@ -208,12 +354,25 @@ ATOMIC_OP(xor)
+@@ -207,12 +353,25 @@ ATOMIC_OP(xor)
*/
static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u)
{
@@ -17512,7 +18599,7 @@ index ae5fb83..f6a093d 100644
if (likely(old == c))
break;
c = old;
-@@ -222,6 +381,49 @@ static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u)
+@@ -221,6 +380,49 @@ static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u)
}
/**
@@ -17563,10 +18650,10 @@ index ae5fb83..f6a093d 100644
* @v: pointer to type int
*
diff --git a/arch/x86/include/asm/atomic64_32.h b/arch/x86/include/asm/atomic64_32.h
-index a11c30b..66fd8a0 100644
+index a984111..9c1ae68 100644
--- a/arch/x86/include/asm/atomic64_32.h
+++ b/arch/x86/include/asm/atomic64_32.h
-@@ -12,6 +12,14 @@ typedef struct {
+@@ -11,6 +11,14 @@ typedef struct {
u64 __aligned(8) counter;
} atomic64_t;
@@ -17581,7 +18668,7 @@ index a11c30b..66fd8a0 100644
#define ATOMIC64_INIT(val) { (val) }
#define __ATOMIC64_DECL(sym) void atomic64_##sym(atomic64_t *, ...)
-@@ -37,21 +45,31 @@ typedef struct {
+@@ -36,21 +44,31 @@ typedef struct {
ATOMIC64_DECL_ONE(sym##_386)
ATOMIC64_DECL_ONE(add_386);
@@ -17613,7 +18700,7 @@ index a11c30b..66fd8a0 100644
ATOMIC64_DECL(dec_if_positive);
ATOMIC64_DECL(inc_not_zero);
ATOMIC64_DECL(add_unless);
-@@ -77,6 +95,21 @@ static inline long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n
+@@ -76,6 +94,21 @@ static inline long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n
}
/**
@@ -17635,7 +18722,7 @@ index a11c30b..66fd8a0 100644
* atomic64_xchg - xchg atomic64 variable
* @v: pointer to type atomic64_t
* @n: value to assign
-@@ -112,6 +145,22 @@ static inline void atomic64_set(atomic64_t *v, long long i)
+@@ -111,6 +144,22 @@ static inline void atomic64_set(atomic64_t *v, long long i)
}
/**
@@ -17658,7 +18745,7 @@ index a11c30b..66fd8a0 100644
* atomic64_read - read atomic64 variable
* @v: pointer to type atomic64_t
*
-@@ -125,6 +174,19 @@ static inline long long atomic64_read(const atomic64_t *v)
+@@ -124,6 +173,19 @@ static inline long long atomic64_read(const atomic64_t *v)
}
/**
@@ -17678,7 +18765,7 @@ index a11c30b..66fd8a0 100644
* atomic64_add_return - add and return
* @i: integer value to add
* @v: pointer to type atomic64_t
-@@ -139,6 +201,21 @@ static inline long long atomic64_add_return(long long i, atomic64_t *v)
+@@ -138,6 +200,21 @@ static inline long long atomic64_add_return(long long i, atomic64_t *v)
return i;
}
@@ -17700,7 +18787,7 @@ index a11c30b..66fd8a0 100644
/*
* Other variants with different arithmetic operators:
*/
-@@ -158,6 +235,14 @@ static inline long long atomic64_inc_return(atomic64_t *v)
+@@ -157,6 +234,14 @@ static inline long long atomic64_inc_return(atomic64_t *v)
return a;
}
@@ -17715,7 +18802,7 @@ index a11c30b..66fd8a0 100644
static inline long long atomic64_dec_return(atomic64_t *v)
{
long long a;
-@@ -182,6 +267,21 @@ static inline long long atomic64_add(long long i, atomic64_t *v)
+@@ -181,6 +266,21 @@ static inline long long atomic64_add(long long i, atomic64_t *v)
}
/**
@@ -18248,11 +19335,11 @@ index acdee09..e5c31cd 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 f7ba9fb..d3945be 100644
+index 7ad8c94..00a0aa3 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
-@@ -217,7 +217,8 @@
- #define X86_FEATURE_PFTHRESHOLD ( 8*32+14) /* AMD pause filter threshold */
+@@ -203,7 +203,8 @@
+
#define X86_FEATURE_VMMCALL ( 8*32+15) /* Prefer vmmcall to vmcall */
#define X86_FEATURE_XENPV ( 8*32+16) /* "" Xen paravirtual guest */
-
@@ -18261,7 +19348,7 @@ index f7ba9fb..d3945be 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*/
-@@ -225,7 +226,7 @@
+@@ -211,7 +212,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 */
@@ -18270,7 +19357,7 @@ index f7ba9fb..d3945be 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 */
-@@ -461,7 +462,8 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
+@@ -462,7 +463,8 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
#ifdef CONFIG_X86_DEBUG_STATIC_CPU_HAS
t_warn:
@@ -18280,7 +19367,7 @@ index f7ba9fb..d3945be 100644
return false;
#endif
-@@ -482,7 +484,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
+@@ -483,7 +485,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"
@@ -18289,7 +19376,7 @@ index f7ba9fb..d3945be 100644
"3: movb $1,%0\n"
"4:\n"
".previous\n"
-@@ -517,7 +519,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
+@@ -518,7 +520,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
" .byte 5f - 4f\n" /* repl len */
" .byte 3b - 2b\n" /* pad len */
".previous\n"
@@ -18298,7 +19385,7 @@ index f7ba9fb..d3945be 100644
"4: jmp %l[t_no]\n"
"5:\n"
".previous\n"
-@@ -552,7 +554,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
+@@ -553,7 +555,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"
@@ -18307,7 +19394,7 @@ index f7ba9fb..d3945be 100644
"3: movb $0,%0\n"
"4:\n"
".previous\n"
-@@ -567,7 +569,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
+@@ -568,7 +570,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"
@@ -18316,6 +19403,208 @@ index f7ba9fb..d3945be 100644
"5: movb $1,%0\n"
"6:\n"
".previous\n"
+diff --git a/arch/x86/include/asm/crypto/camellia.h b/arch/x86/include/asm/crypto/camellia.h
+index bb93333..e3d3d57 100644
+--- a/arch/x86/include/asm/crypto/camellia.h
++++ b/arch/x86/include/asm/crypto/camellia.h
+@@ -39,34 +39,35 @@ extern int xts_camellia_setkey(struct crypto_tfm *tfm, const u8 *key,
+ /* regular block cipher functions */
+ asmlinkage void __camellia_enc_blk(struct camellia_ctx *ctx, u8 *dst,
+ const u8 *src, bool xor);
+-asmlinkage void camellia_dec_blk(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_dec_blk(void *ctx, u8 *dst,
+ const u8 *src);
+
+ /* 2-way parallel cipher functions */
+ asmlinkage void __camellia_enc_blk_2way(struct camellia_ctx *ctx, u8 *dst,
+ const u8 *src, bool xor);
+-asmlinkage void camellia_dec_blk_2way(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_dec_blk_2way(void *ctx, u8 *dst,
+ const u8 *src);
+
+ /* 16-way parallel cipher functions (avx/aes-ni) */
+-asmlinkage void camellia_ecb_enc_16way(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_ecb_enc_16way(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void camellia_ecb_dec_16way(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_ecb_dec_16way(void *ctx, u8 *dst,
+ const u8 *src);
+
+-asmlinkage void camellia_cbc_dec_16way(struct camellia_ctx *ctx, u8 *dst,
++asmlinkage void camellia_cbc_dec_16way(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void camellia_ctr_16way(struct camellia_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void camellia_ctr_16way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+
+-asmlinkage void camellia_xts_enc_16way(struct camellia_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
+-asmlinkage void camellia_xts_dec_16way(struct camellia_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void camellia_xts_enc_16way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
++asmlinkage void camellia_xts_dec_16way(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+
+-static inline void camellia_enc_blk(struct camellia_ctx *ctx, u8 *dst,
++static inline void camellia_enc_blk(void *_ctx, u8 *dst,
+ const u8 *src)
+ {
++ struct camellia_ctx *ctx = _ctx;
+ __camellia_enc_blk(ctx, dst, src, false);
+ }
+
+@@ -76,9 +77,10 @@ static inline void camellia_enc_blk_xor(struct camellia_ctx *ctx, u8 *dst,
+ __camellia_enc_blk(ctx, dst, src, true);
+ }
+
+-static inline void camellia_enc_blk_2way(struct camellia_ctx *ctx, u8 *dst,
++static inline void camellia_enc_blk_2way(void *_ctx, u8 *dst,
+ const u8 *src)
+ {
++ struct camellia_ctx *ctx = _ctx;
+ __camellia_enc_blk_2way(ctx, dst, src, false);
+ }
+
+@@ -89,7 +91,7 @@ static inline void camellia_enc_blk_xor_2way(struct camellia_ctx *ctx, u8 *dst,
+ }
+
+ /* glue helpers */
+-extern void camellia_decrypt_cbc_2way(void *ctx, u128 *dst, const u128 *src);
++extern void camellia_decrypt_cbc_2way(void *ctx, u8 *dst, const u8 *src);
+ extern void camellia_crypt_ctr(void *ctx, u128 *dst, const u128 *src,
+ le128 *iv);
+ extern void camellia_crypt_ctr_2way(void *ctx, u128 *dst, const u128 *src,
+diff --git a/arch/x86/include/asm/crypto/glue_helper.h b/arch/x86/include/asm/crypto/glue_helper.h
+index 03bb106..9e7a45c 100644
+--- a/arch/x86/include/asm/crypto/glue_helper.h
++++ b/arch/x86/include/asm/crypto/glue_helper.h
+@@ -11,16 +11,16 @@
+ #include <crypto/b128ops.h>
+
+ typedef void (*common_glue_func_t)(void *ctx, u8 *dst, const u8 *src);
+-typedef void (*common_glue_cbc_func_t)(void *ctx, u128 *dst, const u128 *src);
++typedef void (*common_glue_cbc_func_t)(void *ctx, u8 *dst, const u8 *src);
+ typedef void (*common_glue_ctr_func_t)(void *ctx, u128 *dst, const u128 *src,
+ le128 *iv);
+ typedef void (*common_glue_xts_func_t)(void *ctx, u128 *dst, const u128 *src,
+ le128 *iv);
+
+-#define GLUE_FUNC_CAST(fn) ((common_glue_func_t)(fn))
+-#define GLUE_CBC_FUNC_CAST(fn) ((common_glue_cbc_func_t)(fn))
+-#define GLUE_CTR_FUNC_CAST(fn) ((common_glue_ctr_func_t)(fn))
+-#define GLUE_XTS_FUNC_CAST(fn) ((common_glue_xts_func_t)(fn))
++#define GLUE_FUNC_CAST(fn) (fn)
++#define GLUE_CBC_FUNC_CAST(fn) (fn)
++#define GLUE_CTR_FUNC_CAST(fn) (fn)
++#define GLUE_XTS_FUNC_CAST(fn) (fn)
+
+ struct common_glue_func_entry {
+ unsigned int num_blocks; /* number of blocks that @fn will process */
+diff --git a/arch/x86/include/asm/crypto/serpent-avx.h b/arch/x86/include/asm/crypto/serpent-avx.h
+index 33c2b8a..586871f 100644
+--- a/arch/x86/include/asm/crypto/serpent-avx.h
++++ b/arch/x86/include/asm/crypto/serpent-avx.h
+@@ -16,20 +16,20 @@ struct serpent_xts_ctx {
+ struct serpent_ctx crypt_ctx;
+ };
+
+-asmlinkage void serpent_ecb_enc_8way_avx(struct serpent_ctx *ctx, u8 *dst,
++asmlinkage void serpent_ecb_enc_8way_avx(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void serpent_ecb_dec_8way_avx(struct serpent_ctx *ctx, u8 *dst,
++asmlinkage void serpent_ecb_dec_8way_avx(void *ctx, u8 *dst,
+ const u8 *src);
+
+-asmlinkage void serpent_cbc_dec_8way_avx(struct serpent_ctx *ctx, u8 *dst,
++asmlinkage void serpent_cbc_dec_8way_avx(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void serpent_ctr_8way_avx(struct serpent_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void serpent_ctr_8way_avx(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+
+-asmlinkage void serpent_xts_enc_8way_avx(struct serpent_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
+-asmlinkage void serpent_xts_dec_8way_avx(struct serpent_ctx *ctx, u8 *dst,
+- const u8 *src, le128 *iv);
++asmlinkage void serpent_xts_enc_8way_avx(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
++asmlinkage void serpent_xts_dec_8way_avx(void *ctx, u128 *dst,
++ const u128 *src, le128 *iv);
+
+ extern void __serpent_crypt_ctr(void *ctx, u128 *dst, const u128 *src,
+ le128 *iv);
+diff --git a/arch/x86/include/asm/crypto/serpent-sse2.h b/arch/x86/include/asm/crypto/serpent-sse2.h
+index e6e77df..fe42081 100644
+--- a/arch/x86/include/asm/crypto/serpent-sse2.h
++++ b/arch/x86/include/asm/crypto/serpent-sse2.h
+@@ -13,7 +13,7 @@ asmlinkage void __serpent_enc_blk_4way(struct serpent_ctx *ctx, u8 *dst,
+ asmlinkage void serpent_dec_blk_4way(struct serpent_ctx *ctx, u8 *dst,
+ const u8 *src);
+
+-static inline void serpent_enc_blk_xway(struct serpent_ctx *ctx, u8 *dst,
++static inline void serpent_enc_blk_xway(void *ctx, u8 *dst,
+ const u8 *src)
+ {
+ __serpent_enc_blk_4way(ctx, dst, src, false);
+@@ -25,7 +25,7 @@ static inline void serpent_enc_blk_xway_xor(struct serpent_ctx *ctx, u8 *dst,
+ __serpent_enc_blk_4way(ctx, dst, src, true);
+ }
+
+-static inline void serpent_dec_blk_xway(struct serpent_ctx *ctx, u8 *dst,
++static inline void serpent_dec_blk_xway(void *ctx, u8 *dst,
+ const u8 *src)
+ {
+ serpent_dec_blk_4way(ctx, dst, src);
+@@ -40,7 +40,7 @@ asmlinkage void __serpent_enc_blk_8way(struct serpent_ctx *ctx, u8 *dst,
+ asmlinkage void serpent_dec_blk_8way(struct serpent_ctx *ctx, u8 *dst,
+ const u8 *src);
+
+-static inline void serpent_enc_blk_xway(struct serpent_ctx *ctx, u8 *dst,
++static inline void serpent_enc_blk_xway(void *ctx, u8 *dst,
+ const u8 *src)
+ {
+ __serpent_enc_blk_8way(ctx, dst, src, false);
+@@ -52,7 +52,7 @@ static inline void serpent_enc_blk_xway_xor(struct serpent_ctx *ctx, u8 *dst,
+ __serpent_enc_blk_8way(ctx, dst, src, true);
+ }
+
+-static inline void serpent_dec_blk_xway(struct serpent_ctx *ctx, u8 *dst,
++static inline void serpent_dec_blk_xway(void *ctx, u8 *dst,
+ const u8 *src)
+ {
+ serpent_dec_blk_8way(ctx, dst, src);
+diff --git a/arch/x86/include/asm/crypto/twofish.h b/arch/x86/include/asm/crypto/twofish.h
+index 878c51c..86fc65f 100644
+--- a/arch/x86/include/asm/crypto/twofish.h
++++ b/arch/x86/include/asm/crypto/twofish.h
+@@ -17,19 +17,19 @@ struct twofish_xts_ctx {
+ };
+
+ /* regular block cipher functions from twofish_x86_64 module */
+-asmlinkage void twofish_enc_blk(struct twofish_ctx *ctx, u8 *dst,
++asmlinkage void twofish_enc_blk(void *ctx, u8 *dst,
+ const u8 *src);
+-asmlinkage void twofish_dec_blk(struct twofish_ctx *ctx, u8 *dst,
++asmlinkage void twofish_dec_blk(void *ctx, u8 *dst,
+ const u8 *src);
+
+ /* 3-way parallel cipher functions */
+-asmlinkage void __twofish_enc_blk_3way(struct twofish_ctx *ctx, u8 *dst,
++asmlinkage void __twofish_enc_blk_3way(void *ctx, u8 *dst,
+ const u8 *src, bool xor);
+-asmlinkage void twofish_dec_blk_3way(struct twofish_ctx *ctx, u8 *dst,
++asmlinkage void twofish_dec_blk_3way(void *ctx, u8 *dst,
+ const u8 *src);
+
+ /* helpers from twofish_x86_64-3way module */
+-extern void twofish_dec_blk_cbc_3way(void *ctx, u128 *dst, const u128 *src);
++extern void twofish_dec_blk_cbc_3way(void *ctx, u8 *dst, const u8 *src);
+ extern void twofish_enc_blk_ctr(void *ctx, u128 *dst, const u128 *src,
+ le128 *iv);
+ extern void twofish_enc_blk_ctr_3way(void *ctx, u128 *dst, const u128 *src,
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
index 4e10d73..7319a47 100644
--- a/arch/x86/include/asm/desc.h
@@ -18718,10 +20007,10 @@ index 1c7eefe..d0e4702 100644
};
diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h
-index 3c3550c..ca9e4c3 100644
+index 0fd440d..5f883a5 100644
--- a/arch/x86/include/asm/fpu/internal.h
+++ b/arch/x86/include/asm/fpu/internal.h
-@@ -97,8 +97,11 @@ extern void fpstate_sanitize_xstate(struct fpu *fpu);
+@@ -98,8 +98,11 @@ extern void fpstate_sanitize_xstate(struct fpu *fpu);
#define user_insn(insn, output, input...) \
({ \
int err; \
@@ -18734,7 +20023,7 @@ index 3c3550c..ca9e4c3 100644
"2: " ASM_CLAC "\n" \
".section .fixup,\"ax\"\n" \
"3: movl $-1,%[err]\n" \
-@@ -107,6 +110,7 @@ extern void fpstate_sanitize_xstate(struct fpu *fpu);
+@@ -108,6 +111,7 @@ extern void fpstate_sanitize_xstate(struct fpu *fpu);
_ASM_EXTABLE(1b, 3b) \
: [err] "=r" (err), output \
: "0"(0), input); \
@@ -18742,7 +20031,7 @@ index 3c3550c..ca9e4c3 100644
err; \
})
-@@ -186,9 +190,9 @@ static inline int copy_user_to_fregs(struct fregs_state __user *fx)
+@@ -187,9 +191,9 @@ static inline int copy_user_to_fregs(struct fregs_state __user *fx)
static inline void copy_fxregs_to_kernel(struct fpu *fpu)
{
if (config_enabled(CONFIG_X86_32))
@@ -18754,7 +20043,7 @@ index 3c3550c..ca9e4c3 100644
else {
/* Using "rex64; fxsave %0" is broken because, if the memory
* operand uses any extended registers for addressing, a second
-@@ -205,15 +209,15 @@ static inline void copy_fxregs_to_kernel(struct fpu *fpu)
+@@ -206,15 +210,15 @@ static inline void copy_fxregs_to_kernel(struct fpu *fpu)
* an extended register is needed for addressing (fix submitted
* to mainline 2005-11-21).
*
@@ -18773,25 +20062,20 @@ index 3c3550c..ca9e4c3 100644
}
}
-@@ -388,12 +392,16 @@ static inline int copy_xregs_to_user(struct xregs_state __user *buf)
+@@ -386,9 +390,11 @@ static inline int copy_xregs_to_user(struct xregs_state __user *buf)
if (unlikely(err))
return -EFAULT;
+ pax_open_userland();
- __asm__ __volatile__(ASM_STAC "\n"
-- "1:"XSAVE"\n"
-+ "1:"
-+ __copyuser_seg
-+ XSAVE"\n"
- "2: " ASM_CLAC "\n"
- xstate_fault(err)
- : "D" (buf), "a" (-1), "d" (-1), "0" (err)
- : "memory");
+ stac();
+- XSTATE_OP(XSAVE, buf, -1, -1, err);
++ XSTATE_OP(__copyuser_seg XSAVE, buf, -1, -1, err);
+ clac();
+ pax_close_userland();
+
return err;
}
-
-@@ -402,17 +410,21 @@ static inline int copy_xregs_to_user(struct xregs_state __user *buf)
+@@ -398,14 +404,16 @@ static inline int copy_xregs_to_user(struct xregs_state __user *buf)
*/
static inline int copy_user_to_xregs(struct xregs_state __user *buf, u64 mask)
{
@@ -18799,23 +20083,18 @@ index 3c3550c..ca9e4c3 100644
+ struct xregs_state *xstate = ((__force_kernel struct xregs_state *)buf);
u32 lmask = mask;
u32 hmask = mask >> 32;
- int err = 0;
+ int err;
+ pax_open_userland();
- __asm__ __volatile__(ASM_STAC "\n"
-- "1:"XRSTOR"\n"
-+ "1:"
-+ __copyuser_seg
-+ XRSTOR"\n"
- "2: " ASM_CLAC "\n"
- xstate_fault(err)
- : "D" (xstate), "a" (lmask), "d" (hmask), "0" (err)
- : "memory"); /* memory required? */
+ stac();
+- XSTATE_OP(XRSTOR, xstate, lmask, hmask, err);
++ XSTATE_OP(__copyuser_seg XRSTOR, xstate, lmask, hmask, err);
+ clac();
+ pax_close_userland();
+
return err;
}
-
-@@ -429,7 +441,7 @@ static inline int copy_user_to_xregs(struct xregs_state __user *buf, u64 mask)
+@@ -423,7 +431,7 @@ static inline int copy_user_to_xregs(struct xregs_state __user *buf, u64 mask)
static inline int copy_fpregs_to_fpstate(struct fpu *fpu)
{
if (likely(use_xsave())) {
@@ -18824,7 +20103,7 @@ index 3c3550c..ca9e4c3 100644
return 1;
}
-@@ -442,7 +454,7 @@ static inline int copy_fpregs_to_fpstate(struct fpu *fpu)
+@@ -436,7 +444,7 @@ static inline int copy_fpregs_to_fpstate(struct fpu *fpu)
* Legacy FPU register saving, FNSAVE always clears FPU registers,
* so we have to mark them inactive:
*/
@@ -18833,7 +20112,7 @@ index 3c3550c..ca9e4c3 100644
return 0;
}
-@@ -471,7 +483,7 @@ static inline void copy_kernel_to_fpregs(union fpregs_state *fpstate)
+@@ -465,7 +473,7 @@ static inline void copy_kernel_to_fpregs(union fpregs_state *fpstate)
"fnclex\n\t"
"emms\n\t"
"fildl %P[addr]" /* set F?P to defined value */
@@ -18842,7 +20121,7 @@ index 3c3550c..ca9e4c3 100644
}
__copy_kernel_to_fpregs(fpstate);
-@@ -611,7 +623,7 @@ switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu)
+@@ -605,7 +613,7 @@ switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu)
if (fpu.preload) {
new_fpu->counter++;
__fpregs_activate(new_fpu);
@@ -18851,7 +20130,7 @@ index 3c3550c..ca9e4c3 100644
} else {
__fpregs_deactivate_hw();
}
-@@ -623,7 +635,7 @@ switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu)
+@@ -617,7 +625,7 @@ switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu)
if (fpu_want_lazy_restore(new_fpu, cpu))
fpu.preload = 0;
else
@@ -18860,7 +20139,7 @@ index 3c3550c..ca9e4c3 100644
fpregs_activate(new_fpu);
}
}
-@@ -643,7 +655,7 @@ switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu)
+@@ -637,7 +645,7 @@ switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu)
static inline void switch_fpu_finish(struct fpu *new_fpu, fpu_switch_t fpu_switch)
{
if (fpu_switch.preload)
@@ -19022,10 +20301,10 @@ 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 59caa55..e4d3fec 100644
+index 84b3d19..8ea9f03 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
-@@ -159,8 +159,8 @@ static inline void unlock_vector_lock(void) {}
+@@ -164,8 +164,8 @@ static inline void unlock_vector_lock(void) {}
#endif /* CONFIG_X86_LOCAL_APIC */
/* Statistics */
@@ -19163,6 +20442,31 @@ index 4421b5d..8543006 100644
#define flush_insn_slot(p) do { } while (0)
+diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
+index e9cd7be..0f3574f 100644
+--- a/arch/x86/include/asm/kvm_emulate.h
++++ b/arch/x86/include/asm/kvm_emulate.h
+@@ -279,6 +279,8 @@ enum x86emul_mode {
+ #define X86EMUL_SMM_MASK (1 << 6)
+ #define X86EMUL_SMM_INSIDE_NMI_MASK (1 << 7)
+
++struct fastop;
++
+ struct x86_emulate_ctxt {
+ const struct x86_emulate_ops *ops;
+
+@@ -311,7 +313,10 @@ struct x86_emulate_ctxt {
+ struct operand src;
+ struct operand src2;
+ struct operand dst;
+- int (*execute)(struct x86_emulate_ctxt *ctxt);
++ union {
++ int (*execute)(struct x86_emulate_ctxt *ctxt);
++ void (*fastop)(struct fastop *fake);
++ } u;
+ int (*check_perm)(struct x86_emulate_ctxt *ctxt);
+ /*
+ * The following six fields are cleared together,
diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h
index 4ad6560..75c7bdd 100644
--- a/arch/x86/include/asm/local.h
@@ -19600,7 +20904,7 @@ index bfd9b2a..0d64fc2 100644
#define activate_mm(prev, next) \
diff --git a/arch/x86/include/asm/module.h b/arch/x86/include/asm/module.h
-index e3b7819..b257c64 100644
+index e3b7819..ba128ec 100644
--- a/arch/x86/include/asm/module.h
+++ b/arch/x86/include/asm/module.h
@@ -5,6 +5,7 @@
@@ -19611,7 +20915,7 @@ index e3b7819..b257c64 100644
#elif defined CONFIG_M486
#define MODULE_PROC_FAMILY "486 "
#elif defined CONFIG_M586
-@@ -57,8 +58,20 @@
+@@ -57,8 +58,26 @@
#error unknown processor family
#endif
@@ -19631,7 +20935,13 @@ index e3b7819..b257c64 100644
+#define MODULE_PAX_UDEREF ""
+#endif
+
-+#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_PAX_KERNEXEC MODULE_PAX_UDEREF
++#ifdef CONFIG_PAX_RAP
++#define MODULE_PAX_RAP "RAP "
++#else
++#define MODULE_PAX_RAP ""
++#endif
++
++#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_PAX_KERNEXEC MODULE_PAX_UDEREF MODULE_PAX_RAP
+
#endif /* _ASM_X86_MODULE_H */
diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h
@@ -19775,10 +21085,10 @@ index b3bebf9..cb419e7 100644
#define __phys_reloc_hide(x) (x)
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
-index c759b3c..043875b 100644
+index f619250..8b851d8 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
-@@ -536,7 +536,7 @@ static inline pmd_t __pmd(pmdval_t val)
+@@ -510,7 +510,7 @@ static inline pmd_t __pmd(pmdval_t val)
return (pmd_t) { ret };
}
@@ -19787,7 +21097,7 @@ index c759b3c..043875b 100644
{
pmdval_t ret;
-@@ -602,6 +602,18 @@ static inline void set_pgd(pgd_t *pgdp, pgd_t pgd)
+@@ -576,6 +576,18 @@ static inline void set_pgd(pgd_t *pgdp, pgd_t pgd)
val);
}
@@ -19806,7 +21116,7 @@ index c759b3c..043875b 100644
static inline void pgd_clear(pgd_t *pgdp)
{
set_pgd(pgdp, __pgd(0));
-@@ -686,6 +698,21 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
+@@ -660,6 +672,21 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
pv_mmu_ops.set_fixmap(idx, phys, flags);
}
@@ -19828,7 +21138,7 @@ index c759b3c..043875b 100644
#if defined(CONFIG_SMP) && defined(CONFIG_PARAVIRT_SPINLOCKS)
#ifdef CONFIG_QUEUED_SPINLOCKS
-@@ -909,7 +936,7 @@ extern void default_banner(void);
+@@ -883,7 +910,7 @@ extern void default_banner(void);
#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 4)
#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .long, 4)
@@ -19837,7 +21147,7 @@ index c759b3c..043875b 100644
#endif
#define INTERRUPT_RETURN \
-@@ -979,6 +1006,21 @@ extern void default_banner(void);
+@@ -941,6 +968,21 @@ extern void default_banner(void);
PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_usergs_sysret64), \
CLBR_NONE, \
jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_usergs_sysret64))
@@ -19860,7 +21170,7 @@ index c759b3c..043875b 100644
#endif /* __ASSEMBLY__ */
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
-index 3d44191..1992d40 100644
+index 77db561..bc4a1ea 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -89,7 +89,7 @@ struct pv_init_ops {
@@ -19887,7 +21197,7 @@ index 3d44191..1992d40 100644
struct pv_cpu_ops {
/* hooks for various privileged instructions */
-@@ -195,7 +195,7 @@ struct pv_cpu_ops {
+@@ -178,7 +178,7 @@ struct pv_cpu_ops {
void (*start_context_switch)(struct task_struct *prev);
void (*end_context_switch)(struct task_struct *next);
@@ -19896,25 +21206,16 @@ index 3d44191..1992d40 100644
struct pv_irq_ops {
/*
-@@ -218,7 +218,7 @@ struct pv_irq_ops {
+@@ -201,7 +201,7 @@ struct pv_irq_ops {
#ifdef CONFIG_X86_64
void (*adjust_exception_frame)(void);
#endif
-};
+} __no_randomize_layout;
- struct pv_apic_ops {
- #ifdef CONFIG_X86_LOCAL_APIC
-@@ -226,7 +226,7 @@ struct pv_apic_ops {
- unsigned long start_eip,
- unsigned long start_esp);
- #endif
--};
-+} __no_const __no_randomize_layout;
-
struct pv_mmu_ops {
unsigned long (*read_cr2)(void);
-@@ -316,6 +316,7 @@ struct pv_mmu_ops {
+@@ -285,6 +285,7 @@ struct pv_mmu_ops {
struct paravirt_callee_save make_pud;
void (*set_pgd)(pgd_t *pudp, pgd_t pgdval);
@@ -19922,7 +21223,7 @@ index 3d44191..1992d40 100644
#endif /* CONFIG_PGTABLE_LEVELS == 4 */
#endif /* CONFIG_PGTABLE_LEVELS >= 3 */
-@@ -327,7 +328,13 @@ struct pv_mmu_ops {
+@@ -296,7 +297,13 @@ struct pv_mmu_ops {
an mfn. We can tell which is which from the index. */
void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
phys_addr_t phys, pgprot_t flags);
@@ -19937,7 +21238,7 @@ index 3d44191..1992d40 100644
struct arch_spinlock;
#ifdef CONFIG_SMP
-@@ -349,11 +356,14 @@ struct pv_lock_ops {
+@@ -318,11 +325,14 @@ struct pv_lock_ops {
struct paravirt_callee_save lock_spinning;
void (*unlock_kick)(struct arch_spinlock *lock, __ticket_t ticket);
#endif /* !CONFIG_QUEUED_SPINLOCKS */
@@ -19954,8 +21255,8 @@ index 3d44191..1992d40 100644
struct paravirt_patch_template {
struct pv_init_ops pv_init_ops;
struct pv_time_ops pv_time_ops;
-@@ -362,7 +372,7 @@ struct paravirt_patch_template {
- struct pv_apic_ops pv_apic_ops;
+@@ -330,7 +340,7 @@ struct paravirt_patch_template {
+ struct pv_irq_ops pv_irq_ops;
struct pv_mmu_ops pv_mmu_ops;
struct pv_lock_ops pv_lock_ops;
-};
@@ -20066,7 +21367,7 @@ index cdaa58c..ae30f0d 100644
static inline void pud_clear(pud_t *pudp)
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
-index 6ec0c8b..1e50b49 100644
+index 0687c47..7425416 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -54,6 +54,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
@@ -20077,7 +21378,7 @@ index 6ec0c8b..1e50b49 100644
#define pgd_clear(pgd) native_pgd_clear(pgd)
#endif
-@@ -91,12 +92,53 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
+@@ -88,12 +89,53 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
#define arch_end_context_switch(prev) do {} while(0)
@@ -20131,7 +21432,7 @@ index 6ec0c8b..1e50b49 100644
static inline int pte_dirty(pte_t pte)
{
return pte_flags(pte) & _PAGE_DIRTY;
-@@ -157,6 +199,11 @@ static inline unsigned long pud_pfn(pud_t pud)
+@@ -154,6 +196,11 @@ static inline unsigned long pud_pfn(pud_t pud)
return (pud_val(pud) & pud_pfn_mask(pud)) >> PAGE_SHIFT;
}
@@ -20143,7 +21444,7 @@ index 6ec0c8b..1e50b49 100644
#define pte_page(pte) pfn_to_page(pte_pfn(pte))
static inline int pmd_large(pmd_t pte)
-@@ -210,9 +257,29 @@ static inline pte_t pte_wrprotect(pte_t pte)
+@@ -209,9 +256,29 @@ static inline pte_t pte_wrprotect(pte_t pte)
return pte_clear_flags(pte, _PAGE_RW);
}
@@ -20174,7 +21475,7 @@ index 6ec0c8b..1e50b49 100644
}
static inline pte_t pte_mkdirty(pte_t pte)
-@@ -445,6 +512,16 @@ pte_t *populate_extra_pte(unsigned long vaddr);
+@@ -459,6 +526,16 @@ pte_t *populate_extra_pte(unsigned long vaddr);
#endif
#ifndef __ASSEMBLY__
@@ -20191,7 +21492,7 @@ index 6ec0c8b..1e50b49 100644
#include <linux/mm_types.h>
#include <linux/mmdebug.h>
#include <linux/log2.h>
-@@ -638,7 +715,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)
+@@ -659,7 +736,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:
*/
@@ -20200,7 +21501,7 @@ index 6ec0c8b..1e50b49 100644
/* to find an entry in a page-table-directory. */
static inline unsigned long pud_index(unsigned long address)
-@@ -653,7 +730,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
+@@ -674,7 +751,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
static inline int pgd_bad(pgd_t pgd)
{
@@ -20209,7 +21510,7 @@ index 6ec0c8b..1e50b49 100644
}
static inline int pgd_none(pgd_t pgd)
-@@ -676,7 +753,12 @@ static inline int pgd_none(pgd_t pgd)
+@@ -697,7 +774,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;
*/
@@ -20223,7 +21524,7 @@ index 6ec0c8b..1e50b49 100644
/*
* a shortcut which implies the use of the kernel's pgd, instead
* of a process's
-@@ -687,6 +769,25 @@ static inline int pgd_none(pgd_t pgd)
+@@ -708,6 +790,25 @@ 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)
@@ -20249,7 +21550,7 @@ index 6ec0c8b..1e50b49 100644
#ifndef __ASSEMBLY__
extern int direct_gbpages;
-@@ -853,11 +954,24 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
+@@ -862,11 +963,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.
*/
@@ -20444,22 +21745,24 @@ index e6844df..432b56e 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 79c9185..d1e3128 100644
+index 4432ab7..43778ff 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
-@@ -85,8 +85,10 @@
-
- #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
+@@ -87,9 +87,12 @@
#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX)
+ #define _PAGE_DEVMAP (_AT(u64, 1) << _PAGE_BIT_DEVMAP)
+ #define __HAVE_ARCH_PTE_DEVMAP
-#else
+#elif defined(CONFIG_KMEMCHECK) || defined(CONFIG_MEM_SOFT_DIRTY)
#define _PAGE_NX (_AT(pteval_t, 0))
+ #define _PAGE_DEVMAP (_AT(pteval_t, 0))
+#else
+#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_HIDDEN)
++#define _PAGE_DEVMAP (_AT(pteval_t, 0))
#endif
#define _PAGE_PROTNONE (_AT(pteval_t, 1) << _PAGE_BIT_PROTNONE)
-@@ -141,6 +143,9 @@ enum page_cache_mode {
+@@ -144,6 +147,9 @@ enum page_cache_mode {
#define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | \
_PAGE_ACCESSED)
@@ -20469,7 +21772,7 @@ index 79c9185..d1e3128 100644
#define __PAGE_KERNEL_EXEC \
(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL)
#define __PAGE_KERNEL (__PAGE_KERNEL_EXEC | _PAGE_NX)
-@@ -148,7 +153,7 @@ enum page_cache_mode {
+@@ -151,7 +157,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)
@@ -20478,7 +21781,7 @@ index 79c9185..d1e3128 100644
#define __PAGE_KERNEL_VVAR (__PAGE_KERNEL_RO | _PAGE_USER)
#define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE)
#define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE)
-@@ -194,7 +199,7 @@ enum page_cache_mode {
+@@ -197,7 +203,7 @@ enum page_cache_mode {
#ifdef CONFIG_X86_64
#define __PAGE_KERNEL_IDENT_LARGE_EXEC __PAGE_KERNEL_LARGE_EXEC
#else
@@ -20487,7 +21790,7 @@ index 79c9185..d1e3128 100644
#define PDE_IDENT_ATTR 0x063 /* PRESENT+RW+DIRTY+ACCESSED */
#define PGD_IDENT_ATTR 0x001 /* PRESENT (no other attributes) */
#endif
-@@ -233,7 +238,17 @@ static inline pgdval_t pgd_flags(pgd_t pgd)
+@@ -236,7 +242,17 @@ static inline pgdval_t pgd_flags(pgd_t pgd)
{
return native_pgd_val(pgd) & PTE_FLAGS_MASK;
}
@@ -20505,7 +21808,7 @@ index 79c9185..d1e3128 100644
#if CONFIG_PGTABLE_LEVELS > 3
typedef struct { pudval_t pud; } pud_t;
-@@ -247,8 +262,6 @@ static inline pudval_t native_pud_val(pud_t pud)
+@@ -250,8 +266,6 @@ static inline pudval_t native_pud_val(pud_t pud)
return pud.pud;
}
#else
@@ -20514,7 +21817,7 @@ index 79c9185..d1e3128 100644
static inline pudval_t native_pud_val(pud_t pud)
{
return native_pgd_val(pud.pgd);
-@@ -268,8 +281,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
+@@ -271,8 +285,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
return pmd.pmd;
}
#else
@@ -20523,7 +21826,7 @@ index 79c9185..d1e3128 100644
static inline pmdval_t native_pmd_val(pmd_t pmd)
{
return native_pgd_val(pmd.pud.pgd);
-@@ -386,7 +397,6 @@ typedef struct page *pgtable_t;
+@@ -389,7 +401,6 @@ typedef struct page *pgtable_t;
extern pteval_t __supported_pte_mask;
extern void set_nx(void);
@@ -20532,7 +21835,7 @@ index 79c9185..d1e3128 100644
#define pgprot_writecombine pgprot_writecombine
extern pgprot_t pgprot_writecombine(pgprot_t prot);
diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/pmem.h
-index d8ce3ec..96b12e2 100644
+index c57fd1e..426fc11 100644
--- a/arch/x86/include/asm/pmem.h
+++ b/arch/x86/include/asm/pmem.h
@@ -41,7 +41,7 @@ static inline void arch_memcpy_to_pmem(void __pmem *dst, const void *src,
@@ -20558,7 +21861,7 @@ index 01bcde8..a6f1377 100644
/*
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
-index 2d5a50c..9fc95aaf 100644
+index 20c11d1..f4a4f69 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -136,7 +136,7 @@ struct cpuinfo_x86 {
@@ -20820,7 +22123,7 @@ index 9c6b890..5305f53 100644
u32 gdt_base;
#else
diff --git a/arch/x86/include/asm/reboot.h b/arch/x86/include/asm/reboot.h
-index a82c4f1..ac45053 100644
+index 2cb1cc2..787d524 100644
--- a/arch/x86/include/asm/reboot.h
+++ b/arch/x86/include/asm/reboot.h
@@ -6,13 +6,13 @@
@@ -21228,10 +22531,10 @@ index ba665eb..0f72938 100644
static __always_inline void clac(void)
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
-index 222a6a3..839da8d 100644
+index dfcf072..97cd79a 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
-@@ -35,7 +35,7 @@ DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_map);
+@@ -26,7 +26,7 @@ DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_map);
/* cpus sharing the last level cache: */
DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_llc_shared_map);
DECLARE_PER_CPU_READ_MOSTLY(u16, cpu_llc_id);
@@ -21240,7 +22543,7 @@ index 222a6a3..839da8d 100644
static inline struct cpumask *cpu_llc_shared_mask(int cpu)
{
-@@ -68,7 +68,7 @@ struct smp_ops {
+@@ -59,7 +59,7 @@ struct smp_ops {
void (*send_call_func_ipi)(const struct cpumask *mask);
void (*send_call_func_single_ipi)(int cpu);
@@ -21249,7 +22552,7 @@ index 222a6a3..839da8d 100644
/* Globals due to paravirt */
extern void set_cpu_sibling_map(int cpu);
-@@ -182,14 +182,8 @@ extern unsigned disabled_cpus;
+@@ -170,14 +170,8 @@ extern unsigned disabled_cpus;
extern int safe_smp_processor_id(void);
#elif defined(CONFIG_X86_64_SMP)
@@ -21598,8 +22901,30 @@ index 6df2029..a359a58 100644
asm volatile("invlpg (%0)" ::"r" (addr) : "memory");
}
+diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
+index c3496619..3f3a7dc 100644
+--- a/arch/x86/include/asm/traps.h
++++ b/arch/x86/include/asm/traps.h
+@@ -10,7 +10,7 @@
+ #define dotraplinkage __visible
+
+ asmlinkage void divide_error(void);
+-asmlinkage void debug(void);
++asmlinkage void int1(void);
+ asmlinkage void nmi(void);
+ asmlinkage void int3(void);
+ asmlinkage void xen_debug(void);
+@@ -107,7 +107,7 @@ extern int panic_on_unrecovered_nmi;
+
+ void math_emulate(struct math_emu_info *);
+ #ifndef CONFIG_X86_32
+-asmlinkage void smp_thermal_interrupt(void);
++asmlinkage void smp_thermal_interrupt(struct pt_regs *regs);
+ asmlinkage void smp_threshold_interrupt(void);
+ asmlinkage void smp_deferred_error_interrupt(void);
+ #endif
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
-index 09b1b0a..8f56367 100644
+index a4a30e4..44891b7 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -7,6 +7,7 @@
@@ -21662,8 +22987,8 @@ index 09b1b0a..8f56367 100644
/*
* The exception table consists of pairs of addresses relative to the
-@@ -135,11 +169,13 @@ extern int __get_user_8(void);
- extern int __get_user_bad(void);
+@@ -138,11 +172,13 @@ extern int __get_user_bad(void);
+ #define __uaccess_end() clac()
/*
- * This is a type: either unsigned long, if the argument fits into
@@ -21679,7 +23004,7 @@ index 09b1b0a..8f56367 100644
/**
* get_user: - Get a simple variable from user space.
-@@ -178,10 +214,12 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))
+@@ -181,10 +217,12 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))
register __inttype(*(ptr)) __val_gu asm("%"_ASM_DX); \
__chk_user_ptr(ptr); \
might_fault(); \
@@ -21692,7 +23017,7 @@ index 09b1b0a..8f56367 100644
__builtin_expect(__ret_gu, 0); \
})
-@@ -189,13 +227,21 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))
+@@ -192,13 +230,21 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))
asm volatile("call __put_user_" #size : "=a" (__ret_pu) \
: "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
@@ -21709,26 +23034,26 @@ index 09b1b0a..8f56367 100644
#ifdef CONFIG_X86_32
#define __put_user_asm_u64(x, addr, err, errret) \
- asm volatile(ASM_STAC "\n" \
+ asm volatile("\n" \
- "1: movl %%eax,0(%2)\n" \
- "2: movl %%edx,4(%2)\n" \
+ "1: "__copyuser_seg"movl %%eax,0(%2)\n" \
+ "2: "__copyuser_seg"movl %%edx,4(%2)\n" \
- "3: " ASM_CLAC "\n" \
+ "3:" \
".section .fixup,\"ax\"\n" \
"4: movl %3,%0\n" \
-@@ -208,8 +254,8 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))
+@@ -211,8 +257,8 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))
#define __put_user_asm_ex_u64(x, addr) \
- asm volatile(ASM_STAC "\n" \
+ asm volatile("\n" \
- "1: movl %%eax,0(%1)\n" \
- "2: movl %%edx,4(%1)\n" \
+ "1: "__copyuser_seg"movl %%eax,0(%1)\n" \
+ "2: "__copyuser_seg"movl %%edx,4(%1)\n" \
- "3: " ASM_CLAC "\n" \
+ "3:" \
_ASM_EXTABLE_EX(1b, 2b) \
_ASM_EXTABLE_EX(2b, 3b) \
-@@ -257,10 +303,11 @@ extern void __put_user_8(void);
+@@ -260,10 +306,11 @@ extern void __put_user_8(void);
#define put_user(x, ptr) \
({ \
int __ret_pu; \
@@ -21742,7 +23067,7 @@ index 09b1b0a..8f56367 100644
switch (sizeof(*(ptr))) { \
case 1: \
__put_user_x(1, __pu_val, ptr, __ret_pu); \
-@@ -278,6 +325,7 @@ extern void __put_user_8(void);
+@@ -281,6 +328,7 @@ extern void __put_user_8(void);
__put_user_x(X, __pu_val, ptr, __ret_pu); \
break; \
} \
@@ -21750,7 +23075,7 @@ index 09b1b0a..8f56367 100644
__builtin_expect(__ret_pu, 0); \
})
-@@ -341,10 +389,10 @@ do { \
+@@ -348,10 +396,10 @@ do { \
__chk_user_ptr(ptr); \
switch (size) { \
case 1: \
@@ -21763,16 +23088,16 @@ index 09b1b0a..8f56367 100644
break; \
case 4: \
__get_user_asm(x, ptr, retval, "l", "k", "=r", errret); \
-@@ -358,27 +406,31 @@ do { \
+@@ -365,17 +413,21 @@ do { \
} while (0)
#define __get_user_asm(x, addr, err, itype, rtype, ltype, errret) \
+do { \
+ pax_open_userland(); \
- asm volatile(ASM_STAC "\n" \
+ asm volatile("\n" \
- "1: mov"itype" %2,%"rtype"1\n" \
+ "1: "__copyuser_seg"mov"itype" %2,%"rtype"1\n"\
- "2: " ASM_CLAC "\n" \
+ "2:\n" \
".section .fixup,\"ax\"\n" \
"3: mov %3,%0\n" \
- " xor"itype" %"rtype"1,%"rtype"1\n" \
@@ -21787,8 +23112,9 @@ index 09b1b0a..8f56367 100644
+ pax_close_userland(); \
+} while (0)
- #define __get_user_size_ex(x, ptr, size) \
- do { \
+ /*
+ * This doesn't do __uaccess_begin/end - the exception handling
+@@ -386,10 +438,10 @@ do { \
__chk_user_ptr(ptr); \
switch (size) { \
case 1: \
@@ -21801,7 +23127,7 @@ index 09b1b0a..8f56367 100644
break; \
case 4: \
__get_user_asm_ex(x, ptr, "l", "k", "=r"); \
-@@ -392,7 +444,7 @@ do { \
+@@ -403,7 +455,7 @@ do { \
} while (0)
#define __get_user_asm_ex(x, addr, itype, rtype, ltype) \
@@ -21810,13 +23136,10 @@ index 09b1b0a..8f56367 100644
"2:\n" \
_ASM_EXTABLE_EX(1b, 2b) \
: ltype(x) : "m" (__m(addr)))
-@@ -407,15 +459,26 @@ do { \
- #define __get_user_nocheck(x, ptr, size) \
- ({ \
- int __gu_err; \
-- unsigned long __gu_val; \
-+ __inttype(*(ptr)) __gu_val; \
+@@ -424,13 +476,24 @@ do { \
+ __uaccess_begin(); \
__get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT); \
+ __uaccess_end(); \
- (x) = (__force __typeof__(*(ptr)))__gu_val; \
+ (x) = (__typeof__(*(ptr)))__gu_val; \
__builtin_expect(__gu_err, 0); \
@@ -21840,19 +23163,19 @@ index 09b1b0a..8f56367 100644
/*
* Tell gcc we read from memory instead of writing: this is because
-@@ -423,8 +486,10 @@ struct __large_struct { unsigned long buf[100]; };
+@@ -438,8 +501,10 @@ struct __large_struct { unsigned long buf[100]; };
* aliasing issues.
*/
#define __put_user_asm(x, addr, err, itype, rtype, ltype, errret) \
+do { \
+ pax_open_userland(); \
- asm volatile(ASM_STAC "\n" \
+ asm volatile("\n" \
- "1: mov"itype" %"rtype"1,%2\n" \
+ "1: "__copyuser_seg"mov"itype" %"rtype"1,%2\n"\
- "2: " ASM_CLAC "\n" \
+ "2:\n" \
".section .fixup,\"ax\"\n" \
"3: mov %3,%0\n" \
-@@ -432,10 +497,12 @@ struct __large_struct { unsigned long buf[100]; };
+@@ -447,10 +512,12 @@ struct __large_struct { unsigned long buf[100]; };
".previous\n" \
_ASM_EXTABLE(1b, 3b) \
: "=r"(err) \
@@ -21867,21 +23190,21 @@ index 09b1b0a..8f56367 100644
"2:\n" \
_ASM_EXTABLE_EX(1b, 2b) \
: : ltype(x), "m" (__m(addr)))
-@@ -445,11 +512,13 @@ struct __large_struct { unsigned long buf[100]; };
+@@ -460,11 +527,13 @@ struct __large_struct { unsigned long buf[100]; };
*/
#define uaccess_try do { \
current_thread_info()->uaccess_err = 0; \
+ pax_open_userland(); \
- stac(); \
+ __uaccess_begin(); \
barrier();
#define uaccess_catch(err) \
- clac(); \
+ __uaccess_end(); \
+ pax_close_userland(); \
(err) |= (current_thread_info()->uaccess_err ? -EFAULT : 0); \
} while (0)
-@@ -475,8 +544,12 @@ struct __large_struct { unsigned long buf[100]; };
+@@ -490,8 +559,12 @@ struct __large_struct { unsigned long buf[100]; };
* On error, the variable @x is set to zero.
*/
@@ -21894,7 +23217,7 @@ index 09b1b0a..8f56367 100644
/**
* __put_user: - Write a simple value into user space, with less checking.
-@@ -499,8 +572,12 @@ struct __large_struct { unsigned long buf[100]; };
+@@ -514,8 +587,12 @@ struct __large_struct { unsigned long buf[100]; };
* Returns zero on success, or -EFAULT on error.
*/
@@ -21907,7 +23230,7 @@ index 09b1b0a..8f56367 100644
#define __get_user_unaligned __get_user
#define __put_user_unaligned __put_user
-@@ -518,7 +595,7 @@ struct __large_struct { unsigned long buf[100]; };
+@@ -533,7 +610,7 @@ struct __large_struct { unsigned long buf[100]; };
#define get_user_ex(x, ptr) do { \
unsigned long __gue_val; \
__get_user_size_ex((__gue_val), (ptr), (sizeof(*(ptr)))); \
@@ -21916,7 +23239,7 @@ index 09b1b0a..8f56367 100644
} while (0)
#define put_user_try uaccess_try
-@@ -536,7 +613,7 @@ extern __must_check long strlen_user(const char __user *str);
+@@ -551,7 +628,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);
@@ -21925,7 +23248,7 @@ index 09b1b0a..8f56367 100644
extern void __cmpxchg_wrong_size(void)
__compiletime_error("Bad argument size for cmpxchg");
-@@ -544,21 +621,22 @@ extern void __cmpxchg_wrong_size(void)
+@@ -559,22 +636,23 @@ extern void __cmpxchg_wrong_size(void)
#define __user_atomic_cmpxchg_inatomic(uval, ptr, old, new, size) \
({ \
int __ret = 0; \
@@ -21936,13 +23259,14 @@ index 09b1b0a..8f56367 100644
+ __typeof__(*(uval)) __old = (old); \
+ __typeof__(*(uval)) __new = (new); \
+ pax_open_userland(); \
+ __uaccess_begin(); \
switch (size) { \
case 1: \
{ \
- asm volatile("\t" ASM_STAC "\n" \
+ asm volatile("\n" \
- "1:\t" LOCK_PREFIX "cmpxchgb %4, %2\n" \
+ "1:\t" LOCK_PREFIX __copyuser_seg"cmpxchgb %4, %2\n"\
- "2:\t" ASM_CLAC "\n" \
+ "2:\n" \
"\t.section .fixup, \"ax\"\n" \
"3:\tmov %3, %0\n" \
"\tjmp 2b\n" \
@@ -21953,13 +23277,13 @@ index 09b1b0a..8f56367 100644
: "i" (-EFAULT), "q" (__new), "1" (__old) \
: "memory" \
); \
-@@ -567,14 +645,14 @@ extern void __cmpxchg_wrong_size(void)
+@@ -583,14 +661,14 @@ extern void __cmpxchg_wrong_size(void)
case 2: \
{ \
- asm volatile("\t" ASM_STAC "\n" \
+ asm volatile("\n" \
- "1:\t" LOCK_PREFIX "cmpxchgw %4, %2\n" \
+ "1:\t" LOCK_PREFIX __copyuser_seg"cmpxchgw %4, %2\n"\
- "2:\t" ASM_CLAC "\n" \
+ "2:\n" \
"\t.section .fixup, \"ax\"\n" \
"3:\tmov %3, %0\n" \
"\tjmp 2b\n" \
@@ -21970,13 +23294,13 @@ index 09b1b0a..8f56367 100644
: "i" (-EFAULT), "r" (__new), "1" (__old) \
: "memory" \
); \
-@@ -583,14 +661,14 @@ extern void __cmpxchg_wrong_size(void)
+@@ -599,14 +677,14 @@ extern void __cmpxchg_wrong_size(void)
case 4: \
{ \
- asm volatile("\t" ASM_STAC "\n" \
+ asm volatile("\n" \
- "1:\t" LOCK_PREFIX "cmpxchgl %4, %2\n" \
+ "1:\t" LOCK_PREFIX __copyuser_seg"cmpxchgl %4, %2\n"\
- "2:\t" ASM_CLAC "\n" \
+ "2:\n" \
"\t.section .fixup, \"ax\"\n" \
"3:\tmov %3, %0\n" \
"\tjmp 2b\n" \
@@ -21987,13 +23311,13 @@ index 09b1b0a..8f56367 100644
: "i" (-EFAULT), "r" (__new), "1" (__old) \
: "memory" \
); \
-@@ -602,14 +680,14 @@ extern void __cmpxchg_wrong_size(void)
+@@ -618,14 +696,14 @@ extern void __cmpxchg_wrong_size(void)
__cmpxchg_wrong_size(); \
\
- asm volatile("\t" ASM_STAC "\n" \
+ asm volatile("\n" \
- "1:\t" LOCK_PREFIX "cmpxchgq %4, %2\n" \
+ "1:\t" LOCK_PREFIX __copyuser_seg"cmpxchgq %4, %2\n"\
- "2:\t" ASM_CLAC "\n" \
+ "2:\n" \
"\t.section .fixup, \"ax\"\n" \
"3:\tmov %3, %0\n" \
"\tjmp 2b\n" \
@@ -22004,15 +23328,15 @@ index 09b1b0a..8f56367 100644
: "i" (-EFAULT), "r" (__new), "1" (__old) \
: "memory" \
); \
-@@ -618,6 +696,7 @@ extern void __cmpxchg_wrong_size(void)
- default: \
+@@ -635,6 +713,7 @@ extern void __cmpxchg_wrong_size(void)
__cmpxchg_wrong_size(); \
} \
+ __uaccess_end(); \
+ pax_close_userland(); \
*__uval = __old; \
__ret; \
})
-@@ -641,17 +720,6 @@ extern struct movsl_mask {
+@@ -658,17 +737,6 @@ extern struct movsl_mask {
#define ARCH_HAS_NOCACHE_UACCESS 1
@@ -22030,7 +23354,7 @@ index 09b1b0a..8f56367 100644
#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
# define copy_user_diag __compiletime_error
#else
-@@ -661,7 +729,7 @@ unsigned long __must_check _copy_to_user(void __user *to, const void *from,
+@@ -678,7 +746,7 @@ unsigned long __must_check _copy_to_user(void __user *to, const void *from,
extern void copy_user_diag("copy_from_user() buffer size is too small")
copy_from_user_overflow(void);
extern void copy_user_diag("copy_to_user() buffer size is too small")
@@ -22039,7 +23363,7 @@ index 09b1b0a..8f56367 100644
#undef copy_user_diag
-@@ -674,7 +742,7 @@ __copy_from_user_overflow(void) __asm__("copy_from_user_overflow");
+@@ -691,7 +759,7 @@ __copy_from_user_overflow(void) __asm__("copy_from_user_overflow");
extern void
__compiletime_warning("copy_to_user() buffer size is not provably correct")
@@ -22048,7 +23372,7 @@ index 09b1b0a..8f56367 100644
#define __copy_to_user_overflow(size, count) __copy_to_user_overflow()
#else
-@@ -689,10 +757,16 @@ __copy_from_user_overflow(int size, unsigned long count)
+@@ -706,10 +774,16 @@ __copy_from_user_overflow(int size, unsigned long count)
#endif
@@ -22066,7 +23390,7 @@ index 09b1b0a..8f56367 100644
might_fault();
-@@ -714,12 +788,15 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
+@@ -731,12 +805,15 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
* case, and do only runtime checking for non-constant sizes.
*/
@@ -22088,7 +23412,7 @@ index 09b1b0a..8f56367 100644
return n;
}
-@@ -727,17 +804,18 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
+@@ -744,17 +821,18 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
static inline unsigned long __must_check
copy_to_user(void __user *to, const void *from, unsigned long n)
{
@@ -22115,7 +23439,7 @@ index 09b1b0a..8f56367 100644
return n;
}
diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h
-index f5dcb52..da2c15b 100644
+index 3fe0eac..18dfa8b 100644
--- a/arch/x86/include/asm/uaccess_32.h
+++ b/arch/x86/include/asm/uaccess_32.h
@@ -40,9 +40,14 @@ unsigned long __must_check __copy_from_user_ll_nocache_nozero
@@ -22134,7 +23458,7 @@ index f5dcb52..da2c15b 100644
if (__builtin_constant_p(n)) {
unsigned long ret;
-@@ -87,12 +92,16 @@ static __always_inline unsigned long __must_check
+@@ -95,12 +100,16 @@ static __always_inline unsigned long __must_check
__copy_to_user(void __user *to, const void *from, unsigned long n)
{
might_fault();
@@ -22152,7 +23476,7 @@ index f5dcb52..da2c15b 100644
/* Avoid zeroing the tail if the copy fails..
* If 'n' is constant and 1, 2, or 4, we do still zero on a failure,
* but as the zeroing behaviour is only significant when n is not
-@@ -143,6 +152,12 @@ static __always_inline unsigned long
+@@ -157,6 +166,12 @@ static __always_inline unsigned long
__copy_from_user(void *to, const void __user *from, unsigned long n)
{
might_fault();
@@ -22165,7 +23489,7 @@ index f5dcb52..da2c15b 100644
if (__builtin_constant_p(n)) {
unsigned long ret;
-@@ -165,6 +180,10 @@ static __always_inline unsigned long __copy_from_user_nocache(void *to,
+@@ -185,6 +200,10 @@ static __always_inline unsigned long __copy_from_user_nocache(void *to,
const void __user *from, unsigned long n)
{
might_fault();
@@ -22176,7 +23500,7 @@ index f5dcb52..da2c15b 100644
if (__builtin_constant_p(n)) {
unsigned long ret;
-@@ -187,7 +206,10 @@ static __always_inline unsigned long
+@@ -213,7 +232,10 @@ static __always_inline unsigned long
__copy_from_user_inatomic_nocache(void *to, const void __user *from,
unsigned long n)
{
@@ -22189,7 +23513,7 @@ index f5dcb52..da2c15b 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 f2f9b39..2ae1bf8 100644
+index b89c34c..93a6bce 100644
--- a/arch/x86/include/asm/uaccess_64.h
+++ b/arch/x86/include/asm/uaccess_64.h
@@ -10,6 +10,9 @@
@@ -22213,7 +23537,7 @@ index f2f9b39..2ae1bf8 100644
{
unsigned ret;
-@@ -46,121 +49,170 @@ copy_user_generic(void *to, const void *from, unsigned len)
+@@ -46,152 +49,201 @@ copy_user_generic(void *to, const void *from, unsigned len)
}
__must_check unsigned long
@@ -22250,43 +23574,57 @@ index f2f9b39..2ae1bf8 100644
- return copy_user_generic(dst, (__force void *)src, size);
+ return copy_user_generic(dst, (__force_kernel const void *)____m(src), size);
switch (size) {
-- case 1:__get_user_asm(*(u8 *)dst, (u8 __user *)src,
-+ case 1:__get_user_asm(*(u8 *)dst, (const u8 __user *)src,
+ case 1:
+ __uaccess_begin();
+- __get_user_asm(*(u8 *)dst, (u8 __user *)src,
++ __get_user_asm(*(u8 *)dst, (const u8 __user *)src,
ret, "b", "b", "=q", 1);
+ __uaccess_end();
return ret;
-- case 2:__get_user_asm(*(u16 *)dst, (u16 __user *)src,
-+ case 2:__get_user_asm(*(u16 *)dst, (const u16 __user *)src,
+ case 2:
+ __uaccess_begin();
+- __get_user_asm(*(u16 *)dst, (u16 __user *)src,
++ __get_user_asm(*(u16 *)dst, (const u16 __user *)src,
ret, "w", "w", "=r", 2);
+ __uaccess_end();
return ret;
-- case 4:__get_user_asm(*(u32 *)dst, (u32 __user *)src,
-+ case 4:__get_user_asm(*(u32 *)dst, (const u32 __user *)src,
+ case 4:
+ __uaccess_begin();
+- __get_user_asm(*(u32 *)dst, (u32 __user *)src,
++ __get_user_asm(*(u32 *)dst, (const u32 __user *)src,
ret, "l", "k", "=r", 4);
+ __uaccess_end();
return ret;
-- case 8:__get_user_asm(*(u64 *)dst, (u64 __user *)src,
-+ case 8:__get_user_asm(*(u64 *)dst, (const u64 __user *)src,
+ case 8:
+ __uaccess_begin();
+- __get_user_asm(*(u64 *)dst, (u64 __user *)src,
++ __get_user_asm(*(u64 *)dst, (const u64 __user *)src,
ret, "q", "", "=r", 8);
+ __uaccess_end();
return ret;
case 10:
+ __uaccess_begin();
- __get_user_asm(*(u64 *)dst, (u64 __user *)src,
+ __get_user_asm(*(u64 *)dst, (const u64 __user *)src,
ret, "q", "", "=r", 10);
- if (unlikely(ret))
- return ret;
- __get_user_asm(*(u16 *)(8 + (char *)dst),
-- (u16 __user *)(8 + (char __user *)src),
-+ (const u16 __user *)(8 + (const char __user *)src),
- ret, "w", "w", "=r", 2);
+ if (likely(!ret))
+ __get_user_asm(*(u16 *)(8 + (char *)dst),
+- (u16 __user *)(8 + (char __user *)src),
++ (const u16 __user *)(8 + (const char __user *)src),
+ ret, "w", "w", "=r", 2);
+ __uaccess_end();
return ret;
case 16:
+ __uaccess_begin();
- __get_user_asm(*(u64 *)dst, (u64 __user *)src,
+ __get_user_asm(*(u64 *)dst, (const u64 __user *)src,
ret, "q", "", "=r", 16);
- if (unlikely(ret))
- return ret;
- __get_user_asm(*(u64 *)(8 + (char *)dst),
-- (u64 __user *)(8 + (char __user *)src),
-+ (const u64 __user *)(8 + (const char __user *)src),
- ret, "q", "", "=r", 8);
+ if (likely(!ret))
+ __get_user_asm(*(u64 *)(8 + (char *)dst),
+- (u64 __user *)(8 + (char __user *)src),
++ (const u64 __user *)(8 + (const char __user *)src),
+ ret, "q", "", "=r", 8);
+ __uaccess_end();
return ret;
default:
- return copy_user_generic(dst, (__force void *)src, size);
@@ -22332,43 +23670,59 @@ index f2f9b39..2ae1bf8 100644
- return copy_user_generic((__force void *)dst, src, size);
+ return copy_user_generic((__force_kernel void *)____m(dst), src, size);
switch (size) {
-- case 1:__put_user_asm(*(u8 *)src, (u8 __user *)dst,
-+ case 1:__put_user_asm(*(const u8 *)src, (u8 __user *)dst,
+ case 1:
+ __uaccess_begin();
+- __put_user_asm(*(u8 *)src, (u8 __user *)dst,
++ __put_user_asm(*(const u8 *)src, (u8 __user *)dst,
ret, "b", "b", "iq", 1);
+ __uaccess_end();
return ret;
-- case 2:__put_user_asm(*(u16 *)src, (u16 __user *)dst,
-+ case 2:__put_user_asm(*(const u16 *)src, (u16 __user *)dst,
+ case 2:
+ __uaccess_begin();
+- __put_user_asm(*(u16 *)src, (u16 __user *)dst,
++ __put_user_asm(*(const u16 *)src, (u16 __user *)dst,
ret, "w", "w", "ir", 2);
+ __uaccess_end();
return ret;
-- case 4:__put_user_asm(*(u32 *)src, (u32 __user *)dst,
-+ case 4:__put_user_asm(*(const u32 *)src, (u32 __user *)dst,
+ case 4:
+ __uaccess_begin();
+- __put_user_asm(*(u32 *)src, (u32 __user *)dst,
++ __put_user_asm(*(const u32 *)src, (u32 __user *)dst,
ret, "l", "k", "ir", 4);
+ __uaccess_end();
return ret;
-- case 8:__put_user_asm(*(u64 *)src, (u64 __user *)dst,
-+ case 8:__put_user_asm(*(const u64 *)src, (u64 __user *)dst,
+ case 8:
+ __uaccess_begin();
+- __put_user_asm(*(u64 *)src, (u64 __user *)dst,
++ __put_user_asm(*(const u64 *)src, (u64 __user *)dst,
ret, "q", "", "er", 8);
+ __uaccess_end();
return ret;
case 10:
+ __uaccess_begin();
- __put_user_asm(*(u64 *)src, (u64 __user *)dst,
+ __put_user_asm(*(const u64 *)src, (u64 __user *)dst,
ret, "q", "", "er", 10);
- if (unlikely(ret))
- return ret;
- asm("":::"memory");
-- __put_user_asm(4[(u16 *)src], 4 + (u16 __user *)dst,
-+ __put_user_asm(4[(const u16 *)src], 4 + (u16 __user *)dst,
- ret, "w", "w", "ir", 2);
+ if (likely(!ret)) {
+ asm("":::"memory");
+- __put_user_asm(4[(u16 *)src], 4 + (u16 __user *)dst,
++ __put_user_asm(4[(const u16 *)src], 4 + (u16 __user *)dst,
+ ret, "w", "w", "ir", 2);
+ }
+ __uaccess_end();
return ret;
case 16:
+ __uaccess_begin();
- __put_user_asm(*(u64 *)src, (u64 __user *)dst,
+ __put_user_asm(*(const u64 *)src, (u64 __user *)dst,
ret, "q", "", "er", 16);
- if (unlikely(ret))
- return ret;
- asm("":::"memory");
-- __put_user_asm(1[(u64 *)src], 1 + (u64 __user *)dst,
-+ __put_user_asm(1[(const u64 *)src], 1 + (u64 __user *)dst,
- ret, "q", "", "er", 8);
+ if (likely(!ret)) {
+ asm("":::"memory");
+- __put_user_asm(1[(u64 *)src], 1 + (u64 __user *)dst,
++ __put_user_asm(1[(const u64 *)src], 1 + (u64 __user *)dst,
+ ret, "q", "", "er", 8);
+ }
+ __uaccess_end();
return ret;
default:
- return copy_user_generic((__force void *)dst, src, size);
@@ -22411,39 +23765,40 @@ index f2f9b39..2ae1bf8 100644
switch (size) {
case 1: {
u8 tmp;
+ __uaccess_begin();
- __get_user_asm(tmp, (u8 __user *)src,
+ __get_user_asm(tmp, (const u8 __user *)src,
ret, "b", "b", "=q", 1);
if (likely(!ret))
__put_user_asm(tmp, (u8 __user *)dst,
-@@ -169,7 +221,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
- }
+@@ -202,7 +254,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
case 2: {
u16 tmp;
+ __uaccess_begin();
- __get_user_asm(tmp, (u16 __user *)src,
+ __get_user_asm(tmp, (const u16 __user *)src,
ret, "w", "w", "=r", 2);
if (likely(!ret))
__put_user_asm(tmp, (u16 __user *)dst,
-@@ -179,7 +231,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
-
+@@ -214,7 +266,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
case 4: {
u32 tmp;
+ __uaccess_begin();
- __get_user_asm(tmp, (u32 __user *)src,
+ __get_user_asm(tmp, (const u32 __user *)src,
ret, "l", "k", "=r", 4);
if (likely(!ret))
__put_user_asm(tmp, (u32 __user *)dst,
-@@ -188,7 +240,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
- }
+@@ -225,7 +277,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
case 8: {
u64 tmp;
+ __uaccess_begin();
- __get_user_asm(tmp, (u64 __user *)src,
+ __get_user_asm(tmp, (const u64 __user *)src,
ret, "q", "", "=r", 8);
if (likely(!ret))
__put_user_asm(tmp, (u64 __user *)dst,
-@@ -196,41 +248,58 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
+@@ -234,41 +286,58 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
return ret;
}
default:
@@ -22529,10 +23884,10 @@ 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 cd0fc0c..64e7559 100644
+index 1ae89a2..a279bf4 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
-@@ -128,7 +128,7 @@ struct x86_init_ops {
+@@ -126,7 +126,7 @@ struct x86_init_ops {
struct x86_init_timers timers;
struct x86_init_iommu iommu;
struct x86_init_pci pci;
@@ -22541,7 +23896,7 @@ index cd0fc0c..64e7559 100644
/**
* struct x86_cpuinit_ops - platform specific cpu hotplug setups
-@@ -139,7 +139,7 @@ struct x86_cpuinit_ops {
+@@ -137,7 +137,7 @@ struct x86_cpuinit_ops {
void (*setup_percpu_clockev)(void);
void (*early_percpu_clock_init)(void);
void (*fixup_cpu_id)(struct cpuinfo_x86 *c, int node);
@@ -22550,7 +23905,7 @@ index cd0fc0c..64e7559 100644
struct timespec;
-@@ -167,7 +167,7 @@ struct x86_platform_ops {
+@@ -165,7 +165,7 @@ struct x86_platform_ops {
void (*save_sched_clock_state)(void);
void (*restore_sched_clock_state)(void);
void (*apic_post_init)(void);
@@ -22559,7 +23914,7 @@ index cd0fc0c..64e7559 100644
struct pci_dev;
-@@ -176,12 +176,12 @@ struct x86_msi_ops {
+@@ -174,12 +174,12 @@ struct x86_msi_ops {
void (*teardown_msi_irq)(unsigned int irq);
void (*teardown_msi_irqs)(struct pci_dev *dev);
void (*restore_msi_irqs)(struct pci_dev *dev);
@@ -22931,10 +24286,10 @@ index 25f9093..f630040 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 2f69e3b..f301e5f 100644
+index 8a5cdda..ef3aabc 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
-@@ -171,7 +171,7 @@ int first_system_vector = FIRST_SYSTEM_VECTOR;
+@@ -177,7 +177,7 @@ int first_system_vector = FIRST_SYSTEM_VECTOR;
/*
* Debug level, exported for io_apic.c
*/
@@ -22943,7 +24298,7 @@ index 2f69e3b..f301e5f 100644
int pic_mode;
-@@ -1868,7 +1868,7 @@ static void __smp_error_interrupt(struct pt_regs *regs)
+@@ -1878,7 +1878,7 @@ static void __smp_error_interrupt(struct pt_regs *regs)
apic_write(APIC_ESR, 0);
v = apic_read(APIC_ESR);
ack_APIC_irq();
@@ -22953,7 +24308,7 @@ index 2f69e3b..f301e5f 100644
apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x",
smp_processor_id(), v);
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c
-index f92ab36..1884323 100644
+index 9968f30..b06feae 100644
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -25,7 +25,7 @@
@@ -22974,7 +24329,7 @@ index f92ab36..1884323 100644
.name = "flat",
.probe = flat_probe,
.acpi_madt_oem_check = flat_acpi_madt_oem_check,
-@@ -259,7 +259,7 @@ static int physflat_probe(void)
+@@ -249,7 +249,7 @@ static int physflat_probe(void)
return 0;
}
@@ -22984,10 +24339,10 @@ index f92ab36..1884323 100644
.name = "physical flat",
.probe = physflat_probe,
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c
-index 0d96749..ce6b722 100644
+index 331a7a0..2173347 100644
--- a/arch/x86/kernel/apic/apic_noop.c
+++ b/arch/x86/kernel/apic/apic_noop.c
-@@ -108,7 +108,7 @@ static void noop_apic_write(u32 reg, u32 v)
+@@ -109,7 +109,7 @@ static void noop_apic_write(u32 reg, u32 v)
WARN_ON_ONCE(cpu_has_apic && !disable_apic);
}
@@ -22997,10 +24352,10 @@ index 0d96749..ce6b722 100644
.probe = noop_probe,
.acpi_madt_oem_check = NULL,
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
-index 971cf88..a8e01ae 100644
+index cf9bd89..75fcb85 100644
--- a/arch/x86/kernel/apic/bigsmp_32.c
+++ b/arch/x86/kernel/apic/bigsmp_32.c
-@@ -147,7 +147,7 @@ static int probe_bigsmp(void)
+@@ -142,7 +142,7 @@ static int probe_bigsmp(void)
return dmi_bigsmp;
}
@@ -23010,7 +24365,7 @@ index 971cf88..a8e01ae 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 fdb0fbf..1426add 100644
+index fdb0fbf..352c2f0 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1682,7 +1682,7 @@ static unsigned int startup_ioapic_irq(struct irq_data *data)
@@ -23040,6 +24395,15 @@ index fdb0fbf..1426add 100644
.name = "IO-APIC",
.irq_startup = startup_ioapic_irq,
.irq_mask = mask_ioapic_irq,
+@@ -1878,7 +1878,7 @@ static struct irq_chip ioapic_chip __read_mostly = {
+ .flags = IRQCHIP_SKIP_SET_WAKE,
+ };
+
+-static struct irq_chip ioapic_ir_chip __read_mostly = {
++static struct irq_chip ioapic_ir_chip = {
+ .name = "IR-IO-APIC",
+ .irq_startup = startup_ioapic_irq,
+ .irq_mask = mask_ioapic_irq,
@@ -1936,7 +1936,7 @@ static void ack_lapic_irq(struct irq_data *data)
ack_APIC_irq();
}
@@ -23050,10 +24414,10 @@ index fdb0fbf..1426add 100644
.irq_mask = mask_lapic_irq,
.irq_unmask = unmask_lapic_irq,
diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
-index 5f1feb6..199d454 100644
+index ade2532..5fc7f4f9 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
-@@ -267,7 +267,7 @@ static void hpet_msi_write_msg(struct irq_data *data, struct msi_msg *msg)
+@@ -269,7 +269,7 @@ static void hpet_msi_write_msg(struct irq_data *data, struct msi_msg *msg)
hpet_msi_write(irq_data_get_irq_handler_data(data), msg);
}
@@ -23063,7 +24427,7 @@ index 5f1feb6..199d454 100644
.irq_unmask = hpet_msi_unmask,
.irq_mask = hpet_msi_mask,
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c
-index 7694ae6..5abb08e 100644
+index f316e34..48c21c5 100644
--- a/arch/x86/kernel/apic/probe_32.c
+++ b/arch/x86/kernel/apic/probe_32.c
@@ -72,7 +72,7 @@ static int probe_default(void)
@@ -23075,7 +24439,7 @@ index 7694ae6..5abb08e 100644
.name = "default",
.probe = probe_default,
-@@ -126,7 +126,7 @@ static struct apic apic_default = {
+@@ -127,7 +127,7 @@ static struct apic apic_default = {
apic_driver(apic_default);
@@ -23085,10 +24449,10 @@ index 7694ae6..5abb08e 100644
static int cmdline_apic __initdata;
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
-index 7af2505..d1ea63f 100644
+index ad59d70..c3570b7 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
-@@ -36,6 +36,7 @@ static struct irq_chip lapic_controller;
+@@ -37,6 +37,7 @@ static struct irq_chip lapic_controller;
static struct apic_chip_data *legacy_irq_data[NR_IRQS_LEGACY];
#endif
@@ -23096,7 +24460,7 @@ index 7af2505..d1ea63f 100644
void lock_vector_lock(void)
{
/* Used to the online set of cpus does not change
-@@ -44,6 +45,7 @@ void lock_vector_lock(void)
+@@ -45,6 +46,7 @@ void lock_vector_lock(void)
raw_spin_lock(&vector_lock);
}
@@ -23105,10 +24469,10 @@ index 7af2505..d1ea63f 100644
{
raw_spin_unlock(&vector_lock);
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
-index cc8311c..d72f027 100644
+index aca8b75..4c1a7f5 100644
--- a/arch/x86/kernel/apic/x2apic_cluster.c
+++ b/arch/x86/kernel/apic/x2apic_cluster.c
-@@ -234,7 +234,7 @@ static void cluster_vector_allocation_domain(int cpu, struct cpumask *retmask,
+@@ -242,7 +242,7 @@ static void cluster_vector_allocation_domain(int cpu, struct cpumask *retmask,
cpumask_and(retmask, mask, per_cpu(cpus_in_cluster, cpu));
}
@@ -23118,10 +24482,10 @@ index cc8311c..d72f027 100644
.name = "cluster x2apic",
.probe = x2apic_cluster_probe,
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
-index 662e915..e721634 100644
+index a1242e2..0e7f712 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
-@@ -90,7 +90,7 @@ static int x2apic_phys_probe(void)
+@@ -98,7 +98,7 @@ static int x2apic_phys_probe(void)
return apic == &apic_x2apic_phys;
}
@@ -23131,7 +24495,7 @@ index 662e915..e721634 100644
.name = "physical x2apic",
.probe = x2apic_phys_probe,
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
-index 4a13946..067ed8c 100644
+index 624db005..86c508a 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -374,7 +374,7 @@ static int uv_probe(void)
@@ -23228,7 +24592,7 @@ index 052c9c3..bc22ccdba 100644
proc_create("apm", 0, NULL, &apm_file_ops);
diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
-index 439df97..884bc37 100644
+index 84a7524..e8edc49 100644
--- a/arch/x86/kernel/asm-offsets.c
+++ b/arch/x86/kernel/asm-offsets.c
@@ -32,6 +32,8 @@ void common(void) {
@@ -23240,8 +24604,8 @@ index 439df97..884bc37 100644
BLANK();
OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
-@@ -70,8 +72,26 @@ void common(void) {
- #endif
+@@ -67,8 +69,26 @@ void common(void) {
+ OFFSET(PV_CPU_iret, pv_cpu_ops, iret);
OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0);
OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2);
+
@@ -23268,10 +24632,10 @@ index 439df97..884bc37 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 d8f42f9..a46f1fc 100644
+index f2edafb..460f4e6 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
-@@ -59,6 +59,7 @@ int main(void)
+@@ -58,6 +58,7 @@ int main(void)
BLANK();
#undef ENTRY
@@ -23295,10 +24659,10 @@ index 5803130..c899b3d 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 a8816b3..a9c0bf8 100644
+index a07956a..368a2eb 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -767,7 +767,7 @@ static void init_amd(struct cpuinfo_x86 *c)
+@@ -766,7 +766,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) */
@@ -23328,7 +24692,7 @@ index 04f0fe5..3c0598c 100644
/*
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
-index c2b7522..a9a9453 100644
+index 37830de..54677f5 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -92,60 +92,6 @@ static const struct cpu_dev default_cpu = {
@@ -23511,7 +24875,7 @@ index c2b7522..a9a9453 100644
gdt_descr.size = GDT_SIZE - 1;
load_gdt(&gdt_descr);
/* Reload the per-cpu base */
-@@ -919,6 +968,20 @@ static void identify_cpu(struct cpuinfo_x86 *c)
+@@ -916,6 +965,20 @@ static void identify_cpu(struct cpuinfo_x86 *c)
setup_smep(c);
setup_smap(c);
@@ -23532,7 +24896,7 @@ index c2b7522..a9a9453 100644
/*
* The vendor-specific functions might have changed features.
* Now we do "generic changes."
-@@ -993,7 +1056,7 @@ void enable_sep_cpu(void)
+@@ -990,7 +1053,7 @@ void enable_sep_cpu(void)
int cpu;
cpu = get_cpu();
@@ -23541,7 +24905,7 @@ index c2b7522..a9a9453 100644
if (!boot_cpu_has(X86_FEATURE_SEP))
goto out;
-@@ -1139,10 +1202,12 @@ static __init int setup_disablecpuid(char *arg)
+@@ -1136,10 +1199,12 @@ static __init int setup_disablecpuid(char *arg)
}
__setup("clearcpuid=", setup_disablecpuid);
@@ -23557,7 +24921,7 @@ index c2b7522..a9a9453 100644
DEFINE_PER_CPU_FIRST(union irq_stack_union,
irq_stack_union) __aligned(PAGE_SIZE) __visible;
-@@ -1254,21 +1319,21 @@ EXPORT_PER_CPU_SYMBOL(current_task);
+@@ -1251,21 +1316,21 @@ EXPORT_PER_CPU_SYMBOL(current_task);
DEFINE_PER_CPU(int, __preempt_count) = INIT_PREEMPT_COUNT;
EXPORT_PER_CPU_SYMBOL(__preempt_count);
@@ -23586,7 +24950,7 @@ index c2b7522..a9a9453 100644
/*
* Clear all 6 debug registers:
*/
-@@ -1344,7 +1409,7 @@ void cpu_init(void)
+@@ -1341,7 +1406,7 @@ void cpu_init(void)
*/
load_ucode_ap();
@@ -23595,7 +24959,7 @@ index c2b7522..a9a9453 100644
oist = &per_cpu(orig_ist, cpu);
#ifdef CONFIG_NUMA
-@@ -1376,7 +1441,6 @@ void cpu_init(void)
+@@ -1373,7 +1438,6 @@ void cpu_init(void)
wrmsrl(MSR_KERNEL_GS_BASE, 0);
barrier();
@@ -23603,7 +24967,7 @@ index c2b7522..a9a9453 100644
x2apic_setup();
/*
-@@ -1428,7 +1492,7 @@ void cpu_init(void)
+@@ -1425,7 +1489,7 @@ void cpu_init(void)
{
int cpu = smp_processor_id();
struct task_struct *curr = current;
@@ -23613,7 +24977,7 @@ index c2b7522..a9a9453 100644
wait_for_master_cpu(cpu);
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
-index e38d338..48498df 100644
+index 0b6c523..54d8406 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -519,25 +519,23 @@ cache_private_attrs_is_visible(struct kobject *kobj,
@@ -23665,7 +25029,7 @@ index e38d338..48498df 100644
return &cache_private_group;
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
-index 7e8a736..c00fc59 100644
+index a006f4c..9c0afe2 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -47,6 +47,7 @@
@@ -23676,7 +25040,7 @@ index 7e8a736..c00fc59 100644
#include "mce-internal.h"
-@@ -212,8 +213,7 @@ static struct notifier_block mce_srao_nb;
+@@ -211,8 +212,7 @@ static struct notifier_block mce_srao_nb;
void mce_register_decode_chain(struct notifier_block *nb)
{
/* Ensure SRAO notifier has the highest priority in the decode chain. */
@@ -23686,7 +25050,7 @@ index 7e8a736..c00fc59 100644
atomic_notifier_chain_register(&x86_mce_decoder_chain, nb);
}
-@@ -237,7 +237,7 @@ static void print_mce(struct mce *m)
+@@ -236,7 +236,7 @@ static void print_mce(struct mce *m)
!(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "",
m->cs, m->ip);
@@ -23695,7 +25059,7 @@ index 7e8a736..c00fc59 100644
print_symbol("{%s}", m->ip);
pr_cont("\n");
}
-@@ -270,10 +270,10 @@ static void print_mce(struct mce *m)
+@@ -269,10 +269,10 @@ static void print_mce(struct mce *m)
#define PANIC_TIMEOUT 5 /* 5 seconds */
@@ -23708,7 +25072,7 @@ index 7e8a736..c00fc59 100644
/* Panic in progress. Enable interrupts and wait for final IPI */
static void wait_for_panic(void)
-@@ -297,7 +297,7 @@ static void mce_panic(const char *msg, struct mce *final, char *exp)
+@@ -296,7 +296,7 @@ static void mce_panic(const char *msg, struct mce *final, char *exp)
/*
* Make sure only one CPU runs in machine check panic
*/
@@ -23717,7 +25081,7 @@ index 7e8a736..c00fc59 100644
wait_for_panic();
barrier();
-@@ -305,7 +305,7 @@ static void mce_panic(const char *msg, struct mce *final, char *exp)
+@@ -304,7 +304,7 @@ static void mce_panic(const char *msg, struct mce *final, char *exp)
console_verbose();
} else {
/* Don't log too much for fake panic */
@@ -23726,7 +25090,7 @@ index 7e8a736..c00fc59 100644
return;
}
/* First print corrected ones that are still unlogged */
-@@ -344,7 +344,7 @@ static void mce_panic(const char *msg, struct mce *final, char *exp)
+@@ -343,7 +343,7 @@ static void mce_panic(const char *msg, struct mce *final, char *exp)
if (!fake_panic) {
if (panic_timeout == 0)
panic_timeout = mca_cfg.panic_timeout;
@@ -23735,7 +25099,7 @@ index 7e8a736..c00fc59 100644
} else
pr_emerg(HW_ERR "Fake kernel panic: %s\n", msg);
}
-@@ -697,7 +697,7 @@ static int mce_timed_out(u64 *t, const char *msg)
+@@ -717,7 +717,7 @@ static int mce_timed_out(u64 *t, const char *msg)
* might have been modified by someone else.
*/
rmb();
@@ -23744,7 +25108,7 @@ index 7e8a736..c00fc59 100644
wait_for_panic();
if (!mca_cfg.monarch_timeout)
goto out;
-@@ -1669,7 +1669,7 @@ static void unexpected_machine_check(struct pt_regs *regs, long error_code)
+@@ -1671,7 +1671,7 @@ static void unexpected_machine_check(struct pt_regs *regs, long error_code)
}
/* Call the installed machine check handler for this CPU setup. */
@@ -23753,7 +25117,7 @@ index 7e8a736..c00fc59 100644
unexpected_machine_check;
/*
-@@ -1698,7 +1698,9 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)
+@@ -1700,7 +1700,9 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)
return;
}
@@ -23763,7 +25127,7 @@ index 7e8a736..c00fc59 100644
__mcheck_cpu_init_generic();
__mcheck_cpu_init_vendor(c);
-@@ -1729,7 +1731,7 @@ void mcheck_cpu_clear(struct cpuinfo_x86 *c)
+@@ -1731,7 +1733,7 @@ void mcheck_cpu_clear(struct cpuinfo_x86 *c)
*/
static DEFINE_SPINLOCK(mce_chrdev_state_lock);
@@ -23772,7 +25136,7 @@ index 7e8a736..c00fc59 100644
static int mce_chrdev_open_exclu; /* already open exclusive? */
static int mce_chrdev_open(struct inode *inode, struct file *file)
-@@ -1737,7 +1739,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
+@@ -1739,7 +1741,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
spin_lock(&mce_chrdev_state_lock);
if (mce_chrdev_open_exclu ||
@@ -23781,7 +25145,7 @@ index 7e8a736..c00fc59 100644
spin_unlock(&mce_chrdev_state_lock);
return -EBUSY;
-@@ -1745,7 +1747,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
+@@ -1747,7 +1749,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
if (file->f_flags & O_EXCL)
mce_chrdev_open_exclu = 1;
@@ -23790,7 +25154,7 @@ index 7e8a736..c00fc59 100644
spin_unlock(&mce_chrdev_state_lock);
-@@ -1756,7 +1758,7 @@ static int mce_chrdev_release(struct inode *inode, struct file *file)
+@@ -1758,7 +1760,7 @@ static int mce_chrdev_release(struct inode *inode, struct file *file)
{
spin_lock(&mce_chrdev_state_lock);
@@ -23799,7 +25163,7 @@ index 7e8a736..c00fc59 100644
mce_chrdev_open_exclu = 0;
spin_unlock(&mce_chrdev_state_lock);
-@@ -2446,7 +2448,7 @@ static __init void mce_init_banks(void)
+@@ -2448,7 +2450,7 @@ static __init void mce_init_banks(void)
for (i = 0; i < mca_cfg.banks; i++) {
struct mce_bank *b = &mce_banks[i];
@@ -23808,7 +25172,7 @@ index 7e8a736..c00fc59 100644
sysfs_attr_init(&a->attr);
a->attr.name = b->attrname;
-@@ -2553,7 +2555,7 @@ struct dentry *mce_get_debugfs_dir(void)
+@@ -2555,7 +2557,7 @@ struct dentry *mce_get_debugfs_dir(void)
static void mce_reset(void)
{
cpu_missing = 0;
@@ -23862,10 +25226,10 @@ index 01dd870..6fd1c59 100644
wmb();
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
-index ac8975a..37d9aa6 100644
+index 4f4735b..05b4ca6 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
-@@ -1016,13 +1016,13 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device,
+@@ -1012,13 +1012,13 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device,
static int get_ucode_user(void *to, const void *from, size_t n)
{
@@ -23895,7 +25259,7 @@ index 20e242e..14b1629 100644
.detect = ms_hyperv_platform,
.init_platform = ms_hyperv_init_platform,
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
-index 3b533cf..b40d426 100644
+index c870af1..173e1cc 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -723,7 +723,8 @@ static DEFINE_RAW_SPINLOCK(set_atomicity_lock);
@@ -23919,7 +25283,7 @@ index 3b533cf..b40d426 100644
/* Flush TLBs (no need to flush caches - they are disabled) */
count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
-index f891b47..9dff300 100644
+index 5c3d149..a052b18 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -72,7 +72,7 @@ static DEFINE_MUTEX(mtrr_mutex);
@@ -23945,10 +25309,10 @@ index 951884d..4796b75 100644
extern int generic_get_free_region(unsigned long base, unsigned long size,
int replace_reg);
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
-index a3aeb2c..935e1d7 100644
+index 6532f5b..5de6c88 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
-@@ -1531,7 +1531,7 @@ static void __init pmu_check_apic(void)
+@@ -1534,7 +1534,7 @@ static void __init pmu_check_apic(void)
}
@@ -23957,7 +25321,7 @@ index a3aeb2c..935e1d7 100644
.name = "format",
.attrs = NULL,
};
-@@ -1630,7 +1630,7 @@ static struct attribute *events_attr[] = {
+@@ -1642,7 +1642,7 @@ static struct attribute *events_attr[] = {
NULL,
};
@@ -23966,7 +25330,7 @@ index a3aeb2c..935e1d7 100644
.name = "events",
.attrs = events_attr,
};
-@@ -2216,7 +2216,7 @@ valid_user_frame(const void __user *fp, unsigned long size)
+@@ -2228,7 +2228,7 @@ valid_user_frame(const void __user *fp, unsigned long size)
static unsigned long get_segment_base(unsigned int segment)
{
struct desc_struct *desc;
@@ -23975,7 +25339,7 @@ index a3aeb2c..935e1d7 100644
if ((segment & SEGMENT_TI_MASK) == SEGMENT_LDT) {
#ifdef CONFIG_MODIFY_LDT_SYSCALL
-@@ -2238,7 +2238,7 @@ static unsigned long get_segment_base(unsigned int segment)
+@@ -2250,7 +2250,7 @@ static unsigned long get_segment_base(unsigned int segment)
if (idx > GDT_ENTRIES)
return 0;
@@ -23984,20 +25348,20 @@ index a3aeb2c..935e1d7 100644
}
return get_desc_base(desc);
-@@ -2328,7 +2328,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
+@@ -2355,7 +2355,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
break;
perf_callchain_store(entry, frame.return_address);
-- fp = frame.next_frame;
-+ fp = (const void __force_user *)frame.next_frame;
+- fp = (void __user *)frame.next_frame;
++ fp = (void __force_user *)frame.next_frame;
}
+ pagefault_enable();
}
-
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
-index ee70445..7c6859c 100644
+index 98be6d6..b44c81a 100644
--- a/arch/x86/kernel/cpu/perf_event.h
+++ b/arch/x86/kernel/cpu/perf_event.h
-@@ -792,7 +792,7 @@ static inline void set_linear_ip(struct pt_regs *regs, unsigned long ip)
+@@ -787,7 +787,7 @@ static inline void set_linear_ip(struct pt_regs *regs, unsigned long ip)
regs->cs = kernel_ip(ip) ? __KERNEL_CS : __USER_CS;
if (regs->flags & X86_VM_MASK)
regs->flags ^= (PERF_EFLAGS_VM | X86_VM_MASK);
@@ -24007,9 +25371,25 @@ index ee70445..7c6859c 100644
ssize_t x86_event_sysfs_show(char *page, u64 config, u64 event);
diff --git a/arch/x86/kernel/cpu/perf_event_amd_iommu.c b/arch/x86/kernel/cpu/perf_event_amd_iommu.c
-index 97242a9..cf9c30e 100644
+index 97242a9..ba15e8c 100644
--- a/arch/x86/kernel/cpu/perf_event_amd_iommu.c
+++ b/arch/x86/kernel/cpu/perf_event_amd_iommu.c
+@@ -80,12 +80,12 @@ static struct attribute_group amd_iommu_format_group = {
+ * sysfs events attributes
+ *---------------------------------------------*/
+ struct amd_iommu_event_desc {
+- struct kobj_attribute attr;
++ struct device_attribute attr;
+ const char *event;
+ };
+
+-static ssize_t _iommu_event_show(struct kobject *kobj,
+- struct kobj_attribute *attr, char *buf)
++static ssize_t _iommu_event_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ struct amd_iommu_event_desc *event =
+ container_of(attr, struct amd_iommu_event_desc, attr);
@@ -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)
{
@@ -24020,10 +25400,10 @@ index 97242a9..cf9c30e 100644
while (amd_iommu_v2_event_descs[i].attr.attr.name)
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
-index 078de2e..7ac50e5 100644
+index 760aec1..3c64694 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
-@@ -2140,6 +2140,8 @@ __intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
+@@ -2185,6 +2185,8 @@ __intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
}
static void
@@ -24032,7 +25412,7 @@ index 078de2e..7ac50e5 100644
intel_start_scheduling(struct cpu_hw_events *cpuc)
{
struct intel_excl_cntrs *excl_cntrs = cpuc->excl_cntrs;
-@@ -2149,14 +2151,18 @@ intel_start_scheduling(struct cpu_hw_events *cpuc)
+@@ -2194,14 +2196,18 @@ intel_start_scheduling(struct cpu_hw_events *cpuc)
/*
* nothing needed if in group validation mode
*/
@@ -24053,7 +25433,7 @@ index 078de2e..7ac50e5 100644
xl = &excl_cntrs->states[tid];
-@@ -2196,6 +2202,8 @@ static void intel_commit_scheduling(struct cpu_hw_events *cpuc, int idx, int cnt
+@@ -2241,6 +2247,8 @@ static void intel_commit_scheduling(struct cpu_hw_events *cpuc, int idx, int cnt
}
static void
@@ -24062,7 +25442,7 @@ index 078de2e..7ac50e5 100644
intel_stop_scheduling(struct cpu_hw_events *cpuc)
{
struct intel_excl_cntrs *excl_cntrs = cpuc->excl_cntrs;
-@@ -2205,13 +2213,18 @@ intel_stop_scheduling(struct cpu_hw_events *cpuc)
+@@ -2250,13 +2258,18 @@ intel_stop_scheduling(struct cpu_hw_events *cpuc)
/*
* nothing needed if in group validation mode
*/
@@ -24083,7 +25463,7 @@ index 078de2e..7ac50e5 100644
xl = &excl_cntrs->states[tid];
-@@ -2394,19 +2407,22 @@ static void intel_put_excl_constraints(struct cpu_hw_events *cpuc,
+@@ -2439,19 +2452,22 @@ static void intel_put_excl_constraints(struct cpu_hw_events *cpuc,
* unused now.
*/
if (hwc->idx >= 0) {
@@ -24108,7 +25488,7 @@ index 078de2e..7ac50e5 100644
raw_spin_unlock(&excl_cntrs->lock);
}
}
-@@ -3279,10 +3295,10 @@ __init int intel_pmu_init(void)
+@@ -3360,10 +3376,10 @@ __init int intel_pmu_init(void)
x86_pmu.num_counters_fixed = max((int)edx.split.num_counters_fixed, 3);
if (boot_cpu_has(X86_FEATURE_PDCM)) {
@@ -24169,7 +25549,7 @@ index a316ca9..99344f4 100644
ret = intel_cqm_setup_rmid_cache();
if (ret)
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
-index 7abb2b8..ea24517 100644
+index 9551401..649b91c 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -598,7 +598,7 @@ int intel_pmu_drain_bts_buffer(void)
@@ -24181,7 +25561,7 @@ index 7abb2b8..ea24517 100644
x86_pmu.drain_pebs(&regs);
}
-@@ -869,7 +869,7 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs)
+@@ -876,7 +876,7 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs)
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
unsigned long from = cpuc->lbr_entries[0].from;
unsigned long old_to, to = cpuc->lbr_entries[0].to;
@@ -24190,7 +25570,7 @@ index 7abb2b8..ea24517 100644
int is_64bit = 0;
void *kaddr;
int size;
-@@ -921,6 +921,7 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs)
+@@ -928,6 +928,7 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs)
} else {
kaddr = (void *)to;
}
@@ -24198,7 +25578,7 @@ index 7abb2b8..ea24517 100644
do {
struct insn insn;
-@@ -1069,7 +1070,7 @@ static void setup_pebs_sample_data(struct perf_event *event,
+@@ -1076,7 +1077,7 @@ static void setup_pebs_sample_data(struct perf_event *event,
}
if (event->attr.precise_ip > 1 && x86_pmu.intel_cap.pebs_format >= 2) {
@@ -24208,10 +25588,10 @@ index 7abb2b8..ea24517 100644
} else if (event->attr.precise_ip > 1 && intel_pmu_pebs_fixup_ip(regs))
regs->flags |= PERF_EFLAGS_EXACT;
diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c
-index 659f01e..ef67d60 100644
+index 653f88d..11b6b78 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c
-@@ -686,7 +686,7 @@ static int branch_type(unsigned long from, unsigned long to, int abort)
+@@ -704,7 +704,7 @@ static int branch_type(unsigned long from, unsigned long to, int abort)
* Ensure we don't blindy read any address by validating it is
* a known text address.
*/
@@ -24220,7 +25600,7 @@ index 659f01e..ef67d60 100644
addr = (void *)from;
/*
* Assume we can get the maximum possible size
-@@ -708,7 +708,7 @@ static int branch_type(unsigned long from, unsigned long to, int abort)
+@@ -726,7 +726,7 @@ static int branch_type(unsigned long from, unsigned long to, int abort)
#ifdef CONFIG_X86_64
is64 = kernel_ip((unsigned long)addr) || !test_thread_flag(TIF_IA32);
#endif
@@ -24230,10 +25610,10 @@ index 659f01e..ef67d60 100644
if (!insn.opcode.got)
return X86_BR_ABORT;
diff --git a/arch/x86/kernel/cpu/perf_event_intel_pt.c b/arch/x86/kernel/cpu/perf_event_intel_pt.c
-index 868e119..be39b45 100644
+index c0bbd10..727ae15e 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_pt.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_pt.c
-@@ -132,14 +132,10 @@ static const struct attribute_group *pt_attr_groups[] = {
+@@ -133,14 +133,10 @@ static const struct attribute_group *pt_attr_groups[] = {
static int __init pt_pmu_hw_init(void)
{
@@ -24250,7 +25630,7 @@ index 868e119..be39b45 100644
for (i = 0; i < PT_CPUID_LEAVES; i++) {
cpuid_count(20, i,
&pt_pmu.caps[CR_EAX + i*PT_CPUID_REGS_NUM],
-@@ -148,39 +144,25 @@ static int __init pt_pmu_hw_init(void)
+@@ -149,39 +145,25 @@ static int __init pt_pmu_hw_init(void)
&pt_pmu.caps[CR_EDX + i*PT_CPUID_REGS_NUM]);
}
@@ -24298,7 +25678,7 @@ index 868e119..be39b45 100644
}
#define RTIT_CTL_CYC_PSB (RTIT_CTL_CYCLEACC | \
-@@ -996,7 +978,7 @@ static void pt_event_start(struct perf_event *event, int mode)
+@@ -997,7 +979,7 @@ static void pt_event_start(struct perf_event *event, int mode)
return;
}
@@ -24307,7 +25687,7 @@ index 868e119..be39b45 100644
event->hw.state = 0;
pt_config_buffer(buf->cur->table, buf->cur_idx,
-@@ -1012,7 +994,7 @@ static void pt_event_stop(struct perf_event *event, int mode)
+@@ -1013,7 +995,7 @@ static void pt_event_stop(struct perf_event *event, int mode)
* Protect against the PMI racing with disabling wrmsr,
* see comment in intel_pt_interrupt().
*/
@@ -24317,10 +25697,28 @@ index 868e119..be39b45 100644
if (event->hw.state == PERF_HES_STOPPED)
diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
-index ed446bd..413b10e 100644
+index 24a351a..d429cd7 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
-@@ -496,7 +496,7 @@ static struct attribute *rapl_events_knl_attr[] = {
+@@ -97,14 +97,14 @@ static const char *const rapl_domain_names[NR_RAPL_DOMAINS] __initconst = {
+ #define RAPL_EVENT_MASK 0xFFULL
+
+ #define DEFINE_RAPL_FORMAT_ATTR(_var, _name, _format) \
+-static ssize_t __rapl_##_var##_show(struct kobject *kobj, \
+- struct kobj_attribute *attr, \
++static ssize_t __rapl_##_var##_show(struct device *dev, \
++ struct device_attribute *attr, \
+ char *page) \
+ { \
+ BUILD_BUG_ON(sizeof(_format) >= PAGE_SIZE); \
+ return sprintf(page, _format "\n"); \
+ } \
+-static struct kobj_attribute format_attr_##_var = \
++static struct device_attribute format_attr_##_var = \
+ __ATTR(_name, 0444, __rapl_##_var##_show, NULL)
+
+ #define RAPL_CNTR_WIDTH 32 /* 32-bit rapl counters */
+@@ -483,7 +483,7 @@ static struct attribute *rapl_events_knl_attr[] = {
NULL,
};
@@ -24330,9 +25728,20 @@ index ed446bd..413b10e 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 61215a6..ceee0e5 100644
+index 3bf41d4..b5dc2c2 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+@@ -74,8 +74,8 @@ end:
+ return map;
+ }
+
+-ssize_t uncore_event_show(struct kobject *kobj,
+- struct kobj_attribute *attr, char *buf)
++ssize_t uncore_event_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ struct uncore_event_desc *event =
+ container_of(attr, struct uncore_event_desc, attr);
@@ -785,7 +785,7 @@ static void __init uncore_types_exit(struct intel_uncore_type **types)
static int __init uncore_type_init(struct intel_uncore_type *type)
{
@@ -24343,18 +25752,50 @@ index 61215a6..ceee0e5 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 2f0a4a9..8f4b802 100644
+index a7086b8..ccac9b1 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.h
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.h
-@@ -115,7 +115,7 @@ struct intel_uncore_box {
+@@ -113,9 +113,9 @@ struct intel_uncore_box {
+ #define UNCORE_BOX_FLAG_INITIATED 0
+
struct uncore_event_desc {
- struct kobj_attribute attr;
+- struct kobj_attribute attr;
++ struct device_attribute attr;
const char *config;
-};
+} __do_const;
struct pci2phy_map {
struct list_head list;
+@@ -126,8 +126,8 @@ struct pci2phy_map {
+ int uncore_pcibus_to_physid(struct pci_bus *bus);
+ struct pci2phy_map *__find_pci2phy_map(int segment);
+
+-ssize_t uncore_event_show(struct kobject *kobj,
+- struct kobj_attribute *attr, char *buf);
++ssize_t uncore_event_show(struct device *dev,
++ struct device_attribute *attr, char *buf);
+
+ #define INTEL_UNCORE_EVENT_DESC(_name, _config) \
+ { \
+@@ -136,14 +136,14 @@ ssize_t uncore_event_show(struct kobject *kobj,
+ }
+
+ #define DEFINE_UNCORE_FORMAT_ATTR(_var, _name, _format) \
+-static ssize_t __uncore_##_var##_show(struct kobject *kobj, \
+- struct kobj_attribute *attr, \
++static ssize_t __uncore_##_var##_show(struct device *dev, \
++ struct device_attribute *attr, \
+ char *page) \
+ { \
+ BUILD_BUG_ON(sizeof(_format) >= PAGE_SIZE); \
+ return sprintf(page, _format "\n"); \
+ } \
+-static struct kobj_attribute format_attr_##_var = \
++static struct device_attribute format_attr_##_var = \
+ __ATTR(_name, 0444, __uncore_##_var##_show, NULL)
+
+ static inline unsigned uncore_pci_box_ctl(struct intel_uncore_box *box)
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 628a059..83bced6 100644
--- a/arch/x86/kernel/cpu/vmware.c
@@ -24627,7 +26068,7 @@ index 464ffd6..01f2cda 100644
+EXPORT_SYMBOL(pax_check_alloca);
+#endif
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
-index 5f1c626..14b4999 100644
+index 5f1c626..059e830 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -153,12 +153,12 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
@@ -24681,7 +26122,7 @@ index 5f1c626..14b4999 100644
* exception stack:
*/
+ if ((u16)stack_end[-1] != __KERNEL_DS)
-+ break;
++ goto out;
stack = (unsigned long *) stack_end[-2];
done = 0;
break;
@@ -24695,7 +26136,7 @@ index 5f1c626..14b4999 100644
ops, data, stack_end, &graph);
/*
* We link to the next stack (which would be
-@@ -237,10 +239,6 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+@@ -237,10 +239,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
}
}
@@ -24703,10 +26144,11 @@ index 5f1c626..14b4999 100644
- * This handles the process stack:
- */
- bp = ops->walk_stack(tinfo, stack, bp, ops, data, NULL, &graph);
++out:
put_cpu();
}
EXPORT_SYMBOL(dump_trace);
-@@ -347,8 +345,55 @@ int is_valid_bugaddr(unsigned long ip)
+@@ -347,8 +346,55 @@ int is_valid_bugaddr(unsigned long ip)
{
unsigned short ud2;
@@ -24888,7 +26330,7 @@ index 4d38416..ec7cc4e 100644
unlock_done:
mutex_unlock(&espfix_init_mutex);
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
-index d25097c..4c36ff6 100644
+index d5804ad..4c36ff6 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -127,7 +127,7 @@ void __kernel_fpu_end(void)
@@ -24954,19 +26396,7 @@ index d25097c..4c36ff6 100644
fpu->counter++;
kernel_fpu_enable();
}
-@@ -409,8 +409,10 @@ static inline void copy_init_fpstate_to_fpregs(void)
- {
- if (use_xsave())
- copy_kernel_to_xregs(&init_fpstate.xsave, -1);
-- else
-+ else if (static_cpu_has(X86_FEATURE_FXSR))
- copy_kernel_to_fxregs(&init_fpstate.fxsave);
-+ else
-+ copy_kernel_to_fregs(&init_fpstate.fsave);
- }
-
- /*
-@@ -442,25 +444,25 @@ void fpu__clear(struct fpu *fpu)
+@@ -444,25 +444,25 @@ void fpu__clear(struct fpu *fpu)
static inline unsigned short get_fpu_cwd(struct fpu *fpu)
{
if (cpu_has_fxsr) {
@@ -24998,10 +26428,10 @@ index d25097c..4c36ff6 100644
return MXCSR_DEFAULT;
}
diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c
-index be39b5f..1095798 100644
+index bd08fb7..dc29a0a 100644
--- a/arch/x86/kernel/fpu/init.c
+++ b/arch/x86/kernel/fpu/init.c
-@@ -42,7 +42,7 @@ static void fpu__init_cpu_generic(void)
+@@ -45,7 +45,7 @@ static void fpu__init_cpu_generic(void)
/* Flush out any pending x87 state: */
#ifdef CONFIG_MATH_EMULATION
if (!cpu_has_fpu)
@@ -25010,22 +26440,22 @@ index be39b5f..1095798 100644
else
#endif
asm volatile ("fninit");
-@@ -129,7 +129,7 @@ static void __init fpu__init_system_generic(void)
- * Set up the legacy init FPU context. (xstate init might overwrite this
- * with a more modern format, if the CPU supports it.)
- */
-- fpstate_init_fxstate(&init_fpstate.fxsave);
-+ fpstate_init(&init_fpstate);
-
- fpu__init_system_mxcsr();
- }
-@@ -143,42 +143,7 @@ static void __init fpu__init_system_generic(void)
+@@ -148,51 +148,7 @@ static void __init fpu__init_system_generic(void)
unsigned int xstate_size;
EXPORT_SYMBOL_GPL(xstate_size);
--/* Enforce that 'MEMBER' is the last field of 'TYPE': */
+-/* Get alignment of the TYPE. */
+-#define TYPE_ALIGN(TYPE) offsetof(struct { char x; TYPE test; }, test)
+-
+-/*
+- * Enforce that 'MEMBER' is the last field of 'TYPE'.
+- *
+- * Align the computed size with alignment of the TYPE,
+- * because that's how C aligns structs.
+- */
-#define CHECK_MEMBER_AT_END_OF(TYPE, MEMBER) \
-- BUILD_BUG_ON(sizeof(TYPE) != offsetofend(TYPE, MEMBER))
+- BUILD_BUG_ON(sizeof(TYPE) != ALIGN(offsetofend(TYPE, MEMBER), \
+- TYPE_ALIGN(TYPE)))
-
-/*
- * We append the 'struct fpu' to the task_struct:
@@ -25063,7 +26493,7 @@ index be39b5f..1095798 100644
/*
* Set up the xstate_size based on the legacy FPU context size.
-@@ -331,7 +296,6 @@ void __init fpu__init_system(struct cpuinfo_x86 *c)
+@@ -400,7 +356,6 @@ void __init fpu__init_system(struct cpuinfo_x86 *c)
fpu__init_system_generic();
fpu__init_system_xstate_size_legacy();
fpu__init_system_xstate();
@@ -25261,10 +26691,10 @@ index 31c6a60..523f27e 100644
} else {
sanitize_restored_xstate(tsk, &env, xfeatures, fx_only);
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
-index 70fc312..30dfd14 100644
+index d425cda5..011b570 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
-@@ -109,14 +109,14 @@ EXPORT_SYMBOL_GPL(cpu_has_xfeatures);
+@@ -110,14 +110,14 @@ EXPORT_SYMBOL_GPL(cpu_has_xfeatures);
*/
void fpstate_sanitize_xstate(struct fpu *fpu)
{
@@ -25289,7 +26719,7 @@ index 70fc312..30dfd14 100644
+ return get_xsave_addr(&fpu->state->xsave, xsave_state);
}
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
-index 311bcf3..83b8e85 100644
+index 29408d6..cd88f18 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -89,7 +89,7 @@ static unsigned long text_ip_addr(unsigned long ip)
@@ -25307,10 +26737,10 @@ index 311bcf3..83b8e85 100644
+ ip = ktla_ktva(ip);
+
+ ftrace_expected = old_code;
+
/*
- * Note: Due to modules and __init, code can
- * disappear and change, we need to protect against faulting
-@@ -230,7 +232,7 @@ static int update_ftrace_func(unsigned long ip, void *new)
+@@ -233,7 +235,7 @@ static int update_ftrace_func(unsigned long ip, void *new)
unsigned char old[MCOUNT_INSN_SIZE];
int ret;
@@ -25319,7 +26749,7 @@ index 311bcf3..83b8e85 100644
ftrace_update_func = ip;
/* Make sure the breakpoints see the ftrace_update_func update */
-@@ -311,7 +313,7 @@ static int add_break(unsigned long ip, const char *old)
+@@ -314,7 +316,7 @@ static int add_break(unsigned long ip, const char *old)
unsigned char replaced[MCOUNT_INSN_SIZE];
unsigned char brk = BREAKPOINT_INSTRUCTION;
@@ -25327,8 +26757,8 @@ index 311bcf3..83b8e85 100644
+ if (probe_kernel_read(replaced, (void *)ktla_ktva(ip), MCOUNT_INSN_SIZE))
return -EFAULT;
- /* Make sure it is what we expect it to be */
-@@ -674,11 +676,11 @@ static unsigned char *ftrace_jmp_replace(unsigned long ip, unsigned long addr)
+ ftrace_expected = old;
+@@ -681,11 +683,11 @@ static unsigned char *ftrace_jmp_replace(unsigned long ip, unsigned long addr)
/* Module allocation simplifies allocating memory for code */
static inline void *alloc_tramp(unsigned long size)
{
@@ -25342,7 +26772,7 @@ index 311bcf3..83b8e85 100644
}
#else
/* Trampolines can only be created if modules are supported */
-@@ -757,7 +759,9 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
+@@ -764,7 +766,9 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
*tramp_size = size + MCOUNT_INSN_SIZE + sizeof(void *);
/* Copy ftrace_caller onto the trampoline memory */
@@ -25352,7 +26782,7 @@ index 311bcf3..83b8e85 100644
if (WARN_ON(ret < 0)) {
tramp_free(trampoline);
return 0;
-@@ -767,6 +771,7 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
+@@ -774,6 +778,7 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
/* The trampoline ends with a jmp to ftrace_return */
jmp = ftrace_jmp_replace(ip, (unsigned long)ftrace_return);
@@ -25360,7 +26790,7 @@ index 311bcf3..83b8e85 100644
memcpy(trampoline + size, jmp, MCOUNT_INSN_SIZE);
/*
-@@ -779,6 +784,7 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
+@@ -786,6 +791,7 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
ptr = (unsigned long *)(trampoline + size + MCOUNT_INSN_SIZE);
*ptr = (unsigned long)ops;
@@ -25368,7 +26798,7 @@ index 311bcf3..83b8e85 100644
op_offset -= start_offset;
memcpy(&op_ptr, trampoline + op_offset, OP_REF_SIZE);
-@@ -796,7 +802,9 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
+@@ -803,7 +809,9 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
op_ptr.offset = offset;
/* put in the new offset to the ftrace_ops */
@@ -25379,7 +26809,7 @@ index 311bcf3..83b8e85 100644
/* ALLOC_TRAMP flags lets us know we created it */
ops->flags |= FTRACE_OPS_FL_ALLOC_TRAMP;
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
-index f129a9a..af8f6da 100644
+index 2c0f340..76c1d24 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -68,12 +68,12 @@ again:
@@ -26811,7 +28241,7 @@ index 47190bd..0165c4d 100644
.detect = kvm_detect,
.x2apic_available = kvm_para_available,
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
-index 2bd81e3..2d5e042 100644
+index 72cef58..252d1b0 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -29,7 +29,7 @@
@@ -26831,8 +28261,8 @@ index 2bd81e3..2d5e042 100644
+static struct pvclock_vsyscall_time_info hv_clock[NR_CPUS] __page_aligned_bss;
static struct pvclock_wall_clock wall_clock;
- /*
-@@ -156,7 +156,7 @@ bool kvm_check_and_clear_guest_paused(void)
+ struct pvclock_vsyscall_time_info *pvclock_pvti_cpu0_va(void)
+@@ -161,7 +161,7 @@ bool kvm_check_and_clear_guest_paused(void)
struct pvclock_vcpu_time_info *src;
int cpu = smp_processor_id();
@@ -26841,7 +28271,7 @@ index 2bd81e3..2d5e042 100644
return ret;
src = &hv_clock[cpu].pvti;
-@@ -183,7 +183,7 @@ int kvm_register_clock(char *txt)
+@@ -188,7 +188,7 @@ int kvm_register_clock(char *txt)
int low, high, ret;
struct pvclock_vcpu_time_info *src;
@@ -26850,7 +28280,7 @@ index 2bd81e3..2d5e042 100644
return 0;
src = &hv_clock[cpu].pvti;
-@@ -243,7 +243,6 @@ static void kvm_shutdown(void)
+@@ -248,7 +248,6 @@ static void kvm_shutdown(void)
void __init kvmclock_init(void)
{
struct pvclock_vcpu_time_info *vcpu_time;
@@ -26858,7 +28288,7 @@ index 2bd81e3..2d5e042 100644
int size, cpu;
u8 flags;
-@@ -261,15 +260,8 @@ void __init kvmclock_init(void)
+@@ -266,15 +265,8 @@ void __init kvmclock_init(void)
printk(KERN_INFO "kvm-clock: Using msrs %x and %x",
msr_kvm_system_time, msr_kvm_wall_clock);
@@ -26875,7 +28305,7 @@ index 2bd81e3..2d5e042 100644
return;
}
-@@ -310,7 +302,7 @@ int __init kvm_setup_vsyscall_timeinfo(void)
+@@ -314,7 +306,7 @@ int __init kvm_setup_vsyscall_timeinfo(void)
struct pvclock_vcpu_time_info *vcpu_time;
unsigned int size;
@@ -26967,23 +28397,23 @@ index 6acc9dd..f72931d 100644
case 0:
ret = read_ldt(ptr, bytecount);
diff --git a/arch/x86/kernel/livepatch.c b/arch/x86/kernel/livepatch.c
-index d1d35cc..d5b1193 100644
+index 92fc1a5..478b427 100644
--- a/arch/x86/kernel/livepatch.c
+++ b/arch/x86/kernel/livepatch.c
-@@ -41,8 +41,10 @@ int klp_write_module_reloc(struct module *mod, unsigned long type,
- int ret, numpages, size = 4;
- bool readonly;
+@@ -38,8 +38,10 @@ int klp_write_module_reloc(struct module *mod, unsigned long type,
+ {
+ size_t size = 4;
unsigned long val;
-- unsigned long core = (unsigned long)mod->module_core;
-- unsigned long core_size = mod->core_size;
-+ unsigned long core_rx = (unsigned long)mod->module_core_rx;
-+ unsigned long core_rw = (unsigned long)mod->module_core_rw;
-+ unsigned long core_size_rx = mod->core_size_rx;
-+ unsigned long core_size_rw = mod->core_size_rw;
+- unsigned long core = (unsigned long)mod->core_layout.base;
+- unsigned long core_size = mod->core_layout.size;
++ unsigned long core_rx = (unsigned long)mod->core_layout.base_rx;
++ unsigned long core_rw = (unsigned long)mod->core_layout.base_rw;
++ unsigned long core_size_rx = mod->core_layout.size_rx;
++ unsigned long core_size_rw = mod->core_layout.size_rw;
switch (type) {
case R_X86_64_NONE:
-@@ -65,14 +67,15 @@ int klp_write_module_reloc(struct module *mod, unsigned long type,
+@@ -62,7 +64,8 @@ int klp_write_module_reloc(struct module *mod, unsigned long type,
return -EINVAL;
}
@@ -26993,14 +28423,6 @@ index d1d35cc..d5b1193 100644
/* loc does not point to any symbol inside the module */
return -EINVAL;
- readonly = false;
-
- #ifdef CONFIG_DEBUG_SET_MODULE_RONX
-- if (loc < core + mod->core_ro_size)
-+ if (loc < core_rx + core_size_rx)
- readonly = true;
- #endif
-
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
index 469b23d..5449cfe 100644
--- a/arch/x86/kernel/machine_kexec_32.c
@@ -27033,7 +28455,7 @@ index 469b23d..5449cfe 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 87e1762..994fdb6 100644
+index 87e1762..f08a93d 100644
--- a/arch/x86/kernel/mcount_64.S
+++ b/arch/x86/kernel/mcount_64.S
@@ -7,7 +7,7 @@
@@ -27056,10 +28478,12 @@ index 87e1762..994fdb6 100644
ENTRY(ftrace_caller)
/* save_mcount_regs fills in first two parameters */
-@@ -181,8 +182,9 @@ GLOBAL(ftrace_graph_call)
+@@ -180,9 +181,10 @@ GLOBAL(ftrace_graph_call)
+ jmp ftrace_stub
#endif
- GLOBAL(ftrace_stub)
+-GLOBAL(ftrace_stub)
++RAP_ENTRY(ftrace_stub)
+ pax_force_retaddr
retq
-END(ftrace_caller)
@@ -27266,7 +28690,7 @@ index 005c03e..7000fe4 100644
if ((s64)val != *(s32 *)loc)
goto overflow;
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
-index 113e707..0a690e1 100644
+index 64f9616..c94695d 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -39,6 +39,7 @@
@@ -27277,7 +28701,7 @@ index 113e707..0a690e1 100644
#include <asm/processor.h>
#include <asm/msr.h>
-@@ -105,6 +106,11 @@ static ssize_t msr_write(struct file *file, const char __user *buf,
+@@ -83,6 +84,11 @@ static ssize_t msr_write(struct file *file, const char __user *buf,
int err = 0;
ssize_t bytes = 0;
@@ -27289,7 +28713,7 @@ index 113e707..0a690e1 100644
if (count % 8)
return -EINVAL; /* Invalid chunk size */
-@@ -152,6 +158,10 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg)
+@@ -130,6 +136,10 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg)
err = -EBADF;
break;
}
@@ -27300,7 +28724,7 @@ index 113e707..0a690e1 100644
if (copy_from_user(&regs, uregs, sizeof regs)) {
err = -EFAULT;
break;
-@@ -235,7 +245,7 @@ static int msr_class_cpu_callback(struct notifier_block *nfb,
+@@ -213,7 +223,7 @@ static int msr_class_cpu_callback(struct notifier_block *nfb,
return notifier_from_errno(err);
}
@@ -27310,10 +28734,10 @@ index 113e707..0a690e1 100644
};
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
-index 697f90d..8b1c639 100644
+index 8a2cdd7..5b45fda 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
-@@ -98,16 +98,16 @@ fs_initcall(nmi_warning_debugfs);
+@@ -99,16 +99,16 @@ fs_initcall(nmi_warning_debugfs);
static void nmi_max_handler(struct irq_work *w)
{
@@ -27333,7 +28757,7 @@ index 697f90d..8b1c639 100644
}
static int nmi_handle(unsigned int type, struct pt_regs *regs)
-@@ -134,11 +134,11 @@ static int nmi_handle(unsigned int type, struct pt_regs *regs)
+@@ -135,11 +135,11 @@ static int nmi_handle(unsigned int type, struct pt_regs *regs)
delta = sched_clock() - delta;
trace_nmi_handler(a->handler, (int)delta, thishandled);
@@ -27348,7 +28772,7 @@ index 697f90d..8b1c639 100644
}
rcu_read_unlock();
-@@ -148,7 +148,7 @@ static int nmi_handle(unsigned int type, struct pt_regs *regs)
+@@ -149,7 +149,7 @@ static int nmi_handle(unsigned int type, struct pt_regs *regs)
}
NOKPROBE_SYMBOL(nmi_handle);
@@ -27357,7 +28781,7 @@ index 697f90d..8b1c639 100644
{
struct nmi_desc *desc = nmi_to_desc(type);
unsigned long flags;
-@@ -156,7 +156,8 @@ int __register_nmi_handler(unsigned int type, struct nmiaction *action)
+@@ -157,7 +157,8 @@ int __register_nmi_handler(unsigned int type, struct nmiaction *action)
if (!action->handler)
return -EINVAL;
@@ -27367,7 +28791,7 @@ index 697f90d..8b1c639 100644
spin_lock_irqsave(&desc->lock, flags);
-@@ -174,9 +175,9 @@ int __register_nmi_handler(unsigned int type, struct nmiaction *action)
+@@ -175,9 +176,9 @@ int __register_nmi_handler(unsigned int type, struct nmiaction *action)
* event confuses some handlers (kdump uses this flag)
*/
if (action->flags & NMI_FLAG_FIRST)
@@ -27379,7 +28803,7 @@ index 697f90d..8b1c639 100644
spin_unlock_irqrestore(&desc->lock, flags);
return 0;
-@@ -199,7 +200,7 @@ void unregister_nmi_handler(unsigned int type, const char *name)
+@@ -200,7 +201,7 @@ void unregister_nmi_handler(unsigned int type, const char *name)
if (!strcmp(n->name, name)) {
WARN(in_nmi(),
"Trying to free NMI (%s) from NMI context!\n", n->name);
@@ -27388,7 +28812,7 @@ index 697f90d..8b1c639 100644
break;
}
}
-@@ -481,6 +482,17 @@ static DEFINE_PER_CPU(int, update_debug_stack);
+@@ -501,6 +502,17 @@ static DEFINE_PER_CPU(int, update_debug_stack);
dotraplinkage notrace void
do_nmi(struct pt_regs *regs, long error_code)
{
@@ -27442,7 +28866,7 @@ index 33ee3e0..da3519a 100644
#ifdef CONFIG_QUEUED_SPINLOCKS
.queued_spin_lock_slowpath = native_queued_spin_lock_slowpath,
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
-index c2130ae..d52ca15 100644
+index f08ac28..0151389 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -64,6 +64,9 @@ u64 _paravirt_ident_64(u64 x)
@@ -27455,7 +28879,7 @@ index c2130ae..d52ca15 100644
void __init default_banner(void)
{
-@@ -150,16 +153,20 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
+@@ -139,15 +142,19 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
if (opfunc == NULL)
/* If there's no function, patch it with a ud2a (BUG) */
@@ -27463,8 +28887,7 @@ index c2130ae..d52ca15 100644
- else if (opfunc == _paravirt_nop)
+ ret = paravirt_patch_insns(insnbuf, len, (const char *)ktva_ktla((unsigned long)ud2a), ud2a+sizeof(ud2a));
+ else if (opfunc == (void *)_paravirt_nop)
- /* If the operation is a nop, then nop the callsite */
- ret = paravirt_patch_nop();
+ ret = 0;
/* identity functions just return their single argument */
- else if (opfunc == _paravirt_ident_32)
@@ -27479,8 +28902,8 @@ index c2130ae..d52ca15 100644
+#endif
else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) ||
- #ifdef CONFIG_X86_32
-@@ -186,7 +193,7 @@ unsigned paravirt_patch_insns(void *insnbuf, unsigned len,
+ type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret64))
+@@ -170,7 +177,7 @@ unsigned paravirt_patch_insns(void *insnbuf, unsigned len,
if (insn_len > len || start == NULL)
insn_len = len;
else
@@ -27489,7 +28912,7 @@ index c2130ae..d52ca15 100644
return insn_len;
}
-@@ -310,7 +317,7 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
+@@ -292,7 +299,7 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
return this_cpu_read(paravirt_lazy_mode);
}
@@ -27498,7 +28921,7 @@ index c2130ae..d52ca15 100644
.name = "bare hardware",
.paravirt_enabled = 0,
.kernel_rpl = 0,
-@@ -321,16 +328,16 @@ struct pv_info pv_info = {
+@@ -303,16 +310,16 @@ struct pv_info pv_info = {
#endif
};
@@ -27518,7 +28941,7 @@ index c2130ae..d52ca15 100644
.save_fl = __PV_IS_CALLEE_SAVE(native_save_fl),
.restore_fl = __PV_IS_CALLEE_SAVE(native_restore_fl),
.irq_disable = __PV_IS_CALLEE_SAVE(native_irq_disable),
-@@ -342,7 +349,7 @@ __visible struct pv_irq_ops pv_irq_ops = {
+@@ -324,7 +331,7 @@ __visible struct pv_irq_ops pv_irq_ops = {
#endif
};
@@ -27527,17 +28950,10 @@ index c2130ae..d52ca15 100644
.cpuid = native_cpuid,
.get_debugreg = native_get_debugreg,
.set_debugreg = native_set_debugreg,
-@@ -403,21 +410,26 @@ NOKPROBE_SYMBOL(native_get_debugreg);
+@@ -379,15 +386,20 @@ NOKPROBE_SYMBOL(native_get_debugreg);
NOKPROBE_SYMBOL(native_set_debugreg);
NOKPROBE_SYMBOL(native_load_idt);
--struct pv_apic_ops pv_apic_ops = {
-+struct pv_apic_ops pv_apic_ops __read_only= {
- #ifdef CONFIG_X86_LOCAL_APIC
- .startup_ipi_hook = paravirt_nop,
- #endif
- };
-
-#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
+#ifdef CONFIG_X86_32
+#ifdef CONFIG_X86_PAE
@@ -27557,7 +28973,7 @@ index c2130ae..d52ca15 100644
.read_cr2 = native_read_cr2,
.write_cr2 = native_write_cr2,
-@@ -467,6 +479,7 @@ struct pv_mmu_ops pv_mmu_ops = {
+@@ -434,6 +446,7 @@ struct pv_mmu_ops pv_mmu_ops = {
.make_pud = PTE_IDENT,
.set_pgd = native_set_pgd,
@@ -27565,7 +28981,7 @@ index c2130ae..d52ca15 100644
#endif
#endif /* CONFIG_PGTABLE_LEVELS >= 3 */
-@@ -487,6 +500,12 @@ struct pv_mmu_ops pv_mmu_ops = {
+@@ -454,6 +467,12 @@ struct pv_mmu_ops pv_mmu_ops = {
},
.set_fixmap = native_set_fixmap,
@@ -27579,7 +28995,7 @@ index c2130ae..d52ca15 100644
EXPORT_SYMBOL_GPL(pv_time_ops);
diff --git a/arch/x86/kernel/paravirt_patch_64.c b/arch/x86/kernel/paravirt_patch_64.c
-index 8aa0558..465512e 100644
+index e70087a..b083377 100644
--- a/arch/x86/kernel/paravirt_patch_64.c
+++ b/arch/x86/kernel/paravirt_patch_64.c
@@ -9,7 +9,11 @@ DEF_NATIVE(pv_irq_ops, save_fl, "pushfq; popq %rax");
@@ -27594,7 +29010,7 @@ index 8aa0558..465512e 100644
DEF_NATIVE(pv_cpu_ops, clts, "clts");
DEF_NATIVE(pv_cpu_ops, wbinvd, "wbinvd");
-@@ -62,7 +66,11 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
+@@ -59,7 +63,11 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
PATCH_SITE(pv_mmu_ops, read_cr3);
PATCH_SITE(pv_mmu_ops, write_cr3);
PATCH_SITE(pv_cpu_ops, clts);
@@ -27607,7 +29023,7 @@ index 8aa0558..465512e 100644
#if defined(CONFIG_PARAVIRT_SPINLOCKS) && defined(CONFIG_QUEUED_SPINLOCKS)
case PARAVIRT_PATCH(pv_lock_ops.queued_spin_unlock):
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
-index 0497f71..7186c0d 100644
+index 833b1d3..f839e8b 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -1347,7 +1347,7 @@ static void __init get_tce_space_from_tar(void)
@@ -27633,7 +29049,7 @@ index 35ccf75..7a15747 100644
#define DEBUG 1
diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c
-index adf0392..88a7576 100644
+index 7c577a1..3557b10 100644
--- a/arch/x86/kernel/pci-swiotlb.c
+++ b/arch/x86/kernel/pci-swiotlb.c
@@ -40,7 +40,7 @@ void x86_swiotlb_free_coherent(struct device *dev, size_t size,
@@ -27923,7 +29339,7 @@ index 9f95091..6885108 100644
return prev_p;
}
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
-index 4cbb60f..7cc4cb4 100644
+index 9f75187..9b2d358 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -160,9 +160,10 @@ int copy_thread_tls(unsigned long clone_flags, unsigned long sp,
@@ -27982,10 +29398,10 @@ index 4cbb60f..7cc4cb4 100644
* Now maybe reload the debug registers and handle I/O bitmaps
*/
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
-index 558f50e..2312c52 100644
+index 32e9d9c..afd5732 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
-@@ -184,10 +184,10 @@ unsigned long kernel_stack_pointer(struct pt_regs *regs)
+@@ -169,10 +169,10 @@ unsigned long kernel_stack_pointer(struct pt_regs *regs)
unsigned long sp = (unsigned long)&regs->sp;
u32 *prev_esp;
@@ -27998,7 +29414,7 @@ index 558f50e..2312c52 100644
if (prev_esp)
return (unsigned long)prev_esp;
-@@ -444,6 +444,20 @@ static int putreg(struct task_struct *child,
+@@ -429,6 +429,20 @@ static int putreg(struct task_struct *child,
if (child->thread.gs != value)
return do_arch_prctl(child, ARCH_SET_GS, value);
return 0;
@@ -28019,7 +29435,7 @@ index 558f50e..2312c52 100644
#endif
}
-@@ -580,7 +594,7 @@ static void ptrace_triggered(struct perf_event *bp,
+@@ -565,7 +579,7 @@ static void ptrace_triggered(struct perf_event *bp,
static unsigned long ptrace_get_dr7(struct perf_event *bp[])
{
int i;
@@ -28028,7 +29444,7 @@ index 558f50e..2312c52 100644
struct arch_hw_breakpoint *info;
for (i = 0; i < HBP_NUM; i++) {
-@@ -814,7 +828,7 @@ long arch_ptrace(struct task_struct *child, long request,
+@@ -799,7 +813,7 @@ long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{
int ret;
@@ -28037,7 +29453,7 @@ index 558f50e..2312c52 100644
switch (request) {
/* read the word at location addr in the USER area. */
-@@ -899,14 +913,14 @@ long arch_ptrace(struct task_struct *child, long request,
+@@ -884,14 +898,14 @@ long arch_ptrace(struct task_struct *child, long request,
if ((int) addr < 0)
return -EIO;
ret = do_get_thread_area(child, addr,
@@ -28054,7 +29470,7 @@ index 558f50e..2312c52 100644
break;
#endif
-@@ -1294,7 +1308,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
+@@ -1279,7 +1293,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
#ifdef CONFIG_X86_64
@@ -28063,7 +29479,7 @@ index 558f50e..2312c52 100644
[REGSET_GENERAL] = {
.core_note_type = NT_PRSTATUS,
.n = sizeof(struct user_regs_struct) / sizeof(long),
-@@ -1335,7 +1349,7 @@ static const struct user_regset_view user_x86_64_view = {
+@@ -1320,7 +1334,7 @@ static const struct user_regset_view user_x86_64_view = {
#endif /* CONFIG_X86_64 */
#if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
@@ -28072,7 +29488,7 @@ index 558f50e..2312c52 100644
[REGSET_GENERAL] = {
.core_note_type = NT_PRSTATUS,
.n = sizeof(struct user_regs_struct32) / sizeof(u32),
-@@ -1388,7 +1402,7 @@ static const struct user_regset_view user_x86_32_view = {
+@@ -1373,7 +1387,7 @@ static const struct user_regset_view user_x86_32_view = {
*/
u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
@@ -28081,7 +29497,7 @@ index 558f50e..2312c52 100644
{
#ifdef CONFIG_X86_64
x86_64_regsets[REGSET_XSTATE].n = size / sizeof(u64);
-@@ -1423,7 +1437,7 @@ static void fill_sigtrap_info(struct task_struct *tsk,
+@@ -1408,7 +1422,7 @@ static void fill_sigtrap_info(struct task_struct *tsk,
memset(info, 0, sizeof(*info));
info->si_signo = SIGTRAP;
info->si_code = si_code;
@@ -28091,7 +29507,7 @@ index 558f50e..2312c52 100644
void user_single_step_siginfo(struct task_struct *tsk,
diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
-index 2f355d2..e75ed0a 100644
+index 99bfc02..c85b4c4 100644
--- a/arch/x86/kernel/pvclock.c
+++ b/arch/x86/kernel/pvclock.c
@@ -51,11 +51,11 @@ void pvclock_touch_watchdogs(void)
@@ -28123,7 +29539,7 @@ index 2f355d2..e75ed0a 100644
return ret;
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
-index f660d63..564a120 100644
+index ab0adc0..502dfc2 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -70,6 +70,11 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
@@ -28261,7 +29677,7 @@ index 98111b3..73ca125 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 d2bbe34..9d8fdaa 100644
+index d3d80e6..5c5b8de 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -112,6 +112,7 @@
@@ -28497,7 +29913,7 @@ index cb6282c..7cda5d0 100644
}
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
-index 12c8286..aa65d13 100644
+index 658777c..6285f88 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -336,7 +336,7 @@ static int __init nonmi_ipi_setup(char *str)
@@ -28510,7 +29926,7 @@ index 12c8286..aa65d13 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 fbabe4f..c686333 100644
+index 24d57f7..36e49a2 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -213,14 +213,17 @@ static void notrace start_secondary(void *unused)
@@ -28535,7 +29951,7 @@ index fbabe4f..c686333 100644
/*
* Check TSC synchronization with the BP:
*/
-@@ -810,16 +813,15 @@ void common_cpu_up(unsigned int cpu, struct task_struct *idle)
+@@ -803,16 +806,15 @@ void common_cpu_up(unsigned int cpu, struct task_struct *idle)
alternatives_enable_smp();
per_cpu(current_task, cpu) = idle;
@@ -28554,7 +29970,7 @@ index fbabe4f..c686333 100644
}
/*
-@@ -840,9 +842,11 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
+@@ -833,9 +835,11 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
unsigned long timeout;
idle->thread.sp = (unsigned long) (((struct pt_regs *)
@@ -28567,7 +29983,7 @@ index fbabe4f..c686333 100644
initial_code = (unsigned long)start_secondary;
stack_start = idle->thread.sp;
-@@ -990,6 +994,15 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
+@@ -983,6 +987,15 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
common_cpu_up(cpu, tidle);
@@ -28609,7 +30025,7 @@ index c9a0738..f0ab628 100644
switch (opcode[i]) {
diff --git a/arch/x86/kernel/sys_i386_32.c b/arch/x86/kernel/sys_i386_32.c
new file mode 100644
-index 0000000..5877189
+index 0000000..920e413
--- /dev/null
+++ b/arch/x86/kernel/sys_i386_32.c
@@ -0,0 +1,189 @@
@@ -28737,9 +30153,9 @@ index 0000000..5877189
+}
+
+unsigned long
-+arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
-+ const unsigned long len, const unsigned long pgoff,
-+ const unsigned long flags)
++arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr0,
++ unsigned long len, unsigned long pgoff,
++ unsigned long flags)
+{
+ struct vm_area_struct *vma;
+ struct mm_struct *mm = current->mm;
@@ -28803,7 +30219,7 @@ index 0000000..5877189
+ return arch_get_unmapped_area(filp, addr0, len, pgoff, flags);
+}
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
-index 10e0272..b4bb9a7 100644
+index 10e0272..a73232f 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -97,8 +97,8 @@ out:
@@ -28854,7 +30270,7 @@ index 10e0272..b4bb9a7 100644
return addr;
}
-@@ -157,6 +161,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -157,18 +161,20 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
info.align_mask = get_align_mask();
info.align_offset += get_align_bits();
}
@@ -28862,7 +30278,15 @@ index 10e0272..b4bb9a7 100644
return vm_unmapped_area(&info);
}
-@@ -169,6 +174,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+ unsigned long
+-arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+- const unsigned long len, const unsigned long pgoff,
+- const unsigned long flags)
++arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr0,
++ unsigned long len, unsigned long pgoff,
++ unsigned long flags)
+ {
+ struct vm_area_struct *vma;
struct mm_struct *mm = current->mm;
unsigned long addr = addr0;
struct vm_unmapped_area_info info;
@@ -29048,7 +30472,7 @@ 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 ade185a..2452e8b 100644
+index ade185a..4c354a0 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -70,7 +70,7 @@
@@ -29087,7 +30511,7 @@ index ade185a..2452e8b 100644
struct pt_regs *regs, long error_code)
{
if (v8086_mode(regs)) {
-@@ -202,8 +202,20 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str,
+@@ -202,8 +202,25 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str,
if (!fixup_exception(regs)) {
tsk->thread.error_code = error_code;
tsk->thread.trap_nr = trapnr;
@@ -29097,6 +30521,11 @@ index ade185a..2452e8b 100644
+ str = "PAX: suspicious stack segment fault";
+#endif
+
++#ifdef CONFIG_PAX_RAP
++ if (trapnr == X86_TRAP_UD)
++ str = "PAX: overwritten function pointer or return address detected";
++#endif
++
die(str, regs, error_code);
}
+
@@ -29108,7 +30537,7 @@ index ade185a..2452e8b 100644
return 0;
}
-@@ -242,7 +254,7 @@ static siginfo_t *fill_trap_info(struct pt_regs *regs, int signr, int trapnr,
+@@ -242,7 +259,7 @@ static siginfo_t *fill_trap_info(struct pt_regs *regs, int signr, int trapnr,
}
static void
@@ -29117,7 +30546,7 @@ index ade185a..2452e8b 100644
long error_code, siginfo_t *info)
{
struct task_struct *tsk = current;
-@@ -266,7 +278,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
+@@ -266,7 +283,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",
@@ -29126,7 +30555,7 @@ index ade185a..2452e8b 100644
regs->ip, regs->sp, error_code);
print_vma_addr(" in ", regs->ip);
pr_cont("\n");
-@@ -347,6 +359,11 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
+@@ -347,6 +364,11 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
tsk->thread.error_code = error_code;
tsk->thread.trap_nr = X86_TRAP_DF;
@@ -29138,7 +30567,7 @@ index ade185a..2452e8b 100644
#ifdef CONFIG_DOUBLEFAULT
df_debug(regs, error_code);
#endif
-@@ -459,11 +476,35 @@ do_general_protection(struct pt_regs *regs, long error_code)
+@@ -459,11 +481,35 @@ do_general_protection(struct pt_regs *regs, long error_code)
tsk->thread.error_code = error_code;
tsk->thread.trap_nr = X86_TRAP_GP;
if (notify_die(DIE_GPF, "general protection fault", regs, error_code,
@@ -29175,7 +30604,7 @@ index ade185a..2452e8b 100644
tsk->thread.error_code = error_code;
tsk->thread.trap_nr = X86_TRAP_GP;
-@@ -559,6 +600,9 @@ struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
+@@ -559,6 +605,9 @@ struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
container_of(task_pt_regs(current),
struct bad_iret_stack, regs);
@@ -29185,8 +30614,35 @@ index ade185a..2452e8b 100644
/* Copy the IRET target to the new stack. */
memmove(&new_stack->regs.ip, (void *)s->regs.sp, 5*8);
+@@ -805,7 +854,7 @@ void __init early_trap_init(void)
+ * since we don't have trace_debug and it will be reset to
+ * 'debug' in trap_init() by set_intr_gate_ist().
+ */
+- set_intr_gate_notrace(X86_TRAP_DB, debug);
++ set_intr_gate_notrace(X86_TRAP_DB, int1);
+ /* int3 can be called from all */
+ set_system_intr_gate(X86_TRAP_BP, &int3);
+ #ifdef CONFIG_X86_32
+@@ -890,7 +939,7 @@ void __init trap_init(void)
+ * in early_trap_init(). However, ITS works only after
+ * cpu_init() loads TSS. See comments in early_trap_init().
+ */
+- set_intr_gate_ist(X86_TRAP_DB, &debug, DEBUG_STACK);
++ set_intr_gate_ist(X86_TRAP_DB, &int1, DEBUG_STACK);
+ /* int3 can be called from all */
+ set_system_intr_gate_ist(X86_TRAP_BP, &int3, DEBUG_STACK);
+
+@@ -898,7 +947,7 @@ void __init trap_init(void)
+
+ #ifdef CONFIG_X86_64
+ memcpy(&debug_idt_table, &idt_table, IDT_ENTRIES * 16);
+- set_nmi_gate(X86_TRAP_DB, &debug);
++ set_nmi_gate(X86_TRAP_DB, &int1);
+ set_nmi_gate(X86_TRAP_BP, &int3);
+ #endif
+ }
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
-index c7c4d9c..ddd1454 100644
+index 3d743da..d74c208 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -151,7 +151,7 @@ static void cyc2ns_write_end(int cpu, struct cyc2ns_data *data)
@@ -29221,7 +30677,7 @@ index bf4db6e..624137c 100644
force_sig_info(SIGSEGV, SEND_SIG_FORCED, current);
}
diff --git a/arch/x86/kernel/verify_cpu.S b/arch/x86/kernel/verify_cpu.S
-index 4cf401f..ae8c9cf 100644
+index 07efb35..2bf8766 100644
--- a/arch/x86/kernel/verify_cpu.S
+++ b/arch/x86/kernel/verify_cpu.S
@@ -20,6 +20,7 @@
@@ -29233,7 +30689,7 @@ index 4cf401f..ae8c9cf 100644
* verify_cpu, returns the status of longmode and SSE in register %eax.
* 0: Success 1: Failure
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
-index 5246193..c6bed42 100644
+index e574b85..5514c57 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -144,7 +144,7 @@ void save_v86_state(struct kernel_vm86_regs *regs, int retval)
@@ -29245,7 +30701,7 @@ index 5246193..c6bed42 100644
tsk->thread.sp0 = vm86->saved_sp0;
tsk->thread.sysenter_cs = __KERNEL_CS;
load_sp0(tss, &tsk->thread);
-@@ -259,6 +259,13 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus)
+@@ -263,6 +263,13 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus)
return -EPERM;
}
@@ -29259,7 +30715,7 @@ index 5246193..c6bed42 100644
if (!vm86) {
if (!(vm86 = kzalloc(sizeof(*vm86), GFP_KERNEL)))
return -ENOMEM;
-@@ -354,7 +361,7 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus)
+@@ -358,7 +365,7 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus)
vm86->saved_sp0 = tsk->thread.sp0;
lazy_save_gs(vm86->regs32.gs);
@@ -29267,8 +30723,8 @@ index 5246193..c6bed42 100644
+ tss = cpu_tss + get_cpu();
/* make room for real-mode segments */
tsk->thread.sp0 += 16;
- if (cpu_has_sep)
-@@ -535,7 +542,7 @@ static void do_int(struct kernel_vm86_regs *regs, int i,
+
+@@ -541,7 +548,7 @@ static void do_int(struct kernel_vm86_regs *regs, int i,
goto cannot_handle;
if (i == 0x21 && is_revectored(AH(regs), &vm86->int21_revectored))
goto cannot_handle;
@@ -29277,7 +30733,7 @@ index 5246193..c6bed42 100644
if (get_user(segoffs, intr_ptr))
goto cannot_handle;
if ((segoffs >> 16) == BIOSSEG)
-@@ -828,6 +835,14 @@ static inline int get_and_reset_irq(int irqnumber)
+@@ -834,6 +841,14 @@ static inline int get_and_reset_irq(int irqnumber)
static int do_vm86_irq_handling(int subfunction, int irqnumber)
{
int ret;
@@ -29584,10 +31040,10 @@ index a0695be..33e180c 100644
+EXPORT_SYMBOL(cpu_pgd);
+#endif
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
-index 3839628..2e5b5b35 100644
+index dad5fe9..ce5f4ba 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
-@@ -92,7 +92,7 @@ struct x86_cpuinit_ops x86_cpuinit = {
+@@ -91,7 +91,7 @@ struct x86_cpuinit_ops x86_cpuinit = {
static void default_nmi_init(void) { };
static int default_i8042_detect(void) { return 1; };
@@ -29596,7 +31052,7 @@ index 3839628..2e5b5b35 100644
.calibrate_tsc = native_calibrate_tsc,
.get_wallclock = mach_get_cmos_time,
.set_wallclock = mach_set_rtc_mmss,
-@@ -108,7 +108,7 @@ struct x86_platform_ops x86_platform = {
+@@ -107,7 +107,7 @@ struct x86_platform_ops x86_platform = {
EXPORT_SYMBOL_GPL(x86_platform);
#if defined(CONFIG_PCI_MSI)
@@ -29605,7 +31061,7 @@ index 3839628..2e5b5b35 100644
.setup_msi_irqs = native_setup_msi_irqs,
.teardown_msi_irq = native_teardown_msi_irq,
.teardown_msi_irqs = default_teardown_msi_irqs,
-@@ -137,7 +137,7 @@ void arch_restore_msi_irqs(struct pci_dev *dev)
+@@ -136,7 +136,7 @@ void arch_restore_msi_irqs(struct pci_dev *dev)
}
#endif
@@ -29666,9 +31122,18 @@ index 6525e92..28559d2 100644
out:
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
-index b9b09fe..138addd 100644
+index b9b09fe..2e1cfb3 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
+@@ -959,7 +959,7 @@ static int em_bsr_c(struct x86_emulate_ctxt *ctxt)
+ static u8 test_cc(unsigned int condition, unsigned long flags)
+ {
+ u8 rc;
+- void (*fop)(void) = (void *)em_setcc + 4 * (condition & 0xf);
++ void (*fop)(struct fastop *) = (void *)em_setcc + 4 * (condition & 0xf);
+
+ flags = (flags & EFLAGS_MASK) | X86_EFLAGS_IF;
+ asm("push %[flags]; popf; call *%[fastop]"
@@ -1881,7 +1881,7 @@ static int em_push_sreg(struct x86_emulate_ctxt *ctxt)
static int em_pop_sreg(struct x86_emulate_ctxt *ctxt)
{
@@ -29696,6 +31161,37 @@ index b9b09fe..138addd 100644
0xffffffff00000000ULL,
0, 0, 0, /* CR3 checked later */
CR4_RESERVED_BITS,
+@@ -4956,7 +4956,10 @@ done_prefixes:
+ if (ctxt->d == 0)
+ return EMULATION_FAILED;
+
+- ctxt->execute = opcode.u.execute;
++ if (ctxt->d & Fastop)
++ ctxt->u.fastop = opcode.u.fastop;
++ else
++ ctxt->u.execute = opcode.u.execute;
+
+ if (unlikely(ctxt->ud) && likely(!(ctxt->d & EmulateOnUD)))
+ return EMULATION_FAILED;
+@@ -5267,15 +5270,14 @@ special_insn:
+ else
+ ctxt->eflags &= ~X86_EFLAGS_RF;
+
+- if (ctxt->execute) {
++ if (ctxt->u.execute) {
+ if (ctxt->d & Fastop) {
+- void (*fop)(struct fastop *) = (void *)ctxt->execute;
+- rc = fastop(ctxt, fop);
++ rc = fastop(ctxt, ctxt->u.fastop);
+ if (rc != X86EMUL_CONTINUE)
+ goto done;
+ goto writeback;
+ }
+- rc = ctxt->execute(ctxt);
++ rc = ctxt->u.execute(ctxt);
+ if (rc != X86EMUL_CONTINUE)
+ goto done;
+ goto writeback;
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 7cc2360..6ae1236 100644
--- a/arch/x86/kvm/i8259.c
@@ -29766,7 +31262,7 @@ index 7cc2360..6ae1236 100644
{
struct kvm_kpic_state *s = opaque;
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
-index 88d0a92..fa8b52a 100644
+index 1facfd6..51dcfd3 100644
--- a/arch/x86/kvm/ioapic.c
+++ b/arch/x86/kvm/ioapic.c
@@ -405,6 +405,8 @@ static void kvm_ioapic_eoi_inject_work(struct work_struct *work)
@@ -29779,10 +31275,10 @@ index 88d0a92..fa8b52a 100644
{
int i;
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
-index 4d30b86..94115f0 100644
+index 36591fa..3b2fa3f 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
-@@ -56,7 +56,7 @@
+@@ -57,7 +57,7 @@
#define APIC_BUS_CYCLE_NS 1
/* #define apic_debug(fmt,arg...) printk(KERN_WARNING fmt,##arg) */
@@ -29792,7 +31288,7 @@ index 4d30b86..94115f0 100644
#define APIC_LVT_NUM 6
/* 14 is the version for Xeon and Pentium 8.4.8*/
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
-index 7be8a25..7d71250 100644
+index 2ce4f05..ab8fa72 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -335,7 +335,7 @@ retry_walk:
@@ -29805,10 +31301,10 @@ index 7be8a25..7d71250 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 899c40f..a114588 100644
+index c13a64b..2075a7c 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
-@@ -3490,7 +3490,11 @@ static void reload_tss(struct kvm_vcpu *vcpu)
+@@ -3529,7 +3529,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);
@@ -29820,7 +31316,7 @@ index 899c40f..a114588 100644
load_TR_desc();
}
-@@ -3885,6 +3889,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -3928,6 +3932,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
#endif
#endif
@@ -29831,7 +31327,7 @@ index 899c40f..a114588 100644
reload_tss(vcpu);
local_irq_disable();
-@@ -4260,7 +4268,7 @@ static void svm_sched_in(struct kvm_vcpu *vcpu, int cpu)
+@@ -4303,7 +4311,7 @@ static void svm_sched_in(struct kvm_vcpu *vcpu, int cpu)
{
}
@@ -29841,25 +31337,27 @@ index 899c40f..a114588 100644
.disabled_by_bios = is_disabled,
.hardware_setup = svm_hardware_setup,
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
-index f34ab71..049ebd8 100644
+index 539062e..0aa69ab 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
-@@ -1514,12 +1514,12 @@ static void vmcs_write64(unsigned long field, u64 value)
- #endif
+@@ -1575,14 +1575,14 @@ static __always_inline void vmcs_writel(unsigned long field, unsigned long value
+ __vmcs_writel(field, value);
}
--static void vmcs_clear_bits(unsigned long field, u32 mask)
-+static void vmcs_clear_bits(unsigned long field, unsigned long mask)
+-static __always_inline void vmcs_clear_bits(unsigned long field, u32 mask)
++static __always_inline void vmcs_clear_bits(unsigned long field, unsigned long mask)
{
- vmcs_writel(field, vmcs_readl(field) & ~mask);
+ BUILD_BUG_ON_MSG(__builtin_constant_p(field) && ((field) & 0x6000) == 0x2000,
+ "vmcs_clear_bits does not support 64-bit fields");
+ __vmcs_writel(field, __vmcs_readl(field) & ~mask);
}
--static void vmcs_set_bits(unsigned long field, u32 mask)
-+static void vmcs_set_bits(unsigned long field, unsigned long mask)
+-static __always_inline void vmcs_set_bits(unsigned long field, u32 mask)
++static __always_inline void vmcs_set_bits(unsigned long field, unsigned long mask)
{
- vmcs_writel(field, vmcs_readl(field) | mask);
- }
-@@ -1786,7 +1786,11 @@ static void reload_tss(void)
+ BUILD_BUG_ON_MSG(__builtin_constant_p(field) && ((field) & 0x6000) == 0x2000,
+ "vmcs_set_bits does not support 64-bit fields");
+@@ -1851,7 +1851,11 @@ static void reload_tss(void)
struct desc_struct *descs;
descs = (void *)gdt->address;
@@ -29871,7 +31369,7 @@ index f34ab71..049ebd8 100644
load_TR_desc();
}
-@@ -2078,6 +2082,10 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
+@@ -2143,6 +2147,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 */
@@ -29882,7 +31380,7 @@ index f34ab71..049ebd8 100644
rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp);
vmcs_writel(HOST_IA32_SYSENTER_ESP, sysenter_esp); /* 22.2.3 */
-@@ -2395,7 +2403,7 @@ static void setup_msrs(struct vcpu_vmx *vmx)
+@@ -2460,7 +2468,7 @@ static void setup_msrs(struct vcpu_vmx *vmx)
* guest_tsc = (host_tsc * tsc multiplier) >> 48 + tsc_offset
* -- Intel TSC Scaling for Virtualization White Paper, sec 1.3
*/
@@ -29891,7 +31389,7 @@ index f34ab71..049ebd8 100644
{
u64 host_tsc, tsc_offset;
-@@ -4633,7 +4641,10 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
+@@ -4693,7 +4701,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 */
@@ -29902,7 +31400,7 @@ index f34ab71..049ebd8 100644
/* Save the most likely value for this task's CR4 in the VMCS. */
cr4 = cr4_read_shadow();
-@@ -4660,7 +4671,7 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
+@@ -4720,7 +4731,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;
@@ -29911,7 +31409,7 @@ index f34ab71..049ebd8 100644
rdmsr(MSR_IA32_SYSENTER_CS, low32, high32);
vmcs_write32(HOST_IA32_SYSENTER_CS, low32);
-@@ -6210,11 +6221,17 @@ static __init int hardware_setup(void)
+@@ -6277,11 +6288,17 @@ static __init int hardware_setup(void)
* page upon invalidation. No need to do anything if not
* using the APIC_ACCESS_ADDR VMCS field.
*/
@@ -29931,23 +31429,7 @@ index f34ab71..049ebd8 100644
if (enable_ept && !cpu_has_vmx_ept_2m_page())
kvm_disable_largepages();
-@@ -6231,6 +6248,7 @@ static __init int hardware_setup(void)
- kvm_tsc_scaling_ratio_frac_bits = 48;
- }
-
-+ pax_open_kernel();
- if (enable_apicv)
- kvm_x86_ops->update_cr8_intercept = NULL;
- else {
-@@ -6239,6 +6257,7 @@ static __init int hardware_setup(void)
- kvm_x86_ops->deliver_posted_interrupt = NULL;
- kvm_x86_ops->sync_pir_to_irr = vmx_sync_pir_to_irr_dummy;
- }
-+ pax_close_kernel();
-
- vmx_disable_intercept_for_msr(MSR_FS_BASE, false);
- vmx_disable_intercept_for_msr(MSR_GS_BASE, false);
-@@ -6293,10 +6312,12 @@ static __init int hardware_setup(void)
+@@ -6351,10 +6368,12 @@ static __init int hardware_setup(void)
enable_pml = 0;
if (!enable_pml) {
@@ -29960,7 +31442,7 @@ index f34ab71..049ebd8 100644
}
kvm_set_posted_intr_wakeup_handler(wakeup_handler);
-@@ -8615,6 +8636,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -8673,6 +8692,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
"jmp 2f \n\t"
"1: " __ex(ASM_VMX_VMRESUME) "\n\t"
"2: "
@@ -29973,7 +31455,7 @@ index f34ab71..049ebd8 100644
/* Save guest registers, load host registers, keep flags */
"mov %0, %c[wordsize](%%" _ASM_SP ") \n\t"
"pop %0 \n\t"
-@@ -8667,6 +8694,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -8725,6 +8750,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))
@@ -29985,7 +31467,7 @@ index f34ab71..049ebd8 100644
: "cc", "memory"
#ifdef CONFIG_X86_64
, "rax", "rbx", "rdi", "rsi"
-@@ -8680,7 +8712,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -8738,7 +8768,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
if (debugctlmsr)
update_debugctlmsr(debugctlmsr);
@@ -29994,7 +31476,7 @@ index f34ab71..049ebd8 100644
/*
* The sysexit path does not restore ds/es, so we must set them to
* a reasonable value ourselves.
-@@ -8689,8 +8721,18 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -8747,8 +8777,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.
*/
@@ -30015,7 +31497,7 @@ index f34ab71..049ebd8 100644
#endif
vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP)
-@@ -10772,7 +10814,7 @@ out:
+@@ -10830,7 +10870,7 @@ out:
return ret;
}
@@ -30025,10 +31507,10 @@ index f34ab71..049ebd8 100644
.disabled_by_bios = vmx_disabled_by_bios,
.hardware_setup = hardware_setup,
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
-index 7eb4ebd..9431608 100644
+index eca5bd9..5cf1b68 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
-@@ -1937,8 +1937,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
+@@ -1945,8 +1945,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
{
struct kvm *kvm = vcpu->kvm;
int lm = is_long_mode(vcpu);
@@ -30039,7 +31521,7 @@ index 7eb4ebd..9431608 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;
-@@ -2636,6 +2636,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
+@@ -2647,6 +2647,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
if (n < msr_list.nmsrs)
goto out;
r = -EFAULT;
@@ -30048,7 +31530,7 @@ index 7eb4ebd..9431608 100644
if (copy_to_user(user_msr_list->indices, &msrs_to_save,
num_msrs_to_save * sizeof(u32)))
goto out;
-@@ -3029,7 +3031,7 @@ static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu,
+@@ -3047,7 +3049,7 @@ static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu,
static void fill_xsave(u8 *dest, struct kvm_vcpu *vcpu)
{
@@ -30057,7 +31539,7 @@ index 7eb4ebd..9431608 100644
u64 xstate_bv = xsave->header.xfeatures;
u64 valid;
-@@ -3065,7 +3067,7 @@ static void fill_xsave(u8 *dest, struct kvm_vcpu *vcpu)
+@@ -3083,7 +3085,7 @@ static void fill_xsave(u8 *dest, struct kvm_vcpu *vcpu)
static void load_xsave(struct kvm_vcpu *vcpu, u8 *src)
{
@@ -30066,7 +31548,7 @@ index 7eb4ebd..9431608 100644
u64 xstate_bv = *(u64 *)(src + XSAVE_HDR_OFFSET);
u64 valid;
-@@ -3109,7 +3111,7 @@ static void kvm_vcpu_ioctl_x86_get_xsave(struct kvm_vcpu *vcpu,
+@@ -3127,7 +3129,7 @@ static void kvm_vcpu_ioctl_x86_get_xsave(struct kvm_vcpu *vcpu,
fill_xsave((u8 *) guest_xsave->region, vcpu);
} else {
memcpy(guest_xsave->region,
@@ -30075,7 +31557,7 @@ index 7eb4ebd..9431608 100644
sizeof(struct fxregs_state));
*(u64 *)&guest_xsave->region[XSAVE_HDR_OFFSET / sizeof(u32)] =
XFEATURE_MASK_FPSSE;
-@@ -3134,7 +3136,7 @@ static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu,
+@@ -3152,7 +3154,7 @@ static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu,
} else {
if (xstate_bv & ~XFEATURE_MASK_FPSSE)
return -EINVAL;
@@ -30084,7 +31566,7 @@ index 7eb4ebd..9431608 100644
guest_xsave->region, sizeof(struct fxregs_state));
}
return 0;
-@@ -6362,6 +6364,7 @@ void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm,
+@@ -6422,6 +6424,7 @@ void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm,
* exiting to the userspace. Otherwise, the value will be returned to the
* userspace.
*/
@@ -30092,7 +31574,7 @@ index 7eb4ebd..9431608 100644
static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
{
int r;
-@@ -6612,6 +6615,7 @@ out:
+@@ -6686,6 +6689,7 @@ out:
return r;
}
@@ -30100,7 +31582,7 @@ index 7eb4ebd..9431608 100644
static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu)
{
if (!kvm_arch_vcpu_runnable(vcpu) &&
-@@ -7159,7 +7163,7 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
+@@ -7233,7 +7237,7 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
{
struct fxregs_state *fxsave =
@@ -30109,7 +31591,7 @@ index 7eb4ebd..9431608 100644
memcpy(fpu->fpr, fxsave->st_space, 128);
fpu->fcw = fxsave->cwd;
-@@ -7176,7 +7180,7 @@ int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
+@@ -7250,7 +7254,7 @@ int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
{
struct fxregs_state *fxsave =
@@ -30118,7 +31600,7 @@ index 7eb4ebd..9431608 100644
memcpy(fxsave->st_space, fpu->fpr, 128);
fxsave->cwd = fpu->fcw;
-@@ -7192,9 +7196,9 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
+@@ -7266,9 +7270,9 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
static void fx_init(struct kvm_vcpu *vcpu)
{
@@ -30130,7 +31612,7 @@ index 7eb4ebd..9431608 100644
host_xcr0 | XSTATE_COMPACTION_ENABLED;
/*
-@@ -7218,7 +7222,7 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
+@@ -7292,7 +7296,7 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
kvm_put_guest_xcr0(vcpu);
vcpu->guest_fpu_loaded = 1;
__kernel_fpu_begin();
@@ -30139,7 +31621,7 @@ index 7eb4ebd..9431608 100644
trace_kvm_fpu(1);
}
-@@ -7521,6 +7525,8 @@ bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu)
+@@ -7595,6 +7599,8 @@ bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu)
struct static_key kvm_no_apic_vcpu __read_mostly;
@@ -30148,7 +31630,7 @@ index 7eb4ebd..9431608 100644
int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
{
struct page *page;
-@@ -7537,11 +7543,14 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
+@@ -7612,11 +7618,14 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
else
vcpu->arch.mp_state = KVM_MP_STATE_UNINITIALIZED;
@@ -30167,7 +31649,7 @@ index 7eb4ebd..9431608 100644
vcpu->arch.pio_data = page_address(page);
kvm_set_tsc_khz(vcpu, max_tsc_khz);
-@@ -7597,6 +7606,9 @@ fail_mmu_destroy:
+@@ -7674,6 +7683,9 @@ fail_mmu_destroy:
kvm_mmu_destroy(vcpu);
fail_free_pio_data:
free_page((unsigned long)vcpu->arch.pio_data);
@@ -30177,7 +31659,7 @@ index 7eb4ebd..9431608 100644
fail:
return r;
}
-@@ -7614,6 +7626,8 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
+@@ -7692,6 +7704,8 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
free_page((unsigned long)vcpu->arch.pio_data);
if (!lapic_in_kernel(vcpu))
static_key_slow_dec(&kvm_no_apic_vcpu);
@@ -30187,7 +31669,7 @@ index 7eb4ebd..9431608 100644
void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu)
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
-index a43b2ea..e64e453 100644
+index 4ba229a..470f861 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -1336,9 +1336,10 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count)
@@ -32779,10 +34261,10 @@ index 5e044d5..d342fce 100644
#define FPU_CS (*(unsigned short *) &(FPU_info->regs->cs))
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
-index 65c47fd..3e0fd98 100644
+index f9d38a4..556175f 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
-@@ -33,3 +33,7 @@ obj-$(CONFIG_ACPI_NUMA) += srat.o
+@@ -34,3 +34,7 @@ obj-$(CONFIG_ACPI_NUMA) += srat.o
obj-$(CONFIG_NUMA_EMU) += numa_emulation.o
obj-$(CONFIG_X86_INTEL_MPX) += mpx.o
@@ -33590,10 +35072,10 @@ index e830c71..f7e9e6c 100644
+ return ret ? -EFAULT : 0;
+}
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
-index ae9a37b..c5f8310 100644
+index d8a798d..6f803ca 100644
--- a/arch/x86/mm/gup.c
+++ b/arch/x86/mm/gup.c
-@@ -266,7 +266,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
+@@ -302,7 +302,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
addr = start;
len = (unsigned long) nr_pages << PAGE_SHIFT;
end = start + len;
@@ -33602,7 +35084,7 @@ index ae9a37b..c5f8310 100644
(void __user *)start, len)))
return 0;
-@@ -342,6 +342,10 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
+@@ -378,6 +378,10 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
goto slow_irqon;
#endif
@@ -33639,7 +35121,7 @@ index a6d7392..3b105a8 100644
return (void *)vaddr;
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
-index 42982b2..7168fc3 100644
+index 740d7ac..4091827 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -74,23 +74,24 @@ int pud_huge(pud_t pud)
@@ -34204,10 +35686,10 @@ index cb4ef3d..377ec5a 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 ec081fe..14e8743 100644
+index 5488d21..6063860 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
-@@ -136,7 +136,7 @@ int kernel_ident_mapping_init(struct x86_mapping_info *info, pgd_t *pgd_page,
+@@ -137,7 +137,7 @@ int kernel_ident_mapping_init(struct x86_mapping_info *info, pgd_t *pgd_page,
* around without checking the pgd every time.
*/
@@ -34216,7 +35698,7 @@ index ec081fe..14e8743 100644
EXPORT_SYMBOL_GPL(__supported_pte_mask);
int force_personality32;
-@@ -169,7 +169,12 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
+@@ -170,7 +170,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);
@@ -34229,7 +35711,7 @@ index ec081fe..14e8743 100644
/*
* When it is called after memory hot remove, pgd_none()
-@@ -180,6 +185,25 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
+@@ -181,6 +186,25 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
continue;
spin_lock(&pgd_lock);
@@ -34255,7 +35737,7 @@ index ec081fe..14e8743 100644
list_for_each_entry(page, &pgd_list, lru) {
pgd_t *pgd;
spinlock_t *pgt_lock;
-@@ -188,6 +212,7 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
+@@ -189,6 +213,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);
@@ -34263,7 +35745,7 @@ index ec081fe..14e8743 100644
if (!pgd_none(*pgd_ref) && !pgd_none(*pgd))
BUG_ON(pgd_page_vaddr(*pgd)
-@@ -201,7 +226,10 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
+@@ -202,7 +227,10 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
set_pgd(pgd, *pgd_ref);
}
@@ -34274,7 +35756,7 @@ index ec081fe..14e8743 100644
}
spin_unlock(&pgd_lock);
}
-@@ -234,7 +262,7 @@ static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
+@@ -235,7 +263,7 @@ static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
{
if (pgd_none(*pgd)) {
pud_t *pud = (pud_t *)spp_getpage();
@@ -34283,7 +35765,7 @@ index ec081fe..14e8743 100644
if (pud != pud_offset(pgd, 0))
printk(KERN_ERR "PAGETABLE BUG #00! %p <-> %p\n",
pud, pud_offset(pgd, 0));
-@@ -246,7 +274,7 @@ static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
+@@ -247,7 +275,7 @@ static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
{
if (pud_none(*pud)) {
pmd_t *pmd = (pmd_t *) spp_getpage();
@@ -34292,7 +35774,7 @@ index ec081fe..14e8743 100644
if (pmd != pmd_offset(pud, 0))
printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
pmd, pmd_offset(pud, 0));
-@@ -275,7 +303,9 @@ void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte)
+@@ -276,7 +304,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);
@@ -34302,7 +35784,7 @@ index ec081fe..14e8743 100644
/*
* It's enough to flush this one mapping.
-@@ -337,14 +367,12 @@ static void __init __init_extra_mapping(unsigned long phys, unsigned long size,
+@@ -338,14 +368,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();
@@ -34319,7 +35801,7 @@ index ec081fe..14e8743 100644
}
pmd = pmd_offset(pud, phys);
BUG_ON(!pmd_none(*pmd));
-@@ -585,7 +613,7 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end,
+@@ -586,7 +614,7 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end,
prot);
spin_lock(&init_mm.page_table_lock);
@@ -34328,7 +35810,7 @@ index ec081fe..14e8743 100644
spin_unlock(&init_mm.page_table_lock);
}
__flush_tlb_all();
-@@ -626,7 +654,7 @@ kernel_physical_mapping_init(unsigned long start,
+@@ -627,7 +655,7 @@ kernel_physical_mapping_init(unsigned long start,
page_size_mask);
spin_lock(&init_mm.page_table_lock);
@@ -34354,7 +35836,7 @@ index 9c0ff04..9020d5f 100644
return (void *)vaddr;
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
-index b9c78f3..c757af4 100644
+index 0d8d53d..5f7315c 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -59,8 +59,8 @@ static int __ioremap_check_ram(unsigned long start_pfn, unsigned long nr_pages,
@@ -34464,7 +35946,7 @@ index b4f2e7e..96c9c3e 100644
pte = kmemcheck_pte_lookup(address);
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
-index 844b06d..f363c86 100644
+index 72bb52f..4bc6d52 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -52,7 +52,7 @@ static unsigned long stack_maxrandom_size(void)
@@ -34631,18 +36113,9 @@ index ef05755..7125725 100644
err_out:
/* info might be NULL, but kfree() handles that */
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
-index c3b3f65..5bfe5dc 100644
+index d04f809..683f0be 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
-@@ -469,7 +469,7 @@ static void __init numa_clear_kernel_node_hotplug(void)
- {
- int i, nid;
- nodemask_t numa_kernel_nodes = NODE_MASK_NONE;
-- unsigned long start, end;
-+ u64 start, end;
- struct memblock_region *r;
-
- /*
@@ -508,7 +508,7 @@ static void __init numa_clear_kernel_node_hotplug(void)
}
}
@@ -34653,10 +36126,10 @@ index c3b3f65..5bfe5dc 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 b599a78..4ac899d 100644
+index 9cf96d8..ce09f13 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
-@@ -259,7 +259,7 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
+@@ -264,7 +264,7 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
*/
#ifdef CONFIG_PCI_BIOS
if (pcibios_enabled && within(pfn, BIOS_BEGIN >> PAGE_SHIFT, BIOS_END >> PAGE_SHIFT))
@@ -34665,7 +36138,7 @@ index b599a78..4ac899d 100644
#endif
/*
-@@ -267,9 +267,10 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
+@@ -272,9 +272,10 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
* Does not cover __inittext since that is gone later on. On
* 64bit we do not enforce !NX on the low mapping
*/
@@ -34678,7 +36151,7 @@ index b599a78..4ac899d 100644
/*
* The .rodata section needs to be read-only. Using the pfn
* catches all aliases.
-@@ -277,6 +278,7 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
+@@ -282,6 +283,7 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
if (within(pfn, __pa_symbol(__start_rodata) >> PAGE_SHIFT,
__pa_symbol(__end_rodata) >> PAGE_SHIFT))
pgprot_val(forbidden) |= _PAGE_RW;
@@ -34686,7 +36159,7 @@ index b599a78..4ac899d 100644
#if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA)
/*
-@@ -315,6 +317,13 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
+@@ -320,6 +322,13 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
}
#endif
@@ -34700,7 +36173,7 @@ index b599a78..4ac899d 100644
prot = __pgprot(pgprot_val(prot) & ~pgprot_val(forbidden));
return prot;
-@@ -451,23 +460,37 @@ EXPORT_SYMBOL_GPL(slow_virt_to_phys);
+@@ -456,23 +465,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 */
@@ -34740,7 +36213,7 @@ index b599a78..4ac899d 100644
}
static int
-@@ -704,6 +727,10 @@ __split_large_page(struct cpa_data *cpa, pte_t *kpte, unsigned long address,
+@@ -709,6 +732,10 @@ __split_large_page(struct cpa_data *cpa, pte_t *kpte, unsigned long address,
return 0;
}
@@ -34751,7 +36224,7 @@ index b599a78..4ac899d 100644
static int split_large_page(struct cpa_data *cpa, pte_t *kpte,
unsigned long address)
{
-@@ -1147,6 +1174,9 @@ static int __cpa_process_fault(struct cpa_data *cpa, unsigned long vaddr,
+@@ -1152,6 +1179,9 @@ static int __cpa_process_fault(struct cpa_data *cpa, unsigned long vaddr,
}
}
@@ -34761,7 +36234,7 @@ index b599a78..4ac899d 100644
static int __change_page_attr(struct cpa_data *cpa, int primary)
{
unsigned long address;
-@@ -1205,7 +1235,9 @@ repeat:
+@@ -1210,7 +1240,9 @@ repeat:
* Do we really change anything ?
*/
if (pte_val(old_pte) != pte_val(new_pte)) {
@@ -34772,19 +36245,19 @@ index b599a78..4ac899d 100644
}
cpa->numpages = 1;
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
-index 188e3e0..5c75446 100644
+index f4ae536..e250eec 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
-@@ -588,7 +588,7 @@ int free_memtype(u64 start, u64 end)
+@@ -589,7 +589,7 @@ int free_memtype(u64 start, u64 end)
- if (!entry) {
+ if (IS_ERR(entry)) {
pr_info("x86/PAT: %s:%d freeing invalid memtype [mem %#010Lx-%#010Lx]\n",
- current->comm, current->pid, start, end - 1);
+ current->comm, task_pid_nr(current), start, end - 1);
return -EINVAL;
}
-@@ -711,8 +711,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
+@@ -712,8 +712,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
while (cursor < to) {
if (!devmem_is_allowed(pfn)) {
@@ -34795,7 +36268,7 @@ index 188e3e0..5c75446 100644
return 0;
}
cursor += PAGE_SIZE;
-@@ -782,7 +782,7 @@ int kernel_map_sync_memtype(u64 base, unsigned long size,
+@@ -783,7 +783,7 @@ int kernel_map_sync_memtype(u64 base, unsigned long size,
if (ioremap_change_attr((unsigned long)__va(base), id_sz, pcm) < 0) {
pr_info("x86/PAT: %s:%d ioremap_change_attr failed %s for [mem %#010Lx-%#010Lx]\n",
@@ -34804,7 +36277,7 @@ index 188e3e0..5c75446 100644
cattr_name(pcm),
base, (unsigned long long)(base + size-1));
return -EINVAL;
-@@ -817,7 +817,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
+@@ -818,7 +818,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
pcm = lookup_memtype(paddr);
if (want_pcm != pcm) {
pr_warn("x86/PAT: %s:%d map pfn RAM range req %s for [mem %#010Lx-%#010Lx], got %s\n",
@@ -34813,7 +36286,7 @@ index 188e3e0..5c75446 100644
cattr_name(want_pcm),
(unsigned long long)paddr,
(unsigned long long)(paddr + size - 1),
-@@ -838,7 +838,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
+@@ -839,7 +839,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
!is_new_memtype_allowed(paddr, size, want_pcm, pcm)) {
free_memtype(paddr, paddr + size);
pr_err("x86/PAT: %s:%d map pfn expected mapping type %s for [mem %#010Lx-%#010Lx], got %s\n",
@@ -34823,10 +36296,10 @@ index 188e3e0..5c75446 100644
(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 6393108..890adda 100644
+index 2f770225..22a4d23 100644
--- a/arch/x86/mm/pat_rbtree.c
+++ b/arch/x86/mm/pat_rbtree.c
-@@ -161,7 +161,7 @@ success:
+@@ -171,7 +171,7 @@ success:
failure:
pr_info("x86/PAT: %s:%d conflicting memory types %Lx-%Lx %s<->%s\n",
@@ -34885,7 +36358,7 @@ index 9f0614d..92ae64a 100644
p += get_opcode(p, &opcode);
for (i = 0; i < ARRAY_SIZE(imm_wop); i++)
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
-index fb0a9dd..5ab49c4 100644
+index 4eb287e..e91945b 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -98,10 +98,75 @@ static inline void pgd_list_del(pgd_t *pgd)
@@ -35173,7 +36646,7 @@ index fb0a9dd..5ab49c4 100644
pgd_dtor(pgd);
paravirt_pgd_free(mm, pgd);
_pgd_free(pgd);
-@@ -544,6 +616,55 @@ void __init reserve_top_address(unsigned long reserve)
+@@ -526,6 +598,50 @@ void __init reserve_top_address(unsigned long reserve)
int fixmaps_set;
@@ -35192,11 +36665,6 @@ index fb0a9dd..5ab49c4 100644
+ case VSYSCALL_PAGE:
+ break;
+#endif
-+
-+#ifdef CONFIG_PARAVIRT_CLOCK
-+ case PVCLOCK_FIXMAP_BEGIN ... PVCLOCK_FIXMAP_END:
-+ break;
-+#endif
+ }
+
+ pgd = pgd_offset_k(address);
@@ -35229,7 +36697,7 @@ index fb0a9dd..5ab49c4 100644
void __native_set_fixmap(enum fixed_addresses idx, pte_t pte)
{
unsigned long address = __fix_to_virt(idx);
-@@ -554,6 +675,7 @@ void __native_set_fixmap(enum fixed_addresses idx, pte_t pte)
+@@ -536,6 +652,7 @@ void __native_set_fixmap(enum fixed_addresses idx, pte_t pte)
}
set_pte_vaddr(address, pte);
fixmaps_set++;
@@ -35237,7 +36705,7 @@ index fb0a9dd..5ab49c4 100644
}
void native_set_fixmap(enum fixed_addresses idx, phys_addr_t phys,
-@@ -620,9 +742,11 @@ int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot)
+@@ -602,9 +719,11 @@ int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot)
prot = pgprot_4k_2_large(prot);
@@ -35268,7 +36736,7 @@ index 75cc097..79a097f 100644
/*
* It's enough to flush this one mapping.
diff --git a/arch/x86/mm/setup_nx.c b/arch/x86/mm/setup_nx.c
-index 90555bf..f5f1828 100644
+index 92e2eac..92fc081 100644
--- a/arch/x86/mm/setup_nx.c
+++ b/arch/x86/mm/setup_nx.c
@@ -5,8 +5,10 @@
@@ -35293,7 +36761,7 @@ index 90555bf..f5f1828 100644
void x86_configure_nx(void)
{
+#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
- if (cpu_has_nx && !disable_nx)
+ if (boot_cpu_has(X86_FEATURE_NX) && !disable_nx)
__supported_pte_mask |= _PAGE_NX;
else
+#endif
@@ -35449,7 +36917,7 @@ index 4093216..44b6b83 100644
+ pax_force_retaddr
ret
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
-index 7599197..8e986f3 100644
+index 4286f36..54471fd 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -14,7 +14,11 @@
@@ -35474,7 +36942,7 @@ index 7599197..8e986f3 100644
}
struct jit_context {
-@@ -1030,7 +1036,9 @@ common_load:
+@@ -1060,7 +1066,9 @@ common_load:
pr_err("bpf_jit_compile fatal error\n");
return -EFAULT;
}
@@ -35484,7 +36952,7 @@ index 7599197..8e986f3 100644
}
proglen += ilen;
addrs[i] = proglen;
-@@ -1107,7 +1115,6 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
+@@ -1137,7 +1145,6 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
if (image) {
bpf_flush_icache(header, image + proglen);
@@ -35492,7 +36960,7 @@ index 7599197..8e986f3 100644
prog->bpf_func = (void *)image;
prog->jited = 1;
}
-@@ -1120,12 +1127,8 @@ void bpf_jit_free(struct bpf_prog *fp)
+@@ -1150,12 +1157,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;
@@ -35535,7 +37003,7 @@ index 4e664bd..2beeaa2 100644
return NULL;
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
-index 1d2e639..f6ef82a 100644
+index 1d2e639..d7f0e67 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -23,6 +23,7 @@
@@ -35546,6 +37014,15 @@ index 1d2e639..f6ef82a 100644
#include "op_counter.h"
#include "op_x86_model.h"
+@@ -614,7 +615,7 @@ enum __force_cpu_type {
+
+ static int force_cpu_type;
+
+-static int set_cpu_type(const char *str, struct kernel_param *kp)
++static int set_cpu_type(const char *str, const struct kernel_param *kp)
+ {
+ if (!strcmp(str, "timer")) {
+ force_cpu_type = timer;
@@ -785,8 +786,11 @@ int __init op_nmi_init(struct oprofile_operations *ops)
if (ret)
return ret;
@@ -35671,7 +37148,7 @@ index 9bd1154..e9d4656 100644
.callback = fix_broken_hp_bios_irq9,
.ident = "HP Pavilion N5400 Series Laptop",
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
-index 9b83b90..2c256c5 100644
+index 9770e55..76067ec 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -79,7 +79,7 @@ union bios32 {
@@ -35803,129 +37280,51 @@ index 9b83b90..2c256c5 100644
: "memory");
local_irq_restore(flags);
-@@ -189,7 +235,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
-
- switch (len) {
- case 1:
-- __asm__("lcall *(%%esi); cld\n\t"
-+ __asm__("movw %w6, %%ds\n\t"
-+ "lcall *%%ss:(%%esi); cld\n\t"
-+ "push %%ss\n\t"
-+ "pop %%ds\n\t"
- "jc 1f\n\t"
- "xor %%ah, %%ah\n"
- "1:"
-@@ -198,7 +247,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
- : "1" (PCIBIOS_READ_CONFIG_BYTE),
- "b" (bx),
- "D" ((long)reg),
-- "S" (&pci_indirect));
-+ "S" (&pci_indirect),
-+ "r" (__PCIBIOS_DS));
- /*
- * Zero-extend the result beyond 8 bits, do not trust the
- * BIOS having done it:
-@@ -206,7 +256,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
- *value &= 0xff;
- break;
- case 2:
-- __asm__("lcall *(%%esi); cld\n\t"
-+ __asm__("movw %w6, %%ds\n\t"
-+ "lcall *%%ss:(%%esi); cld\n\t"
-+ "push %%ss\n\t"
-+ "pop %%ds\n\t"
- "jc 1f\n\t"
- "xor %%ah, %%ah\n"
- "1:"
-@@ -215,7 +268,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
- : "1" (PCIBIOS_READ_CONFIG_WORD),
- "b" (bx),
- "D" ((long)reg),
-- "S" (&pci_indirect));
-+ "S" (&pci_indirect),
-+ "r" (__PCIBIOS_DS));
- /*
- * Zero-extend the result beyond 16 bits, do not trust the
- * BIOS having done it:
-@@ -223,7 +277,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
- *value &= 0xffff;
- break;
- case 4:
-- __asm__("lcall *(%%esi); cld\n\t"
-+ __asm__("movw %w6, %%ds\n\t"
-+ "lcall *%%ss:(%%esi); cld\n\t"
-+ "push %%ss\n\t"
-+ "pop %%ds\n\t"
- "jc 1f\n\t"
- "xor %%ah, %%ah\n"
- "1:"
-@@ -232,7 +289,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
- : "1" (PCIBIOS_READ_CONFIG_DWORD),
- "b" (bx),
- "D" ((long)reg),
-- "S" (&pci_indirect));
-+ "S" (&pci_indirect),
-+ "r" (__PCIBIOS_DS));
+@@ -202,7 +248,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
break;
}
-@@ -256,7 +314,10 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
-
- switch (len) {
- case 1:
-- __asm__("lcall *(%%esi); cld\n\t"
-+ __asm__("movw %w6, %%ds\n\t"
-+ "lcall *%%ss:(%%esi); cld\n\t"
-+ "push %%ss\n\t"
-+ "pop %%ds\n\t"
- "jc 1f\n\t"
- "xor %%ah, %%ah\n"
- "1:"
-@@ -265,10 +326,14 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
- "c" (value),
- "b" (bx),
- "D" ((long)reg),
-- "S" (&pci_indirect));
-+ "S" (&pci_indirect),
-+ "r" (__PCIBIOS_DS));
- break;
- case 2:
-- __asm__("lcall *(%%esi); cld\n\t"
-+ __asm__("movw %w6, %%ds\n\t"
-+ "lcall *%%ss:(%%esi); cld\n\t"
-+ "push %%ss\n\t"
-+ "pop %%ds\n\t"
- "jc 1f\n\t"
- "xor %%ah, %%ah\n"
- "1:"
-@@ -277,10 +342,14 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
- "c" (value),
- "b" (bx),
- "D" ((long)reg),
-- "S" (&pci_indirect));
-+ "S" (&pci_indirect),
-+ "r" (__PCIBIOS_DS));
- break;
- case 4:
-- __asm__("lcall *(%%esi); cld\n\t"
-+ __asm__("movw %w6, %%ds\n\t"
-+ "lcall *%%ss:(%%esi); cld\n\t"
-+ "push %%ss\n\t"
-+ "pop %%ds\n\t"
- "jc 1f\n\t"
- "xor %%ah, %%ah\n"
- "1:"
-@@ -289,7 +358,8 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
- "c" (value),
- "b" (bx),
- "D" ((long)reg),
-- "S" (&pci_indirect));
-+ "S" (&pci_indirect),
-+ "r" (__PCIBIOS_DS));
+- __asm__("lcall *(%%esi); cld\n\t"
++ __asm__("movw %w6, %%ds\n\t"
++ "lcall *%%ss:(%%esi); cld\n\t"
++ "push %%ss\n\t"
++ "pop %%ds\n\t"
+ "jc 1f\n\t"
+ "xor %%ah, %%ah\n"
+ "1:"
+@@ -211,7 +260,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
+ : "1" (number),
+ "b" (bx),
+ "D" ((long)reg),
+- "S" (&pci_indirect));
++ "S" (&pci_indirect),
++ "r" (__PCIBIOS_DS));
+ /*
+ * Zero-extend the result beyond 8 or 16 bits, do not trust the
+ * BIOS having done it:
+@@ -250,7 +300,10 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
break;
}
-@@ -394,10 +464,13 @@ struct irq_routing_table * pcibios_get_irq_routing_table(void)
+- __asm__("lcall *(%%esi); cld\n\t"
++ __asm__("movw %w6, %%ds\n\t"
++ "lcall *%%ss:(%%esi); cld\n\t"
++ "push %%ss\n\t"
++ "pop %%ds\n\t"
+ "jc 1f\n\t"
+ "xor %%ah, %%ah\n"
+ "1:"
+@@ -259,7 +312,8 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
+ "c" (value),
+ "b" (bx),
+ "D" ((long)reg),
+- "S" (&pci_indirect));
++ "S" (&pci_indirect),
++ "r" (__PCIBIOS_DS));
+
+ raw_spin_unlock_irqrestore(&pci_config_lock, flags);
+
+@@ -362,10 +416,13 @@ struct irq_routing_table * pcibios_get_irq_routing_table(void)
DBG("PCI: Fetching IRQ routing table... ");
__asm__("push %%es\n\t"
@@ -35940,7 +37339,7 @@ index 9b83b90..2c256c5 100644
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
-@@ -408,7 +481,8 @@ struct irq_routing_table * pcibios_get_irq_routing_table(void)
+@@ -376,7 +433,8 @@ struct irq_routing_table * pcibios_get_irq_routing_table(void)
"1" (0),
"D" ((long) &opt),
"S" (&pci_indirect),
@@ -35950,7 +37349,7 @@ index 9b83b90..2c256c5 100644
: "memory");
DBG("OK ret=%d, size=%d, map=%x\n", ret, opt.size, map);
if (ret & 0xff00)
-@@ -432,7 +506,10 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
+@@ -400,7 +458,10 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
{
int ret;
@@ -35962,7 +37361,7 @@ index 9b83b90..2c256c5 100644
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
-@@ -440,7 +517,8 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
+@@ -408,7 +469,8 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
: "0" (PCIBIOS_SET_PCI_HW_INT),
"b" ((dev->bus->number << 8) | dev->devfn),
"c" ((irq << 8) | (pin + 10)),
@@ -35972,6 +37371,35 @@ index 9b83b90..2c256c5 100644
return !(ret & 0xff00);
}
EXPORT_SYMBOL(pcibios_set_irq_routing);
+diff --git a/arch/x86/pci/vmd.c b/arch/x86/pci/vmd.c
+index d57e480..20eb97a 100644
+--- a/arch/x86/pci/vmd.c
++++ b/arch/x86/pci/vmd.c
+@@ -374,7 +374,7 @@ static void vmd_teardown_dma_ops(struct vmd_dev *vmd)
+ #define ASSIGN_VMD_DMA_OPS(source, dest, fn) \
+ do { \
+ if (source->fn) \
+- dest->fn = vmd_##fn; \
++ *(void **)&dest->fn = vmd_##fn; \
+ } while (0)
+
+ static void vmd_setup_dma_ops(struct vmd_dev *vmd)
+@@ -388,6 +388,7 @@ static void vmd_setup_dma_ops(struct vmd_dev *vmd)
+
+ if (!source)
+ return;
++ pax_open_kernel();
+ ASSIGN_VMD_DMA_OPS(source, dest, alloc);
+ ASSIGN_VMD_DMA_OPS(source, dest, free);
+ ASSIGN_VMD_DMA_OPS(source, dest, mmap);
+@@ -405,6 +406,7 @@ static void vmd_setup_dma_ops(struct vmd_dev *vmd)
+ #ifdef ARCH_HAS_DMA_GET_REQUIRED_MASK
+ ASSIGN_VMD_DMA_OPS(source, dest, get_required_mask);
+ #endif
++ pax_close_kernel();
+ add_dma_domain(domain);
+ }
+ #undef ASSIGN_VMD_DMA_OPS
diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c
index ed5b673..24d2d53 100644
--- a/arch/x86/platform/efi/efi_32.c
@@ -36221,7 +37649,7 @@ index 86d0f9e..6d499f4 100644
ENDPROC(efi_call)
diff --git a/arch/x86/platform/intel-mid/intel-mid.c b/arch/x86/platform/intel-mid/intel-mid.c
-index 1bbc21e..8a50853 100644
+index 90bb997..3cca066 100644
--- a/arch/x86/platform/intel-mid/intel-mid.c
+++ b/arch/x86/platform/intel-mid/intel-mid.c
@@ -63,7 +63,7 @@ enum intel_mid_timer_options intel_mid_timer_options;
@@ -36318,10 +37746,10 @@ index d6ee929..3637cb5 100644
.getproplen = olpc_dt_getproplen,
.getproperty = olpc_dt_getproperty,
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
-index 9ab5279..8ba4611 100644
+index d5f6499..12939f1 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
-@@ -134,11 +134,8 @@ static void do_fpu_end(void)
+@@ -159,11 +159,8 @@ static void do_fpu_end(void)
static void fix_processor_context(void)
{
int cpu = smp_processor_id();
@@ -36335,7 +37763,7 @@ index 9ab5279..8ba4611 100644
set_tss_desc(cpu, t); /*
* This just modifies memory; should not be
* necessary. But... This is necessary, because
-@@ -147,10 +144,6 @@ static void fix_processor_context(void)
+@@ -172,10 +169,6 @@ static void fix_processor_context(void)
*/
#ifdef CONFIG_X86_64
@@ -36375,10 +37803,10 @@ index 0b7a63d..dff2199 100644
#endif
}
diff --git a/arch/x86/realmode/rm/Makefile b/arch/x86/realmode/rm/Makefile
-index 2730d77..2e4cd19 100644
+index 3e75fcf..4cfefb8 100644
--- a/arch/x86/realmode/rm/Makefile
+++ b/arch/x86/realmode/rm/Makefile
-@@ -68,5 +68,8 @@ $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
+@@ -68,6 +68,9 @@ $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
KBUILD_CFLAGS := $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
-I$(srctree)/arch/x86/boot
@@ -36387,6 +37815,7 @@ index 2730d77..2e4cd19 100644
+endif
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
+ UBSAN_SANITIZE := n
diff --git a/arch/x86/realmode/rm/header.S b/arch/x86/realmode/rm/header.S
index a28221d..93c40f1 100644
--- a/arch/x86/realmode/rm/header.S
@@ -36514,7 +37943,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 0c2fae8..88d7719 100644
+index 0c2fae8..1d2a079 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -1,5 +1,7 @@
@@ -36533,7 +37962,15 @@ index 0c2fae8..88d7719 100644
struct relocs {
uint32_t *offset;
-@@ -386,9 +389,39 @@ static void read_ehdr(FILE *fp)
+@@ -45,6 +48,7 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
+ "^(xen_irq_disable_direct_reloc$|"
+ "xen_save_fl_direct_reloc$|"
+ "VDSO|"
++ "__rap_hash_|"
+ "__crc_)",
+
+ /*
+@@ -386,9 +390,39 @@ static void read_ehdr(FILE *fp)
}
}
@@ -36574,7 +38011,7 @@ index 0c2fae8..88d7719 100644
Elf_Shdr shdr;
secs = calloc(ehdr.e_shnum, sizeof(struct section));
-@@ -423,7 +456,7 @@ static void read_shdrs(FILE *fp)
+@@ -423,7 +457,7 @@ static void read_shdrs(FILE *fp)
static void read_strtabs(FILE *fp)
{
@@ -36583,7 +38020,7 @@ index 0c2fae8..88d7719 100644
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_STRTAB) {
-@@ -448,7 +481,7 @@ static void read_strtabs(FILE *fp)
+@@ -448,7 +482,7 @@ static void read_strtabs(FILE *fp)
static void read_symtabs(FILE *fp)
{
@@ -36592,7 +38029,7 @@ index 0c2fae8..88d7719 100644
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_SYMTAB) {
-@@ -479,9 +512,11 @@ static void read_symtabs(FILE *fp)
+@@ -479,9 +513,11 @@ static void read_symtabs(FILE *fp)
}
@@ -36606,7 +38043,7 @@ index 0c2fae8..88d7719 100644
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_REL_TYPE) {
-@@ -501,9 +536,22 @@ static void read_relocs(FILE *fp)
+@@ -501,9 +537,22 @@ static void read_relocs(FILE *fp)
die("Cannot read symbol table: %s\n",
strerror(errno));
}
@@ -36630,7 +38067,7 @@ index 0c2fae8..88d7719 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);
-@@ -515,7 +563,7 @@ static void read_relocs(FILE *fp)
+@@ -515,7 +564,7 @@ static void read_relocs(FILE *fp)
static void print_absolute_symbols(void)
{
@@ -36639,7 +38076,7 @@ index 0c2fae8..88d7719 100644
const char *format;
if (ELF_BITS == 64)
-@@ -528,7 +576,7 @@ static void print_absolute_symbols(void)
+@@ -528,7 +577,7 @@ static void print_absolute_symbols(void)
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
char *sym_strtab;
@@ -36648,7 +38085,7 @@ index 0c2fae8..88d7719 100644
if (sec->shdr.sh_type != SHT_SYMTAB) {
continue;
-@@ -555,7 +603,7 @@ static void print_absolute_symbols(void)
+@@ -555,7 +604,7 @@ static void print_absolute_symbols(void)
static void print_absolute_relocs(void)
{
@@ -36657,7 +38094,7 @@ index 0c2fae8..88d7719 100644
const char *format;
if (ELF_BITS == 64)
-@@ -568,7 +616,7 @@ static void print_absolute_relocs(void)
+@@ -568,7 +617,7 @@ static void print_absolute_relocs(void)
struct section *sec_applies, *sec_symtab;
char *sym_strtab;
Elf_Sym *sh_symtab;
@@ -36666,7 +38103,7 @@ index 0c2fae8..88d7719 100644
if (sec->shdr.sh_type != SHT_REL_TYPE) {
continue;
}
-@@ -645,13 +693,13 @@ static void add_reloc(struct relocs *r, uint32_t offset)
+@@ -645,13 +694,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))
{
@@ -36682,7 +38119,7 @@ index 0c2fae8..88d7719 100644
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_REL_TYPE) {
-@@ -697,7 +745,7 @@ static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel,
+@@ -697,7 +746,7 @@ static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel,
* kernel data and does not require special treatment.
*
*/
@@ -36691,7 +38128,7 @@ index 0c2fae8..88d7719 100644
static Elf_Addr per_cpu_load_addr;
static void percpu_init(void)
-@@ -830,6 +878,23 @@ static int do_reloc32(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
+@@ -830,6 +879,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);
@@ -36715,7 +38152,7 @@ index 0c2fae8..88d7719 100644
switch (r_type) {
case R_386_NONE:
-@@ -968,7 +1033,7 @@ static int write32_as_text(uint32_t v, FILE *f)
+@@ -968,7 +1034,7 @@ static int write32_as_text(uint32_t v, FILE *f)
static void emit_relocs(int as_text, int use_real_mode)
{
@@ -36724,7 +38161,7 @@ index 0c2fae8..88d7719 100644
int (*write_reloc)(uint32_t, FILE *) = write32;
int (*do_reloc)(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
const char *symname);
-@@ -1078,10 +1143,11 @@ void process(FILE *fp, int use_real_mode, int as_text,
+@@ -1078,10 +1144,11 @@ void process(FILE *fp, int use_real_mode, int as_text,
{
regex_init(use_real_mode);
read_ehdr(fp);
@@ -36776,7 +38213,7 @@ index c7b15f3..cc09a65 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 beab8c7..9a29803 100644
+index e3679db..16b93d1 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -131,8 +131,6 @@ EXPORT_SYMBOL_GPL(xen_start_info);
@@ -36817,8 +38254,17 @@ index beab8c7..9a29803 100644
BUG_ON(va & ~PAGE_MASK);
for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) {
-@@ -1271,7 +1267,7 @@ static const struct pv_apic_ops xen_apic_ops __initconst = {
- #endif
+@@ -777,7 +773,7 @@ static int cvt_gate_to_trap(int vector, const gate_desc *val,
+ * so we should never see them. Warn if
+ * there's an unexpected IST-using fault handler.
+ */
+- if (addr == (unsigned long)debug)
++ if (addr == (unsigned long)int1)
+ addr = (unsigned long)xen_debug;
+ else if (addr == (unsigned long)int3)
+ addr = (unsigned long)xen_int3;
+@@ -1262,7 +1258,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = {
+ .end_context_switch = xen_end_context_switch,
};
-static void xen_reboot(int reason)
@@ -36826,7 +38272,7 @@ index beab8c7..9a29803 100644
{
struct sched_shutdown r = { .reason = reason };
int cpu;
-@@ -1279,26 +1275,26 @@ static void xen_reboot(int reason)
+@@ -1270,26 +1266,26 @@ static void xen_reboot(int reason)
for_each_online_cpu(cpu)
xen_pmu_finish(cpu);
@@ -36859,7 +38305,7 @@ index beab8c7..9a29803 100644
{
if (pm_power_off)
pm_power_off();
-@@ -1451,8 +1447,11 @@ static void __ref xen_setup_gdt(int cpu)
+@@ -1442,8 +1438,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;
@@ -36873,7 +38319,7 @@ index beab8c7..9a29803 100644
pv_cpu_ops.write_gdt_entry = xen_write_gdt_entry;
pv_cpu_ops.load_gdt = xen_load_gdt;
-@@ -1570,7 +1569,17 @@ asmlinkage __visible void __init xen_start_kernel(void)
+@@ -1560,7 +1559,17 @@ asmlinkage __visible void __init xen_start_kernel(void)
__userpte_alloc_gfp &= ~__GFP_HIGHMEM;
/* Work out if we support NX */
@@ -36892,7 +38338,7 @@ index beab8c7..9a29803 100644
/* Get mfn list */
xen_build_dynamic_phys_to_machine();
-@@ -1598,13 +1607,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
+@@ -1588,13 +1597,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
machine_ops = xen_machine_ops;
@@ -36907,7 +38353,7 @@ index beab8c7..9a29803 100644
#ifdef CONFIG_ACPI_NUMA
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
-index cb5e266..cd5bcab 100644
+index c913ca4..b6d8c05 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1950,7 +1950,11 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
@@ -36954,7 +38400,7 @@ index cb5e266..cd5bcab 100644
#endif
/* This will work as long as patching hasn't happened yet
-@@ -2473,6 +2489,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = {
+@@ -2472,6 +2488,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,
@@ -37016,10 +38462,10 @@ index 3f4ebf0..f074dc1 100644
}
diff --git a/arch/x86/xen/xen-asm_32.S b/arch/x86/xen/xen-asm_32.S
-index fd92a64..1f72641 100644
+index feb6d40..e59382c 100644
--- a/arch/x86/xen/xen-asm_32.S
+++ b/arch/x86/xen/xen-asm_32.S
-@@ -99,7 +99,7 @@ ENTRY(xen_iret)
+@@ -85,7 +85,7 @@ ENTRY(xen_iret)
pushw %fs
movl $(__KERNEL_PERCPU), %eax
movl %eax, %fs
@@ -37051,7 +38497,7 @@ index b65f59a..c43f9c6 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 1399423..b1ae0fa 100644
+index 4140b07..a391b69 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -16,8 +16,6 @@ void xen_syscall_target(void);
@@ -37102,7 +38548,7 @@ 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/block/bio.c b/block/bio.c
-index d4d1443..bb167da 100644
+index cf75915..02d854f 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1143,7 +1143,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
@@ -37124,7 +38570,7 @@ index d4d1443..bb167da 100644
nr_pages += end - start;
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
-index 5a37188..0361054 100644
+index 66e6f1a..8fb30f4 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -561,10 +561,10 @@ u64 __blkg_prfill_rwstat(struct seq_file *sf, struct blkg_policy_data *pd,
@@ -37159,7 +38605,7 @@ index 5a37188..0361054 100644
percpu_counter_sum_positive(&rwstat->cpu_cnt[i]),
&sum.aux_cnt[i]);
}
-@@ -877,13 +877,13 @@ static int blkcg_print_stat(struct seq_file *sf, void *v)
+@@ -886,13 +886,13 @@ static int blkcg_print_stat(struct seq_file *sf, void *v)
rwstat = blkg_rwstat_recursive_sum(blkg, NULL,
offsetof(struct blkcg_gq, stat_bytes));
@@ -37177,24 +38623,11 @@ index 5a37188..0361054 100644
spin_unlock_irq(blkg->q->queue_lock);
-diff --git a/block/blk-iopoll.c b/block/blk-iopoll.c
-index 0736729..2ec3b48 100644
---- a/block/blk-iopoll.c
-+++ b/block/blk-iopoll.c
-@@ -74,7 +74,7 @@ void blk_iopoll_complete(struct blk_iopoll *iop)
- }
- EXPORT_SYMBOL(blk_iopoll_complete);
-
--static void blk_iopoll_softirq(struct softirq_action *h)
-+static __latent_entropy void blk_iopoll_softirq(void)
- {
- struct list_head *list = this_cpu_ptr(&blk_cpu_iopoll);
- int rearm = 0, budget = blk_iopoll_budget;
diff --git a/block/blk-map.c b/block/blk-map.c
-index f565e11..f05b424 100644
+index a54f054..760b494 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
-@@ -214,7 +214,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
+@@ -245,7 +245,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
if (!len || !kbuf)
return -EINVAL;
@@ -37285,10 +38718,10 @@ index f678c73..f35aa18 100644
err = -EFAULT;
goto out;
diff --git a/block/genhd.c b/block/genhd.c
-index e5cafa51..65e4557 100644
+index 9f42526..fcc8648 100644
--- a/block/genhd.c
+++ b/block/genhd.c
-@@ -470,21 +470,24 @@ static char *bdevt_str(dev_t devt, char *buf)
+@@ -471,21 +471,24 @@ static char *bdevt_str(dev_t devt, char *buf)
/*
* Register device numbers dev..(dev+range-1)
@@ -37405,8 +38838,34 @@ index 0774799..7afc734 100644
if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len))
goto error;
+diff --git a/crypto/cast6_generic.c b/crypto/cast6_generic.c
+index 058c8d7..55229dd 100644
+--- a/crypto/cast6_generic.c
++++ b/crypto/cast6_generic.c
+@@ -181,8 +181,9 @@ static inline void QBAR(u32 *block, u8 *Kr, u32 *Km)
+ block[2] ^= F1(block[3], Kr[0], Km[0]);
+ }
+
+-void __cast6_encrypt(struct cast6_ctx *c, u8 *outbuf, const u8 *inbuf)
++void __cast6_encrypt(void *_c, u8 *outbuf, const u8 *inbuf)
+ {
++ struct cast6_ctx *c = _c;
+ const __be32 *src = (const __be32 *)inbuf;
+ __be32 *dst = (__be32 *)outbuf;
+ u32 block[4];
+@@ -219,8 +220,9 @@ static void cast6_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf)
+ __cast6_encrypt(crypto_tfm_ctx(tfm), outbuf, inbuf);
+ }
+
+-void __cast6_decrypt(struct cast6_ctx *c, u8 *outbuf, const u8 *inbuf)
++void __cast6_decrypt(void *_c, u8 *outbuf, const u8 *inbuf)
+ {
++ struct cast6_ctx *c = _c;
+ const __be32 *src = (const __be32 *)inbuf;
+ __be32 *dst = (__be32 *)outbuf;
+ u32 block[4];
diff --git a/crypto/cryptd.c b/crypto/cryptd.c
-index c81861b..dbf894f 100644
+index 7921251..ba86330 100644
--- a/crypto/cryptd.c
+++ b/crypto/cryptd.c
@@ -63,7 +63,7 @@ struct cryptd_blkcipher_ctx {
@@ -37453,6 +38912,75 @@ index ee9cfb9..30b36ed 100644
if (!ret)
kobject_uevent(&pinst->kobj, KOBJ_ADD);
+diff --git a/crypto/salsa20_generic.c b/crypto/salsa20_generic.c
+index f550b5d..8488beb 100644
+--- a/crypto/salsa20_generic.c
++++ b/crypto/salsa20_generic.c
+@@ -104,7 +104,7 @@ static void salsa20_wordtobyte(u8 output[64], const u32 input[16])
+ static const char sigma[16] = "expand 32-byte k";
+ static const char tau[16] = "expand 16-byte k";
+
+-static void salsa20_keysetup(struct salsa20_ctx *ctx, const u8 *k, u32 kbytes)
++static void __salsa20_keysetup(struct salsa20_ctx *ctx, const u8 *k, u32 kbytes)
+ {
+ const char *constants;
+
+@@ -128,7 +128,7 @@ static void salsa20_keysetup(struct salsa20_ctx *ctx, const u8 *k, u32 kbytes)
+ ctx->input[15] = U8TO32_LITTLE(constants + 12);
+ }
+
+-static void salsa20_ivsetup(struct salsa20_ctx *ctx, const u8 *iv)
++static void __salsa20_ivsetup(struct salsa20_ctx *ctx, const u8 *iv)
+ {
+ ctx->input[6] = U8TO32_LITTLE(iv + 0);
+ ctx->input[7] = U8TO32_LITTLE(iv + 4);
+@@ -136,7 +136,7 @@ static void salsa20_ivsetup(struct salsa20_ctx *ctx, const u8 *iv)
+ ctx->input[9] = 0;
+ }
+
+-static void salsa20_encrypt_bytes(struct salsa20_ctx *ctx, u8 *dst,
++static void __salsa20_encrypt_bytes(struct salsa20_ctx *ctx, u8 *dst,
+ const u8 *src, unsigned int bytes)
+ {
+ u8 buf[64];
+@@ -170,7 +170,7 @@ static int setkey(struct crypto_tfm *tfm, const u8 *key,
+ unsigned int keysize)
+ {
+ struct salsa20_ctx *ctx = crypto_tfm_ctx(tfm);
+- salsa20_keysetup(ctx, key, keysize);
++ __salsa20_keysetup(ctx, key, keysize);
+ return 0;
+ }
+
+@@ -186,24 +186,24 @@ static int encrypt(struct blkcipher_desc *desc,
+ blkcipher_walk_init(&walk, dst, src, nbytes);
+ err = blkcipher_walk_virt_block(desc, &walk, 64);
+
+- salsa20_ivsetup(ctx, walk.iv);
++ __salsa20_ivsetup(ctx, walk.iv);
+
+ if (likely(walk.nbytes == nbytes))
+ {
+- salsa20_encrypt_bytes(ctx, walk.dst.virt.addr,
++ __salsa20_encrypt_bytes(ctx, walk.dst.virt.addr,
+ walk.src.virt.addr, nbytes);
+ return blkcipher_walk_done(desc, &walk, 0);
+ }
+
+ while (walk.nbytes >= 64) {
+- salsa20_encrypt_bytes(ctx, walk.dst.virt.addr,
++ __salsa20_encrypt_bytes(ctx, walk.dst.virt.addr,
+ walk.src.virt.addr,
+ walk.nbytes - (walk.nbytes % 64));
+ err = blkcipher_walk_done(desc, &walk, walk.nbytes % 64);
+ }
+
+ if (walk.nbytes) {
+- salsa20_encrypt_bytes(ctx, walk.dst.virt.addr,
++ __salsa20_encrypt_bytes(ctx, walk.dst.virt.addr,
+ walk.src.virt.addr, walk.nbytes);
+ err = blkcipher_walk_done(desc, &walk, 0);
+ }
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c
index ea5815c..5880da6 100644
--- a/crypto/scatterwalk.c
@@ -37480,6 +39008,32 @@ index ea5815c..5880da6 100644
return;
scatterwalk_start(&walk, sg);
+diff --git a/crypto/serpent_generic.c b/crypto/serpent_generic.c
+index 94970a7..f0c8d26 100644
+--- a/crypto/serpent_generic.c
++++ b/crypto/serpent_generic.c
+@@ -442,8 +442,9 @@ int serpent_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
+ }
+ EXPORT_SYMBOL_GPL(serpent_setkey);
+
+-void __serpent_encrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src)
++void __serpent_encrypt(void *_ctx, u8 *dst, const u8 *src)
+ {
++ struct serpent_ctx *ctx = _ctx;
+ const u32 *k = ctx->expkey;
+ const __le32 *s = (const __le32 *)src;
+ __le32 *d = (__le32 *)dst;
+@@ -507,8 +508,9 @@ static void serpent_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
+ __serpent_encrypt(ctx, dst, src);
+ }
+
+-void __serpent_decrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src)
++void __serpent_decrypt(void *_ctx, u8 *dst, const u8 *src)
+ {
++ struct serpent_ctx *ctx = _ctx;
+ const u32 *k = ctx->expkey;
+ const __le32 *s = (const __le32 *)src;
+ __le32 *d = (__le32 *)dst;
diff --git a/crypto/zlib.c b/crypto/zlib.c
index d51a30a..b6891a3 100644
--- a/crypto/zlib.c
@@ -37525,11 +39079,24 @@ index d51a30a..b6891a3 100644
: DEF_WBITS;
stream->workspace = vzalloc(zlib_inflate_workspacesize());
+diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
+index f71b756..b96847c 100644
+--- a/drivers/acpi/ac.c
++++ b/drivers/acpi/ac.c
+@@ -70,7 +70,7 @@ static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
+
+ #ifdef CONFIG_ACPI_PROCFS_POWER
+ extern struct proc_dir_entry *acpi_lock_ac_dir(void);
+-extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
++extern void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
+ static int acpi_ac_open_fs(struct inode *inode, struct file *file);
+ #endif
+
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
-index 5fdac39..ce3c90e 100644
+index a76f8be..28cef93 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
-@@ -412,7 +412,7 @@ static int video_enable_only_lcd(const struct dmi_system_id *d)
+@@ -426,7 +426,7 @@ static int video_set_report_key_events(const struct dmi_system_id *id)
return 0;
}
@@ -37539,7 +39106,7 @@ index 5fdac39..ce3c90e 100644
* Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
*/
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
-index d62a616..387dbd0 100644
+index f76e0ea..4b83315 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
@@ -37622,6 +39189,19 @@ index 3dd9c46..cf0678f 100644
period = duration;
do_div(period, (count + 1));
if (period > max_period) {
+diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
+index b719ab3..371e2a6 100644
+--- a/drivers/acpi/battery.c
++++ b/drivers/acpi/battery.c
+@@ -75,7 +75,7 @@ MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
+
+ #ifdef CONFIG_ACPI_PROCFS_POWER
+ extern struct proc_dir_entry *acpi_lock_battery_dir(void);
+-extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
++extern void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
+
+ enum acpi_battery_files {
+ info_tag = 0,
diff --git a/drivers/acpi/bgrt.c b/drivers/acpi/bgrt.c
index a83e3c6..c3d617f 100644
--- a/drivers/acpi/bgrt.c
@@ -37662,7 +39242,7 @@ index 96809cd..6a49f979 100644
.callback = dmi_disable_osi_vista,
.ident = "Fujitsu Siemens",
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
-index a212cef..443c9c4 100644
+index 891c42d..ac31987 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -63,7 +63,7 @@ static int set_copy_dsdt(const struct dmi_system_id *id)
@@ -37699,10 +39279,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 08a02cd..1fa9787 100644
+index cd2c3d6..2031a4a 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
-@@ -1024,6 +1024,8 @@ EXPORT_SYMBOL_GPL(acpi_subsys_freeze);
+@@ -1025,6 +1025,8 @@ EXPORT_SYMBOL_GPL(acpi_subsys_freeze);
#endif /* CONFIG_PM_SLEEP */
@@ -37711,7 +39291,7 @@ index 08a02cd..1fa9787 100644
static struct dev_pm_domain acpi_general_pm_domain = {
.ops = {
.runtime_suspend = acpi_subsys_runtime_suspend,
-@@ -1040,6 +1042,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
+@@ -1041,6 +1043,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
.restore_early = acpi_subsys_resume_early,
#endif
},
@@ -37719,7 +39299,7 @@ index 08a02cd..1fa9787 100644
};
/**
-@@ -1117,7 +1120,6 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
+@@ -1118,7 +1121,6 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
acpi_device_wakeup(adev, ACPI_STATE_S0, false);
}
@@ -37728,7 +39308,7 @@ index 08a02cd..1fa9787 100644
}
EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
-index b420fb4..e8d7e29 100644
+index b420fb4..b66c430 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -1503,7 +1503,7 @@ static int ec_clear_on_resume(const struct dmi_system_id *id)
@@ -37740,6 +39320,24 @@ index b420fb4..e8d7e29 100644
{
ec_skip_dsdt_scan, "Compal JFL92", {
DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"),
+@@ -1610,7 +1610,7 @@ error:
+ return -ENODEV;
+ }
+
+-static int param_set_event_clearing(const char *val, struct kernel_param *kp)
++static int param_set_event_clearing(const char *val, const struct kernel_param *kp)
+ {
+ int result = 0;
+
+@@ -1628,7 +1628,7 @@ static int param_set_event_clearing(const char *val, struct kernel_param *kp)
+ return result;
+ }
+
+-static int param_get_event_clearing(char *buffer, struct kernel_param *kp)
++static int param_get_event_clearing(char *buffer, const struct kernel_param *kp)
+ {
+ switch (ec_event_clearing) {
+ case ACPI_EC_EVT_TIMING_STATUS:
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c
index 7188e53..6012bc4 100644
--- a/drivers/acpi/pci_slot.c
@@ -37780,7 +39378,7 @@ index 7cfbda4..74f738c 100644
set_no_mwait, "Extensa 5220", {
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
-index e3322ad..4a03c27 100644
+index f054cad..e3c1453 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -148,7 +148,7 @@ static int __init init_nvs_nosave(const struct dmi_system_id *d)
@@ -37793,9 +39391,36 @@ index e3322ad..4a03c27 100644
.callback = init_old_suspend_ordering,
.ident = "Abit KN9 (nForce4 variant)",
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
-index 0243d37..774aa56 100644
+index 0243d37..dcf52db 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
+@@ -227,7 +227,7 @@ module_param_cb(trace_method_name, &param_ops_trace_method, &trace_method_name,
+ module_param_cb(trace_debug_layer, &param_ops_trace_attrib, &acpi_gbl_trace_dbg_layer, 0644);
+ module_param_cb(trace_debug_level, &param_ops_trace_attrib, &acpi_gbl_trace_dbg_level, 0644);
+
+-static int param_set_trace_state(const char *val, struct kernel_param *kp)
++static int param_set_trace_state(const char *val, const struct kernel_param *kp)
+ {
+ acpi_status status;
+ const char *method = trace_method_name;
+@@ -263,7 +263,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
+ return 0;
+ }
+
+-static int param_get_trace_state(char *buffer, struct kernel_param *kp)
++static int param_get_trace_state(char *buffer, const struct kernel_param *kp)
+ {
+ if (!(acpi_gbl_trace_flags & ACPI_TRACE_ENABLED))
+ return sprintf(buffer, "disable");
+@@ -292,7 +292,7 @@ MODULE_PARM_DESC(aml_debug_output,
+ "To enable/disable the ACPI Debug Object output.");
+
+ /* /sys/module/acpi/parameters/acpica_version */
+-static int param_get_acpica_version(char *buffer, struct kernel_param *kp)
++static int param_get_acpica_version(char *buffer, const struct kernel_param *kp)
+ {
+ int result;
+
@@ -486,11 +486,11 @@ static u32 num_counters;
static struct attribute **all_attrs;
static u32 acpi_gpe_count;
@@ -37810,6 +39435,22 @@ index 0243d37..774aa56 100644
static void delete_gpe_attr_array(void)
{
+@@ -777,13 +777,13 @@ static void __exit interrupt_stats_exit(void)
+ }
+
+ static ssize_t
+-acpi_show_profile(struct device *dev, struct device_attribute *attr,
++acpi_show_profile(struct kobject *kobj, struct kobj_attribute *attr,
+ char *buf)
+ {
+ return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile);
+ }
+
+-static const struct device_attribute pm_profile_attr =
++static const struct kobj_attribute pm_profile_attr =
+ __ATTR(pm_profile, S_IRUGO, acpi_show_profile, NULL);
+
+ static ssize_t hotplug_enabled_show(struct kobject *kobj,
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 82707f9..a6b19f5 100644
--- a/drivers/acpi/thermal.c
@@ -37824,7 +39465,7 @@ index 82707f9..a6b19f5 100644
* Award BIOS on this AOpen makes thermal control almost worthless.
* http://bugzilla.kernel.org/show_bug.cgi?id=8842
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
-index 80e55cb..f660caf 100644
+index 1316ddd..0f10a1d 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -41,7 +41,6 @@ ACPI_MODULE_NAME("video");
@@ -37835,7 +39476,7 @@ index 80e55cb..f660caf 100644
static struct work_struct backlight_notify_work;
static enum acpi_backlight_type acpi_backlight_cmdline = acpi_backlight_undef;
-@@ -294,6 +293,10 @@ static int acpi_video_backlight_notify(struct notifier_block *nb,
+@@ -311,6 +310,10 @@ static int acpi_video_backlight_notify(struct notifier_block *nb,
return NOTIFY_OK;
}
@@ -37846,7 +39487,7 @@ index 80e55cb..f660caf 100644
/*
* Determine which type of backlight interface to use on this system,
* First check cmdline, then dmi quirks, then do autodetect.
-@@ -324,8 +327,6 @@ enum acpi_backlight_type acpi_video_get_backlight_type(void)
+@@ -341,8 +344,6 @@ enum acpi_backlight_type acpi_video_get_backlight_type(void)
&video_caps, NULL);
INIT_WORK(&backlight_notify_work,
acpi_video_backlight_notify_work);
@@ -37855,11 +39496,24 @@ index 80e55cb..f660caf 100644
if (backlight_register_notifier(&backlight_nb) == 0)
backlight_notifier_registered = true;
init_done = true;
+diff --git a/drivers/android/binder.c b/drivers/android/binder.c
+index 7d00b7a..d5fd80d 100644
+--- a/drivers/android/binder.c
++++ b/drivers/android/binder.c
+@@ -120,7 +120,7 @@ static DECLARE_WAIT_QUEUE_HEAD(binder_user_error_wait);
+ static int binder_stop_on_user_error;
+
+ static int binder_set_stop_on_user_error(const char *val,
+- struct kernel_param *kp)
++ const struct kernel_param *kp)
+ {
+ int ret;
+
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
-index b79cb10..7daa9f7 100644
+index 55e257c..28b9a25 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
-@@ -102,7 +102,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
+@@ -103,7 +103,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
static void ata_dev_xfermask(struct ata_device *dev);
static unsigned long ata_dev_blacklisted(const struct ata_device *dev);
@@ -37868,7 +39522,7 @@ index b79cb10..7daa9f7 100644
struct ata_force_param {
const char *name;
-@@ -4801,7 +4801,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
+@@ -4804,7 +4804,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
struct ata_port *ap;
unsigned int tag;
@@ -37877,7 +39531,7 @@ index b79cb10..7daa9f7 100644
ap = qc->ap;
qc->flags = 0;
-@@ -4818,7 +4818,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
+@@ -4821,7 +4821,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
struct ata_port *ap;
struct ata_link *link;
@@ -37886,7 +39540,7 @@ index b79cb10..7daa9f7 100644
WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE));
ap = qc->ap;
link = qc->dev->link;
-@@ -5925,6 +5925,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
+@@ -5928,6 +5928,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
return;
spin_lock(&lock);
@@ -37894,7 +39548,7 @@ index b79cb10..7daa9f7 100644
for (cur = ops->inherits; cur; cur = cur->inherits) {
void **inherit = (void **)cur;
-@@ -5938,8 +5939,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
+@@ -5941,8 +5942,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
if (IS_ERR(*pp))
*pp = NULL;
@@ -37905,7 +39559,7 @@ index b79cb10..7daa9f7 100644
spin_unlock(&lock);
}
-@@ -6135,7 +6137,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
+@@ -6138,7 +6140,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++) {
@@ -38834,10 +40488,10 @@ index ddc4ceb..36e29aa 100644
}
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
-index 3d7fb65..0f26393 100644
+index 6ac2b2b..6373ebd 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
-@@ -843,7 +843,7 @@ static void solos_bh(unsigned long card_arg)
+@@ -849,7 +849,7 @@ static void solos_bh(unsigned long card_arg)
}
atm_charge(vcc, skb->truesize);
vcc->push(vcc, skb);
@@ -38846,7 +40500,7 @@ index 3d7fb65..0f26393 100644
break;
case PKT_STATUS:
-@@ -1124,7 +1124,7 @@ static uint32_t fpga_tx(struct solos_card *card)
+@@ -1130,7 +1130,7 @@ static uint32_t fpga_tx(struct solos_card *card)
vcc = SKB_CB(oldskb)->vcc;
if (vcc) {
@@ -38987,7 +40641,7 @@ index 8fc654f..36e28e9 100644
LIST_HEAD(todo);
int cnt;
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
-index 68f0314..ca2a609 100644
+index 44a74cf..a5dd826 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -354,7 +354,7 @@ int devtmpfs_mount(const char *mntdir)
@@ -39028,7 +40682,7 @@ index 560751b..3a4847a 100644
static ssize_t show_node_state(struct device *dev,
struct device_attribute *attr, char *buf)
diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c
-index 5df4575..986184b 100644
+index 279e539..b87ed03 100644
--- a/drivers/base/platform-msi.c
+++ b/drivers/base/platform-msi.c
@@ -24,6 +24,8 @@
@@ -39037,10 +40691,10 @@ index 5df4575..986184b 100644
+#include <asm/pgtable.h>
+
- #define DEV_ID_SHIFT 24
+ #define DEV_ID_SHIFT 21
+ #define MAX_DEV_MSIS (1 << (32 - DEV_ID_SHIFT))
- /*
-@@ -77,10 +79,12 @@ static void platform_msi_update_dom_ops(struct msi_domain_info *info)
+@@ -81,10 +83,12 @@ static void platform_msi_update_dom_ops(struct msi_domain_info *info)
BUG_ON(!ops);
@@ -39055,7 +40709,7 @@ index 5df4575..986184b 100644
}
static void platform_msi_write_msg(struct irq_data *data, struct msi_msg *msg)
-@@ -98,16 +102,18 @@ static void platform_msi_update_chip_ops(struct msi_domain_info *info)
+@@ -102,16 +106,18 @@ static void platform_msi_update_chip_ops(struct msi_domain_info *info)
struct irq_chip *chip = info->chip;
BUG_ON(!chip);
@@ -39078,12 +40732,12 @@ index 5df4575..986184b 100644
+ pax_close_kernel();
}
- static void platform_msi_free_descs(struct device *dev)
+ static void platform_msi_free_descs(struct device *dev, int base, int nvec)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 65f50ec..acab2a1 100644
+index 301b785..82070c6 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
-@@ -1810,8 +1810,11 @@ int genpd_dev_pm_attach(struct device *dev)
+@@ -1804,8 +1804,10 @@ int genpd_dev_pm_attach(struct device *dev)
goto out;
}
@@ -39093,15 +40747,76 @@ index 65f50ec..acab2a1 100644
+ *(void **)&dev->pm_domain->detach = genpd_dev_pm_detach;
+ *(void **)&dev->pm_domain->sync = genpd_dev_pm_sync;
+ pax_close_kernel();
-+
- ret = genpd_poweron(pd);
- out:
+ mutex_lock(&pd->lock);
+ ret = genpd_poweron(pd, 0);
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
-index e1a10a0..a6bc363 100644
+index 4c70550..223bba1 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
-@@ -263,8 +263,8 @@ static int rpm_check_suspend_allowed(struct device *dev)
+@@ -16,35 +16,32 @@
+
+ typedef int (*pm_callback_t)(struct device *);
+
+-static pm_callback_t __rpm_get_callback(struct device *dev, size_t cb_offset)
+-{
+- pm_callback_t cb;
+- const struct dev_pm_ops *ops;
+-
+- if (dev->pm_domain)
+- ops = &dev->pm_domain->ops;
+- else if (dev->type && dev->type->pm)
+- ops = dev->type->pm;
+- else if (dev->class && dev->class->pm)
+- ops = dev->class->pm;
+- else if (dev->bus && dev->bus->pm)
+- ops = dev->bus->pm;
+- else
+- ops = NULL;
+-
+- if (ops)
+- cb = *(pm_callback_t *)((void *)ops + cb_offset);
+- else
+- cb = NULL;
+-
+- if (!cb && dev->driver && dev->driver->pm)
+- cb = *(pm_callback_t *)((void *)dev->driver->pm + cb_offset);
+-
+- return cb;
+-}
+-
+-#define RPM_GET_CALLBACK(dev, callback) \
+- __rpm_get_callback(dev, offsetof(struct dev_pm_ops, callback))
++#define RPM_GET_CALLBACK(dev, callback) \
++({ \
++ pm_callback_t cb; \
++ const struct dev_pm_ops *ops; \
++ \
++ if (dev->pm_domain) \
++ ops = &dev->pm_domain->ops; \
++ else if (dev->type && dev->type->pm) \
++ ops = dev->type->pm; \
++ else if (dev->class && dev->class->pm) \
++ ops = dev->class->pm; \
++ else if (dev->bus && dev->bus->pm) \
++ ops = dev->bus->pm; \
++ else \
++ ops = NULL; \
++ \
++ if (ops) \
++ cb = ops->callback; \
++ else \
++ cb = NULL; \
++ \
++ if (!cb && dev->driver && dev->driver->pm) \
++ cb = dev->driver->pm->callback; \
++ \
++ cb; \
++})
+
+ static int rpm_resume(struct device *dev, int rpmflags);
+ static int rpm_suspend(struct device *dev, int rpmflags);
+@@ -263,8 +260,8 @@ static int rpm_check_suspend_allowed(struct device *dev)
* @cb: Runtime PM callback to run.
* @dev: Device to run the callback for.
*/
@@ -39111,7 +40826,7 @@ index e1a10a0..a6bc363 100644
{
int retval;
-@@ -412,8 +412,8 @@ static int rpm_callback(int (*cb)(struct device *), struct device *dev)
+@@ -412,8 +409,8 @@ static int rpm_callback(int (*cb)(struct device *), struct device *dev)
*
* This function must be called under dev->power.lock with interrupts disabled.
*/
@@ -39121,7 +40836,7 @@ index e1a10a0..a6bc363 100644
{
int (*callback)(struct device *);
struct device *parent = NULL;
-@@ -594,8 +594,8 @@ static int rpm_suspend(struct device *dev, int rpmflags)
+@@ -594,8 +591,8 @@ static int rpm_suspend(struct device *dev, int rpmflags)
*
* This function must be called under dev->power.lock with interrupts disabled.
*/
@@ -39184,32 +40899,32 @@ index a1e0b9a..81fc106 100644
split_counters(&cnt, &inpr);
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
-index 3f0a7e2..8195e50 100644
+index 1ee3d40..3274424 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
-@@ -401,7 +401,7 @@ static ssize_t regmap_access_read_file(struct file *file,
- char __user *user_buf, size_t count,
- loff_t *ppos)
- {
-- int reg_len, tot_len;
-+ size_t reg_len, tot_len;
- size_t buf_pos = 0;
- loff_t p = 0;
- ssize_t ret;
-@@ -434,7 +434,7 @@ static ssize_t regmap_access_read_file(struct file *file,
- /* Format the register */
- snprintf(buf + buf_pos, count - buf_pos,
- "%.*x: %c %c %c %c\n",
-- reg_len, i,
-+ (int)reg_len, i,
- regmap_readable(map, i) ? 'y' : 'n',
- regmap_writeable(map, i) ? 'y' : 'n',
- regmap_volatile(map, i) ? 'y' : 'n',
+@@ -400,7 +400,7 @@ static const struct file_operations regmap_reg_ranges_fops = {
+ static int regmap_access_show(struct seq_file *s, void *ignored)
+ {
+ struct regmap *map = s->private;
+- int i, reg_len;
++ size_t i, reg_len;
+
+ reg_len = regmap_calc_reg_len(map->max_register);
+
+@@ -410,7 +410,7 @@ static int regmap_access_show(struct seq_file *s, void *ignored)
+ continue;
+
+ /* Format the register */
+- seq_printf(s, "%.*x: %c %c %c %c\n", reg_len, i,
++ seq_printf(s, "%.*x: %c %c %c %c\n", (int)reg_len, i,
+ regmap_readable(map, i) ? 'y' : 'n',
+ regmap_writeable(map, i) ? 'y' : 'n',
+ regmap_volatile(map, i) ? 'y' : 'n',
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
-index 4ac63c0..9007855 100644
+index ee54e84..f00a29c 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
-@@ -344,8 +344,8 @@ static void regmap_unlock_mutex(void *__map)
+@@ -401,8 +401,8 @@ static void regmap_unlock_mutex(void *__map)
mutex_unlock(&map->mutex);
}
@@ -39219,7 +40934,7 @@ index 4ac63c0..9007855 100644
{
struct regmap *map = __map;
unsigned long flags;
-@@ -354,8 +354,8 @@ __acquires(&map->spinlock)
+@@ -411,8 +411,8 @@ __acquires(&map->spinlock)
map->spinlock_flags = flags;
}
@@ -39252,10 +40967,10 @@ index 8d98a32..61d3165 100644
}
EXPORT_SYMBOL_GPL(unregister_syscore_ops);
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
-index 0422c47..b222c7a 100644
+index 63c2064..34fae98 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
-@@ -3024,7 +3024,7 @@ static void start_io(ctlr_info_t *h)
+@@ -3018,7 +3018,7 @@ static void start_io(ctlr_info_t *h)
while (!list_empty(&h->reqQ)) {
c = list_entry(h->reqQ.next, CommandList_struct, list);
/* can't do anything if fifo is full */
@@ -39264,7 +40979,7 @@ index 0422c47..b222c7a 100644
dev_warn(&h->pdev->dev, "fifo full\n");
break;
}
-@@ -3034,7 +3034,7 @@ static void start_io(ctlr_info_t *h)
+@@ -3028,7 +3028,7 @@ static void start_io(ctlr_info_t *h)
h->Qdepth--;
/* Tell the controller execute command */
@@ -39273,7 +40988,7 @@ index 0422c47..b222c7a 100644
/* Put job onto the completed Q */
addQ(&h->cmpQ, c);
-@@ -3460,17 +3460,17 @@ startio:
+@@ -3454,17 +3454,17 @@ startio:
static inline unsigned long get_next_completion(ctlr_info_t *h)
{
@@ -39294,7 +41009,7 @@ index 0422c47..b222c7a 100644
(h->interrupts_enabled == 0));
}
-@@ -3503,7 +3503,7 @@ static inline u32 next_command(ctlr_info_t *h)
+@@ -3497,7 +3497,7 @@ static inline u32 next_command(ctlr_info_t *h)
u32 a;
if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant)))
@@ -39303,7 +41018,7 @@ index 0422c47..b222c7a 100644
if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) {
a = *(h->reply_pool_head); /* Next cmd in ring buffer */
-@@ -4060,7 +4060,7 @@ static void cciss_put_controller_into_performant_mode(ctlr_info_t *h)
+@@ -4054,7 +4054,7 @@ static void cciss_put_controller_into_performant_mode(ctlr_info_t *h)
trans_support & CFGTBL_Trans_use_short_tags);
/* Change the access methods to the performant access methods */
@@ -39312,7 +41027,7 @@ index 0422c47..b222c7a 100644
h->transMethod = CFGTBL_Trans_Performant;
return;
-@@ -4334,7 +4334,7 @@ static int cciss_pci_init(ctlr_info_t *h)
+@@ -4328,7 +4328,7 @@ static int cciss_pci_init(ctlr_info_t *h)
if (prod_index < 0)
return -ENODEV;
h->product_name = products[prod_index].product_name;
@@ -39321,7 +41036,7 @@ index 0422c47..b222c7a 100644
if (cciss_board_disabled(h)) {
dev_warn(&h->pdev->dev, "controller appears to be disabled\n");
-@@ -5065,7 +5065,7 @@ reinit_after_soft_reset:
+@@ -5059,7 +5059,7 @@ reinit_after_soft_reset:
}
/* make sure the board interrupts are off */
@@ -39330,7 +41045,7 @@ index 0422c47..b222c7a 100644
rc = cciss_request_irq(h, do_cciss_msix_intr, do_cciss_intx);
if (rc)
goto clean2;
-@@ -5115,7 +5115,7 @@ reinit_after_soft_reset:
+@@ -5109,7 +5109,7 @@ reinit_after_soft_reset:
* fake ones to scoop up any residual completions.
*/
spin_lock_irqsave(&h->lock, flags);
@@ -39339,7 +41054,7 @@ index 0422c47..b222c7a 100644
spin_unlock_irqrestore(&h->lock, flags);
free_irq(h->intr[h->intr_mode], h);
rc = cciss_request_irq(h, cciss_msix_discard_completions,
-@@ -5135,9 +5135,9 @@ reinit_after_soft_reset:
+@@ -5129,9 +5129,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");
@@ -39351,7 +41066,7 @@ index 0422c47..b222c7a 100644
rc = controller_reset_failed(h->cfgtable);
if (rc)
-@@ -5160,7 +5160,7 @@ reinit_after_soft_reset:
+@@ -5154,7 +5154,7 @@ reinit_after_soft_reset:
cciss_scsi_setup(h);
/* Turn the interrupts on so we can service requests */
@@ -39360,7 +41075,7 @@ index 0422c47..b222c7a 100644
/* Get the firmware version */
inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL);
-@@ -5232,7 +5232,7 @@ static void cciss_shutdown(struct pci_dev *pdev)
+@@ -5226,7 +5226,7 @@ static void cciss_shutdown(struct pci_dev *pdev)
kfree(flush_buf);
if (return_code != IO_OK)
dev_warn(&h->pdev->dev, "Error flushing cache\n");
@@ -39559,10 +41274,10 @@ index be73e9d..7fbf140 100644
cmdlist_t *reqQ;
cmdlist_t *cmpQ;
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c
-index 9462d27..4b9f997 100644
+index 92d6fc0..e4e1e27 100644
--- a/drivers/block/drbd/drbd_bitmap.c
+++ b/drivers/block/drbd/drbd_bitmap.c
-@@ -1027,7 +1027,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho
+@@ -1019,7 +1019,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho
submit_bio(rw, bio);
/* this should not count as user activity and cause the
* resync to throttle -- see drbd_rs_should_slow_down(). */
@@ -39572,10 +41287,10 @@ index 9462d27..4b9f997 100644
}
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
-index e66d453..edaae71 100644
+index 34bc84e..8bac095 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
-@@ -386,7 +386,7 @@ struct drbd_epoch {
+@@ -382,7 +382,7 @@ struct drbd_epoch {
struct drbd_connection *connection;
struct list_head list;
unsigned int barrier_nr;
@@ -39584,7 +41299,7 @@ index e66d453..edaae71 100644
atomic_t active; /* increased on every req. added, and dec on every finished. */
unsigned long flags;
};
-@@ -947,7 +947,7 @@ struct drbd_device {
+@@ -951,7 +951,7 @@ struct drbd_device {
unsigned int al_tr_number;
int al_tr_cycle;
wait_queue_head_t seq_wait;
@@ -39593,7 +41308,7 @@ index e66d453..edaae71 100644
unsigned int peer_seq;
spinlock_t peer_seq_lock;
unsigned long comm_bm_set; /* communicated number of set bits. */
-@@ -956,8 +956,8 @@ struct drbd_device {
+@@ -960,8 +960,8 @@ struct drbd_device {
struct mutex own_state_mutex;
struct mutex *state_mutex; /* either own_state_mutex or first_peer_device(device)->connection->cstate_mutex */
char congestion_reason; /* Why we where congested... */
@@ -39605,10 +41320,10 @@ index e66d453..edaae71 100644
int rs_last_events; /* counter of read or write "events" (unit sectors)
* on the lower level device when we last looked. */
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
-index 74d97f4..bb5a486 100644
+index 5b43dfb..d5f6e5c 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
+@@ -1329,7 +1329,7 @@ static int _drbd_send_ack(struct drbd_peer_device *peer_device, enum drbd_packet
p->sector = sector;
p->block_id = block_id;
p->blksize = blksize;
@@ -39617,7 +41332,7 @@ index 74d97f4..bb5a486 100644
return drbd_send_command(peer_device, sock, cmd, sizeof(*p), NULL, 0);
}
-@@ -1634,7 +1634,7 @@ int drbd_send_dblock(struct drbd_peer_device *peer_device, struct drbd_request *
+@@ -1635,7 +1635,7 @@ int drbd_send_dblock(struct drbd_peer_device *peer_device, struct drbd_request *
return -EIO;
p->sector = cpu_to_be64(req->i.sector);
p->block_id = (unsigned long)req;
@@ -39626,7 +41341,7 @@ index 74d97f4..bb5a486 100644
dp_flags = bio_flags_to_wire(peer_device->connection, req->master_bio->bi_rw);
if (device->state.conn >= C_SYNC_SOURCE &&
device->state.conn <= C_PAUSED_SYNC_T)
-@@ -1915,8 +1915,8 @@ void drbd_init_set_defaults(struct drbd_device *device)
+@@ -1907,8 +1907,8 @@ void drbd_init_set_defaults(struct drbd_device *device)
atomic_set(&device->unacked_cnt, 0);
atomic_set(&device->local_cnt, 0);
atomic_set(&device->pp_in_use_by_net, 0);
@@ -39637,7 +41352,7 @@ index 74d97f4..bb5a486 100644
atomic_set(&device->ap_in_flight, 0);
atomic_set(&device->md_io.in_use, 0);
-@@ -2683,8 +2683,8 @@ void drbd_destroy_connection(struct kref *kref)
+@@ -2675,8 +2675,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;
@@ -39649,17 +41364,21 @@ index 74d97f4..bb5a486 100644
idr_destroy(&connection->peer_devices);
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
-index e80cbef..42533f1 100644
+index c055c5e..5cb3c1e 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
-@@ -3637,13 +3637,13 @@ finish:
+@@ -89,8 +89,8 @@ int drbd_adm_get_initial_state(struct sk_buff *skb, struct netlink_callback *cb)
+ #include "drbd_nla.h"
+ #include <linux/genl_magic_func.h>
- void drbd_bcast_event(struct drbd_device *device, const struct sib_info *sib)
- {
-- static atomic_t drbd_genl_seq = ATOMIC_INIT(2); /* two. */
-+ static atomic_unchecked_t drbd_genl_seq = ATOMIC_INIT(2); /* two. */
- struct sk_buff *msg;
- struct drbd_genlmsghdr *d_out;
+-static atomic_t drbd_genl_seq = ATOMIC_INIT(2); /* two. */
+-static atomic_t notify_genl_seq = ATOMIC_INIT(2); /* two. */
++static atomic_unchecked_t drbd_genl_seq = ATOMIC_INIT(2); /* two. */
++static atomic_unchecked_t notify_genl_seq = ATOMIC_INIT(2); /* two. */
+
+ DEFINE_MUTEX(notification_mutex);
+
+@@ -4374,7 +4374,7 @@ void drbd_bcast_event(struct drbd_device *device, const struct sib_info *sib)
unsigned seq;
int err = -ENOMEM;
@@ -39668,11 +41387,56 @@ index e80cbef..42533f1 100644
msg = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO);
if (!msg)
goto failed;
+@@ -4426,7 +4426,7 @@ void notify_resource_state(struct sk_buff *skb,
+ int err;
+
+ if (!skb) {
+- seq = atomic_inc_return(&notify_genl_seq);
++ seq = atomic_inc_return_unchecked(&notify_genl_seq);
+ skb = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO);
+ err = -ENOMEM;
+ if (!skb)
+@@ -4477,7 +4477,7 @@ void notify_device_state(struct sk_buff *skb,
+ int err;
+
+ if (!skb) {
+- seq = atomic_inc_return(&notify_genl_seq);
++ seq = atomic_inc_return_unchecked(&notify_genl_seq);
+ skb = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO);
+ err = -ENOMEM;
+ if (!skb)
+@@ -4526,7 +4526,7 @@ void notify_connection_state(struct sk_buff *skb,
+ int err;
+
+ if (!skb) {
+- seq = atomic_inc_return(&notify_genl_seq);
++ seq = atomic_inc_return_unchecked(&notify_genl_seq);
+ skb = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO);
+ err = -ENOMEM;
+ if (!skb)
+@@ -4576,7 +4576,7 @@ void notify_peer_device_state(struct sk_buff *skb,
+ int err;
+
+ if (!skb) {
+- seq = atomic_inc_return(&notify_genl_seq);
++ seq = atomic_inc_return_unchecked(&notify_genl_seq);
+ skb = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO);
+ err = -ENOMEM;
+ if (!skb)
+@@ -4619,7 +4619,7 @@ void notify_helper(enum drbd_notification_type type,
+ {
+ struct drbd_resource *resource = device ? device->resource : connection->resource;
+ struct drbd_helper_info helper_info;
+- unsigned int seq = atomic_inc_return(&notify_genl_seq);
++ unsigned int seq = atomic_inc_return_unchecked(&notify_genl_seq);
+ struct sk_buff *skb = NULL;
+ struct drbd_genlmsghdr *dh;
+ int err;
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
-index b4b5680..4ae7b27 100644
+index 1957fe8..de39941 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
-@@ -871,7 +871,7 @@ int drbd_connected(struct drbd_peer_device *peer_device)
+@@ -895,7 +895,7 @@ int drbd_connected(struct drbd_peer_device *peer_device)
struct drbd_device *device = peer_device->device;
int err;
@@ -39681,7 +41445,7 @@ index b4b5680..4ae7b27 100644
device->peer_seq = 0;
device->state_mutex = peer_device->connection->agreed_pro_version < 100 ?
-@@ -1234,7 +1234,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_connection *connectio
+@@ -1266,7 +1266,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_connection *connectio
do {
next_epoch = NULL;
@@ -39690,7 +41454,7 @@ index b4b5680..4ae7b27 100644
switch (ev & ~EV_CLEANUP) {
case EV_PUT:
-@@ -1274,7 +1274,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_connection *connectio
+@@ -1306,7 +1306,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_connection *connectio
rv = FE_DESTROYED;
} else {
epoch->flags = 0;
@@ -39699,7 +41463,7 @@ index b4b5680..4ae7b27 100644
/* atomic_set(&epoch->active, 0); is already zero */
if (rv == FE_STILL_LIVE)
rv = FE_RECYCLED;
-@@ -1551,7 +1551,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
+@@ -1577,7 +1577,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
conn_wait_active_ee_empty(connection);
drbd_flush(connection);
@@ -39708,7 +41472,7 @@ index b4b5680..4ae7b27 100644
epoch = kmalloc(sizeof(struct drbd_epoch), GFP_NOIO);
if (epoch)
break;
-@@ -1565,11 +1565,11 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
+@@ -1591,11 +1591,11 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
}
epoch->flags = 0;
@@ -39722,7 +41486,7 @@ index b4b5680..4ae7b27 100644
list_add(&epoch->list, &connection->current_epoch->list);
connection->current_epoch = epoch;
connection->epochs++;
-@@ -1781,7 +1781,9 @@ static int e_end_resync_block(struct drbd_work *w, int unused)
+@@ -1807,7 +1807,9 @@ static int e_end_resync_block(struct drbd_work *w, int unused)
}
static int recv_resync_read(struct drbd_peer_device *peer_device, sector_t sector,
@@ -39733,7 +41497,7 @@ index b4b5680..4ae7b27 100644
{
struct drbd_device *device = peer_device->device;
struct drbd_peer_request *peer_req;
-@@ -1803,7 +1805,7 @@ static int recv_resync_read(struct drbd_peer_device *peer_device, sector_t secto
+@@ -1829,7 +1831,7 @@ static int recv_resync_read(struct drbd_peer_device *peer_device, sector_t secto
list_add_tail(&peer_req->w.list, &device->sync_ee);
spin_unlock_irq(&device->resource->req_lock);
@@ -39742,7 +41506,7 @@ index b4b5680..4ae7b27 100644
if (drbd_submit_peer_request(device, peer_req, WRITE, DRBD_FAULT_RS_WR) == 0)
return 0;
-@@ -1901,7 +1903,7 @@ static int receive_RSDataReply(struct drbd_connection *connection, struct packet
+@@ -1927,7 +1929,7 @@ static int receive_RSDataReply(struct drbd_connection *connection, struct packet
drbd_send_ack_dp(peer_device, P_NEG_ACK, p, pi->size);
}
@@ -39751,7 +41515,7 @@ index b4b5680..4ae7b27 100644
return err;
}
-@@ -2291,7 +2293,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info *
+@@ -2317,7 +2319,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info *
err = wait_for_and_update_peer_seq(peer_device, peer_seq);
drbd_send_ack_dp(peer_device, P_NEG_ACK, p, pi->size);
@@ -39760,7 +41524,7 @@ index b4b5680..4ae7b27 100644
err2 = drbd_drain_block(peer_device, pi->size);
if (!err)
err = err2;
-@@ -2335,7 +2337,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info *
+@@ -2361,7 +2363,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info *
spin_lock(&connection->epoch_lock);
peer_req->epoch = connection->current_epoch;
@@ -39769,7 +41533,7 @@ index b4b5680..4ae7b27 100644
atomic_inc(&peer_req->epoch->active);
spin_unlock(&connection->epoch_lock);
-@@ -2480,7 +2482,7 @@ bool drbd_rs_c_min_rate_throttle(struct drbd_device *device)
+@@ -2506,7 +2508,7 @@ bool drbd_rs_c_min_rate_throttle(struct drbd_device *device)
curr_events = (int)part_stat_read(&disk->part0, sectors[0]) +
(int)part_stat_read(&disk->part0, sectors[1]) -
@@ -39778,7 +41542,7 @@ index b4b5680..4ae7b27 100644
if (atomic_read(&device->ap_actlog_cnt)
|| curr_events - device->rs_last_events > 64) {
-@@ -2619,7 +2621,7 @@ static int receive_DataRequest(struct drbd_connection *connection, struct packet
+@@ -2645,7 +2647,7 @@ static int receive_DataRequest(struct drbd_connection *connection, struct packet
device->use_csums = true;
} else if (pi->cmd == P_OV_REPLY) {
/* track progress, we may need to throttle */
@@ -39787,7 +41551,7 @@ index b4b5680..4ae7b27 100644
peer_req->w.cb = w_e_end_ov_reply;
dec_rs_pending(device);
/* drbd_rs_begin_io done when we sent this request,
-@@ -2692,7 +2694,7 @@ static int receive_DataRequest(struct drbd_connection *connection, struct packet
+@@ -2718,7 +2720,7 @@ static int receive_DataRequest(struct drbd_connection *connection, struct packet
goto out_free_e;
submit_for_resync:
@@ -39796,7 +41560,7 @@ index b4b5680..4ae7b27 100644
submit:
update_receiver_timing_details(connection, drbd_submit_peer_request);
-@@ -4565,7 +4567,7 @@ struct data_cmd {
+@@ -4591,7 +4593,7 @@ struct data_cmd {
int expect_payload;
size_t pkt_size;
int (*fn)(struct drbd_connection *, struct packet_info *);
@@ -39805,7 +41569,7 @@ index b4b5680..4ae7b27 100644
static struct data_cmd drbd_cmd_handler[] = {
[P_DATA] = { 1, sizeof(struct p_data), receive_Data },
-@@ -4679,7 +4681,7 @@ static void conn_disconnect(struct drbd_connection *connection)
+@@ -4709,7 +4711,7 @@ static void conn_disconnect(struct drbd_connection *connection)
if (!list_empty(&connection->current_epoch->list))
drbd_err(connection, "ASSERTION FAILED: connection->current_epoch->list not empty\n");
/* ok, no more ee's on the fly, it is safe to reset the epoch_size */
@@ -39814,7 +41578,7 @@ index b4b5680..4ae7b27 100644
connection->send.seen_any_write_yet = false;
drbd_info(connection, "Connection closed\n");
-@@ -5183,7 +5185,7 @@ static int got_IsInSync(struct drbd_connection *connection, struct packet_info *
+@@ -5213,7 +5215,7 @@ static int got_IsInSync(struct drbd_connection *connection, struct packet_info *
put_ldev(device);
}
dec_rs_pending(device);
@@ -39823,20 +41587,113 @@ index b4b5680..4ae7b27 100644
return 0;
}
-@@ -5471,7 +5473,7 @@ static int connection_finish_peer_reqs(struct drbd_connection *connection)
- struct asender_cmd {
+@@ -5464,7 +5466,7 @@ static int got_skip(struct drbd_connection *connection, struct packet_info *pi)
+ struct meta_sock_cmd {
size_t pkt_size;
int (*fn)(struct drbd_connection *connection, struct packet_info *);
-};
+} __do_const;
- static struct asender_cmd asender_tbl[] = {
- [P_PING] = { 0, got_Ping },
+ static void set_rcvtimeo(struct drbd_connection *connection, bool ping_timeout)
+ {
+diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
+index 5a7ef78..bbd058b 100644
+--- a/drivers/block/drbd/drbd_state.c
++++ b/drivers/block/drbd/drbd_state.c
+@@ -1497,9 +1497,10 @@ int drbd_bitmap_io_from_worker(struct drbd_device *device,
+
+ void notify_resource_state_change(struct sk_buff *skb,
+ unsigned int seq,
+- struct drbd_resource_state_change *resource_state_change,
++ void *_resource_state_change,
+ enum drbd_notification_type type)
+ {
++ struct drbd_resource_state_change *resource_state_change = _resource_state_change;
+ struct drbd_resource *resource = resource_state_change->resource;
+ struct resource_info resource_info = {
+ .res_role = resource_state_change->role[NEW],
+@@ -1513,9 +1514,10 @@ void notify_resource_state_change(struct sk_buff *skb,
+
+ void notify_connection_state_change(struct sk_buff *skb,
+ unsigned int seq,
+- struct drbd_connection_state_change *connection_state_change,
++ void *_connection_state_change,
+ enum drbd_notification_type type)
+ {
++ struct drbd_connection_state_change *connection_state_change = _connection_state_change;
+ struct drbd_connection *connection = connection_state_change->connection;
+ struct connection_info connection_info = {
+ .conn_connection_state = connection_state_change->cstate[NEW],
+@@ -1527,9 +1529,10 @@ void notify_connection_state_change(struct sk_buff *skb,
+
+ void notify_device_state_change(struct sk_buff *skb,
+ unsigned int seq,
+- struct drbd_device_state_change *device_state_change,
++ void *_device_state_change,
+ enum drbd_notification_type type)
+ {
++ struct drbd_device_state_change *device_state_change = _device_state_change;
+ struct drbd_device *device = device_state_change->device;
+ struct device_info device_info = {
+ .dev_disk_state = device_state_change->disk_state[NEW],
+@@ -1540,9 +1543,10 @@ void notify_device_state_change(struct sk_buff *skb,
+
+ void notify_peer_device_state_change(struct sk_buff *skb,
+ unsigned int seq,
+- struct drbd_peer_device_state_change *p,
++ void *_p,
+ enum drbd_notification_type type)
+ {
++ struct drbd_peer_device_state_change *p = _p;
+ struct drbd_peer_device *peer_device = p->peer_device;
+ struct peer_device_info peer_device_info = {
+ .peer_repl_state = p->repl_state[NEW],
+diff --git a/drivers/block/drbd/drbd_state.h b/drivers/block/drbd/drbd_state.h
+index bd98953..488e501 100644
+--- a/drivers/block/drbd/drbd_state.h
++++ b/drivers/block/drbd/drbd_state.h
+@@ -126,7 +126,7 @@ extern enum drbd_state_rv _drbd_set_state(struct drbd_device *, union drbd_state
+ enum chg_state_flags,
+ struct completion *done);
+ extern void print_st_err(struct drbd_device *, union drbd_state,
+- union drbd_state, int);
++ union drbd_state, enum drbd_state_rv);
+
+ enum drbd_state_rv
+ _conn_request_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val,
+diff --git a/drivers/block/drbd/drbd_state_change.h b/drivers/block/drbd/drbd_state_change.h
+index 9e503a1..ac60262 100644
+--- a/drivers/block/drbd/drbd_state_change.h
++++ b/drivers/block/drbd/drbd_state_change.h
+@@ -45,19 +45,19 @@ extern void forget_state_change(struct drbd_state_change *);
+
+ extern void notify_resource_state_change(struct sk_buff *,
+ unsigned int,
+- struct drbd_resource_state_change *,
++ void *,
+ enum drbd_notification_type type);
+ extern void notify_connection_state_change(struct sk_buff *,
+ unsigned int,
+- struct drbd_connection_state_change *,
++ void *,
+ enum drbd_notification_type type);
+ extern void notify_device_state_change(struct sk_buff *,
+ unsigned int,
+- struct drbd_device_state_change *,
++ void *,
+ enum drbd_notification_type type);
+ extern void notify_peer_device_state_change(struct sk_buff *,
+ unsigned int,
+- struct drbd_peer_device_state_change *,
++ void *,
+ enum drbd_notification_type type);
+
+ #endif /* DRBD_STATE_CHANGE_H */
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
-index 5578c14..a05f791 100644
+index eff716c..4c52ef7 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
-@@ -94,7 +94,8 @@ void drbd_md_endio(struct bio *bio)
+@@ -87,7 +87,8 @@ void drbd_md_endio(struct bio *bio)
/* reads on behalf of the partner,
* "submitted" by the receiver
*/
@@ -39846,7 +41703,7 @@ index 5578c14..a05f791 100644
{
unsigned long flags = 0;
struct drbd_peer_device *peer_device = peer_req->peer_device;
-@@ -115,7 +116,8 @@ static void drbd_endio_read_sec_final(struct drbd_peer_request *peer_req) __rele
+@@ -108,7 +109,8 @@ static void drbd_endio_read_sec_final(struct drbd_peer_request *peer_req) __rele
/* writes on behalf of the partner, or resync writes,
* "submitted" by the receiver, final stage. */
@@ -39856,7 +41713,7 @@ index 5578c14..a05f791 100644
{
unsigned long flags = 0;
struct drbd_peer_device *peer_device = peer_req->peer_device;
-@@ -386,7 +388,7 @@ static int read_for_csum(struct drbd_peer_device *peer_device, sector_t sector,
+@@ -391,7 +393,7 @@ static int read_for_csum(struct drbd_peer_device *peer_device, sector_t sector,
list_add_tail(&peer_req->w.list, &device->read_ee);
spin_unlock_irq(&device->resource->req_lock);
@@ -39865,7 +41722,7 @@ index 5578c14..a05f791 100644
if (drbd_submit_peer_request(device, peer_req, READ, DRBD_FAULT_RS_RD) == 0)
return 0;
-@@ -531,7 +533,7 @@ static int drbd_rs_number_requests(struct drbd_device *device)
+@@ -536,7 +538,7 @@ static int drbd_rs_number_requests(struct drbd_device *device)
unsigned int sect_in; /* Number of sectors that came in since the last turn */
int number, mxb;
@@ -39874,7 +41731,7 @@ index 5578c14..a05f791 100644
device->rs_in_flight -= sect_in;
rcu_read_lock();
-@@ -1573,8 +1575,8 @@ void drbd_rs_controller_reset(struct drbd_device *device)
+@@ -1583,8 +1585,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;
@@ -39885,6 +41742,38 @@ index 5578c14..a05f791 100644
device->rs_in_flight = 0;
device->rs_last_events =
(int)part_stat_read(&disk->part0, sectors[0]) +
+diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
+index 84708a5..95c0e55 100644
+--- a/drivers/block/floppy.c
++++ b/drivers/block/floppy.c
+@@ -961,6 +961,10 @@ static void empty(void)
+ {
+ }
+
++static void empty2(int i)
++{
++}
++
+ static void (*floppy_work_fn)(void);
+
+ static void floppy_work_workfn(struct work_struct *work)
+@@ -1953,14 +1957,14 @@ static const struct cont_t wakeup_cont = {
+ .interrupt = empty,
+ .redo = do_wakeup,
+ .error = empty,
+- .done = (done_f)empty
++ .done = empty2
+ };
+
+ static const struct cont_t intr_cont = {
+ .interrupt = empty,
+ .redo = process_fd_request,
+ .error = empty,
+- .done = (done_f)empty
++ .done = empty2
+ };
+
+ static int wait_til_done(void (*handler)(void), bool interruptible)
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index d06c62e..cd04d96 100644
--- a/drivers/block/pktcdvd.c
@@ -39908,7 +41797,7 @@ index d06c62e..cd04d96 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 fbdddd6..060ff07 100644
+index 9745cf9..8dbe1b5 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -64,7 +64,7 @@
@@ -39991,7 +41880,7 @@ index e5565fb..71be10b4 100644
+ .command_completed = smart1_completed,
};
diff --git a/drivers/bluetooth/btwilink.c b/drivers/bluetooth/btwilink.c
-index 57eb935..eafd6b8 100644
+index 24a652f..2dffae6 100644
--- a/drivers/bluetooth/btwilink.c
+++ b/drivers/bluetooth/btwilink.c
@@ -275,7 +275,7 @@ static int ti_st_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
@@ -40034,7 +41923,7 @@ index 577cc4b..bfe0c2d 100644
return 0;
}
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
-index c206ccd..375691c 100644
+index 1b257ea..ea76b22 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -610,7 +610,6 @@ int register_cdrom(struct cdrom_device_info *cdi)
@@ -40076,7 +41965,7 @@ index c206ccd..375691c 100644
if (cgc.buffer)
break;
-@@ -3435,7 +3436,7 @@ static int cdrom_print_info(const char *header, int val, char *info,
+@@ -3431,7 +3432,7 @@ static int cdrom_print_info(const char *header, int val, char *info,
struct cdrom_device_info *cdi;
int ret;
@@ -40182,7 +42071,7 @@ index 4f94375..413694e 100644
return -EINVAL;
else
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
-index 240b6cf..e0ba20c 100644
+index be54e53..50272fe 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -574,7 +574,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets,
@@ -40195,7 +42084,7 @@ index 240b6cf..e0ba20c 100644
{
struct hpet_timer __iomem *timer;
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
-index e3536da..b1617f0 100644
+index 94fb407..603dd43 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -436,7 +436,7 @@ struct ipmi_smi {
@@ -40217,9 +42106,9 @@ index e3536da..b1617f0 100644
- ((unsigned int) atomic_read(&(intf)->stats[IPMI_STAT_ ## stat]))
+ ((unsigned int) atomic_read_unchecked(&(intf)->stats[IPMI_STAT_ ## stat]))
- static char *addr_src_to_str[] = { "invalid", "hotmod", "hardcoded", "SPMI",
- "ACPI", "SMBIOS", "PCI",
-@@ -2834,7 +2834,7 @@ int ipmi_register_smi(const struct ipmi_smi_handlers *handlers,
+ static const char * const addr_src_to_str[] = {
+ "invalid", "hotmod", "hardcoded", "SPMI", "ACPI", "SMBIOS", "PCI",
+@@ -2835,7 +2835,7 @@ int ipmi_register_smi(const struct ipmi_smi_handlers *handlers,
INIT_LIST_HEAD(&intf->cmd_rcvrs);
init_waitqueue_head(&intf->waitq);
for (i = 0; i < IPMI_NUM_STATS; i++)
@@ -40228,11 +42117,24 @@ index e3536da..b1617f0 100644
intf->proc_dir = NULL;
+diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c
+index 9f2e3be..676c910 100644
+--- a/drivers/char/ipmi/ipmi_poweroff.c
++++ b/drivers/char/ipmi/ipmi_poweroff.c
+@@ -66,7 +66,7 @@ static void (*specific_poweroff_func)(ipmi_user_t user);
+ /* Holds the old poweroff function so we can restore it on removal. */
+ static void (*old_poweroff_func)(void);
+
+-static int set_param_ifnum(const char *val, struct kernel_param *kp)
++static int set_param_ifnum(const char *val, const struct kernel_param *kp)
+ {
+ int rv = param_set_int(val, kp);
+ if (rv)
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
-index 4cc72fa..4c6f80d 100644
+index 7fddd86..f5b038e 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
-@@ -300,7 +300,7 @@ struct smi_info {
+@@ -302,7 +302,7 @@ struct smi_info {
unsigned char slave_addr;
/* Counters and things for the proc filesystem. */
@@ -40241,7 +42143,7 @@ index 4cc72fa..4c6f80d 100644
struct task_struct *thread;
-@@ -309,9 +309,9 @@ struct smi_info {
+@@ -311,9 +311,9 @@ struct smi_info {
};
#define smi_inc_stat(smi, stat) \
@@ -40253,7 +42155,25 @@ index 4cc72fa..4c6f80d 100644
#define SI_MAX_PARMS 4
-@@ -3620,7 +3620,7 @@ static int try_smi_init(struct smi_info *new_smi)
+@@ -1345,7 +1345,7 @@ static unsigned int num_slave_addrs;
+ #define IPMI_MEM_ADDR_SPACE 1
+ static const char * const addr_space_to_str[] = { "i/o", "mem" };
+
+-static int hotmod_handler(const char *val, struct kernel_param *kp);
++static int hotmod_handler(const char *val, const struct kernel_param *kp);
+
+ module_param_call(hotmod, hotmod_handler, NULL, NULL, 0200);
+ MODULE_PARM_DESC(hotmod, "Add and remove interfaces. See"
+@@ -1806,7 +1806,7 @@ static struct smi_info *smi_info_alloc(void)
+ return info;
+ }
+
+-static int hotmod_handler(const char *val, struct kernel_param *kp)
++static int hotmod_handler(const char *val, const struct kernel_param *kp)
+ {
+ char *str = kstrdup(val, GFP_KERNEL);
+ int rv;
+@@ -3623,7 +3623,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++)
@@ -40263,7 +42183,7 @@ index 4cc72fa..4c6f80d 100644
new_smi->interrupt_disabled = true;
atomic_set(&new_smi->need_watch, 0);
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
-index 90e6246..58acb77 100644
+index 5f1c3d0..8fca936 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -284,17 +284,17 @@ struct ssif_info {
@@ -40307,7 +42227,7 @@ index 90e6246..58acb77 100644
if (ssif_info->supports_pec)
ssif_info->client->flags |= I2C_CLIENT_PEC;
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
-index 6b1721f..fda9398 100644
+index 4f6f94c..1e20d2f5 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -18,6 +18,7 @@
@@ -40456,10 +42376,10 @@ index 6b1721f..fda9398 100644
return tty_init();
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
-index 97c2d8d..aa03a89 100644
+index 0129232..422edaa 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
-@@ -247,7 +247,7 @@ static ssize_t nvram_read(struct file *file, char __user *buf,
+@@ -235,7 +235,7 @@ static ssize_t nvram_read(struct file *file, char __user *buf,
spin_unlock_irq(&rtc_lock);
@@ -40541,7 +42461,7 @@ index 45df4bf..22d88d4 100644
if (cmd != SIOCWANDEV)
diff --git a/drivers/char/random.c b/drivers/char/random.c
-index d0da5d8..739fd3a 100644
+index b583e53..f3bb4ac 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -289,9 +289,6 @@
@@ -40843,10 +42763,10 @@ index b5bcd77..0f7bd99 100644
return 0;
}
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
-index cec1ee2..d8e33a0 100644
+index 51eef87..d944fa7 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
-@@ -687,8 +687,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
+@@ -682,8 +682,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
data->acpi_perf_cpu = cpu;
policy->driver_data = data;
@@ -40860,7 +42780,7 @@ index cec1ee2..d8e33a0 100644
result = acpi_processor_register_performance(perf, cpu);
if (result)
-@@ -821,7 +824,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
+@@ -816,7 +819,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu);
break;
case ACPI_ADR_SPACE_FIXED_HARDWARE:
@@ -40871,24 +42791,24 @@ index cec1ee2..d8e33a0 100644
break;
default:
break;
-@@ -916,8 +921,10 @@ static void __init acpi_cpufreq_boost_init(void)
+@@ -910,8 +915,10 @@ static void __init acpi_cpufreq_boost_init(void)
if (!msrs)
return;
-- acpi_cpufreq_driver.boost_supported = true;
+- acpi_cpufreq_driver.set_boost = set_boost;
- acpi_cpufreq_driver.boost_enabled = boost_state(0);
+ pax_open_kernel();
-+ *(bool *)&acpi_cpufreq_driver.boost_supported = true;
++ *(void **)&acpi_cpufreq_driver.set_boost = set_boost;
+ *(bool *)&acpi_cpufreq_driver.boost_enabled = boost_state(0);
+ pax_close_kernel();
cpu_notifier_register_begin();
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
-index 90d6408..0df4580 100644
+index 0ca74d0..15705fb 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
-@@ -456,7 +456,9 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
+@@ -461,7 +461,9 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
if (!IS_ERR(cpu_reg))
regulator_put(cpu_reg);
@@ -40900,9 +42820,24 @@ index 90d6408..0df4580 100644
ret = cpufreq_register_driver(&dt_cpufreq_driver);
if (ret)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
-index 8412ce5..3a40e15 100644
+index e979ec7..a024e16 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
+@@ -474,12 +474,12 @@ EXPORT_SYMBOL_GPL(cpufreq_freq_transition_end);
+ * SYSFS INTERFACE *
+ *********************************************************************/
+ static ssize_t show_boost(struct kobject *kobj,
+- struct attribute *attr, char *buf)
++ struct kobj_attribute *attr, char *buf)
+ {
+ return sprintf(buf, "%d\n", cpufreq_driver->boost_enabled);
+ }
+
+-static ssize_t store_boost(struct kobject *kobj, struct attribute *attr,
++static ssize_t store_boost(struct kobject *kobj, struct kobj_attribute *attr,
+ const char *buf, size_t count)
+ {
+ int ret, enable;
@@ -2048,7 +2048,7 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor)
read_unlock_irqrestore(&cpufreq_driver_lock, flags);
@@ -40941,32 +42876,18 @@ index 8412ce5..3a40e15 100644
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
pr_err("%s: Cannot %s BOOST\n",
-@@ -2350,8 +2354,11 @@ static int create_boost_sysfs_file(void)
- * Check if driver provides function to enable boost -
- * if not, use cpufreq_boost_set_sw as default
- */
-- if (!cpufreq_driver->set_boost)
-- cpufreq_driver->set_boost = cpufreq_boost_set_sw;
-+ if (!cpufreq_driver->set_boost) {
-+ pax_open_kernel();
-+ *(void **)&cpufreq_driver->set_boost = cpufreq_boost_set_sw;
-+ pax_close_kernel();
-+ }
-
- ret = sysfs_create_file(cpufreq_global_kobject, &boost.attr);
- if (ret)
-@@ -2375,7 +2382,9 @@ int cpufreq_enable_boost_support(void)
+@@ -2361,7 +2365,9 @@ int cpufreq_enable_boost_support(void)
if (cpufreq_boost_supported())
return 0;
-- cpufreq_driver->boost_supported = true;
+- cpufreq_driver->set_boost = cpufreq_boost_set_sw;
+ pax_open_kernel();
-+ *(bool *)&cpufreq_driver->boost_supported = true;
++ *(void **)&cpufreq_driver->set_boost = cpufreq_boost_set_sw;
+ pax_close_kernel();
/* This will get removed on driver unregister */
return create_boost_sysfs_file();
-@@ -2432,8 +2441,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
+@@ -2418,8 +2424,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
cpufreq_driver = driver_data;
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
@@ -40978,13 +42899,13 @@ index 8412ce5..3a40e15 100644
+ pax_close_kernel();
+ }
- ret = create_boost_sysfs_file();
- if (ret)
+ if (cpufreq_boost_supported()) {
+ ret = create_boost_sysfs_file();
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
-index d994b0f..b0b9d15 100644
+index e0d1110..575e673 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
-@@ -465,7 +465,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy,
+@@ -497,7 +497,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy,
cs_dbs_info->down_skip = 0;
cs_dbs_info->requested_freq = policy->cur;
} else {
@@ -40994,10 +42915,28 @@ index d994b0f..b0b9d15 100644
od_dbs_info->rate_mult = 1;
diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h
-index 5621bb0..a854d3c 100644
+index 91e767a0..3b40724 100644
--- a/drivers/cpufreq/cpufreq_governor.h
+++ b/drivers/cpufreq/cpufreq_governor.h
-@@ -217,7 +217,7 @@ struct common_dbs_data {
+@@ -75,7 +75,7 @@ __ATTR(_name, 0644, show_##_name##_gov_pol, store_##_name##_gov_pol)
+ /* Create show/store routines */
+ #define show_one(_gov, file_name) \
+ static ssize_t show_##file_name##_gov_sys \
+-(struct kobject *kobj, struct attribute *attr, char *buf) \
++(struct kobject *kobj, struct kobj_attribute *attr, char *buf) \
+ { \
+ struct _gov##_dbs_tuners *tuners = _gov##_dbs_cdata.gdbs_data->tuners; \
+ return sprintf(buf, "%u\n", tuners->file_name); \
+@@ -91,7 +91,7 @@ static ssize_t show_##file_name##_gov_pol \
+
+ #define store_one(_gov, file_name) \
+ static ssize_t store_##file_name##_gov_sys \
+-(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) \
++(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) \
+ { \
+ struct dbs_data *dbs_data = _gov##_dbs_cdata.gdbs_data; \
+ return store_##file_name(dbs_data, buf, count); \
+@@ -219,7 +219,7 @@ struct common_dbs_data {
void (*exit)(struct dbs_data *dbs_data, bool notify);
/* Governor specific ops, see below */
@@ -41006,7 +42945,7 @@ index 5621bb0..a854d3c 100644
/*
* Protects governor's data (struct dbs_data and struct common_dbs_data)
-@@ -239,7 +239,7 @@ struct od_ops {
+@@ -241,7 +241,7 @@ struct od_ops {
unsigned int (*powersave_bias_target)(struct cpufreq_policy *policy,
unsigned int freq_next, unsigned int relation);
void (*freq_increase)(struct cpufreq_policy *policy, unsigned int freq);
@@ -41015,11 +42954,20 @@ index 5621bb0..a854d3c 100644
static inline int delay_for_sampling_rate(unsigned int sampling_rate)
{
+@@ -256,7 +256,7 @@ static inline int delay_for_sampling_rate(unsigned int sampling_rate)
+
+ #define declare_show_sampling_rate_min(_gov) \
+ static ssize_t show_sampling_rate_min_gov_sys \
+-(struct kobject *kobj, struct attribute *attr, char *buf) \
++(struct kobject *kobj, struct kobj_attribute *attr, char *buf) \
+ { \
+ struct dbs_data *dbs_data = _gov##_dbs_cdata.gdbs_data; \
+ return sprintf(buf, "%u\n", dbs_data->min_sampling_rate); \
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
-index 03ac6ce..2d7a94b 100644
+index eae5107..26e7a39 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
-@@ -509,7 +509,7 @@ static void od_exit(struct dbs_data *dbs_data, bool notify)
+@@ -534,7 +534,7 @@ static void od_exit(struct dbs_data *dbs_data, bool notify)
define_get_cpu_dbs_routines(od_cpu_dbs_info);
@@ -41028,7 +42976,7 @@ index 03ac6ce..2d7a94b 100644
.powersave_bias_init_cpu = ondemand_powersave_bias_init_cpu,
.powersave_bias_target = generic_powersave_bias_target,
.freq_increase = dbs_freq_increase,
-@@ -568,14 +568,18 @@ void od_register_powersave_bias_handler(unsigned int (*f)
+@@ -593,14 +593,18 @@ void od_register_powersave_bias_handler(unsigned int (*f)
(struct cpufreq_policy *, unsigned int, unsigned int),
unsigned int powersave_bias)
{
@@ -41050,15 +42998,11 @@ index 03ac6ce..2d7a94b 100644
}
EXPORT_SYMBOL_GPL(od_unregister_powersave_bias_handler);
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
-index 98fb882..9f1d2a4 100644
+index cd83d47..3ad4309 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
-@@ -138,10 +138,10 @@ struct pstate_funcs {
- struct cpu_defaults {
- struct pstate_adjust_policy pid_policy;
- struct pstate_funcs funcs;
--};
-+} __do_const;
+@@ -147,7 +147,7 @@ static inline int32_t get_target_pstate_use_performance(struct cpudata *cpu);
+ static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu);
static struct pstate_adjust_policy pid_params;
-static struct pstate_funcs pstate_funcs;
@@ -41066,7 +43010,68 @@ index 98fb882..9f1d2a4 100644
static int hwp_active;
struct perf_limits {
-@@ -840,19 +840,19 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate, bool force)
+@@ -374,13 +374,13 @@ static void __init intel_pstate_debug_expose_params(void)
+ /************************** sysfs begin ************************/
+ #define show_one(file_name, object) \
+ static ssize_t show_##file_name \
+- (struct kobject *kobj, struct attribute *attr, char *buf) \
++ (struct kobject *kobj, struct kobj_attribute *attr, char *buf) \
+ { \
+ return sprintf(buf, "%u\n", limits->object); \
+ }
+
+ static ssize_t show_turbo_pct(struct kobject *kobj,
+- struct attribute *attr, char *buf)
++ struct kobj_attribute *attr, char *buf)
+ {
+ struct cpudata *cpu;
+ int total, no_turbo, turbo_pct;
+@@ -396,7 +396,7 @@ static ssize_t show_turbo_pct(struct kobject *kobj,
+ }
+
+ static ssize_t show_num_pstates(struct kobject *kobj,
+- struct attribute *attr, char *buf)
++ struct kobj_attribute *attr, char *buf)
+ {
+ struct cpudata *cpu;
+ int total;
+@@ -407,7 +407,7 @@ static ssize_t show_num_pstates(struct kobject *kobj,
+ }
+
+ static ssize_t show_no_turbo(struct kobject *kobj,
+- struct attribute *attr, char *buf)
++ struct kobj_attribute *attr, char *buf)
+ {
+ ssize_t ret;
+
+@@ -420,7 +420,7 @@ static ssize_t show_no_turbo(struct kobject *kobj,
+ return ret;
+ }
+
+-static ssize_t store_no_turbo(struct kobject *a, struct attribute *b,
++static ssize_t store_no_turbo(struct kobject *a, struct kobj_attribute *b,
+ const char *buf, size_t count)
+ {
+ unsigned int input;
+@@ -444,7 +444,7 @@ static ssize_t store_no_turbo(struct kobject *a, struct attribute *b,
+ return count;
+ }
+
+-static ssize_t store_max_perf_pct(struct kobject *a, struct attribute *b,
++static ssize_t store_max_perf_pct(struct kobject *a, struct kobj_attribute *b,
+ const char *buf, size_t count)
+ {
+ unsigned int input;
+@@ -469,7 +469,7 @@ static ssize_t store_max_perf_pct(struct kobject *a, struct attribute *b,
+ return count;
+ }
+
+-static ssize_t store_min_perf_pct(struct kobject *a, struct attribute *b,
++static ssize_t store_min_perf_pct(struct kobject *a, struct kobj_attribute *b,
+ const char *buf, size_t count)
+ {
+ unsigned int input;
+@@ -850,19 +850,19 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate, bool force)
cpu->pstate.current_pstate = pstate;
@@ -41094,7 +43099,16 @@ index 98fb882..9f1d2a4 100644
intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate, false);
}
-@@ -1210,15 +1210,15 @@ static unsigned int force_load;
+@@ -1016,7 +1016,7 @@ static inline void intel_pstate_adjust_busy_pstate(struct cpudata *cpu)
+
+ from = cpu->pstate.current_pstate;
+
+- target_pstate = pstate_funcs.get_target_pstate(cpu);
++ target_pstate = pstate_funcs->get_target_pstate(cpu);
+
+ intel_pstate_set_pstate(cpu, target_pstate, true);
+
+@@ -1249,15 +1249,15 @@ static unsigned int force_load;
static int intel_pstate_msrs_not_valid(void)
{
@@ -41114,7 +43128,7 @@ index 98fb882..9f1d2a4 100644
{
pid_params.sample_rate_ms = policy->sample_rate_ms;
pid_params.p_gain_pct = policy->p_gain_pct;
-@@ -1230,13 +1230,7 @@ static void copy_pid_params(struct pstate_adjust_policy *policy)
+@@ -1269,15 +1269,7 @@ static void copy_pid_params(struct pstate_adjust_policy *policy)
static void copy_cpu_funcs(struct pstate_funcs *funcs)
{
@@ -41125,6 +43139,8 @@ index 98fb882..9f1d2a4 100644
- pstate_funcs.get_scaling = funcs->get_scaling;
- pstate_funcs.set = funcs->set;
- pstate_funcs.get_vid = funcs->get_vid;
+- pstate_funcs.get_target_pstate = funcs->get_target_pstate;
+-
+ pstate_funcs = funcs;
}
@@ -41328,6 +43344,38 @@ index fb9f511..213e6cc 100644
if (!cpuidle_curr_governor ||
cpuidle_curr_governor->rating < gov->rating)
cpuidle_switch_governor(gov);
+diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c
+index 63bd5a4..eea2dff 100644
+--- a/drivers/cpuidle/governors/ladder.c
++++ b/drivers/cpuidle/governors/ladder.c
+@@ -173,6 +173,15 @@ static void ladder_reflect(struct cpuidle_device *dev, int index)
+
+ static struct cpuidle_governor ladder_governor = {
+ .name = "ladder",
++ .rating = 25,
++ .enable = ladder_enable_device,
++ .select = ladder_select_state,
++ .reflect = ladder_reflect,
++ .owner = THIS_MODULE,
++};
++
++static struct cpuidle_governor ladder_governor_nohz = {
++ .name = "ladder",
+ .rating = 10,
+ .enable = ladder_enable_device,
+ .select = ladder_select_state,
+@@ -190,10 +199,8 @@ static int __init init_ladder(void)
+ * governor is better so give it a higher rating than the menu
+ * governor.
+ */
+- if (!tick_nohz_enabled)
+- ladder_governor.rating = 25;
+
+- return cpuidle_register_governor(&ladder_governor);
++ return cpuidle_register_governor(tick_nohz_enabled ? &ladder_governor_nohz : &ladder_governor);
+ }
+
+ postcore_initcall(init_ladder);
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index 832a2c3..1794080 100644
--- a/drivers/cpuidle/sysfs.c
@@ -41370,10 +43418,10 @@ index 8ef06fa..ab9945f 100644
state.msg_bits = rctx->msg_bits;
state.first = rctx->first;
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
-index ca5c71a..df88d0c 100644
+index eee2c7e..268aa3e 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
-@@ -49,7 +49,7 @@ module_param_string(hifn_pll_ref, hifn_pll_ref, sizeof(hifn_pll_ref), 0444);
+@@ -37,7 +37,7 @@ module_param_string(hifn_pll_ref, hifn_pll_ref, sizeof(hifn_pll_ref), 0444);
MODULE_PARM_DESC(hifn_pll_ref,
"PLL reference clock (pci[freq] or ext[freq], default ext)");
@@ -41382,12 +43430,12 @@ index ca5c71a..df88d0c 100644
#define ACRYPTO_OP_DECRYPT 0
#define ACRYPTO_OP_ENCRYPT 1
-@@ -2575,7 +2575,7 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+@@ -2483,7 +2483,7 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto err_out_disable_pci_device;
snprintf(name, sizeof(name), "hifn%d",
-- atomic_inc_return(&hifn_dev_number)-1);
-+ atomic_inc_return_unchecked(&hifn_dev_number)-1);
+- atomic_inc_return(&hifn_dev_number) - 1);
++ atomic_inc_return_unchecked(&hifn_dev_number) - 1);
err = pci_request_regions(pdev, name);
if (err)
@@ -41413,7 +43461,7 @@ index bd985e7..74071e4 100644
u64 len;
int src_nents;
diff --git a/drivers/crypto/marvell/hash.c b/drivers/crypto/marvell/hash.c
-index 6ec55b4..27b314e 100644
+index 683cca9..7ca2e0f 100644
--- a/drivers/crypto/marvell/hash.c
+++ b/drivers/crypto/marvell/hash.c
@@ -45,69 +45,25 @@ mv_cesa_ahash_req_iter_next_op(struct mv_cesa_ahash_dma_iter *iter)
@@ -41546,7 +43594,7 @@ index 6ec55b4..27b314e 100644
return mv_cesa_dma_add_data_transfer(chain,
CESA_SA_DATA_SRAM_OFFSET,
ahashdreq->cache_dma,
-@@ -844,10 +798,6 @@ static int mv_cesa_ahash_import(struct ahash_request *req, const void *hash,
+@@ -848,10 +802,6 @@ static int mv_cesa_ahash_import(struct ahash_request *req, const void *hash,
if (!cache_ptr)
return 0;
@@ -41557,7 +43605,7 @@ index 6ec55b4..27b314e 100644
memcpy(creq->cache, cache, cache_ptr);
creq->cache_ptr = cache_ptr;
-@@ -856,9 +806,14 @@ static int mv_cesa_ahash_import(struct ahash_request *req, const void *hash,
+@@ -860,9 +810,14 @@ static int mv_cesa_ahash_import(struct ahash_request *req, const void *hash,
static int mv_cesa_md5_init(struct ahash_request *req)
{
@@ -41572,7 +43620,7 @@ index 6ec55b4..27b314e 100644
mv_cesa_ahash_init(req, &tmpl, true);
-@@ -919,9 +874,15 @@ struct ahash_alg mv_md5_alg = {
+@@ -923,9 +878,15 @@ struct ahash_alg mv_md5_alg = {
static int mv_cesa_sha1_init(struct ahash_request *req)
{
@@ -41588,7 +43636,7 @@ index 6ec55b4..27b314e 100644
mv_cesa_ahash_init(req, &tmpl, false);
-@@ -982,9 +943,18 @@ struct ahash_alg mv_sha1_alg = {
+@@ -986,9 +947,18 @@ struct ahash_alg mv_sha1_alg = {
static int mv_cesa_sha256_init(struct ahash_request *req)
{
@@ -41607,11 +43655,71 @@ index 6ec55b4..27b314e 100644
mv_cesa_ahash_init(req, &tmpl, false);
+diff --git a/drivers/crypto/qat/qat_common/adf_aer.c b/drivers/crypto/qat/qat_common/adf_aer.c
+index e78a1d7..f6ef8aa 100644
+--- a/drivers/crypto/qat/qat_common/adf_aer.c
++++ b/drivers/crypto/qat/qat_common/adf_aer.c
+@@ -56,7 +56,7 @@
+ static struct workqueue_struct *device_reset_wq;
+
+ static pci_ers_result_t adf_error_detected(struct pci_dev *pdev,
+- pci_channel_state_t state)
++ enum pci_channel_state state)
+ {
+ struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev);
+
+diff --git a/drivers/crypto/qat/qat_common/adf_sriov.c b/drivers/crypto/qat/qat_common/adf_sriov.c
+index 1117a8b..6f9dd73 100644
+--- a/drivers/crypto/qat/qat_common/adf_sriov.c
++++ b/drivers/crypto/qat/qat_common/adf_sriov.c
+@@ -93,7 +93,7 @@ static void adf_iov_send_resp(struct work_struct *work)
+ kfree(pf2vf_resp);
+ }
+
+-static void adf_vf2pf_bh_handler(void *data)
++static void adf_vf2pf_bh_handler(unsigned long data)
+ {
+ struct adf_accel_vf_info *vf_info = (struct adf_accel_vf_info *)data;
+ struct adf_pf2vf_resp *pf2vf_resp;
+@@ -131,7 +131,7 @@ static int adf_enable_sriov(struct adf_accel_dev *accel_dev)
+ vf_info->vf_nr = i;
+
+ tasklet_init(&vf_info->vf2pf_bh_tasklet,
+- (void *)adf_vf2pf_bh_handler,
++ adf_vf2pf_bh_handler,
+ (unsigned long)vf_info);
+ mutex_init(&vf_info->pf2vf_lock);
+ ratelimit_state_init(&vf_info->vf2pf_ratelimit,
+diff --git a/drivers/crypto/qat/qat_common/adf_vf_isr.c b/drivers/crypto/qat/qat_common/adf_vf_isr.c
+index 09427b3..50f7306 100644
+--- a/drivers/crypto/qat/qat_common/adf_vf_isr.c
++++ b/drivers/crypto/qat/qat_common/adf_vf_isr.c
+@@ -90,9 +90,9 @@ static void adf_disable_msi(struct adf_accel_dev *accel_dev)
+ pci_disable_msi(pdev);
+ }
+
+-static void adf_pf2vf_bh_handler(void *data)
++static void adf_pf2vf_bh_handler(unsigned long data)
+ {
+- struct adf_accel_dev *accel_dev = data;
++ struct adf_accel_dev *accel_dev = (struct adf_accel_dev *)data;
+ struct adf_hw_device_data *hw_data = accel_dev->hw_device;
+ struct adf_bar *pmisc =
+ &GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)];
+@@ -143,7 +143,7 @@ err:
+ static int adf_setup_pf2vf_bh(struct adf_accel_dev *accel_dev)
+ {
+ tasklet_init(&accel_dev->vf.pf2vf_bh_tasklet,
+- (void *)adf_pf2vf_bh_handler, (unsigned long)accel_dev);
++ adf_pf2vf_bh_handler, (unsigned long)accel_dev);
+
+ mutex_init(&accel_dev->vf.vf2pf_lock);
+ return 0;
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
-index ca848cc..9049c89 100644
+index 984c5e9..c873659 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
-@@ -671,7 +671,7 @@ int devfreq_add_governor(struct devfreq_governor *governor)
+@@ -717,7 +717,7 @@ int devfreq_add_governor(struct devfreq_governor *governor)
goto err_out;
}
@@ -41620,7 +43728,7 @@ index ca848cc..9049c89 100644
list_for_each_entry(devfreq, &devfreq_list, node) {
int ret = 0;
-@@ -759,7 +759,7 @@ int devfreq_remove_governor(struct devfreq_governor *governor)
+@@ -805,7 +805,7 @@ int devfreq_remove_governor(struct devfreq_governor *governor)
}
}
@@ -41658,10 +43766,10 @@ index 11707df..2ea96f7 100644
/* Run before NMI debug handler and KGDB */
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
-index 5358737..2064670 100644
+index a979003..773b7f0 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
-@@ -474,9 +474,9 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
+@@ -468,9 +468,9 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
*/
int edac_device_alloc_index(void)
{
@@ -41673,10 +43781,32 @@ index 5358737..2064670 100644
}
EXPORT_SYMBOL_GPL(edac_device_alloc_index);
+diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c
+index 93da1a4..5e2c149 100644
+--- a/drivers/edac/edac_device_sysfs.c
++++ b/drivers/edac/edac_device_sysfs.c
+@@ -749,7 +749,7 @@ static int edac_device_add_main_sysfs_attributes(
+ */
+ while (sysfs_attrib->attr.name != NULL) {
+ err = sysfs_create_file(&edac_dev->kobj,
+- (struct attribute*) sysfs_attrib);
++ &sysfs_attrib->attr);
+ if (err)
+ goto err_out;
+
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
-index 58aed67..e6817a1 100644
+index 26e65ab..9a1e25d 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
+@@ -50,7 +50,7 @@ int edac_mc_get_poll_msec(void)
+ return edac_mc_poll_msec;
+ }
+
+-static int edac_set_poll_msec(const char *val, struct kernel_param *kp)
++static int edac_set_poll_msec(const char *val, const struct kernel_param *kp)
+ {
+ unsigned long l;
+ int ret;
@@ -154,7 +154,7 @@ static const char * const edac_caps[] = {
struct dev_ch_attribute {
struct device_attribute attr;
@@ -41686,8 +43816,21 @@ index 58aed67..e6817a1 100644
#define DEVICE_CHANNEL(_name, _mode, _show, _store, _var) \
static struct dev_ch_attribute dev_attr_legacy_##_name = \
+diff --git a/drivers/edac/edac_module.c b/drivers/edac/edac_module.c
+index 5f8543b..46aa017 100644
+--- a/drivers/edac/edac_module.c
++++ b/drivers/edac/edac_module.c
+@@ -19,7 +19,7 @@
+
+ #ifdef CONFIG_EDAC_DEBUG
+
+-static int edac_set_debug_level(const char *buf, struct kernel_param *kp)
++static int edac_set_debug_level(const char *buf, const struct kernel_param *kp)
+ {
+ unsigned long val;
+ int ret;
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
-index b4b3860..08d7faa 100644
+index 9968538..fa53f93 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -29,7 +29,7 @@
@@ -41699,7 +43842,7 @@ index b4b3860..08d7faa 100644
/*
* edac_pci_alloc_ctl_info
-@@ -314,7 +314,7 @@ EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
+@@ -255,7 +255,7 @@ static void edac_pci_workq_teardown(struct edac_pci_ctl_info *pci)
*/
int edac_pci_alloc_index(void)
{
@@ -41709,7 +43852,7 @@ index b4b3860..08d7faa 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 24d877f..4e30133 100644
+index 6e3428b..9bdb207 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -23,8 +23,8 @@ static int edac_pci_log_pe = 1; /* log PCI parity errors */
@@ -41732,7 +43875,7 @@ index 24d877f..4e30133 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,
-@@ -576,7 +576,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -564,7 +564,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));
@@ -41741,7 +43884,7 @@ index 24d877f..4e30133 100644
}
if (status & (PCI_STATUS_PARITY)) {
-@@ -584,7 +584,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -572,7 +572,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
"Master Data Parity Error on %s\n",
pci_name(dev));
@@ -41750,7 +43893,7 @@ index 24d877f..4e30133 100644
}
if (status & (PCI_STATUS_DETECTED_PARITY)) {
-@@ -592,7 +592,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -580,7 +580,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
"Detected Parity Error on %s\n",
pci_name(dev));
@@ -41759,7 +43902,7 @@ index 24d877f..4e30133 100644
}
}
-@@ -615,7 +615,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -603,7 +603,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));
@@ -41768,7 +43911,7 @@ index 24d877f..4e30133 100644
}
if (status & (PCI_STATUS_PARITY)) {
-@@ -623,7 +623,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -611,7 +611,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
"Master Data Parity Error on "
"%s\n", pci_name(dev));
@@ -41777,7 +43920,7 @@ index 24d877f..4e30133 100644
}
if (status & (PCI_STATUS_DETECTED_PARITY)) {
-@@ -631,7 +631,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
+@@ -619,7 +619,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
"Detected Parity Error on %s\n",
pci_name(dev));
@@ -41786,7 +43929,7 @@ index 24d877f..4e30133 100644
}
}
}
-@@ -669,7 +669,7 @@ void edac_pci_do_parity_check(void)
+@@ -657,7 +657,7 @@ void edac_pci_do_parity_check(void)
if (!check_pci_errors)
return;
@@ -41795,7 +43938,7 @@ index 24d877f..4e30133 100644
/* scan all PCI devices looking for a Parity Error on devices and
* bridges.
-@@ -681,7 +681,7 @@ void edac_pci_do_parity_check(void)
+@@ -669,7 +669,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' */
@@ -41842,6 +43985,28 @@ index 57ea7f4..af06b76 100644
card->driver->update_phy_reg(card, 4,
PHY_LINK_ACTIVE | PHY_CONTENDER, 0);
+diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
+index 36a7c2d..3cea1bf 100644
+--- a/drivers/firewire/core-cdev.c
++++ b/drivers/firewire/core-cdev.c
+@@ -970,7 +970,7 @@ static int ioctl_create_iso_context(struct client *client, union ioctl_arg *arg)
+ {
+ struct fw_cdev_create_iso_context *a = &arg->create_iso_context;
+ struct fw_iso_context *context;
+- fw_iso_callback_t cb;
++ void *cb;
+ int ret;
+
+ BUILD_BUG_ON(FW_CDEV_ISO_CONTEXT_TRANSMIT != FW_ISO_CONTEXT_TRANSMIT ||
+@@ -995,7 +995,7 @@ static int ioctl_create_iso_context(struct client *client, union ioctl_arg *arg)
+ break;
+
+ case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL:
+- cb = (fw_iso_callback_t)iso_mc_callback;
++ cb = iso_mc_callback;
+ break;
+
+ default:
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c
index f9e3aee..269dbdb 100644
--- a/drivers/firewire/core-device.c
@@ -41855,6 +44020,19 @@ index f9e3aee..269dbdb 100644
static ssize_t show_immediate(struct device *dev,
struct device_attribute *dattr, char *buf)
+diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c
+index 38c0aa6..95466e4 100644
+--- a/drivers/firewire/core-iso.c
++++ b/drivers/firewire/core-iso.c
+@@ -162,7 +162,7 @@ size_t fw_iso_buffer_lookup(struct fw_iso_buffer *buffer, dma_addr_t completed)
+
+ struct fw_iso_context *fw_iso_context_create(struct fw_card *card,
+ int type, int channel, int speed, size_t header_size,
+- fw_iso_callback_t callback, void *callback_data)
++ void *callback, void *callback_data)
+ {
+ struct fw_iso_context *ctx;
+
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index d6a09b9..18e90dd 100644
--- a/drivers/firewire/core-transaction.c
@@ -41908,7 +44086,7 @@ index c2f5117..e36414d 100644
/*
* FIXME: Make sure this bitmask is cleared when we clear the busReset
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
-index 94a58a0..f5eba42 100644
+index 94a58a0..5b8dd03 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -16,7 +16,7 @@
@@ -41920,11 +44098,27 @@ index 94a58a0..f5eba42 100644
#define to_dmi_dev_attr(_dev_attr) \
container_of(_dev_attr, struct dmi_device_attribute, dev_attr)
+@@ -159,9 +159,14 @@ static int dmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
+ return 0;
+ }
+
++static void dmi_dev_release(struct device *dev)
++{
++ kfree(dev);
++}
++
+ static struct class dmi_class = {
+ .name = "dmi",
+- .dev_release = (void(*)(struct device *)) kfree,
++ .dev_release = dmi_dev_release,
+ .dev_uevent = dmi_dev_uevent,
+ };
+
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
-index 0e08e66..7824b4a 100644
+index 88bebe1..c7b636f 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
-@@ -690,14 +690,18 @@ static int __init dmi_init(void)
+@@ -712,14 +712,18 @@ static int __init dmi_init(void)
if (!dmi_table)
goto err_tables;
@@ -41969,10 +44163,10 @@ index d425374..1da1716 100644
EXPORT_SYMBOL_GPL(cper_next_record_id);
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
-index 027ca21..65689be 100644
+index 2cd37da..8bcbe8b 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
-@@ -174,14 +174,16 @@ static struct attribute_group efi_subsys_attr_group = {
+@@ -176,14 +176,16 @@ static struct attribute_group efi_subsys_attr_group = {
};
static struct efivars generic_efivars;
@@ -42072,10 +44266,10 @@ index 5de3ed2..d839c56 100644
.sysfs_ops = &memmap_attr_ops,
.default_attrs = def_attrs,
diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
-index d24f35d..5875c5d 100644
+index f25cd79..7b7ad07 100644
--- a/drivers/firmware/psci.c
+++ b/drivers/firmware/psci.c
-@@ -54,7 +54,7 @@ bool psci_tos_resident_on(int cpu)
+@@ -55,7 +55,7 @@ bool psci_tos_resident_on(int cpu)
return cpu == resident_cpu;
}
@@ -42085,10 +44279,10 @@ index d24f35d..5875c5d 100644
typedef unsigned long (psci_fn)(unsigned long, unsigned long,
unsigned long, unsigned long);
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
-index 5e71538..00b7406 100644
+index cd007a6..6fd1a2e 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
-@@ -441,9 +441,9 @@ static struct irq_chip *davinci_gpio_get_irq_chip(unsigned int irq)
+@@ -439,9 +439,9 @@ static struct irq_chip *davinci_gpio_get_irq_chip(unsigned int irq)
return &gpio_unbanked.chip;
};
@@ -42100,7 +44294,7 @@ index 5e71538..00b7406 100644
gpio_unbanked = *irq_get_chip(irq);
return &gpio_unbanked;
-@@ -473,7 +473,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)
+@@ -471,7 +471,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)
struct davinci_gpio_regs __iomem *g;
struct irq_domain *irq_domain = NULL;
const struct of_device_id *match;
@@ -42110,7 +44304,7 @@ index 5e71538..00b7406 100644
/*
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
-index 6bca1e1..ed8b22e 100644
+index 8d32ccc..2d2ca61 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -274,7 +274,7 @@ static int em_gio_probe(struct platform_device *pdev)
@@ -42123,7 +44317,7 @@ index 6bca1e1..ed8b22e 100644
unsigned int ngpios;
int ret;
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
-index 4ba7ed5..1536b5d 100644
+index a489338..3c0a85b 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -94,7 +94,7 @@ struct ichx_desc {
@@ -42136,7 +44330,7 @@ index 4ba7ed5..1536b5d 100644
static struct {
spinlock_t lock;
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
-index f7fbb46..cee8e40 100644
+index 189f672..c52c254 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1069,7 +1069,7 @@ static void omap_gpio_mod_init(struct gpio_bank *bank)
@@ -42158,10 +44352,10 @@ index f7fbb46..cee8e40 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 2a81224..ec01fb3 100644
+index d9ab0cd..406ce88 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
-@@ -398,7 +398,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
+@@ -421,7 +421,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
struct gpio_rcar_priv *p;
struct resource *io, *irq;
struct gpio_chip *gpio_chip;
@@ -42169,9 +44363,9 @@ index 2a81224..ec01fb3 100644
+ irq_chip_no_const *irq_chip;
struct device *dev = &pdev->dev;
const char *name = dev_name(dev);
- int ret;
+ unsigned int npins;
diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c
-index c1caa45..f0f97d2 100644
+index ac8deb0..f3caa10 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)
@@ -42184,10 +44378,10 @@ index c1caa45..f0f97d2 100644
return -EINVAL;
}
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
-index 4e4c308..d041d75 100644
+index 5c1ba87..ab4a059 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
-@@ -638,8 +638,10 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
+@@ -669,8 +669,10 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
}
if (gpiochip->irqchip) {
@@ -42200,7 +44394,7 @@ index 4e4c308..d041d75 100644
gpiochip->irqchip = NULL;
}
}
-@@ -715,8 +717,10 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
+@@ -747,8 +749,10 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
*/
if (!irqchip->irq_request_resources &&
!irqchip->irq_release_resources) {
@@ -42214,10 +44408,19 @@ index 4e4c308..d041d75 100644
/*
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
-index bb1099c..8eff7b2 100644
+index 5e7770f..a84a2c6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
-@@ -2338,7 +2338,7 @@ static inline void amdgpu_unregister_atpx_handler(void) {}
+@@ -1733,7 +1733,7 @@ void amdgpu_debugfs_cleanup(struct drm_minor *minor);
+ * amdgpu smumgr functions
+ */
+ struct amdgpu_smumgr_funcs {
+- int (*check_fw_load_finish)(struct amdgpu_device *adev, uint32_t fwtype);
++ int (*check_fw_load_finish)(struct amdgpu_device *adev, enum AMDGPU_UCODE_ID fwtype);
+ int (*request_smu_load_fw)(struct amdgpu_device *adev);
+ int (*request_smu_specific_fw)(struct amdgpu_device *adev, uint32_t fwtype);
+ };
+@@ -2345,7 +2345,7 @@ static inline void amdgpu_unregister_atpx_handler(void) {}
* KMS
*/
extern const struct drm_ioctl_desc amdgpu_ioctls_kms[];
@@ -42226,11 +44429,24 @@ index bb1099c..8eff7b2 100644
int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags);
int amdgpu_driver_unload_kms(struct drm_device *dev);
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
+index 81dc6b6..2762d6b 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
+@@ -493,7 +493,7 @@ static int amdgpu_atpx_init(void)
+ * look up whether we are the integrated or discrete GPU (all asics).
+ * Returns the client id.
+ */
+-static int amdgpu_atpx_get_client_id(struct pci_dev *pdev)
++static enum vga_switcheroo_client_id amdgpu_atpx_get_client_id(struct pci_dev *pdev)
+ {
+ if (amdgpu_atpx_priv.dhandle == ACPI_HANDLE(&pdev->dev))
+ return VGA_SWITCHEROO_IGD;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
-index 8e99514..3d68786 100644
+index 75cb5b9..2f6481f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
-@@ -737,44 +737,44 @@ static int amdgpu_cgs_get_firmware_info(void *cgs_device,
+@@ -1066,48 +1066,48 @@ int amdgpu_cgs_call_acpi_method(void *cgs_device,
}
static const struct cgs_ops amdgpu_cgs_ops = {
@@ -42253,6 +44469,7 @@ index 8e99514..3d68786 100644
- amdgpu_cgs_write_pci_config_byte,
- amdgpu_cgs_write_pci_config_word,
- amdgpu_cgs_write_pci_config_dword,
+- amdgpu_cgs_get_pci_resource,
- amdgpu_cgs_atom_get_data_table,
- amdgpu_cgs_atom_get_cmd_table_revs,
- amdgpu_cgs_atom_exec_cmd_table,
@@ -42265,7 +44482,10 @@ index 8e99514..3d68786 100644
- amdgpu_cgs_set_camera_voltages,
- amdgpu_cgs_get_firmware_info,
- amdgpu_cgs_set_powergating_state,
-- amdgpu_cgs_set_clockgating_state
+- amdgpu_cgs_set_clockgating_state,
+- amdgpu_cgs_get_active_displays_info,
+- amdgpu_cgs_call_acpi_method,
+- amdgpu_cgs_query_system_info,
+ .gpu_mem_info = amdgpu_cgs_gpu_mem_info,
+ .gmap_kmem = amdgpu_cgs_gmap_kmem,
+ .gunmap_kmem = amdgpu_cgs_gunmap_kmem,
@@ -42285,6 +44505,7 @@ index 8e99514..3d68786 100644
+ .write_pci_config_byte = amdgpu_cgs_write_pci_config_byte,
+ .write_pci_config_word = amdgpu_cgs_write_pci_config_word,
+ .write_pci_config_dword = amdgpu_cgs_write_pci_config_dword,
++ .get_pci_resource = amdgpu_cgs_get_pci_resource,
+ .atom_get_data_table = amdgpu_cgs_atom_get_data_table,
+ .atom_get_cmd_table_revs = amdgpu_cgs_atom_get_cmd_table_revs,
+ .atom_exec_cmd_table = amdgpu_cgs_atom_exec_cmd_table,
@@ -42297,7 +44518,10 @@ index 8e99514..3d68786 100644
+ .set_camera_voltages = amdgpu_cgs_set_camera_voltages,
+ .get_firmware_info = amdgpu_cgs_get_firmware_info,
+ .set_powergating_state = amdgpu_cgs_set_powergating_state,
-+ .set_clockgating_state = amdgpu_cgs_set_clockgating_state
++ .set_clockgating_state = amdgpu_cgs_set_clockgating_state,
++ .get_active_displays_info = amdgpu_cgs_get_active_displays_info,
++ .call_acpi_method = amdgpu_cgs_call_acpi_method,
++ .query_system_info = amdgpu_cgs_query_system_info
};
static const struct cgs_os_ops amdgpu_cgs_os_ops = {
@@ -42310,11 +44534,51 @@ index 8e99514..3d68786 100644
};
void *amdgpu_cgs_create_device(struct amdgpu_device *adev)
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+index 119cdc2..fd6698c 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+@@ -701,7 +701,7 @@ static int amdgpu_connector_lvds_get_modes(struct drm_connector *connector)
+ return ret;
+ }
+
+-static int amdgpu_connector_lvds_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status amdgpu_connector_lvds_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct drm_encoder *encoder = amdgpu_connector_best_single_encoder(connector);
+@@ -838,7 +838,7 @@ static int amdgpu_connector_vga_get_modes(struct drm_connector *connector)
+ return ret;
+ }
+
+-static int amdgpu_connector_vga_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status amdgpu_connector_vga_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct drm_device *dev = connector->dev;
+@@ -1158,7 +1158,7 @@ static void amdgpu_connector_dvi_force(struct drm_connector *connector)
+ amdgpu_connector->use_digital = true;
+ }
+
+-static int amdgpu_connector_dvi_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status amdgpu_connector_dvi_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct drm_device *dev = connector->dev;
+@@ -1427,7 +1427,7 @@ out:
+ return ret;
+ }
+
+-static int amdgpu_connector_dp_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status amdgpu_connector_dp_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
-index 9d88023..5fe8189 100644
+index d6c68d0..ea00f37 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
-@@ -1081,7 +1081,7 @@ static bool amdgpu_switcheroo_can_switch(struct pci_dev *pdev)
+@@ -1091,7 +1091,7 @@ static bool amdgpu_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.
*/
@@ -42324,10 +44588,10 @@ index 9d88023..5fe8189 100644
static const struct vga_switcheroo_client_ops amdgpu_switcheroo_ops = {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
-index 8d6668c..ea61792 100644
+index 9ef1db8..bfd5d78 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
-@@ -481,7 +481,7 @@ static struct drm_driver kms_driver = {
+@@ -495,7 +495,7 @@ static struct drm_driver kms_driver = {
.driver_features =
DRIVER_USE_AGP |
DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM |
@@ -42336,7 +44600,7 @@ index 8d6668c..ea61792 100644
.dev_priv_size = 0,
.load = amdgpu_driver_load_kms,
.open = amdgpu_driver_open_kms,
-@@ -532,9 +532,6 @@ static struct drm_driver kms_driver = {
+@@ -546,9 +546,6 @@ static struct drm_driver kms_driver = {
.patchlevel = KMS_DRIVER_PATCHLEVEL,
};
@@ -42346,7 +44610,7 @@ index 8d6668c..ea61792 100644
static struct pci_driver amdgpu_kms_pci_driver = {
.name = DRIVER_NAME,
.id_table = pciidlist,
-@@ -552,22 +549,23 @@ static int __init amdgpu_init(void)
+@@ -566,22 +563,23 @@ static int __init amdgpu_init(void)
}
#endif
DRM_INFO("amdgpu kernel modesetting enabled.\n");
@@ -42386,8 +44650,74 @@ index e23843f..9ecc6f3 100644
};
-int amdgpu_max_kms_ioctl = ARRAY_SIZE(amdgpu_ioctls_kms);
+const int amdgpu_max_kms_ioctl = ARRAY_SIZE(amdgpu_ioctls_kms);
+diff --git a/drivers/gpu/drm/amd/amdgpu/fiji_smc.c b/drivers/gpu/drm/amd/amdgpu/fiji_smc.c
+index e35340a..9f6d286 100644
+--- a/drivers/gpu/drm/amd/amdgpu/fiji_smc.c
++++ b/drivers/gpu/drm/amd/amdgpu/fiji_smc.c
+@@ -513,7 +513,7 @@ static int fiji_smu_request_load_fw(struct amdgpu_device *adev)
+ return 0;
+ }
+
+-static uint32_t fiji_smu_get_mask_for_fw_type(uint32_t fw_type)
++static uint32_t fiji_smu_get_mask_for_fw_type(enum AMDGPU_UCODE_ID fw_type)
+ {
+ switch (fw_type) {
+ case AMDGPU_UCODE_ID_SDMA0:
+@@ -539,7 +539,7 @@ static uint32_t fiji_smu_get_mask_for_fw_type(uint32_t fw_type)
+ }
+
+ static int fiji_smu_check_fw_load_finish(struct amdgpu_device *adev,
+- uint32_t fw_type)
++ enum AMDGPU_UCODE_ID fw_type)
+ {
+ uint32_t fw_mask = fiji_smu_get_mask_for_fw_type(fw_type);
+ int i;
+diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_smc.c b/drivers/gpu/drm/amd/amdgpu/iceland_smc.c
+index 090486c..699728e 100644
+--- a/drivers/gpu/drm/amd/amdgpu/iceland_smc.c
++++ b/drivers/gpu/drm/amd/amdgpu/iceland_smc.c
+@@ -418,7 +418,7 @@ static enum AMDGPU_UCODE_ID iceland_convert_fw_type(uint32_t fw_type)
+ }
+ }
+
+-static uint32_t iceland_smu_get_mask_for_fw_type(uint32_t fw_type)
++static uint32_t iceland_smu_get_mask_for_fw_type(enum AMDGPU_UCODE_ID fw_type)
+ {
+ switch (fw_type) {
+ case AMDGPU_UCODE_ID_SDMA0:
+@@ -556,7 +556,7 @@ static int iceland_smu_request_load_fw(struct amdgpu_device *adev)
+ }
+
+ static int iceland_smu_check_fw_load_finish(struct amdgpu_device *adev,
+- uint32_t fw_type)
++ enum AMDGPU_UCODE_ID fw_type)
+ {
+ uint32_t fw_mask = iceland_smu_get_mask_for_fw_type(fw_type);
+ int i;
+diff --git a/drivers/gpu/drm/amd/amdgpu/tonga_smc.c b/drivers/gpu/drm/amd/amdgpu/tonga_smc.c
+index 361c49a..1113506 100644
+--- a/drivers/gpu/drm/amd/amdgpu/tonga_smc.c
++++ b/drivers/gpu/drm/amd/amdgpu/tonga_smc.c
+@@ -515,7 +515,7 @@ static int tonga_smu_request_load_fw(struct amdgpu_device *adev)
+ return 0;
+ }
+
+-static uint32_t tonga_smu_get_mask_for_fw_type(uint32_t fw_type)
++static uint32_t tonga_smu_get_mask_for_fw_type(enum AMDGPU_UCODE_ID fw_type)
+ {
+ switch (fw_type) {
+ case AMDGPU_UCODE_ID_SDMA0:
+@@ -541,7 +541,7 @@ static uint32_t tonga_smu_get_mask_for_fw_type(uint32_t fw_type)
+ }
+
+ static int tonga_smu_check_fw_load_finish(struct amdgpu_device *adev,
+- uint32_t fw_type)
++ enum AMDGPU_UCODE_ID fw_type)
+ {
+ uint32_t fw_mask = tonga_smu_get_mask_for_fw_type(fw_type);
+ int i;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
-index c6a1b4c..32873f8 100644
+index d2b49c0..478e036 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -419,7 +419,7 @@ static int kfd_ioctl_set_memory_policy(struct file *filep,
@@ -42844,10 +45174,10 @@ index 7b69070..d7bd78b 100644
if (retval != 0)
return retval;
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
-index 3a4820e..ece12c8 100644
+index 8b2becd..2d8f572 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
-@@ -135,7 +135,7 @@ int amd_sched_entity_init(struct amd_gpu_scheduler *sched,
+@@ -139,7 +139,7 @@ int amd_sched_entity_init(struct amd_gpu_scheduler *sched,
if (r)
return r;
@@ -42855,9 +45185,9 @@ index 3a4820e..ece12c8 100644
+ atomic_set_unchecked(&entity->fence_seq, 0);
entity->fence_context = fence_context_alloc(1);
- /* Add the entity to the run queue */
+ return 0;
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
-index a0f0ae5..1771582 100644
+index 9403145..b8842f1 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
@@ -49,7 +49,7 @@ struct amd_sched_entity {
@@ -42883,10 +45213,10 @@ index 87c78ee..59dc36e 100644
s_entity->fence_context, seq);
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
-index 77ab93d..ae69bac 100644
+index 3bd7e1c..565fe46 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
-@@ -217,6 +217,7 @@ static struct drm_driver armada_drm_driver = {
+@@ -218,6 +218,7 @@ static struct drm_driver armada_drm_driver = {
.driver_features = DRIVER_GEM | DRIVER_MODESET |
DRIVER_HAVE_IRQ | DRIVER_PRIME,
.ioctls = armada_ioctls,
@@ -42894,7 +45224,7 @@ index 77ab93d..ae69bac 100644
.fops = &armada_drm_fops,
};
-@@ -337,8 +338,6 @@ static int __init armada_drm_init(void)
+@@ -338,8 +339,6 @@ static int __init armada_drm_init(void)
{
int ret;
@@ -42903,11 +45233,62 @@ index 77ab93d..ae69bac 100644
ret = platform_driver_register(&armada_lcd_platform_driver);
if (ret)
return ret;
+diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
+index 0123458..4169580 100644
+--- a/drivers/gpu/drm/ast/ast_mode.c
++++ b/drivers/gpu/drm/ast/ast_mode.c
+@@ -789,7 +789,7 @@ static int ast_get_modes(struct drm_connector *connector)
+ return 0;
+ }
+
+-static int ast_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status ast_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct ast_private *ast = connector->dev->dev_private;
+diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
+index 2849f1b..86f509b 100644
+--- a/drivers/gpu/drm/bochs/bochs_kms.c
++++ b/drivers/gpu/drm/bochs/bochs_kms.c
+@@ -210,7 +210,7 @@ int bochs_connector_get_modes(struct drm_connector *connector)
+ return count;
+ }
+
+-static int bochs_connector_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status bochs_connector_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct bochs_device *bochs =
+diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
+index 9a7b446..33576d3 100644
+--- a/drivers/gpu/drm/drm_atomic.c
++++ b/drivers/gpu/drm/drm_atomic.c
+@@ -1339,6 +1339,11 @@ EXPORT_SYMBOL(drm_atomic_async_commit);
+ * The big monstor ioctl
+ */
+
++static void free_vblank_event(struct drm_pending_event *event)
++{
++ kfree(event);
++}
++
+ static struct drm_pending_vblank_event *create_vblank_event(
+ struct drm_device *dev, struct drm_file *file_priv, uint64_t user_data)
+ {
+@@ -1366,7 +1371,7 @@ static struct drm_pending_vblank_event *create_vblank_event(
+ e->event.user_data = user_data;
+ e->base.event = &e->event.base;
+ e->base.file_priv = file_priv;
+- e->base.destroy = (void (*) (struct drm_pending_event *)) kfree;
++ e->base.destroy = free_vblank_event;
+
+ out:
+ return e;
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
-index 24c5434..d4671de 100644
+index f619121..ef03460 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
-@@ -4090,7 +4090,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
+@@ -4152,7 +4152,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
goto done;
}
@@ -42916,11 +45297,33 @@ index 24c5434..d4671de 100644
&prop_enum->name, DRM_PROP_NAME_LEN)) {
ret = -EFAULT;
goto done;
+@@ -5229,6 +5229,11 @@ out:
+ return ret;
+ }
+
++static void drm_mode_page_flip_dmabuf_destroy(struct drm_pending_event *event)
++{
++ kfree(event);
++}
++
+ /**
+ * drm_mode_page_flip_ioctl - schedule an asynchronous fb update
+ * @dev: DRM device
+@@ -5327,8 +5332,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
+ e->event.user_data = page_flip->user_data;
+ e->base.event = &e->event.base;
+ e->base.file_priv = file_priv;
+- e->base.destroy =
+- (void (*) (struct drm_pending_event *)) kfree;
++ e->base.destroy = drm_mode_page_flip_dmabuf_destroy;
+ }
+
+ crtc->primary->old_fb = crtc->primary->fb;
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
-index 7dd6728..6271b191 100644
+index 167c8d3..bf13708 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
-@@ -471,7 +471,7 @@ void drm_unplug_dev(struct drm_device *dev)
+@@ -467,7 +467,7 @@ void drm_unplug_dev(struct drm_device *dev)
drm_device_set_unplugged(dev);
@@ -42930,7 +45333,7 @@ index 7dd6728..6271b191 100644
}
mutex_unlock(&drm_global_mutex);
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
-index 6b5625e..d49b9fb 100644
+index 1ea8790..03efb49 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)
@@ -42951,7 +45354,7 @@ index 6b5625e..d49b9fb 100644
drm_minor_release(minor);
return retcode;
}
-@@ -405,7 +405,7 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -407,7 +407,7 @@ int drm_release(struct inode *inode, struct file *filp)
mutex_lock(&drm_global_mutex);
@@ -42960,7 +45363,7 @@ index 6b5625e..d49b9fb 100644
mutex_lock(&dev->struct_mutex);
list_del(&file_priv->lhead);
-@@ -420,10 +420,10 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -422,10 +422,10 @@ int drm_release(struct inode *inode, struct file *filp)
* Begin inline drm_release
*/
@@ -42973,7 +45376,7 @@ index 6b5625e..d49b9fb 100644
/* if the master has gone away we can't do anything with the lock */
if (file_priv->minor->master)
-@@ -493,7 +493,7 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -495,7 +495,7 @@ int drm_release(struct inode *inode, struct file *filp)
* End inline drm_release
*/
@@ -43139,8 +45542,33 @@ index 8ce2a0c..d09a8f6 100644
unsigned int nr = DRM_IOCTL_NR(cmd);
int retcode = -EINVAL;
char stack_kdata[128];
+diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
+index 1fe1457..a3e7822 100644
+--- a/drivers/gpu/drm/drm_irq.c
++++ b/drivers/gpu/drm/drm_irq.c
+@@ -1646,6 +1646,11 @@ int drm_modeset_ctl(struct drm_device *dev, void *data,
+ return 0;
+ }
+
++static void drm_vblank_dmabuf_destroy(struct drm_pending_event *event)
++{
++ kfree(event);
++}
++
+ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
+ union drm_wait_vblank *vblwait,
+ struct drm_file *file_priv)
+@@ -1670,7 +1675,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
+ e->event.user_data = vblwait->request.signal;
+ e->base.event = &e->event.base;
+ e->base.file_priv = file_priv;
+- e->base.destroy = (void (*) (struct drm_pending_event *)) kfree;
++ e->base.destroy = drm_vblank_dmabuf_destroy;
+
+ spin_lock_irqsave(&dev->event_lock, flags);
+
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
-index fcd2a86..f50489e 100644
+index a1fff11..425c24b 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -308,7 +308,7 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
@@ -43164,7 +45592,7 @@ index fcd2a86..f50489e 100644
for (i = 0; pdriver->id_table[i].vendor != 0; i++) {
pid = &pdriver->id_table[i];
-@@ -457,7 +460,7 @@ void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
+@@ -477,7 +480,7 @@ void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
} else {
list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list,
legacy_dev_list) {
@@ -43174,10 +45602,10 @@ index fcd2a86..f50489e 100644
}
}
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
-index 2c6019d..6508989 100644
+index 68f0f36..4e8daee 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
-@@ -616,7 +616,6 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
+@@ -605,7 +605,6 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
struct component_match *match;
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
@@ -43185,33 +45613,96 @@ index 2c6019d..6508989 100644
match = exynos_drm_match_add(&pdev->dev);
if (IS_ERR(match))
-diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c b/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c
-index d4813e0..6c1ab4d 100644
---- a/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c
-+++ b/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c
-@@ -825,10 +825,16 @@ void mdfld_dsi_dpi_mode_set(struct drm_encoder *encoder,
- u32 pipeconf_reg = PIPEACONF;
- u32 dspcntr_reg = DSPACNTR;
-
-- u32 pipeconf = dev_priv->pipeconf[pipe];
-- u32 dspcntr = dev_priv->dspcntr[pipe];
-+ u32 pipeconf;
-+ u32 dspcntr;
- u32 mipi = MIPI_PORT_EN | PASS_FROM_SPHY_TO_AFE | SEL_FLOPPED_HSTX;
-
-+ if (pipe == -1)
-+ return;
-+
-+ pipeconf = dev_priv->pipeconf[pipe];
-+ dspcntr = dev_priv->dspcntr[pipe];
+diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+index 8dfe6e1..e7957e6 100644
+--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
++++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+@@ -1060,6 +1060,11 @@ int exynos_g2d_get_ver_ioctl(struct drm_device *drm_dev, void *data,
+ return 0;
+ }
+
++static void exynos_g2d_dmabuf_destroy(struct drm_pending_event *event)
++{
++ kfree(event);
++}
+
- if (pipe) {
- pipeconf_reg = PIPECCONF;
- dspcntr_reg = DSPCCNTR;
+ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data,
+ struct drm_file *file)
+ {
+@@ -1118,7 +1123,7 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data,
+ e->event.user_data = req->user_data;
+ e->base.event = &e->event.base;
+ e->base.file_priv = file;
+- e->base.destroy = (void (*) (struct drm_pending_event *)) kfree;
++ e->base.destroy = exynos_g2d_dmabuf_destroy;
+
+ node->event = e;
+ }
+diff --git a/drivers/gpu/drm/gma500/cdv_intel_crt.c b/drivers/gpu/drm/gma500/cdv_intel_crt.c
+index d0717a8..563f087 100644
+--- a/drivers/gpu/drm/gma500/cdv_intel_crt.c
++++ b/drivers/gpu/drm/gma500/cdv_intel_crt.c
+@@ -64,7 +64,7 @@ static void cdv_intel_crt_dpms(struct drm_encoder *encoder, int mode)
+ REG_WRITE(reg, temp);
+ }
+
+-static int cdv_intel_crt_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status cdv_intel_crt_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
+diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
+index 7bb1f1af..a35770e 100644
+--- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
++++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
+@@ -505,7 +505,7 @@ static void cdv_intel_edp_backlight_off (struct gma_encoder *intel_encoder)
+ msleep(intel_dp->backlight_off_delay);
+ }
+
+-static int
++static enum drm_mode_status
+ cdv_intel_dp_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+index ddf2d77..4e9e184 100644
+--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
++++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+@@ -223,7 +223,7 @@ static int cdv_hdmi_get_modes(struct drm_connector *connector)
+ return ret;
+ }
+
+-static int cdv_hdmi_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status cdv_hdmi_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ if (mode->clock > 165000)
+diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+index 813ef23..17928d6 100644
+--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
++++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+@@ -244,7 +244,7 @@ static void cdv_intel_lvds_restore(struct drm_connector *connector)
+ {
+ }
+
+-static int cdv_intel_lvds_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status cdv_intel_lvds_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct drm_device *dev = connector->dev;
diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
-index 89f705c..d262d0b 100644
+index d758f4c..7828190 100644
--- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
+++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
+@@ -351,7 +351,7 @@ static int mdfld_dsi_connector_get_modes(struct drm_connector *connector)
+ return 0;
+ }
+
+-static int mdfld_dsi_connector_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status mdfld_dsi_connector_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct mdfld_dsi_connector *dsi_connector =
@@ -382,14 +382,14 @@ static int mdfld_dsi_connector_mode_valid(struct drm_connector *connector,
return MODE_OK;
}
@@ -43230,6 +45721,19 @@ index 89f705c..d262d0b 100644
}
static struct drm_encoder *mdfld_dsi_connector_best_encoder(
+diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
+index 2d18499..3d5f8b9 100644
+--- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
++++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
+@@ -509,7 +509,7 @@ static void oaktrail_hdmi_dpms(struct drm_encoder *encoder, int mode)
+ HDMI_WRITE(HDMI_VIDEO_REG, temp);
+ }
+
+-static int oaktrail_hdmi_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status oaktrail_hdmi_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ if (mode->clock > 165000)
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 92e7e57..5d74ff5 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
@@ -43242,6 +45746,58 @@ index 92e7e57..5d74ff5 100644
psb_modeset_init(dev);
psb_fbdev_init(dev);
+diff --git a/drivers/gpu/drm/gma500/psb_intel_drv.h b/drivers/gpu/drm/gma500/psb_intel_drv.h
+index 2a3b7c6..fbd3fa3 100644
+--- a/drivers/gpu/drm/gma500/psb_intel_drv.h
++++ b/drivers/gpu/drm/gma500/psb_intel_drv.h
+@@ -255,7 +255,7 @@ extern int intelfb_remove(struct drm_device *dev,
+ extern bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder,
+ const struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode);
+-extern int psb_intel_lvds_mode_valid(struct drm_connector *connector,
++extern enum drm_mode_status psb_intel_lvds_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode);
+ extern int psb_intel_lvds_set_property(struct drm_connector *connector,
+ struct drm_property *property,
+diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
+index b1b9331..6b254ef 100644
+--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
++++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
+@@ -343,7 +343,7 @@ static void psb_intel_lvds_restore(struct drm_connector *connector)
+ }
+ }
+
+-int psb_intel_lvds_mode_valid(struct drm_connector *connector,
++enum drm_mode_status psb_intel_lvds_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct drm_psb_private *dev_priv = connector->dev->dev_private;
+diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
+index e787d37..91622fd 100644
+--- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
++++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
+@@ -1158,7 +1158,7 @@ static void psb_intel_sdvo_dpms(struct drm_encoder *encoder, int mode)
+ return;
+ }
+
+-static int psb_intel_sdvo_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status psb_intel_sdvo_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct psb_intel_sdvo *psb_intel_sdvo = intel_attached_sdvo(connector);
+diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
+index f8ee740..223ee4c 100644
+--- a/drivers/gpu/drm/i2c/tda998x_drv.c
++++ b/drivers/gpu/drm/i2c/tda998x_drv.c
+@@ -864,7 +864,7 @@ tda998x_encoder_mode_fixup(struct drm_encoder *encoder,
+ return true;
+ }
+
+-static int tda998x_connector_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status tda998x_connector_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ /* TDA19988 dotclock can go up to 165MHz */
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c
index d918567..6cfd904 100644
--- a/drivers/gpu/drm/i810/i810_dma.c
@@ -43296,11 +45852,24 @@ index 93ec5dc..204ec92 100644
#define I810_BASE(reg) ((unsigned long) \
dev_priv->mmio_map->handle)
+diff --git a/drivers/gpu/drm/i915/dvo.h b/drivers/gpu/drm/i915/dvo.h
+index 5e6a301..b6e143e 100644
+--- a/drivers/gpu/drm/i915/dvo.h
++++ b/drivers/gpu/drm/i915/dvo.h
+@@ -74,7 +74,7 @@ struct intel_dvo_dev_ops {
+ *
+ * \return MODE_OK if the mode is valid, or another MODE_* otherwise.
+ */
+- int (*mode_valid)(struct intel_dvo_device *dvo,
++ enum drm_mode_status (*mode_valid)(struct intel_dvo_device *dvo,
+ struct drm_display_mode *mode);
+
+ /*
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
-index 61fcb3b..bad2d5f 100644
+index d70d96f..d3a598e 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
-@@ -354,7 +354,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.
*/
@@ -43309,14 +45878,14 @@ index 61fcb3b..bad2d5f 100644
}
static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
-@@ -1331,4 +1331,4 @@ const struct drm_ioctl_desc i915_ioctls[] = {
+@@ -1334,4 +1334,4 @@ const struct drm_ioctl_desc i915_ioctls[] = {
DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_SETPARAM, i915_gem_context_setparam_ioctl, DRM_RENDER_ALLOW),
};
-int i915_max_ioctl = ARRAY_SIZE(i915_ioctls);
+const int i915_max_ioctl = ARRAY_SIZE(i915_ioctls);
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
-index a6ad938..ad4ff46 100644
+index f357058..5638302 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -40,7 +40,7 @@
@@ -43328,7 +45897,7 @@ index a6ad938..ad4ff46 100644
#define GEN_DEFAULT_PIPEOFFSETS \
.pipe_offsets = { PIPE_A_OFFSET, PIPE_B_OFFSET, \
-@@ -1690,7 +1690,7 @@ static const struct file_operations i915_driver_fops = {
+@@ -1672,7 +1672,7 @@ static const struct file_operations i915_driver_fops = {
.llseek = noop_llseek,
};
@@ -43337,7 +45906,7 @@ index a6ad938..ad4ff46 100644
/* Don't use MTRRs here; the Xserver or userspace app should
* deal with them for Intel hardware.
*/
-@@ -1740,6 +1740,7 @@ static struct pci_driver i915_pci_driver = {
+@@ -1722,6 +1722,7 @@ static struct pci_driver i915_pci_driver = {
static int __init i915_init(void)
{
@@ -43345,7 +45914,7 @@ index a6ad938..ad4ff46 100644
driver.num_ioctls = i915_max_ioctl;
/*
-@@ -1757,6 +1758,7 @@ static int __init i915_init(void)
+@@ -1739,6 +1740,7 @@ static int __init i915_init(void)
#endif
if (!(driver.driver_features & DRIVER_MODESET)) {
@@ -43353,7 +45922,7 @@ index a6ad938..ad4ff46 100644
/* Silently fail loading to not upset userspace. */
DRM_DEBUG_DRIVER("KMS and UMS disabled.\n");
return 0;
-@@ -1764,6 +1766,7 @@ static int __init i915_init(void)
+@@ -1746,6 +1748,7 @@ static int __init i915_init(void)
if (i915.nuclear_pageflip)
driver.driver_features |= DRIVER_ATOMIC;
@@ -43362,10 +45931,10 @@ index a6ad938..ad4ff46 100644
return drm_pci_init(&driver, &i915_pci_driver);
}
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
-index d3ce4da..73a3dda 100644
+index b0847b9..c6116c8 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
-@@ -2637,7 +2637,7 @@ struct drm_i915_cmd_table {
+@@ -2665,7 +2665,7 @@ struct drm_i915_cmd_table {
#include "i915_trace.h"
extern const struct drm_ioctl_desc i915_ioctls[];
@@ -43375,10 +45944,10 @@ index d3ce4da..73a3dda 100644
extern int i915_suspend_switcheroo(struct drm_device *dev, pm_message_t state);
extern int i915_resume_switcheroo(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
-index 6ed7d63a..1863cfa 100644
+index dccb517..c5da26b 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
-@@ -965,12 +965,12 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec)
+@@ -1001,12 +1001,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,
@@ -43394,10 +45963,10 @@ index 6ed7d63a..1863cfa 100644
invalid_flags = __EXEC_OBJECT_UNKNOWN_FLAGS;
if (USES_FULL_PPGTT(dev))
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
-index 86c7500..f4d2025 100644
+index 56f4f2e..5f6e773 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
-@@ -2953,8 +2953,8 @@ static void chv_setup_private_ppat(struct drm_i915_private *dev_priv)
+@@ -3011,8 +3011,8 @@ static void chv_setup_private_ppat(struct drm_i915_private *dev_priv)
static int gen8_gmch_probe(struct drm_device *dev,
u64 *gtt_total,
@@ -43408,7 +45977,7 @@ index 86c7500..f4d2025 100644
u64 *mappable_end)
{
struct drm_i915_private *dev_priv = dev->dev_private;
-@@ -3001,8 +3001,8 @@ static int gen8_gmch_probe(struct drm_device *dev,
+@@ -3062,8 +3062,8 @@ static int gen8_gmch_probe(struct drm_device *dev,
static int gen6_gmch_probe(struct drm_device *dev,
u64 *gtt_total,
@@ -43419,7 +45988,7 @@ index 86c7500..f4d2025 100644
u64 *mappable_end)
{
struct drm_i915_private *dev_priv = dev->dev_private;
-@@ -3052,8 +3052,8 @@ static void gen6_gmch_remove(struct i915_address_space *vm)
+@@ -3113,8 +3113,8 @@ static void gen6_gmch_remove(struct i915_address_space *vm)
static int i915_gmch_probe(struct drm_device *dev,
u64 *gtt_total,
@@ -43430,7 +45999,7 @@ index 86c7500..f4d2025 100644
u64 *mappable_end)
{
struct drm_i915_private *dev_priv = dev->dev_private;
-@@ -3121,8 +3121,8 @@ int i915_gem_gtt_init(struct drm_device *dev)
+@@ -3182,8 +3182,8 @@ int i915_gem_gtt_init(struct drm_device *dev)
/* GMADR is the PCI mmio aperture into the global GTT. */
DRM_INFO("Memory usable by graphics device = %lluM\n",
gtt->base.total >> 20);
@@ -43442,10 +46011,10 @@ index 86c7500..f4d2025 100644
if (intel_iommu_gfx_mapped)
DRM_INFO("VT-d active for gfx access\n");
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
-index a216397..2906614 100644
+index b448ad8..422a8c5 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.h
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
-@@ -344,11 +344,11 @@ struct i915_address_space {
+@@ -341,11 +341,11 @@ struct i915_address_space {
struct i915_gtt {
struct i915_address_space base;
@@ -43459,7 +46028,7 @@ index a216397..2906614 100644
/** "Graphics Stolen Memory" holds the global PTEs */
void __iomem *gsm;
-@@ -359,7 +359,7 @@ struct i915_gtt {
+@@ -356,7 +356,7 @@ struct i915_gtt {
/* global gtt ops */
int (*gtt_probe)(struct drm_device *dev, u64 *gtt_total,
@@ -43502,10 +46071,10 @@ index 97f3a56..32c712e 100644
ret = drm_ioctl(filp, cmd, arg);
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
-index 0f42a27..8d376ee 100644
+index fa8afa7..0bac957 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
-@@ -4399,14 +4399,15 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
+@@ -4490,14 +4490,15 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
pm_qos_add_request(&dev_priv->pm_qos, PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE);
@@ -43524,7 +46093,7 @@ index 0f42a27..8d376ee 100644
dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
}
-@@ -4418,32 +4419,32 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
+@@ -4509,32 +4510,32 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
if (!IS_GEN2(dev_priv))
dev->vblank_disable_immediate = true;
@@ -43577,7 +46146,7 @@ index 0f42a27..8d376ee 100644
if (IS_BROXTON(dev))
dev_priv->display.hpd_irq_setup = bxt_hpd_irq_setup;
else if (HAS_PCH_SPT(dev))
-@@ -4451,35 +4452,36 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
+@@ -4542,35 +4543,36 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
else
dev_priv->display.hpd_irq_setup = ilk_hpd_irq_setup;
} else if (HAS_PCH_SPLIT(dev)) {
@@ -43635,10 +46204,10 @@ index 0f42a27..8d376ee 100644
/**
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
-index f859a5b..c6ef76b 100644
+index 46947ff..c3efaa4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
-@@ -14731,13 +14731,13 @@ struct intel_quirk {
+@@ -15106,13 +15106,13 @@ struct intel_quirk {
int subsystem_vendor;
int subsystem_device;
void (*hook)(struct drm_device *dev);
@@ -43654,7 +46223,7 @@ index f859a5b..c6ef76b 100644
static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
{
-@@ -14745,18 +14745,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
+@@ -15120,18 +15120,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
return 1;
}
@@ -43686,10 +46255,10 @@ index f859a5b..c6ef76b 100644
},
};
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
-index 7b990b4..452d7e4 100644
+index 2f57d79..7152e6e 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
-@@ -354,7 +354,7 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
+@@ -348,7 +348,7 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
if (imxdrm->pipes >= MAX_CRTC)
return -EINVAL;
@@ -43822,6 +46391,32 @@ index 792f924..aeb1334 100644
-int mga_max_ioctl = ARRAY_SIZE(mga_ioctls);
+const int mga_max_ioctl = ARRAY_SIZE(mga_ioctls);
+diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
+index dc13c48..7d8d1cd 100644
+--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
++++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
+@@ -1586,7 +1586,7 @@ static uint32_t mga_vga_calculate_mode_bandwidth(struct drm_display_mode *mode,
+
+ #define MODE_BANDWIDTH MODE_BAD
+
+-static int mga_vga_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status mga_vga_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct drm_device *dev = connector->dev;
+diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
+index d5e6938..3c38707 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
++++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
+@@ -193,7 +193,7 @@ static int nouveau_dsm_power_state(enum vga_switcheroo_client_id id,
+ return nouveau_dsm_set_discrete_state(nouveau_dsm_priv.dhandle, state);
+ }
+
+-static int nouveau_dsm_get_client_id(struct pci_dev *pdev)
++static enum vga_switcheroo_client_id nouveau_dsm_get_client_id(struct pci_dev *pdev)
+ {
+ /* easy option one - intel vendor ID means Integrated */
+ if (pdev->vendor == PCI_VENDOR_ID_INTEL)
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 4dca65a..3486961 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -43835,11 +46430,24 @@ index 4dca65a..3486961 100644
#define BIT_TABLE(id, funcid) ((struct bit_table){ id, parse_bit_##funcid##_tbl_entry })
+diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
+index fcebfae..2a7341d 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
++++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
+@@ -843,7 +843,7 @@ get_tmds_link_bandwidth(struct drm_connector *connector, bool hdmi)
+ return 112000;
+ }
+
+-static int
++static enum drm_mode_status
+ nouveau_connector_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
-index 1d3ee51..5fb4449 100644
+index 2f2f252e..305b42e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
-@@ -76,9 +76,8 @@ MODULE_PARM_DESC(runpm, "disable (0), force enable (1), optimus only default (-1
+@@ -80,9 +80,8 @@ MODULE_PARM_DESC(runpm, "disable (0), force enable (1), optimus only default (-1
int nouveau_runtime_pm = -1;
module_param_named(runpm, nouveau_runtime_pm, int, 0400);
@@ -43850,7 +46458,7 @@ index 1d3ee51..5fb4449 100644
static u64
nouveau_pci_name(struct pci_dev *pdev)
-@@ -915,7 +914,7 @@ nouveau_driver_fops = {
+@@ -919,7 +918,7 @@ nouveau_driver_fops = {
};
static struct drm_driver
@@ -43859,16 +46467,16 @@ index 1d3ee51..5fb4449 100644
.driver_features =
DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER |
DRIVER_KMS_LEGACY_CONTEXT,
-@@ -927,6 +926,8 @@ driver_stub = {
+@@ -931,6 +930,8 @@ driver_stub = {
.postclose = nouveau_drm_postclose,
.lastclose = nouveau_vga_lastclose,
+ .set_busid = drm_pci_set_busid,
+
#if defined(CONFIG_DEBUG_FS)
- .debugfs_init = nouveau_debugfs_init,
- .debugfs_cleanup = nouveau_debugfs_takedown,
-@@ -1064,10 +1065,10 @@ err_free:
+ .debugfs_init = nouveau_drm_debugfs_init,
+ .debugfs_cleanup = nouveau_drm_debugfs_cleanup,
+@@ -1063,10 +1064,10 @@ err_free:
static int __init
nouveau_drm_init(void)
{
@@ -43883,7 +46491,7 @@ index 1d3ee51..5fb4449 100644
nouveau_display_options();
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.h b/drivers/gpu/drm/nouveau/nouveau_drm.h
-index a02813e..c30a6b0 100644
+index 5c363ed..98fa924 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.h
@@ -124,7 +124,6 @@ struct nouveau_drm {
@@ -43960,6 +46568,31 @@ index d2e7d20..7bbe51f 100644
};
int
+diff --git a/drivers/gpu/drm/nouveau/nouveau_usif.c b/drivers/gpu/drm/nouveau/nouveau_usif.c
+index e9f52ef..b25cd62 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_usif.c
++++ b/drivers/gpu/drm/nouveau/nouveau_usif.c
+@@ -186,6 +186,11 @@ usif_notify_del(struct drm_file *f, void *data, u32 size, void *argv, u32 argc)
+ return ret;
+ }
+
++static void usif_notify_release(struct drm_pending_event *event)
++{
++ kfree(event);
++}
++
+ static int
+ usif_notify_get(struct drm_file *f, void *data, u32 size, void *argv, u32 argc)
+ {
+@@ -212,7 +217,7 @@ usif_notify_get(struct drm_file *f, void *data, u32 size, void *argv, u32 argc)
+ ntfy->p->base.event = &ntfy->p->e.base;
+ ntfy->p->base.file_priv = f;
+ ntfy->p->base.pid = current->pid;
+- ntfy->p->base.destroy =(void(*)(struct drm_pending_event *))kfree;
++ ntfy->p->base.destroy = usif_notify_release;
+ ntfy->p->e.base.type = DRM_NOUVEAU_EVENT_NVIF;
+ ntfy->p->e.base.length = sizeof(ntfy->p->e.base) + ntfy->reply;
+
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
index af89c36..83ef136 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.c
@@ -43973,19 +46606,85 @@ index af89c36..83ef136 100644
}
static const struct vga_switcheroo_client_ops
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
+index b2557e8..2d4f9f4 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
+@@ -151,11 +151,16 @@ shadow_fw_init(struct nvkm_bios *bios, const char *name)
+ return (void *)fw;
+ }
+
++static void shadow_fw_fini(void *fw)
++{
++ release_firmware(fw);
++}
++
+ static const struct nvbios_source
+ shadow_fw = {
+ .name = "firmware",
+ .init = shadow_fw_init,
+- .fini = (void(*)(void *))release_firmware,
++ .fini = shadow_fw_fini,
+ .read = shadow_fw_read,
+ .rw = false,
+ };
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c
+index 9b91da0..b3fa90d 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c
+@@ -111,11 +111,16 @@ platform_init(struct nvkm_bios *bios, const char *name)
+ return ERR_PTR(ret);
+ }
+
++static void platform_fini(void *data)
++{
++ kfree(data);
++}
++
+ const struct nvbios_source
+ nvbios_platform = {
+ .name = "PLATFORM",
+ .init = platform_init,
+- .fini = (void(*)(void *))kfree,
++ .fini = platform_fini,
+ .read = pcirom_read,
+ .rw = true,
+ };
diff --git a/drivers/gpu/drm/omapdrm/Makefile b/drivers/gpu/drm/omapdrm/Makefile
-index 778372b..4b81cb4 100644
+index fe4c222..48b7b75 100644
--- a/drivers/gpu/drm/omapdrm/Makefile
+++ b/drivers/gpu/drm/omapdrm/Makefile
-@@ -3,7 +3,7 @@
- # Direct Rendering Infrastructure (DRI)
- #
+@@ -6,7 +6,7 @@
+ obj-y += dss/
+ obj-y += displays/
-ccflags-y := -Iinclude/drm -Werror
+ccflags-y := -Iinclude/drm
omapdrm-y := omap_drv.o \
omap_irq.o \
omap_debugfs.o \
+diff --git a/drivers/gpu/drm/omapdrm/dss/display.c b/drivers/gpu/drm/omapdrm/dss/display.c
+index ef5b902..47cf7f5 100644
+--- a/drivers/gpu/drm/omapdrm/dss/display.c
++++ b/drivers/gpu/drm/omapdrm/dss/display.c
+@@ -161,12 +161,14 @@ int omapdss_register_display(struct omap_dss_device *dssdev)
+ if (dssdev->name == NULL)
+ dssdev->name = dssdev->alias;
+
++ pax_open_kernel();
+ if (drv && drv->get_resolution == NULL)
+- drv->get_resolution = omapdss_default_get_resolution;
++ *(void **)&drv->get_resolution = omapdss_default_get_resolution;
+ if (drv && drv->get_recommended_bpp == NULL)
+- drv->get_recommended_bpp = omapdss_default_get_recommended_bpp;
++ *(void **)&drv->get_recommended_bpp = omapdss_default_get_recommended_bpp;
+ if (drv && drv->get_timings == NULL)
+- drv->get_timings = omapdss_default_get_timings;
++ *(void **)&drv->get_timings = omapdss_default_get_timings;
++ pax_close_kernel();
+
+ mutex_lock(&panel_list_mutex);
+ list_add_tail(&dssdev->panel_list, &panel_list);
diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c
index fdc1833..f307630 100644
--- a/drivers/gpu/drm/qxl/qxl_cmd.c
@@ -44043,6 +46742,19 @@ index 6911b8c..89d6867 100644
seq_printf(m, "%d\n", qdev->irq_received_error);
return 0;
}
+diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
+index 8627651..87df69f 100644
+--- a/drivers/gpu/drm/qxl/qxl_display.c
++++ b/drivers/gpu/drm/qxl/qxl_display.c
+@@ -831,7 +831,7 @@ static int qxl_conn_get_modes(struct drm_connector *connector)
+ return ret;
+ }
+
+-static int qxl_conn_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status qxl_conn_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct drm_device *ddev = connector->dev;
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index 7307b07..8eecdd0 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
@@ -44070,7 +46782,7 @@ index 7307b07..8eecdd0 100644
}
diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h
-index 01a8694..584fb48 100644
+index 6e6b9b1..4462096 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.h
+++ b/drivers/gpu/drm/qxl/qxl_drv.h
@@ -290,10 +290,10 @@ struct qxl_device {
@@ -44174,7 +46886,7 @@ index 0bf1e20..42a7310 100644
ret = drm_irq_install(qdev->ddev, qdev->ddev->pdev->irq);
qdev->ram_header->int_mask = QXL_INTERRUPT_MASK;
diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
-index 0cbc4c9..0e46686 100644
+index 9534127..3fbab8c 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -103,7 +103,7 @@ static void qxl_ttm_global_fini(struct qxl_device *qdev)
@@ -44395,8 +47107,70 @@ index b928c17..e5d9400 100644
if (regcomp
(&mask_rex, "(0x[0-9a-fA-F]*) *([_a-zA-Z0-9]*)", REG_EXTENDED)) {
+diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
+index 9bc408c..3bb75f5 100644
+--- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c
++++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
+@@ -491,7 +491,7 @@ static int radeon_atpx_init(void)
+ * look up whether we are the integrated or discrete GPU (all asics).
+ * Returns the client id.
+ */
+-static int radeon_atpx_get_client_id(struct pci_dev *pdev)
++static enum vga_switcheroo_client_id radeon_atpx_get_client_id(struct pci_dev *pdev)
+ {
+ if (radeon_atpx_priv.dhandle == ACPI_HANDLE(&pdev->dev))
+ return VGA_SWITCHEROO_IGD;
+diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
+index 340f3f5..3a0afbe 100644
+--- a/drivers/gpu/drm/radeon/radeon_connectors.c
++++ b/drivers/gpu/drm/radeon/radeon_connectors.c
+@@ -851,7 +851,7 @@ static int radeon_lvds_get_modes(struct drm_connector *connector)
+ return ret;
+ }
+
+-static int radeon_lvds_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status radeon_lvds_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct drm_encoder *encoder = radeon_best_single_encoder(connector);
+@@ -994,7 +994,7 @@ static int radeon_vga_get_modes(struct drm_connector *connector)
+ return ret;
+ }
+
+-static int radeon_vga_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status radeon_vga_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct drm_device *dev = connector->dev;
+@@ -1133,7 +1133,7 @@ static int radeon_tv_get_modes(struct drm_connector *connector)
+ return 1;
+ }
+
+-static int radeon_tv_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status radeon_tv_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ if ((mode->hdisplay > 1024) || (mode->vdisplay > 768))
+@@ -1464,7 +1464,7 @@ static void radeon_dvi_force(struct drm_connector *connector)
+ radeon_connector->use_digital = true;
+ }
+
+-static int radeon_dvi_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status radeon_dvi_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ struct drm_device *dev = connector->dev;
+@@ -1761,7 +1761,7 @@ out:
+ return ret;
+ }
+
+-static int radeon_dp_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status radeon_dp_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *