From 1ab933acc723e4e3e1c7cd39df5e36693cd126eb Mon Sep 17 00:00:00 2001 From: Leonardo Arena Date: Fri, 28 Mar 2014 08:02:46 +0000 Subject: [PATCH] main/linux-virt-grsec: upgrade to 3.13.7 --- main/linux-virt-grsec/APKBUILD | 34 +- ... grsecurity-3.0-3.13.7-201403252047.patch} | 21031 +++++++++------- main/linux-virt-grsec/kernelconfig.x86 | 91 +- main/linux-virt-grsec/kernelconfig.x86_64 | 99 +- 4 files changed, 11741 insertions(+), 9514 deletions(-) rename main/linux-virt-grsec/{grsecurity-3.0-3.12.8-201401191015.patch => grsecurity-3.0-3.13.7-201403252047.patch} (90%) diff --git a/main/linux-virt-grsec/APKBUILD b/main/linux-virt-grsec/APKBUILD index bf2e05f2676..58ccadc5c20 100644 --- a/main/linux-virt-grsec/APKBUILD +++ b/main/linux-virt-grsec/APKBUILD @@ -3,7 +3,7 @@ _flavor=virt-grsec pkgname=linux-${_flavor} -pkgver=3.12.8 +pkgver=3.13.7 case $pkgver in *.*.*) _kernver=${pkgver%.*};; *.*) _kernver=${pkgver};; @@ -18,7 +18,7 @@ _config=${config:-kernelconfig.${CARCH}} install= source="http://ftp.kernel.org/pub/linux/kernel/v3.x/linux-$_kernver.tar.xz http://ftp.kernel.org/pub/linux/kernel/v3.x/patch-$pkgver.xz - grsecurity-3.0-$pkgver-201401191015.patch + grsecurity-3.0-$pkgver-201403252047.patch fix-memory-map-for-PIE-applications.patch kernelconfig.x86 @@ -144,21 +144,21 @@ dev() { "$subpkgdir"/lib/modules/${_abi_release}/build } -md5sums="cc6ee608854e0da4b64f6c1ff8b6398c linux-3.12.tar.xz -03d34842e3a1197d17055610f62627b8 patch-3.12.8.xz -a7dd09d05b98cca3b7c00098698bdd38 grsecurity-3.0-3.12.8-201401191015.patch +md5sums="0ecbaf65c00374eb4a826c2f9f37606f linux-3.13.tar.xz +cb33b329d3417846d310c7f58a2614b6 patch-3.13.7.xz +00dbb1fb5bfc08842d97c02ece67e441 grsecurity-3.0-3.13.7-201403252047.patch c6a4ae7e8ca6159e1631545515805216 fix-memory-map-for-PIE-applications.patch -cc0bc34dd6d4f4396fa70ceaa5aa4a1a kernelconfig.x86 -93a67bcefa885e0089247694c3e1fa25 kernelconfig.x86_64" -sha256sums="2e120ec7fde19fa51dc6b6cc11c81860a0775defcad5a5bf910ed9a50e845a02 linux-3.12.tar.xz -a8e056bec1a39bbca8d2df9c477a9dee0e263ae4335601548eda14326e83e782 patch-3.12.8.xz -8ec870556270bb0041b1b7fcc4d86328c62023a288b8e914b8721c94956ac737 grsecurity-3.0-3.12.8-201401191015.patch +dafaf5ef5b477d21411b423caa0d6836 kernelconfig.x86 +492168c5783522e39f26ce5771f93e12 kernelconfig.x86_64" +sha256sums="4d5e5eee5f276424c32e9591f1b6c971baedc7b49f28ce03d1f48b1e5d6226a2 linux-3.13.tar.xz +4e7a062493c2a0dd2f2aa0ec636a47b2b1785aebccf652ae56e68f0dfc083f89 patch-3.13.7.xz +2bd65311a72df142f5b4f7be20f4b1e26fc62c076dba9991f0efba12dc847538 grsecurity-3.0-3.13.7-201403252047.patch 500f3577310be52e87b9fecdc2e9c4ca43210fd97d69089f9005d484563f74c7 fix-memory-map-for-PIE-applications.patch -bb7418bfdfbe45476331412b17a06abb08f8a0f44fe8ff978fd3413e8671ae66 kernelconfig.x86 -4a11a2edd0dc69687f96f6c80140537b8ba74684244af59a1ffe74cd69712c6c kernelconfig.x86_64" -sha512sums="4ba5797e0772726d05c9f2eee66dc6dc2a5033c749ef44764c805a83da739ed5d0c6443b76785e38fe1ef74cc7ade787e48144faed0cfcb6f124f05248c700ff linux-3.12.tar.xz -27cf39ed82d2b28669a7a63b577814b625e9fa73fce4e15c5f4a35358621356e4364c4892427fb5e02982087090404f5ce871357a04c0372d008b1e55ca55aee patch-3.12.8.xz -d8d9ead63a728385fff54597cd25d0856d9f1e964d871cf75ed9563beb358ea8f6e87d81ed16432c02772fa3d8e1caf45b15e0cce4ec4c07e73e0ef531f28016 grsecurity-3.0-3.12.8-201401191015.patch +ae9d10524dde3504cf77db0f3a2efb10a60af804e246117d34c722be34e20d49 kernelconfig.x86 +f478c9d4e13f687a07bd4148be812ff9489668dd75d8512fc466428fa290198a kernelconfig.x86_64" +sha512sums="1ba223bb4b885d691a67196d86a8aaf7b4a1c351bf2a762f50f1b0c32da00dd0c28895872a66b49e8d244498d996876609268e64861d28ac4048886ef9f79b87 linux-3.13.tar.xz +bee628e25d8ed378fd32d0e96ac20f24d1bef2950377cee249b65db918bd528a744cc1058006f9e945095ccc81805d715eb27e5c36f2515c7dcfdf5fe6b6c7a6 patch-3.13.7.xz +f118a017084f8dee3d5ae0f9435f96e9e5cff7c2d4672855622133cc6fd811c4e481c6b6f907b43c691f0531bfaf168dbd08877e29c25da82989492bc4186de4 grsecurity-3.0-3.13.7-201403252047.patch 4665c56ae1bbac311f9205d64918e84ee8b01d47d6e2396ff6b8adfb10aada7f7254531ce62e31edbb65c2a54a830f09ad05d314dfcd75d6272f4068945ad7c7 fix-memory-map-for-PIE-applications.patch -b2245e3eeb020651eb36289d658b32a0ace45e00c392113e8589dbc31f5bd602fb3284b915b4924c235c7886f5e773ad731ddb392ca9e7b10528e0344bdafaef kernelconfig.x86 -203ef17038ebdb92dbdd6547875816012442f6d4c3d5ea43d9f4898b4c074feda85c485c3bf2aa1b6de127985292aaeef3596e66f06282c7853f9ff7db0a5df4 kernelconfig.x86_64" +e3632c26946afe40fad6ebd8bba9631d67c57c948efabc619096aeb108720464ffd70c4b69227b6906593b606d6e6ed0b22e71298a13cf4955076ffeb457198b kernelconfig.x86 +574f8b4373fa4f59aaf4958754baacf2c231718f7aae76264f9cc349582824b9edd4288daea7e3aa66b3c01b176897ad2c8975395971fe2062f7ca5ff27e8f82 kernelconfig.x86_64" diff --git a/main/linux-virt-grsec/grsecurity-3.0-3.12.8-201401191015.patch b/main/linux-virt-grsec/grsecurity-3.0-3.13.7-201403252047.patch similarity index 90% rename from main/linux-virt-grsec/grsecurity-3.0-3.12.8-201401191015.patch rename to main/linux-virt-grsec/grsecurity-3.0-3.13.7-201403252047.patch index 07d9c2507f9..52f42f11481 100644 --- a/main/linux-virt-grsec/grsecurity-3.0-3.12.8-201401191015.patch +++ b/main/linux-virt-grsec/grsecurity-3.0-3.13.7-201403252047.patch @@ -1,5 +1,5 @@ diff --git a/Documentation/dontdiff b/Documentation/dontdiff -index b89a739..903b673 100644 +index b89a739..e289b9b 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff @@ -2,9 +2,11 @@ @@ -169,10 +169,12 @@ index b89a739..903b673 100644 pnmtologo ppc_defs.h* pss_boot.h -@@ -203,7 +227,10 @@ r200_reg_safe.h +@@ -203,7 +227,12 @@ r200_reg_safe.h r300_reg_safe.h r420_reg_safe.h r600_reg_safe.h ++randomize_layout_hash.h ++randomize_layout_seed.h +realmode.lds +realmode.relocs recordmcount @@ -180,7 +182,7 @@ index b89a739..903b673 100644 relocs rlim_names.h rn50_reg_safe.h -@@ -213,8 +240,12 @@ series +@@ -213,8 +242,12 @@ series setup setup.bin setup.elf @@ -193,7 +195,7 @@ index b89a739..903b673 100644 split-include syscalltab.h tables.c -@@ -224,6 +255,7 @@ tftpboot.img +@@ -224,6 +257,7 @@ tftpboot.img timeconst.h times.h* trix_boot.h @@ -201,7 +203,7 @@ index b89a739..903b673 100644 utsrelease.h* vdso-syms.lds vdso.lds -@@ -235,13 +267,17 @@ vdso32.lds +@@ -235,13 +269,17 @@ vdso32.lds vdso32.so.dbg vdso64.lds vdso64.so.dbg @@ -219,7 +221,7 @@ index b89a739..903b673 100644 vmlinuz voffset.h vsyscall.lds -@@ -249,9 +285,12 @@ vsyscall_32.lds +@@ -249,9 +287,12 @@ vsyscall_32.lds wanxlfw.inc uImage unifdef @@ -233,10 +235,10 @@ index b89a739..903b673 100644 +zconf.lex.c zoffset.h diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 4f7c57c..a2dc685 100644 +index b9e9bd8..bf49b92 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -1031,6 +1031,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. +@@ -1033,6 +1033,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. Format: such that (rxsize & ~0x1fffc0) == 0. Default: 1024 @@ -247,7 +249,7 @@ index 4f7c57c..a2dc685 100644 hashdist= [KNL,NUMA] Large hashes allocated during boot are distributed across NUMA nodes. Defaults on for 64-bit NUMA, off otherwise. -@@ -2001,6 +2005,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. +@@ -2018,6 +2022,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. noexec=on: enable non-executable mappings (default) noexec=off: disable non-executable mappings @@ -258,7 +260,7 @@ index 4f7c57c..a2dc685 100644 nosmap [X86] Disable SMAP (Supervisor Mode Access Prevention) even if it is supported by processor. -@@ -2268,6 +2276,25 @@ bytes respectively. Such letter suffixes can also be entirely omitted. +@@ -2285,6 +2293,25 @@ 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. @@ -285,10 +287,10 @@ index 4f7c57c..a2dc685 100644 pcd. [PARIDE] diff --git a/Makefile b/Makefile -index 5d0ec13..d3dcef2 100644 +index 9f214b4..8c9c622 100644 --- a/Makefile +++ b/Makefile -@@ -241,8 +241,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ +@@ -244,8 +244,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ HOSTCC = gcc HOSTCXX = g++ @@ -300,7 +302,23 @@ index 5d0ec13..d3dcef2 100644 # Decide whether to build built-in, modular, or both. # Normally, just do built-in. -@@ -414,8 +415,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \ +@@ -311,9 +312,15 @@ endif + # If the user is running make -s (silent mode), suppress echoing of + # commands + ++ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4 ++ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),) ++ quiet=silent_ ++endif ++else # make-3.8x + ifneq ($(filter s% -s%,$(MAKEFLAGS)),) + quiet=silent_ + endif ++endif + + export quiet Q KBUILD_VERBOSE + +@@ -417,8 +424,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \ # Rules shared between *config targets and build targets # Basic helpers built in scripts/ @@ -311,7 +329,7 @@ index 5d0ec13..d3dcef2 100644 $(Q)$(MAKE) $(build)=scripts/basic $(Q)rm -f .tmp_quiet_recordmcount -@@ -576,6 +577,65 @@ else +@@ -579,6 +586,72 @@ else KBUILD_CFLAGS += -O2 endif @@ -337,6 +355,12 @@ index 5d0ec13..d3dcef2 100644 +KERNEXEC_PLUGIN_CFLAGS += -fplugin-arg-kernexec_plugin-method=$(CONFIG_PAX_KERNEXEC_PLUGIN_METHOD) -DKERNEXEC_PLUGIN +KERNEXEC_PLUGIN_AFLAGS := -DKERNEXEC_PLUGIN +endif ++ifdef CONFIG_GRKERNSEC_RANDSTRUCT ++RANDSTRUCT_PLUGIN_CFLAGS := -fplugin=$(objtree)/tools/gcc/randomize_layout_plugin.so -DRANDSTRUCT_PLUGIN ++ifdef CONFIG_GRKERNSEC_RANDSTRUCT_PERFORMANCE ++RANDSTRUCT_PLUGIN_CFLAGS += -fplugin-arg-randomize_layout_plugin-performance-mode ++endif ++endif +ifdef CONFIG_CHECKER_PLUGIN +ifeq ($(call cc-ifversion, -ge, 0406, y), y) +CHECKER_PLUGIN_CFLAGS := -fplugin=$(objtree)/tools/gcc/checker_plugin.so -DCHECKER_PLUGIN @@ -355,8 +379,9 @@ index 5d0ec13..d3dcef2 100644 +GCC_PLUGINS_CFLAGS := $(CONSTIFY_PLUGIN_CFLAGS) $(STACKLEAK_PLUGIN_CFLAGS) $(KALLOCSTAT_PLUGIN_CFLAGS) +GCC_PLUGINS_CFLAGS += $(KERNEXEC_PLUGIN_CFLAGS) $(CHECKER_PLUGIN_CFLAGS) $(COLORIZE_PLUGIN_CFLAGS) +GCC_PLUGINS_CFLAGS += $(SIZE_OVERFLOW_PLUGIN_CFLAGS) $(LATENT_ENTROPY_PLUGIN_CFLAGS) $(STRUCTLEAK_PLUGIN_CFLAGS) ++GCC_PLUGINS_CFLAGS += $(RANDSTRUCT_PLUGIN_CFLAGS) +GCC_PLUGINS_AFLAGS := $(KERNEXEC_PLUGIN_AFLAGS) -+export PLUGINCC GCC_PLUGINS_CFLAGS GCC_PLUGINS_AFLAGS CONSTIFY_PLUGIN ++export PLUGINCC GCC_PLUGINS_CFLAGS GCC_PLUGINS_AFLAGS CONSTIFY_PLUGIN LATENT_ENTROPY_PLUGIN_CFLAGS +ifeq ($(KBUILD_EXTMOD),) +gcc-plugins: + $(Q)$(MAKE) $(build)=tools/gcc @@ -377,7 +402,16 @@ index 5d0ec13..d3dcef2 100644 include $(srctree)/arch/$(SRCARCH)/Makefile ifdef CONFIG_READABLE_ASM -@@ -733,7 +793,7 @@ export mod_sign_cmd +@@ -619,7 +692,7 @@ endif + + ifdef CONFIG_DEBUG_INFO + KBUILD_CFLAGS += -g +-KBUILD_AFLAGS += -gdwarf-2 ++KBUILD_AFLAGS += -Wa,--gdwarf-2 + endif + + ifdef CONFIG_DEBUG_INFO_REDUCED +@@ -754,7 +827,7 @@ export mod_sign_cmd ifeq ($(KBUILD_EXTMOD),) @@ -386,7 +420,7 @@ index 5d0ec13..d3dcef2 100644 vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ -@@ -782,6 +842,8 @@ endif +@@ -803,6 +876,8 @@ endif # The actual objects are generated when descending, # make sure no implicit rule kicks in @@ -395,7 +429,7 @@ index 5d0ec13..d3dcef2 100644 $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; # Handle descending into subdirectories listed in $(vmlinux-dirs) -@@ -791,7 +853,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; +@@ -812,7 +887,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; # Error messages still appears in the original language PHONY += $(vmlinux-dirs) @@ -404,7 +438,7 @@ index 5d0ec13..d3dcef2 100644 $(Q)$(MAKE) $(build)=$@ define filechk_kernel.release -@@ -834,10 +896,13 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \ +@@ -855,10 +930,13 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \ archprepare: archheaders archscripts prepare1 scripts_basic @@ -418,7 +452,7 @@ index 5d0ec13..d3dcef2 100644 prepare: prepare0 # Generate some files -@@ -945,6 +1010,8 @@ all: modules +@@ -966,6 +1044,8 @@ all: modules # using awk while concatenating to the final file. PHONY += modules @@ -427,7 +461,7 @@ index 5d0ec13..d3dcef2 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.'; -@@ -960,7 +1027,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) +@@ -981,7 +1061,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) # Target to prepare building external modules PHONY += modules_prepare @@ -436,16 +470,17 @@ index 5d0ec13..d3dcef2 100644 # Target to install modules PHONY += modules_install -@@ -1026,7 +1093,7 @@ MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \ +@@ -1047,7 +1127,8 @@ MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \ Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ signing_key.priv signing_key.x509 x509.genkey \ extra_certificates signing_key.x509.keyid \ - signing_key.x509.signer -+ signing_key.x509.signer tools/gcc/size_overflow_hash.h ++ signing_key.x509.signer tools/gcc/size_overflow_hash.h \ ++ tools/gcc/randomize_layout_seed.h # clean - Delete most, but leave enough to build external modules # -@@ -1066,6 +1133,7 @@ distclean: mrproper +@@ -1087,6 +1168,7 @@ distclean: mrproper \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ -o -name '.*.rej' \ @@ -453,7 +488,7 @@ index 5d0ec13..d3dcef2 100644 -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ -type f -print | xargs rm -f -@@ -1227,6 +1295,8 @@ PHONY += $(module-dirs) modules +@@ -1248,6 +1330,8 @@ PHONY += $(module-dirs) modules $(module-dirs): crmodverdir $(objtree)/Module.symvers $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) @@ -462,7 +497,7 @@ index 5d0ec13..d3dcef2 100644 modules: $(module-dirs) @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost -@@ -1366,17 +1436,21 @@ else +@@ -1387,17 +1471,21 @@ else target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) endif @@ -488,7 +523,7 @@ index 5d0ec13..d3dcef2 100644 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) %.symtypes: %.c prepare scripts FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -@@ -1386,11 +1460,15 @@ endif +@@ -1407,11 +1495,15 @@ endif $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) @@ -572,7 +607,7 @@ index 968d999..d36b2df 100644 registered using atexit. This provides a mean for the dynamic linker to call DT_FINI functions for shared libraries that have diff --git a/arch/alpha/include/asm/pgalloc.h b/arch/alpha/include/asm/pgalloc.h -index bc2a0da..8ad11ee 100644 +index aab14a0..b4fa3e7 100644 --- a/arch/alpha/include/asm/pgalloc.h +++ b/arch/alpha/include/asm/pgalloc.h @@ -29,6 +29,12 @@ pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd) @@ -839,10 +874,10 @@ index 98838a0..b304fb4 100644 /* Allow reads even for write-only mappings */ if (!(vma->vm_flags & (VM_READ | VM_WRITE))) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 1ad6fb6..9406b3d 100644 +index 47085a0..f975a53 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1832,7 +1832,7 @@ config ALIGNMENT_TRAP +@@ -1830,7 +1830,7 @@ config ALIGNMENT_TRAP config UACCESS_WITH_MEMCPY bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user()" @@ -851,7 +886,7 @@ index 1ad6fb6..9406b3d 100644 default y if CPU_FEROCEON help Implement faster copy_to_user and clear_user methods for CPU -@@ -2097,6 +2097,7 @@ config XIP_PHYS_ADDR +@@ -2102,6 +2102,7 @@ config XIP_PHYS_ADDR config KEXEC bool "Kexec system call (EXPERIMENTAL)" depends on (!SMP || PM_SLEEP_SMP) @@ -860,10 +895,10 @@ index 1ad6fb6..9406b3d 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/include/asm/atomic.h b/arch/arm/include/asm/atomic.h -index da1c77d..2ee6056 100644 +index 62d2cb5..09d45e3 100644 --- a/arch/arm/include/asm/atomic.h +++ b/arch/arm/include/asm/atomic.h -@@ -17,17 +17,35 @@ +@@ -18,17 +18,35 @@ #include #include @@ -899,9 +934,9 @@ index da1c77d..2ee6056 100644 #if __LINUX_ARM_ARCH__ >= 6 -@@ -42,6 +60,35 @@ static inline void atomic_add(int i, atomic_t *v) - int result; +@@ -44,6 +62,36 @@ static inline void atomic_add(int i, atomic_t *v) + prefetchw(&v->counter); __asm__ __volatile__("@ atomic_add\n" +"1: ldrex %1, [%3]\n" +" adds %0, %1, %4\n" @@ -931,11 +966,12 @@ index da1c77d..2ee6056 100644 + unsigned long tmp; + int result; + ++ prefetchw(&v->counter); + __asm__ __volatile__("@ atomic_add_unchecked\n" "1: ldrex %0, [%3]\n" " add %0, %0, %4\n" " strex %1, %0, [%3]\n" -@@ -60,6 +107,42 @@ static inline int atomic_add_return(int i, atomic_t *v) +@@ -62,6 +110,42 @@ static inline int atomic_add_return(int i, atomic_t *v) smp_mb(); __asm__ __volatile__("@ atomic_add_return\n" @@ -978,9 +1014,9 @@ index da1c77d..2ee6056 100644 "1: ldrex %0, [%3]\n" " add %0, %0, %4\n" " strex %1, %0, [%3]\n" -@@ -80,6 +163,35 @@ static inline void atomic_sub(int i, atomic_t *v) - int result; +@@ -83,6 +167,36 @@ static inline void atomic_sub(int i, atomic_t *v) + prefetchw(&v->counter); __asm__ __volatile__("@ atomic_sub\n" +"1: ldrex %1, [%3]\n" +" subs %0, %1, %4\n" @@ -1010,11 +1046,12 @@ index da1c77d..2ee6056 100644 + unsigned long tmp; + int result; + ++ prefetchw(&v->counter); + __asm__ __volatile__("@ atomic_sub_unchecked\n" "1: ldrex %0, [%3]\n" " sub %0, %0, %4\n" " strex %1, %0, [%3]\n" -@@ -98,11 +210,25 @@ static inline int atomic_sub_return(int i, atomic_t *v) +@@ -101,11 +215,25 @@ static inline int atomic_sub_return(int i, atomic_t *v) smp_mb(); __asm__ __volatile__("@ atomic_sub_return\n" @@ -1042,7 +1079,7 @@ index da1c77d..2ee6056 100644 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "Ir" (i) : "cc"); -@@ -134,6 +260,28 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new) +@@ -138,6 +266,28 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new) return oldval; } @@ -1068,10 +1105,10 @@ index da1c77d..2ee6056 100644 + return oldval; +} + - static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) - { - unsigned long tmp, tmp2; -@@ -167,7 +315,17 @@ static inline int atomic_add_return(int i, atomic_t *v) + #else /* ARM_ARCH_6 */ + + #ifdef CONFIG_SMP +@@ -156,7 +306,17 @@ static inline int atomic_add_return(int i, atomic_t *v) return val; } @@ -1089,7 +1126,7 @@ index da1c77d..2ee6056 100644 static inline int atomic_sub_return(int i, atomic_t *v) { -@@ -182,6 +340,10 @@ static inline int atomic_sub_return(int i, atomic_t *v) +@@ -171,6 +331,10 @@ static inline int atomic_sub_return(int i, atomic_t *v) return val; } #define atomic_sub(i, v) (void) atomic_sub_return(i, v) @@ -1100,7 +1137,7 @@ index da1c77d..2ee6056 100644 static inline int atomic_cmpxchg(atomic_t *v, int old, int new) { -@@ -197,6 +359,11 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new) +@@ -186,9 +350,18 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new) return ret; } @@ -1109,10 +1146,6 @@ index da1c77d..2ee6056 100644 + return atomic_cmpxchg(v, old, new); +} + - static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) - { - unsigned long flags; -@@ -209,6 +376,10 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) #endif /* __LINUX_ARM_ARCH__ */ #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) @@ -1123,7 +1156,7 @@ index da1c77d..2ee6056 100644 static inline int __atomic_add_unless(atomic_t *v, int a, int u) { -@@ -221,11 +392,27 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) +@@ -201,11 +374,27 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) } #define atomic_inc(v) atomic_add(1, v) @@ -1151,13 +1184,13 @@ index da1c77d..2ee6056 100644 #define atomic_dec_return(v) (atomic_sub_return(1, v)) #define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) -@@ -241,6 +428,14 @@ typedef struct { - u64 __aligned(8) counter; +@@ -221,6 +410,14 @@ typedef struct { + long long counter; } atomic64_t; +#ifdef CONFIG_PAX_REFCOUNT +typedef struct { -+ u64 __aligned(8) counter; ++ long long counter; +} atomic64_unchecked_t; +#else +typedef atomic64_t atomic64_unchecked_t; @@ -1166,13 +1199,13 @@ index da1c77d..2ee6056 100644 #define ATOMIC64_INIT(i) { (i) } #ifdef CONFIG_ARM_LPAE -@@ -257,6 +452,19 @@ static inline u64 atomic64_read(const atomic64_t *v) +@@ -237,6 +434,19 @@ static inline long long atomic64_read(const atomic64_t *v) return result; } -+static inline u64 atomic64_read_unchecked(const atomic64_unchecked_t *v) ++static inline long long atomic64_read_unchecked(const atomic64_unchecked_t *v) +{ -+ u64 result; ++ long long result; + + __asm__ __volatile__("@ atomic64_read_unchecked\n" +" ldrd %0, %H0, [%1]" @@ -1183,15 +1216,15 @@ index da1c77d..2ee6056 100644 + return result; +} + - static inline void atomic64_set(atomic64_t *v, u64 i) + static inline void atomic64_set(atomic64_t *v, long long i) { __asm__ __volatile__("@ atomic64_set\n" -@@ -265,6 +473,15 @@ static inline void atomic64_set(atomic64_t *v, u64 i) +@@ -245,6 +455,15 @@ static inline void atomic64_set(atomic64_t *v, long long i) : "r" (&v->counter), "r" (i) ); } + -+static inline void atomic64_set_unchecked(atomic64_unchecked_t *v, u64 i) ++static inline void atomic64_set_unchecked(atomic64_unchecked_t *v, long long i) +{ + __asm__ __volatile__("@ atomic64_set_unchecked\n" +" strd %2, %H2, [%1]" @@ -1200,15 +1233,15 @@ index da1c77d..2ee6056 100644 + ); +} #else - static inline u64 atomic64_read(const atomic64_t *v) + static inline long long atomic64_read(const atomic64_t *v) { -@@ -279,6 +496,19 @@ static inline u64 atomic64_read(const atomic64_t *v) +@@ -259,6 +478,19 @@ static inline long long atomic64_read(const atomic64_t *v) return result; } -+static inline u64 atomic64_read_unchecked(atomic64_unchecked_t *v) ++static inline long long atomic64_read_unchecked(const atomic64_unchecked_t *v) +{ -+ u64 result; ++ long long result; + + __asm__ __volatile__("@ atomic64_read_unchecked\n" +" ldrexd %0, %H0, [%1]" @@ -1219,18 +1252,19 @@ index da1c77d..2ee6056 100644 + return result; +} + - static inline void atomic64_set(atomic64_t *v, u64 i) + static inline void atomic64_set(atomic64_t *v, long long i) { - u64 tmp; -@@ -292,6 +522,21 @@ static inline void atomic64_set(atomic64_t *v, u64 i) + long long tmp; +@@ -273,6 +505,21 @@ static inline void atomic64_set(atomic64_t *v, long long i) : "r" (&v->counter), "r" (i) : "cc"); } + -+static inline void atomic64_set_unchecked(atomic64_unchecked_t *v, u64 i) ++static inline void atomic64_set_unchecked(atomic64_unchecked_t *v, long long i) +{ -+ u64 tmp; ++ long long tmp; + ++ prefetchw(&v->counter); + __asm__ __volatile__("@ atomic64_set_unchecked\n" +"1: ldrexd %0, %H0, [%2]\n" +" strexd %0, %3, %H3, [%2]\n" @@ -1240,15 +1274,14 @@ index da1c77d..2ee6056 100644 + : "r" (&v->counter), "r" (i) + : "cc"); +} -+ #endif - static inline void atomic64_add(u64 i, atomic64_t *v) -@@ -302,6 +547,36 @@ static inline void atomic64_add(u64 i, atomic64_t *v) + static inline void atomic64_add(long long i, atomic64_t *v) +@@ -284,6 +531,37 @@ static inline void atomic64_add(long long i, atomic64_t *v) __asm__ __volatile__("@ atomic64_add\n" "1: ldrexd %0, %H0, [%3]\n" - " adds %0, %0, %4\n" -+" adcs %H0, %H0, %H4\n" + " adds %Q0, %Q0, %Q4\n" ++" adcs %R0, %R0, %R4\n" + +#ifdef CONFIG_PAX_REFCOUNT +" bvc 3f\n" @@ -1270,31 +1303,23 @@ index da1c77d..2ee6056 100644 + : "cc"); +} + -+static inline void atomic64_add_unchecked(u64 i, atomic64_unchecked_t *v) ++static inline void atomic64_add_unchecked(long long i, atomic64_unchecked_t *v) +{ -+ u64 result; ++ long long result; + unsigned long tmp; + ++ prefetchw(&v->counter); + __asm__ __volatile__("@ atomic64_add_unchecked\n" +"1: ldrexd %0, %H0, [%3]\n" -+" adds %0, %0, %4\n" - " adc %H0, %H0, %H4\n" ++" adds %Q0, %Q0, %Q4\n" + " adc %R0, %R0, %R4\n" " strexd %1, %0, %H0, [%3]\n" " teq %1, #0\n" -@@ -313,12 +588,49 @@ static inline void atomic64_add(u64 i, atomic64_t *v) - - static inline u64 atomic64_add_return(u64 i, atomic64_t *v) - { -- u64 result; -- unsigned long tmp; -+ u64 result, tmp; - - smp_mb(); - +@@ -303,6 +581,44 @@ static inline long long atomic64_add_return(long long i, atomic64_t *v) __asm__ __volatile__("@ atomic64_add_return\n" -+"1: ldrexd %1, %H1, [%3]\n" -+" adds %0, %1, %4\n" -+" adcs %H0, %H1, %H4\n" + "1: ldrexd %0, %H0, [%3]\n" + " adds %Q0, %Q0, %Q4\n" ++" adcs %R0, %R0, %R4\n" + +#ifdef CONFIG_PAX_REFCOUNT +" bvc 3f\n" @@ -1322,22 +1347,24 @@ index da1c77d..2ee6056 100644 + return result; +} + -+static inline u64 atomic64_add_return_unchecked(u64 i, atomic64_unchecked_t *v) ++static inline long long atomic64_add_return_unchecked(long long i, atomic64_unchecked_t *v) +{ -+ u64 result; ++ long long result; + unsigned long tmp; + + smp_mb(); + + __asm__ __volatile__("@ atomic64_add_return_unchecked\n" - "1: ldrexd %0, %H0, [%3]\n" - " adds %0, %0, %4\n" - " adc %H0, %H0, %H4\n" -@@ -342,6 +654,36 @@ static inline void atomic64_sub(u64 i, atomic64_t *v) ++"1: ldrexd %0, %H0, [%3]\n" ++" adds %Q0, %Q0, %Q4\n" + " adc %R0, %R0, %R4\n" + " strexd %1, %0, %H0, [%3]\n" + " teq %1, #0\n" +@@ -325,6 +641,37 @@ static inline void atomic64_sub(long long i, atomic64_t *v) __asm__ __volatile__("@ atomic64_sub\n" "1: ldrexd %0, %H0, [%3]\n" - " subs %0, %0, %4\n" -+" sbcs %H0, %H0, %H4\n" + " subs %Q0, %Q0, %Q4\n" ++" sbcs %R0, %R0, %R4\n" + +#ifdef CONFIG_PAX_REFCOUNT +" bvc 3f\n" @@ -1359,34 +1386,24 @@ index da1c77d..2ee6056 100644 + : "cc"); +} + -+static inline void atomic64_sub_unchecked(u64 i, atomic64_unchecked_t *v) ++static inline void atomic64_sub_unchecked(long long i, atomic64_unchecked_t *v) +{ -+ u64 result; ++ long long result; + unsigned long tmp; + ++ prefetchw(&v->counter); + __asm__ __volatile__("@ atomic64_sub_unchecked\n" +"1: ldrexd %0, %H0, [%3]\n" -+" subs %0, %0, %4\n" - " sbc %H0, %H0, %H4\n" ++" subs %Q0, %Q0, %Q4\n" + " sbc %R0, %R0, %R4\n" " strexd %1, %0, %H0, [%3]\n" " teq %1, #0\n" -@@ -353,18 +695,32 @@ static inline void atomic64_sub(u64 i, atomic64_t *v) - - static inline u64 atomic64_sub_return(u64 i, atomic64_t *v) - { -- u64 result; -- unsigned long tmp; -+ u64 result, tmp; - - smp_mb(); - +@@ -344,16 +691,29 @@ static inline long long atomic64_sub_return(long long i, atomic64_t *v) __asm__ __volatile__("@ atomic64_sub_return\n" --"1: ldrexd %0, %H0, [%3]\n" --" subs %0, %0, %4\n" --" sbc %H0, %H0, %H4\n" -+"1: ldrexd %1, %H1, [%3]\n" -+" subs %0, %1, %4\n" -+" sbcs %H0, %H1, %H4\n" + "1: ldrexd %0, %H0, [%3]\n" + " subs %Q0, %Q0, %Q4\n" +-" sbc %R0, %R0, %R4\n" ++" sbcs %R0, %R0, %R4\n" + +#ifdef CONFIG_PAX_REFCOUNT +" bvc 3f\n" @@ -1408,13 +1425,20 @@ index da1c77d..2ee6056 100644 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "r" (i) : "cc"); -@@ -398,6 +754,30 @@ static inline u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old, u64 new) + +- smp_mb(); +- + return result; + } + +@@ -382,6 +742,31 @@ static inline long long atomic64_cmpxchg(atomic64_t *ptr, long long old, return oldval; } -+static inline u64 atomic64_cmpxchg_unchecked(atomic64_unchecked_t *ptr, u64 old, u64 new) ++static inline long long atomic64_cmpxchg_unchecked(atomic64_unchecked_t *ptr, long long old, ++ long long new) +{ -+ u64 oldval; ++ long long oldval; + unsigned long res; + + smp_mb(); @@ -1436,36 +1460,35 @@ index da1c77d..2ee6056 100644 + return oldval; +} + - static inline u64 atomic64_xchg(atomic64_t *ptr, u64 new) + static inline long long atomic64_xchg(atomic64_t *ptr, long long new) { - u64 result; -@@ -421,21 +801,34 @@ static inline u64 atomic64_xchg(atomic64_t *ptr, u64 new) - - static inline u64 atomic64_dec_if_positive(atomic64_t *v) + long long result; +@@ -406,20 +791,34 @@ static inline long long atomic64_xchg(atomic64_t *ptr, long long new) + static inline long long atomic64_dec_if_positive(atomic64_t *v) { -- u64 result; + long long result; - unsigned long tmp; -+ u64 result, tmp; ++ u64 tmp; smp_mb(); __asm__ __volatile__("@ atomic64_dec_if_positive\n" -"1: ldrexd %0, %H0, [%3]\n" --" subs %0, %0, #1\n" --" sbc %H0, %H0, #0\n" +-" subs %Q0, %Q0, #1\n" +-" sbc %R0, %R0, #0\n" +"1: ldrexd %1, %H1, [%3]\n" -+" subs %0, %1, #1\n" -+" sbcs %H0, %H1, #0\n" ++" subs %Q0, %Q1, #1\n" ++" sbcs %R0, %R1, #0\n" + +#ifdef CONFIG_PAX_REFCOUNT +" bvc 3f\n" -+" mov %0, %1\n" -+" mov %H0, %H1\n" ++" mov %Q0, %Q1\n" ++" mov %R0, %R1\n" +"2: bkpt 0xf103\n" +"3:\n" +#endif + - " teq %H0, #0\n" + " teq %R0, #0\n" -" bmi 2f\n" +" bmi 4f\n" " strexd %1, %0, %H0, [%3]\n" @@ -1481,15 +1504,15 @@ index da1c77d..2ee6056 100644 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter) : "cc"); -@@ -458,13 +851,25 @@ static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u) +@@ -442,13 +841,25 @@ static inline int atomic64_add_unless(atomic64_t *v, long long a, long long u) " teq %0, %5\n" " teqeq %H0, %H5\n" " moveq %1, #0\n" -" beq 2f\n" +" beq 4f\n" - " adds %0, %0, %6\n" --" adc %H0, %H0, %H6\n" -+" adcs %H0, %H0, %H6\n" + " adds %Q0, %Q0, %Q6\n" +-" adc %R0, %R0, %R6\n" ++" adcs %R0, %R0, %R6\n" + +#ifdef CONFIG_PAX_REFCOUNT +" bvc 3f\n" @@ -1510,7 +1533,7 @@ index da1c77d..2ee6056 100644 : "=&r" (val), "+r" (ret), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "r" (u), "r" (a) : "cc"); -@@ -477,10 +882,13 @@ static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u) +@@ -461,10 +872,13 @@ static inline int atomic64_add_unless(atomic64_t *v, long long a, long long u) #define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0) #define atomic64_inc(v) atomic64_add(1LL, (v)) @@ -1548,7 +1571,7 @@ index 75fe66b..ba3dee4 100644 #endif diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h -index 15f2d5b..43ffa53 100644 +index ab91ebb..2c2afeb 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h @@ -116,7 +116,7 @@ struct cpu_cache_fns { @@ -1586,7 +1609,7 @@ index 6dcc164..b14d917 100644 /* * Fold a partial checksum without adding pseudo headers diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h -index 4f009c1..466c59b 100644 +index df2fbba..63fe3e1 100644 --- a/arch/arm/include/asm/cmpxchg.h +++ b/arch/arm/include/asm/cmpxchg.h @@ -102,6 +102,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size @@ -1822,10 +1845,18 @@ index f94784f..9a09a4a 100644 extern struct outer_cache_fns outer_cache; diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h -index 4355f0e..c229913 100644 +index 4355f0e..cd9168e 100644 --- a/arch/arm/include/asm/page.h +++ b/arch/arm/include/asm/page.h -@@ -114,7 +114,7 @@ struct cpu_user_fns { +@@ -23,6 +23,7 @@ + + #else + ++#include + #include + + /* +@@ -114,7 +115,7 @@ struct cpu_user_fns { void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr); void (*cpu_copy_user_highpage)(struct page *to, struct page *from, unsigned long vaddr, struct vm_area_struct *vma); @@ -1835,7 +1866,7 @@ index 4355f0e..c229913 100644 #ifdef MULTI_USER extern struct cpu_user_fns cpu_user; diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h -index 943504f..c37a730 100644 +index 78a7793..e3dc06c 100644 --- a/arch/arm/include/asm/pgalloc.h +++ b/arch/arm/include/asm/pgalloc.h @@ -17,6 +17,7 @@ @@ -1866,7 +1897,7 @@ index 943504f..c37a730 100644 #endif /* CONFIG_ARM_LPAE */ -@@ -126,6 +133,19 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte) +@@ -128,6 +135,19 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte) __free_page(pte); } @@ -1886,7 +1917,7 @@ index 943504f..c37a730 100644 static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte, pmdval_t prot) { -@@ -155,7 +175,7 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep) +@@ -157,7 +177,7 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep) static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep) { @@ -1932,7 +1963,7 @@ index 5cfba15..f415e1a 100644 #define PTE_EXT_AP0 (_AT(pteval_t, 1) << 4) #define PTE_EXT_AP1 (_AT(pteval_t, 2) << 4) diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h -index f97ee02..cc9fe9e 100644 +index 86a659a..70e0120 100644 --- a/arch/arm/include/asm/pgtable-2level.h +++ b/arch/arm/include/asm/pgtable-2level.h @@ -126,6 +126,9 @@ @@ -1958,7 +1989,7 @@ index 626989f..9d67a33 100644 /* diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h -index 5689c18..eea12f9 100644 +index 1d15673..04d626a 100644 --- a/arch/arm/include/asm/pgtable-3level.h +++ b/arch/arm/include/asm/pgtable-3level.h @@ -82,6 +82,7 @@ @@ -2070,19 +2101,6 @@ index 1571d12..b8a9b43 100644 pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); return pte; } -diff --git a/arch/arm/include/asm/proc-fns.h b/arch/arm/include/asm/proc-fns.h -index 5324c11..bcae5f0 100644 ---- a/arch/arm/include/asm/proc-fns.h -+++ b/arch/arm/include/asm/proc-fns.h -@@ -75,7 +75,7 @@ extern struct processor { - unsigned int suspend_size; - void (*do_suspend)(void *); - void (*do_resume)(void *); --} processor; -+} __do_const processor; - - #ifndef MULTI_CPU - extern void cpu_proc_init(void); diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h index c4ae171..ea0c0c2 100644 --- a/arch/arm/include/asm/psci.h @@ -2097,10 +2115,10 @@ index c4ae171..ea0c0c2 100644 extern struct psci_operations psci_ops; extern struct smp_operations psci_smp_ops; diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h -index a8cae71c..65dd797 100644 +index 22a3b9b..7f214ee 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h -@@ -110,7 +110,7 @@ struct smp_operations { +@@ -112,7 +112,7 @@ struct smp_operations { int (*cpu_disable)(unsigned int cpu); #endif #endif @@ -2110,7 +2128,7 @@ index a8cae71c..65dd797 100644 /* * set platform specific SMP operations diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h -index df5e13d..97efb82 100644 +index 71a06b2..8bb9ae1 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h @@ -88,9 +88,9 @@ struct thread_info { @@ -2126,7 +2144,7 @@ index df5e13d..97efb82 100644 .restart_block = { \ .fn = do_no_restart_syscall, \ }, \ -@@ -163,7 +163,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, +@@ -157,7 +157,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, #define TIF_SYSCALL_AUDIT 9 #define TIF_SYSCALL_TRACEPOINT 10 #define TIF_SECCOMP 11 /* seccomp syscall filtering active */ @@ -2139,7 +2157,7 @@ index df5e13d..97efb82 100644 #define TIF_USING_IWMMXT 17 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ #define TIF_RESTORE_SIGMASK 20 -@@ -176,10 +180,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, +@@ -170,10 +174,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) #define _TIF_SECCOMP (1 << TIF_SECCOMP) #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) @@ -2153,7 +2171,7 @@ index df5e13d..97efb82 100644 /* * Change these and you break ASM code in entry-common.S diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h -index 72abdc5..9eba222 100644 +index 72abdc5..35acac1 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -18,6 +18,7 @@ @@ -2232,7 +2250,15 @@ index 72abdc5..9eba222 100644 }) #else /* CONFIG_MMU */ -@@ -237,13 +273,17 @@ static inline void set_fs(mm_segment_t fs) +@@ -220,6 +256,7 @@ static inline void set_fs(mm_segment_t fs) + + #endif /* CONFIG_MMU */ + ++#define access_ok_noprefault(type,addr,size) access_ok((type),(addr),(size)) + #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) + + #define user_addr_max() \ +@@ -237,13 +274,17 @@ static inline void set_fs(mm_segment_t fs) #define __get_user(x,ptr) \ ({ \ long __gu_err = 0; \ @@ -2250,7 +2276,7 @@ index 72abdc5..9eba222 100644 (void) 0; \ }) -@@ -319,13 +359,17 @@ do { \ +@@ -319,13 +360,17 @@ do { \ #define __put_user(x,ptr) \ ({ \ long __pu_err = 0; \ @@ -2268,7 +2294,7 @@ index 72abdc5..9eba222 100644 (void) 0; \ }) -@@ -425,11 +469,44 @@ do { \ +@@ -425,11 +470,44 @@ do { \ #ifdef CONFIG_MMU @@ -2316,7 +2342,7 @@ index 72abdc5..9eba222 100644 #else #define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) #define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) -@@ -438,6 +515,9 @@ extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned l +@@ -438,6 +516,9 @@ extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned l static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) { @@ -2326,7 +2352,7 @@ index 72abdc5..9eba222 100644 if (access_ok(VERIFY_READ, from, n)) n = __copy_from_user(to, from, n); else /* security hole - plug it */ -@@ -447,6 +527,9 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __u +@@ -447,6 +528,9 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __u static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n) { @@ -2350,7 +2376,7 @@ 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 60d3b73..e5a0f22 100644 +index 1f031dd..d9b5e4a 100644 --- a/arch/arm/kernel/armksyms.c +++ b/arch/arm/kernel/armksyms.c @@ -53,7 +53,7 @@ EXPORT_SYMBOL(arm_delay_ops); @@ -2376,7 +2402,7 @@ index 60d3b73..e5a0f22 100644 EXPORT_SYMBOL(__get_user_1); EXPORT_SYMBOL(__get_user_2); diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S -index ec3e5cf..b450ee3 100644 +index b3fb8c9..59cfab2 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -47,6 +47,87 @@ @@ -2525,10 +2551,10 @@ index ec3e5cf..b450ee3 100644 + pax_open_userland 1: ldrt r0, [r4] + pax_close_userland - #ifdef CONFIG_CPU_ENDIAN_BE8 - rev r0, r0 @ little endian instruction - #endif -@@ -451,10 +550,14 @@ __und_usr_thumb: + ARM_BE8(rev r0, r0) @ little endian instruction + + @ r0 = 32-bit ARM instruction which caused the exception +@@ -450,10 +549,14 @@ __und_usr_thumb: */ .arch armv6t2 #endif @@ -2543,7 +2569,7 @@ index ec3e5cf..b450ee3 100644 add r2, r2, #2 @ r2 is PC + 2, make it PC + 4 str r2, [sp, #S_PC] @ it's a 2x16bit instr, update orr r0, r0, r5, lsl #16 -@@ -483,7 +586,8 @@ ENDPROC(__und_usr) +@@ -482,7 +585,8 @@ ENDPROC(__und_usr) */ .pushsection .fixup, "ax" .align 2 @@ -2553,7 +2579,7 @@ index ec3e5cf..b450ee3 100644 .popsection .pushsection __ex_table,"a" .long 1b, 4b -@@ -693,7 +797,7 @@ ENTRY(__switch_to) +@@ -692,7 +796,7 @@ ENTRY(__switch_to) THUMB( str lr, [ip], #4 ) ldr r4, [r2, #TI_TP_VALUE] ldr r5, [r2, #TI_TP_VALUE + 4] @@ -2562,7 +2588,7 @@ index ec3e5cf..b450ee3 100644 ldr r6, [r2, #TI_CPU_DOMAIN] #endif switch_tls r1, r4, r5, r3, r7 -@@ -702,7 +806,7 @@ ENTRY(__switch_to) +@@ -701,7 +805,7 @@ ENTRY(__switch_to) ldr r8, =__stack_chk_guard ldr r7, [r7, #TSK_STACK_CANARY] #endif @@ -2572,7 +2598,7 @@ index ec3e5cf..b450ee3 100644 #endif mov r5, r0 diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S -index bc6bd96..bd026cb 100644 +index a2dcafd..1048b5a 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -10,18 +10,46 @@ @@ -2625,7 +2651,7 @@ index bc6bd96..bd026cb 100644 .align 5 /* * This is the fast syscall return path. We do as little as -@@ -413,6 +441,12 @@ ENTRY(vector_swi) +@@ -411,6 +439,12 @@ ENTRY(vector_swi) USER( ldr scno, [lr, #-4] ) @ get SWI instruction #endif @@ -2739,7 +2765,7 @@ index 918875d..cd5fa27 100644 flush_icache_range((unsigned long)base + offset, offset + length); diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S -index 476de57..4857a76 100644 +index 32f317e..710ae07 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -52,7 +52,9 @@ @@ -2753,7 +2779,7 @@ index 476de57..4857a76 100644 .endm /* -@@ -432,7 +434,7 @@ __enable_mmu: +@@ -436,7 +438,7 @@ __enable_mmu: mov r5, #(domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \ domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \ @@ -2763,10 +2789,10 @@ index 476de57..4857a76 100644 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer #endif diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c -index 084dc88..fce4e68 100644 +index 45e4781..8eac93d 100644 --- a/arch/arm/kernel/module.c +++ b/arch/arm/kernel/module.c -@@ -37,12 +37,39 @@ +@@ -38,12 +38,39 @@ #endif #ifdef CONFIG_MMU @@ -2776,8 +2802,8 @@ index 084dc88..fce4e68 100644 + if (!size || PAGE_ALIGN(size) > MODULES_END - MODULES_VADDR) + return NULL; return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, -- GFP_KERNEL, PAGE_KERNEL_EXEC, -1, -+ GFP_KERNEL, prot, -1, +- GFP_KERNEL, PAGE_KERNEL_EXEC, NUMA_NO_NODE, ++ GFP_KERNEL, prot, NUMA_NO_NODE, __builtin_return_address(0)); } + @@ -2965,10 +2991,10 @@ index 0dd3b79..e018f64 100644 if (secure_computing(scno) == -1) return -1; diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c -index 0e1e2b3..c0e821d 100644 +index 987a7f5..ab0c397 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c -@@ -98,21 +98,23 @@ EXPORT_SYMBOL(system_serial_high); +@@ -100,21 +100,23 @@ EXPORT_SYMBOL(system_serial_high); unsigned int elf_hwcap __read_mostly; EXPORT_SYMBOL(elf_hwcap); @@ -2977,7 +3003,7 @@ index 0e1e2b3..c0e821d 100644 #ifdef MULTI_CPU -struct processor processor __read_mostly; -+struct processor processor; ++struct processor processor __read_only; #endif #ifdef MULTI_TLB -struct cpu_tlb_fns cpu_tlb __read_mostly; @@ -2997,7 +3023,7 @@ index 0e1e2b3..c0e821d 100644 EXPORT_SYMBOL(outer_cache); #endif -@@ -245,9 +247,13 @@ static int __get_cpu_architecture(void) +@@ -247,9 +249,13 @@ static int __get_cpu_architecture(void) asm("mrc p15, 0, %0, c0, c1, 4" : "=r" (mmfr0)); if ((mmfr0 & 0x0000000f) >= 0x00000003 || @@ -3013,29 +3039,20 @@ index 0e1e2b3..c0e821d 100644 (mmfr0 & 0x000000f0) == 0x00000020) cpu_arch = CPU_ARCH_ARMv6; else -@@ -571,7 +577,7 @@ static void __init setup_processor(void) - __cpu_architecture = __get_cpu_architecture(); - - #ifdef MULTI_CPU -- processor = *list->proc; -+ memcpy((void *)&processor, list->proc, sizeof processor); - #endif - #ifdef MULTI_TLB - cpu_tlb = *list->tlb; diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c -index ab33042..11248a8 100644 +index 04d6388..5115238 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c -@@ -45,8 +45,6 @@ static const unsigned long sigreturn_codes[7] = { - MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN, - }; +@@ -23,8 +23,6 @@ + + extern const unsigned long sigreturn_codes[7]; -static unsigned long signal_return_offset; - #ifdef CONFIG_CRUNCH static int preserve_crunch_context(struct crunch_sigframe __user *frame) { -@@ -411,8 +409,7 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig, +@@ -395,8 +393,7 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig, * except when the MPU has protected the vectors * page from PL0 */ @@ -3045,7 +3062,7 @@ index ab33042..11248a8 100644 } else #endif { -@@ -616,33 +613,3 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) +@@ -600,33 +597,3 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) } while (thread_flags & _TIF_WORK_MASK); return 0; } @@ -3080,10 +3097,10 @@ index ab33042..11248a8 100644 - return page; -} diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c -index 72024ea..ae302dd 100644 +index dc894ab..f929a0d 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c -@@ -70,7 +70,7 @@ enum ipi_msg_type { +@@ -73,7 +73,7 @@ enum ipi_msg_type { static DECLARE_COMPLETION(cpu_running); @@ -3093,10 +3110,10 @@ index 72024ea..ae302dd 100644 void __init smp_set_ops(struct smp_operations *ops) { diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c -index 1f735aa..08af6f7 100644 +index 4636d56..ce4ec3d 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c -@@ -61,7 +61,7 @@ static void dump_mem(const char *, const char *, unsigned long, unsigned long); +@@ -62,7 +62,7 @@ static void dump_mem(const char *, const char *, unsigned long, unsigned long); void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame) { #ifdef CONFIG_KALLSYMS @@ -3105,7 +3122,7 @@ index 1f735aa..08af6f7 100644 #else printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); #endif -@@ -263,6 +263,8 @@ static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; +@@ -264,6 +264,8 @@ static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; static int die_owner = -1; static unsigned int die_nest_count; @@ -3114,7 +3131,7 @@ index 1f735aa..08af6f7 100644 static unsigned long oops_begin(void) { int cpu; -@@ -305,6 +307,9 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, int signr) +@@ -306,6 +308,9 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, int signr) panic("Fatal exception in interrupt"); if (panic_on_oops) panic("Fatal exception"); @@ -3124,7 +3141,7 @@ index 1f735aa..08af6f7 100644 if (signr) do_exit(signr); } -@@ -635,7 +640,9 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) +@@ -642,7 +647,9 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) * The user helper at 0xffff0fe0 must be used instead. * (see entry-armv.S for details) */ @@ -3134,7 +3151,7 @@ index 1f735aa..08af6f7 100644 } return 0; -@@ -892,7 +899,11 @@ void __init early_trap_init(void *vectors_base) +@@ -899,7 +906,11 @@ void __init early_trap_init(void *vectors_base) kuser_init(vectors_base); flush_icache_range(vectors, vectors + PAGE_SIZE * 2); @@ -3218,7 +3235,7 @@ index 7bcee5c..e2f3249 100644 __data_loc = .; #endif diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c -index 9c697db..115237f 100644 +index 2a700e0..745b980 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -56,7 +56,7 @@ static unsigned long hyp_default_vectors; @@ -3230,7 +3247,7 @@ index 9c697db..115237f 100644 static u8 kvm_next_vmid; static DEFINE_SPINLOCK(kvm_vmid_lock); -@@ -396,7 +396,7 @@ void force_vm_exit(const cpumask_t *mask) +@@ -397,7 +397,7 @@ void force_vm_exit(const cpumask_t *mask) */ static bool need_new_vmid_gen(struct kvm *kvm) { @@ -3239,7 +3256,7 @@ index 9c697db..115237f 100644 } /** -@@ -429,7 +429,7 @@ static void update_vttbr(struct kvm *kvm) +@@ -430,7 +430,7 @@ static void update_vttbr(struct kvm *kvm) /* First user of a new VMID generation? */ if (unlikely(kvm_next_vmid == 0)) { @@ -3248,7 +3265,7 @@ index 9c697db..115237f 100644 kvm_next_vmid = 1; /* -@@ -446,7 +446,7 @@ static void update_vttbr(struct kvm *kvm) +@@ -447,7 +447,7 @@ static void update_vttbr(struct kvm *kvm) kvm_call_hyp(__kvm_flush_vm_context); } @@ -3382,10 +3399,10 @@ index 5306de3..aed6d03 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 025f742..a9e5b3b 100644 +index 3e58d71..029817c 100644 --- a/arch/arm/lib/uaccess_with_memcpy.c +++ b/arch/arm/lib/uaccess_with_memcpy.c -@@ -104,7 +104,7 @@ out: +@@ -136,7 +136,7 @@ out: } unsigned long @@ -3394,7 +3411,7 @@ index 025f742..a9e5b3b 100644 { /* * This test is stubbed out of the main function above to keep -@@ -155,7 +155,7 @@ out: +@@ -190,7 +190,7 @@ out: return n; } @@ -3404,7 +3421,7 @@ index 025f742..a9e5b3b 100644 /* See rational for this in __copy_to_user() above. */ if (n < 64) diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c -index 1767611..d2e7e24 100644 +index f3407a5..bd4256f 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c @@ -156,7 +156,16 @@ static void clk_gate_fn_disable(struct clk_hw *hw) @@ -3454,7 +3471,7 @@ index 827d1500..2885dc6 100644 }; diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c -index 579697a..1d5a3b2 100644 +index ab43755..ccfa231 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -148,7 +148,6 @@ struct omap3_gpmc_regs { @@ -3523,10 +3540,10 @@ index f991016..145ebeb 100644 .resume = dummy_cpu_resume, .scu_prepare = dummy_scu_prepare, diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c -index 813c615..ce467c6 100644 +index 3664562..72f85c6 100644 --- a/arch/arm/mach-omap2/omap-wakeupgen.c +++ b/arch/arm/mach-omap2/omap-wakeupgen.c -@@ -339,7 +339,7 @@ static int irq_cpu_hotplug_notify(struct notifier_block *self, +@@ -343,7 +343,7 @@ static int irq_cpu_hotplug_notify(struct notifier_block *self, return NOTIFY_OK; } @@ -3536,10 +3553,10 @@ index 813c615..ce467c6 100644 }; diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c -index 53f0735..5b54eb6 100644 +index e0a398c..a470fa5 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) +@@ -508,7 +508,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, @@ -3548,7 +3565,7 @@ index 53f0735..5b54eb6 100644 { struct omap_hwmod *ohs[] = { oh }; -@@ -532,7 +532,7 @@ struct platform_device __init *omap_device_build(const char *pdev_name, +@@ -536,7 +536,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, @@ -3558,10 +3575,10 @@ index 53f0735..5b54eb6 100644 { int ret = -ENOMEM; diff --git a/arch/arm/mach-omap2/omap_device.h b/arch/arm/mach-omap2/omap_device.h -index 17ca1ae..beba869 100644 +index 78c02b3..c94109a 100644 --- a/arch/arm/mach-omap2/omap_device.h +++ b/arch/arm/mach-omap2/omap_device.h -@@ -71,12 +71,12 @@ int omap_device_idle(struct platform_device *pdev); +@@ -72,12 +72,12 @@ int omap_device_idle(struct platform_device *pdev); /* Core code interface */ struct platform_device *omap_device_build(const char *pdev_name, int pdev_id, @@ -3577,7 +3594,7 @@ index 17ca1ae..beba869 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 832adb1..49b62c4 100644 +index 8a1b5e0..5f30074 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -194,10 +194,10 @@ struct omap_hwmod_soc_ops { @@ -3593,6 +3610,29 @@ index 832adb1..49b62c4 100644 /* omap_hwmod_list contains all registered struct omap_hwmods */ static LIST_HEAD(omap_hwmod_list); +diff --git a/arch/arm/mach-omap2/powerdomains43xx_data.c b/arch/arm/mach-omap2/powerdomains43xx_data.c +index 95fee54..cfa9cf1 100644 +--- a/arch/arm/mach-omap2/powerdomains43xx_data.c ++++ b/arch/arm/mach-omap2/powerdomains43xx_data.c +@@ -10,6 +10,7 @@ + + #include + #include ++#include + + #include "powerdomain.h" + +@@ -129,7 +130,9 @@ static int am43xx_check_vcvp(void) + + void __init am43xx_powerdomains_init(void) + { +- omap4_pwrdm_operations.pwrdm_has_voltdm = am43xx_check_vcvp; ++ pax_open_kernel(); ++ *(void **)&omap4_pwrdm_operations.pwrdm_has_voltdm = am43xx_check_vcvp; ++ pax_close_kernel(); + pwrdm_register_platform_funcs(&omap4_pwrdm_operations); + pwrdm_register_pwrdms(powerdomains_am43xx); + pwrdm_complete_init(); diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c index d15c7bb..b2d1f0c 100644 --- a/arch/arm/mach-omap2/wd_timer.c @@ -3631,10 +3671,10 @@ index b82dcae..44ee5b6 100644 cpuidle_coupled_parallel_barrier(dev, &abort_barrier); diff --git a/arch/arm/mach-ux500/setup.h b/arch/arm/mach-ux500/setup.h -index 656324a..0beba28 100644 +index bdb3564..cebb96f 100644 --- a/arch/arm/mach-ux500/setup.h +++ b/arch/arm/mach-ux500/setup.h -@@ -40,13 +40,6 @@ extern void ux500_timer_init(void); +@@ -39,13 +39,6 @@ extern void ux500_timer_init(void); .type = MT_DEVICE, \ } @@ -3649,7 +3689,7 @@ index 656324a..0beba28 100644 extern void ux500_cpu_die(unsigned int cpu); diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig -index cd2c88e..4dd9b67 100644 +index 1f8fed9..14d7823 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -446,7 +446,7 @@ config CPU_32v5 @@ -3687,10 +3727,10 @@ index cd2c88e..4dd9b67 100644 If all of the binaries and libraries which run on your platform diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c -index 6f4585b..7b6f52b 100644 +index 9240364..a2b8cf3 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c -@@ -211,10 +211,12 @@ union offset_union { +@@ -212,10 +212,12 @@ union offset_union { #define __get16_unaligned_check(ins,val,addr) \ do { \ unsigned int err = 0, v, a = addr; \ @@ -3703,7 +3743,7 @@ index 6f4585b..7b6f52b 100644 if (err) \ goto fault; \ } while (0) -@@ -228,6 +230,7 @@ union offset_union { +@@ -229,6 +231,7 @@ union offset_union { #define __get32_unaligned_check(ins,val,addr) \ do { \ unsigned int err = 0, v, a = addr; \ @@ -3711,7 +3751,7 @@ index 6f4585b..7b6f52b 100644 __get8_unaligned_check(ins,v,a,err); \ val = v << ((BE) ? 24 : 0); \ __get8_unaligned_check(ins,v,a,err); \ -@@ -236,6 +239,7 @@ union offset_union { +@@ -237,6 +240,7 @@ union offset_union { val |= v << ((BE) ? 8 : 16); \ __get8_unaligned_check(ins,v,a,err); \ val |= v << ((BE) ? 0 : 24); \ @@ -3719,7 +3759,7 @@ index 6f4585b..7b6f52b 100644 if (err) \ goto fault; \ } while (0) -@@ -249,6 +253,7 @@ union offset_union { +@@ -250,6 +254,7 @@ union offset_union { #define __put16_unaligned_check(ins,val,addr) \ do { \ unsigned int err = 0, v = val, a = addr; \ @@ -3727,7 +3767,7 @@ index 6f4585b..7b6f52b 100644 __asm__( FIRST_BYTE_16 \ ARM( "1: "ins" %1, [%2], #1\n" ) \ THUMB( "1: "ins" %1, [%2]\n" ) \ -@@ -268,6 +273,7 @@ union offset_union { +@@ -269,6 +274,7 @@ union offset_union { " .popsection\n" \ : "=r" (err), "=&r" (v), "=&r" (a) \ : "0" (err), "1" (v), "2" (a)); \ @@ -3735,7 +3775,7 @@ index 6f4585b..7b6f52b 100644 if (err) \ goto fault; \ } while (0) -@@ -281,6 +287,7 @@ union offset_union { +@@ -282,6 +288,7 @@ union offset_union { #define __put32_unaligned_check(ins,val,addr) \ do { \ unsigned int err = 0, v = val, a = addr; \ @@ -3743,7 +3783,7 @@ index 6f4585b..7b6f52b 100644 __asm__( FIRST_BYTE_32 \ ARM( "1: "ins" %1, [%2], #1\n" ) \ THUMB( "1: "ins" %1, [%2]\n" ) \ -@@ -310,6 +317,7 @@ union offset_union { +@@ -311,6 +318,7 @@ union offset_union { " .popsection\n" \ : "=r" (err), "=&r" (v), "=&r" (a) \ : "0" (err), "1" (v), "2" (a)); \ @@ -4057,7 +4097,7 @@ index cf08bdf..772656c 100644 unsigned long search_exception_table(unsigned long addr); diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c -index 18ec4c5..479bb6a 100644 +index 3e8f106..a0a1fe4 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -30,6 +30,8 @@ @@ -4069,7 +4109,7 @@ index 18ec4c5..479bb6a 100644 #include #include -@@ -684,7 +686,46 @@ void free_initmem(void) +@@ -681,7 +683,46 @@ void free_initmem(void) { #ifdef CONFIG_HAVE_TCM extern char __tcm_start, __tcm_end; @@ -4133,7 +4173,7 @@ index f123d6e..04bf569 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 304661d..53a6b19 100644 +index 5e85ed3..b10a7ed 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, @@ -4244,10 +4284,10 @@ index 304661d..53a6b19 100644 } } diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c -index b1d17ee..7a6f4d3 100644 +index 911d433..8580952 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c -@@ -36,6 +36,22 @@ +@@ -38,6 +38,22 @@ #include "mm.h" #include "tcm.h" @@ -4270,12 +4310,13 @@ index b1d17ee..7a6f4d3 100644 /* * empty_zero_page is a special page that is used for * zero-initialized data and COW. -@@ -228,10 +244,18 @@ __setup("noalign", noalign_setup); +@@ -230,11 +246,19 @@ __setup("noalign", noalign_setup); #endif /* ifdef CONFIG_CPU_CP15 / else */ -#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN +#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY + #define PROT_PTE_S2_DEVICE PROT_PTE_DEVICE #define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE -static struct mem_type mem_types[] = { @@ -4291,7 +4332,7 @@ index b1d17ee..7a6f4d3 100644 [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */ .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED | L_PTE_SHARED, -@@ -260,16 +284,16 @@ static struct mem_type mem_types[] = { +@@ -266,16 +290,16 @@ static struct mem_type mem_types[] = { [MT_UNCACHED] = { .prot_pte = PROT_PTE_DEVICE, .prot_l1 = PMD_TYPE_TABLE, @@ -4311,7 +4352,7 @@ index b1d17ee..7a6f4d3 100644 .domain = DOMAIN_KERNEL, }, #endif -@@ -277,36 +301,54 @@ static struct mem_type mem_types[] = { +@@ -283,36 +307,54 @@ static struct mem_type mem_types[] = { .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_RDONLY, .prot_l1 = PMD_TYPE_TABLE, @@ -4374,7 +4415,7 @@ index b1d17ee..7a6f4d3 100644 .domain = DOMAIN_KERNEL, }, [MT_MEMORY_ITCM] = { -@@ -316,10 +358,10 @@ static struct mem_type mem_types[] = { +@@ -322,10 +364,10 @@ static struct mem_type mem_types[] = { }, [MT_MEMORY_SO] = { .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | @@ -4387,7 +4428,7 @@ index b1d17ee..7a6f4d3 100644 .domain = DOMAIN_KERNEL, }, [MT_MEMORY_DMA_READY] = { -@@ -405,9 +447,35 @@ static void __init build_mem_type_table(void) +@@ -411,9 +453,35 @@ static void __init build_mem_type_table(void) * to prevent speculative instruction fetches. */ mem_types[MT_DEVICE].prot_sect |= PMD_SECT_XN; @@ -4423,7 +4464,7 @@ index b1d17ee..7a6f4d3 100644 } if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) { /* -@@ -468,6 +536,9 @@ static void __init build_mem_type_table(void) +@@ -475,6 +543,9 @@ static void __init build_mem_type_table(void) * from SVC mode and no access from userspace. */ mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; @@ -4433,7 +4474,7 @@ index b1d17ee..7a6f4d3 100644 mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; #endif -@@ -485,11 +556,17 @@ static void __init build_mem_type_table(void) +@@ -492,11 +563,17 @@ static void __init build_mem_type_table(void) mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED; mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S; mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED; @@ -4455,7 +4496,7 @@ index b1d17ee..7a6f4d3 100644 } } -@@ -500,15 +577,20 @@ static void __init build_mem_type_table(void) +@@ -507,15 +584,20 @@ static void __init build_mem_type_table(void) if (cpu_arch >= CPU_ARCH_ARMv6) { if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) { /* Non-cacheable Normal is XCB = 001 */ @@ -4479,7 +4520,7 @@ index b1d17ee..7a6f4d3 100644 } #ifdef CONFIG_ARM_LPAE -@@ -524,6 +606,8 @@ static void __init build_mem_type_table(void) +@@ -531,6 +613,8 @@ static void __init build_mem_type_table(void) vecs_pgprot |= PTE_EXT_AF; #endif @@ -4488,7 +4529,7 @@ index b1d17ee..7a6f4d3 100644 for (i = 0; i < 16; i++) { pteval_t v = pgprot_val(protection_map[i]); protection_map[i] = __pgprot(v | user_pgprot); -@@ -541,10 +625,15 @@ static void __init build_mem_type_table(void) +@@ -548,10 +632,15 @@ static void __init build_mem_type_table(void) mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; @@ -4507,7 +4548,7 @@ index b1d17ee..7a6f4d3 100644 mem_types[MT_ROM].prot_sect |= cp->pmd; switch (cp->pmd) { -@@ -1186,18 +1275,15 @@ void __init arm_mm_memblock_reserve(void) +@@ -1193,18 +1282,15 @@ void __init arm_mm_memblock_reserve(void) * called function. This means you can't use any function or debugging * method which may touch any device, otherwise the kernel _will_ crash. */ @@ -4530,7 +4571,7 @@ index b1d17ee..7a6f4d3 100644 for (addr = VMALLOC_START; addr; addr += PMD_SIZE) pmd_clear(pmd_off_k(addr)); -@@ -1237,7 +1323,7 @@ static void __init devicemaps_init(const struct machine_desc *mdesc) +@@ -1244,7 +1330,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. */ @@ -4539,7 +4580,7 @@ index b1d17ee..7a6f4d3 100644 map.virtual = 0xffff0000; map.length = PAGE_SIZE; #ifdef CONFIG_KUSER_HELPERS -@@ -1309,8 +1395,39 @@ static void __init map_lowmem(void) +@@ -1316,8 +1402,39 @@ static void __init map_lowmem(void) map.pfn = __phys_to_pfn(start); map.virtual = __phys_to_virt(start); map.length = end - start; @@ -4580,24 +4621,6 @@ index b1d17ee..7a6f4d3 100644 create_mapping(&map); } } -diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c -index 99b44e0..8c9106f 100644 ---- a/arch/arm/net/bpf_jit_32.c -+++ b/arch/arm/net/bpf_jit_32.c -@@ -637,10 +637,10 @@ load_ind: - emit(ARM_MUL(r_A, r_A, r_X), ctx); - break; - case BPF_S_ALU_DIV_K: -- /* current k == reciprocal_value(userspace k) */ -+ if (k == 1) -+ break; - emit_mov_i(r_scratch, k, ctx); -- /* A = top 32 bits of the product */ -- emit(ARM_UMULL(r_scratch, r_A, r_A, r_scratch), ctx); -+ emit_udiv(r_A, r_A, r_scratch, ctx); - break; - case BPF_S_ALU_DIV_X: - update_on_xread(ctx); diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index a5bc92d..0bb4730 100644 --- a/arch/arm/plat-omap/sram.c @@ -4624,6 +4647,18 @@ index ce6d763..cfea917 100644 extern void *samsung_dmadev_get_ops(void); extern void *s3c_dma_get_ops(void); +diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h +index 7ecc2b2..5e56c66 100644 +--- a/arch/arm64/include/asm/uaccess.h ++++ b/arch/arm64/include/asm/uaccess.h +@@ -99,6 +99,7 @@ static inline void set_fs(mm_segment_t fs) + flag; \ + }) + ++#define access_ok_noprefault(type, addr, size) access_ok((type), (addr), (size)) + #define access_ok(type, addr, size) __range_ok(addr, size) + + /* diff --git a/arch/avr32/include/asm/cache.h b/arch/avr32/include/asm/cache.h index c3a58a1..78fbf54 100644 --- a/arch/avr32/include/asm/cache.h @@ -4874,7 +4909,7 @@ index f4ca594..adc72fd6 100644 #define __cacheline_aligned __aligned(L1_CACHE_BYTES) #define ____cacheline_aligned __aligned(L1_CACHE_BYTES) diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig -index 7740ab1..17fa8c5 100644 +index 4e4119b..dd7de0a 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -554,6 +554,7 @@ source "drivers/sn/Kconfig" @@ -4946,7 +4981,7 @@ index 5a83c5c..4d7f553 100644 /* IA-64 relocations: */ diff --git a/arch/ia64/include/asm/pgalloc.h b/arch/ia64/include/asm/pgalloc.h -index 96a8d92..617a1cf 100644 +index 5767cdf..7462574 100644 --- a/arch/ia64/include/asm/pgalloc.h +++ b/arch/ia64/include/asm/pgalloc.h @@ -39,6 +39,12 @@ pgd_populate(struct mm_struct *mm, pgd_t * pgd_entry, pud_t * pud) @@ -5020,10 +5055,18 @@ index 45698cd..e8e2dbc 100644 static __always_inline void __ticket_spin_unlock_wait(arch_spinlock_t *lock) diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h -index 449c8c0..18965fb 100644 +index 449c8c0..3d4b1e9 100644 --- a/arch/ia64/include/asm/uaccess.h +++ b/arch/ia64/include/asm/uaccess.h -@@ -240,12 +240,24 @@ extern unsigned long __must_check __copy_user (void __user *to, const void __use +@@ -70,6 +70,7 @@ + && ((segment).seg == KERNEL_DS.seg \ + || likely(REGION_OFFSET((unsigned long) (addr)) < RGN_MAP_LIMIT))); \ + }) ++#define access_ok_noprefault(type, addr, size) access_ok((type), (addr), (size)) + #define access_ok(type, addr, size) __access_ok((addr), (size), get_fs()) + + /* +@@ -240,12 +241,24 @@ extern unsigned long __must_check __copy_user (void __user *to, const void __use static inline unsigned long __copy_to_user (void __user *to, const void *from, unsigned long count) { @@ -5048,7 +5091,7 @@ index 449c8c0..18965fb 100644 return __copy_user((__force void __user *) to, from, count); } -@@ -255,10 +267,13 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) +@@ -255,10 +268,13 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) ({ \ void __user *__cu_to = (to); \ const void *__cu_from = (from); \ @@ -5064,7 +5107,7 @@ index 449c8c0..18965fb 100644 __cu_len; \ }) -@@ -266,11 +281,14 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) +@@ -266,11 +282,14 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) ({ \ void *__cu_to = (to); \ const void __user *__cu_from = (from); \ @@ -5305,7 +5348,7 @@ index 68232db..6ca80af 100644 } diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c -index b6f7f43..c04320d 100644 +index 88504ab..cbb6c9f 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -120,6 +120,19 @@ ia64_init_addr_space (void) @@ -5416,10 +5459,10 @@ index 4efe96a..60e8699 100644 #define SMP_CACHE_BYTES L1_CACHE_BYTES diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig -index f75ab4a..adc6968 100644 +index 650de39..6982b02 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2283,6 +2283,7 @@ source "kernel/Kconfig.preempt" +@@ -2268,6 +2268,7 @@ source "kernel/Kconfig.preempt" config KEXEC bool "Kexec system call" @@ -5427,8 +5470,21 @@ index f75ab4a..adc6968 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 +diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c +index 02f2444..506969c 100644 +--- a/arch/mips/cavium-octeon/dma-octeon.c ++++ b/arch/mips/cavium-octeon/dma-octeon.c +@@ -199,7 +199,7 @@ static void octeon_dma_free_coherent(struct device *dev, size_t size, + if (dma_release_from_coherent(dev, order, vaddr)) + return; + +- swiotlb_free_coherent(dev, size, vaddr, dma_handle); ++ swiotlb_free_coherent(dev, size, vaddr, dma_handle, attrs); + } + + static dma_addr_t octeon_unity_phys_to_dma(struct device *dev, phys_addr_t paddr) diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h -index 08b6079..8b554d2 100644 +index 7eed2f2..c4e385d 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h @@ -21,15 +21,39 @@ @@ -6352,10 +6408,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 cf3ae24..238d22f 100644 +index a66359e..d3d474a 100644 --- a/arch/mips/include/asm/elf.h +++ b/arch/mips/include/asm/elf.h -@@ -372,13 +372,16 @@ extern const char *__elf_platform; +@@ -373,13 +373,16 @@ extern const char *__elf_platform; #define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2) #endif @@ -6388,6 +6444,77 @@ index c1f6afa..38cc6e9 100644 +#define arch_align_stack(x) ((x) & ~0xfUL) #endif /* _ASM_EXEC_H */ +diff --git a/arch/mips/include/asm/ftrace.h b/arch/mips/include/asm/ftrace.h +index ce35c9a..434321c 100644 +--- a/arch/mips/include/asm/ftrace.h ++++ b/arch/mips/include/asm/ftrace.h +@@ -22,12 +22,12 @@ extern void _mcount(void); + #define safe_load(load, src, dst, error) \ + do { \ + asm volatile ( \ +- "1: " load " %[" STR(dst) "], 0(%[" STR(src) "])\n"\ +- " li %[" STR(error) "], 0\n" \ ++ "1: " load " %[dest], 0(%[source])\n" \ ++ " li %[err], 0\n" \ + "2:\n" \ + \ + ".section .fixup, \"ax\"\n" \ +- "3: li %[" STR(error) "], 1\n" \ ++ "3: li %[err], 1\n" \ + " j 2b\n" \ + ".previous\n" \ + \ +@@ -35,8 +35,8 @@ do { \ + STR(PTR) "\t1b, 3b\n\t" \ + ".previous\n" \ + \ +- : [dst] "=&r" (dst), [error] "=r" (error)\ +- : [src] "r" (src) \ ++ : [dest] "=&r" (dst), [err] "=r" (error)\ ++ : [source] "r" (src) \ + : "memory" \ + ); \ + } while (0) +@@ -44,12 +44,12 @@ do { \ + #define safe_store(store, src, dst, error) \ + do { \ + asm volatile ( \ +- "1: " store " %[" STR(src) "], 0(%[" STR(dst) "])\n"\ +- " li %[" STR(error) "], 0\n" \ ++ "1: " store " %[source], 0(%[dest])\n"\ ++ " li %[err], 0\n" \ + "2:\n" \ + \ + ".section .fixup, \"ax\"\n" \ +- "3: li %[" STR(error) "], 1\n" \ ++ "3: li %[err], 1\n" \ + " j 2b\n" \ + ".previous\n" \ + \ +@@ -57,8 +57,8 @@ do { \ + STR(PTR) "\t1b, 3b\n\t" \ + ".previous\n" \ + \ +- : [error] "=r" (error) \ +- : [dst] "r" (dst), [src] "r" (src)\ ++ : [err] "=r" (error) \ ++ : [dest] "r" (dst), [source] "r" (src)\ + : "memory" \ + ); \ + } while (0) +diff --git a/arch/mips/include/asm/hw_irq.h b/arch/mips/include/asm/hw_irq.h +index 9e8ef59..1139d6b 100644 +--- a/arch/mips/include/asm/hw_irq.h ++++ b/arch/mips/include/asm/hw_irq.h +@@ -10,7 +10,7 @@ + + #include + +-extern atomic_t irq_err_count; ++extern atomic_unchecked_t irq_err_count; + + /* + * interrupt-retrigger: NOP for now. This may not be appropriate for all diff --git a/arch/mips/include/asm/local.h b/arch/mips/include/asm/local.h index d44622c..64990d2 100644 --- a/arch/mips/include/asm/local.h @@ -6493,7 +6620,7 @@ index f6be474..12ad554 100644 typedef struct { unsigned long long pte; } pte_t; #define pte_val(x) ((x).pte) diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h -index 881d18b..cea38bc 100644 +index b336037..5b874cc 100644 --- a/arch/mips/include/asm/pgalloc.h +++ b/arch/mips/include/asm/pgalloc.h @@ -37,6 +37,11 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) @@ -6508,6 +6635,20 @@ index 881d18b..cea38bc 100644 #endif /* +diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h +index 008324d..f67c239 100644 +--- a/arch/mips/include/asm/pgtable.h ++++ b/arch/mips/include/asm/pgtable.h +@@ -20,6 +20,9 @@ + #include + #include + ++#define ktla_ktva(addr) (addr) ++#define ktva_ktla(addr) (addr) ++ + struct mm_struct; + struct vm_area_struct; + diff --git a/arch/mips/include/asm/smtc_proc.h b/arch/mips/include/asm/smtc_proc.h index 25da651..ae2a259 100644 --- a/arch/mips/include/asm/smtc_proc.h @@ -6520,43 +6661,99 @@ index 25da651..ae2a259 100644 +extern atomic_unchecked_t smtc_fpu_recoveries; #endif /* __ASM_SMTC_PROC_H */ +diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h +index 81c8913..81d8432 100644 +--- a/arch/mips/include/asm/syscall.h ++++ b/arch/mips/include/asm/syscall.h +@@ -29,7 +29,7 @@ static inline long syscall_get_nr(struct task_struct *task, + static inline unsigned long mips_get_syscall_arg(unsigned long *arg, + struct task_struct *task, struct pt_regs *regs, unsigned int n) + { +- unsigned long usp = regs->regs[29]; ++ unsigned long usp __maybe_unused = regs->regs[29]; + + switch (n) { + case 0: case 1: case 2: case 3: +@@ -39,14 +39,14 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg, + + #ifdef CONFIG_32BIT + case 4: case 5: case 6: case 7: +- return get_user(*arg, (int *)usp + 4 * n); ++ return get_user(*arg, (int *)usp + n); + #endif + + #ifdef CONFIG_64BIT + case 4: case 5: case 6: case 7: + #ifdef CONFIG_MIPS32_O32 + if (test_thread_flag(TIF_32BIT_REGS)) +- return get_user(*arg, (int *)usp + 4 * n); ++ return get_user(*arg, (int *)usp + n); + else + #endif + *arg = regs->regs[4 + n]; +@@ -83,11 +83,10 @@ static inline void syscall_get_arguments(struct task_struct *task, + unsigned int i, unsigned int n, + unsigned long *args) + { +- unsigned long arg; + int ret; + + while (n--) +- ret |= mips_get_syscall_arg(&arg, task, regs, i++); ++ ret |= mips_get_syscall_arg(args++, task, regs, i++); + + /* + * No way to communicate an error because this is a void function. diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h -index 61215a3..213ee0e 100644 +index 4f58ef6..5e7081b 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h -@@ -116,6 +116,8 @@ static inline struct thread_info *current_thread_info(void) - #define TIF_32BIT_ADDR 23 /* 32-bit address space (o32/n32) */ +@@ -115,6 +115,8 @@ static inline struct thread_info *current_thread_info(void) #define TIF_FPUBOUND 24 /* thread bound to FPU-full CPU set */ #define TIF_LOAD_WATCH 25 /* If set, load watch registers */ + #define TIF_SYSCALL_TRACEPOINT 26 /* syscall tracepoint instrumentation */ +/* li takes a 32bit immediate */ +#define TIF_GRSEC_SETXID 29 /* update credentials on syscall entry/exit */ #define TIF_SYSCALL_TRACE 31 /* syscall trace active */ #define _TIF_SYSCALL_TRACE (1< /* +diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c +index 185ba25..374ed74 100644 +--- a/arch/mips/kernel/ftrace.c ++++ b/arch/mips/kernel/ftrace.c +@@ -111,11 +111,10 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1, + safe_store_code(new_code1, ip, faulted); + if (unlikely(faulted)) + return -EFAULT; +- ip += 4; +- safe_store_code(new_code2, ip, faulted); ++ safe_store_code(new_code2, ip + 4, faulted); + if (unlikely(faulted)) + return -EFAULT; +- flush_icache_range(ip, ip + 8); /* original ip + 12 */ ++ flush_icache_range(ip, ip + 8); + return 0; + } + #endif +diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c +index 2b91fe8..fe4f6b4 100644 +--- a/arch/mips/kernel/i8259.c ++++ b/arch/mips/kernel/i8259.c +@@ -205,7 +205,7 @@ spurious_8259A_irq: + printk(KERN_DEBUG "spurious 8259A interrupt: IRQ%d.\n", irq); + spurious_irq_mask |= irqmask; + } +- atomic_inc(&irq_err_count); ++ atomic_inc_unchecked(&irq_err_count); + /* + * Theoretically we do not have to handle this IRQ, + * but in Linux this does not cause problems and is +diff --git a/arch/mips/kernel/irq-gt641xx.c b/arch/mips/kernel/irq-gt641xx.c +index 44a1f79..2bd6aa3 100644 +--- a/arch/mips/kernel/irq-gt641xx.c ++++ b/arch/mips/kernel/irq-gt641xx.c +@@ -110,7 +110,7 @@ void gt641xx_irq_dispatch(void) + } + } + +- atomic_inc(&irq_err_count); ++ atomic_inc_unchecked(&irq_err_count); + } + + void __init gt641xx_irq_init(void) diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index d1fea7a..45602ea 100644 --- a/arch/mips/kernel/irq.c @@ -6640,11 +6881,11 @@ index ddc7610..8c58f17 100644 - return sp & ALMASK; -} diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c -index 8ae1ebe..1bcbf47 100644 +index b52e1d2..1a3ca09 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c -@@ -529,6 +529,10 @@ static inline int audit_arch(void) - return arch; +@@ -652,6 +652,10 @@ long arch_ptrace(struct task_struct *child, long request, + return ret; } +#ifdef CONFIG_GRKERNSEC_SETXID @@ -6654,18 +6895,50 @@ index 8ae1ebe..1bcbf47 100644 /* * Notification of system call entry/exit * - triggered by current->work.syscall_trace -@@ -540,6 +544,11 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs) - /* do the secure computing check first */ - secure_computing_strict(regs->regs[2]); +@@ -668,6 +672,11 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs) + tracehook_report_syscall_entry(regs)) + ret = -1; +#ifdef CONFIG_GRKERNSEC_SETXID + if (unlikely(test_and_clear_thread_flag(TIF_GRSEC_SETXID))) + gr_delayed_cred_worker(); +#endif + - if (!(current->ptrace & PT_PTRACED)) - goto out; + if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) + trace_sys_enter(regs, regs->regs[2]); +diff --git a/arch/mips/kernel/reset.c b/arch/mips/kernel/reset.c +index 07fc524..b9d7f28 100644 +--- a/arch/mips/kernel/reset.c ++++ b/arch/mips/kernel/reset.c +@@ -13,6 +13,7 @@ + #include + + #include ++#include + + /* + * Urgs ... Too many MIPS machines to handle this in a generic way. +@@ -29,16 +30,19 @@ void machine_restart(char *command) + { + if (_machine_restart) + _machine_restart(command); ++ BUG(); + } + + void machine_halt(void) + { + if (_machine_halt) + _machine_halt(); ++ BUG(); + } + + void machine_power_off(void) + { + if (pm_power_off) + pm_power_off(); ++ BUG(); + } diff --git a/arch/mips/kernel/smtc-proc.c b/arch/mips/kernel/smtc-proc.c index c10aa84..9ec2e60 100644 --- a/arch/mips/kernel/smtc-proc.c @@ -6780,10 +7053,10 @@ index 84536bf..79caa4d 100644 } /* Arrange for an interrupt in a short while */ diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c -index 524841f..3eef41e 100644 +index f9c8746..78b64e3 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c -@@ -684,7 +684,18 @@ asmlinkage void do_ov(struct pt_regs *regs) +@@ -690,7 +690,18 @@ asmlinkage void do_ov(struct pt_regs *regs) siginfo_t info; prev_state = exception_enter(); @@ -6847,7 +7120,7 @@ index becc42b..9e43d4b 100644 tsk->thread.error_code = write; #if 0 diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c -index f1baadd..8537544 100644 +index f1baadd..5472dca 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, @@ -6876,7 +7149,7 @@ index f1baadd..8537544 100644 vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -+ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vmm, addr, len, offset)) ++ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) return addr; } @@ -6951,6 +7224,58 @@ index f1baadd..8537544 100644 int __virt_addr_valid(const volatile void *kaddr) { return pfn_valid(PFN_DOWN(virt_to_phys(kaddr))); +diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c +index 59cccd9..f39ac2f 100644 +--- a/arch/mips/pci/pci-octeon.c ++++ b/arch/mips/pci/pci-octeon.c +@@ -327,8 +327,8 @@ static int octeon_write_config(struct pci_bus *bus, unsigned int devfn, + + + static struct pci_ops octeon_pci_ops = { +- octeon_read_config, +- octeon_write_config, ++ .read = octeon_read_config, ++ .write = octeon_write_config, + }; + + static struct resource octeon_pci_mem_resource = { +diff --git a/arch/mips/pci/pcie-octeon.c b/arch/mips/pci/pcie-octeon.c +index 5e36c33..eb4a17b 100644 +--- a/arch/mips/pci/pcie-octeon.c ++++ b/arch/mips/pci/pcie-octeon.c +@@ -1792,8 +1792,8 @@ static int octeon_dummy_write_config(struct pci_bus *bus, unsigned int devfn, + } + + static struct pci_ops octeon_pcie0_ops = { +- octeon_pcie0_read_config, +- octeon_pcie0_write_config, ++ .read = octeon_pcie0_read_config, ++ .write = octeon_pcie0_write_config, + }; + + static struct resource octeon_pcie0_mem_resource = { +@@ -1813,8 +1813,8 @@ static struct pci_controller octeon_pcie0_controller = { + }; + + static struct pci_ops octeon_pcie1_ops = { +- octeon_pcie1_read_config, +- octeon_pcie1_write_config, ++ .read = octeon_pcie1_read_config, ++ .write = octeon_pcie1_write_config, + }; + + static struct resource octeon_pcie1_mem_resource = { +@@ -1834,8 +1834,8 @@ static struct pci_controller octeon_pcie1_controller = { + }; + + static struct pci_ops octeon_dummy_ops = { +- octeon_dummy_read_config, +- octeon_dummy_write_config, ++ .read = octeon_dummy_read_config, ++ .write = octeon_dummy_write_config, + }; + + static struct resource octeon_dummy_mem_resource = { diff --git a/arch/mips/sgi-ip27/ip27-nmi.c b/arch/mips/sgi-ip27/ip27-nmi.c index a2358b4..7cead4f 100644 --- a/arch/mips/sgi-ip27/ip27-nmi.c @@ -6976,6 +7301,54 @@ index a2358b4..7cead4f 100644 #endif /* +diff --git a/arch/mips/sni/rm200.c b/arch/mips/sni/rm200.c +index a046b30..6799527 100644 +--- a/arch/mips/sni/rm200.c ++++ b/arch/mips/sni/rm200.c +@@ -270,7 +270,7 @@ spurious_8259A_irq: + "spurious RM200 8259A interrupt: IRQ%d.\n", irq); + spurious_irq_mask |= irqmask; + } +- atomic_inc(&irq_err_count); ++ atomic_inc_unchecked(&irq_err_count); + /* + * Theoretically we do not have to handle this IRQ, + * but in Linux this does not cause problems and is +diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c +index 41e873b..34d33a7 100644 +--- a/arch/mips/vr41xx/common/icu.c ++++ b/arch/mips/vr41xx/common/icu.c +@@ -653,7 +653,7 @@ static int icu_get_irq(unsigned int irq) + + printk(KERN_ERR "spurious ICU interrupt: %04x,%04x\n", pend1, pend2); + +- atomic_inc(&irq_err_count); ++ atomic_inc_unchecked(&irq_err_count); + + return -1; + } +diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c +index ae0e4ee..e8f0692 100644 +--- a/arch/mips/vr41xx/common/irq.c ++++ b/arch/mips/vr41xx/common/irq.c +@@ -64,7 +64,7 @@ static void irq_dispatch(unsigned int irq) + irq_cascade_t *cascade; + + if (irq >= NR_IRQS) { +- atomic_inc(&irq_err_count); ++ atomic_inc_unchecked(&irq_err_count); + return; + } + +@@ -84,7 +84,7 @@ static void irq_dispatch(unsigned int irq) + ret = cascade->get_irq(irq); + irq = ret; + if (ret < 0) +- atomic_inc(&irq_err_count); ++ atomic_inc_unchecked(&irq_err_count); + else + irq_dispatch(irq); + if (!irqd_irq_disabled(idata) && chip->irq_unmask) diff --git a/arch/mn10300/proc-mn103e010/include/proc/cache.h b/arch/mn10300/proc-mn103e010/include/proc/cache.h index 967d144..db12197 100644 --- a/arch/mn10300/proc-mn103e010/include/proc/cache.h @@ -7104,7 +7477,7 @@ index ad2b503..bdf1651 100644 instruction set this CPU supports. This could be done in user space, but it's not easy, and we've already done it here. */ diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h -index fc987a1..6e068ef 100644 +index f213f5b..0af3e8e 100644 --- a/arch/parisc/include/asm/pgalloc.h +++ b/arch/parisc/include/asm/pgalloc.h @@ -61,6 +61,11 @@ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd) @@ -7150,10 +7523,10 @@ index 34899b5..02dd060 100644 #define PAGE_KERNEL_EXEC __pgprot(_PAGE_KERNEL_EXEC) #define PAGE_KERNEL_RWX __pgprot(_PAGE_KERNEL_RWX) diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h -index e0a8235..ce2f1e1 100644 +index 4006964..fcb3cc2 100644 --- a/arch/parisc/include/asm/uaccess.h +++ b/arch/parisc/include/asm/uaccess.h -@@ -245,10 +245,10 @@ static inline unsigned long __must_check copy_from_user(void *to, +@@ -246,10 +246,10 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) { @@ -7167,7 +7540,7 @@ index e0a8235..ce2f1e1 100644 else copy_from_user_overflow(); diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c -index 2a625fb..9908930 100644 +index 50dfafc..b9fc230 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c @@ -98,16 +98,38 @@ @@ -7270,7 +7643,7 @@ index 2a625fb..9908930 100644 DEBUGP("register_unwind_table(), sect = %d at 0x%p - 0x%p (gp=0x%lx)\n", me->arch.unwind_section, table, end, gp); diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c -index 0d3a9d4..44975d0 100644 +index 0d3a9d4..20a99b0 100644 --- a/arch/parisc/kernel/sys_parisc.c +++ b/arch/parisc/kernel/sys_parisc.c @@ -33,9 +33,11 @@ @@ -7278,11 +7651,11 @@ index 0d3a9d4..44975d0 100644 #include -static unsigned long get_unshared_area(unsigned long addr, unsigned long len) -+static unsigned long get_unshared_area(struct file *filp, unsigned long addr, unsigned long len, ++static unsigned long get_unshared_area(unsigned long addr, unsigned long len, + unsigned long flags) { struct vm_unmapped_area_info info; -+ unsigned long offset = gr_rand_threadstack_offset(current->mm, filp, flags); ++ unsigned long offset = gr_rand_threadstack_offset(current->mm, NULL, flags); info.flags = 0; info.length = len; @@ -7294,7 +7667,7 @@ index 0d3a9d4..44975d0 100644 return vm_unmapped_area(&info); } -@@ -69,15 +72,17 @@ static unsigned long shared_align_offset(struct file *filp, unsigned long pgoff) +@@ -69,9 +72,10 @@ static unsigned long shared_align_offset(struct file *filp, unsigned long pgoff) } static unsigned long get_shared_area(struct file *filp, unsigned long addr, @@ -7306,13 +7679,14 @@ index 0d3a9d4..44975d0 100644 info.flags = 0; info.length = len; - info.low_limit = PAGE_ALIGN(addr); +@@ -79,6 +83,7 @@ static unsigned long get_shared_area(struct file *filp, unsigned long addr, info.high_limit = TASK_SIZE; info.align_mask = PAGE_MASK & (SHMLBA - 1); -+ info.threadstack_offset = offset; info.align_offset = shared_align_offset(filp, pgoff); ++ info.threadstack_offset = offset; return vm_unmapped_area(&info); } + @@ -93,13 +98,20 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, return -EINVAL; return addr; @@ -7353,7 +7727,7 @@ index 1cd1d0c..44ec918 100644 fault_space = regs->iasq[0]; diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c -index 0293588..3b229aa 100644 +index 9d08c71..e2b4d20 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c @@ -15,6 +15,7 @@ @@ -7490,7 +7864,7 @@ index 0293588..3b229aa 100644 int fixup_exception(struct pt_regs *regs) { const struct exception_table_entry *fix; -@@ -204,8 +315,33 @@ retry: +@@ -210,8 +321,33 @@ retry: good_area: @@ -7526,10 +7900,10 @@ index 0293588..3b229aa 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 38f3b7e..7e485c0 100644 +index b44b52c..4cd253c 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig -@@ -378,6 +378,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE +@@ -382,6 +382,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE config KEXEC bool "kexec system call" depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP)) @@ -7580,7 +7954,7 @@ index 9e495c9..b6878e5 100644 #define SMP_CACHE_BYTES L1_CACHE_BYTES diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h -index cc0655a..13eac2e 100644 +index 935b5e7..7001d2d 100644 --- a/arch/powerpc/include/asm/elf.h +++ b/arch/powerpc/include/asm/elf.h @@ -28,8 +28,19 @@ @@ -7603,9 +7977,9 @@ index cc0655a..13eac2e 100644 +#endif +#endif - /* - * Our registers are always unsigned longs, whether we're a 32 bit -@@ -123,10 +134,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, + #define ELF_CORE_EFLAGS (is_elf2_task() ? 2 : 0) + +@@ -127,10 +138,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, (0x7ff >> (PAGE_SHIFT - 12)) : \ (0x3ffff >> (PAGE_SHIFT - 12))) @@ -7641,6 +8015,62 @@ index 5acabbd..7ea14fa 100644 #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_KMAP_TYPES_H */ +diff --git a/arch/powerpc/include/asm/local.h b/arch/powerpc/include/asm/local.h +index b8da913..60b608a 100644 +--- a/arch/powerpc/include/asm/local.h ++++ b/arch/powerpc/include/asm/local.h +@@ -9,15 +9,26 @@ typedef struct + atomic_long_t a; + } local_t; + ++typedef struct ++{ ++ atomic_long_unchecked_t a; ++} local_unchecked_t; ++ + #define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } + + #define local_read(l) atomic_long_read(&(l)->a) ++#define local_read_unchecked(l) atomic_long_read_unchecked(&(l)->a) + #define local_set(l,i) atomic_long_set(&(l)->a, (i)) ++#define local_set_unchecked(l,i) atomic_long_set_unchecked(&(l)->a, (i)) + + #define local_add(i,l) atomic_long_add((i),(&(l)->a)) ++#define local_add_unchecked(i,l) atomic_long_add_unchecked((i),(&(l)->a)) + #define local_sub(i,l) atomic_long_sub((i),(&(l)->a)) ++#define local_sub_unchecked(i,l) atomic_long_sub_unchecked((i),(&(l)->a)) + #define local_inc(l) atomic_long_inc(&(l)->a) ++#define local_inc_unchecked(l) atomic_long_inc_unchecked(&(l)->a) + #define local_dec(l) atomic_long_dec(&(l)->a) ++#define local_dec_unchecked(l) atomic_long_dec_unchecked(&(l)->a) + + static __inline__ long local_add_return(long a, local_t *l) + { +@@ -35,6 +46,7 @@ static __inline__ long local_add_return(long a, local_t *l) + + return t; + } ++#define local_add_return_unchecked(i, l) atomic_long_add_return_unchecked((i), (&(l)->a)) + + #define local_add_negative(a, l) (local_add_return((a), (l)) < 0) + +@@ -54,6 +66,7 @@ static __inline__ long local_sub_return(long a, local_t *l) + + return t; + } ++#define local_sub_return_unchecked(i, l) atomic_long_sub_return_unchecked((i), (&(l)->a)) + + static __inline__ long local_inc_return(local_t *l) + { +@@ -101,6 +114,8 @@ static __inline__ long local_dec_return(local_t *l) + + #define local_cmpxchg(l, o, n) \ + (cmpxchg_local(&((l)->a.counter), (o), (n))) ++#define local_cmpxchg_unchecked(l, o, n) \ ++ (cmpxchg_local(&((l)->a.counter), (o), (n))) + #define local_xchg(l, n) (xchg_local(&((l)->a.counter), (n))) + + /** diff --git a/arch/powerpc/include/asm/mman.h b/arch/powerpc/include/asm/mman.h index 8565c25..2865190 100644 --- a/arch/powerpc/include/asm/mman.h @@ -7655,7 +8085,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 b9f4262..dcf04f7 100644 +index 32e4e21..62afb12 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; @@ -7706,10 +8136,10 @@ index 88693ce..ac6f9ab 100644 #include diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h -index 256d6f8..b0166a7 100644 +index 4b0be20..c15a27d 100644 --- a/arch/powerpc/include/asm/pgalloc-64.h +++ b/arch/powerpc/include/asm/pgalloc-64.h -@@ -53,6 +53,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) +@@ -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) @@ -7717,7 +8147,7 @@ index 256d6f8..b0166a7 100644 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) { -@@ -70,6 +71,11 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) +@@ -71,6 +72,11 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) pud_set(pud, (unsigned long)pmd); } @@ -7729,7 +8159,7 @@ index 256d6f8..b0166a7 100644 #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)) -@@ -169,6 +175,7 @@ extern void __tlb_remove_table(void *_table); +@@ -173,6 +179,7 @@ extern void __tlb_remove_table(void *_table); #endif #define pud_populate(mm, pud, pmd) pud_set(pud, (unsigned long)pmd) @@ -7762,10 +8192,10 @@ index 4aad413..85d86bf 100644 #define _PAGE_NO_CACHE 0x020 /* I: cache inhibit */ #define _PAGE_WRITETHRU 0x040 /* W: cache write-through */ diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h -index 10d1ef0..8f83abc 100644 +index fa8388e..f985549 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h -@@ -234,6 +234,7 @@ +@@ -239,6 +239,7 @@ #define SPRN_DBCR 0x136 /* e300 Data Breakpoint Control Reg */ #define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ #define DSISR_NOHPTE 0x40000000 /* no translation found */ @@ -7774,10 +8204,10 @@ index 10d1ef0..8f83abc 100644 #define DSISR_ISSTORE 0x02000000 /* access was a store */ #define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */ diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h -index 98da78e..dc68271 100644 +index 084e080..9415a3d 100644 --- a/arch/powerpc/include/asm/smp.h +++ b/arch/powerpc/include/asm/smp.h -@@ -50,7 +50,7 @@ struct smp_ops_t { +@@ -51,7 +51,7 @@ struct smp_ops_t { int (*cpu_disable)(void); void (*cpu_die)(unsigned int nr); int (*cpu_bootable)(unsigned int nr); @@ -7787,10 +8217,10 @@ index 98da78e..dc68271 100644 extern void smp_send_debugger_break(void); extern void start_secondary_resume(void); diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h -index ba7b197..d292e26 100644 +index 9854c56..7517190 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h -@@ -93,7 +93,6 @@ static inline struct thread_info *current_thread_info(void) +@@ -91,7 +91,6 @@ static inline struct thread_info *current_thread_info(void) #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_32BIT 4 /* 32 bit binary */ @@ -7798,17 +8228,17 @@ index ba7b197..d292e26 100644 #define TIF_PERFMON_CTXSW 6 /* perfmon needs ctxsw calls */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ #define TIF_SINGLESTEP 8 /* singlestepping active */ -@@ -107,6 +106,9 @@ static inline struct thread_info *current_thread_info(void) - #define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation - for stack store? */ - #define TIF_MEMDIE 17 /* is terminating due to OOM killer */ -+#define TIF_PERFMON_WORK 18 /* work for pfm_handle_work() */ +@@ -108,6 +107,9 @@ static inline struct thread_info *current_thread_info(void) + #if defined(CONFIG_PPC64) + #define TIF_ELF2ABI 18 /* function descriptors must die! */ + #endif ++#define TIF_PERFMON_WORK 19 /* work for pfm_handle_work() */ +/* mask must be expressable within 16 bits to satisfy 'andi' instruction reqs */ +#define TIF_GRSEC_SETXID 5 /* update credentials on syscall entry/exit */ /* as above, but as bit values */ #define _TIF_SYSCALL_TRACE (1<arch.core_plt_section = i; } if (!me->arch.core_plt_section || !me->arch.init_plt_section) { @@ -8043,7 +8494,7 @@ index 2e3200c..7118986 100644 return -ENOEXEC; } -@@ -192,11 +192,16 @@ static uint32_t do_plt_call(void *location, +@@ -191,11 +191,16 @@ static uint32_t do_plt_call(void *location, DEBUGP("Doing plt for call to 0x%x at 0x%x\n", val, (unsigned int)location); /* Init, or core PLT? */ @@ -8063,7 +8514,7 @@ index 2e3200c..7118986 100644 /* Find this entry, or if that fails, the next avail. entry */ while (entry->jump[0]) { -@@ -300,7 +305,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, +@@ -299,7 +304,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, } #ifdef CONFIG_DYNAMIC_FTRACE module->arch.tramp = @@ -8073,10 +8524,10 @@ index 2e3200c..7118986 100644 sechdrs, module); #endif diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c -index 96d2fdf..f6d10c8 100644 +index ea2f6a3..dbb2be3 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c -@@ -886,8 +886,8 @@ void show_regs(struct pt_regs * regs) +@@ -888,8 +888,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 */ @@ -8085,9 +8536,9 @@ index 96d2fdf..f6d10c8 100644 + printk("NIP ["REG"] %pA\n", regs->nip, (void *)regs->nip); + printk("LR ["REG"] %pA\n", regs->link, (void *)regs->link); #endif - #ifdef CONFIG_PPC_TRANSACTIONAL_MEM - printk("PACATMSCRATCH [%llx]\n", get_paca()->tm_scratch); -@@ -1352,10 +1352,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) + show_stack(current, (unsigned long *) regs->gpr[1]); + if (!user_mode(regs)) +@@ -1385,10 +1385,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) newsp = stack[0]; ip = stack[STACK_FRAME_LR_SAVE]; if (!firstframe || ip != lr) { @@ -8100,7 +8551,7 @@ index 96d2fdf..f6d10c8 100644 (void *)current->ret_stack[curr_frame].ret); curr_frame--; } -@@ -1375,7 +1375,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) +@@ -1408,7 +1408,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; @@ -8109,7 +8560,7 @@ index 96d2fdf..f6d10c8 100644 regs->trap, (void *)regs->nip, (void *)lr); firstframe = 1; } -@@ -1411,58 +1411,3 @@ void notrace __ppc64_runlatch_off(void) +@@ -1444,58 +1444,3 @@ void notrace __ppc64_runlatch_off(void) mtspr(SPRN_CTRLT, ctrl); } #endif /* CONFIG_PPC64 */ @@ -8169,10 +8620,10 @@ index 96d2fdf..f6d10c8 100644 - return ret; -} diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c -index 9a0d24c..e7fbedf 100644 +index 2e3d2bf..35df241 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c -@@ -1761,6 +1761,10 @@ long arch_ptrace(struct task_struct *child, long request, +@@ -1762,6 +1762,10 @@ long arch_ptrace(struct task_struct *child, long request, return ret; } @@ -8183,7 +8634,7 @@ index 9a0d24c..e7fbedf 100644 /* * We must return the syscall number to actually look up in the table. * This can be -1L to skip running any syscall at all. -@@ -1773,6 +1777,11 @@ long do_syscall_trace_enter(struct pt_regs *regs) +@@ -1774,6 +1778,11 @@ long do_syscall_trace_enter(struct pt_regs *regs) secure_computing_strict(regs->gpr[0]); @@ -8195,7 +8646,7 @@ index 9a0d24c..e7fbedf 100644 if (test_thread_flag(TIF_SYSCALL_TRACE) && tracehook_report_syscall_entry(regs)) /* -@@ -1807,6 +1816,11 @@ void do_syscall_trace_leave(struct pt_regs *regs) +@@ -1808,6 +1817,11 @@ void do_syscall_trace_leave(struct pt_regs *regs) { int step; @@ -8208,10 +8659,10 @@ index 9a0d24c..e7fbedf 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 fea2dba..a779f6b 100644 +index 68027bf..b26fd31 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c -@@ -1002,7 +1002,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, +@@ -1004,7 +1004,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, /* Save user registers on the stack */ frame = &rt_sf->uc.uc_mcontext; addr = frame; @@ -8221,10 +8672,10 @@ index fea2dba..a779f6b 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 1e7ba88..17afb1b 100644 +index 448245f..b9bae83 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c -@@ -763,7 +763,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info, +@@ -758,7 +758,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info, #endif /* Set up to return from userspace. */ @@ -8234,7 +8685,7 @@ index 1e7ba88..17afb1b 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 f783c93..619baf1 100644 +index 907a472..4ba206f 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -142,6 +142,8 @@ static unsigned __kprobes long oops_begin(struct pt_regs *regs) @@ -8257,18 +8708,18 @@ index f783c93..619baf1 100644 } diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c -index 1d9c926..25f4741 100644 +index 094e45c..d82b848 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c -@@ -34,6 +34,7 @@ - #include +@@ -35,6 +35,7 @@ #include #include + #include +#include - #include "setup.h" + #undef DEBUG -@@ -222,7 +223,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) +@@ -221,7 +222,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) vdso_base = VDSO32_MBASE; #endif @@ -8277,7 +8728,7 @@ index 1d9c926..25f4741 100644 /* vDSO has a problem and was disabled, just don't "enable" it for the * process -@@ -242,7 +243,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) +@@ -241,7 +242,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) vdso_base = get_unmapped_area(NULL, vdso_base, (vdso_pages << PAGE_SHIFT) + ((VDSO_ALIGNMENT - 1) & PAGE_MASK), @@ -8286,6 +8737,19 @@ index 1d9c926..25f4741 100644 if (IS_ERR_VALUE(vdso_base)) { rc = vdso_base; goto fail_mmapsem; +diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c +index 9ae9768..87c3448 100644 +--- a/arch/powerpc/kvm/powerpc.c ++++ b/arch/powerpc/kvm/powerpc.c +@@ -1141,7 +1141,7 @@ void kvmppc_init_lpid(unsigned long nr_lpids_param) + } + EXPORT_SYMBOL_GPL(kvmppc_init_lpid); + +-int kvm_arch_init(void *opaque) ++int kvm_arch_init(const void *opaque) + { + return 0; + } diff --git a/arch/powerpc/lib/usercopy_64.c b/arch/powerpc/lib/usercopy_64.c index 5eea6f3..5d10396 100644 --- a/arch/powerpc/lib/usercopy_64.c @@ -8422,10 +8886,15 @@ index 51ab9e7..7d3c78b 100644 goto bail; } diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c -index cb8bdbe..d770680 100644 +index cb8bdbe..cde4bc7 100644 --- a/arch/powerpc/mm/mmap.c +++ b/arch/powerpc/mm/mmap.c -@@ -57,6 +57,10 @@ static unsigned long mmap_rnd(void) +@@ -53,10 +53,14 @@ static inline int mmap_is_legacy(void) + return sysctl_legacy_va_layout; + } + +-static unsigned long mmap_rnd(void) ++static unsigned long mmap_rnd(struct mm_struct *mm) { unsigned long rnd = 0; @@ -8436,6 +8905,24 @@ index cb8bdbe..d770680 100644 if (current->flags & PF_RANDOMIZE) { /* 8MB for 32bit, 1GB for 64bit */ if (is_32bit_task()) +@@ -67,7 +71,7 @@ static unsigned long mmap_rnd(void) + return rnd << PAGE_SHIFT; + } + +-static inline unsigned long mmap_base(void) ++static inline unsigned long mmap_base(struct mm_struct *mm) + { + unsigned long gap = rlimit(RLIMIT_STACK); + +@@ -76,7 +80,7 @@ static inline unsigned long mmap_base(void) + else if (gap > MAX_GAP) + gap = MAX_GAP; + +- return PAGE_ALIGN(TASK_SIZE - gap - mmap_rnd()); ++ return PAGE_ALIGN(TASK_SIZE - gap - mmap_rnd(mm)); + } + + /* @@ -91,9 +95,21 @@ void arch_pick_mmap_layout(struct mm_struct *mm) */ if (mmap_is_legacy()) { @@ -8448,7 +8935,8 @@ index cb8bdbe..d770680 100644 + mm->get_unmapped_area = arch_get_unmapped_area; } else { - mm->mmap_base = mmap_base(); +- mm->mmap_base = mmap_base(); ++ mm->mmap_base = mmap_base(mm); + +#ifdef CONFIG_PAX_RANDMMAP + if (mm->pax_flags & MF_PAX_RANDMMAP) @@ -8496,25 +8984,21 @@ index 7ce9cf3..a964087 100644 /* If hint, make sure it matches our alignment restrictions */ if (!fixed && addr) { addr = _ALIGN_UP(addr, 1ul << pshift); -diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c -index 2345bdb..ebbb2f1 100644 ---- a/arch/powerpc/net/bpf_jit_comp.c -+++ b/arch/powerpc/net/bpf_jit_comp.c -@@ -209,10 +209,11 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image, - } - PPC_DIVWU(r_A, r_A, r_X); - break; -- case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K); */ -+ case BPF_S_ALU_DIV_K: /* A /= K */ -+ if (K == 1) -+ break; - PPC_LI32(r_scratch1, K); -- /* Top 32 bits of 64bit result -> A */ -- PPC_MULHWU(r_A, r_A, r_scratch1); -+ PPC_DIVWU(r_A, r_A, r_scratch1); - break; - case BPF_S_ALU_AND_X: - ctx->seen |= SEEN_XREG; +diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c +index 4278acf..67fd0e6 100644 +--- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c ++++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c +@@ -400,8 +400,8 @@ static int scc_pciex_write_config(struct pci_bus *bus, unsigned int devfn, + } + + static struct pci_ops scc_pciex_pci_ops = { +- scc_pciex_read_config, +- scc_pciex_write_config, ++ .read = scc_pciex_read_config, ++ .write = scc_pciex_write_config, + }; + + static void pciex_clear_intr_all(unsigned int __iomem *base) diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 9098692..3d54cd1 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c @@ -8532,10 +9016,10 @@ index 9098692..3d54cd1 100644 struct spu_context *ctx = vma->vm_file->private_data; unsigned long offset = address - vma->vm_start; diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h -index c797832..ce575c8 100644 +index fa9aaf7..3f5d836 100644 --- a/arch/s390/include/asm/atomic.h +++ b/arch/s390/include/asm/atomic.h -@@ -326,6 +326,16 @@ static inline long long atomic64_dec_if_positive(atomic64_t *v) +@@ -398,6 +398,16 @@ static inline long long atomic64_dec_if_positive(atomic64_t *v) #define atomic64_dec_and_test(_v) (atomic64_sub_return(1, _v) == 0) #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) @@ -8612,10 +9096,18 @@ index c4a93d6..4d2a9b4 100644 #endif /* __ASM_EXEC_H */ diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h -index 9c33ed4..e40cbef 100644 +index 79330af..254cf37 100644 --- a/arch/s390/include/asm/uaccess.h +++ b/arch/s390/include/asm/uaccess.h -@@ -252,6 +252,10 @@ static inline unsigned long __must_check +@@ -59,6 +59,7 @@ static inline int __range_ok(unsigned long addr, unsigned long size) + __range_ok((unsigned long)(addr), (size)); \ + }) + ++#define access_ok_noprefault(type, addr, size) access_ok((type), (addr), (size)) + #define access_ok(type, addr, size) __access_ok(addr, size) + + /* +@@ -245,6 +246,10 @@ static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n) { might_fault(); @@ -8626,17 +9118,17 @@ index 9c33ed4..e40cbef 100644 return __copy_to_user(to, from, n); } -@@ -275,6 +279,9 @@ copy_to_user(void __user *to, const void *from, unsigned long n) +@@ -268,6 +273,9 @@ copy_to_user(void __user *to, const void *from, unsigned long n) static inline unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n) { + if ((long)n < 0) + return n; + - if (__builtin_constant_p(n) && (n <= 256)) - return uaccess.copy_from_user_small(n, from, to); - else -@@ -306,10 +313,14 @@ __compiletime_warning("copy_from_user() buffer size is not provably correct") + return uaccess.copy_from_user(n, from, to); + } + +@@ -296,10 +304,14 @@ __compiletime_warning("copy_from_user() buffer size is not provably correct") static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) { @@ -8654,7 +9146,7 @@ index 9c33ed4..e40cbef 100644 return n; } diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c -index 7845e15..59c4353 100644 +index b89b591..fd9609d 100644 --- a/arch/s390/kernel/module.c +++ b/arch/s390/kernel/module.c @@ -169,11 +169,11 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, @@ -8729,10 +9221,10 @@ index 7845e15..59c4353 100644 if (r_type == R_390_GOTPC) rc = apply_rela_bits(loc, val, 1, 32, 0); diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c -index c5dbb33..b41f4ee 100644 +index 7ed0d4e..1dfc145 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c -@@ -237,39 +237,3 @@ unsigned long get_wchan(struct task_struct *p) +@@ -242,39 +242,3 @@ unsigned long get_wchan(struct task_struct *p) } return 0; } @@ -8773,13 +9265,13 @@ index c5dbb33..b41f4ee 100644 - return ret; -} diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c -index 4002329..99b67cb 100644 +index 9b436c2..54fbf0a 100644 --- a/arch/s390/mm/mmap.c +++ b/arch/s390/mm/mmap.c -@@ -90,9 +90,21 @@ void arch_pick_mmap_layout(struct mm_struct *mm) +@@ -95,9 +95,21 @@ void arch_pick_mmap_layout(struct mm_struct *mm) */ if (mmap_is_legacy()) { - mm->mmap_base = TASK_UNMAPPED_BASE; + mm->mmap_base = mmap_base_legacy(); + +#ifdef CONFIG_PAX_RANDMMAP + if (mm->pax_flags & MF_PAX_RANDMMAP) @@ -8798,10 +9290,10 @@ index 4002329..99b67cb 100644 mm->get_unmapped_area = arch_get_unmapped_area_topdown; } } -@@ -173,9 +185,21 @@ void arch_pick_mmap_layout(struct mm_struct *mm) +@@ -170,9 +182,21 @@ void arch_pick_mmap_layout(struct mm_struct *mm) */ if (mmap_is_legacy()) { - mm->mmap_base = TASK_UNMAPPED_BASE; + mm->mmap_base = mmap_base_legacy(); + +#ifdef CONFIG_PAX_RANDMMAP + if (mm->pax_flags & MF_PAX_RANDMMAP) @@ -8820,41 +9312,6 @@ index 4002329..99b67cb 100644 mm->get_unmapped_area = s390_get_unmapped_area_topdown; } } -diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c -index a5df511..06f5acc 100644 ---- a/arch/s390/net/bpf_jit_comp.c -+++ b/arch/s390/net/bpf_jit_comp.c -@@ -371,11 +371,13 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct sock_filter *filter, - /* dr %r4,%r12 */ - EMIT2(0x1d4c); - break; -- case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K) */ -- /* m %r4,(%r13) */ -- EMIT4_DISP(0x5c40d000, EMIT_CONST(K)); -- /* lr %r5,%r4 */ -- EMIT2(0x1854); -+ case BPF_S_ALU_DIV_K: /* A /= K */ -+ if (K == 1) -+ break; -+ /* lhi %r4,0 */ -+ EMIT4(0xa7480000); -+ /* d %r4,(%r13) */ -+ EMIT4_DISP(0x5d40d000, EMIT_CONST(K)); - break; - case BPF_S_ALU_MOD_X: /* A %= X */ - jit->seen |= SEEN_XREG | SEEN_RET0; -@@ -391,6 +393,11 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct sock_filter *filter, - EMIT2(0x1854); - break; - case BPF_S_ALU_MOD_K: /* A %= K */ -+ if (K == 1) { -+ /* lhi %r5,0 */ -+ EMIT4(0xa7580000); -+ break; -+ } - /* lhi %r4,0 */ - EMIT4(0xa7480000); - /* d %r4,(%r13) */ diff --git a/arch/score/include/asm/cache.h b/arch/score/include/asm/cache.h index ae3d59f..f65f075 100644 --- a/arch/score/include/asm/cache.h @@ -9262,6 +9719,19 @@ index bcfe063..b333142 100644 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) { +diff --git a/arch/sparc/include/asm/pgtable.h b/arch/sparc/include/asm/pgtable.h +index 59ba6f6..4518128 100644 +--- a/arch/sparc/include/asm/pgtable.h ++++ b/arch/sparc/include/asm/pgtable.h +@@ -5,4 +5,8 @@ + #else + #include + #endif ++ ++#define ktla_ktva(addr) (addr) ++#define ktva_ktla(addr) (addr) ++ + #endif diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h index 502f632..da1917f 100644 --- a/arch/sparc/include/asm/pgtable_32.h @@ -9419,7 +9889,7 @@ index 9689176..63c18ea 100644 unsigned long mask, tmp1, tmp2, result; diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h -index dd38075..e7cac83 100644 +index 96efa7a..16858bf 100644 --- a/arch/sparc/include/asm/thread_info_32.h +++ b/arch/sparc/include/asm/thread_info_32.h @@ -49,6 +49,8 @@ struct thread_info { @@ -9432,7 +9902,7 @@ index dd38075..e7cac83 100644 /* diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h -index d5e5042..9bfee76 100644 +index a5f01ac..703b554 100644 --- a/arch/sparc/include/asm/thread_info_64.h +++ b/arch/sparc/include/asm/thread_info_64.h @@ -63,6 +63,8 @@ struct thread_info { @@ -9444,12 +9914,14 @@ index d5e5042..9bfee76 100644 unsigned long fpregs[0] __attribute__ ((aligned(64))); }; -@@ -192,10 +194,11 @@ register struct thread_info *current_thread_info_reg asm("g6"); +@@ -188,12 +190,13 @@ register struct thread_info *current_thread_info_reg asm("g6"); + #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ + /* flag bit 4 is available */ #define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */ - /* flag bit 6 is available */ +-/* flag bit 6 is available */ ++#define TIF_GRSEC_SETXID 6 /* update credentials on syscall entry/exit */ #define TIF_32BIT 7 /* 32-bit binary */ --/* flag bit 8 is available */ -+#define TIF_GRSEC_SETXID 8 /* update credentials on syscall entry/exit */ + #define TIF_NOHZ 8 /* in adaptive nohz mode */ #define TIF_SECCOMP 9 /* secure computing */ #define TIF_SYSCALL_AUDIT 10 /* syscall auditing active */ #define TIF_SYSCALL_TRACEPOINT 11 /* syscall tracepoint instrumentation */ @@ -9457,7 +9929,7 @@ index d5e5042..9bfee76 100644 /* NOTE: Thread flags >= 12 should be ones we have no interest * in using in assembly, else we can't use the mask as * an immediate value in instructions such as andcc. -@@ -214,12 +217,18 @@ register struct thread_info *current_thread_info_reg asm("g6"); +@@ -213,12 +216,18 @@ register struct thread_info *current_thread_info_reg asm("g6"); #define _TIF_SYSCALL_AUDIT (1<ins[4], rwk->ins[5], rwk->ins[6], rwk->ins[7]); if (regs->tstate & TSTATE_PRIV) @@ -9644,7 +10116,7 @@ index baebab2..9cd13b1 100644 } void show_regs(struct pt_regs *regs) -@@ -167,7 +167,7 @@ void show_regs(struct pt_regs *regs) +@@ -168,7 +168,7 @@ void show_regs(struct pt_regs *regs) printk("TSTATE: %016lx TPC: %016lx TNPC: %016lx Y: %08x %s\n", regs->tstate, regs->tpc, regs->tnpc, regs->y, print_tainted()); @@ -9653,7 +10125,7 @@ index baebab2..9cd13b1 100644 printk("g0: %016lx g1: %016lx g2: %016lx g3: %016lx\n", regs->u_regs[0], regs->u_regs[1], regs->u_regs[2], regs->u_regs[3]); -@@ -180,7 +180,7 @@ void show_regs(struct pt_regs *regs) +@@ -181,7 +181,7 @@ void show_regs(struct pt_regs *regs) printk("o4: %016lx o5: %016lx sp: %016lx ret_pc: %016lx\n", regs->u_regs[12], regs->u_regs[13], regs->u_regs[14], regs->u_regs[15]); @@ -9662,7 +10134,7 @@ index baebab2..9cd13b1 100644 show_regwindow(regs); show_stack(current, (unsigned long *) regs->u_regs[UREG_FP]); } -@@ -269,7 +269,7 @@ void arch_trigger_all_cpu_backtrace(void) +@@ -270,7 +270,7 @@ void arch_trigger_all_cpu_backtrace(void) ((tp && tp->task) ? tp->task->pid : -1)); if (gp->tstate & TSTATE_PRIV) { @@ -9685,10 +10157,10 @@ index 79cc0d1..ec62734 100644 .getproplen = prom_getproplen, .getproperty = prom_getproperty, diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c -index 773c1f2..a8bdd87 100644 +index c13c9f2..d572c34 100644 --- a/arch/sparc/kernel/ptrace_64.c +++ b/arch/sparc/kernel/ptrace_64.c -@@ -1059,6 +1059,10 @@ long arch_ptrace(struct task_struct *child, long request, +@@ -1060,6 +1060,10 @@ long arch_ptrace(struct task_struct *child, long request, return ret; } @@ -9699,9 +10171,9 @@ index 773c1f2..a8bdd87 100644 asmlinkage int syscall_trace_enter(struct pt_regs *regs) { int ret = 0; -@@ -1066,6 +1070,11 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs) - /* do the secure computing check first */ - secure_computing_strict(regs->u_regs[UREG_G1]); +@@ -1070,6 +1074,11 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs) + if (test_thread_flag(TIF_NOHZ)) + user_exit(); +#ifdef CONFIG_GRKERNSEC_SETXID + if (unlikely(test_and_clear_thread_flag(TIF_GRSEC_SETXID))) @@ -9711,10 +10183,10 @@ index 773c1f2..a8bdd87 100644 if (test_thread_flag(TIF_SYSCALL_TRACE)) ret = tracehook_report_syscall_entry(regs); -@@ -1086,6 +1095,11 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs) +@@ -1093,6 +1102,11 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs) + if (test_thread_flag(TIF_NOHZ)) + user_exit(); - asmlinkage void syscall_trace_leave(struct pt_regs *regs) - { +#ifdef CONFIG_GRKERNSEC_SETXID + if (unlikely(test_and_clear_thread_flag(TIF_GRSEC_SETXID))) + gr_delayed_cred_worker(); @@ -9724,10 +10196,10 @@ index 773c1f2..a8bdd87 100644 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c -index e142545..fd29654 100644 +index b085311..6f885f7 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c -@@ -869,8 +869,8 @@ extern unsigned long xcall_flush_dcache_page_cheetah; +@@ -870,8 +870,8 @@ extern unsigned long xcall_flush_dcache_page_cheetah; extern unsigned long xcall_flush_dcache_page_spitfire; #ifdef CONFIG_DEBUG_DCFLUSH @@ -9738,7 +10210,7 @@ index e142545..fd29654 100644 #endif static inline void __local_flush_dcache_page(struct page *page) -@@ -894,7 +894,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu) +@@ -895,7 +895,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu) return; #ifdef CONFIG_DEBUG_DCFLUSH @@ -9747,7 +10219,7 @@ index e142545..fd29654 100644 #endif this_cpu = get_cpu(); -@@ -918,7 +918,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu) +@@ -919,7 +919,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu) xcall_deliver(data0, __pa(pg_addr), (u64) pg_addr, cpumask_of(cpu)); #ifdef CONFIG_DEBUG_DCFLUSH @@ -9756,7 +10228,7 @@ index e142545..fd29654 100644 #endif } } -@@ -937,7 +937,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page) +@@ -938,7 +938,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page) preempt_disable(); #ifdef CONFIG_DEBUG_DCFLUSH @@ -9765,7 +10237,7 @@ index e142545..fd29654 100644 #endif data0 = 0; pg_addr = page_address(page); -@@ -954,7 +954,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page) +@@ -955,7 +955,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page) xcall_deliver(data0, __pa(pg_addr), (u64) pg_addr, cpu_online_mask); #ifdef CONFIG_DEBUG_DCFLUSH @@ -9788,10 +10260,10 @@ index 3a8d184..49498a8 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 51561b8..8256764 100644 +index beb0b5a..5a153f7 100644 --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c -@@ -90,13 +90,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi +@@ -88,13 +88,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi struct vm_area_struct * vma; unsigned long task_size = TASK_SIZE; int do_color_align; @@ -9807,7 +10279,7 @@ index 51561b8..8256764 100644 ((addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1))) return -EINVAL; return addr; -@@ -111,6 +112,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi +@@ -109,6 +110,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi if (filp || (flags & MAP_SHARED)) do_color_align = 1; @@ -9818,7 +10290,7 @@ index 51561b8..8256764 100644 if (addr) { if (do_color_align) addr = COLOR_ALIGN(addr, pgoff); -@@ -118,22 +123,28 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi +@@ -116,22 +121,28 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi addr = PAGE_ALIGN(addr); vma = find_vma(mm, addr); @@ -9850,7 +10322,7 @@ index 51561b8..8256764 100644 info.high_limit = task_size; addr = vm_unmapped_area(&info); } -@@ -151,6 +162,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, +@@ -149,6 +160,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, unsigned long task_size = STACK_TOP32; unsigned long addr = addr0; int do_color_align; @@ -9858,7 +10330,7 @@ index 51561b8..8256764 100644 struct vm_unmapped_area_info info; /* This should only ever run for 32-bit processes. */ -@@ -160,7 +172,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, +@@ -158,7 +170,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, /* We do not accept a shared mapping if it would violate * cache aliasing constraints. */ @@ -9867,7 +10339,7 @@ index 51561b8..8256764 100644 ((addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1))) return -EINVAL; return addr; -@@ -173,6 +185,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, +@@ -171,6 +183,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, if (filp || (flags & MAP_SHARED)) do_color_align = 1; @@ -9878,7 +10350,7 @@ index 51561b8..8256764 100644 /* requesting a specific address */ if (addr) { if (do_color_align) -@@ -181,8 +197,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, +@@ -179,8 +195,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, addr = PAGE_ALIGN(addr); vma = find_vma(mm, addr); @@ -9888,7 +10360,7 @@ index 51561b8..8256764 100644 return addr; } -@@ -192,6 +207,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, +@@ -190,6 +205,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, info.high_limit = mm->mmap_base; info.align_mask = do_color_align ? (PAGE_MASK & (SHMLBA - 1)) : 0; info.align_offset = pgoff << PAGE_SHIFT; @@ -9896,7 +10368,7 @@ index 51561b8..8256764 100644 addr = vm_unmapped_area(&info); /* -@@ -204,6 +220,12 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, +@@ -202,6 +218,12 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, VM_BUG_ON(addr != -ENOMEM); info.flags = 0; info.low_limit = TASK_UNMAPPED_BASE; @@ -9909,7 +10381,7 @@ index 51561b8..8256764 100644 info.high_limit = STACK_TOP32; addr = vm_unmapped_area(&info); } -@@ -260,10 +282,14 @@ unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, u +@@ -258,10 +280,14 @@ unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, u EXPORT_SYMBOL(get_fb_unmapped_area); /* Essentially the same as PowerPC. */ @@ -9925,7 +10397,7 @@ index 51561b8..8256764 100644 if (current->flags & PF_RANDOMIZE) { unsigned long val = get_random_int(); if (test_thread_flag(TIF_32BIT)) -@@ -276,7 +302,7 @@ static unsigned long mmap_rnd(void) +@@ -274,7 +300,7 @@ static unsigned long mmap_rnd(void) void arch_pick_mmap_layout(struct mm_struct *mm) { @@ -9934,7 +10406,7 @@ index 51561b8..8256764 100644 unsigned long gap; /* -@@ -289,6 +315,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm) +@@ -287,6 +313,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm) gap == RLIM_INFINITY || sysctl_legacy_va_layout) { mm->mmap_base = TASK_UNMAPPED_BASE + random_factor; @@ -9947,7 +10419,7 @@ index 51561b8..8256764 100644 mm->get_unmapped_area = arch_get_unmapped_area; } else { /* We know it's 32-bit */ -@@ -300,6 +332,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm) +@@ -298,6 +330,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm) gap = (task_size / 6 * 5); mm->mmap_base = PAGE_ALIGN(task_size - gap - random_factor); @@ -9961,41 +10433,54 @@ index 51561b8..8256764 100644 } } diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S -index d950197..192f9d8 100644 +index 87729ff..d87fb1f 100644 --- a/arch/sparc/kernel/syscalls.S +++ b/arch/sparc/kernel/syscalls.S @@ -52,7 +52,7 @@ sys32_rt_sigreturn: #endif .align 32 1: ldx [%g6 + TI_FLAGS], %l5 -- andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 +- andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT|_TIF_NOHZ), %g0 + andcc %l5, _TIF_WORK_SYSCALL, %g0 be,pt %icc, rtrap nop call syscall_trace_leave -@@ -184,7 +184,7 @@ linux_sparc_syscall32: +@@ -184,12 +184,13 @@ linux_sparc_syscall32: srl %i3, 0, %o3 ! IEU0 srl %i2, 0, %o2 ! IEU0 Group -- andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 +- andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT|_TIF_NOHZ), %g0 + andcc %l0, _TIF_WORK_SYSCALL, %g0 bne,pn %icc, linux_syscall_trace32 ! CTI mov %i0, %l5 ! IEU1 5: call %l7 ! CTI Group brk forced -@@ -207,7 +207,7 @@ linux_sparc_syscall: + srl %i5, 0, %o5 ! IEU1 +- ba,a,pt %xcc, 3f ++ ba,pt %xcc, 3f ++ sra %o0, 0, %o0 + + /* Linux native system calls enter here... */ + .align 32 +@@ -207,7 +208,7 @@ linux_sparc_syscall: mov %i3, %o3 ! IEU1 mov %i4, %o4 ! IEU0 Group -- andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 +- andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT|_TIF_NOHZ), %g0 + andcc %l0, _TIF_WORK_SYSCALL, %g0 bne,pn %icc, linux_syscall_trace ! CTI Group mov %i0, %l5 ! IEU0 2: call %l7 ! CTI Group brk forced -@@ -223,7 +223,7 @@ ret_sys_call: +@@ -217,13 +218,12 @@ linux_sparc_syscall: + 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] + ret_sys_call: + ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 +- sra %o0, 0, %o0 + mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 + sllx %g2, 32, %g2 cmp %o0, -ERESTART_RESTARTBLOCK bgeu,pn %xcc, 1f -- andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 +- andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT|_TIF_NOHZ), %g0 + andcc %l0, _TIF_WORK_SYSCALL, %g0 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc @@ -10034,10 +10519,10 @@ index 6629829..036032d 100644 } diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c -index b3f833a..f485f80 100644 +index 4ced92f..965eeed 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c -@@ -76,7 +76,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p) +@@ -77,7 +77,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p) i + 1, p->trapstack[i].tstate, p->trapstack[i].tpc, p->trapstack[i].tnpc, p->trapstack[i].tt); @@ -10046,7 +10531,7 @@ index b3f833a..f485f80 100644 } } -@@ -96,6 +96,12 @@ void bad_trap(struct pt_regs *regs, long lvl) +@@ -97,6 +97,12 @@ void bad_trap(struct pt_regs *regs, long lvl) lvl -= 0x100; if (regs->tstate & TSTATE_PRIV) { @@ -10059,7 +10544,7 @@ index b3f833a..f485f80 100644 sprintf(buffer, "Kernel bad sw trap %lx", lvl); die_if_kernel(buffer, regs); } -@@ -114,11 +120,16 @@ void bad_trap(struct pt_regs *regs, long lvl) +@@ -115,11 +121,16 @@ void bad_trap(struct pt_regs *regs, long lvl) void bad_trap_tl1(struct pt_regs *regs, long lvl) { char buffer[32]; @@ -10077,7 +10562,7 @@ index b3f833a..f485f80 100644 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); sprintf (buffer, "Bad trap %lx at tl>0", lvl); -@@ -1142,7 +1153,7 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in +@@ -1149,7 +1160,7 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in regs->tpc, regs->tnpc, regs->u_regs[UREG_I7], regs->tstate); printk("%s" "ERROR(%d): ", (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id()); @@ -10086,7 +10571,7 @@ index b3f833a..f485f80 100644 printk("%s" "ERROR(%d): M_SYND(%lx), E_SYND(%lx)%s%s\n", (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), (afsr & CHAFSR_M_SYNDROME) >> CHAFSR_M_SYNDROME_SHIFT, -@@ -1749,7 +1760,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs) +@@ -1756,7 +1767,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs) smp_processor_id(), (type & 0x1) ? 'I' : 'D', regs->tpc); @@ -10095,7 +10580,7 @@ index b3f833a..f485f80 100644 panic("Irrecoverable Cheetah+ parity error."); } -@@ -1757,7 +1768,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs) +@@ -1764,7 +1775,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs) smp_processor_id(), (type & 0x1) ? 'I' : 'D', regs->tpc); @@ -10104,7 +10589,7 @@ index b3f833a..f485f80 100644 } struct sun4v_error_entry { -@@ -1830,8 +1841,8 @@ struct sun4v_error_entry { +@@ -1837,8 +1848,8 @@ struct sun4v_error_entry { /*0x38*/u64 reserved_5; }; @@ -10115,7 +10600,7 @@ index b3f833a..f485f80 100644 static const char *sun4v_err_type_to_str(u8 type) { -@@ -1923,7 +1934,7 @@ static void sun4v_report_real_raddr(const char *pfx, struct pt_regs *regs) +@@ -1930,7 +1941,7 @@ static void sun4v_report_real_raddr(const char *pfx, struct pt_regs *regs) } static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, @@ -10124,7 +10609,7 @@ index b3f833a..f485f80 100644 { u64 *raw_ptr = (u64 *) ent; u32 attrs; -@@ -1981,8 +1992,8 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, +@@ -1988,8 +1999,8 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, show_regs(regs); @@ -10135,7 +10620,7 @@ index b3f833a..f485f80 100644 wmb(); printk("%s: Queue overflowed %d times.\n", pfx, cnt); -@@ -2036,7 +2047,7 @@ void sun4v_resum_error(struct pt_regs *regs, unsigned long offset) +@@ -2046,7 +2057,7 @@ out: */ void sun4v_resum_overflow(struct pt_regs *regs) { @@ -10144,7 +10629,7 @@ index b3f833a..f485f80 100644 } /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate. -@@ -2089,7 +2100,7 @@ void sun4v_nonresum_overflow(struct pt_regs *regs) +@@ -2099,7 +2110,7 @@ void sun4v_nonresum_overflow(struct pt_regs *regs) /* XXX Actually even this can make not that much sense. Perhaps * XXX we should just pull the plug and panic directly from here? */ @@ -10153,7 +10638,7 @@ index b3f833a..f485f80 100644 } unsigned long sun4v_err_itlb_vaddr; -@@ -2104,9 +2115,9 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl) +@@ -2114,9 +2125,9 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl) printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n", regs->tpc, tl); @@ -10165,7 +10650,7 @@ index b3f833a..f485f80 100644 (void *) regs->u_regs[UREG_I7]); printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] " "pte[%lx] error[%lx]\n", -@@ -2128,9 +2139,9 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl) +@@ -2138,9 +2149,9 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl) printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n", regs->tpc, tl); @@ -10177,7 +10662,7 @@ index b3f833a..f485f80 100644 (void *) regs->u_regs[UREG_I7]); printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] " "pte[%lx] error[%lx]\n", -@@ -2336,13 +2347,13 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) +@@ -2359,13 +2370,13 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) fp = (unsigned long)sf->fp + STACK_BIAS; } @@ -10193,7 +10678,7 @@ index b3f833a..f485f80 100644 graph++; } } -@@ -2360,6 +2371,8 @@ static inline struct reg_window *kernel_stack_up(struct reg_window *rw) +@@ -2383,6 +2394,8 @@ static inline struct reg_window *kernel_stack_up(struct reg_window *rw) return (struct reg_window *) (fp + STACK_BIAS); } @@ -10202,7 +10687,7 @@ index b3f833a..f485f80 100644 void die_if_kernel(char *str, struct pt_regs *regs) { static int die_counter; -@@ -2388,7 +2401,7 @@ void die_if_kernel(char *str, struct pt_regs *regs) +@@ -2411,7 +2424,7 @@ void die_if_kernel(char *str, struct pt_regs *regs) while (rw && count++ < 30 && kstack_valid(tp, (unsigned long) rw)) { @@ -10211,7 +10696,7 @@ index b3f833a..f485f80 100644 (void *) rw->ins[7]); rw = kernel_stack_up(rw); -@@ -2401,8 +2414,10 @@ void die_if_kernel(char *str, struct pt_regs *regs) +@@ -2424,8 +2437,10 @@ void die_if_kernel(char *str, struct pt_regs *regs) } user_instruction_dump ((unsigned int __user *) regs->tpc); } @@ -10224,10 +10709,10 @@ index b3f833a..f485f80 100644 } EXPORT_SYMBOL(die_if_kernel); diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c -index 8201c25e..072a2a7 100644 +index 3c1a7cb..73e1923 100644 --- a/arch/sparc/kernel/unaligned_64.c +++ b/arch/sparc/kernel/unaligned_64.c -@@ -286,7 +286,7 @@ static void log_unaligned(struct pt_regs *regs) +@@ -289,7 +289,7 @@ static void log_unaligned(struct pt_regs *regs) static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5); if (__ratelimit(&ratelimit)) { @@ -10817,20 +11302,20 @@ index 59dbd46..1dd7f5e 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 2ebec26..b212598 100644 +index 69bb818..6ca35c8 100644 --- a/arch/sparc/mm/fault_64.c +++ b/arch/sparc/mm/fault_64.c -@@ -21,6 +21,9 @@ - #include +@@ -22,6 +22,9 @@ #include #include + #include +#include +#include +#include #include #include -@@ -74,7 +77,7 @@ static void __kprobes bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr) +@@ -75,7 +78,7 @@ static void __kprobes bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr) printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n", regs->tpc); printk(KERN_CRIT "OOPS: RPC [%016lx]\n", regs->u_regs[15]); @@ -10839,7 +11324,7 @@ index 2ebec26..b212598 100644 printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr); dump_stack(); unhandled_fault(regs->tpc, current, regs); -@@ -270,6 +273,466 @@ static void noinline __kprobes bogus_32bit_fault_address(struct pt_regs *regs, +@@ -271,6 +274,466 @@ static void noinline __kprobes bogus_32bit_fault_address(struct pt_regs *regs, show_regs(regs); } @@ -11305,8 +11790,8 @@ index 2ebec26..b212598 100644 + asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs) { - struct mm_struct *mm = current->mm; -@@ -342,6 +805,29 @@ retry: + enum ctx_state prev_state = exception_enter(); +@@ -344,6 +807,29 @@ retry: if (!vma) goto bad_area; @@ -11337,10 +11822,10 @@ index 2ebec26..b212598 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 9639964..806cd0c 100644 +index 3096317..a7b7654 100644 --- a/arch/sparc/mm/hugetlbpage.c +++ b/arch/sparc/mm/hugetlbpage.c -@@ -28,7 +28,8 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp, +@@ -26,7 +26,8 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, @@ -11350,7 +11835,7 @@ index 9639964..806cd0c 100644 { unsigned long task_size = TASK_SIZE; struct vm_unmapped_area_info info; -@@ -38,15 +39,22 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp, +@@ -36,15 +37,22 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp, info.flags = 0; info.length = len; @@ -11374,7 +11859,7 @@ index 9639964..806cd0c 100644 info.high_limit = task_size; addr = vm_unmapped_area(&info); } -@@ -58,7 +66,8 @@ static unsigned long +@@ -56,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, @@ -11384,7 +11869,7 @@ index 9639964..806cd0c 100644 { struct mm_struct *mm = current->mm; unsigned long addr = addr0; -@@ -73,6 +82,7 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, +@@ -71,6 +80,7 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, info.high_limit = mm->mmap_base; info.align_mask = PAGE_MASK & ~HPAGE_MASK; info.align_offset = 0; @@ -11392,7 +11877,7 @@ index 9639964..806cd0c 100644 addr = vm_unmapped_area(&info); /* -@@ -85,6 +95,12 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, +@@ -83,6 +93,12 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, VM_BUG_ON(addr != -ENOMEM); info.flags = 0; info.low_limit = TASK_UNMAPPED_BASE; @@ -11405,7 +11890,7 @@ index 9639964..806cd0c 100644 info.high_limit = STACK_TOP32; addr = vm_unmapped_area(&info); } -@@ -99,6 +115,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, +@@ -97,6 +113,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, struct mm_struct *mm = current->mm; struct vm_area_struct *vma; unsigned long task_size = TASK_SIZE; @@ -11413,7 +11898,7 @@ index 9639964..806cd0c 100644 if (test_thread_flag(TIF_32BIT)) task_size = STACK_TOP32; -@@ -114,19 +131,22 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, +@@ -112,19 +129,22 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, return addr; } @@ -11441,7 +11926,7 @@ index 9639964..806cd0c 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 ed82eda..0d80e77 100644 +index 5322e53..f820c5e 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -188,9 +188,9 @@ unsigned long sparc64_kern_sec_context __read_mostly; @@ -11478,39 +11963,11 @@ index ed82eda..0d80e77 100644 #endif /* CONFIG_SMP */ #endif /* CONFIG_DEBUG_DCFLUSH */ } -diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c -index 218b6b2..01fe994 100644 ---- a/arch/sparc/net/bpf_jit_comp.c -+++ b/arch/sparc/net/bpf_jit_comp.c -@@ -497,9 +497,20 @@ void bpf_jit_compile(struct sk_filter *fp) - case BPF_S_ALU_MUL_K: /* A *= K */ - emit_alu_K(MUL, K); - break; -- case BPF_S_ALU_DIV_K: /* A /= K */ -- emit_alu_K(MUL, K); -- emit_read_y(r_A); -+ case BPF_S_ALU_DIV_K: /* A /= K with K != 0*/ -+ if (K == 1) -+ break; -+ emit_write_y(G0); -+#ifdef CONFIG_SPARC32 -+ /* The Sparc v8 architecture requires -+ * three instructions between a %y -+ * register write and the first use. -+ */ -+ emit_nop(); -+ emit_nop(); -+ emit_nop(); -+#endif -+ emit_alu_K(DIV, K); - break; - case BPF_S_ALU_DIV_X: /* A /= X; */ - emit_cmpi(r_X, 0); diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig -index d45a2c4..3c05a78 100644 +index b3692ce..e4517c9 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig -@@ -185,6 +185,7 @@ source "kernel/Kconfig.hz" +@@ -184,6 +184,7 @@ source "kernel/Kconfig.hz" config KEXEC bool "kexec system call" @@ -11594,10 +12051,10 @@ index 0cb3bba..7338b2d 100644 /* diff --git a/arch/um/Makefile b/arch/um/Makefile -index 133f7de..1d6f2f1 100644 +index 36e658a..71a5c5a 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile -@@ -62,6 +62,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ +@@ -72,6 +72,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include @@ -11608,18 +12065,6 @@ index 133f7de..1d6f2f1 100644 #This will adjust *FLAGS accordingly to the platform. include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) -diff --git a/arch/um/defconfig b/arch/um/defconfig -index 2665e6b..3e3822b 100644 ---- a/arch/um/defconfig -+++ b/arch/um/defconfig -@@ -51,7 +51,6 @@ CONFIG_X86_CMPXCHG=y - CONFIG_X86_L1_CACHE_SHIFT=5 - CONFIG_X86_XADD=y - CONFIG_X86_PPRO_FENCE=y --CONFIG_X86_WP_WORKS_OK=y - CONFIG_X86_INVLPG=y - CONFIG_X86_BSWAP=y - CONFIG_X86_POPAD_OK=y diff --git a/arch/um/include/asm/cache.h b/arch/um/include/asm/cache.h index 19e1bdd..3665b77 100644 --- a/arch/um/include/asm/cache.h @@ -11679,10 +12124,10 @@ index 0032f92..cd151e0 100644 #ifdef CONFIG_64BIT #define set_pud(pudptr, pudval) set_64bit((u64 *) (pudptr), pud_val(pudval)) diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c -index bbcef52..6a2a483 100644 +index eecc414..48adb87 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c -@@ -367,22 +367,6 @@ int singlestepping(void * t) +@@ -356,22 +356,6 @@ int singlestepping(void * t) return 2; } @@ -11723,10 +12168,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 f67e839..bfd4748 100644 +index 0952ecd..9cf578c 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -247,7 +247,7 @@ config X86_HT +@@ -249,7 +249,7 @@ config X86_HT config X86_32_LAZY_GS def_bool y @@ -11735,15 +12180,15 @@ index f67e839..bfd4748 100644 config ARCH_HWEIGHT_CFLAGS string -@@ -1099,6 +1099,7 @@ config MICROCODE_EARLY +@@ -602,6 +602,7 @@ config SCHED_OMIT_FRAME_POINTER - config X86_MSR - tristate "/dev/cpu/*/msr - Model-specific register support" -+ depends on !GRKERNSEC_KMEM + menuconfig HYPERVISOR_GUEST + bool "Linux guest support" ++ depends on !GRKERNSEC_CONFIG_AUTO || GRKERNSEC_CONFIG_VIRT_GUEST || (GRKERNSEC_CONFIG_VIRT_HOST && GRKERNSEC_CONFIG_VIRT_XEN) ---help--- - This device gives privileged processes access to the x86 - Model-Specific Registers (MSRs). It is a character device with -@@ -1122,7 +1123,7 @@ choice + Say Y here to enable options for running Linux under various hyper- + visors. This option enables basic hypervisor detection and platform +@@ -1127,7 +1128,7 @@ choice config NOHIGHMEM bool "off" @@ -11752,7 +12197,7 @@ index f67e839..bfd4748 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 -@@ -1159,7 +1160,7 @@ config NOHIGHMEM +@@ -1164,7 +1165,7 @@ config NOHIGHMEM config HIGHMEM4G bool "4GB" @@ -11761,7 +12206,7 @@ index f67e839..bfd4748 100644 ---help--- Select this if you have a 32-bit processor and between 1 and 4 gigabytes of physical RAM. -@@ -1212,7 +1213,7 @@ config PAGE_OFFSET +@@ -1217,7 +1218,7 @@ config PAGE_OFFSET hex default 0xB0000000 if VMSPLIT_3G_OPT default 0x80000000 if VMSPLIT_2G @@ -11770,7 +12215,7 @@ index f67e839..bfd4748 100644 default 0x40000000 if VMSPLIT_1G default 0xC0000000 depends on X86_32 -@@ -1614,6 +1615,7 @@ config SECCOMP +@@ -1619,6 +1620,7 @@ config SECCOMP config CC_STACKPROTECTOR bool "Enable -fstack-protector buffer overflow detection" @@ -11778,7 +12223,7 @@ index f67e839..bfd4748 100644 ---help--- This option turns on the -fstack-protector GCC feature. This feature puts, at the beginning of functions, a canary value on -@@ -1632,6 +1634,7 @@ source kernel/Kconfig.hz +@@ -1637,6 +1639,7 @@ source kernel/Kconfig.hz config KEXEC bool "kexec system call" @@ -11786,7 +12231,7 @@ index f67e839..bfd4748 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 -@@ -1733,6 +1736,8 @@ config X86_NEED_RELOCS +@@ -1738,6 +1741,8 @@ config X86_NEED_RELOCS config PHYSICAL_ALIGN hex "Alignment value to which kernel should be aligned" default "0x1000000" @@ -11795,7 +12240,7 @@ index f67e839..bfd4748 100644 range 0x2000 0x1000000 if X86_32 range 0x200000 0x1000000 if X86_64 ---help--- -@@ -1812,9 +1817,10 @@ config DEBUG_HOTPLUG_CPU0 +@@ -1817,9 +1822,10 @@ config DEBUG_HOTPLUG_CPU0 If unsure, say N. config COMPAT_VDSO @@ -11839,10 +12284,10 @@ index c026cca..14657ae 100644 config X86_MINIMUM_CPU_FAMILY int diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug -index 78d91af..8ceb94b 100644 +index 0f3621e..282f24b 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug -@@ -74,7 +74,7 @@ config X86_PTDUMP +@@ -84,7 +84,7 @@ config X86_PTDUMP config DEBUG_RODATA bool "Write protect kernel read-only data structures" default y @@ -11851,7 +12296,7 @@ index 78d91af..8ceb94b 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 -@@ -92,7 +92,7 @@ config DEBUG_RODATA_TEST +@@ -102,7 +102,7 @@ config DEBUG_RODATA_TEST config DEBUG_SET_MODULE_RONX bool "Set loadable kernel module data as NX and text as RO" @@ -11904,7 +12349,7 @@ index 57d0215..b4373fb 100644 +archprepare: + $(if $(LDFLAGS_BUILD_ID),,$(error $(OLD_LD))) diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile -index 6cf0111..f2e2398 100644 +index d9c1195..a26ca0d 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile @@ -65,6 +65,9 @@ KBUILD_CFLAGS := $(USERINCLUDE) -m32 -g -Os -D_SETUP -D__KERNEL__ \ @@ -11975,26 +12420,6 @@ index c8a6792..2402765 100644 KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ GCOV_PROFILE := n -diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c -index b7388a4..03844ec 100644 ---- a/arch/x86/boot/compressed/eboot.c -+++ b/arch/x86/boot/compressed/eboot.c -@@ -150,7 +150,6 @@ again: - *addr = max_addr; - } - --free_pool: - efi_call_phys1(sys_table->boottime->free_pool, map); - - fail: -@@ -214,7 +213,6 @@ static efi_status_t low_alloc(unsigned long size, unsigned long align, - if (i == map_size / desc_size) - status = EFI_NOT_FOUND; - --free_pool: - efi_call_phys1(sys_table->boottime->free_pool, map); - fail: - return status; diff --git a/arch/x86/boot/compressed/efi_stub_32.S b/arch/x86/boot/compressed/efi_stub_32.S index a53440e..c3dbf1e 100644 --- a/arch/x86/boot/compressed/efi_stub_32.S @@ -13836,10 +14261,10 @@ index a039d21..524b8b2 100644 ret ENDPROC(twofish_dec_blk) diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c -index bae3aba..c1788c1 100644 +index d21ff89..6da8e6e 100644 --- a/arch/x86/ia32/ia32_aout.c +++ b/arch/x86/ia32/ia32_aout.c -@@ -159,6 +159,8 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, +@@ -153,6 +153,8 @@ static int aout_core_dump(struct coredump_params *cprm) unsigned long dump_start, dump_size; struct user32 dump; @@ -13849,9 +14274,18 @@ index bae3aba..c1788c1 100644 set_fs(KERNEL_DS); has_dumped = 1; diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c -index 665a730..8e7a67a 100644 +index 2206757..85cbcfa 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c +@@ -218,7 +218,7 @@ asmlinkage long sys32_sigreturn(void) + if (__get_user(set.sig[0], &frame->sc.oldmask) + || (_COMPAT_NSIG_WORDS > 1 + && __copy_from_user((((char *) &set.sig) + 4), +- &frame->extramask, ++ frame->extramask, + sizeof(frame->extramask)))) + goto badframe; + @@ -338,7 +338,7 @@ static void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, sp -= frame_size; /* Align the stack pointer according to the i386 ABI, @@ -13861,6 +14295,15 @@ index 665a730..8e7a67a 100644 return (void __user *) sp; } +@@ -386,7 +386,7 @@ int ia32_setup_frame(int sig, struct ksignal *ksig, + restorer = VDSO32_SYMBOL(current->mm->context.vdso, + sigreturn); + else +- restorer = &frame->retcode; ++ restorer = frame->retcode; + } + + put_user_try { @@ -396,7 +396,7 @@ int ia32_setup_frame(int sig, struct ksignal *ksig, * These are actually not used anymore, but left because some * gdb versions depend on them as a marker. @@ -13889,7 +14332,7 @@ index 665a730..8e7a67a 100644 else - restorer = VDSO32_SYMBOL(current->mm->context.vdso, - rt_sigreturn); -+ restorer = &frame->retcode; ++ restorer = frame->retcode; put_user_ex(ptr_to_compat(restorer), &frame->pretcode); /* @@ -14382,10 +14825,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 722aa3b..c392d85 100644 +index b17f4f4..9620151 100644 --- a/arch/x86/include/asm/atomic.h +++ b/arch/x86/include/asm/atomic.h -@@ -22,7 +22,18 @@ +@@ -23,7 +23,18 @@ */ static inline int atomic_read(const atomic_t *v) { @@ -14405,7 +14848,7 @@ index 722aa3b..c392d85 100644 } /** -@@ -38,6 +49,18 @@ static inline void atomic_set(atomic_t *v, int i) +@@ -39,6 +50,18 @@ static inline void atomic_set(atomic_t *v, int i) } /** @@ -14424,7 +14867,7 @@ index 722aa3b..c392d85 100644 * atomic_add - add integer to atomic variable * @i: integer value to add * @v: pointer of type atomic_t -@@ -46,7 +69,29 @@ static inline void atomic_set(atomic_t *v, int i) +@@ -47,7 +70,29 @@ static inline void atomic_set(atomic_t *v, int i) */ static inline void atomic_add(int i, atomic_t *v) { @@ -14455,7 +14898,7 @@ index 722aa3b..c392d85 100644 : "+m" (v->counter) : "ir" (i)); } -@@ -60,7 +105,29 @@ static inline void atomic_add(int i, atomic_t *v) +@@ -61,7 +106,29 @@ static inline void atomic_add(int i, atomic_t *v) */ static inline void atomic_sub(int i, atomic_t *v) { @@ -14486,25 +14929,16 @@ index 722aa3b..c392d85 100644 : "+m" (v->counter) : "ir" (i)); } -@@ -78,7 +145,16 @@ static inline int atomic_sub_and_test(int i, atomic_t *v) +@@ -77,7 +144,7 @@ static inline void atomic_sub(int i, atomic_t *v) + */ + static inline int atomic_sub_and_test(int i, atomic_t *v) { - unsigned char c; +- GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, "er", i, "%0", "e"); ++ GEN_BINARY_RMWcc(LOCK_PREFIX "subl", LOCK_PREFIX "addl", v->counter, "er", i, "%0", "e"); + } -- asm volatile(LOCK_PREFIX "subl %2,%0; sete %1" -+ asm volatile(LOCK_PREFIX "subl %2,%0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ LOCK_PREFIX "addl %2,%0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sete %1\n" - : "+m" (v->counter), "=qm" (c) - : "ir" (i) : "memory"); - return c; -@@ -92,7 +168,27 @@ static inline int atomic_sub_and_test(int i, atomic_t *v) + /** +@@ -88,7 +155,27 @@ static inline int atomic_sub_and_test(int i, atomic_t *v) */ static inline void atomic_inc(atomic_t *v) { @@ -14533,7 +14967,7 @@ index 722aa3b..c392d85 100644 : "+m" (v->counter)); } -@@ -104,7 +200,27 @@ static inline void atomic_inc(atomic_t *v) +@@ -100,7 +187,27 @@ static inline void atomic_inc(atomic_t *v) */ static inline void atomic_dec(atomic_t *v) { @@ -14562,42 +14996,21 @@ index 722aa3b..c392d85 100644 : "+m" (v->counter)); } -@@ -120,7 +236,16 @@ static inline int atomic_dec_and_test(atomic_t *v) +@@ -114,7 +221,7 @@ static inline void atomic_dec(atomic_t *v) + */ + static inline int atomic_dec_and_test(atomic_t *v) { - unsigned char c; +- GEN_UNARY_RMWcc(LOCK_PREFIX "decl", v->counter, "%0", "e"); ++ GEN_UNARY_RMWcc(LOCK_PREFIX "decl", LOCK_PREFIX "incl", v->counter, "%0", "e"); + } -- asm volatile(LOCK_PREFIX "decl %0; sete %1" -+ asm volatile(LOCK_PREFIX "decl %0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ LOCK_PREFIX "incl %0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sete %1\n" - : "+m" (v->counter), "=qm" (c) - : : "memory"); - return c != 0; -@@ -138,7 +263,35 @@ static inline int atomic_inc_and_test(atomic_t *v) + /** +@@ -127,7 +234,20 @@ static inline int atomic_dec_and_test(atomic_t *v) + */ + static inline int atomic_inc_and_test(atomic_t *v) { - unsigned char c; - -- asm volatile(LOCK_PREFIX "incl %0; sete %1" -+ asm volatile(LOCK_PREFIX "incl %0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ LOCK_PREFIX "decl %0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sete %1\n" -+ : "+m" (v->counter), "=qm" (c) -+ : : "memory"); -+ return c != 0; +- GEN_UNARY_RMWcc(LOCK_PREFIX "incl", v->counter, "%0", "e"); ++ GEN_UNARY_RMWcc(LOCK_PREFIX "incl", LOCK_PREFIX "decl", v->counter, "%0", "e"); +} + +/** @@ -14610,32 +15023,20 @@ index 722aa3b..c392d85 100644 + */ +static inline int atomic_inc_and_test_unchecked(atomic_unchecked_t *v) +{ -+ unsigned char c; -+ -+ asm volatile(LOCK_PREFIX "incl %0\n" -+ "sete %1\n" - : "+m" (v->counter), "=qm" (c) - : : "memory"); - return c != 0; -@@ -157,7 +310,16 @@ static inline int atomic_add_negative(int i, atomic_t *v) - { - unsigned char c; ++ GEN_UNARY_RMWcc_unchecked(LOCK_PREFIX "incl", v->counter, "%0", "e"); + } -- asm volatile(LOCK_PREFIX "addl %2,%0; sets %1" -+ asm volatile(LOCK_PREFIX "addl %2,%0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ LOCK_PREFIX "subl %2,%0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sets %1\n" - : "+m" (v->counter), "=qm" (c) - : "ir" (i) : "memory"); - return c; -@@ -172,6 +334,18 @@ static inline int atomic_add_negative(int i, atomic_t *v) + /** +@@ -141,7 +261,7 @@ static inline int atomic_inc_and_test(atomic_t *v) + */ + static inline int atomic_add_negative(int i, atomic_t *v) + { +- GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, "er", i, "%0", "s"); ++ GEN_BINARY_RMWcc(LOCK_PREFIX "addl", LOCK_PREFIX "subl", v->counter, "er", i, "%0", "s"); + } + + /** +@@ -153,6 +273,18 @@ static inline int atomic_add_negative(int i, atomic_t *v) */ static inline int atomic_add_return(int i, atomic_t *v) { @@ -14654,7 +15055,7 @@ index 722aa3b..c392d85 100644 return i + xadd(&v->counter, i); } -@@ -188,9 +362,18 @@ static inline int atomic_sub_return(int i, atomic_t *v) +@@ -169,9 +301,18 @@ static inline int atomic_sub_return(int i, atomic_t *v) } #define atomic_inc_return(v) (atomic_add_return(1, v)) @@ -14674,7 +15075,7 @@ index 722aa3b..c392d85 100644 { return cmpxchg(&v->counter, old, new); } -@@ -200,6 +383,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); } @@ -14686,7 +15087,7 @@ index 722aa3b..c392d85 100644 /** * __atomic_add_unless - add unless the number is already a given value * @v: pointer of type atomic_t -@@ -209,14 +397,27 @@ static inline int atomic_xchg(atomic_t *v, int new) +@@ -190,14 +336,27 @@ static inline int atomic_xchg(atomic_t *v, int new) * Atomically adds @a to @v, so long as @v was not already @u. * Returns the old value of @v. */ @@ -14718,7 +15119,7 @@ index 722aa3b..c392d85 100644 if (likely(old == c)) break; c = old; -@@ -225,6 +426,49 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) +@@ -206,6 +365,49 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) } /** @@ -14768,7 +15169,7 @@ index 722aa3b..c392d85 100644 * atomic_inc_short - increment of a short integer * @v: pointer to type int * -@@ -253,14 +497,37 @@ static inline void atomic_or_long(unsigned long *v1, unsigned long v2) +@@ -234,14 +436,37 @@ static inline void atomic_or_long(unsigned long *v1, unsigned long v2) #endif /* These are x86-specific, used by some header files */ @@ -14989,7 +15390,7 @@ index b154de7..bf18a5a 100644 * @i: integer value to subtract * @v: pointer to type atomic64_t diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h -index 0e1cbfc..a891fc7 100644 +index 46e9052..ae45136 100644 --- a/arch/x86/include/asm/atomic64_64.h +++ b/arch/x86/include/asm/atomic64_64.h @@ -18,7 +18,19 @@ @@ -15092,25 +15493,16 @@ index 0e1cbfc..a891fc7 100644 : "=m" (v->counter) : "er" (i), "m" (v->counter)); } -@@ -74,7 +142,16 @@ static inline int atomic64_sub_and_test(long i, atomic64_t *v) +@@ -72,7 +140,7 @@ static inline void atomic64_sub(long i, atomic64_t *v) + */ + static inline int atomic64_sub_and_test(long i, atomic64_t *v) { - unsigned char c; +- GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, "er", i, "%0", "e"); ++ GEN_BINARY_RMWcc(LOCK_PREFIX "subq", LOCK_PREFIX "addq", v->counter, "er", i, "%0", "e"); + } -- asm volatile(LOCK_PREFIX "subq %2,%0; sete %1" -+ asm volatile(LOCK_PREFIX "subq %2,%0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ LOCK_PREFIX "addq %2,%0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sete %1\n" - : "=m" (v->counter), "=qm" (c) - : "er" (i), "m" (v->counter) : "memory"); - return c; -@@ -88,6 +165,27 @@ static inline int atomic64_sub_and_test(long i, atomic64_t *v) + /** +@@ -83,6 +151,27 @@ static inline int atomic64_sub_and_test(long i, atomic64_t *v) */ static inline void atomic64_inc(atomic64_t *v) { @@ -15138,7 +15530,7 @@ index 0e1cbfc..a891fc7 100644 asm volatile(LOCK_PREFIX "incq %0" : "=m" (v->counter) : "m" (v->counter)); -@@ -101,7 +199,28 @@ static inline void atomic64_inc(atomic64_t *v) +@@ -96,7 +185,28 @@ static inline void atomic64_inc(atomic64_t *v) */ static inline void atomic64_dec(atomic64_t *v) { @@ -15168,61 +15560,34 @@ index 0e1cbfc..a891fc7 100644 : "=m" (v->counter) : "m" (v->counter)); } -@@ -118,7 +237,16 @@ static inline int atomic64_dec_and_test(atomic64_t *v) +@@ -111,7 +221,7 @@ static inline void atomic64_dec(atomic64_t *v) + */ + static inline int atomic64_dec_and_test(atomic64_t *v) { - unsigned char c; +- GEN_UNARY_RMWcc(LOCK_PREFIX "decq", v->counter, "%0", "e"); ++ GEN_UNARY_RMWcc(LOCK_PREFIX "decq", LOCK_PREFIX "incq", v->counter, "%0", "e"); + } -- asm volatile(LOCK_PREFIX "decq %0; sete %1" -+ asm volatile(LOCK_PREFIX "decq %0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ LOCK_PREFIX "incq %0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sete %1\n" - : "=m" (v->counter), "=qm" (c) - : "m" (v->counter) : "memory"); - return c != 0; -@@ -136,7 +264,16 @@ static inline int atomic64_inc_and_test(atomic64_t *v) + /** +@@ -124,7 +234,7 @@ static inline int atomic64_dec_and_test(atomic64_t *v) + */ + static inline int atomic64_inc_and_test(atomic64_t *v) { - unsigned char c; +- GEN_UNARY_RMWcc(LOCK_PREFIX "incq", v->counter, "%0", "e"); ++ GEN_UNARY_RMWcc(LOCK_PREFIX "incq", LOCK_PREFIX "decq", v->counter, "%0", "e"); + } -- asm volatile(LOCK_PREFIX "incq %0; sete %1" -+ asm volatile(LOCK_PREFIX "incq %0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ LOCK_PREFIX "decq %0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sete %1\n" - : "=m" (v->counter), "=qm" (c) - : "m" (v->counter) : "memory"); - return c != 0; -@@ -155,7 +292,16 @@ static inline int atomic64_add_negative(long i, atomic64_t *v) + /** +@@ -138,7 +248,7 @@ static inline int atomic64_inc_and_test(atomic64_t *v) + */ + static inline int atomic64_add_negative(long i, atomic64_t *v) { - unsigned char c; +- GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, "er", i, "%0", "s"); ++ GEN_BINARY_RMWcc(LOCK_PREFIX "addq", LOCK_PREFIX "subq", v->counter, "er", i, "%0", "s"); + } -- asm volatile(LOCK_PREFIX "addq %2,%0; sets %1" -+ asm volatile(LOCK_PREFIX "addq %2,%0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ LOCK_PREFIX "subq %2,%0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sets %1\n" - : "=m" (v->counter), "=qm" (c) - : "er" (i), "m" (v->counter) : "memory"); - return c; -@@ -170,6 +316,18 @@ static inline int atomic64_add_negative(long i, atomic64_t *v) + /** +@@ -150,6 +260,18 @@ static inline int atomic64_add_negative(long i, atomic64_t *v) */ static inline long atomic64_add_return(long i, atomic64_t *v) { @@ -15241,7 +15606,7 @@ index 0e1cbfc..a891fc7 100644 return i + xadd(&v->counter, i); } -@@ -179,6 +337,10 @@ static inline long atomic64_sub_return(long i, atomic64_t *v) +@@ -159,6 +281,10 @@ static inline long atomic64_sub_return(long i, atomic64_t *v) } #define atomic64_inc_return(v) (atomic64_add_return(1, (v))) @@ -15252,7 +15617,7 @@ index 0e1cbfc..a891fc7 100644 #define atomic64_dec_return(v) (atomic64_sub_return(1, (v))) static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new) -@@ -186,6 +348,11 @@ static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new) +@@ -166,6 +292,11 @@ static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new) return cmpxchg(&v->counter, old, new); } @@ -15264,7 +15629,7 @@ index 0e1cbfc..a891fc7 100644 static inline long atomic64_xchg(atomic64_t *v, long new) { return xchg(&v->counter, new); -@@ -202,17 +369,30 @@ static inline long atomic64_xchg(atomic64_t *v, long new) +@@ -182,17 +313,30 @@ static inline long atomic64_xchg(atomic64_t *v, long new) */ static inline int atomic64_add_unless(atomic64_t *v, long a, long u) { @@ -15300,10 +15665,10 @@ index 0e1cbfc..a891fc7 100644 #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h -index 41639ce..ebce552 100644 +index 9fc1af7..fc71228 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h -@@ -48,7 +48,7 @@ +@@ -49,7 +49,7 @@ * a mask operation on a byte. */ #define IS_IMMEDIATE(nr) (__builtin_constant_p(nr)) @@ -15312,7 +15677,34 @@ index 41639ce..ebce552 100644 #define CONST_MASK(nr) (1 << ((nr) & 7)) /** -@@ -361,7 +361,7 @@ static int test_bit(int nr, const volatile unsigned long *addr); +@@ -205,7 +205,7 @@ static inline void change_bit(long nr, volatile unsigned long *addr) + */ + static inline int test_and_set_bit(long nr, volatile unsigned long *addr) + { +- GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, "Ir", nr, "%0", "c"); ++ GEN_BINARY_RMWcc_unchecked(LOCK_PREFIX "bts", *addr, "Ir", nr, "%0", "c"); + } + + /** +@@ -251,7 +251,7 @@ static inline int __test_and_set_bit(long nr, volatile unsigned long *addr) + */ + static inline int test_and_clear_bit(long nr, volatile unsigned long *addr) + { +- GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, "Ir", nr, "%0", "c"); ++ GEN_BINARY_RMWcc_unchecked(LOCK_PREFIX "btr", *addr, "Ir", nr, "%0", "c"); + } + + /** +@@ -304,7 +304,7 @@ static inline int __test_and_change_bit(long nr, volatile unsigned long *addr) + */ + static inline int test_and_change_bit(long nr, volatile unsigned long *addr) + { +- GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, "Ir", nr, "%0", "c"); ++ GEN_BINARY_RMWcc_unchecked(LOCK_PREFIX "btc", *addr, "Ir", nr, "%0", "c"); + } + + static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) +@@ -345,7 +345,7 @@ static int test_bit(int nr, const volatile unsigned long *addr); * * Undefined if no bit exists, so code should check against 0 first. */ @@ -15321,7 +15713,7 @@ index 41639ce..ebce552 100644 { asm("rep; bsf %1,%0" : "=r" (word) -@@ -375,7 +375,7 @@ static inline unsigned long __ffs(unsigned long word) +@@ -359,7 +359,7 @@ static inline unsigned long __ffs(unsigned long word) * * Undefined if no zero exists, so code should check against ~0UL first. */ @@ -15330,7 +15722,7 @@ index 41639ce..ebce552 100644 { asm("rep; bsf %1,%0" : "=r" (word) -@@ -389,7 +389,7 @@ static inline unsigned long ffz(unsigned long word) +@@ -373,7 +373,7 @@ static inline unsigned long ffz(unsigned long word) * * Undefined if no set bit exists, so code should check against 0 first. */ @@ -15339,7 +15731,7 @@ index 41639ce..ebce552 100644 { asm("bsr %1,%0" : "=r" (word) -@@ -452,7 +452,7 @@ static inline int ffs(int x) +@@ -436,7 +436,7 @@ static inline int ffs(int x) * set bit if value is nonzero. The last (most significant) bit is * at position 32. */ @@ -15348,7 +15740,7 @@ index 41639ce..ebce552 100644 { int r; -@@ -494,7 +494,7 @@ static inline int fls(int x) +@@ -478,7 +478,7 @@ static inline int fls(int x) * at position 64. */ #ifdef CONFIG_X86_64 @@ -15412,10 +15804,10 @@ index 9863ee3..4a1f8e1 100644 return _PAGE_CACHE_WC; else if (pg_flags == _PGMT_UC_MINUS) diff --git a/arch/x86/include/asm/calling.h b/arch/x86/include/asm/calling.h -index 0fa6750..cb7b2c3 100644 +index cb4c73b..c473c29 100644 --- a/arch/x86/include/asm/calling.h +++ b/arch/x86/include/asm/calling.h -@@ -80,103 +80,113 @@ For 32-bit we have the following conventions - kernel is built with +@@ -82,103 +82,113 @@ For 32-bit we have the following conventions - kernel is built with #define RSP 152 #define SS 160 @@ -15772,7 +16164,7 @@ index 89270b4..f0abf8e 100644 "6:\n" ".previous\n" diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h -index b90e5df..b462c91 100644 +index 50d033a..37deb26 100644 --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h @@ -4,6 +4,7 @@ @@ -15899,7 +16291,7 @@ index b90e5df..b462c91 100644 { gate_desc s; -@@ -321,8 +334,8 @@ static inline void set_nmi_gate(int gate, void *addr) +@@ -321,14 +334,14 @@ static inline void set_nmi_gate(int gate, void *addr) #endif #ifdef CONFIG_TRACING @@ -15910,8 +16302,15 @@ index b90e5df..b462c91 100644 static inline void write_trace_idt_entry(int entry, const gate_desc *gate) { write_idt_entry(trace_idt_table, entry, gate); -@@ -333,7 +346,7 @@ static inline void write_trace_idt_entry(int entry, const gate_desc *gate) } + +-static inline void _trace_set_gate(int gate, unsigned type, void *addr, ++static inline void _trace_set_gate(int gate, unsigned type, const void *addr, + unsigned dpl, unsigned ist, unsigned seg) + { + gate_desc s; +@@ -348,7 +361,7 @@ static inline void write_trace_idt_entry(int entry, const gate_desc *gate) + #define _trace_set_gate(gate, type, addr, dpl, ist, seg) #endif -static inline void _set_gate(int gate, unsigned type, void *addr, @@ -15919,16 +16318,19 @@ index b90e5df..b462c91 100644 unsigned dpl, unsigned ist, unsigned seg) { gate_desc s; -@@ -353,7 +366,7 @@ static inline void _set_gate(int gate, unsigned type, void *addr, - * Pentium F0 0F bugfix can have resulted in the mapped - * IDT being write-protected. - */ --static inline void set_intr_gate(unsigned int n, void *addr) -+static inline void set_intr_gate(unsigned int n, const void *addr) - { - BUG_ON((unsigned)n > 0xFF); - _set_gate(n, GATE_INTERRUPT, addr, 0, 0, __KERNEL_CS); -@@ -410,19 +423,19 @@ static inline void __alloc_intr_gate(unsigned int n, void *addr) +@@ -371,9 +384,9 @@ static inline void _set_gate(int gate, unsigned type, void *addr, + #define set_intr_gate(n, addr) \ + do { \ + BUG_ON((unsigned)n > 0xFF); \ +- _set_gate(n, GATE_INTERRUPT, (void *)addr, 0, 0, \ ++ _set_gate(n, GATE_INTERRUPT, (const void *)addr, 0, 0, \ + __KERNEL_CS); \ +- _trace_set_gate(n, GATE_INTERRUPT, (void *)trace_##addr,\ ++ _trace_set_gate(n, GATE_INTERRUPT, (const void *)trace_##addr,\ + 0, 0, __KERNEL_CS); \ + } while (0) + +@@ -401,19 +414,19 @@ static inline void alloc_system_vector(int vector) /* * This routine sets up an interrupt gate at directory privilege level 3. */ @@ -15951,7 +16353,7 @@ index b90e5df..b462c91 100644 { BUG_ON((unsigned)n > 0xFF); _set_gate(n, GATE_TRAP, addr, 0, 0, __KERNEL_CS); -@@ -431,16 +444,16 @@ static inline void set_trap_gate(unsigned int n, void *addr) +@@ -422,16 +435,16 @@ static inline void set_trap_gate(unsigned int n, void *addr) static inline void set_task_gate(unsigned int n, unsigned int gdt_entry) { BUG_ON((unsigned)n > 0xFF); @@ -15971,7 +16373,7 @@ index b90e5df..b462c91 100644 { BUG_ON((unsigned)n > 0xFF); _set_gate(n, GATE_INTERRUPT, addr, 0x3, ist, __KERNEL_CS); -@@ -512,4 +525,17 @@ static inline void load_current_idt(void) +@@ -503,4 +516,17 @@ static inline void load_current_idt(void) else load_idt((const struct desc_ptr *)&idt_descr); } @@ -16099,8 +16501,41 @@ index 77a99ac..39ff7f5 100644 +extern void machine_emergency_restart(void) __noreturn; #endif /* _ASM_X86_EMERGENCY_RESTART_H */ +diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h +index d3d7469..677ef72 100644 +--- a/arch/x86/include/asm/floppy.h ++++ b/arch/x86/include/asm/floppy.h +@@ -229,18 +229,18 @@ static struct fd_routine_l { + int (*_dma_setup)(char *addr, unsigned long size, int mode, int io); + } fd_routine[] = { + { +- request_dma, +- free_dma, +- get_dma_residue, +- dma_mem_alloc, +- hard_dma_setup ++ ._request_dma = request_dma, ++ ._free_dma = free_dma, ++ ._get_dma_residue = get_dma_residue, ++ ._dma_mem_alloc = dma_mem_alloc, ++ ._dma_setup = hard_dma_setup + }, + { +- vdma_request_dma, +- vdma_nop, +- vdma_get_dma_residue, +- vdma_mem_alloc, +- vdma_dma_setup ++ ._request_dma = vdma_request_dma, ++ ._free_dma = vdma_nop, ++ ._get_dma_residue = vdma_get_dma_residue, ++ ._dma_mem_alloc = vdma_mem_alloc, ++ ._dma_setup = vdma_dma_setup + } + }; + diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h -index 5be9f87..0320912 100644 +index cea1c76..6c0d79b 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h @@ -124,8 +124,11 @@ static inline void sanitize_i387_state(struct task_struct *tsk) @@ -16221,7 +16656,7 @@ index be27ba1..04a8801 100644 *uval = oldval; return ret; diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h -index 92b3bae..3866449 100644 +index cba45d9..86344ba 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h @@ -165,8 +165,8 @@ extern void setup_ioapic_dest(void); @@ -16333,7 +16768,7 @@ index 9454c16..e4100e3 100644 #define flush_insn_slot(p) do { } while (0) diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h -index 2d89e39..baee879 100644 +index 4ad6560..75c7bdd 100644 --- a/arch/x86/include/asm/local.h +++ b/arch/x86/include/asm/local.h @@ -10,33 +10,97 @@ typedef struct { @@ -16438,79 +16873,43 @@ index 2d89e39..baee879 100644 : "+m" (l->a.counter) : "ir" (i)); } -@@ -54,7 +118,16 @@ static inline int local_sub_and_test(long i, local_t *l) +@@ -52,7 +116,7 @@ static inline void local_sub(long i, local_t *l) + */ + static inline int local_sub_and_test(long i, local_t *l) { - unsigned char c; +- GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, "er", i, "%0", "e"); ++ GEN_BINARY_RMWcc(_ASM_SUB, _ASM_ADD, l->a.counter, "er", i, "%0", "e"); + } -- asm volatile(_ASM_SUB "%2,%0; sete %1" -+ asm volatile(_ASM_SUB "%2,%0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ _ASM_ADD "%2,%0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sete %1\n" - : "+m" (l->a.counter), "=qm" (c) - : "ir" (i) : "memory"); - return c; -@@ -72,7 +145,16 @@ static inline int local_dec_and_test(local_t *l) + /** +@@ -65,7 +129,7 @@ static inline int local_sub_and_test(long i, local_t *l) + */ + static inline int local_dec_and_test(local_t *l) { - unsigned char c; +- GEN_UNARY_RMWcc(_ASM_DEC, l->a.counter, "%0", "e"); ++ GEN_UNARY_RMWcc(_ASM_DEC, _ASM_INC, l->a.counter, "%0", "e"); + } -- asm volatile(_ASM_DEC "%0; sete %1" -+ asm volatile(_ASM_DEC "%0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ _ASM_INC "%0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sete %1\n" - : "+m" (l->a.counter), "=qm" (c) - : : "memory"); - return c != 0; -@@ -90,7 +172,16 @@ static inline int local_inc_and_test(local_t *l) + /** +@@ -78,7 +142,7 @@ static inline int local_dec_and_test(local_t *l) + */ + static inline int local_inc_and_test(local_t *l) { - unsigned char c; +- GEN_UNARY_RMWcc(_ASM_INC, l->a.counter, "%0", "e"); ++ GEN_UNARY_RMWcc(_ASM_INC, _ASM_DEC, l->a.counter, "%0", "e"); + } -- asm volatile(_ASM_INC "%0; sete %1" -+ asm volatile(_ASM_INC "%0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ _ASM_DEC "%0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sete %1\n" - : "+m" (l->a.counter), "=qm" (c) - : : "memory"); - return c != 0; -@@ -109,7 +200,16 @@ static inline int local_add_negative(long i, local_t *l) + /** +@@ -92,7 +156,7 @@ static inline int local_inc_and_test(local_t *l) + */ + static inline int local_add_negative(long i, local_t *l) { - unsigned char c; +- GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, "er", i, "%0", "s"); ++ GEN_BINARY_RMWcc(_ASM_ADD, _ASM_SUB, l->a.counter, "er", i, "%0", "s"); + } -- asm volatile(_ASM_ADD "%2,%0; sets %1" -+ asm volatile(_ASM_ADD "%2,%0\n" -+ -+#ifdef CONFIG_PAX_REFCOUNT -+ "jno 0f\n" -+ _ASM_SUB "%2,%0\n" -+ "int $4\n0:\n" -+ _ASM_EXTABLE(0b, 0b) -+#endif -+ -+ "sets %1\n" - : "+m" (l->a.counter), "=qm" (c) - : "ir" (i) : "memory"); - return c; -@@ -125,6 +225,30 @@ static inline int local_add_negative(long i, local_t *l) + /** +@@ -105,6 +169,30 @@ static inline int local_add_negative(long i, local_t *l) static inline long local_add_return(long i, local_t *l) { long __i = i; @@ -16541,7 +16940,7 @@ index 2d89e39..baee879 100644 asm volatile(_ASM_XADD "%0, %1;" : "+r" (i), "+m" (l->a.counter) : : "memory"); -@@ -141,6 +265,8 @@ static inline long local_sub_return(long i, local_t *l) +@@ -121,6 +209,8 @@ static inline long local_sub_return(long i, local_t *l) #define local_cmpxchg(l, o, n) \ (cmpxchg_local(&((l)->a.counter), (o), (n))) @@ -16965,7 +17364,7 @@ index 401f350..dee5d13 100644 #endif /* __ASSEMBLY__ */ diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h -index aab8f67..2531748 100644 +index aab8f67..0fb0ee4 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -84,7 +84,7 @@ struct pv_init_ops { @@ -16973,16 +17372,23 @@ index aab8f67..2531748 100644 unsigned (*patch)(u8 type, u16 clobber, void *insnbuf, unsigned long addr, unsigned len); -}; -+} __no_const; ++} __no_const __no_randomize_layout; struct pv_lazy_ops { -@@ -98,7 +98,7 @@ struct pv_time_ops { +@@ -92,13 +92,13 @@ struct pv_lazy_ops { + void (*enter)(void); + void (*leave)(void); + void (*flush)(void); +-}; ++} __no_randomize_layout; + + struct pv_time_ops { unsigned long long (*sched_clock)(void); unsigned long long (*steal_clock)(int cpu); unsigned long (*get_tsc_khz)(void); -}; -+} __no_const; ++} __no_const __no_randomize_layout; struct pv_cpu_ops { /* hooks for various privileged instructions */ @@ -16991,16 +17397,25 @@ index aab8f67..2531748 100644 void (*start_context_switch)(struct task_struct *prev); void (*end_context_switch)(struct task_struct *next); -}; -+} __no_const; ++} __no_const __no_randomize_layout; struct pv_irq_ops { /* +@@ -215,7 +215,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 @@ -223,7 +223,7 @@ struct pv_apic_ops { unsigned long start_eip, unsigned long start_esp); #endif -}; -+} __no_const; ++} __no_const __no_randomize_layout; struct pv_mmu_ops { unsigned long (*read_cr2)(void); @@ -17012,21 +17427,49 @@ index aab8f67..2531748 100644 #endif /* PAGETABLE_LEVELS == 4 */ #endif /* PAGETABLE_LEVELS >= 3 */ -@@ -324,6 +325,12 @@ struct pv_mmu_ops { +@@ -324,7 +325,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); +-}; + +#ifdef CONFIG_PAX_KERNEXEC + unsigned long (*pax_open_kernel)(void); + unsigned long (*pax_close_kernel)(void); +#endif + - }; ++} __no_randomize_layout; struct arch_spinlock; + #ifdef CONFIG_SMP +@@ -336,11 +343,14 @@ typedef u16 __ticket_t; + struct pv_lock_ops { + struct paravirt_callee_save lock_spinning; + void (*unlock_kick)(struct arch_spinlock *lock, __ticket_t ticket); +-}; ++} __no_randomize_layout; + + /* This contains all the paravirt structures: we get a convenient + * number for each function using the offset which we use to indicate +- * what to patch. */ ++ * what to patch. ++ * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c ++ */ ++ + struct paravirt_patch_template { + struct pv_init_ops pv_init_ops; + struct pv_time_ops pv_time_ops; +@@ -349,7 +359,7 @@ struct paravirt_patch_template { + struct pv_apic_ops pv_apic_ops; + struct pv_mmu_ops pv_mmu_ops; + struct pv_lock_ops pv_lock_ops; +-}; ++} __no_randomize_layout; + + extern struct pv_info pv_info; + extern struct pv_init_ops pv_init_ops; diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h -index b4389a4..7024269 100644 +index c4412e9..90e88c5 100644 --- a/arch/x86/include/asm/pgalloc.h +++ b/arch/x86/include/asm/pgalloc.h @@ -63,6 +63,13 @@ static inline void pmd_populate_kernel(struct mm_struct *mm, @@ -17043,7 +17486,7 @@ index b4389a4..7024269 100644 set_pmd(pmd, __pmd(__pa(pte) | _PAGE_TABLE)); } -@@ -99,12 +106,22 @@ static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd, +@@ -108,12 +115,22 @@ static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd, #ifdef CONFIG_X86_PAE extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd); @@ -17066,7 +17509,7 @@ index b4389a4..7024269 100644 #endif /* CONFIG_X86_PAE */ #if PAGETABLE_LEVELS > 3 -@@ -114,6 +131,12 @@ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) +@@ -123,6 +140,12 @@ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud))); } @@ -17115,7 +17558,7 @@ index 81bb91b..9392125 100644 /* diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h -index bbc8b12..f228861 100644 +index 5ad38ad..71db3f2 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -45,6 +45,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page); @@ -17238,7 +17681,7 @@ index bbc8b12..f228861 100644 #include #include #include -@@ -570,7 +645,7 @@ static inline unsigned long pud_page_vaddr(pud_t pud) +@@ -580,7 +655,7 @@ static inline unsigned long pud_page_vaddr(pud_t pud) * Currently stuck as a macro due to indirect forward reference to * linux/mmzone.h's __section_mem_map_addr() definition: */ @@ -17247,7 +17690,7 @@ index bbc8b12..f228861 100644 /* Find an entry in the second-level page table.. */ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) -@@ -610,7 +685,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd) +@@ -620,7 +695,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: */ @@ -17256,7 +17699,7 @@ index bbc8b12..f228861 100644 /* to find an entry in a page-table-directory. */ static inline unsigned long pud_index(unsigned long address) -@@ -625,7 +700,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address) +@@ -635,7 +710,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address) static inline int pgd_bad(pgd_t pgd) { @@ -17265,7 +17708,7 @@ index bbc8b12..f228861 100644 } static inline int pgd_none(pgd_t pgd) -@@ -648,7 +723,12 @@ static inline int pgd_none(pgd_t pgd) +@@ -658,7 +733,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; */ @@ -17279,7 +17722,7 @@ index bbc8b12..f228861 100644 /* * a shortcut which implies the use of the kernel's pgd, instead * of a process's -@@ -659,6 +739,23 @@ static inline int pgd_none(pgd_t pgd) +@@ -669,6 +749,23 @@ static inline int pgd_none(pgd_t pgd) #define KERNEL_PGD_BOUNDARY pgd_index(PAGE_OFFSET) #define KERNEL_PGD_PTRS (PTRS_PER_PGD - KERNEL_PGD_BOUNDARY) @@ -17303,7 +17746,7 @@ index bbc8b12..f228861 100644 #ifndef __ASSEMBLY__ extern int direct_gbpages; -@@ -825,11 +922,24 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm, +@@ -835,11 +932,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. */ @@ -17480,7 +17923,7 @@ index 2d88344..4679fc3 100644 #define EARLY_DYNAMIC_PAGE_TABLES 64 diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h -index 0ecac25..306c276 100644 +index 840c127..a8f297b 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -16,13 +16,12 @@ @@ -17513,14 +17956,14 @@ index 0ecac25..306c276 100644 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) #define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX) -#else -+#elif defined(CONFIG_KMEMCHECK) ++#elif defined(CONFIG_KMEMCHECK) || defined(CONFIG_MEM_SOFT_DIRTY) #define _PAGE_NX (_AT(pteval_t, 0)) +#else +#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_HIDDEN) #endif #define _PAGE_FILE (_AT(pteval_t, 1) << _PAGE_BIT_FILE) -@@ -146,6 +146,9 @@ +@@ -147,6 +147,9 @@ #define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | \ _PAGE_ACCESSED) @@ -17530,7 +17973,7 @@ index 0ecac25..306c276 100644 #define __PAGE_KERNEL_EXEC \ (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL) #define __PAGE_KERNEL (__PAGE_KERNEL_EXEC | _PAGE_NX) -@@ -156,7 +159,7 @@ +@@ -157,7 +160,7 @@ #define __PAGE_KERNEL_WC (__PAGE_KERNEL | _PAGE_CACHE_WC) #define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_PCD | _PAGE_PWT) #define __PAGE_KERNEL_UC_MINUS (__PAGE_KERNEL | _PAGE_PCD) @@ -17539,7 +17982,7 @@ index 0ecac25..306c276 100644 #define __PAGE_KERNEL_VVAR (__PAGE_KERNEL_RO | _PAGE_USER) #define __PAGE_KERNEL_VVAR_NOCACHE (__PAGE_KERNEL_VVAR | _PAGE_PCD | _PAGE_PWT) #define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE) -@@ -218,8 +221,8 @@ +@@ -219,8 +222,8 @@ * bits are combined, this will alow user to access the high address mapped * VDSO in the presence of CONFIG_COMPAT_VDSO */ @@ -17550,7 +17993,7 @@ index 0ecac25..306c276 100644 #define PGD_IDENT_ATTR 0x001 /* PRESENT (no other attributes) */ #endif -@@ -257,7 +260,17 @@ static inline pgdval_t pgd_flags(pgd_t pgd) +@@ -258,7 +261,17 @@ static inline pgdval_t pgd_flags(pgd_t pgd) { return native_pgd_val(pgd) & PTE_FLAGS_MASK; } @@ -17568,7 +18011,7 @@ index 0ecac25..306c276 100644 #if PAGETABLE_LEVELS > 3 typedef struct { pudval_t pud; } pud_t; -@@ -271,8 +284,6 @@ static inline pudval_t native_pud_val(pud_t pud) +@@ -272,8 +285,6 @@ static inline pudval_t native_pud_val(pud_t pud) return pud.pud; } #else @@ -17577,7 +18020,7 @@ index 0ecac25..306c276 100644 static inline pudval_t native_pud_val(pud_t pud) { return native_pgd_val(pud.pgd); -@@ -292,8 +303,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) +@@ -293,8 +304,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) return pmd.pmd; } #else @@ -17586,7 +18029,7 @@ index 0ecac25..306c276 100644 static inline pmdval_t native_pmd_val(pmd_t pmd) { return native_pgd_val(pmd.pud.pgd); -@@ -333,7 +342,6 @@ typedef struct page *pgtable_t; +@@ -334,7 +343,6 @@ typedef struct page *pgtable_t; extern pteval_t __supported_pte_mask; extern void set_nx(void); @@ -17594,10 +18037,32 @@ index 0ecac25..306c276 100644 #define pgprot_writecombine pgprot_writecombine extern pgprot_t pgprot_writecombine(pgprot_t prot); +diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h +index c8b0519..fd29e73 100644 +--- a/arch/x86/include/asm/preempt.h ++++ b/arch/x86/include/asm/preempt.h +@@ -87,7 +87,7 @@ static __always_inline void __preempt_count_sub(int val) + */ + static __always_inline bool __preempt_count_dec_and_test(void) + { +- GEN_UNARY_RMWcc("decl", __preempt_count, __percpu_arg(0), "e"); ++ GEN_UNARY_RMWcc("decl", "incl", __preempt_count, __percpu_arg(0), "e"); + } + + /* diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h -index 987c75e..2723054 100644 +index 7b034a4..4fe3e3f 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h +@@ -128,7 +128,7 @@ struct cpuinfo_x86 { + /* Index into per_cpu list: */ + u16 cpu_index; + u32 microcode; +-} __attribute__((__aligned__(SMP_CACHE_BYTES))); ++} __attribute__((__aligned__(SMP_CACHE_BYTES))) __randomize_layout; + + #define X86_VENDOR_INTEL 0 + #define X86_VENDOR_CYRIX 1 @@ -199,9 +199,21 @@ static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, : "memory"); } @@ -17638,7 +18103,7 @@ index 987c75e..2723054 100644 #endif #ifdef CONFIG_X86_32 unsigned long ip; -@@ -553,29 +566,8 @@ static inline void load_sp0(struct tss_struct *tss, +@@ -562,29 +575,8 @@ static inline void load_sp0(struct tss_struct *tss, extern unsigned long mmu_cr4_features; extern u32 *trampoline_cr4_features; @@ -17670,7 +18135,7 @@ index 987c75e..2723054 100644 typedef struct { unsigned long seg; -@@ -824,11 +816,18 @@ static inline void spin_lock_prefetch(const void *x) +@@ -833,11 +825,18 @@ static inline void spin_lock_prefetch(const void *x) */ #define TASK_SIZE PAGE_OFFSET #define TASK_SIZE_MAX TASK_SIZE @@ -17691,7 +18156,7 @@ index 987c75e..2723054 100644 .vm86_info = NULL, \ .sysenter_cs = __KERNEL_CS, \ .io_bitmap_ptr = NULL, \ -@@ -842,7 +841,7 @@ static inline void spin_lock_prefetch(const void *x) +@@ -851,7 +850,7 @@ static inline void spin_lock_prefetch(const void *x) */ #define INIT_TSS { \ .x86_tss = { \ @@ -17700,7 +18165,7 @@ index 987c75e..2723054 100644 .ss0 = __KERNEL_DS, \ .ss1 = __KERNEL_CS, \ .io_bitmap_base = INVALID_IO_BITMAP_OFFSET, \ -@@ -853,11 +852,7 @@ static inline void spin_lock_prefetch(const void *x) +@@ -862,11 +861,7 @@ static inline void spin_lock_prefetch(const void *x) extern unsigned long thread_saved_pc(struct task_struct *tsk); #define THREAD_SIZE_LONGS (THREAD_SIZE/sizeof(unsigned long)) @@ -17713,7 +18178,7 @@ index 987c75e..2723054 100644 /* * The below -8 is to reserve 8 bytes on top of the ring0 stack. -@@ -872,7 +867,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); +@@ -881,7 +876,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); #define task_pt_regs(task) \ ({ \ struct pt_regs *__regs__; \ @@ -17722,7 +18187,7 @@ index 987c75e..2723054 100644 __regs__ - 1; \ }) -@@ -882,13 +877,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); +@@ -891,13 +886,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); /* * User space process size. 47bits minus one guard page. */ @@ -17738,7 +18203,7 @@ index 987c75e..2723054 100644 #define TASK_SIZE (test_thread_flag(TIF_ADDR32) ? \ IA32_PAGE_OFFSET : TASK_SIZE_MAX) -@@ -899,11 +894,11 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); +@@ -908,11 +903,11 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); #define STACK_TOP_MAX TASK_SIZE_MAX #define INIT_THREAD { \ @@ -17752,7 +18217,7 @@ index 987c75e..2723054 100644 } /* -@@ -931,6 +926,10 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip, +@@ -940,6 +935,10 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip, */ #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3)) @@ -17763,7 +18228,7 @@ index 987c75e..2723054 100644 #define KSTK_EIP(task) (task_pt_regs(task)->ip) /* Get/set a process' ability to use the timestamp counter instruction */ -@@ -957,7 +956,7 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves) +@@ -966,7 +965,7 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves) return 0; } @@ -17772,7 +18237,7 @@ index 987c75e..2723054 100644 extern void free_init_pages(char *what, unsigned long begin, unsigned long end); void default_idle(void); -@@ -967,6 +966,6 @@ bool xen_set_default_idle(void); +@@ -976,6 +975,6 @@ bool xen_set_default_idle(void); #define xen_set_default_idle 0 #endif @@ -17899,6 +18364,120 @@ index a82c4f1..ac45053 100644 extern struct machine_ops machine_ops; +diff --git a/arch/x86/include/asm/rmwcc.h b/arch/x86/include/asm/rmwcc.h +index 8f7866a..e442f20 100644 +--- a/arch/x86/include/asm/rmwcc.h ++++ b/arch/x86/include/asm/rmwcc.h +@@ -3,7 +3,34 @@ + + #ifdef CC_HAVE_ASM_GOTO + +-#define __GEN_RMWcc(fullop, var, cc, ...) \ ++#ifdef CONFIG_PAX_REFCOUNT ++#define __GEN_RMWcc(fullop, fullantiop, var, cc, ...) \ ++do { \ ++ asm_volatile_goto (fullop \ ++ ";jno 0f\n" \ ++ fullantiop \ ++ ";int $4\n0:\n" \ ++ _ASM_EXTABLE(0b, 0b) \ ++ ";j" cc " %l[cc_label]" \ ++ : : "m" (var), ## __VA_ARGS__ \ ++ : "memory" : cc_label); \ ++ return 0; \ ++cc_label: \ ++ return 1; \ ++} while (0) ++#else ++#define __GEN_RMWcc(fullop, fullantiop, var, cc, ...) \ ++do { \ ++ asm_volatile_goto (fullop ";j" cc " %l[cc_label]" \ ++ : : "m" (var), ## __VA_ARGS__ \ ++ : "memory" : cc_label); \ ++ return 0; \ ++cc_label: \ ++ return 1; \ ++} while (0) ++#endif ++ ++#define __GEN_RMWcc_unchecked(fullop, var, cc, ...) \ + do { \ + asm_volatile_goto (fullop "; j" cc " %l[cc_label]" \ + : : "m" (var), ## __VA_ARGS__ \ +@@ -13,15 +40,46 @@ cc_label: \ + return 1; \ + } while (0) + +-#define GEN_UNARY_RMWcc(op, var, arg0, cc) \ +- __GEN_RMWcc(op " " arg0, var, cc) ++#define GEN_UNARY_RMWcc(op, antiop, var, arg0, cc) \ ++ __GEN_RMWcc(op " " arg0, antiop " " arg0, var, cc) + +-#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \ +- __GEN_RMWcc(op " %1, " arg0, var, cc, vcon (val)) ++#define GEN_UNARY_RMWcc_unchecked(op, var, arg0, cc) \ ++ __GEN_RMWcc_unchecked(op " " arg0, var, cc) ++ ++#define GEN_BINARY_RMWcc(op, antiop, var, vcon, val, arg0, cc) \ ++ __GEN_RMWcc(op " %1, " arg0, antiop " %1, " arg0, var, cc, vcon (val)) ++ ++#define GEN_BINARY_RMWcc_unchecked(op, var, vcon, val, arg0, cc) \ ++ __GEN_RMWcc_unchecked(op " %1, " arg0, var, cc, vcon (val)) + + #else /* !CC_HAVE_ASM_GOTO */ + +-#define __GEN_RMWcc(fullop, var, cc, ...) \ ++#ifdef CONFIG_PAX_REFCOUNT ++#define __GEN_RMWcc(fullop, fullantiop, var, cc, ...) \ ++do { \ ++ char c; \ ++ asm volatile (fullop \ ++ ";jno 0f\n" \ ++ fullantiop \ ++ ";int $4\n0:\n" \ ++ _ASM_EXTABLE(0b, 0b) \ ++ "; set" cc " %1" \ ++ : "+m" (var), "=qm" (c) \ ++ : __VA_ARGS__ : "memory"); \ ++ return c != 0; \ ++} while (0) ++#else ++#define __GEN_RMWcc(fullop, fullantiop, var, cc, ...) \ ++do { \ ++ char c; \ ++ asm volatile (fullop "; set" cc " %1" \ ++ : "+m" (var), "=qm" (c) \ ++ : __VA_ARGS__ : "memory"); \ ++ return c != 0; \ ++} while (0) ++#endif ++ ++#define __GEN_RMWcc_unchecked(fullop, var, cc, ...) \ + do { \ + char c; \ + asm volatile (fullop "; set" cc " %1" \ +@@ -30,11 +88,17 @@ do { \ + return c != 0; \ + } while (0) + +-#define GEN_UNARY_RMWcc(op, var, arg0, cc) \ +- __GEN_RMWcc(op " " arg0, var, cc) ++#define GEN_UNARY_RMWcc(op, antiop, var, arg0, cc) \ ++ __GEN_RMWcc(op " " arg0, antiop " " arg0, var, cc) ++ ++#define GEN_UNARY_RMWcc_unchecked(op, var, arg0, cc) \ ++ __GEN_RMWcc_unchecked(op " " arg0, var, cc) ++ ++#define GEN_BINARY_RMWcc(op, antiop, var, vcon, val, arg0, cc) \ ++ __GEN_RMWcc(op " %2, " arg0, antiop " %2, " arg0, var, cc, vcon (val)) + +-#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \ +- __GEN_RMWcc(op " %2, " arg0, var, cc, vcon (val)) ++#define GEN_BINARY_RMWcc_unchecked(op, var, vcon, val, arg0, cc) \ ++ __GEN_RMWcc_unchecked(op " %2, " arg0, var, cc, vcon (val)) + + #endif /* CC_HAVE_ASM_GOTO */ + diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h index cad82c9..2e5c5c1 100644 --- a/arch/x86/include/asm/rwsem.h @@ -18020,7 +18599,7 @@ index cad82c9..2e5c5c1 100644 #endif /* __KERNEL__ */ diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h -index c48a950..bc40804 100644 +index 6f1c3a8..7744f19 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h @@ -64,10 +64,15 @@ @@ -18106,7 +18685,7 @@ index c48a950..bc40804 100644 #define __USER_DS (GDT_ENTRY_DEFAULT_USER_DS*8+3) #define __USER_CS (GDT_ENTRY_DEFAULT_USER_CS*8+3) #ifndef CONFIG_PARAVIRT -@@ -265,7 +284,7 @@ static inline unsigned long get_limit(unsigned long segment) +@@ -268,7 +287,7 @@ static inline unsigned long get_limit(unsigned long segment) { unsigned long __limit; asm("lsll %1,%0" : "=r" (__limit) : "r" (segment)); @@ -18411,7 +18990,7 @@ index d7f3b3b..3cc39f1 100644 __switch_canary_iparam \ : "memory", "cc" __EXTRA_CLOBBER) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h -index 2781119..618b59b 100644 +index 3ba3de4..6c113b2 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -10,6 +10,7 @@ @@ -18430,7 +19009,7 @@ index 2781119..618b59b 100644 struct exec_domain *exec_domain; /* execution domain */ __u32 flags; /* low level flags */ __u32 status; /* thread synchronous flags */ -@@ -33,19 +33,13 @@ struct thread_info { +@@ -32,19 +32,13 @@ struct thread_info { mm_segment_t addr_limit; struct restart_block restart_block; void __user *sysenter_return; @@ -18452,7 +19031,7 @@ index 2781119..618b59b 100644 .exec_domain = &default_exec_domain, \ .flags = 0, \ .cpu = 0, \ -@@ -56,7 +50,7 @@ struct thread_info { +@@ -55,7 +49,7 @@ struct thread_info { }, \ } @@ -18461,7 +19040,7 @@ index 2781119..618b59b 100644 #define init_stack (init_thread_union.stack) #else /* !__ASSEMBLY__ */ -@@ -96,6 +90,7 @@ struct thread_info { +@@ -95,6 +89,7 @@ struct thread_info { #define TIF_SYSCALL_TRACEPOINT 28 /* syscall tracepoint instrumentation */ #define TIF_ADDR32 29 /* 32-bit address space on 64 bits */ #define TIF_X32 30 /* 32-bit native x86-64 binary */ @@ -18469,7 +19048,7 @@ index 2781119..618b59b 100644 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) -@@ -119,17 +114,18 @@ struct thread_info { +@@ -118,17 +113,18 @@ struct thread_info { #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) #define _TIF_ADDR32 (1 << TIF_ADDR32) #define _TIF_X32 (1 << TIF_X32) @@ -18490,7 +19069,7 @@ index 2781119..618b59b 100644 /* work to do on interrupt/exception return */ #define _TIF_WORK_MASK \ -@@ -140,7 +136,7 @@ struct thread_info { +@@ -139,7 +135,7 @@ struct thread_info { /* work to do on any return to user space */ #define _TIF_ALLWORK_MASK \ ((0x0000FFFF & ~_TIF_SECCOMP) | _TIF_SYSCALL_TRACEPOINT | \ @@ -18499,9 +19078,9 @@ index 2781119..618b59b 100644 /* Only used for 64 bit */ #define _TIF_DO_NOTIFY_MASK \ -@@ -156,45 +152,40 @@ struct thread_info { - - #define PREEMPT_ACTIVE 0x10000000 +@@ -153,45 +149,40 @@ struct thread_info { + #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY) + #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW) -#ifdef CONFIG_X86_32 - @@ -18570,7 +19149,7 @@ index 2781119..618b59b 100644 /* * macros/functions for gaining access to the thread information structure * preempt_count needs to be 1 initially, until the scheduler is functional. -@@ -202,27 +193,8 @@ static inline struct thread_info *current_thread_info(void) +@@ -199,27 +190,8 @@ static inline struct thread_info *current_thread_info(void) #ifndef __ASSEMBLY__ DECLARE_PER_CPU(unsigned long, kernel_stack); @@ -18600,7 +19179,7 @@ index 2781119..618b59b 100644 #endif #endif /* !X86_32 */ -@@ -281,5 +253,12 @@ static inline bool is_ia32_task(void) +@@ -278,5 +250,12 @@ static inline bool is_ia32_task(void) extern void arch_task_cache_init(void); extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); extern void arch_release_task_struct(struct task_struct *tsk); @@ -18614,7 +19193,7 @@ index 2781119..618b59b 100644 #endif #endif /* _ASM_X86_THREAD_INFO_H */ diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h -index e6d90ba..0897f44 100644 +index e6d90ba..f81f114 100644 --- a/arch/x86/include/asm/tlbflush.h +++ b/arch/x86/include/asm/tlbflush.h @@ -17,18 +17,44 @@ @@ -18668,11 +19247,10 @@ index e6d90ba..0897f44 100644 } static inline void __native_flush_tlb_global(void) -@@ -49,6 +75,42 @@ static inline void __native_flush_tlb_global(void) +@@ -49,6 +75,41 @@ static inline void __native_flush_tlb_global(void) static inline void __native_flush_tlb_single(unsigned long addr) { -+ + if (static_cpu_has(X86_FEATURE_INVPCID)) { + u64 descriptor[2]; + @@ -18712,14 +19290,14 @@ index e6d90ba..0897f44 100644 } diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h -index 5838fa9..f7ae572 100644 +index 8ec57c0..451bcfc 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h @@ -7,6 +7,7 @@ #include #include #include -+#include ++#include #include #include #include @@ -18736,13 +19314,14 @@ index 5838fa9..f7ae572 100644 #define segment_eq(a, b) ((a).seg == (b).seg) -@@ -77,8 +83,33 @@ +@@ -77,8 +83,34 @@ * checks that the pointer is in the user space range - after calling * this function, memory access functions may still return -EFAULT. */ -#define access_ok(type, addr, size) \ - (likely(__range_not_ok(addr, size, user_addr_max()) == 0)) -+#define __access_ok(type, addr, size) (likely(__range_not_ok(addr, size, user_addr_max()) == 0)) ++extern int _cond_resched(void); ++#define access_ok_noprefault(type, addr, size) (likely(__range_not_ok(addr, size, user_addr_max()) == 0)) +#define access_ok(type, addr, size) \ +({ \ + long __size = size; \ @@ -18755,7 +19334,7 @@ index 5838fa9..f7ae572 100644 + char __c_ao; \ + __addr_ao += PAGE_SIZE; \ + if (__size > PAGE_SIZE) \ -+ cond_resched(); \ ++ _cond_resched(); \ + if (__get_user(__c_ao, (char __user *)__addr)) \ + break; \ + if (type != VERIFY_WRITE) { \ @@ -18772,7 +19351,7 @@ index 5838fa9..f7ae572 100644 /* * The exception table consists of pairs of addresses relative to the -@@ -168,10 +199,12 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL)) +@@ -168,10 +200,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(); \ @@ -18785,7 +19364,7 @@ index 5838fa9..f7ae572 100644 __ret_gu; \ }) -@@ -179,13 +212,21 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL)) +@@ -179,13 +213,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") @@ -18810,7 +19389,7 @@ index 5838fa9..f7ae572 100644 "3: " ASM_CLAC "\n" \ ".section .fixup,\"ax\"\n" \ "4: movl %3,%0\n" \ -@@ -198,8 +239,8 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL)) +@@ -198,8 +240,8 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL)) #define __put_user_asm_ex_u64(x, addr) \ asm volatile(ASM_STAC "\n" \ @@ -18821,7 +19400,7 @@ index 5838fa9..f7ae572 100644 "3: " ASM_CLAC "\n" \ _ASM_EXTABLE_EX(1b, 2b) \ _ASM_EXTABLE_EX(2b, 3b) \ -@@ -249,7 +290,8 @@ extern void __put_user_8(void); +@@ -249,7 +291,8 @@ extern void __put_user_8(void); __typeof__(*(ptr)) __pu_val; \ __chk_user_ptr(ptr); \ might_fault(); \ @@ -18831,7 +19410,7 @@ index 5838fa9..f7ae572 100644 switch (sizeof(*(ptr))) { \ case 1: \ __put_user_x(1, __pu_val, ptr, __ret_pu); \ -@@ -267,6 +309,7 @@ extern void __put_user_8(void); +@@ -267,6 +310,7 @@ extern void __put_user_8(void); __put_user_x(X, __pu_val, ptr, __ret_pu); \ break; \ } \ @@ -18839,7 +19418,7 @@ index 5838fa9..f7ae572 100644 __ret_pu; \ }) -@@ -347,8 +390,10 @@ do { \ +@@ -347,8 +391,10 @@ do { \ } while (0) #define __get_user_asm(x, addr, err, itype, rtype, ltype, errret) \ @@ -18851,7 +19430,7 @@ index 5838fa9..f7ae572 100644 "2: " ASM_CLAC "\n" \ ".section .fixup,\"ax\"\n" \ "3: mov %3,%0\n" \ -@@ -356,8 +401,10 @@ do { \ +@@ -356,8 +402,10 @@ do { \ " jmp 2b\n" \ ".previous\n" \ _ASM_EXTABLE(1b, 3b) \ @@ -18864,7 +19443,7 @@ index 5838fa9..f7ae572 100644 #define __get_user_size_ex(x, ptr, size) \ do { \ -@@ -381,7 +428,7 @@ do { \ +@@ -381,7 +429,7 @@ do { \ } while (0) #define __get_user_asm_ex(x, addr, itype, rtype, ltype) \ @@ -18873,7 +19452,7 @@ index 5838fa9..f7ae572 100644 "2:\n" \ _ASM_EXTABLE_EX(1b, 2b) \ : ltype(x) : "m" (__m(addr))) -@@ -398,13 +445,24 @@ do { \ +@@ -398,13 +446,24 @@ do { \ int __gu_err; \ unsigned long __gu_val; \ __get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT); \ @@ -18900,7 +19479,7 @@ index 5838fa9..f7ae572 100644 /* * Tell gcc we read from memory instead of writing: this is because -@@ -412,8 +470,10 @@ struct __large_struct { unsigned long buf[100]; }; +@@ -412,8 +471,10 @@ struct __large_struct { unsigned long buf[100]; }; * aliasing issues. */ #define __put_user_asm(x, addr, err, itype, rtype, ltype, errret) \ @@ -18912,7 +19491,7 @@ index 5838fa9..f7ae572 100644 "2: " ASM_CLAC "\n" \ ".section .fixup,\"ax\"\n" \ "3: mov %3,%0\n" \ -@@ -421,10 +481,12 @@ struct __large_struct { unsigned long buf[100]; }; +@@ -421,10 +482,12 @@ struct __large_struct { unsigned long buf[100]; }; ".previous\n" \ _ASM_EXTABLE(1b, 3b) \ : "=r"(err) \ @@ -18927,7 +19506,7 @@ index 5838fa9..f7ae572 100644 "2:\n" \ _ASM_EXTABLE_EX(1b, 2b) \ : : ltype(x), "m" (__m(addr))) -@@ -434,11 +496,13 @@ struct __large_struct { unsigned long buf[100]; }; +@@ -434,11 +497,13 @@ struct __large_struct { unsigned long buf[100]; }; */ #define uaccess_try do { \ current_thread_info()->uaccess_err = 0; \ @@ -18941,7 +19520,7 @@ index 5838fa9..f7ae572 100644 (err) |= (current_thread_info()->uaccess_err ? -EFAULT : 0); \ } while (0) -@@ -463,8 +527,12 @@ struct __large_struct { unsigned long buf[100]; }; +@@ -463,8 +528,12 @@ struct __large_struct { unsigned long buf[100]; }; * On error, the variable @x is set to zero. */ @@ -18954,7 +19533,7 @@ index 5838fa9..f7ae572 100644 /** * __put_user: - Write a simple value into user space, with less checking. -@@ -486,8 +554,12 @@ struct __large_struct { unsigned long buf[100]; }; +@@ -486,8 +555,12 @@ struct __large_struct { unsigned long buf[100]; }; * Returns zero on success, or -EFAULT on error. */ @@ -18967,7 +19546,7 @@ index 5838fa9..f7ae572 100644 #define __get_user_unaligned __get_user #define __put_user_unaligned __put_user -@@ -505,7 +577,7 @@ struct __large_struct { unsigned long buf[100]; }; +@@ -505,7 +578,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)))); \ @@ -18976,8 +19555,110 @@ index 5838fa9..f7ae572 100644 } while (0) #define put_user_try uaccess_try +@@ -536,17 +609,6 @@ extern struct movsl_mask { + + #define ARCH_HAS_NOCACHE_UACCESS 1 + +-#ifdef CONFIG_X86_32 +-# include +-#else +-# include +-#endif +- +-unsigned long __must_check _copy_from_user(void *to, const void __user *from, +- unsigned n); +-unsigned long __must_check _copy_to_user(void __user *to, const void *from, +- unsigned n); +- + #ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS + # define copy_user_diag __compiletime_error + #else +@@ -556,7 +618,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") +-copy_to_user_overflow(void) __asm__("copy_from_user_overflow"); ++copy_to_user_overflow(void); + + #undef copy_user_diag + +@@ -569,7 +631,7 @@ __copy_from_user_overflow(void) __asm__("copy_from_user_overflow"); + + extern void + __compiletime_warning("copy_to_user() buffer size is not provably correct") +-__copy_to_user_overflow(void) __asm__("copy_from_user_overflow"); ++__copy_to_user_overflow(void) __asm__("copy_to_user_overflow"); + #define __copy_to_user_overflow(size, count) __copy_to_user_overflow() + + #else +@@ -584,10 +646,16 @@ __copy_from_user_overflow(int size, unsigned long count) + + #endif + ++#ifdef CONFIG_X86_32 ++# include ++#else ++# include ++#endif ++ + static inline unsigned long __must_check + copy_from_user(void *to, const void __user *from, unsigned long n) + { +- int sz = __compiletime_object_size(to); ++ size_t sz = __compiletime_object_size(to); + + might_fault(); + +@@ -609,12 +677,15 @@ copy_from_user(void *to, const void __user *from, unsigned long n) + * case, and do only runtime checking for non-constant sizes. + */ + +- if (likely(sz < 0 || sz >= n)) +- n = _copy_from_user(to, from, n); +- else if(__builtin_constant_p(n)) +- copy_from_user_overflow(); +- else +- __copy_from_user_overflow(sz, n); ++ if (likely(sz != (size_t)-1 && sz < n)) { ++ if(__builtin_constant_p(n)) ++ copy_from_user_overflow(); ++ else ++ __copy_from_user_overflow(sz, n); ++ } if (access_ok(VERIFY_READ, from, n)) ++ n = __copy_from_user(to, from, n); ++ else if ((long)n > 0) ++ memset(to, 0, n); + + return n; + } +@@ -622,17 +693,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) + { +- int sz = __compiletime_object_size(from); ++ size_t sz = __compiletime_object_size(from); + + might_fault(); + + /* See the comment in copy_from_user() above. */ +- if (likely(sz < 0 || sz >= n)) +- n = _copy_to_user(to, from, n); +- else if(__builtin_constant_p(n)) +- copy_to_user_overflow(); +- else +- __copy_to_user_overflow(sz, n); ++ if (likely(sz != (size_t)-1 && sz < n)) { ++ if(__builtin_constant_p(n)) ++ copy_to_user_overflow(); ++ else ++ __copy_to_user_overflow(sz, n); ++ } else if (access_ok(VERIFY_WRITE, to, n)) ++ n = __copy_to_user(to, from, n); + + return n; + } diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h -index 7f760a9..b596b9a 100644 +index 3c03a5d..1071638 100644 --- a/arch/x86/include/asm/uaccess_32.h +++ b/arch/x86/include/asm/uaccess_32.h @@ -43,6 +43,11 @@ unsigned long __must_check __copy_from_user_ll_nocache_nozero @@ -19033,7 +19714,7 @@ index 7f760a9..b596b9a 100644 if (__builtin_constant_p(n)) { unsigned long ret; -@@ -181,15 +200,19 @@ static __always_inline unsigned long +@@ -181,7 +200,10 @@ static __always_inline unsigned long __copy_from_user_inatomic_nocache(void *to, const void __user *from, unsigned long n) { @@ -19044,93 +19725,9 @@ index 7f760a9..b596b9a 100644 + return __copy_from_user_ll_nocache_nozero(to, from, n); } --unsigned long __must_check copy_to_user(void __user *to, -- const void *from, unsigned long n); --unsigned long __must_check _copy_from_user(void *to, -- const void __user *from, -- unsigned long n); -- -+extern void copy_to_user_overflow(void) -+#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS -+ __compiletime_error("copy_to_user() buffer size is not provably correct") -+#else -+ __compiletime_warning("copy_to_user() buffer size is not provably correct") -+#endif -+; - - extern void copy_from_user_overflow(void) - #ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS -@@ -199,17 +222,60 @@ extern void copy_from_user_overflow(void) - #endif - ; - --static inline unsigned long __must_check copy_from_user(void *to, -- const void __user *from, -- unsigned long n) -+/** -+ * copy_to_user: - Copy a block of data into user space. -+ * @to: Destination address, in user space. -+ * @from: Source address, in kernel space. -+ * @n: Number of bytes to copy. -+ * -+ * Context: User context only. This function may sleep. -+ * -+ * Copy data from kernel space to user space. -+ * -+ * Returns number of bytes that could not be copied. -+ * On success, this will be zero. -+ */ -+static inline unsigned long __must_check -+copy_to_user(void __user *to, const void *from, unsigned long n) - { -- int sz = __compiletime_object_size(to); -+ size_t sz = __compiletime_object_size(from); - -- if (likely(sz == -1 || sz >= n)) -- n = _copy_from_user(to, from, n); -- else -+ if (unlikely(sz != (size_t)-1 && sz < n)) -+ copy_to_user_overflow(); -+ else if (access_ok(VERIFY_WRITE, to, n)) -+ n = __copy_to_user(to, from, n); -+ return n; -+} -+ -+/** -+ * copy_from_user: - Copy a block of data from user space. -+ * @to: Destination address, in kernel space. -+ * @from: Source address, in user space. -+ * @n: Number of bytes to copy. -+ * -+ * Context: User context only. This function may sleep. -+ * -+ * Copy data from user space to kernel space. -+ * -+ * Returns number of bytes that could not be copied. -+ * On success, this will be zero. -+ * -+ * If some data could not be copied, this function will pad the copied -+ * data to the requested size using zero bytes. -+ */ -+static inline unsigned long __must_check -+copy_from_user(void *to, const void __user *from, unsigned long n) -+{ -+ size_t sz = __compiletime_object_size(to); -+ -+ check_object_size(to, n, false); -+ -+ if (unlikely(sz != (size_t)-1 && sz < n)) - copy_from_user_overflow(); -- -+ else if (access_ok(VERIFY_READ, from, n)) -+ n = __copy_from_user(to, from, n); -+ else if ((long)n > 0) -+ memset(to, 0, n); - return n; - } - + #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 4f7923d..201b58d 100644 +index 190413d..206c200 100644 --- a/arch/x86/include/asm/uaccess_64.h +++ b/arch/x86/include/asm/uaccess_64.h @@ -10,6 +10,9 @@ @@ -19156,89 +19753,26 @@ index 4f7923d..201b58d 100644 -copy_user_generic_unrolled(void *to, const void *from, unsigned len); +copy_user_generic_unrolled(void *to, const void *from, unsigned len) __size_overflow(3); --static __always_inline __must_check unsigned long + static __always_inline __must_check unsigned long -copy_user_generic(void *to, const void *from, unsigned len) -+static __always_inline __must_check unsigned long +copy_user_generic(void *to, const void *from, unsigned long len) { unsigned ret; -@@ -45,138 +48,200 @@ copy_user_generic(void *to, const void *from, unsigned len) - return ret; +@@ -46,121 +49,170 @@ copy_user_generic(void *to, const void *from, unsigned len) } -+static __always_inline __must_check unsigned long -+__copy_to_user(void __user *to, const void *from, unsigned long len); -+static __always_inline __must_check unsigned long -+__copy_from_user(void *to, const void __user *from, unsigned long len); __must_check unsigned long --_copy_to_user(void __user *to, const void *from, unsigned len); --__must_check unsigned long --_copy_from_user(void *to, const void __user *from, unsigned len); --__must_check unsigned long -copy_in_user(void __user *to, const void __user *from, unsigned len); +copy_in_user(void __user *to, const void __user *from, unsigned long len); -+ -+extern void copy_to_user_overflow(void) -+#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS -+ __compiletime_error("copy_to_user() buffer size is not provably correct") -+#else -+ __compiletime_warning("copy_to_user() buffer size is not provably correct") -+#endif -+; -+ -+extern void copy_from_user_overflow(void) -+#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS -+ __compiletime_error("copy_from_user() buffer size is not provably correct") -+#else -+ __compiletime_warning("copy_from_user() buffer size is not provably correct") -+#endif -+; - - static inline unsigned long __must_check copy_from_user(void *to, - const void __user *from, - unsigned long n) - { -- int sz = __compiletime_object_size(to); -- - might_fault(); -- if (likely(sz == -1 || sz >= n)) -- n = _copy_from_user(to, from, n); --#ifdef CONFIG_DEBUG_VM -- else -- WARN(1, "Buffer overflow detected!\n"); --#endif -+ -+ check_object_size(to, n, false); -+ -+ if (access_ok(VERIFY_READ, from, n)) -+ n = __copy_from_user(to, from, n); -+ else if (n < INT_MAX) -+ memset(to, 0, n); - return n; - } static __always_inline __must_check --int copy_to_user(void __user *dst, const void *src, unsigned size) -+int copy_to_user(void __user *dst, const void *src, unsigned long size) - { - might_fault(); - -- return _copy_to_user(dst, src, size); -+ if (access_ok(VERIFY_WRITE, dst, size)) -+ size = __copy_to_user(dst, src, size); -+ return size; - } - - static __always_inline __must_check --int __copy_from_user(void *dst, const void __user *src, unsigned size) -+unsigned long __copy_from_user(void *dst, const void __user *src, unsigned long size) +-int __copy_from_user_nocheck(void *dst, const void __user *src, unsigned size) ++unsigned long __copy_from_user_nocheck(void *dst, const void __user *src, unsigned long size) { - int ret = 0; + size_t sz = __compiletime_object_size(dst); + unsigned ret = 0; - - might_fault(); + + if (size > INT_MAX) + return size; @@ -19246,15 +19780,18 @@ index 4f7923d..201b58d 100644 + check_object_size(dst, size, false); + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if (!__access_ok(VERIFY_READ, src, size)) ++ if (!access_ok_noprefault(VERIFY_READ, src, size)) + return size; +#endif + + if (unlikely(sz != (size_t)-1 && sz < size)) { -+ copy_from_user_overflow(); ++ if(__builtin_constant_p(size)) ++ copy_from_user_overflow(); ++ else ++ __copy_from_user_overflow(sz, size); + return size; + } -+ + if (!__builtin_constant_p(size)) - return copy_user_generic(dst, (__force void *)src, size); + return copy_user_generic(dst, (__force_kernel const void *)____m(src), size); @@ -19304,14 +19841,20 @@ index 4f7923d..201b58d 100644 } static __always_inline __must_check --int __copy_to_user(void __user *dst, const void *src, unsigned size) -+unsigned long __copy_to_user(void __user *dst, const void *src, unsigned long size) +-int __copy_from_user(void *dst, const void __user *src, unsigned size) ++unsigned long __copy_from_user(void *dst, const void __user *src, unsigned long size) + { + might_fault(); + return __copy_from_user_nocheck(dst, src, size); + } + + static __always_inline __must_check +-int __copy_to_user_nocheck(void __user *dst, const void *src, unsigned size) ++unsigned long __copy_to_user_nocheck(void __user *dst, const void *src, unsigned long size) { - int ret = 0; + size_t sz = __compiletime_object_size(src); + unsigned ret = 0; - - might_fault(); + + if (size > INT_MAX) + return size; @@ -19319,15 +19862,18 @@ index 4f7923d..201b58d 100644 + check_object_size(src, size, true); + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if (!__access_ok(VERIFY_WRITE, dst, size)) ++ if (!access_ok_noprefault(VERIFY_WRITE, dst, size)) + return size; +#endif + + if (unlikely(sz != (size_t)-1 && sz < size)) { -+ copy_to_user_overflow(); ++ if(__builtin_constant_p(size)) ++ copy_to_user_overflow(); ++ else ++ __copy_to_user_overflow(sz, size); + return size; + } -+ + if (!__builtin_constant_p(size)) - return copy_user_generic((__force void *)dst, src, size); + return copy_user_generic((__force_kernel void *)____m(dst), src, size); @@ -19376,9 +19922,17 @@ index 4f7923d..201b58d 100644 } } + static __always_inline __must_check +-int __copy_to_user(void __user *dst, const void *src, unsigned size) ++unsigned long __copy_to_user(void __user *dst, const void *src, unsigned long size) + { + might_fault(); + return __copy_to_user_nocheck(dst, src, size); + } + static __always_inline __must_check -int __copy_in_user(void __user *dst, const void __user *src, unsigned size) -+unsigned long __copy_in_user(void __user *dst, const void __user *src, unsigned long size) ++unsigned long __copy_in_user(void __user *dst, const void __user *src, unsigned size) { - int ret = 0; + unsigned ret = 0; @@ -19389,9 +19943,9 @@ index 4f7923d..201b58d 100644 + return size; + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if (!__access_ok(VERIFY_READ, src, size)) ++ if (!access_ok_noprefault(VERIFY_READ, src, size)) + return size; -+ if (!__access_ok(VERIFY_WRITE, dst, size)) ++ if (!access_ok_noprefault(VERIFY_WRITE, dst, size)) + return size; +#endif + @@ -19408,7 +19962,7 @@ index 4f7923d..201b58d 100644 ret, "b", "b", "=q", 1); if (likely(!ret)) __put_user_asm(tmp, (u8 __user *)dst, -@@ -185,7 +250,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) +@@ -169,7 +221,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) } case 2: { u16 tmp; @@ -19417,7 +19971,7 @@ index 4f7923d..201b58d 100644 ret, "w", "w", "=r", 2); if (likely(!ret)) __put_user_asm(tmp, (u16 __user *)dst, -@@ -195,7 +260,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) +@@ -179,7 +231,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) case 4: { u32 tmp; @@ -19426,7 +19980,7 @@ index 4f7923d..201b58d 100644 ret, "l", "k", "=r", 4); if (likely(!ret)) __put_user_asm(tmp, (u32 __user *)dst, -@@ -204,7 +269,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) +@@ -188,7 +240,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) } case 8: { u64 tmp; @@ -19435,7 +19989,7 @@ index 4f7923d..201b58d 100644 ret, "q", "", "=r", 8); if (likely(!ret)) __put_user_asm(tmp, (u64 __user *)dst, -@@ -212,41 +277,74 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) +@@ -196,41 +248,58 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) return ret; } default: @@ -19451,16 +20005,8 @@ index 4f7923d..201b58d 100644 +static __must_check __always_inline unsigned long +__copy_from_user_inatomic(void *dst, const void __user *src, unsigned long size) { -- return copy_user_generic(dst, (__force const void *)src, size); -+ if (size > INT_MAX) -+ return size; -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if (!__access_ok(VERIFY_READ, src, size)) -+ return size; -+#endif -+ -+ return copy_user_generic(dst, (__force_kernel const void *)____m(src), size); +- return __copy_from_user_nocheck(dst, (__force const void *)src, size); ++ return __copy_from_user_nocheck(dst, src, size); } -static __must_check __always_inline int @@ -19468,16 +20014,8 @@ index 4f7923d..201b58d 100644 +static __must_check __always_inline unsigned long +__copy_to_user_inatomic(void __user *dst, const void *src, unsigned long size) { -- return copy_user_generic((__force void *)dst, src, size); -+ if (size > INT_MAX) -+ return size; -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if (!__access_ok(VERIFY_WRITE, dst, size)) -+ return size; -+#endif -+ -+ return copy_user_generic((__force_kernel void *)____m(dst), src, size); +- return __copy_to_user_nocheck((__force void *)dst, src, size); ++ return __copy_to_user_nocheck(dst, src, size); } -extern long __copy_user_nocache(void *dst, const void __user *src, @@ -19496,7 +20034,7 @@ index 4f7923d..201b58d 100644 + return size; + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if (!__access_ok(VERIFY_READ, src, size)) ++ if (!access_ok_noprefault(VERIFY_READ, src, size)) + return size; +#endif + @@ -19513,7 +20051,7 @@ index 4f7923d..201b58d 100644 + return size; + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if (!__access_ok(VERIFY_READ, src, size)) ++ if (!access_ok_noprefault(VERIFY_READ, src, size)) + return size; +#endif + @@ -19539,7 +20077,7 @@ index 5b238981..77fdd78 100644 #define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0x01), REPEAT_BYTE(0x80) } diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h -index 828a156..650e625 100644 +index 0f1be11..f7542bf 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -129,7 +129,7 @@ struct x86_init_ops { @@ -19569,16 +20107,16 @@ index 828a156..650e625 100644 struct pci_dev; struct msi_msg; -@@ -182,7 +182,7 @@ struct x86_msi_ops { - void (*teardown_msi_irqs)(struct pci_dev *dev); - void (*restore_msi_irqs)(struct pci_dev *dev, int irq); +@@ -185,7 +185,7 @@ struct x86_msi_ops { int (*setup_hpet_msi)(unsigned int irq, unsigned int id); + u32 (*msi_mask_irq)(struct msi_desc *desc, u32 mask, u32 flag); + u32 (*msix_mask_irq)(struct msi_desc *desc, u32 flag); -}; +} __no_const; struct IO_APIC_route_entry; struct io_apic_irq_attr; -@@ -203,7 +203,7 @@ struct x86_io_apic_ops { +@@ -206,7 +206,7 @@ struct x86_io_apic_ops { unsigned int destination, int vector, struct io_apic_irq_attr *attr); void (*eoi_ioapic_pin)(int apic, int pin, int vector); @@ -19676,7 +20214,7 @@ index 7b0a55a..ad115bf 100644 /* top of stack page */ diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile -index a5408b9..5133813 100644 +index 9b0a34e..fc7e553 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -24,7 +24,7 @@ obj-y += time.o ioport.o ldt.o dumpstack.o nmi.o @@ -19689,10 +20227,10 @@ index a5408b9..5133813 100644 obj-y += syscall_$(BITS).o obj-$(CONFIG_X86_64) += vsyscall_64.o diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c -index 40c7660..f709f4b 100644 +index 6c0b43b..e67bb31 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c -@@ -1365,7 +1365,7 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d) +@@ -1315,7 +1315,7 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d) * If your system is blacklisted here, but you find that acpi=force * works for you, please contact linux-acpi@vger.kernel.org */ @@ -19701,7 +20239,7 @@ index 40c7660..f709f4b 100644 /* * Boxes that need ACPI disabled */ -@@ -1440,7 +1440,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { +@@ -1390,7 +1390,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { }; /* second table for DMI checks that should run after early-quirks */ @@ -19711,10 +20249,10 @@ index 40c7660..f709f4b 100644 * HP laptops which use a DSDT reporting as HP/SB400/10000, * which includes some code which overrides all temperature diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c -index 3312010..a65ca7b 100644 +index 3a2ae4c..9db31d6 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c -@@ -88,8 +88,12 @@ int x86_acpi_suspend_lowlevel(void) +@@ -99,8 +99,12 @@ int x86_acpi_suspend_lowlevel(void) #else /* CONFIG_64BIT */ #ifdef CONFIG_SMP stack_start = (unsigned long)temp_stack + sizeof(temp_stack); @@ -19728,7 +20266,7 @@ index 3312010..a65ca7b 100644 #endif initial_code = (unsigned long)wakeup_long64; diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S -index d1daa66..59fecba 100644 +index 665c6b7..eae4d56 100644 --- a/arch/x86/kernel/acpi/wakeup_32.S +++ b/arch/x86/kernel/acpi/wakeup_32.S @@ -29,13 +29,11 @@ wakeup_pmode_return: @@ -19748,7 +20286,7 @@ index d1daa66..59fecba 100644 bogus_magic: jmp bogus_magic diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c -index 15e8563..323cbe1 100644 +index df94598..f3b29bf 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -269,6 +269,13 @@ void __init_or_module apply_alternatives(struct alt_instr *start, @@ -19801,7 +20339,7 @@ index 15e8563..323cbe1 100644 text_poke(ptr, ((unsigned char []){0x3E}), 1); } mutex_unlock(&text_mutex); -@@ -469,7 +488,7 @@ void __init_or_module apply_paravirt(struct paravirt_patch_site *start, +@@ -458,7 +477,7 @@ void __init_or_module apply_paravirt(struct paravirt_patch_site *start, BUG_ON(p->len > MAX_PATCH_LEN); /* prep the buffer with the original instructions */ @@ -19810,7 +20348,7 @@ index 15e8563..323cbe1 100644 used = pv_init_ops.patch(p->instrtype, p->clobbers, insnbuf, (unsigned long)p->instr, p->len); -@@ -516,7 +535,7 @@ void __init alternative_instructions(void) +@@ -505,7 +524,7 @@ void __init alternative_instructions(void) if (!uniproc_patched || num_possible_cpus() == 1) free_init_pages("SMP alternatives", (unsigned long)__smp_locks, @@ -19819,7 +20357,7 @@ index 15e8563..323cbe1 100644 #endif apply_paravirt(__parainstructions, __parainstructions_end); -@@ -536,13 +555,17 @@ void __init alternative_instructions(void) +@@ -525,13 +544,17 @@ void __init alternative_instructions(void) * instructions. And on the local CPU you need to be protected again NMI or MCE * handlers seeing an inconsistent instruction while you patch. */ @@ -19839,7 +20377,7 @@ index 15e8563..323cbe1 100644 local_irq_restore(flags); /* Could also do a CLFLUSH here to speed up CPU recovery; but that causes hangs on some VIA CPUs. */ -@@ -564,36 +587,22 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode, +@@ -553,36 +576,22 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode, */ void *__kprobes text_poke(void *addr, const void *opcode, size_t len) { @@ -19884,7 +20422,7 @@ index 15e8563..323cbe1 100644 return addr; } -@@ -613,7 +622,7 @@ int poke_int3_handler(struct pt_regs *regs) +@@ -602,7 +611,7 @@ int poke_int3_handler(struct pt_regs *regs) if (likely(!bp_patching_in_progress)) return 0; @@ -19893,7 +20431,7 @@ index 15e8563..323cbe1 100644 return 0; /* set up the specified breakpoint handler */ -@@ -647,7 +656,7 @@ int poke_int3_handler(struct pt_regs *regs) +@@ -636,7 +645,7 @@ int poke_int3_handler(struct pt_regs *regs) */ void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) { @@ -19903,10 +20441,10 @@ index 15e8563..323cbe1 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 a7eb82d..f6e52d4 100644 +index d278736..0b4af9a8 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c -@@ -190,7 +190,7 @@ int first_system_vector = 0xfe; +@@ -191,7 +191,7 @@ int first_system_vector = 0xfe; /* * Debug level, exported for io_apic.c */ @@ -19915,7 +20453,7 @@ index a7eb82d..f6e52d4 100644 int pic_mode; -@@ -1985,7 +1985,7 @@ static inline void __smp_error_interrupt(struct pt_regs *regs) +@@ -1986,7 +1986,7 @@ static inline void __smp_error_interrupt(struct pt_regs *regs) apic_write(APIC_ESR, 0); v1 = apic_read(APIC_ESR); ack_APIC_irq(); @@ -20111,10 +20649,10 @@ index 562a76d..a003c0f 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 a419814..1dd34a0 100644 +index ad0dc04..0d9cc56 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c -@@ -357,7 +357,7 @@ static int uv_probe(void) +@@ -350,7 +350,7 @@ static int uv_probe(void) return apic == &apic_x2apic_uv_x; } @@ -20199,19 +20737,19 @@ index 3ab0343..814c4787 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 2861082..6d4718e 100644 +index 9f6b934..cf5ffb3 100644 --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c -@@ -33,6 +33,8 @@ void common(void) { +@@ -32,6 +32,8 @@ void common(void) { + OFFSET(TI_flags, thread_info, flags); OFFSET(TI_status, thread_info, status); OFFSET(TI_addr_limit, thread_info, addr_limit); - OFFSET(TI_preempt_count, thread_info, preempt_count); + OFFSET(TI_lowest_stack, thread_info, lowest_stack); + DEFINE(TI_task_thread_sp0, offsetof(struct task_struct, thread.sp0) - offsetof(struct task_struct, tinfo)); BLANK(); OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx); -@@ -53,8 +55,26 @@ void common(void) { +@@ -52,8 +54,26 @@ void common(void) { OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit); OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0); OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2); @@ -20266,10 +20804,10 @@ index 47b56a7..efc2bc6 100644 obj-y += proc.o capflags.o powerflags.o common.o obj-y += rdrand.o diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c -index 903a264..fc955f3 100644 +index 59bfebc..d8f27bd 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c -@@ -743,7 +743,7 @@ static void init_amd(struct cpuinfo_x86 *c) +@@ -753,7 +753,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) */ @@ -20279,7 +20817,7 @@ index 903a264..fc955f3 100644 if (c->x86_model == 3 && c->x86_mask == 0) size = 64; diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c -index 2793d1f..b4f313a 100644 +index fe2bdd0..77b0d1b 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -88,60 +88,6 @@ static const struct cpu_dev default_cpu = { @@ -20343,8 +20881,8 @@ index 2793d1f..b4f313a 100644 static int __init x86_xsave_setup(char *s) { setup_clear_cpu_cap(X86_FEATURE_XSAVE); -@@ -288,6 +234,59 @@ static __always_inline void setup_smap(struct cpuinfo_x86 *c) - set_in_cr4(X86_CR4_SMAP); +@@ -293,6 +239,59 @@ static __always_inline void setup_smap(struct cpuinfo_x86 *c) + } } +#ifdef CONFIG_X86_64 @@ -20403,7 +20941,7 @@ index 2793d1f..b4f313a 100644 /* * Some CPU features depend on higher CPUID levels, which may not always * be available due to CPUID level capping or broken virtualization -@@ -386,7 +385,7 @@ void switch_to_new_gdt(int cpu) +@@ -393,7 +392,7 @@ void switch_to_new_gdt(int cpu) { struct desc_ptr gdt_descr; @@ -20412,7 +20950,7 @@ index 2793d1f..b4f313a 100644 gdt_descr.size = GDT_SIZE - 1; load_gdt(&gdt_descr); /* Reload the per-cpu base */ -@@ -875,6 +874,10 @@ static void identify_cpu(struct cpuinfo_x86 *c) +@@ -882,6 +881,10 @@ static void identify_cpu(struct cpuinfo_x86 *c) setup_smep(c); setup_smap(c); @@ -20423,7 +20961,7 @@ index 2793d1f..b4f313a 100644 /* * The vendor-specific functions might have changed features. * Now we do "generic changes." -@@ -883,6 +886,10 @@ static void identify_cpu(struct cpuinfo_x86 *c) +@@ -890,6 +893,10 @@ static void identify_cpu(struct cpuinfo_x86 *c) /* Filter out anything that depends on CPUID levels we don't have */ filter_cpuid_features(c, true); @@ -20434,7 +20972,7 @@ index 2793d1f..b4f313a 100644 /* If the model name is still unset, do table lookup. */ if (!c->x86_model_id[0]) { const char *p; -@@ -1070,10 +1077,12 @@ static __init int setup_disablecpuid(char *arg) +@@ -1077,10 +1084,12 @@ static __init int setup_disablecpuid(char *arg) } __setup("clearcpuid=", setup_disablecpuid); @@ -20450,7 +20988,7 @@ index 2793d1f..b4f313a 100644 DEFINE_PER_CPU_FIRST(union irq_stack_union, irq_stack_union) __aligned(PAGE_SIZE) __visible; -@@ -1087,7 +1096,7 @@ DEFINE_PER_CPU(struct task_struct *, current_task) ____cacheline_aligned = +@@ -1094,7 +1103,7 @@ DEFINE_PER_CPU(struct task_struct *, current_task) ____cacheline_aligned = EXPORT_PER_CPU_SYMBOL(current_task); DEFINE_PER_CPU(unsigned long, kernel_stack) = @@ -20459,7 +20997,7 @@ index 2793d1f..b4f313a 100644 EXPORT_PER_CPU_SYMBOL(kernel_stack); DEFINE_PER_CPU(char *, irq_stack_ptr) = -@@ -1232,7 +1241,7 @@ void cpu_init(void) +@@ -1244,7 +1253,7 @@ void cpu_init(void) load_ucode_ap(); cpu = stack_smp_processor_id(); @@ -20468,7 +21006,7 @@ index 2793d1f..b4f313a 100644 oist = &per_cpu(orig_ist, cpu); #ifdef CONFIG_NUMA -@@ -1267,7 +1276,6 @@ void cpu_init(void) +@@ -1279,7 +1288,6 @@ void cpu_init(void) wrmsrl(MSR_KERNEL_GS_BASE, 0); barrier(); @@ -20476,7 +21014,7 @@ index 2793d1f..b4f313a 100644 enable_x2apic(); /* -@@ -1319,7 +1327,7 @@ void cpu_init(void) +@@ -1331,7 +1339,7 @@ void cpu_init(void) { int cpu = smp_processor_id(); struct task_struct *curr = current; @@ -20486,7 +21024,7 @@ index 2793d1f..b4f313a 100644 show_ucode_info_early(); diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c -index 1414c90..1159406 100644 +index 0641113..06f5ba4 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c @@ -1014,6 +1014,22 @@ static struct attribute *default_attrs[] = { @@ -20790,10 +21328,10 @@ index df5e41f..816c719 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 8a87a32..682a22a 100644 +index db6cdbe..faaf834 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c -@@ -1348,7 +1348,7 @@ static void __init pmu_check_apic(void) +@@ -1351,7 +1351,7 @@ static void __init pmu_check_apic(void) pr_info("no hardware sampling interrupt available.\n"); } @@ -20802,7 +21340,7 @@ index 8a87a32..682a22a 100644 .name = "format", .attrs = NULL, }; -@@ -1447,7 +1447,7 @@ static struct attribute *events_attr[] = { +@@ -1450,7 +1450,7 @@ static struct attribute *events_attr[] = { NULL, }; @@ -20811,7 +21349,7 @@ index 8a87a32..682a22a 100644 .name = "events", .attrs = events_attr, }; -@@ -1958,7 +1958,7 @@ static unsigned long get_segment_base(unsigned int segment) +@@ -1961,7 +1961,7 @@ static unsigned long get_segment_base(unsigned int segment) if (idx > GDT_ENTRIES) return 0; @@ -20820,7 +21358,7 @@ index 8a87a32..682a22a 100644 } return get_desc_base(desc + idx); -@@ -2048,7 +2048,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) +@@ -2051,7 +2051,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) break; perf_callchain_store(entry, frame.return_address); @@ -20843,10 +21381,10 @@ index 639d128..e92d7e5 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 f31a165..7b46cd8 100644 +index 0fa4f24..17990ed 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c -@@ -2247,10 +2247,10 @@ __init int intel_pmu_init(void) +@@ -2314,10 +2314,10 @@ __init int intel_pmu_init(void) * v2 and above have a perf capabilities MSR */ if (version > 1) { @@ -20861,10 +21399,10 @@ index f31a165..7b46cd8 100644 intel_ds_init(); diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c -index 4118f9f..f91d0ab 100644 +index 29c2487..a5606fa 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c -@@ -3204,7 +3204,7 @@ static void __init uncore_types_exit(struct intel_uncore_type **types) +@@ -3318,7 +3318,7 @@ static void __init uncore_types_exit(struct intel_uncore_type **types) static int __init uncore_type_init(struct intel_uncore_type *type) { struct intel_uncore_pmu *pmus; @@ -20964,7 +21502,7 @@ index 5d3fe8d..02e1429 100644 .__cr3 = __pa_nodebug(swapper_pg_dir), diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c -index deb6421..76bbc12 100644 +index d9c12d3..7858b62 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -2,6 +2,9 @@ @@ -20977,7 +21515,7 @@ index deb6421..76bbc12 100644 #include #include #include -@@ -35,16 +38,14 @@ void printk_address(unsigned long address, int reliable) +@@ -40,16 +43,14 @@ void printk_address(unsigned long address) static void print_ftrace_graph_addr(unsigned long addr, void *data, const struct stacktrace_ops *ops, @@ -20995,7 +21533,7 @@ index deb6421..76bbc12 100644 index = task->curr_ret_stack; if (!task->ret_stack || index < *graph) -@@ -61,7 +62,7 @@ print_ftrace_graph_addr(unsigned long addr, void *data, +@@ -66,7 +67,7 @@ print_ftrace_graph_addr(unsigned long addr, void *data, static inline void print_ftrace_graph_addr(unsigned long addr, void *data, const struct stacktrace_ops *ops, @@ -21004,7 +21542,7 @@ index deb6421..76bbc12 100644 { } #endif -@@ -72,10 +73,8 @@ print_ftrace_graph_addr(unsigned long addr, void *data, +@@ -77,10 +78,8 @@ print_ftrace_graph_addr(unsigned long addr, void *data, * severe exception (double fault, nmi, stack fault, debug, mce) hardware stack */ @@ -21016,7 +21554,7 @@ index deb6421..76bbc12 100644 if (end) { if (p < end && p >= (end-THREAD_SIZE)) return 1; -@@ -86,14 +85,14 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, +@@ -91,14 +90,14 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, } unsigned long @@ -21033,7 +21571,7 @@ index deb6421..76bbc12 100644 unsigned long addr; addr = *stack; -@@ -105,7 +104,7 @@ print_context_stack(struct thread_info *tinfo, +@@ -110,7 +109,7 @@ print_context_stack(struct thread_info *tinfo, } else { ops->address(data, addr, 0); } @@ -21042,7 +21580,7 @@ index deb6421..76bbc12 100644 } stack++; } -@@ -114,7 +113,7 @@ print_context_stack(struct thread_info *tinfo, +@@ -119,7 +118,7 @@ print_context_stack(struct thread_info *tinfo, EXPORT_SYMBOL_GPL(print_context_stack); unsigned long @@ -21051,7 +21589,7 @@ index deb6421..76bbc12 100644 unsigned long *stack, unsigned long bp, const struct stacktrace_ops *ops, void *data, unsigned long *end, int *graph) -@@ -122,7 +121,7 @@ print_context_stack_bp(struct thread_info *tinfo, +@@ -127,7 +126,7 @@ print_context_stack_bp(struct thread_info *tinfo, struct stack_frame *frame = (struct stack_frame *)bp; unsigned long *ret_addr = &frame->return_address; @@ -21060,7 +21598,7 @@ index deb6421..76bbc12 100644 unsigned long addr = *ret_addr; if (!__kernel_text_address(addr)) -@@ -131,7 +130,7 @@ print_context_stack_bp(struct thread_info *tinfo, +@@ -136,7 +135,7 @@ print_context_stack_bp(struct thread_info *tinfo, ops->address(data, addr, 1); frame = frame->next_frame; ret_addr = &frame->return_address; @@ -21069,16 +21607,16 @@ index deb6421..76bbc12 100644 } return (unsigned long)frame; -@@ -150,7 +149,7 @@ static int print_trace_stack(void *data, char *name) +@@ -155,7 +154,7 @@ static int print_trace_stack(void *data, char *name) static void print_trace_address(void *data, unsigned long addr, int reliable) { touch_nmi_watchdog(); - printk(data); + printk("%s", (char *)data); - printk_address(addr, reliable); + printk_stack_address(addr, reliable); } -@@ -219,6 +218,8 @@ unsigned __kprobes long oops_begin(void) +@@ -224,6 +223,8 @@ unsigned __kprobes long oops_begin(void) } EXPORT_SYMBOL_GPL(oops_begin); @@ -21087,7 +21625,7 @@ index deb6421..76bbc12 100644 void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr) { if (regs && kexec_should_crash(current)) -@@ -240,7 +241,10 @@ void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr) +@@ -245,7 +246,10 @@ void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr) panic("Fatal exception in interrupt"); if (panic_on_oops) panic("Fatal exception"); @@ -21099,7 +21637,7 @@ index deb6421..76bbc12 100644 } int __kprobes __die(const char *str, struct pt_regs *regs, long err) -@@ -268,7 +272,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err) +@@ -273,7 +277,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err) print_modules(); show_regs(regs); #ifdef CONFIG_X86_32 @@ -21108,7 +21646,7 @@ index deb6421..76bbc12 100644 sp = regs->sp; ss = regs->ss & 0xffff; } else { -@@ -296,7 +300,7 @@ void die(const char *str, struct pt_regs *regs, long err) +@@ -301,7 +305,7 @@ void die(const char *str, struct pt_regs *regs, long err) unsigned long flags = oops_begin(); int sig = SIGSEGV; @@ -21339,7 +21877,7 @@ index 174da5f..5e55606 100644 static int userdef __initdata; diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c -index d15f575..d692043 100644 +index 01d1c18..8073693 100644 --- a/arch/x86/kernel/early_printk.c +++ b/arch/x86/kernel/early_printk.c @@ -7,6 +7,7 @@ @@ -21351,7 +21889,7 @@ index d15f575..d692043 100644 #include #include diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S -index f0dcb0c..9f39b80 100644 +index a2a4f46..6cab058 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S @@ -177,13 +177,153 @@ @@ -21570,7 +22108,7 @@ index f0dcb0c..9f39b80 100644 #ifdef CONFIG_PREEMPT ENTRY(resume_kernel) -@@ -372,7 +529,7 @@ need_resched: +@@ -369,7 +526,7 @@ need_resched: jz restore_all call preempt_schedule_irq jmp need_resched @@ -21579,7 +22117,7 @@ index f0dcb0c..9f39b80 100644 #endif CFI_ENDPROC /* -@@ -406,30 +563,45 @@ sysenter_past_esp: +@@ -403,30 +560,45 @@ sysenter_past_esp: /*CFI_REL_OFFSET cs, 0*/ /* * Push current_thread_info()->sysenter_return to the stack. @@ -21628,7 +22166,7 @@ index f0dcb0c..9f39b80 100644 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp) jnz sysenter_audit sysenter_do_call: -@@ -444,12 +616,24 @@ sysenter_do_call: +@@ -441,12 +613,24 @@ sysenter_do_call: testl $_TIF_ALLWORK_MASK, %ecx jne sysexit_audit sysenter_exit: @@ -21653,7 +22191,7 @@ index f0dcb0c..9f39b80 100644 PTGS_TO_GS ENABLE_INTERRUPTS_SYSEXIT -@@ -466,6 +650,9 @@ sysenter_audit: +@@ -463,6 +647,9 @@ sysenter_audit: movl %eax,%edx /* 2nd arg: syscall number */ movl $AUDIT_ARCH_I386,%eax /* 1st arg: audit arch */ call __audit_syscall_entry @@ -21663,7 +22201,7 @@ index f0dcb0c..9f39b80 100644 pushl_cfi %ebx movl PT_EAX(%esp),%eax /* reload syscall number */ jmp sysenter_do_call -@@ -491,10 +678,16 @@ sysexit_audit: +@@ -488,10 +675,16 @@ sysexit_audit: CFI_ENDPROC .pushsection .fixup,"ax" @@ -21682,7 +22220,7 @@ index f0dcb0c..9f39b80 100644 PTGS_TO_GS_EX ENDPROC(ia32_sysenter_target) -@@ -509,6 +702,11 @@ ENTRY(system_call) +@@ -506,6 +699,11 @@ ENTRY(system_call) pushl_cfi %eax # save orig_eax SAVE_ALL GET_THREAD_INFO(%ebp) @@ -21694,7 +22232,7 @@ index f0dcb0c..9f39b80 100644 # system call tracing in operation / emulation testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp) jnz syscall_trace_entry -@@ -527,6 +725,15 @@ syscall_exit: +@@ -524,6 +722,15 @@ syscall_exit: testl $_TIF_ALLWORK_MASK, %ecx # current->work jne syscall_exit_work @@ -21710,7 +22248,7 @@ index f0dcb0c..9f39b80 100644 restore_all: TRACE_IRQS_IRET restore_all_notrace: -@@ -583,14 +790,34 @@ ldt_ss: +@@ -580,14 +787,34 @@ ldt_ss: * compensating for the offset by changing to the ESPFIX segment with * a base address that matches for the difference. */ @@ -21748,7 +22286,7 @@ index f0dcb0c..9f39b80 100644 pushl_cfi $__ESPFIX_SS pushl_cfi %eax /* new kernel esp */ /* Disable interrupts, but do not irqtrace this section: we -@@ -619,20 +846,18 @@ work_resched: +@@ -616,20 +843,18 @@ work_resched: movl TI_flags(%ebp), %ecx andl $_TIF_WORK_MASK, %ecx # is there any work to be done other # than syscall tracing? @@ -21771,7 +22309,7 @@ index f0dcb0c..9f39b80 100644 #endif TRACE_IRQS_ON ENABLE_INTERRUPTS(CLBR_NONE) -@@ -653,7 +878,7 @@ work_notifysig_v86: +@@ -650,7 +875,7 @@ work_notifysig_v86: movl %eax, %esp jmp 1b #endif @@ -21780,7 +22318,7 @@ index f0dcb0c..9f39b80 100644 # perform syscall exit tracing ALIGN -@@ -661,11 +886,14 @@ syscall_trace_entry: +@@ -658,11 +883,14 @@ syscall_trace_entry: movl $-ENOSYS,PT_EAX(%esp) movl %esp, %eax call syscall_trace_enter @@ -21796,7 +22334,7 @@ index f0dcb0c..9f39b80 100644 # perform syscall exit tracing ALIGN -@@ -678,21 +906,25 @@ syscall_exit_work: +@@ -675,21 +903,25 @@ syscall_exit_work: movl %esp, %eax call syscall_trace_leave jmp resume_userspace @@ -21825,7 +22363,7 @@ index f0dcb0c..9f39b80 100644 CFI_ENDPROC /* * End of kprobes section -@@ -708,8 +940,15 @@ END(syscall_badsys) +@@ -705,8 +937,15 @@ END(syscall_badsys) * normal stack and adjusts ESP with the matching offset. */ /* fixup the stack */ @@ -21843,7 +22381,7 @@ index f0dcb0c..9f39b80 100644 shl $16, %eax addl %esp, %eax /* the adjusted stack pointer */ pushl_cfi $__KERNEL_DS -@@ -762,7 +1001,7 @@ vector=vector+1 +@@ -759,7 +998,7 @@ vector=vector+1 .endr 2: jmp common_interrupt .endr @@ -21852,7 +22390,7 @@ index f0dcb0c..9f39b80 100644 .previous END(interrupt) -@@ -823,7 +1062,7 @@ ENTRY(coprocessor_error) +@@ -820,7 +1059,7 @@ ENTRY(coprocessor_error) pushl_cfi $do_coprocessor_error jmp error_code CFI_ENDPROC @@ -21861,7 +22399,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(simd_coprocessor_error) RING0_INT_FRAME -@@ -836,7 +1075,7 @@ ENTRY(simd_coprocessor_error) +@@ -833,7 +1072,7 @@ ENTRY(simd_coprocessor_error) .section .altinstructions,"a" altinstruction_entry 661b, 663f, X86_FEATURE_XMM, 662b-661b, 664f-663f .previous @@ -21870,7 +22408,7 @@ index f0dcb0c..9f39b80 100644 663: pushl $do_simd_coprocessor_error 664: .previous -@@ -845,7 +1084,7 @@ ENTRY(simd_coprocessor_error) +@@ -842,7 +1081,7 @@ ENTRY(simd_coprocessor_error) #endif jmp error_code CFI_ENDPROC @@ -21879,7 +22417,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(device_not_available) RING0_INT_FRAME -@@ -854,18 +1093,18 @@ ENTRY(device_not_available) +@@ -851,18 +1090,18 @@ ENTRY(device_not_available) pushl_cfi $do_device_not_available jmp error_code CFI_ENDPROC @@ -21901,7 +22439,7 @@ index f0dcb0c..9f39b80 100644 #endif ENTRY(overflow) -@@ -875,7 +1114,7 @@ ENTRY(overflow) +@@ -872,7 +1111,7 @@ ENTRY(overflow) pushl_cfi $do_overflow jmp error_code CFI_ENDPROC @@ -21910,7 +22448,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(bounds) RING0_INT_FRAME -@@ -884,7 +1123,7 @@ ENTRY(bounds) +@@ -881,7 +1120,7 @@ ENTRY(bounds) pushl_cfi $do_bounds jmp error_code CFI_ENDPROC @@ -21919,7 +22457,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(invalid_op) RING0_INT_FRAME -@@ -893,7 +1132,7 @@ ENTRY(invalid_op) +@@ -890,7 +1129,7 @@ ENTRY(invalid_op) pushl_cfi $do_invalid_op jmp error_code CFI_ENDPROC @@ -21928,7 +22466,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(coprocessor_segment_overrun) RING0_INT_FRAME -@@ -902,7 +1141,7 @@ ENTRY(coprocessor_segment_overrun) +@@ -899,7 +1138,7 @@ ENTRY(coprocessor_segment_overrun) pushl_cfi $do_coprocessor_segment_overrun jmp error_code CFI_ENDPROC @@ -21937,7 +22475,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(invalid_TSS) RING0_EC_FRAME -@@ -910,7 +1149,7 @@ ENTRY(invalid_TSS) +@@ -907,7 +1146,7 @@ ENTRY(invalid_TSS) pushl_cfi $do_invalid_TSS jmp error_code CFI_ENDPROC @@ -21946,7 +22484,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(segment_not_present) RING0_EC_FRAME -@@ -918,7 +1157,7 @@ ENTRY(segment_not_present) +@@ -915,7 +1154,7 @@ ENTRY(segment_not_present) pushl_cfi $do_segment_not_present jmp error_code CFI_ENDPROC @@ -21955,7 +22493,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(stack_segment) RING0_EC_FRAME -@@ -926,7 +1165,7 @@ ENTRY(stack_segment) +@@ -923,7 +1162,7 @@ ENTRY(stack_segment) pushl_cfi $do_stack_segment jmp error_code CFI_ENDPROC @@ -21964,7 +22502,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(alignment_check) RING0_EC_FRAME -@@ -934,7 +1173,7 @@ ENTRY(alignment_check) +@@ -931,7 +1170,7 @@ ENTRY(alignment_check) pushl_cfi $do_alignment_check jmp error_code CFI_ENDPROC @@ -21973,7 +22511,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(divide_error) RING0_INT_FRAME -@@ -943,7 +1182,7 @@ ENTRY(divide_error) +@@ -940,7 +1179,7 @@ ENTRY(divide_error) pushl_cfi $do_divide_error jmp error_code CFI_ENDPROC @@ -21982,7 +22520,7 @@ index f0dcb0c..9f39b80 100644 #ifdef CONFIG_X86_MCE ENTRY(machine_check) -@@ -953,7 +1192,7 @@ ENTRY(machine_check) +@@ -950,7 +1189,7 @@ ENTRY(machine_check) pushl_cfi machine_check_vector jmp error_code CFI_ENDPROC @@ -21991,7 +22529,7 @@ index f0dcb0c..9f39b80 100644 #endif ENTRY(spurious_interrupt_bug) -@@ -963,7 +1202,7 @@ ENTRY(spurious_interrupt_bug) +@@ -960,7 +1199,7 @@ ENTRY(spurious_interrupt_bug) pushl_cfi $do_spurious_interrupt_bug jmp error_code CFI_ENDPROC @@ -22000,7 +22538,7 @@ index f0dcb0c..9f39b80 100644 /* * End of kprobes section */ -@@ -1073,7 +1312,7 @@ BUILD_INTERRUPT3(hyperv_callback_vector, HYPERVISOR_CALLBACK_VECTOR, +@@ -1070,7 +1309,7 @@ BUILD_INTERRUPT3(hyperv_callback_vector, HYPERVISOR_CALLBACK_VECTOR, ENTRY(mcount) ret @@ -22009,7 +22547,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(ftrace_caller) cmpl $0, function_trace_stop -@@ -1106,7 +1345,7 @@ ftrace_graph_call: +@@ -1103,7 +1342,7 @@ ftrace_graph_call: .globl ftrace_stub ftrace_stub: ret @@ -22018,7 +22556,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(ftrace_regs_caller) pushf /* push flags before compare (in cs location) */ -@@ -1210,7 +1449,7 @@ trace: +@@ -1207,7 +1446,7 @@ trace: popl %ecx popl %eax jmp ftrace_stub @@ -22027,7 +22565,7 @@ index f0dcb0c..9f39b80 100644 #endif /* CONFIG_DYNAMIC_FTRACE */ #endif /* CONFIG_FUNCTION_TRACER */ -@@ -1228,7 +1467,7 @@ ENTRY(ftrace_graph_caller) +@@ -1225,7 +1464,7 @@ ENTRY(ftrace_graph_caller) popl %ecx popl %eax ret @@ -22036,7 +22574,7 @@ index f0dcb0c..9f39b80 100644 .globl return_to_handler return_to_handler: -@@ -1284,15 +1523,18 @@ error_code: +@@ -1291,15 +1530,18 @@ error_code: movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart REG_TO_PTGS %ecx SET_KERNEL_GS %ecx @@ -22057,7 +22595,7 @@ index f0dcb0c..9f39b80 100644 /* * Debug traps and NMI can happen at the one SYSENTER instruction -@@ -1335,7 +1577,7 @@ debug_stack_correct: +@@ -1342,7 +1584,7 @@ debug_stack_correct: call do_debug jmp ret_from_exception CFI_ENDPROC @@ -22066,7 +22604,7 @@ index f0dcb0c..9f39b80 100644 /* * NMI is doubly nasty. It can happen _while_ we're handling -@@ -1373,6 +1615,9 @@ nmi_stack_correct: +@@ -1380,6 +1622,9 @@ nmi_stack_correct: xorl %edx,%edx # zero error code movl %esp,%eax # pt_regs pointer call do_nmi @@ -22076,7 +22614,7 @@ index f0dcb0c..9f39b80 100644 jmp restore_all_notrace CFI_ENDPROC -@@ -1409,12 +1654,15 @@ nmi_espfix_stack: +@@ -1416,12 +1661,15 @@ nmi_espfix_stack: FIXUP_ESPFIX_STACK # %eax == %esp xorl %edx,%edx # zero error code call do_nmi @@ -22093,7 +22631,7 @@ index f0dcb0c..9f39b80 100644 ENTRY(int3) RING0_INT_FRAME -@@ -1427,14 +1675,14 @@ ENTRY(int3) +@@ -1434,14 +1682,14 @@ ENTRY(int3) call do_int3 jmp ret_from_exception CFI_ENDPROC @@ -22110,7 +22648,7 @@ index f0dcb0c..9f39b80 100644 #ifdef CONFIG_KVM_GUEST ENTRY(async_page_fault) -@@ -1443,7 +1691,7 @@ ENTRY(async_page_fault) +@@ -1450,7 +1698,7 @@ ENTRY(async_page_fault) pushl_cfi $do_async_page_fault jmp error_code CFI_ENDPROC @@ -22120,7 +22658,7 @@ index f0dcb0c..9f39b80 100644 /* diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S -index b077f4c..8e0df9f 100644 +index 1e96c36..3ff710a 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -59,6 +59,8 @@ @@ -22715,20 +23253,81 @@ index b077f4c..8e0df9f 100644 je 1f SWAPGS /* -@@ -514,9 +927,10 @@ ENTRY(save_paranoid) +@@ -483,6 +896,18 @@ ENDPROC(native_usergs_sysret64) + 0x06 /* DW_OP_deref */, \ + 0x08 /* DW_OP_const1u */, SS+8-RBP, \ + 0x22 /* DW_OP_plus */ ++ ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++ testb $3, CS(%rdi) ++ jnz 1f ++ pax_enter_kernel ++ jmp 2f ++1: pax_enter_kernel_user ++2: ++#else ++ pax_enter_kernel ++#endif ++ + /* We entered an interrupt context - irqs are off: */ + TRACE_IRQS_OFF + .endm +@@ -514,9 +939,52 @@ ENTRY(save_paranoid) js 1f /* negative -> in kernel */ SWAPGS xorl %ebx,%ebx -1: ret -+1: pax_force_retaddr_bts ++1: ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++ testb $3, CS+8(%rsp) ++ jnz 1f ++ pax_enter_kernel ++ jmp 2f ++1: pax_enter_kernel_user ++2: ++#else ++ pax_enter_kernel ++#endif ++ pax_force_retaddr + ret CFI_ENDPROC -END(save_paranoid) +ENDPROC(save_paranoid) ++ ++ENTRY(save_paranoid_nmi) ++ XCPT_FRAME 1 RDI+8 ++ cld ++ movq_cfi rdi, RDI+8 ++ movq_cfi rsi, RSI+8 ++ movq_cfi rdx, RDX+8 ++ movq_cfi rcx, RCX+8 ++ movq_cfi rax, RAX+8 ++ movq_cfi r8, R8+8 ++ movq_cfi r9, R9+8 ++ movq_cfi r10, R10+8 ++ movq_cfi r11, R11+8 ++ movq_cfi rbx, RBX+8 ++ movq_cfi rbp, RBP+8 ++ movq_cfi r12, R12+8 ++ movq_cfi r13, R13+8 ++ movq_cfi r14, R14+8 ++ movq_cfi r15, R15+8 ++ movl $1,%ebx ++ movl $MSR_GS_BASE,%ecx ++ rdmsr ++ testl %edx,%edx ++ js 1f /* negative -> in kernel */ ++ SWAPGS ++ xorl %ebx,%ebx ++1: pax_enter_kernel_nmi ++ pax_force_retaddr ++ ret ++ CFI_ENDPROC ++ENDPROC(save_paranoid_nmi) .popsection /* -@@ -538,7 +952,7 @@ ENTRY(ret_from_fork) +@@ -538,7 +1006,7 @@ ENTRY(ret_from_fork) RESTORE_REST @@ -22737,7 +23336,7 @@ index b077f4c..8e0df9f 100644 jz 1f testl $_TIF_IA32, TI_flags(%rcx) # 32-bit compat task needs IRET -@@ -548,15 +962,13 @@ ENTRY(ret_from_fork) +@@ -548,15 +1016,13 @@ ENTRY(ret_from_fork) jmp ret_from_sys_call # go to the SYSRET fastpath 1: @@ -22754,7 +23353,7 @@ index b077f4c..8e0df9f 100644 /* * System call entry. Up to 6 arguments in registers are supported. -@@ -593,7 +1005,7 @@ END(ret_from_fork) +@@ -593,7 +1059,7 @@ END(ret_from_fork) ENTRY(system_call) CFI_STARTPROC simple CFI_SIGNAL_FRAME @@ -22763,7 +23362,7 @@ index b077f4c..8e0df9f 100644 CFI_REGISTER rip,rcx /*CFI_REGISTER rflags,r11*/ SWAPGS_UNSAFE_STACK -@@ -606,16 +1018,23 @@ GLOBAL(system_call_after_swapgs) +@@ -606,16 +1072,23 @@ GLOBAL(system_call_after_swapgs) movq %rsp,PER_CPU_VAR(old_rsp) movq PER_CPU_VAR(kernel_stack),%rsp @@ -22789,7 +23388,7 @@ index b077f4c..8e0df9f 100644 jnz tracesys system_call_fastpath: #if __SYSCALL_MASK == ~0 -@@ -639,10 +1058,13 @@ sysret_check: +@@ -639,10 +1112,13 @@ sysret_check: LOCKDEP_SYS_EXIT DISABLE_INTERRUPTS(CLBR_NONE) TRACE_IRQS_OFF @@ -22804,7 +23403,7 @@ index b077f4c..8e0df9f 100644 /* * sysretq will re-enable interrupts: */ -@@ -701,6 +1123,9 @@ auditsys: +@@ -701,6 +1177,9 @@ auditsys: movq %rax,%rsi /* 2nd arg: syscall number */ movl $AUDIT_ARCH_X86_64,%edi /* 1st arg: audit arch */ call __audit_syscall_entry @@ -22814,7 +23413,7 @@ index b077f4c..8e0df9f 100644 LOAD_ARGS 0 /* reload call-clobbered registers */ jmp system_call_fastpath -@@ -722,7 +1147,7 @@ sysret_audit: +@@ -722,7 +1201,7 @@ sysret_audit: /* Do syscall tracing */ tracesys: #ifdef CONFIG_AUDITSYSCALL @@ -22823,7 +23422,7 @@ index b077f4c..8e0df9f 100644 jz auditsys #endif SAVE_REST -@@ -730,12 +1155,15 @@ tracesys: +@@ -730,12 +1209,15 @@ tracesys: FIXUP_TOP_OF_STACK %rdi movq %rsp,%rdi call syscall_trace_enter @@ -22840,7 +23439,7 @@ index b077f4c..8e0df9f 100644 RESTORE_REST #if __SYSCALL_MASK == ~0 cmpq $__NR_syscall_max,%rax -@@ -765,7 +1193,9 @@ GLOBAL(int_with_check) +@@ -765,7 +1247,9 @@ GLOBAL(int_with_check) andl %edi,%edx jnz int_careful andl $~TS_COMPAT,TI_status(%rcx) @@ -22851,7 +23450,7 @@ index b077f4c..8e0df9f 100644 /* Either reschedule or signal or syscall exit tracking needed. */ /* First do a reschedule test. */ -@@ -811,7 +1241,7 @@ int_restore_rest: +@@ -811,7 +1295,7 @@ int_restore_rest: TRACE_IRQS_OFF jmp int_with_check CFI_ENDPROC @@ -22860,7 +23459,7 @@ index b077f4c..8e0df9f 100644 .macro FORK_LIKE func ENTRY(stub_\func) -@@ -824,9 +1254,10 @@ ENTRY(stub_\func) +@@ -824,9 +1308,10 @@ ENTRY(stub_\func) DEFAULT_FRAME 0 8 /* offset 8: return address */ call sys_\func RESTORE_TOP_OF_STACK %r11, 8 @@ -22873,7 +23472,7 @@ index b077f4c..8e0df9f 100644 .endm .macro FIXED_FRAME label,func -@@ -836,9 +1267,10 @@ ENTRY(\label) +@@ -836,9 +1321,10 @@ ENTRY(\label) FIXUP_TOP_OF_STACK %r11, 8-ARGOFFSET call \func RESTORE_TOP_OF_STACK %r11, 8-ARGOFFSET @@ -22885,7 +23484,7 @@ index b077f4c..8e0df9f 100644 .endm FORK_LIKE clone -@@ -846,19 +1278,6 @@ END(\label) +@@ -846,19 +1332,6 @@ END(\label) FORK_LIKE vfork FIXED_FRAME stub_iopl, sys_iopl @@ -22905,7 +23504,7 @@ index b077f4c..8e0df9f 100644 ENTRY(stub_execve) CFI_STARTPROC addq $8, %rsp -@@ -870,7 +1289,7 @@ ENTRY(stub_execve) +@@ -870,7 +1343,7 @@ ENTRY(stub_execve) RESTORE_REST jmp int_ret_from_sys_call CFI_ENDPROC @@ -22914,7 +23513,7 @@ index b077f4c..8e0df9f 100644 /* * sigreturn is special because it needs to restore all registers on return. -@@ -887,7 +1306,7 @@ ENTRY(stub_rt_sigreturn) +@@ -887,7 +1360,7 @@ ENTRY(stub_rt_sigreturn) RESTORE_REST jmp int_ret_from_sys_call CFI_ENDPROC @@ -22923,7 +23522,7 @@ index b077f4c..8e0df9f 100644 #ifdef CONFIG_X86_X32_ABI ENTRY(stub_x32_rt_sigreturn) -@@ -901,7 +1320,7 @@ ENTRY(stub_x32_rt_sigreturn) +@@ -901,7 +1374,7 @@ ENTRY(stub_x32_rt_sigreturn) RESTORE_REST jmp int_ret_from_sys_call CFI_ENDPROC @@ -22932,7 +23531,7 @@ index b077f4c..8e0df9f 100644 ENTRY(stub_x32_execve) CFI_STARTPROC -@@ -915,7 +1334,7 @@ ENTRY(stub_x32_execve) +@@ -915,7 +1388,7 @@ ENTRY(stub_x32_execve) RESTORE_REST jmp int_ret_from_sys_call CFI_ENDPROC @@ -22941,7 +23540,7 @@ index b077f4c..8e0df9f 100644 #endif -@@ -952,7 +1371,7 @@ vector=vector+1 +@@ -952,7 +1425,7 @@ vector=vector+1 2: jmp common_interrupt .endr CFI_ENDPROC @@ -22950,7 +23549,7 @@ index b077f4c..8e0df9f 100644 .previous END(interrupt) -@@ -969,9 +1388,19 @@ END(interrupt) +@@ -969,8 +1442,8 @@ END(interrupt) /* 0(%rsp): ~(interrupt number) */ .macro interrupt func /* reserve pt_regs for scratch regs and rbp */ @@ -22959,20 +23558,9 @@ index b077f4c..8e0df9f 100644 + subq $ORIG_RAX, %rsp + CFI_ADJUST_CFA_OFFSET ORIG_RAX SAVE_ARGS_IRQ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ testb $3, CS(%rdi) -+ jnz 1f -+ pax_enter_kernel -+ jmp 2f -+1: pax_enter_kernel_user -+2: -+#else -+ pax_enter_kernel -+#endif call \func .endm - -@@ -997,14 +1426,14 @@ ret_from_intr: +@@ -997,14 +1470,14 @@ ret_from_intr: /* Restore saved previous stack */ popq %rsi @@ -22991,7 +23579,7 @@ index b077f4c..8e0df9f 100644 je retint_kernel /* Interrupt came from user space */ -@@ -1026,12 +1455,16 @@ retint_swapgs: /* return to user-space */ +@@ -1026,12 +1499,16 @@ retint_swapgs: /* return to user-space */ * The iretq could re-enable interrupts: */ DISABLE_INTERRUPTS(CLBR_ANY) @@ -23008,7 +23596,7 @@ index b077f4c..8e0df9f 100644 /* * The iretq could re-enable interrupts: */ -@@ -1114,7 +1547,7 @@ ENTRY(retint_kernel) +@@ -1112,7 +1589,7 @@ ENTRY(retint_kernel) #endif CFI_ENDPROC @@ -23017,7 +23605,7 @@ index b077f4c..8e0df9f 100644 /* * End of kprobes section */ -@@ -1132,7 +1565,7 @@ ENTRY(\sym) +@@ -1130,7 +1607,7 @@ ENTRY(\sym) interrupt \do_sym jmp ret_from_intr CFI_ENDPROC @@ -23026,22 +23614,7 @@ index b077f4c..8e0df9f 100644 .endm #ifdef CONFIG_TRACING -@@ -1215,12 +1648,22 @@ ENTRY(\sym) - CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15 - call error_entry - DEFAULT_FRAME 0 -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ testb $3, CS(%rsp) -+ jnz 1f -+ pax_enter_kernel -+ jmp 2f -+1: pax_enter_kernel_user -+2: -+#else -+ pax_enter_kernel -+#endif - movq %rsp,%rdi /* pt_regs pointer */ - xorl %esi,%esi /* no error code */ +@@ -1218,7 +1695,7 @@ ENTRY(\sym) call \do_sym jmp error_exit /* %ebx: no swapgs flag */ CFI_ENDPROC @@ -23050,22 +23623,7 @@ index b077f4c..8e0df9f 100644 .endm .macro paranoidzeroentry sym do_sym -@@ -1233,15 +1676,25 @@ ENTRY(\sym) - CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15 - call save_paranoid - TRACE_IRQS_OFF -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ testb $3, CS(%rsp) -+ jnz 1f -+ pax_enter_kernel -+ jmp 2f -+1: pax_enter_kernel_user -+2: -+#else -+ pax_enter_kernel -+#endif - movq %rsp,%rdi /* pt_regs pointer */ - xorl %esi,%esi /* no error code */ +@@ -1236,10 +1713,10 @@ ENTRY(\sym) call \do_sym jmp paranoid_exit /* %ebx: no swapgs flag */ CFI_ENDPROC @@ -23078,20 +23636,8 @@ index b077f4c..8e0df9f 100644 .macro paranoidzeroentry_ist sym do_sym ist ENTRY(\sym) INTR_FRAME -@@ -1252,14 +1705,30 @@ ENTRY(\sym) - CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15 - call save_paranoid +@@ -1252,12 +1729,18 @@ ENTRY(\sym) TRACE_IRQS_OFF_DEBUG -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ testb $3, CS(%rsp) -+ jnz 1f -+ pax_enter_kernel -+ jmp 2f -+1: pax_enter_kernel_user -+2: -+#else -+ pax_enter_kernel -+#endif movq %rsp,%rdi /* pt_regs pointer */ xorl %esi,%esi /* no error code */ +#ifdef CONFIG_SMP @@ -23110,23 +23656,7 @@ index b077f4c..8e0df9f 100644 .endm .macro errorentry sym do_sym -@@ -1271,13 +1740,23 @@ ENTRY(\sym) - CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15 - call error_entry - DEFAULT_FRAME 0 -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ testb $3, CS(%rsp) -+ jnz 1f -+ pax_enter_kernel -+ jmp 2f -+1: pax_enter_kernel_user -+2: -+#else -+ pax_enter_kernel -+#endif - movq %rsp,%rdi /* pt_regs pointer */ - movq ORIG_RAX(%rsp),%rsi /* get error code */ - movq $-1,ORIG_RAX(%rsp) /* no syscall to restart */ +@@ -1275,7 +1758,7 @@ ENTRY(\sym) call \do_sym jmp error_exit /* %ebx: no swapgs flag */ CFI_ENDPROC @@ -23134,24 +23664,8 @@ index b077f4c..8e0df9f 100644 +ENDPROC(\sym) .endm - /* error code is on the stack already */ -@@ -1291,13 +1770,23 @@ ENTRY(\sym) - call save_paranoid - DEFAULT_FRAME 0 - TRACE_IRQS_OFF -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ testb $3, CS(%rsp) -+ jnz 1f -+ pax_enter_kernel -+ jmp 2f -+1: pax_enter_kernel_user -+2: -+#else -+ pax_enter_kernel -+#endif - movq %rsp,%rdi /* pt_regs pointer */ - movq ORIG_RAX(%rsp),%rsi /* get error code */ - movq $-1,ORIG_RAX(%rsp) /* no syscall to restart */ + #ifdef CONFIG_TRACING +@@ -1306,7 +1789,7 @@ ENTRY(\sym) call \do_sym jmp paranoid_exit /* %ebx: no swapgs flag */ CFI_ENDPROC @@ -23160,7 +23674,7 @@ index b077f4c..8e0df9f 100644 .endm zeroentry divide_error do_divide_error -@@ -1327,9 +1816,10 @@ gs_change: +@@ -1336,9 +1819,10 @@ gs_change: 2: mfence /* workaround */ SWAPGS popfq_cfi @@ -23172,19 +23686,19 @@ index b077f4c..8e0df9f 100644 _ASM_EXTABLE(gs_change,bad_gs) .section .fixup,"ax" -@@ -1357,9 +1847,10 @@ ENTRY(call_softirq) +@@ -1366,9 +1850,10 @@ ENTRY(do_softirq_own_stack) CFI_DEF_CFA_REGISTER rsp CFI_ADJUST_CFA_OFFSET -8 decl PER_CPU_VAR(irq_count) + pax_force_retaddr ret CFI_ENDPROC --END(call_softirq) -+ENDPROC(call_softirq) +-END(do_softirq_own_stack) ++ENDPROC(do_softirq_own_stack) #ifdef CONFIG_XEN zeroentry xen_hypervisor_callback xen_do_hypervisor_callback -@@ -1397,7 +1888,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs) +@@ -1406,7 +1891,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs) decl PER_CPU_VAR(irq_count) jmp error_exit CFI_ENDPROC @@ -23193,7 +23707,7 @@ index b077f4c..8e0df9f 100644 /* * Hypervisor uses this for application faults while it executes. -@@ -1456,7 +1947,7 @@ ENTRY(xen_failsafe_callback) +@@ -1465,7 +1950,7 @@ ENTRY(xen_failsafe_callback) SAVE_ALL jmp error_exit CFI_ENDPROC @@ -23202,7 +23716,7 @@ index b077f4c..8e0df9f 100644 apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \ xen_hvm_callback_vector xen_evtchn_do_upcall -@@ -1508,18 +1999,33 @@ ENTRY(paranoid_exit) +@@ -1517,18 +2002,33 @@ ENTRY(paranoid_exit) DEFAULT_FRAME DISABLE_INTERRUPTS(CLBR_NONE) TRACE_IRQS_OFF_DEBUG @@ -23238,7 +23752,7 @@ index b077f4c..8e0df9f 100644 jmp irq_return paranoid_userspace: GET_THREAD_INFO(%rcx) -@@ -1548,7 +2054,7 @@ paranoid_schedule: +@@ -1557,7 +2057,7 @@ paranoid_schedule: TRACE_IRQS_OFF jmp paranoid_userspace CFI_ENDPROC @@ -23247,7 +23761,7 @@ index b077f4c..8e0df9f 100644 /* * Exception entry point. This expects an error code/orig_rax on the stack. -@@ -1575,12 +2081,13 @@ ENTRY(error_entry) +@@ -1584,12 +2084,23 @@ ENTRY(error_entry) movq_cfi r14, R14+8 movq_cfi r15, R15+8 xorl %ebx,%ebx @@ -23257,12 +23771,22 @@ index b077f4c..8e0df9f 100644 error_swapgs: SWAPGS error_sti: ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++ testb $3, CS+8(%rsp) ++ jnz 1f ++ pax_enter_kernel ++ jmp 2f ++1: pax_enter_kernel_user ++2: ++#else ++ pax_enter_kernel ++#endif TRACE_IRQS_OFF -+ pax_force_retaddr_bts ++ pax_force_retaddr ret /* -@@ -1607,7 +2114,7 @@ bstep_iret: +@@ -1616,7 +2127,7 @@ bstep_iret: movq %rcx,RIP+8(%rsp) jmp error_swapgs CFI_ENDPROC @@ -23271,7 +23795,7 @@ index b077f4c..8e0df9f 100644 /* ebx: no swapgs flag (1: don't need swapgs, 0: need it) */ -@@ -1618,7 +2125,7 @@ ENTRY(error_exit) +@@ -1627,7 +2138,7 @@ ENTRY(error_exit) DISABLE_INTERRUPTS(CLBR_NONE) TRACE_IRQS_OFF GET_THREAD_INFO(%rcx) @@ -23280,7 +23804,7 @@ index b077f4c..8e0df9f 100644 jne retint_kernel LOCKDEP_SYS_EXIT_IRQ movl TI_flags(%rcx),%edx -@@ -1627,7 +2134,7 @@ ENTRY(error_exit) +@@ -1636,7 +2147,7 @@ ENTRY(error_exit) jnz retint_careful jmp retint_swapgs CFI_ENDPROC @@ -23289,7 +23813,7 @@ index b077f4c..8e0df9f 100644 /* * Test if a given stack is an NMI stack or not. -@@ -1685,9 +2192,11 @@ ENTRY(nmi) +@@ -1694,9 +2205,11 @@ ENTRY(nmi) * If %cs was not the kernel segment, then the NMI triggered in user * space, which means it is definitely not nested. */ @@ -23302,7 +23826,7 @@ index b077f4c..8e0df9f 100644 /* * Check the special variable on the stack to see if NMIs are * executing. -@@ -1721,8 +2230,7 @@ nested_nmi: +@@ -1730,8 +2243,7 @@ nested_nmi: 1: /* Set up the interrupted NMIs stack to jump to repeat_nmi */ @@ -23312,7 +23836,7 @@ index b077f4c..8e0df9f 100644 CFI_ADJUST_CFA_OFFSET 1*8 leaq -10*8(%rsp), %rdx pushq_cfi $__KERNEL_DS -@@ -1740,6 +2248,7 @@ nested_nmi_out: +@@ -1749,6 +2261,7 @@ nested_nmi_out: CFI_RESTORE rdx /* No need to check faults here */ @@ -23320,7 +23844,23 @@ index b077f4c..8e0df9f 100644 INTERRUPT_RETURN CFI_RESTORE_STATE -@@ -1852,9 +2361,11 @@ end_repeat_nmi: +@@ -1845,13 +2358,13 @@ end_repeat_nmi: + subq $ORIG_RAX-R15, %rsp + CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15 + /* +- * Use save_paranoid to handle SWAPGS, but no need to use paranoid_exit ++ * Use save_paranoid_nmi to handle SWAPGS, but no need to use paranoid_exit + * as we should not be calling schedule in NMI context. + * Even with normal interrupts enabled. An NMI should not be + * setting NEED_RESCHED or anything that normal interrupts and + * exceptions might do. + */ +- call save_paranoid ++ call save_paranoid_nmi + DEFAULT_FRAME 0 + + /* +@@ -1861,9 +2374,9 @@ end_repeat_nmi: * NMI itself takes a page fault, the page fault that was preempted * will read the information from the NMI page fault and not the * origin fault. Save it off and restore it if it changes. @@ -23329,12 +23869,10 @@ index b077f4c..8e0df9f 100644 */ - movq %cr2, %r12 + movq %cr2, %r13 -+ -+ pax_enter_kernel_nmi /* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */ movq %rsp,%rdi -@@ -1863,31 +2374,36 @@ end_repeat_nmi: +@@ -1872,31 +2385,36 @@ end_repeat_nmi: /* Did the NMI take a page fault? Restore cr2 if it did */ movq %cr2, %rcx @@ -23377,10 +23915,10 @@ index b077f4c..8e0df9f 100644 /* * End of kprobes section diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c -index d4bdd25..912664c 100644 +index e625319..b9abb9d 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c -@@ -105,6 +105,8 @@ ftrace_modify_code_direct(unsigned long ip, unsigned const char *old_code, +@@ -104,6 +104,8 @@ ftrace_modify_code_direct(unsigned long ip, unsigned const char *old_code, { unsigned char replaced[MCOUNT_INSN_SIZE]; @@ -23389,25 +23927,16 @@ index d4bdd25..912664c 100644 /* * Note: Due to modules and __init, code can * disappear and change, we need to protect against faulting -@@ -227,7 +229,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func) - unsigned char old[MCOUNT_INSN_SIZE], *new; +@@ -229,7 +231,7 @@ static int update_ftrace_func(unsigned long ip, void *new) + unsigned char old[MCOUNT_INSN_SIZE]; int ret; -- memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE); -+ memcpy(old, (void *)ktla_ktva((unsigned long)ftrace_call), MCOUNT_INSN_SIZE); - new = ftrace_call_replace(ip, (unsigned long)func); +- memcpy(old, (void *)ip, MCOUNT_INSN_SIZE); ++ memcpy(old, (void *)ktla_ktva(ip), MCOUNT_INSN_SIZE); - /* See comment above by declaration of modifying_ftrace_code */ -@@ -238,7 +240,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func) - /* Also update the regs callback function */ - if (!ret) { - ip = (unsigned long)(&ftrace_regs_call); -- memcpy(old, &ftrace_regs_call, MCOUNT_INSN_SIZE); -+ memcpy(old, ktla_ktva((void *)&ftrace_regs_call), MCOUNT_INSN_SIZE); - new = ftrace_call_replace(ip, (unsigned long)func); - ret = ftrace_modify_code(ip, old, new); - } -@@ -291,7 +293,7 @@ static int ftrace_write(unsigned long ip, const char *val, int size) + ftrace_update_func = ip; + /* Make sure the breakpoints see the ftrace_update_func update */ +@@ -306,7 +308,7 @@ static int ftrace_write(unsigned long ip, const char *val, int size) * kernel identity mapping to modify code. */ if (within(ip, (unsigned long)_text, (unsigned long)_etext)) @@ -23416,7 +23945,7 @@ index d4bdd25..912664c 100644 return probe_kernel_write((void *)ip, val, size); } -@@ -301,7 +303,7 @@ static int add_break(unsigned long ip, const char *old) +@@ -316,7 +318,7 @@ static int add_break(unsigned long ip, const char *old) unsigned char replaced[MCOUNT_INSN_SIZE]; unsigned char brk = BREAKPOINT_INSTRUCTION; @@ -23425,7 +23954,7 @@ index d4bdd25..912664c 100644 return -EFAULT; /* Make sure it is what we expect it to be */ -@@ -649,7 +651,7 @@ ftrace_modify_code(unsigned long ip, unsigned const char *old_code, +@@ -664,7 +666,7 @@ ftrace_modify_code(unsigned long ip, unsigned const char *old_code, return ret; fail_update: @@ -23434,17 +23963,8 @@ index d4bdd25..912664c 100644 goto out; } -@@ -682,6 +684,8 @@ static int ftrace_mod_jmp(unsigned long ip, - { - unsigned char code[MCOUNT_INSN_SIZE]; - -+ ip = ktla_ktva(ip); -+ - if (probe_kernel_read(code, (void *)ip, MCOUNT_INSN_SIZE)) - return -EFAULT; - diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c -index 1be8e43..d9b9ef6 100644 +index 85126cc..1bbce17 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -67,12 +67,12 @@ again: @@ -23497,7 +24017,7 @@ index 1be8e43..d9b9ef6 100644 init_level4_pgt[511] = early_level4_pgt[511]; diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S -index 81ba276..30c5411 100644 +index f36bd42..56ee1534 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S @@ -26,6 +26,12 @@ @@ -23720,16 +24240,16 @@ index 81ba276..30c5411 100644 movw %cx, 8 * GDT_ENTRY_STACK_CANARY + 2(%eax) shrl $16, %ecx movb %cl, 8 * GDT_ENTRY_STACK_CANARY + 4(%eax) -@@ -544,7 +629,7 @@ ENDPROC(early_idt_handlers) - /* This is global to keep gas from relaxing the jumps */ - ENTRY(early_idt_handler) - cld +@@ -548,7 +633,7 @@ ENTRY(early_idt_handler) + cmpl $2,(%esp) # X86_TRAP_NMI + je is_nmi # Ignore NMI + - cmpl $2,%ss:early_recursion_flag + cmpl $1,%ss:early_recursion_flag je hlt_loop incl %ss:early_recursion_flag -@@ -582,8 +667,8 @@ ENTRY(early_idt_handler) +@@ -586,8 +671,8 @@ ENTRY(early_idt_handler) pushl (20+6*4)(%esp) /* trapno */ pushl $fault_msg call printk @@ -23739,7 +24259,7 @@ index 81ba276..30c5411 100644 hlt_loop: hlt jmp hlt_loop -@@ -602,8 +687,11 @@ ENDPROC(early_idt_handler) +@@ -607,8 +692,11 @@ ENDPROC(early_idt_handler) /* This is the default interrupt "handler" :-) */ ALIGN ignore_int: @@ -23752,7 +24272,7 @@ index 81ba276..30c5411 100644 pushl %eax pushl %ecx pushl %edx -@@ -612,9 +700,6 @@ ignore_int: +@@ -617,9 +705,6 @@ ignore_int: movl $(__KERNEL_DS),%eax movl %eax,%ds movl %eax,%es @@ -23762,7 +24282,7 @@ index 81ba276..30c5411 100644 pushl 16(%esp) pushl 24(%esp) pushl 32(%esp) -@@ -648,29 +733,34 @@ ENTRY(setup_once_ref) +@@ -653,29 +738,34 @@ ENTRY(setup_once_ref) /* * BSS section */ @@ -23802,7 +24322,7 @@ index 81ba276..30c5411 100644 ENTRY(initial_page_table) .long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */ # if KPMDS == 3 -@@ -689,12 +779,20 @@ ENTRY(initial_page_table) +@@ -694,12 +784,20 @@ ENTRY(initial_page_table) # error "Kernel PMDs should be 1, 2 or 3" # endif .align PAGE_SIZE /* needs to be page-sized too */ @@ -23824,7 +24344,7 @@ index 81ba276..30c5411 100644 __INITRODATA int_msg: -@@ -722,7 +820,7 @@ fault_msg: +@@ -727,7 +825,7 @@ fault_msg: * segment size, and 32-bit linear address value: */ @@ -23833,7 +24353,7 @@ index 81ba276..30c5411 100644 .globl boot_gdt_descr .globl idt_descr -@@ -731,7 +829,7 @@ fault_msg: +@@ -736,7 +834,7 @@ fault_msg: .word 0 # 32 bit align gdt_desc.address boot_gdt_descr: .word __BOOT_DS+7 @@ -23842,7 +24362,7 @@ index 81ba276..30c5411 100644 .word 0 # 32-bit align idt_desc.address idt_descr: -@@ -742,7 +840,7 @@ idt_descr: +@@ -747,7 +845,7 @@ idt_descr: .word 0 # 32 bit align gdt_desc.address ENTRY(early_gdt_descr) .word GDT_ENTRIES*8-1 @@ -23851,7 +24371,7 @@ index 81ba276..30c5411 100644 /* * The boot_gdt must mirror the equivalent in setup.S and is -@@ -751,5 +849,65 @@ ENTRY(early_gdt_descr) +@@ -756,5 +854,65 @@ ENTRY(early_gdt_descr) .align L1_CACHE_BYTES ENTRY(boot_gdt) .fill GDT_ENTRY_BOOT_CS,8,0 @@ -23920,7 +24440,7 @@ index 81ba276..30c5411 100644 + .fill PAGE_SIZE_asm - GDT_SIZE,1,0 + .endr diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S -index e1aabdb..fee4fee 100644 +index a468c0a..b9aed84 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -20,6 +20,8 @@ @@ -24012,7 +24532,7 @@ index e1aabdb..fee4fee 100644 movq initial_code(%rip),%rax pushq $0 # fake return address to stop unwinder pushq $__KERNEL_CS # set correct cs -@@ -388,7 +419,7 @@ ENTRY(early_idt_handler) +@@ -391,7 +422,7 @@ ENTRY(early_idt_handler) call dump_stack #ifdef CONFIG_KALLSYMS leaq early_idt_ripmsg(%rip),%rdi @@ -24021,7 +24541,7 @@ index e1aabdb..fee4fee 100644 call __print_symbol #endif #endif /* EARLY_PRINTK */ -@@ -416,6 +447,7 @@ ENDPROC(early_idt_handler) +@@ -420,6 +451,7 @@ ENDPROC(early_idt_handler) early_recursion_flag: .long 0 @@ -24029,7 +24549,7 @@ index e1aabdb..fee4fee 100644 #ifdef CONFIG_EARLY_PRINTK early_idt_msg: .asciz "PANIC: early exception %02lx rip %lx:%lx error %lx cr2 %lx\n" -@@ -443,29 +475,52 @@ NEXT_PAGE(early_level4_pgt) +@@ -447,29 +479,52 @@ NEXT_PAGE(early_level4_pgt) NEXT_PAGE(early_dynamic_pgts) .fill 512*EARLY_DYNAMIC_PAGE_TABLES,8,0 @@ -24091,7 +24611,7 @@ index e1aabdb..fee4fee 100644 NEXT_PAGE(level3_kernel_pgt) .fill L3_START_KERNEL,8,0 -@@ -473,6 +528,9 @@ NEXT_PAGE(level3_kernel_pgt) +@@ -477,6 +532,9 @@ NEXT_PAGE(level3_kernel_pgt) .quad level2_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE .quad level2_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE @@ -24101,7 +24621,7 @@ index e1aabdb..fee4fee 100644 NEXT_PAGE(level2_kernel_pgt) /* * 512 MB kernel mapping. We spend a full page on this pagetable -@@ -490,28 +548,64 @@ NEXT_PAGE(level2_kernel_pgt) +@@ -494,28 +552,64 @@ NEXT_PAGE(level2_kernel_pgt) NEXT_PAGE(level2_fixmap_pgt) .fill 506,8,0 .quad level1_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE @@ -24173,7 +24693,7 @@ index e1aabdb..fee4fee 100644 NEXT_PAGE(empty_zero_page) .skip PAGE_SIZE diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c -index 0fa6912..b37438b 100644 +index 05fd74f..c3548b1 100644 --- a/arch/x86/kernel/i386_ksyms_32.c +++ b/arch/x86/kernel/i386_ksyms_32.c @@ -20,8 +20,12 @@ extern void cmpxchg8b_emu(void); @@ -24189,10 +24709,10 @@ index 0fa6912..b37438b 100644 EXPORT_SYMBOL(__get_user_1); EXPORT_SYMBOL(__get_user_2); -@@ -37,3 +41,11 @@ EXPORT_SYMBOL(strstr); - - EXPORT_SYMBOL(csum_partial); - EXPORT_SYMBOL(empty_zero_page); +@@ -44,3 +48,11 @@ EXPORT_SYMBOL(___preempt_schedule); + EXPORT_SYMBOL(___preempt_schedule_context); + #endif + #endif + +#ifdef CONFIG_PAX_KERNEXEC +EXPORT_SYMBOL(__LOAD_PHYSICAL_ADDR); @@ -24202,7 +24722,7 @@ index 0fa6912..b37438b 100644 +EXPORT_SYMBOL(cpu_pgd); +#endif diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c -index 5d576ab..1403a03 100644 +index d5dd808..b6432cf 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c @@ -51,7 +51,7 @@ static inline bool interrupted_kernel_fpu_idle(void) @@ -24215,7 +24735,7 @@ index 5d576ab..1403a03 100644 /* diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c -index 9a5c460..84868423 100644 +index 2e977b5..5f2c273 100644 --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c @@ -110,7 +110,7 @@ static int i8259A_irq_pending(unsigned int irq) @@ -24236,7 +24756,7 @@ index 9a5c460..84868423 100644 /* * Theoretically we do not have to handle this IRQ, * but in Linux this does not cause problems and is -@@ -333,14 +333,16 @@ static void init_8259A(int auto_eoi) +@@ -332,14 +332,16 @@ static void init_8259A(int auto_eoi) /* (slave's support for AEOI in flat mode is to be investigated) */ outb_pic(SLAVE_ICW4_DEFAULT, PIC_SLAVE_IMR); @@ -24350,7 +24870,7 @@ index 22d0687..e07b2a5 100644 } diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c -index 4186755..18d6a9e 100644 +index d7fcbed..1f747f7 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c @@ -39,7 +39,7 @@ static int check_stack_overflow(void) @@ -24385,7 +24905,7 @@ index 4186755..18d6a9e 100644 irqctx = __this_cpu_read(hardirq_ctx); /* -@@ -92,16 +91,16 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) +@@ -92,13 +91,16 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) * handler) we can't do that and just have to keep using the * current stack (which is the irq stack already after all) */ @@ -24399,16 +24919,14 @@ index 4186755..18d6a9e 100644 - irqctx->tinfo.previous_esp = current_stack_pointer; + isp = (u32 *) ((char *)irqctx + sizeof(*irqctx) - 8); + irqctx->previous_esp = current_stack_pointer; - -- /* Copy the preempt_count so that the [soft]irq checks work. */ -- irqctx->tinfo.preempt_count = curctx->tinfo.preempt_count; ++ +#ifdef CONFIG_PAX_MEMORY_UDEREF + __set_fs(MAKE_MM_SEG(0)); +#endif if (unlikely(overflow)) call_on_stack(print_stack_overflow, isp); -@@ -113,6 +112,11 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) +@@ -110,6 +112,11 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) : "0" (irq), "1" (desc), "2" (isp), "D" (desc->handle_irq) : "memory", "cc", "ecx"); @@ -24420,7 +24938,7 @@ index 4186755..18d6a9e 100644 return 1; } -@@ -121,29 +125,11 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) +@@ -118,48 +125,34 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) */ void irq_ctx_init(int cpu) { @@ -24434,7 +24952,6 @@ index 4186755..18d6a9e 100644 - THREAD_SIZE_ORDER)); - memset(&irqctx->tinfo, 0, sizeof(struct thread_info)); - irqctx->tinfo.cpu = cpu; -- irqctx->tinfo.preempt_count = HARDIRQ_OFFSET; - irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); - - per_cpu(hardirq_ctx, cpu) = irqctx; @@ -24447,47 +24964,43 @@ index 4186755..18d6a9e 100644 - irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); - - per_cpu(softirq_ctx, cpu) = irqctx; +- +- printk(KERN_DEBUG "CPU %u irqstacks, hard=%p soft=%p\n", +- cpu, per_cpu(hardirq_ctx, cpu), per_cpu(softirq_ctx, cpu)); + per_cpu(hardirq_ctx, cpu) = page_address(alloc_pages_node(cpu_to_node(cpu), THREADINFO_GFP, THREAD_SIZE_ORDER)); + per_cpu(softirq_ctx, cpu) = page_address(alloc_pages_node(cpu_to_node(cpu), THREADINFO_GFP, THREAD_SIZE_ORDER)); + } - printk(KERN_DEBUG "CPU %u irqstacks, hard=%p soft=%p\n", - cpu, per_cpu(hardirq_ctx, cpu), per_cpu(softirq_ctx, cpu)); -@@ -152,7 +138,6 @@ void irq_ctx_init(int cpu) - asmlinkage void do_softirq(void) + void do_softirq_own_stack(void) { - unsigned long flags; - struct thread_info *curctx; union irq_ctx *irqctx; u32 *isp; -@@ -162,15 +147,22 @@ asmlinkage void do_softirq(void) - local_irq_save(flags); +- curctx = current_thread_info(); + irqctx = __this_cpu_read(softirq_ctx); +- irqctx->tinfo.task = curctx->task; +- irqctx->tinfo.previous_esp = current_stack_pointer; ++ irqctx->previous_esp = current_stack_pointer; - if (local_softirq_pending()) { -- curctx = current_thread_info(); - irqctx = __this_cpu_read(softirq_ctx); -- irqctx->tinfo.task = curctx->task; -- irqctx->tinfo.previous_esp = current_stack_pointer; -+ irqctx->previous_esp = current_stack_pointer; - - /* build the stack frame on the softirq stack */ -- isp = (u32 *) ((char *)irqctx + sizeof(*irqctx)); -+ isp = (u32 *) ((char *)irqctx + sizeof(*irqctx) - 8); + /* build the stack frame on the softirq stack */ +- isp = (u32 *) ((char *)irqctx + sizeof(*irqctx)); ++ isp = (u32 *) ((char *)irqctx + sizeof(*irqctx) - 8); + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+ __set_fs(MAKE_MM_SEG(0)); ++ __set_fs(MAKE_MM_SEG(0)); +#endif - call_on_stack(__do_softirq, isp); + call_on_stack(__do_softirq, isp); + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+ __set_fs(current_thread_info()->addr_limit); ++ __set_fs(current_thread_info()->addr_limit); +#endif + - /* - * Shouldn't happen, we returned above if in_interrupt(): - */ -@@ -191,7 +183,7 @@ bool handle_irq(unsigned irq, struct pt_regs *regs) + } + + bool handle_irq(unsigned irq, struct pt_regs *regs) +@@ -173,7 +166,7 @@ bool handle_irq(unsigned irq, struct pt_regs *regs) if (unlikely(!desc)) return false; @@ -24497,7 +25010,7 @@ index 4186755..18d6a9e 100644 print_stack_overflow(); desc->handle_irq(irq, desc); diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c -index d04d3ec..ea4b374 100644 +index 4d1c746..232961d 100644 --- a/arch/x86/kernel/irq_64.c +++ b/arch/x86/kernel/irq_64.c @@ -44,7 +44,7 @@ static inline void stack_overflow_check(struct pt_regs *regs) @@ -24510,22 +25023,31 @@ index d04d3ec..ea4b374 100644 if (regs->sp >= curbase + sizeof(struct thread_info) + diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c -index ee11b7d..4df4d0c 100644 +index 26d5a55..a01160a 100644 --- a/arch/x86/kernel/jump_label.c +++ b/arch/x86/kernel/jump_label.c -@@ -49,7 +49,7 @@ static void __jump_label_transform(struct jump_entry *entry, - * We are enabling this jump label. If it is not a nop - * then something must have gone wrong. - */ -- if (unlikely(memcmp((void *)entry->code, ideal_nop, 5) != 0)) -+ if (unlikely(memcmp((void *)ktla_ktva(entry->code), ideal_nop, 5) != 0)) - bug_at((void *)entry->code, __LINE__); - - code.jump = 0xe9; -@@ -64,13 +64,13 @@ static void __jump_label_transform(struct jump_entry *entry, +@@ -51,7 +51,7 @@ static void __jump_label_transform(struct jump_entry *entry, + * Jump label is enabled for the first time. + * So we expect a default_nop... + */ +- if (unlikely(memcmp((void *)entry->code, default_nop, 5) ++ if (unlikely(memcmp((void *)ktla_ktva(entry->code), default_nop, 5) + != 0)) + bug_at((void *)entry->code, __LINE__); + } else { +@@ -59,7 +59,7 @@ static void __jump_label_transform(struct jump_entry *entry, + * ...otherwise expect an ideal_nop. Otherwise + * something went horribly wrong. + */ +- if (unlikely(memcmp((void *)entry->code, ideal_nop, 5) ++ if (unlikely(memcmp((void *)ktla_ktva(entry->code), ideal_nop, 5) + != 0)) + bug_at((void *)entry->code, __LINE__); + } +@@ -75,13 +75,13 @@ static void __jump_label_transform(struct jump_entry *entry, + * are converting the default nop to the ideal nop. */ if (init) { - const unsigned char default_nop[] = { STATIC_KEY_INIT_NOP }; - if (unlikely(memcmp((void *)entry->code, default_nop, 5) != 0)) + if (unlikely(memcmp((void *)ktla_ktva(entry->code), default_nop, 5) != 0)) bug_at((void *)entry->code, __LINE__); @@ -24950,7 +25472,7 @@ index 5fb2ceb..3ae90bb 100644 static void microcode_fini_cpu(int cpu) diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c -index 216a4d7..228255a 100644 +index 18be189..4a9fe40 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c @@ -43,15 +43,60 @@ do { \ @@ -24966,7 +25488,7 @@ index 216a4d7..228255a 100644 return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, - GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC, + GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, prot, - -1, __builtin_return_address(0)); + NUMA_NO_NODE, __builtin_return_address(0)); } +void *module_alloc(unsigned long size) @@ -25087,10 +25609,41 @@ index 216a4d7..228255a 100644 if ((s64)val != *(s32 *)loc) goto overflow; diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c -index 88458fa..349f7a4 100644 +index 05266b5..3432443 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c -@@ -233,7 +233,7 @@ static int msr_class_cpu_callback(struct notifier_block *nfb, +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -103,6 +104,11 @@ static ssize_t msr_write(struct file *file, const char __user *buf, + int err = 0; + ssize_t bytes = 0; + ++#ifdef CONFIG_GRKERNSEC_KMEM ++ gr_handle_msr_write(); ++ return -EPERM; ++#endif ++ + if (count % 8) + return -EINVAL; /* Invalid chunk size */ + +@@ -150,6 +156,10 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg) + err = -EBADF; + break; + } ++#ifdef CONFIG_GRKERNSEC_KMEM ++ gr_handle_msr_write(); ++ return -EPERM; ++#endif + if (copy_from_user(®s, uregs, sizeof regs)) { + err = -EFAULT; + break; +@@ -233,7 +243,7 @@ static int msr_class_cpu_callback(struct notifier_block *nfb, return notifier_from_errno(err); } @@ -25360,6 +25913,33 @@ index 6c483ba..d10ce2f 100644 } static struct dma_map_ops swiotlb_dma_ops = { +diff --git a/arch/x86/kernel/preempt.S b/arch/x86/kernel/preempt.S +index ca7f0d5..8996469 100644 +--- a/arch/x86/kernel/preempt.S ++++ b/arch/x86/kernel/preempt.S +@@ -3,12 +3,14 @@ + #include + #include + #include ++#include + + ENTRY(___preempt_schedule) + CFI_STARTPROC + SAVE_ALL + call preempt_schedule + RESTORE_ALL ++ pax_force_retaddr + ret + CFI_ENDPROC + +@@ -19,6 +21,7 @@ ENTRY(___preempt_schedule_context) + SAVE_ALL + call preempt_schedule_context + RESTORE_ALL ++ pax_force_retaddr + ret + CFI_ENDPROC + diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 3fb8d95..254dc51 100644 --- a/arch/x86/kernel/process.c @@ -25469,7 +26049,7 @@ index 3fb8d95..254dc51 100644 +} +#endif diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c -index 884f98f..ec23e04 100644 +index 6f1236c..fd448d4 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -65,6 +65,7 @@ asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread"); @@ -25549,7 +26129,7 @@ index 884f98f..ec23e04 100644 /* * Load the per-thread Thread-Local Storage descriptor. */ -@@ -307,6 +312,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) +@@ -315,6 +320,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) */ arch_end_context_switch(next_p); @@ -25559,7 +26139,7 @@ index 884f98f..ec23e04 100644 /* * Restore %gs if needed (which is common) */ -@@ -315,8 +323,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) +@@ -323,8 +331,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) switch_fpu_finish(next_p, fpu); @@ -25568,13 +26148,13 @@ index 884f98f..ec23e04 100644 return prev_p; } -@@ -346,4 +352,3 @@ unsigned long get_wchan(struct task_struct *p) +@@ -354,4 +360,3 @@ unsigned long get_wchan(struct task_struct *p) } while (count++ < 16); return 0; } - diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c -index bb1dc51..08dda7f 100644 +index 9c0280f..5bbb1c0 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -158,10 +158,11 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, @@ -25588,7 +26168,7 @@ index bb1dc51..08dda7f 100644 p->thread.usersp = me->thread.usersp; + p->tinfo.lowest_stack = (unsigned long)task_stack_page(p); set_tsk_thread_flag(p, TIF_FORK); - p->fpu_counter = 0; + p->thread.fpu_counter = 0; p->thread.io_bitmap_ptr = NULL; @@ -172,6 +173,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, p->thread.fs = p->thread.fsindex ? 0 : me->thread.fs; @@ -25618,12 +26198,18 @@ index bb1dc51..08dda7f 100644 /* We must save %fs and %gs before load_TLS() because * %fs and %gs may be cleared by load_TLS(). -@@ -362,10 +368,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) +@@ -362,6 +368,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) prev->usersp = this_cpu_read(old_rsp); this_cpu_write(old_rsp, next->usersp); this_cpu_write(current_task, next_p); + this_cpu_write(current_tinfo, &next_p->tinfo); + /* + * If it were not for PREEMPT_ACTIVE we could guarantee that the +@@ -371,9 +378,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) + task_thread_info(prev_p)->saved_preempt_count = this_cpu_read(__preempt_count); + this_cpu_write(__preempt_count, task_thread_info(next_p)->saved_preempt_count); + - this_cpu_write(kernel_stack, - (unsigned long)task_stack_page(next_p) + - THREAD_SIZE - KERNEL_STACK_OFFSET); @@ -25631,7 +26217,7 @@ index bb1dc51..08dda7f 100644 /* * Now maybe reload the debug registers and handle I/O bitmaps -@@ -434,12 +439,11 @@ unsigned long get_wchan(struct task_struct *p) +@@ -442,12 +447,11 @@ unsigned long get_wchan(struct task_struct *p) if (!p || p == current || p->state == TASK_RUNNING) return 0; stack = (unsigned long)task_stack_page(p); @@ -25776,11 +26362,11 @@ index 7461f50..1334029 100644 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c -index a16bae3..1f65f25 100644 +index 2f355d2..e75ed0a 100644 --- a/arch/x86/kernel/pvclock.c +++ b/arch/x86/kernel/pvclock.c -@@ -43,11 +43,11 @@ unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src) - return pv_tsc_khz; +@@ -51,11 +51,11 @@ void pvclock_touch_watchdogs(void) + reset_hung_task_detector(); } -static atomic64_t last_value = ATOMIC64_INIT(0); @@ -25793,7 +26379,7 @@ index a16bae3..1f65f25 100644 } u8 pvclock_read_flags(struct pvclock_vcpu_time_info *src) -@@ -92,11 +92,11 @@ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) +@@ -105,11 +105,11 @@ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) * updating at the same time, and one of them could be slightly behind, * making the assumption that last_value always go forward fail to hold. */ @@ -25808,7 +26394,7 @@ index a16bae3..1f65f25 100644 return ret; diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c -index 618ce26..ec7e21c 100644 +index c752cb4..866c432 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -68,6 +68,11 @@ static int __init set_bios_reboot(const struct dmi_system_id *d) @@ -25854,7 +26440,7 @@ index 618ce26..ec7e21c 100644 "rm" (real_mode_header->machine_real_restart_asm), "a" (type)); #else -@@ -466,7 +493,7 @@ void __attribute__((weak)) mach_reboot_fixups(void) +@@ -470,7 +497,7 @@ void __attribute__((weak)) mach_reboot_fixups(void) * try to force a triple fault and then cycle between hitting the keyboard * controller and doing that */ @@ -25863,7 +26449,7 @@ index 618ce26..ec7e21c 100644 { int i; int attempt = 0; -@@ -575,13 +602,13 @@ void native_machine_shutdown(void) +@@ -593,13 +620,13 @@ void native_machine_shutdown(void) #endif } @@ -25879,7 +26465,7 @@ index 618ce26..ec7e21c 100644 { pr_notice("machine restart\n"); -@@ -590,7 +617,7 @@ static void native_machine_restart(char *__unused) +@@ -608,7 +635,7 @@ static void native_machine_restart(char *__unused) __machine_emergency_restart(0); } @@ -25888,7 +26474,7 @@ index 618ce26..ec7e21c 100644 { /* Stop other cpus and apics */ machine_shutdown(); -@@ -600,7 +627,7 @@ static void native_machine_halt(void) +@@ -618,7 +645,7 @@ static void native_machine_halt(void) stop_this_cpu(NULL); } @@ -25897,7 +26483,7 @@ index 618ce26..ec7e21c 100644 { if (pm_power_off) { if (!reboot_force) -@@ -609,9 +636,10 @@ static void native_machine_power_off(void) +@@ -627,9 +654,10 @@ static void native_machine_power_off(void) } /* A fallback in case there is no PM info available */ tboot_shutdown(TB_SHUTDOWN_HALT); @@ -25953,7 +26539,7 @@ index 3fd2c69..16ef367 100644 1: diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index f0de629..a4978a8f 100644 +index cb233bc..23b4879 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -110,6 +110,7 @@ @@ -26237,10 +26823,10 @@ index 7c3a5a6..f0a8961 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 6cacab6..750636a 100644 +index 85dc05a..1241266 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c -@@ -251,14 +251,18 @@ static void notrace start_secondary(void *unused) +@@ -229,14 +229,18 @@ static void notrace start_secondary(void *unused) enable_start_cpu0 = 0; @@ -26265,7 +26851,7 @@ index 6cacab6..750636a 100644 /* * Check TSC synchronization with the BP: */ -@@ -749,6 +753,7 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle) +@@ -751,6 +755,7 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle) idle->thread.sp = (unsigned long) (((struct pt_regs *) (THREAD_SIZE + task_stack_page(idle))) - 1); per_cpu(current_task, cpu) = idle; @@ -26273,7 +26859,7 @@ index 6cacab6..750636a 100644 #ifdef CONFIG_X86_32 /* Stack for startup_32 can be just as for start_secondary onwards */ -@@ -756,11 +761,13 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle) +@@ -758,11 +763,13 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle) #else clear_tsk_thread_flag(idle, TIF_FORK); initial_gs = per_cpu_offset(cpu); @@ -26290,7 +26876,7 @@ index 6cacab6..750636a 100644 initial_code = (unsigned long)start_secondary; stack_start = idle->thread.sp; -@@ -909,6 +916,15 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle) +@@ -911,6 +918,15 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle) /* the FPU context is blank, nobody can own it */ __cpu_disable_lazy_restore(cpu); @@ -26633,7 +27219,7 @@ index 30277e2..5664a29 100644 if (!(addr & ~PAGE_MASK)) return addr; diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c -index 91a4496..1730bff 100644 +index 91a4496..bb87552 100644 --- a/arch/x86/kernel/tboot.c +++ b/arch/x86/kernel/tboot.c @@ -221,7 +221,7 @@ static int tboot_setup_sleep(void) @@ -26650,7 +27236,7 @@ index 91a4496..1730bff 100644 switch_to_tboot_pt(); - shutdown = (void(*)(void))(unsigned long)tboot->shutdown_entry; -+ shutdown = (void *)tboot->shutdown_entry; ++ shutdown = (void *)(unsigned long)tboot->shutdown_entry; shutdown(); /* should not reach here */ @@ -26762,7 +27348,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 8c8093b..c93f581 100644 +index b857ed8..51ae4cb 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -66,7 +66,7 @@ @@ -27025,7 +27611,7 @@ index e8edcf5..27f9344 100644 goto cannot_handle; if ((segoffs >> 16) == BIOSSEG) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S -index 10c4f30..65408b9 100644 +index da6b35a..977e9cf 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -26,6 +26,13 @@ @@ -27226,7 +27812,7 @@ index 10c4f30..65408b9 100644 .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) { __x86_cpu_dev_start = .; -@@ -253,19 +333,12 @@ SECTIONS +@@ -262,19 +342,12 @@ SECTIONS } . = ALIGN(8); @@ -27247,7 +27833,7 @@ index 10c4f30..65408b9 100644 PERCPU_SECTION(INTERNODE_CACHE_BYTES) #endif -@@ -284,16 +357,10 @@ SECTIONS +@@ -293,16 +366,10 @@ SECTIONS .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { __smp_locks = .; *(.smp_locks) @@ -27265,7 +27851,7 @@ index 10c4f30..65408b9 100644 /* BSS */ . = ALIGN(PAGE_SIZE); .bss : AT(ADDR(.bss) - LOAD_OFFSET) { -@@ -309,6 +376,7 @@ SECTIONS +@@ -318,6 +385,7 @@ SECTIONS __brk_base = .; . += 64 * 1024; /* 64k alignment slop space */ *(.brk_reservation) /* areas brk users have reserved */ @@ -27273,7 +27859,7 @@ index 10c4f30..65408b9 100644 __brk_limit = .; } -@@ -335,13 +403,12 @@ SECTIONS +@@ -344,13 +412,12 @@ SECTIONS * for the boot processor. */ #define INIT_PER_CPU(x) init_per_cpu__##x = x + __per_cpu_load @@ -27332,7 +27918,7 @@ index 1f96f93..d5c8f7a 100644 (unsigned long)VSYSCALL_START); diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c -index b014d94..e775258 100644 +index 04068192..4d75aa6 100644 --- a/arch/x86/kernel/x8664_ksyms_64.c +++ b/arch/x86/kernel/x8664_ksyms_64.c @@ -34,8 +34,6 @@ EXPORT_SYMBOL(copy_user_generic_string); @@ -27344,16 +27930,16 @@ index b014d94..e775258 100644 EXPORT_SYMBOL(copy_page); EXPORT_SYMBOL(clear_page); -@@ -66,3 +64,7 @@ EXPORT_SYMBOL(empty_zero_page); - #ifndef CONFIG_PARAVIRT - EXPORT_SYMBOL(native_load_gs_index); +@@ -73,3 +71,7 @@ EXPORT_SYMBOL(___preempt_schedule); + EXPORT_SYMBOL(___preempt_schedule_context); + #endif #endif + +#ifdef CONFIG_PAX_PER_CPU_PGD +EXPORT_SYMBOL(cpu_pgd); +#endif diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c -index 8ce0072..431a0e7 100644 +index 021783b..6511282 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -93,7 +93,7 @@ struct x86_cpuinit_ops x86_cpuinit = { @@ -27374,7 +27960,7 @@ index 8ce0072..431a0e7 100644 .setup_msi_irqs = native_setup_msi_irqs, .compose_msi_msg = native_compose_msi_msg, .teardown_msi_irq = native_teardown_msi_irq, -@@ -140,7 +140,7 @@ void arch_restore_msi_irqs(struct pci_dev *dev, int irq) +@@ -150,7 +150,7 @@ u32 arch_msix_mask_irq(struct msi_desc *desc, u32 flag) } #endif @@ -27384,9 +27970,40 @@ index 8ce0072..431a0e7 100644 .read = native_io_apic_read, .write = native_io_apic_write, diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c -index 422fd82..c3687ca 100644 +index 422fd82..b2d262e 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c +@@ -164,18 +164,18 @@ static inline int save_xstate_epilog(void __user *buf, int ia32_frame) + + /* Setup the bytes not touched by the [f]xsave and reserved for SW. */ + sw_bytes = ia32_frame ? &fx_sw_reserved_ia32 : &fx_sw_reserved; +- err = __copy_to_user(&x->i387.sw_reserved, sw_bytes, sizeof(*sw_bytes)); ++ err = __copy_to_user(x->i387.sw_reserved, sw_bytes, sizeof(*sw_bytes)); + + if (!use_xsave()) + return err; + +- err |= __put_user(FP_XSTATE_MAGIC2, (__u32 *)(buf + xstate_size)); ++ err |= __put_user(FP_XSTATE_MAGIC2, (__u32 __user *)(buf + xstate_size)); + + /* + * Read the xstate_bv which we copied (directly from the cpu or + * from the state in task struct) to the user buffers. + */ +- err |= __get_user(xstate_bv, (__u32 *)&x->xsave_hdr.xstate_bv); ++ err |= __get_user(xstate_bv, (__u32 __user *)&x->xsave_hdr.xstate_bv); + + /* + * For legacy compatible, we always set FP/SSE bits in the bit +@@ -190,7 +190,7 @@ static inline int save_xstate_epilog(void __user *buf, int ia32_frame) + */ + xstate_bv |= XSTATE_FPSSE; + +- err |= __put_user(xstate_bv, (__u32 *)&x->xsave_hdr.xstate_bv); ++ err |= __put_user(xstate_bv, (__u32 __user *)&x->xsave_hdr.xstate_bv); + + return err; + } @@ -199,6 +199,7 @@ static inline int save_user_xstate(struct xsave_struct __user *buf) { int err; @@ -27404,10 +28021,10 @@ index 422fd82..c3687ca 100644 if ((unsigned long)buf % 64 || fx_only) { u64 init_bv = pcntxt_mask & ~XSTATE_FPSSE; diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c -index b110fe6..d9c19f2 100644 +index c697625..a032162 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c -@@ -124,15 +124,20 @@ int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu, +@@ -156,15 +156,20 @@ int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, struct kvm_cpuid_entry2 __user *entries) { @@ -27431,7 +28048,7 @@ index b110fe6..d9c19f2 100644 vcpu->arch.cpuid_nent = cpuid->nent; kvm_apic_set_version(vcpu); kvm_x86_ops->cpuid_update(vcpu); -@@ -147,15 +152,19 @@ int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu, +@@ -179,15 +184,19 @@ int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, struct kvm_cpuid_entry2 __user *entries) { @@ -27455,7 +28072,7 @@ index b110fe6..d9c19f2 100644 out: diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c -index 1673940..4bce95e 100644 +index d86ff15..e77b023 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -55,7 +55,7 @@ @@ -27481,10 +28098,10 @@ index ad75d77..a679d32 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 c0bc803..6837a50 100644 +index 532add1..59eb241 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c -@@ -3501,7 +3501,11 @@ static void reload_tss(struct kvm_vcpu *vcpu) +@@ -3495,7 +3495,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); @@ -27496,7 +28113,7 @@ index c0bc803..6837a50 100644 load_TR_desc(); } -@@ -3902,6 +3906,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) +@@ -3898,6 +3902,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) #endif #endif @@ -27508,7 +28125,7 @@ index c0bc803..6837a50 100644 local_irq_disable(); diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c -index 6128914..8be1dd2 100644 +index dcc4de3..6bf73f4 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -1316,12 +1316,12 @@ static void vmcs_write64(unsigned long field, u64 value) @@ -27549,7 +28166,7 @@ index 6128914..8be1dd2 100644 rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp); vmcs_writel(HOST_IA32_SYSENTER_ESP, sysenter_esp); /* 22.2.3 */ vmx->loaded_vmcs->cpu = cpu; -@@ -2037,7 +2045,7 @@ static void setup_msrs(struct vcpu_vmx *vmx) +@@ -2033,7 +2041,7 @@ static void setup_msrs(struct vcpu_vmx *vmx) * reads and returns guest's timestamp counter "register" * guest_tsc = host_tsc + tsc_offset -- 21.3 */ @@ -27558,7 +28175,7 @@ index 6128914..8be1dd2 100644 { u64 host_tsc, tsc_offset; -@@ -2982,8 +2990,11 @@ static __init int hardware_setup(void) +@@ -2987,8 +2995,11 @@ static __init int hardware_setup(void) if (!cpu_has_vmx_flexpriority()) flexpriority_enabled = 0; @@ -27572,7 +28189,7 @@ index 6128914..8be1dd2 100644 if (enable_ept && !cpu_has_vmx_ept_2m_page()) kvm_disable_largepages(); -@@ -2994,13 +3005,15 @@ static __init int hardware_setup(void) +@@ -2999,13 +3010,15 @@ static __init int hardware_setup(void) if (!cpu_has_vmx_apicv()) enable_apicv = 0; @@ -27592,7 +28209,7 @@ index 6128914..8be1dd2 100644 if (nested) nested_vmx_setup_ctls_msrs(); -@@ -4127,7 +4140,10 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx) +@@ -4134,7 +4147,10 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx) vmcs_writel(HOST_CR0, read_cr0() & ~X86_CR0_TS); /* 22.2.3 */ vmcs_writel(HOST_CR4, read_cr4()); /* 22.2.3, 22.2.5 */ @@ -27603,7 +28220,7 @@ index 6128914..8be1dd2 100644 vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */ #ifdef CONFIG_X86_64 -@@ -4149,7 +4165,7 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx) +@@ -4156,7 +4172,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; @@ -27612,7 +28229,7 @@ index 6128914..8be1dd2 100644 rdmsr(MSR_IA32_SYSENTER_CS, low32, high32); vmcs_write32(HOST_IA32_SYSENTER_CS, low32); -@@ -7191,6 +7207,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) +@@ -7219,6 +7235,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) "jmp 2f \n\t" "1: " __ex(ASM_VMX_VMRESUME) "\n\t" "2: " @@ -27625,7 +28242,7 @@ index 6128914..8be1dd2 100644 /* Save guest registers, load host registers, keep flags */ "mov %0, %c[wordsize](%%" _ASM_SP ") \n\t" "pop %0 \n\t" -@@ -7243,6 +7265,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) +@@ -7271,6 +7293,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)) @@ -27637,7 +28254,7 @@ index 6128914..8be1dd2 100644 : "cc", "memory" #ifdef CONFIG_X86_64 , "rax", "rbx", "rdi", "rsi" -@@ -7256,7 +7283,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) +@@ -7284,7 +7311,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) if (debugctlmsr) update_debugctlmsr(debugctlmsr); @@ -27646,7 +28263,7 @@ index 6128914..8be1dd2 100644 /* * The sysexit path does not restore ds/es, so we must set them to * a reasonable value ourselves. -@@ -7265,8 +7292,18 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) +@@ -7293,8 +7320,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. */ @@ -27668,10 +28285,10 @@ index 6128914..8be1dd2 100644 vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index eb9b9c9..0f30b12 100644 +index 4e33b85..fa94855 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c -@@ -1779,8 +1779,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data) +@@ -1791,8 +1791,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data) { struct kvm *kvm = vcpu->kvm; int lm = is_long_mode(vcpu); @@ -27682,7 +28299,7 @@ index eb9b9c9..0f30b12 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; -@@ -2663,6 +2663,8 @@ long kvm_arch_dev_ioctl(struct file *filp, +@@ -2676,6 +2676,8 @@ long kvm_arch_dev_ioctl(struct file *filp, if (n < msr_list.nmsrs) goto out; r = -EFAULT; @@ -27691,7 +28308,7 @@ index eb9b9c9..0f30b12 100644 if (copy_to_user(user_msr_list->indices, &msrs_to_save, num_msrs_to_save * sizeof(u32))) goto out; -@@ -5461,7 +5463,7 @@ static struct notifier_block pvclock_gtod_notifier = { +@@ -5485,7 +5487,7 @@ static struct notifier_block pvclock_gtod_notifier = { }; #endif @@ -29854,7 +30471,7 @@ index a63efd6..8149fbe 100644 ret CFI_ENDPROC diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c -index 3eb18ac..4b22130 100644 +index e2f5e21..4b22130 100644 --- a/arch/x86/lib/usercopy_32.c +++ b/arch/x86/lib/usercopy_32.c @@ -42,11 +42,13 @@ do { \ @@ -30351,7 +30968,7 @@ index 3eb18ac..4b22130 100644 clac(); return n; } -@@ -632,60 +743,38 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr +@@ -632,58 +743,38 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr if (n > 64 && cpu_has_xmm2) n = __copy_user_intel_nocache(to, from, n); else @@ -30379,8 +30996,7 @@ index 3eb18ac..4b22130 100644 - * Returns number of bytes that could not be copied. - * On success, this will be zero. - */ --unsigned long --copy_to_user(void __user *to, const void *from, unsigned long n) +-unsigned long _copy_to_user(void __user *to, const void *from, unsigned n) +#ifdef CONFIG_PAX_MEMORY_UDEREF +void __set_fs(mm_segment_t x) { @@ -30401,7 +31017,7 @@ index 3eb18ac..4b22130 100644 + BUG(); + } } --EXPORT_SYMBOL(copy_to_user); +-EXPORT_SYMBOL(_copy_to_user); +EXPORT_SYMBOL(__set_fs); -/** @@ -30420,8 +31036,7 @@ index 3eb18ac..4b22130 100644 - * If some data could not be copied, this function will pad the copied - * data to the requested size using zero bytes. - */ --unsigned long --_copy_from_user(void *to, const void __user *from, unsigned long n) +-unsigned long _copy_from_user(void *to, const void __user *from, unsigned n) +void set_fs(mm_segment_t x) { - if (access_ok(VERIFY_READ, from, n)) @@ -30499,10 +31114,10 @@ index c905e89..01ab928 100644 return len; } diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile -index 23d8e5f..9ccc13a 100644 +index 6a19ad9..1c48f9a 100644 --- a/arch/x86/mm/Makefile +++ b/arch/x86/mm/Makefile -@@ -28,3 +28,7 @@ obj-$(CONFIG_ACPI_NUMA) += srat.o +@@ -30,3 +30,7 @@ obj-$(CONFIG_ACPI_NUMA) += srat.o obj-$(CONFIG_NUMA_EMU) += numa_emulation.o obj-$(CONFIG_MEMTEST) += memtest.o @@ -30565,7 +31180,7 @@ index 903ec1e..c4166b2 100644 } diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c -index 3aaeffc..42ea9fb 100644 +index 6dea040..31e52ff 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -14,11 +14,18 @@ @@ -30585,9 +31200,9 @@ index 3aaeffc..42ea9fb 100644 +#include +#endif - /* - * Page fault error code bits: -@@ -56,7 +63,7 @@ static inline int __kprobes notify_page_fault(struct pt_regs *regs) + #define CREATE_TRACE_POINTS + #include +@@ -59,7 +66,7 @@ static inline int __kprobes kprobes_fault(struct pt_regs *regs) int ret = 0; /* kprobe_running() needs smp_processor_id() */ @@ -30596,7 +31211,7 @@ index 3aaeffc..42ea9fb 100644 preempt_disable(); if (kprobe_running() && kprobe_fault_handler(regs, 14)) ret = 1; -@@ -117,7 +124,10 @@ check_prefetch_opcode(struct pt_regs *regs, unsigned char *instr, +@@ -120,7 +127,10 @@ check_prefetch_opcode(struct pt_regs *regs, unsigned char *instr, return !instr_lo || (instr_lo>>1) == 1; case 0x00: /* Prefetch instruction is 0x0F0D or 0x0F18 */ @@ -30608,7 +31223,7 @@ index 3aaeffc..42ea9fb 100644 return 0; *prefetch = (instr_lo == 0xF) && -@@ -151,7 +161,10 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr) +@@ -154,7 +164,10 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr) while (instr < max_instr) { unsigned char opcode; @@ -30620,7 +31235,7 @@ index 3aaeffc..42ea9fb 100644 break; instr++; -@@ -182,6 +195,34 @@ force_sig_info_fault(int si_signo, int si_code, unsigned long address, +@@ -185,6 +198,34 @@ force_sig_info_fault(int si_signo, int si_code, unsigned long address, force_sig_info(si_signo, &info, tsk); } @@ -30655,7 +31270,7 @@ index 3aaeffc..42ea9fb 100644 DEFINE_SPINLOCK(pgd_lock); LIST_HEAD(pgd_list); -@@ -232,10 +273,27 @@ void vmalloc_sync_all(void) +@@ -235,10 +276,27 @@ void vmalloc_sync_all(void) for (address = VMALLOC_START & PMD_MASK; address >= TASK_SIZE && address < FIXADDR_TOP; address += PMD_SIZE) { @@ -30683,7 +31298,7 @@ index 3aaeffc..42ea9fb 100644 spinlock_t *pgt_lock; pmd_t *ret; -@@ -243,8 +301,14 @@ void vmalloc_sync_all(void) +@@ -246,8 +304,14 @@ void vmalloc_sync_all(void) pgt_lock = &pgd_page_get_mm(page)->page_table_lock; spin_lock(pgt_lock); @@ -30699,7 +31314,7 @@ index 3aaeffc..42ea9fb 100644 if (!ret) break; -@@ -278,6 +342,12 @@ static noinline __kprobes int vmalloc_fault(unsigned long address) +@@ -281,6 +345,12 @@ static noinline __kprobes int vmalloc_fault(unsigned long address) * an interrupt in the middle of a task switch.. */ pgd_paddr = read_cr3(); @@ -30712,7 +31327,7 @@ index 3aaeffc..42ea9fb 100644 pmd_k = vmalloc_sync_one(__va(pgd_paddr), address); if (!pmd_k) return -1; -@@ -373,11 +443,25 @@ static noinline __kprobes int vmalloc_fault(unsigned long address) +@@ -376,11 +446,25 @@ static noinline __kprobes int vmalloc_fault(unsigned long address) * happen within a race in page table update. In the later * case just flush: */ @@ -30739,7 +31354,7 @@ index 3aaeffc..42ea9fb 100644 if (pgd_none(*pgd)) { set_pgd(pgd, *pgd_ref); arch_flush_lazy_mmu_mode(); -@@ -543,7 +627,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address) +@@ -546,7 +630,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address) static int is_errata100(struct pt_regs *regs, unsigned long address) { #ifdef CONFIG_X86_64 @@ -30748,7 +31363,7 @@ index 3aaeffc..42ea9fb 100644 return 1; #endif return 0; -@@ -570,7 +654,7 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) +@@ -573,7 +657,7 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) } static const char nx_warning[] = KERN_CRIT @@ -30757,7 +31372,7 @@ index 3aaeffc..42ea9fb 100644 static void show_fault_oops(struct pt_regs *regs, unsigned long error_code, -@@ -579,15 +663,27 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, +@@ -582,15 +666,27 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, if (!oops_may_print()) return; @@ -30787,7 +31402,7 @@ index 3aaeffc..42ea9fb 100644 printk(KERN_ALERT "BUG: unable to handle kernel "); if (address < PAGE_SIZE) printk(KERN_CONT "NULL pointer dereference"); -@@ -750,6 +846,22 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, +@@ -771,6 +867,22 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, return; } #endif @@ -30810,7 +31425,7 @@ index 3aaeffc..42ea9fb 100644 /* Kernel addresses are always protection faults: */ if (address >= TASK_SIZE) error_code |= PF_PROT; -@@ -835,7 +947,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, +@@ -856,7 +968,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) { printk(KERN_ERR "MCE: Killing %s:%d due to hardware memory corruption fault at %lx\n", @@ -30819,7 +31434,7 @@ index 3aaeffc..42ea9fb 100644 code = BUS_MCEERR_AR; } #endif -@@ -889,6 +1001,99 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte) +@@ -910,6 +1022,99 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte) return 1; } @@ -30919,7 +31534,7 @@ index 3aaeffc..42ea9fb 100644 /* * Handle a spurious fault caused by a stale TLB entry. * -@@ -955,6 +1160,9 @@ int show_unhandled_signals = 1; +@@ -976,6 +1181,9 @@ int show_unhandled_signals = 1; static inline int access_error(unsigned long error_code, struct vm_area_struct *vma) { @@ -30929,7 +31544,7 @@ index 3aaeffc..42ea9fb 100644 if (error_code & PF_WRITE) { /* write, present and write, not present: */ if (unlikely(!(vma->vm_flags & VM_WRITE))) -@@ -983,7 +1191,7 @@ static inline bool smap_violation(int error_code, struct pt_regs *regs) +@@ -1010,7 +1218,7 @@ static inline bool smap_violation(int error_code, struct pt_regs *regs) if (error_code & PF_USER) return false; @@ -30938,7 +31553,7 @@ index 3aaeffc..42ea9fb 100644 return false; return true; -@@ -1010,6 +1218,22 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code) +@@ -1037,6 +1245,22 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code) /* Get the faulting address: */ address = read_cr2(); @@ -30961,7 +31576,7 @@ index 3aaeffc..42ea9fb 100644 /* * Detect and handle instructions that would cause a page fault for * both a tracked kernel page and a userspace page. -@@ -1069,7 +1293,7 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code) +@@ -1114,7 +1338,7 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code) * User-mode registers count as a user access even for any * potential system fault or CPU buglet: */ @@ -30970,7 +31585,7 @@ index 3aaeffc..42ea9fb 100644 local_irq_enable(); error_code |= PF_USER; flags |= FAULT_FLAG_USER; -@@ -1135,6 +1359,11 @@ retry: +@@ -1161,6 +1385,11 @@ retry: might_sleep(); } @@ -30982,7 +31597,7 @@ index 3aaeffc..42ea9fb 100644 vma = find_vma(mm, address); if (unlikely(!vma)) { bad_area(regs, error_code, address); -@@ -1146,18 +1375,24 @@ retry: +@@ -1172,18 +1401,24 @@ retry: bad_area(regs, error_code, address); return; } @@ -31018,7 +31633,7 @@ index 3aaeffc..42ea9fb 100644 if (unlikely(expand_stack(vma, address))) { bad_area(regs, error_code, address); return; -@@ -1231,3 +1466,292 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code) +@@ -1277,3 +1512,292 @@ trace_do_page_fault(struct pt_regs *regs, unsigned long error_code) __do_page_fault(regs, error_code); exception_exit(prev_state); } @@ -31312,7 +31927,7 @@ index 3aaeffc..42ea9fb 100644 + return ret ? -EFAULT : 0; +} diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c -index 0596e8e..9de0b1c 100644 +index 0596e8e..5626789 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c @@ -268,7 +268,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, @@ -31320,7 +31935,7 @@ index 0596e8e..9de0b1c 100644 len = (unsigned long) nr_pages << PAGE_SHIFT; end = start + len; - if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, -+ if (unlikely(!__access_ok(write ? VERIFY_WRITE : VERIFY_READ, ++ if (unlikely(!access_ok_noprefault(write ? VERIFY_WRITE : VERIFY_READ, (void __user *)start, len))) return 0; @@ -31328,7 +31943,7 @@ index 0596e8e..9de0b1c 100644 goto slow_irqon; #endif -+ if (unlikely(!__access_ok(write ? VERIFY_WRITE : VERIFY_READ, ++ if (unlikely(!access_ok_noprefault(write ? VERIFY_WRITE : VERIFY_READ, + (void __user *)start, len))) + return 0; + @@ -31460,7 +32075,7 @@ index 9d980d8..6bbfacb 100644 #endif /*HAVE_ARCH_HUGETLB_UNMAPPED_AREA*/ diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c -index 04664cd..dae6e5d 100644 +index f971306..e83e0f6 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -4,6 +4,7 @@ @@ -31480,7 +32095,7 @@ index 04664cd..dae6e5d 100644 #include "mm_internal.h" -@@ -465,7 +468,18 @@ void __init init_mem_mapping(void) +@@ -563,7 +566,18 @@ void __init init_mem_mapping(void) early_ioremap_page_table_range_init(); #endif @@ -31499,7 +32114,7 @@ index 04664cd..dae6e5d 100644 __flush_tlb_all(); early_memtest(0, max_pfn_mapped << PAGE_SHIFT); -@@ -481,10 +495,40 @@ void __init init_mem_mapping(void) +@@ -579,10 +593,40 @@ void __init init_mem_mapping(void) * Access has to be given to non-kernel-ram areas as well, these contain the PCI * mmio resources as well as potential bios/acpi data regions. */ @@ -31541,7 +32156,7 @@ index 04664cd..dae6e5d 100644 if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) return 0; if (!page_is_ram(pagenr)) -@@ -530,8 +574,117 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end) +@@ -628,8 +672,117 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end) #endif } @@ -32277,7 +32892,7 @@ index 0057a7a..95c7edd 100644 might_sleep(); if (is_enabled()) /* recheck and proper locking in *_core() */ diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c -index 8bf93ba..dbcd670 100644 +index 24aec58..c39fe8b 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -474,7 +474,7 @@ static bool __init numa_meminfo_cover_memory(const struct numa_meminfo *mi) @@ -32504,10 +33119,10 @@ 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 dfa537a..fd45c64 100644 +index c96314a..433b127 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c -@@ -91,10 +91,67 @@ static inline void pgd_list_del(pgd_t *pgd) +@@ -97,10 +97,71 @@ static inline void pgd_list_del(pgd_t *pgd) list_del(&page->lru); } @@ -32556,6 +33171,8 @@ index dfa537a..fd45c64 100644 +#define pxd_t pud_t +#define pyd_t pgd_t +#define paravirt_release_pxd(pfn) paravirt_release_pud(pfn) ++#define pgtable_pxd_page_ctor(page) true ++#define pgtable_pxd_page_dtor(page) +#define pxd_free(mm, pud) pud_free((mm), (pud)) +#define pyd_populate(mm, pgd, pud) pgd_populate((mm), (pgd), (pud)) +#define pyd_offset(mm, address) pgd_offset((mm), (address)) @@ -32564,6 +33181,8 @@ index dfa537a..fd45c64 100644 +#define pxd_t pmd_t +#define pyd_t pud_t +#define paravirt_release_pxd(pfn) paravirt_release_pmd(pfn) ++#define pgtable_pxd_page_ctor(page) pgtable_pmd_page_ctor(page) ++#define pgtable_pxd_page_dtor(page) pgtable_pmd_page_dtor(page) +#define pxd_free(mm, pud) pmd_free((mm), (pud)) +#define pyd_populate(mm, pgd, pud) pud_populate((mm), (pgd), (pud)) +#define pyd_offset(mm, address) pud_offset((mm), (address)) @@ -32577,7 +33196,7 @@ index dfa537a..fd45c64 100644 static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm) { BUILD_BUG_ON(sizeof(virt_to_page(pgd)->index) < sizeof(mm)); -@@ -135,6 +192,7 @@ static void pgd_dtor(pgd_t *pgd) +@@ -141,6 +202,7 @@ static void pgd_dtor(pgd_t *pgd) pgd_list_del(pgd); spin_unlock(&pgd_lock); } @@ -32585,7 +33204,7 @@ index dfa537a..fd45c64 100644 /* * List of all pgd's needed for non-PAE so it can invalidate entries -@@ -147,7 +205,7 @@ static void pgd_dtor(pgd_t *pgd) +@@ -153,7 +215,7 @@ static void pgd_dtor(pgd_t *pgd) * -- nyc */ @@ -32594,7 +33213,7 @@ index dfa537a..fd45c64 100644 /* * In PAE mode, we need to do a cr3 reload (=tlb flush) when * updating the top-level pagetable entries to guarantee the -@@ -159,7 +217,7 @@ static void pgd_dtor(pgd_t *pgd) +@@ -165,7 +227,7 @@ static void pgd_dtor(pgd_t *pgd) * not shared between pagetables (!SHARED_KERNEL_PMDS), we allocate * and initialize the kernel pmds here. */ @@ -32603,7 +33222,7 @@ index dfa537a..fd45c64 100644 void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) { -@@ -177,36 +235,38 @@ void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) +@@ -183,43 +245,45 @@ void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) */ flush_tlb_mm(mm); } @@ -32623,11 +33242,14 @@ index dfa537a..fd45c64 100644 int i; - for(i = 0; i < PREALLOCATED_PMDS; i++) -- if (pmds[i]) +- if (pmds[i]) { +- pgtable_pmd_page_dtor(virt_to_page(pmds[i])); - free_page((unsigned long)pmds[i]); + for(i = 0; i < PREALLOCATED_PXDS; i++) -+ if (pxds[i]) ++ if (pxds[i]) { ++ pgtable_pxd_page_dtor(virt_to_page(pxds[i])); + free_page((unsigned long)pxds[i]); + } } -static int preallocate_pmds(pmd_t *pmds[]) @@ -32638,11 +33260,19 @@ index dfa537a..fd45c64 100644 - for(i = 0; i < PREALLOCATED_PMDS; i++) { - pmd_t *pmd = (pmd_t *)__get_free_page(PGALLOC_GFP); -- if (pmd == NULL) +- if (!pmd) + for(i = 0; i < PREALLOCATED_PXDS; i++) { + pxd_t *pxd = (pxd_t *)__get_free_page(PGALLOC_GFP); -+ if (pxd == NULL) ++ if (!pxd) failed = true; +- if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) { +- free_page((unsigned long)pmd); +- pmd = NULL; ++ if (pxd && !pgtable_pxd_page_ctor(virt_to_page(pxd))) { ++ free_page((unsigned long)pxd); ++ pxd = NULL; + failed = true; + } - pmds[i] = pmd; + pxds[i] = pxd; } @@ -32653,7 +33283,7 @@ index dfa537a..fd45c64 100644 return -ENOMEM; } -@@ -219,49 +279,52 @@ static int preallocate_pmds(pmd_t *pmds[]) +@@ -232,49 +296,52 @@ static int preallocate_pmds(pmd_t *pmds[]) * preallocate which never got a corresponding vma will need to be * freed manually. */ @@ -32723,7 +33353,7 @@ index dfa537a..fd45c64 100644 pgd = (pgd_t *)__get_free_page(PGALLOC_GFP); -@@ -270,11 +333,11 @@ pgd_t *pgd_alloc(struct mm_struct *mm) +@@ -283,11 +350,11 @@ pgd_t *pgd_alloc(struct mm_struct *mm) mm->pgd = pgd; @@ -32737,7 +33367,7 @@ index dfa537a..fd45c64 100644 /* * Make sure that pre-populating the pmds is atomic with -@@ -284,14 +347,14 @@ pgd_t *pgd_alloc(struct mm_struct *mm) +@@ -297,14 +364,14 @@ pgd_t *pgd_alloc(struct mm_struct *mm) spin_lock(&pgd_lock); pgd_ctor(mm, pgd); @@ -32755,7 +33385,7 @@ index dfa537a..fd45c64 100644 out_free_pgd: free_page((unsigned long)pgd); out: -@@ -300,7 +363,7 @@ out: +@@ -313,7 +380,7 @@ out: void pgd_free(struct mm_struct *mm, pgd_t *pgd) { @@ -32897,7 +33527,7 @@ index 0000000..dace51c +EXPORT_SYMBOL(__pax_close_userland); +#endif diff --git a/arch/x86/net/bpf_jit.S b/arch/x86/net/bpf_jit.S -index 877b9a1..a8ecf42 100644 +index 877b9a1..f746de8 100644 --- a/arch/x86/net/bpf_jit.S +++ b/arch/x86/net/bpf_jit.S @@ -9,6 +9,7 @@ @@ -32971,6 +33601,15 @@ index 877b9a1..a8ecf42 100644 ret #define sk_negative_common(SIZE) \ +@@ -140,7 +149,7 @@ bpf_slow_path_byte_msh: + push %r9; \ + push SKBDATA; \ + /* rsi already has offset */ \ +- mov $SIZE,%ecx; /* size */ \ ++ mov $SIZE,%edx; /* size */ \ + call bpf_internal_load_pointer_neg_helper; \ + test %rax,%rax; \ + pop SKBDATA; \ @@ -157,6 +166,7 @@ sk_load_word_negative_offset: sk_negative_common(4) mov (%rax), %eax @@ -33010,7 +33649,7 @@ index 877b9a1..a8ecf42 100644 + pax_force_retaddr ret diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c -index 26328e8..8dfe0d5 100644 +index 4ed75dd..3cf24f0b 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c @@ -50,13 +50,90 @@ static inline u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len) @@ -33209,14 +33848,9 @@ index 26328e8..8dfe0d5 100644 if (!bpf_jit_enable) return; -@@ -202,11 +297,15 @@ void bpf_jit_compile(struct sk_filter *fp) - if (addrs == NULL) +@@ -203,10 +298,10 @@ void bpf_jit_compile(struct sk_filter *fp) return; -+#ifdef CONFIG_GRKERNSEC_JIT_HARDEN -+ randkey = get_random_int(); -+#endif -+ /* Before first pass, make a rough estimation of addrs[] - * each bpf instruction is translated to less than 64 bytes + * each bpf instruction is translated to less than MAX_INSTR_CODE_SIZE bytes @@ -33227,6 +33861,17 @@ index 26328e8..8dfe0d5 100644 addrs[i] = proglen; } cleanup_addr = proglen; /* epilogue address */ +@@ -285,6 +380,10 @@ void bpf_jit_compile(struct sk_filter *fp) + for (i = 0; i < flen; i++) { + unsigned int K = filter[i].k; + ++#ifdef CONFIG_GRKERNSEC_JIT_HARDEN ++ randkey = prandom_u32(); ++#endif ++ + switch (filter[i].code) { + case BPF_S_ALU_ADD_X: /* A += X; */ + seen |= SEEN_XREG; @@ -317,10 +416,8 @@ void bpf_jit_compile(struct sk_filter *fp) case BPF_S_ALU_MUL_K: /* A *= K */ if (is_imm8(K)) @@ -33240,14 +33885,9 @@ index 26328e8..8dfe0d5 100644 break; case BPF_S_ALU_DIV_X: /* A /= X; */ seen |= SEEN_XREG; -@@ -359,15 +456,29 @@ void bpf_jit_compile(struct sk_filter *fp) - EMIT2(0x89, 0xd0); /* mov %edx,%eax */ - break; - case BPF_S_ALU_MOD_K: /* A %= K; */ -+ if (K == 1) { -+ CLEAR_A(); -+ break; -+ } +@@ -364,7 +461,11 @@ void bpf_jit_compile(struct sk_filter *fp) + break; + } EMIT2(0x31, 0xd2); /* xor %edx,%edx */ +#ifdef CONFIG_GRKERNSEC_JIT_HARDEN + DILUTE_CONST_SEQUENCE(K, randkey); @@ -33257,24 +33897,19 @@ index 26328e8..8dfe0d5 100644 EMIT2(0xf7, 0xf1); /* div %ecx */ EMIT2(0x89, 0xd0); /* mov %edx,%eax */ break; -- case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K); */ -- EMIT3(0x48, 0x69, 0xc0); /* imul imm32,%rax,%rax */ -- EMIT(K, 4); -- EMIT4(0x48, 0xc1, 0xe8, 0x20); /* shr $0x20,%rax */ -+ case BPF_S_ALU_DIV_K: /* A /= K */ -+ if (K == 1) -+ break; -+ EMIT2(0x31, 0xd2); /* xor %edx,%edx */ +@@ -372,7 +473,11 @@ void bpf_jit_compile(struct sk_filter *fp) + if (K == 1) + break; + EMIT2(0x31, 0xd2); /* xor %edx,%edx */ +#ifdef CONFIG_GRKERNSEC_JIT_HARDEN + DILUTE_CONST_SEQUENCE(K, randkey); +#else -+ EMIT1(0xb9);EMIT(K, 4); /* mov imm32,%ecx */ + EMIT1(0xb9);EMIT(K, 4); /* mov imm32,%ecx */ +#endif -+ EMIT2(0xf7, 0xf1); /* div %ecx */ + EMIT2(0xf7, 0xf1); /* div %ecx */ break; case BPF_S_ALU_AND_X: - seen |= SEEN_XREG; -@@ -637,8 +748,7 @@ common_load_ind: seen |= SEEN_DATAREF | SEEN_XREG; +@@ -643,8 +748,7 @@ common_load_ind: seen |= SEEN_DATAREF | SEEN_XREG; if (is_imm8(K)) { EMIT3(0x8d, 0x73, K); /* lea imm8(%rbx), %esi */ } else { @@ -33284,7 +33919,7 @@ index 26328e8..8dfe0d5 100644 } } else { EMIT2(0x89,0xde); /* mov %ebx,%esi */ -@@ -728,10 +838,12 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; +@@ -734,10 +838,12 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; if (unlikely(proglen + ilen > oldproglen)) { pr_err("bpb_jit_compile fatal error\n"); kfree(addrs); @@ -33298,7 +33933,7 @@ index 26328e8..8dfe0d5 100644 } proglen += ilen; addrs[i] = proglen; -@@ -764,7 +876,6 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; +@@ -770,7 +876,6 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; if (image) { bpf_flush_icache(header, image + proglen); @@ -33306,7 +33941,7 @@ index 26328e8..8dfe0d5 100644 fp->bpf_func = (void *)image; } out: -@@ -776,10 +887,9 @@ static void bpf_jit_free_deferred(struct work_struct *work) +@@ -782,10 +887,9 @@ static void bpf_jit_free_deferred(struct work_struct *work) { struct sk_filter *fp = container_of(work, struct sk_filter, work); unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK; @@ -33320,7 +33955,7 @@ index 26328e8..8dfe0d5 100644 } diff --git a/arch/x86/oprofile/backtrace.c b/arch/x86/oprofile/backtrace.c -index d6aa6e8..266395a 100644 +index 5d04be5..2beeaa2 100644 --- a/arch/x86/oprofile/backtrace.c +++ b/arch/x86/oprofile/backtrace.c @@ -46,11 +46,11 @@ dump_user_backtrace_32(struct stack_frame_ia32 *head) @@ -33329,7 +33964,7 @@ index d6aa6e8..266395a 100644 - bytes = copy_from_user_nmi(bufhead, head, sizeof(bufhead)); + bytes = copy_from_user_nmi(bufhead, (const char __force_user *)head, sizeof(bufhead)); - if (bytes != sizeof(bufhead)) + if (bytes != 0) return NULL; - fp = (struct stack_frame_ia32 *) compat_ptr(bufhead[0].next_frame); @@ -33343,7 +33978,7 @@ index d6aa6e8..266395a 100644 - bytes = copy_from_user_nmi(bufhead, head, sizeof(bufhead)); + bytes = copy_from_user_nmi(bufhead, (const char __force_user *)head, sizeof(bufhead)); - if (bytes != sizeof(bufhead)) + if (bytes != 0) return NULL; @@ -111,7 +111,7 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth) @@ -33438,6 +34073,19 @@ index 71e8a67..6a313bb 100644 struct op_counter_config; +diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c +index 51384ca..a25f51e 100644 +--- a/arch/x86/pci/intel_mid_pci.c ++++ b/arch/x86/pci/intel_mid_pci.c +@@ -241,7 +241,7 @@ int __init intel_mid_pci_init(void) + pr_info("Intel MID platform detected, using MID PCI ops\n"); + pci_mmcfg_late_init(); + pcibios_enable_irq = intel_mid_pci_irq_enable; +- pci_root_ops = intel_mid_pci_ops; ++ memcpy((void *)&pci_root_ops, &intel_mid_pci_ops, sizeof pci_root_ops); + pci_soc_mode = 1; + /* Continue with standard init */ + return 1; diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c index 372e9b8..e775a6c 100644 --- a/arch/x86/pci/irq.c @@ -33478,21 +34126,6 @@ index 372e9b8..e775a6c 100644 { .callback = fix_broken_hp_bios_irq9, .ident = "HP Pavilion N5400 Series Laptop", -diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c -index 903fded..94b0d88 100644 ---- a/arch/x86/pci/mrst.c -+++ b/arch/x86/pci/mrst.c -@@ -241,7 +241,9 @@ int __init pci_mrst_init(void) - pr_info("Intel MID platform detected, using MID PCI ops\n"); - pci_mmcfg_late_init(); - pcibios_enable_irq = mrst_pci_irq_enable; -- pci_root_ops = pci_mrst_ops; -+ pax_open_kernel(); -+ memcpy((void *)&pci_root_ops, &pci_mrst_ops, sizeof(pci_mrst_ops)); -+ pax_close_kernel(); - pci_soc_mode = 1; - /* Continue with standard init */ - return 1; diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c index c77b24a..c979855 100644 --- a/arch/x86/pci/pcbios.c @@ -34071,28 +34704,22 @@ index 4c07cca..2c8427d 100644 + pax_force_retaddr 0, 1 ret ENDPROC(efi_call6) -diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c -index 3ca5957..7909c18 100644 ---- a/arch/x86/platform/mrst/mrst.c -+++ b/arch/x86/platform/mrst/mrst.c -@@ -78,13 +78,15 @@ struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX]; - EXPORT_SYMBOL_GPL(sfi_mrtc_array); - int sfi_mrtc_num; - --static void mrst_power_off(void) -+static __noreturn void mrst_power_off(void) +diff --git a/arch/x86/platform/intel-mid/intel-mid.c b/arch/x86/platform/intel-mid/intel-mid.c +index f90e290..435f0dd 100644 +--- a/arch/x86/platform/intel-mid/intel-mid.c ++++ b/arch/x86/platform/intel-mid/intel-mid.c +@@ -65,9 +65,10 @@ static void intel_mid_power_off(void) { -+ BUG(); } --static void mrst_reboot(void) -+static __noreturn void mrst_reboot(void) +-static void intel_mid_reboot(void) ++static void __noreturn intel_mid_reboot(void) { intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0); + BUG(); } - /* parse all the mtimer info to a static mtimer array */ + static unsigned long __init intel_mid_calibrate_tsc(void) diff --git a/arch/x86/platform/olpc/olpc_dt.c b/arch/x86/platform/olpc/olpc_dt.c index d6ee929..3637cb5 100644 --- a/arch/x86/platform/olpc/olpc_dt.c @@ -34669,6 +35296,18 @@ index 431e875..cbb23f3 100644 - return 0; -} -__setup("vdso=", vdso_setup); +diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig +index 1a3c765..3d2e8d1 100644 +--- a/arch/x86/xen/Kconfig ++++ b/arch/x86/xen/Kconfig +@@ -9,6 +9,7 @@ config XEN + select XEN_HAVE_PVMMU + depends on X86_64 || (X86_32 && X86_PAE && !X86_VISWS) + depends on X86_TSC ++ depends on !GRKERNSEC_CONFIG_AUTO || GRKERNSEC_CONFIG_VIRT_XEN + help + 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 fa6ade7..73da73a5 100644 --- a/arch/x86/xen/enlighten.c @@ -34792,7 +35431,7 @@ index fa6ade7..73da73a5 100644 #ifdef CONFIG_ACPI_NUMA diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c -index fdc3ba2..23cae00 100644 +index 3c76c3d..7871755 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -379,7 +379,7 @@ static pteval_t pte_mfn_to_pfn(pteval_t val) @@ -34802,7 +35441,7 @@ index fdc3ba2..23cae00 100644 -static pteval_t pte_pfn_to_mfn(pteval_t val) +static pteval_t __intentional_overflow(-1) pte_pfn_to_mfn(pteval_t val) { - if (val & _PAGE_PRESENT) { + if (pteval_present(val)) { unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; @@ -1894,6 +1894,9 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn) /* L3_k[510] -> level2_kernel_pgt @@ -34844,7 +35483,7 @@ index fdc3ba2..23cae00 100644 .alloc_pud = xen_alloc_pmd_init, .release_pud = xen_release_pmd_init, diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c -index 31d0475..51af671 100644 +index c36b325..b0f1518 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c @@ -274,17 +274,13 @@ static void __init xen_smp_prepare_boot_cpu(void) @@ -35056,7 +35695,7 @@ index 4e491d9..c8e18e4 100644 spin_lock_init(&blkcg->lock); INIT_RADIX_TREE(&blkcg->blkg_tree, GFP_ATOMIC); diff --git a/block/blk-iopoll.c b/block/blk-iopoll.c -index 4b8d9b54..a7178c0 100644 +index 1855bf5..af12b06 100644 --- a/block/blk-iopoll.c +++ b/block/blk-iopoll.c @@ -77,7 +77,7 @@ void blk_iopoll_complete(struct blk_iopoll *iopoll) @@ -35066,7 +35705,7 @@ index 4b8d9b54..a7178c0 100644 -static void blk_iopoll_softirq(struct softirq_action *h) +static __latent_entropy void blk_iopoll_softirq(void) { - struct list_head *list = &__get_cpu_var(blk_cpu_iopoll); + 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 623e1cd..ca1e109 100644 @@ -35082,7 +35721,7 @@ index 623e1cd..ca1e109 100644 bio = bio_copy_kern(q, kbuf, len, gfp_mask, reading); else diff --git a/block/blk-softirq.c b/block/blk-softirq.c -index ec9e606..3f38839 100644 +index 57790c1..5e988dd 100644 --- a/block/blk-softirq.c +++ b/block/blk-softirq.c @@ -18,7 +18,7 @@ static DEFINE_PER_CPU(struct list_head, blk_cpu_done); @@ -35126,9 +35765,18 @@ index 420a5a9..23834aa 100644 if (blk_verify_command(rq->cmd, has_write_perm)) return -EPERM; diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c -index fbd5a67..5d631b5 100644 +index fbd5a67..f24fd95 100644 --- a/block/compat_ioctl.c +++ b/block/compat_ioctl.c +@@ -156,7 +156,7 @@ static int compat_cdrom_generic_command(struct block_device *bdev, fmode_t mode, + cgc = compat_alloc_user_space(sizeof(*cgc)); + cgc32 = compat_ptr(arg); + +- if (copy_in_user(&cgc->cmd, &cgc32->cmd, sizeof(cgc->cmd)) || ++ if (copy_in_user(cgc->cmd, cgc32->cmd, sizeof(cgc->cmd)) || + get_user(data, &cgc32->buffer) || + put_user(compat_ptr(data), &cgc->buffer) || + copy_in_user(&cgc->buflen, &cgc32->buflen, @@ -341,7 +341,7 @@ static int compat_fd_ioctl(struct block_device *bdev, fmode_t mode, err |= __get_user(f->spec1, &uf->spec1); err |= __get_user(f->fmt_gap, &uf->fmt_gap); @@ -35171,10 +35819,10 @@ index 791f419..89f21c4 100644 EXPORT_SYMBOL(blk_unregister_region); diff --git a/block/partitions/efi.c b/block/partitions/efi.c -index a8287b4..241a48e 100644 +index dc51f46..d5446a8 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c -@@ -292,14 +292,14 @@ static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state, +@@ -293,14 +293,14 @@ static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state, if (!gpt) return NULL; @@ -35196,7 +35844,7 @@ index a8287b4..241a48e 100644 (u8 *) pte, count) < count) { kfree(pte); diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c -index a5ffcc9..e057498 100644 +index 625e3e4..b5339f9 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -67,7 +67,7 @@ static int scsi_get_bus(struct request_queue *q, int __user *p) @@ -35230,7 +35878,7 @@ index a5ffcc9..e057498 100644 if (blk_verify_command(rq->cmd, mode & FMODE_WRITE)) return -EPERM; -@@ -434,6 +446,8 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode, +@@ -415,6 +427,8 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode, int err; unsigned int in_len, out_len, bytes, opcode, cmdlen; char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE]; @@ -35239,7 +35887,7 @@ index a5ffcc9..e057498 100644 if (!sic) return -EINVAL; -@@ -467,9 +481,18 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode, +@@ -448,9 +462,18 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode, */ err = -EFAULT; rq->cmd_len = cmdlen; @@ -35294,8 +35942,30 @@ index f8c920c..ab2cb5a 100644 if (!ret) kobject_uevent(&pinst->kobj, KOBJ_ADD); +diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c +index 15dddc1..b61cf0c 100644 +--- a/drivers/acpi/acpica/hwxfsleep.c ++++ b/drivers/acpi/acpica/hwxfsleep.c +@@ -63,11 +63,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id); + /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */ + + static struct acpi_sleep_functions acpi_sleep_dispatch[] = { +- {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep), +- acpi_hw_extended_sleep}, +- {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep), +- acpi_hw_extended_wake_prep}, +- {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake} ++ {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep), ++ .extended_function = acpi_hw_extended_sleep}, ++ {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep), ++ .extended_function = acpi_hw_extended_wake_prep}, ++ {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), ++ .extended_function = acpi_hw_extended_wake} + }; + + /* diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h -index f220d64..d359ad6 100644 +index 21ba34a..cb05966 100644 --- a/drivers/acpi/apei/apei-internal.h +++ b/drivers/acpi/apei/apei-internal.h @@ -20,7 +20,7 @@ typedef int (*apei_exec_ins_func_t)(struct apei_exec_context *ctx, @@ -35307,34 +35977,13 @@ index f220d64..d359ad6 100644 struct apei_exec_context { u32 ip; -diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c -index 33dc6a0..4b24b47 100644 ---- a/drivers/acpi/apei/cper.c -+++ b/drivers/acpi/apei/cper.c -@@ -39,12 +39,12 @@ - */ - u64 cper_next_record_id(void) - { -- static atomic64_t seq; -+ static atomic64_unchecked_t seq; - -- if (!atomic64_read(&seq)) -- atomic64_set(&seq, ((u64)get_seconds()) << 32); -+ if (!atomic64_read_unchecked(&seq)) -+ atomic64_set_unchecked(&seq, ((u64)get_seconds()) << 32); - -- return atomic64_inc_return(&seq); -+ return atomic64_inc_return_unchecked(&seq); - } - EXPORT_SYMBOL_GPL(cper_next_record_id); - diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c -index 8ec37bb..b0716e5 100644 +index a30bc31..b91c4d5 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -498,7 +498,7 @@ static void __ghes_print_estatus(const char *pfx, const struct acpi_hest_generic *generic, - const struct acpi_hest_generic_status *estatus) + const struct acpi_generic_status *estatus) { - static atomic_t seqno; + static atomic_unchecked_t seqno; @@ -35368,7 +36017,7 @@ index a83e3c6..c3d617f 100644 bgrt_kobj = kobject_create_and_add("bgrt", acpi_kobj); if (!bgrt_kobj) diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c -index 9515f18..4b149c9 100644 +index 078c4f7..410e272 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c @@ -52,7 +52,7 @@ struct acpi_blacklist_item { @@ -35380,7 +36029,7 @@ index 9515f18..4b149c9 100644 /* * POLICY: If *anything* doesn't work, put it on the blacklist. -@@ -199,7 +199,7 @@ static int __init dmi_disable_osi_win8(const struct dmi_system_id *d) +@@ -164,7 +164,7 @@ static int __init dmi_disable_osi_win8(const struct dmi_system_id *d) return 0; } @@ -35405,10 +36054,10 @@ index 12b62f2..dc2aac8 100644 /* parse the table header to get the table length */ if (count <= sizeof(struct acpi_table_header)) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c -index c7414a5..d5afd71 100644 +index 644516d..643937e 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c -@@ -966,7 +966,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) +@@ -963,7 +963,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) { int i, count = CPUIDLE_DRIVER_STATE_START; struct acpi_processor_cx *cx; @@ -35418,10 +36067,10 @@ index c7414a5..d5afd71 100644 if (!pr->flags.power_setup_done) diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c -index 05306a5..733d1f0 100644 +index 6dbc3ca..b8b59a0 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c -@@ -423,11 +423,11 @@ static u32 num_counters; +@@ -425,11 +425,11 @@ static u32 num_counters; static struct attribute **all_attrs; static u32 acpi_gpe_count; @@ -35436,7 +36085,7 @@ index 05306a5..733d1f0 100644 static void delete_gpe_attr_array(void) { diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c -index cfb7447..98f2149 100644 +index c482f8c..c832240 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -1239,7 +1239,7 @@ int ahci_kick_engine(struct ata_port *ap) @@ -35449,7 +36098,7 @@ index cfb7447..98f2149 100644 unsigned long timeout_msec) { diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c -index 2c2780a..5ebc310 100644 +index 8cb2522..a815e54 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -98,7 +98,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev); @@ -35461,7 +36110,7 @@ index 2c2780a..5ebc310 100644 struct ata_force_param { const char *name; -@@ -4823,7 +4823,7 @@ void ata_qc_free(struct ata_queued_cmd *qc) +@@ -4851,7 +4851,7 @@ void ata_qc_free(struct ata_queued_cmd *qc) struct ata_port *ap; unsigned int tag; @@ -35470,7 +36119,7 @@ index 2c2780a..5ebc310 100644 ap = qc->ap; qc->flags = 0; -@@ -4839,7 +4839,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc) +@@ -4867,7 +4867,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc) struct ata_port *ap; struct ata_link *link; @@ -35479,7 +36128,7 @@ index 2c2780a..5ebc310 100644 WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE)); ap = qc->ap; link = qc->dev->link; -@@ -5958,6 +5958,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) +@@ -5986,6 +5986,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) return; spin_lock(&lock); @@ -35487,7 +36136,7 @@ index 2c2780a..5ebc310 100644 for (cur = ops->inherits; cur; cur = cur->inherits) { void **inherit = (void **)cur; -@@ -5971,8 +5972,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) +@@ -5999,8 +6000,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) if (IS_ERR(*pp)) *pp = NULL; @@ -35498,7 +36147,7 @@ index 2c2780a..5ebc310 100644 spin_unlock(&lock); } -@@ -6165,7 +6167,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) +@@ -6193,7 +6195,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++) { @@ -35508,10 +36157,10 @@ index 2c2780a..5ebc310 100644 } diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c -index 377eb88..8591b44 100644 +index ef8567d..8bdbd03 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c -@@ -4135,7 +4135,7 @@ int ata_sas_port_init(struct ata_port *ap) +@@ -4147,7 +4147,7 @@ int ata_sas_port_init(struct ata_port *ap) if (rc) return rc; @@ -35534,7 +36183,7 @@ index 45b5ab3..98446b8 100644 extern int libata_fua; extern int libata_noacpi; diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c -index 853f610..97d24da 100644 +index 73492dd..ca2bff5 100644 --- a/drivers/ata/pata_arasan_cf.c +++ b/drivers/ata/pata_arasan_cf.c @@ -865,7 +865,9 @@ static int arasan_cf_probe(struct platform_device *pdev) @@ -36545,10 +37194,10 @@ index 969c3c2..9b72956 100644 } diff --git a/drivers/base/bus.c b/drivers/base/bus.c -index 4c289ab..de1c333 100644 +index 73f6c29..b0c0e13 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c -@@ -1193,7 +1193,7 @@ int subsys_interface_register(struct subsys_interface *sif) +@@ -1115,7 +1115,7 @@ int subsys_interface_register(struct subsys_interface *sif) return -EINVAL; mutex_lock(&subsys->p->mutex); @@ -36557,7 +37206,7 @@ index 4c289ab..de1c333 100644 if (sif->add_dev) { subsys_dev_iter_init(&iter, subsys, NULL, NULL); while ((dev = subsys_dev_iter_next(&iter))) -@@ -1218,7 +1218,7 @@ void subsys_interface_unregister(struct subsys_interface *sif) +@@ -1140,7 +1140,7 @@ void subsys_interface_unregister(struct subsys_interface *sif) subsys = sif->subsys; mutex_lock(&subsys->p->mutex); @@ -36567,7 +37216,7 @@ index 4c289ab..de1c333 100644 subsys_dev_iter_init(&iter, subsys, NULL, NULL); while ((dev = subsys_dev_iter_next(&iter))) diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c -index 7413d06..79155fa 100644 +index 0f38201..6c2b444 100644 --- a/drivers/base/devtmpfs.c +++ b/drivers/base/devtmpfs.c @@ -354,7 +354,7 @@ int devtmpfs_mount(const char *mntdir) @@ -36608,9 +37257,21 @@ index bc9f43b..29703b8 100644 static ssize_t show_node_state(struct device *dev, struct device_attribute *attr, char *buf) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c -index bfb8955..42c9b9a 100644 +index bfb8955..4ebff34 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c +@@ -1809,9 +1809,9 @@ int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td) + + if (dev->power.subsys_data->domain_data) { + gpd_data = to_gpd_data(dev->power.subsys_data->domain_data); +- gpd_data->ops = (struct gpd_dev_ops){ NULL }; ++ memset(&gpd_data->ops, 0, sizeof(gpd_data->ops)); + if (clear_td) +- gpd_data->td = (struct gpd_timing_data){ 0 }; ++ memset(&gpd_data->td, 0, sizeof(gpd_data->td)); + + if (--gpd_data->refcount == 0) { + dev->power.subsys_data->domain_data = NULL; @@ -1850,7 +1850,7 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state) { struct cpuidle_driver *cpuidle_drv; @@ -36704,7 +37365,7 @@ index e8d11b6..7b1b36f 100644 } EXPORT_SYMBOL_GPL(unregister_syscore_ops); diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c -index edfa251..1734d4d 100644 +index b35fc4f..c902870 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -3011,7 +3011,7 @@ static void start_io(ctlr_info_t *h) @@ -36822,7 +37483,7 @@ index edfa251..1734d4d 100644 } diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h -index 7fda30e..eb5dfe0 100644 +index 7fda30e..2f27946 100644 --- a/drivers/block/cciss.h +++ b/drivers/block/cciss.h @@ -101,7 +101,7 @@ struct ctlr_info @@ -36834,6 +37495,49 @@ index 7fda30e..eb5dfe0 100644 /* queue and queue Info */ struct list_head reqQ; +@@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h) + } + + static struct access_method SA5_access = { +- SA5_submit_command, +- SA5_intr_mask, +- SA5_fifo_full, +- SA5_intr_pending, +- SA5_completed, ++ .submit_command = SA5_submit_command, ++ .set_intr_mask = SA5_intr_mask, ++ .fifo_full = SA5_fifo_full, ++ .intr_pending = SA5_intr_pending, ++ .command_completed = SA5_completed, + }; + + static struct access_method SA5B_access = { +- SA5_submit_command, +- SA5B_intr_mask, +- SA5_fifo_full, +- SA5B_intr_pending, +- SA5_completed, ++ .submit_command = SA5_submit_command, ++ .set_intr_mask = SA5B_intr_mask, ++ .fifo_full = SA5_fifo_full, ++ .intr_pending = SA5B_intr_pending, ++ .command_completed = SA5_completed, + }; + + static struct access_method SA5_performant_access = { +- SA5_submit_command, +- SA5_performant_intr_mask, +- SA5_fifo_full, +- SA5_performant_intr_pending, +- SA5_performant_completed, ++ .submit_command = SA5_submit_command, ++ .set_intr_mask = SA5_performant_intr_mask, ++ .fifo_full = SA5_fifo_full, ++ .intr_pending = SA5_performant_intr_pending, ++ .command_completed = SA5_performant_completed, + }; + + struct board_type { diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index 2b94403..fd6ad1f 100644 --- a/drivers/block/cpqarray.c @@ -36968,7 +37672,7 @@ index be73e9d..7fbf140 100644 cmdlist_t *reqQ; cmdlist_t *cmpQ; diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h -index 2d7f608..11245fe 100644 +index 0e06f0c..c47b81d 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -582,7 +582,7 @@ struct drbd_epoch { @@ -36989,7 +37693,7 @@ index 2d7f608..11245fe 100644 unsigned int peer_seq; spinlock_t peer_seq_lock; unsigned int minor; -@@ -1572,7 +1572,7 @@ static inline int drbd_setsockopt(struct socket *sock, int level, int optname, +@@ -1573,7 +1573,7 @@ static inline int drbd_setsockopt(struct socket *sock, int level, int optname, char __user *uoptval; int err; @@ -36998,8 +37702,25 @@ index 2d7f608..11245fe 100644 set_fs(KERNEL_DS); if (level == SOL_SOCKET) +diff --git a/drivers/block/drbd/drbd_interval.c b/drivers/block/drbd/drbd_interval.c +index 89c497c..9c736ae 100644 +--- a/drivers/block/drbd/drbd_interval.c ++++ b/drivers/block/drbd/drbd_interval.c +@@ -67,9 +67,9 @@ static void augment_rotate(struct rb_node *rb_old, struct rb_node *rb_new) + } + + static const struct rb_augment_callbacks augment_callbacks = { +- augment_propagate, +- augment_copy, +- augment_rotate, ++ .propagate = augment_propagate, ++ .copy = augment_copy, ++ .rotate = augment_rotate, + }; + + /** diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c -index 55635ed..40e837c 100644 +index 9e3818b..7b64c92 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -1317,7 +1317,7 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd, @@ -37032,7 +37753,7 @@ index 55635ed..40e837c 100644 idr_destroy(&tconn->volumes); diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c -index 8cc1e64..ba7ffa9 100644 +index c706d50..5e1b472 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -3440,7 +3440,7 @@ out: @@ -37054,7 +37775,7 @@ index 8cc1e64..ba7ffa9 100644 if (!msg) goto failed; diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c -index cc29cd3..d4b058b 100644 +index 6fa6673..b7f97e9 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -834,7 +834,7 @@ int drbd_connected(struct drbd_conf *mdev) @@ -37107,7 +37828,7 @@ index cc29cd3..d4b058b 100644 list_add(&epoch->list, &tconn->current_epoch->list); tconn->current_epoch = epoch; tconn->epochs++; -@@ -2172,7 +2172,7 @@ static int receive_Data(struct drbd_tconn *tconn, struct packet_info *pi) +@@ -2163,7 +2163,7 @@ static int receive_Data(struct drbd_tconn *tconn, struct packet_info *pi) err = wait_for_and_update_peer_seq(mdev, peer_seq); drbd_send_ack_dp(mdev, P_NEG_ACK, p, pi->size); @@ -37116,7 +37837,7 @@ index cc29cd3..d4b058b 100644 err2 = drbd_drain_block(mdev, pi->size); if (!err) err = err2; -@@ -2206,7 +2206,7 @@ static int receive_Data(struct drbd_tconn *tconn, struct packet_info *pi) +@@ -2197,7 +2197,7 @@ static int receive_Data(struct drbd_tconn *tconn, struct packet_info *pi) spin_lock(&tconn->epoch_lock); peer_req->epoch = tconn->current_epoch; @@ -37125,7 +37846,7 @@ index cc29cd3..d4b058b 100644 atomic_inc(&peer_req->epoch->active); spin_unlock(&tconn->epoch_lock); -@@ -4347,7 +4347,7 @@ struct data_cmd { +@@ -4344,7 +4344,7 @@ struct data_cmd { int expect_payload; size_t pkt_size; int (*fn)(struct drbd_tconn *, struct packet_info *); @@ -37134,7 +37855,7 @@ index cc29cd3..d4b058b 100644 static struct data_cmd drbd_cmd_handler[] = { [P_DATA] = { 1, sizeof(struct p_data), receive_Data }, -@@ -4467,7 +4467,7 @@ static void conn_disconnect(struct drbd_tconn *tconn) +@@ -4464,7 +4464,7 @@ static void conn_disconnect(struct drbd_tconn *tconn) if (!list_empty(&tconn->current_epoch->list)) conn_err(tconn, "ASSERTION FAILED: tconn->current_epoch->list not empty\n"); /* ok, no more ee's on the fly, it is safe to reset the epoch_size */ @@ -37143,7 +37864,7 @@ index cc29cd3..d4b058b 100644 tconn->send.seen_any_write_yet = false; conn_info(tconn, "Connection closed\n"); -@@ -5223,7 +5223,7 @@ static int tconn_finish_peer_reqs(struct drbd_tconn *tconn) +@@ -5220,7 +5220,7 @@ static int tconn_finish_peer_reqs(struct drbd_tconn *tconn) struct asender_cmd { size_t pkt_size; int (*fn)(struct drbd_tconn *tconn, struct packet_info *); @@ -37165,8 +37886,57 @@ index c8dac73..1800093 100644 set_fs(old_fs); file_end_write(file); if (likely(bw == len)) +diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c +index 83a598e..2de5ce3 100644 +--- a/drivers/block/null_blk.c ++++ b/drivers/block/null_blk.c +@@ -407,14 +407,24 @@ static int null_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, + return 0; + } + +-static struct blk_mq_ops null_mq_ops = { +- .queue_rq = null_queue_rq, +- .map_queue = blk_mq_map_queue, ++static struct blk_mq_ops null_mq_single_ops = { ++ .queue_rq = null_queue_rq, ++ .map_queue = blk_mq_map_queue, + .init_hctx = null_init_hctx, ++ .alloc_hctx = blk_mq_alloc_single_hw_queue, ++ .free_hctx = blk_mq_free_single_hw_queue, ++}; ++ ++static struct blk_mq_ops null_mq_per_node_ops = { ++ .queue_rq = null_queue_rq, ++ .map_queue = blk_mq_map_queue, ++ .init_hctx = null_init_hctx, ++ .alloc_hctx = null_alloc_hctx, ++ .free_hctx = null_free_hctx, + }; + + static struct blk_mq_reg null_mq_reg = { +- .ops = &null_mq_ops, ++ .ops = &null_mq_single_ops, + .queue_depth = 64, + .cmd_size = sizeof(struct nullb_cmd), + .flags = BLK_MQ_F_SHOULD_MERGE, +@@ -545,13 +555,8 @@ static int null_add_dev(void) + null_mq_reg.queue_depth = hw_queue_depth; + null_mq_reg.nr_hw_queues = submit_queues; + +- if (use_per_node_hctx) { +- null_mq_reg.ops->alloc_hctx = null_alloc_hctx; +- null_mq_reg.ops->free_hctx = null_free_hctx; +- } else { +- null_mq_reg.ops->alloc_hctx = blk_mq_alloc_single_hw_queue; +- null_mq_reg.ops->free_hctx = blk_mq_free_single_hw_queue; +- } ++ if (use_per_node_hctx) ++ null_mq_reg.ops = &null_mq_per_node_ops; + + nullb->q = blk_mq_init_queue(&null_mq_reg, nullb); + } else if (queue_mode == NULL_Q_BIO) { diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c -index 5618847..5a46f3b 100644 +index ff8668c..f62167a 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -108,7 +108,7 @@ static int pkt_seq_show(struct seq_file *m, void *p); @@ -37178,7 +37948,7 @@ index 5618847..5a46f3b 100644 } /* -@@ -1897,7 +1897,7 @@ static noinline_for_stack int pkt_probe_settings(struct pktcdvd_device *pd) +@@ -1883,7 +1883,7 @@ static noinline_for_stack int pkt_probe_settings(struct pktcdvd_device *pd) return -EROFS; } pd->settings.fp = ti.fp; @@ -37187,11 +37957,81 @@ index 5618847..5a46f3b 100644 if (ti.nwa_v) { pd->nwa = be32_to_cpu(ti.next_writable); +diff --git a/drivers/block/smart1,2.h b/drivers/block/smart1,2.h +index e5565fb..71be10b4 100644 +--- a/drivers/block/smart1,2.h ++++ b/drivers/block/smart1,2.h +@@ -108,11 +108,11 @@ static unsigned long smart4_intr_pending(ctlr_info_t *h) + } + + static struct access_method smart4_access = { +- smart4_submit_command, +- smart4_intr_mask, +- smart4_fifo_full, +- smart4_intr_pending, +- smart4_completed, ++ .submit_command = smart4_submit_command, ++ .set_intr_mask = smart4_intr_mask, ++ .fifo_full = smart4_fifo_full, ++ .intr_pending = smart4_intr_pending, ++ .command_completed = smart4_completed, + }; + + /* +@@ -144,11 +144,11 @@ static unsigned long smart2_intr_pending(ctlr_info_t *h) + } + + static struct access_method smart2_access = { +- smart2_submit_command, +- smart2_intr_mask, +- smart2_fifo_full, +- smart2_intr_pending, +- smart2_completed, ++ .submit_command = smart2_submit_command, ++ .set_intr_mask = smart2_intr_mask, ++ .fifo_full = smart2_fifo_full, ++ .intr_pending = smart2_intr_pending, ++ .command_completed = smart2_completed, + }; + + /* +@@ -180,11 +180,11 @@ static unsigned long smart2e_intr_pending(ctlr_info_t *h) + } + + static struct access_method smart2e_access = { +- smart2e_submit_command, +- smart2e_intr_mask, +- smart2e_fifo_full, +- smart2e_intr_pending, +- smart2e_completed, ++ .submit_command = smart2e_submit_command, ++ .set_intr_mask = smart2e_intr_mask, ++ .fifo_full = smart2e_fifo_full, ++ .intr_pending = smart2e_intr_pending, ++ .command_completed = smart2e_completed, + }; + + /* +@@ -270,9 +270,9 @@ static unsigned long smart1_intr_pending(ctlr_info_t *h) + } + + static struct access_method smart1_access = { +- smart1_submit_command, +- smart1_intr_mask, +- smart1_fifo_full, +- smart1_intr_pending, +- smart1_completed, ++ .submit_command = smart1_submit_command, ++ .set_intr_mask = smart1_intr_mask, ++ .fifo_full = smart1_fifo_full, ++ .intr_pending = smart1_intr_pending, ++ .command_completed = smart1_completed, + }; diff --git a/drivers/bluetooth/btwilink.c b/drivers/bluetooth/btwilink.c -index 60abf59..80789e1 100644 +index f038dba..bb74c08 100644 --- a/drivers/bluetooth/btwilink.c +++ b/drivers/bluetooth/btwilink.c -@@ -293,7 +293,7 @@ static int ti_st_send_frame(struct sk_buff *skb) +@@ -288,7 +288,7 @@ static int ti_st_send_frame(struct hci_dev *hdev, struct sk_buff *skb) static int bt_ti_probe(struct platform_device *pdev) { @@ -37201,10 +38041,10 @@ index 60abf59..80789e1 100644 int err; diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c -index 2009266..7be9ca2 100644 +index b6739cb..962fd35 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c -@@ -405,7 +405,7 @@ static int __init cci_probe(void) +@@ -979,7 +979,7 @@ static int cci_probe(void) nb_cci_ports = cci_config->nb_ace + cci_config->nb_ace_lite; @@ -37278,7 +38118,7 @@ index 5980cb9..6d7bd7e 100644 static int gdrom_bdops_open(struct block_device *bdev, fmode_t mode) diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig -index 1421997..33f5d6d 100644 +index fa3243d..8c98297 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -8,7 +8,8 @@ source "drivers/tty/Kconfig" @@ -37291,7 +38131,7 @@ index 1421997..33f5d6d 100644 help Say Y here if you want to support the /dev/kmem device. The /dev/kmem device is rarely used, but can be used for certain -@@ -570,6 +571,7 @@ config DEVPORT +@@ -576,6 +577,7 @@ config DEVPORT bool depends on !M68K depends on ISA || PCI @@ -37347,10 +38187,10 @@ index 4f94375..413694e 100644 return -EINVAL; else diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c -index 448ce5e..3a76625 100644 +index 5d9c31d..c94ccb5 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c -@@ -559,7 +559,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets, +@@ -578,7 +578,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets, } static int @@ -37674,43 +38514,72 @@ index d39cca6..8c1e269 100644 if (cmd != SIOCWANDEV) diff --git a/drivers/char/random.c b/drivers/char/random.c -index 7a744d3..895af8f 100644 +index 429b75b..a7f4145 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c -@@ -269,8 +269,13 @@ +@@ -270,10 +270,17 @@ /* * Configuration information */ +#ifdef CONFIG_GRKERNSEC_RANDNET -+#define INPUT_POOL_WORDS 512 -+#define OUTPUT_POOL_WORDS 128 ++#define INPUT_POOL_SHIFT 14 ++#define INPUT_POOL_WORDS (1 << (INPUT_POOL_SHIFT-5)) ++#define OUTPUT_POOL_SHIFT 12 ++#define OUTPUT_POOL_WORDS (1 << (OUTPUT_POOL_SHIFT-5)) +#else - #define INPUT_POOL_WORDS 128 - #define OUTPUT_POOL_WORDS 32 + #define INPUT_POOL_SHIFT 12 + #define INPUT_POOL_WORDS (1 << (INPUT_POOL_SHIFT-5)) + #define OUTPUT_POOL_SHIFT 10 + #define OUTPUT_POOL_WORDS (1 << (OUTPUT_POOL_SHIFT-5)) +#endif - #define SEC_XFER_SIZE 512 - #define EXTRACT_SIZE 10 + #define SEC_XFER_SIZE 512 + #define EXTRACT_SIZE 10 -@@ -310,10 +315,17 @@ static struct poolinfo { - int poolwords; +@@ -284,9 +291,6 @@ + /* + * To allow fractional bits to be tracked, the entropy_count field is + * denominated in units of 1/8th bits. +- * +- * 2*(ENTROPY_SHIFT + log2(poolbits)) must <= 31, or the multiply in +- * credit_entropy_bits() needs to be 64 bits wide. + */ + #define ENTROPY_SHIFT 3 + #define ENTROPY_BITS(r) ((r)->entropy_count >> ENTROPY_SHIFT) +@@ -361,12 +365,19 @@ static struct poolinfo { + #define S(x) ilog2(x)+5, (x), (x)*4, (x)*32, (x) << (ENTROPY_SHIFT+5) int tap1, tap2, tap3, tap4, tap5; } poolinfo_table[] = { +#ifdef CONFIG_GRKERNSEC_RANDNET + /* x^512 + x^411 + x^308 + x^208 +x^104 + x + 1 -- 225 */ -+ { 512, 411, 308, 208, 104, 1 }, -+ /* x^128 + x^103 + x^76 + x^51 + x^25 + x + 1 -- 105 */ -+ { 128, 103, 76, 51, 25, 1 }, ++ { S(512), 411, 308, 208, 104, 1 }, ++ /* x^128 + x^104 + x^76 + x^51 + x^25 + x + 1 -- 105 */ ++ { S(128), 104, 76, 51, 25, 1 }, +#else - /* x^128 + x^103 + x^76 + x^51 +x^25 + x + 1 -- 105 */ - { 128, 103, 76, 51, 25, 1 }, - /* x^32 + x^26 + x^20 + x^14 + x^7 + x + 1 -- 15 */ - { 32, 26, 20, 14, 7, 1 }, + /* was: x^128 + x^103 + x^76 + x^51 +x^25 + x + 1 */ + /* x^128 + x^104 + x^76 + x^51 +x^25 + x + 1 */ + { S(128), 104, 76, 51, 25, 1 }, + /* was: x^32 + x^26 + x^20 + x^14 + x^7 + x + 1 */ + /* x^32 + x^26 + x^19 + x^14 + x^7 + x + 1 */ + { S(32), 26, 19, 14, 7, 1 }, +#endif #if 0 /* x^2048 + x^1638 + x^1231 + x^819 + x^411 + x + 1 -- 115 */ - { 2048, 1638, 1231, 819, 411, 1 }, -@@ -521,8 +533,8 @@ static void _mix_pool_bytes(struct entropy_store *r, const void *in, - input_rotate += i ? 7 : 14; + { S(2048), 1638, 1231, 819, 411, 1 }, +@@ -433,9 +444,9 @@ struct entropy_store { + }; + + static void push_to_pool(struct work_struct *work); +-static __u32 input_pool_data[INPUT_POOL_WORDS]; +-static __u32 blocking_pool_data[OUTPUT_POOL_WORDS]; +-static __u32 nonblocking_pool_data[OUTPUT_POOL_WORDS]; ++static __u32 input_pool_data[INPUT_POOL_WORDS] __latent_entropy; ++static __u32 blocking_pool_data[OUTPUT_POOL_WORDS] __latent_entropy; ++static __u32 nonblocking_pool_data[OUTPUT_POOL_WORDS] __latent_entropy; + + static struct entropy_store input_pool = { + .poolinfo = &poolinfo_table[0], +@@ -524,8 +535,8 @@ static void _mix_pool_bytes(struct entropy_store *r, const void *in, + input_rotate = (input_rotate + (i ? 7 : 14)) & 31; } - ACCESS_ONCE(r->input_rotate) = input_rotate; @@ -37720,20 +38589,16 @@ index 7a744d3..895af8f 100644 smp_wmb(); if (out) -@@ -603,8 +615,11 @@ retry: +@@ -632,7 +643,7 @@ retry: + /* The +2 corresponds to the /4 in the denominator */ - if (!r->initialized && nbits > 0) { - r->entropy_total += nbits; -- if (r->entropy_total > 128) -+ if (r->entropy_total > 128) { - r->initialized = 1; -+ if (r == &nonblocking_pool) -+ prandom_reseed_late(); -+ } - } + do { +- unsigned int anfrac = min(pnfrac, pool_size/2); ++ u64 anfrac = min(pnfrac, pool_size/2); + unsigned int add = + ((pool_size - entropy_count)*anfrac*3) >> s; - trace_credit_entropy_bits(r->name, nbits, entropy_count, -@@ -1029,7 +1044,7 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf, +@@ -1151,7 +1162,7 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf, extract_buf(r, tmp); i = min_t(int, nbytes, EXTRACT_SIZE); @@ -37742,7 +38607,7 @@ index 7a744d3..895af8f 100644 ret = -EFAULT; break; } -@@ -1365,7 +1380,7 @@ EXPORT_SYMBOL(generate_random_uuid); +@@ -1507,7 +1518,7 @@ EXPORT_SYMBOL(generate_random_uuid); #include static int min_read_thresh = 8, min_write_thresh; @@ -37751,7 +38616,7 @@ index 7a744d3..895af8f 100644 static int max_write_thresh = INPUT_POOL_WORDS * 32; static char sysctl_bootid[16]; -@@ -1381,7 +1396,7 @@ static char sysctl_bootid[16]; +@@ -1523,7 +1534,7 @@ static char sysctl_bootid[16]; static int proc_do_uuid(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { @@ -37760,6 +38625,15 @@ index 7a744d3..895af8f 100644 unsigned char buf[64], tmp_uuid[16], *uuid; uuid = table->data; +@@ -1553,7 +1564,7 @@ static int proc_do_uuid(struct ctl_table *table, int write, + static int proc_do_entropy(ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- ctl_table fake_table; ++ ctl_table_no_const fake_table; + int entropy_count; + + entropy_count = *(int *)table->data >> ENTROPY_SHIFT; diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 7cc1fe22..b602d6b 100644 --- a/drivers/char/sonypi.c @@ -37821,7 +38695,7 @@ index 64420b3..5c40b56 100644 acpi_os_unmap_memory(virt, len); return 0; diff --git a/drivers/char/tpm/tpm_eventlog.c b/drivers/char/tpm/tpm_eventlog.c -index 84ddc55..1d32f1e 100644 +index 59f7cb2..bac8b6d 100644 --- a/drivers/char/tpm/tpm_eventlog.c +++ b/drivers/char/tpm/tpm_eventlog.c @@ -95,7 +95,7 @@ static void *tpm_bios_measurements_start(struct seq_file *m, loff_t *pos) @@ -37853,10 +38727,10 @@ index 84ddc55..1d32f1e 100644 return 0; } diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c -index b79cf3e..de172d64f 100644 +index feea87c..18aefff 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c -@@ -682,7 +682,7 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count, +@@ -684,7 +684,7 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count, if (to_user) { ssize_t ret; @@ -37865,7 +38739,7 @@ index b79cf3e..de172d64f 100644 if (ret) return -EFAULT; } else { -@@ -785,7 +785,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, +@@ -787,7 +787,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, if (!port_has_data(port) && !port->host_connected) return 0; @@ -37922,7 +38796,7 @@ index 81dd31a..ef5c542 100644 .get_parent = socfpga_clk_get_parent, .set_parent = socfpga_clk_set_parent, diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c -index 506fd23..01a593f 100644 +index caf41eb..223d27a 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -172,7 +172,7 @@ static ssize_t show_global_boost(struct kobject *kobj, @@ -37934,7 +38808,7 @@ index 506fd23..01a593f 100644 show_global_boost, store_global_boost); -@@ -721,8 +721,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) +@@ -693,8 +693,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) data->acpi_data = per_cpu_ptr(acpi_perf_data, cpu); per_cpu(acfreq_data, cpu) = data; @@ -37948,7 +38822,7 @@ index 506fd23..01a593f 100644 result = acpi_processor_register_performance(data->acpi_data, cpu); if (result) -@@ -850,7 +853,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) +@@ -827,7 +830,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: @@ -37956,14 +38830,23 @@ index 506fd23..01a593f 100644 + pax_open_kernel(); + *(void **)&acpi_cpufreq_driver.get = get_cur_freq_on_cpu; + pax_close_kernel(); - policy->cur = get_cur_freq_on_cpu(cpu); break; default: + break; diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c -index 04548f7..457a342 100644 +index 99a443e..8cb6f02 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c -@@ -2069,7 +2069,7 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb, +@@ -1878,7 +1878,7 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor) + #endif + + mutex_lock(&cpufreq_governor_mutex); +- list_del(&governor->governor_list); ++ pax_list_del(&governor->governor_list); + mutex_unlock(&cpufreq_governor_mutex); + return; + } +@@ -2108,7 +2108,7 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } @@ -37972,7 +38855,7 @@ index 04548f7..457a342 100644 .notifier_call = cpufreq_cpu_callback, }; -@@ -2101,8 +2101,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) +@@ -2141,8 +2141,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) pr_debug("trying to register driver %s\n", driver_data->name); @@ -37987,7 +38870,7 @@ index 04548f7..457a342 100644 write_lock_irqsave(&cpufreq_driver_lock, flags); if (cpufreq_driver) { diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c -index 0806c31..6a73276 100644 +index e6be635..f8a90dc 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -187,7 +187,7 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy, @@ -38018,10 +38901,10 @@ index 0806c31..6a73276 100644 cpufreq_unregister_notifier(cs_ops->notifier_block, CPUFREQ_TRANSITION_NOTIFIER); diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h -index 88cd39f..87f0393 100644 +index b5f2b86..daa801b 100644 --- a/drivers/cpufreq/cpufreq_governor.h +++ b/drivers/cpufreq/cpufreq_governor.h -@@ -202,7 +202,7 @@ struct common_dbs_data { +@@ -205,7 +205,7 @@ struct common_dbs_data { void (*exit)(struct dbs_data *dbs_data); /* Governor specific ops, see below */ @@ -38030,7 +38913,7 @@ index 88cd39f..87f0393 100644 }; /* Governor Per policy data */ -@@ -222,7 +222,7 @@ struct od_ops { +@@ -225,7 +225,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); @@ -38040,10 +38923,10 @@ index 88cd39f..87f0393 100644 struct cs_ops { struct notifier_block *notifier_block; diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c -index 32f26f6..feb657b 100644 +index 18d4091..434be15 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c -@@ -522,7 +522,7 @@ static void od_exit(struct dbs_data *dbs_data) +@@ -521,7 +521,7 @@ static void od_exit(struct dbs_data *dbs_data) define_get_cpu_dbs_routines(od_cpu_dbs_info); @@ -38052,7 +38935,7 @@ index 32f26f6..feb657b 100644 .powersave_bias_init_cpu = ondemand_powersave_bias_init_cpu, .powersave_bias_target = generic_powersave_bias_target, .freq_increase = dbs_freq_increase, -@@ -577,14 +577,18 @@ void od_register_powersave_bias_handler(unsigned int (*f) +@@ -576,14 +576,18 @@ void od_register_powersave_bias_handler(unsigned int (*f) (struct cpufreq_policy *, unsigned int, unsigned int), unsigned int powersave_bias) { @@ -38086,11 +38969,90 @@ index 4cf0d28..5830372 100644 .notifier_call = cpufreq_stat_cpu_callback, .priority = 1, }; +diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c +index b687df8..ae733fc 100644 +--- a/drivers/cpufreq/intel_pstate.c ++++ b/drivers/cpufreq/intel_pstate.c +@@ -123,10 +123,10 @@ struct pstate_funcs { + struct cpu_defaults { + struct pstate_adjust_policy pid_policy; + struct pstate_funcs funcs; +-}; ++} __do_const; + + static struct pstate_adjust_policy pid_params; +-static struct pstate_funcs pstate_funcs; ++static struct pstate_funcs *pstate_funcs; + + struct perf_limits { + int no_turbo; +@@ -517,7 +517,7 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) + + cpu->pstate.current_pstate = pstate; + +- pstate_funcs.set(cpu, pstate); ++ pstate_funcs->set(cpu, pstate); + } + + static inline void intel_pstate_pstate_increase(struct cpudata *cpu, int steps) +@@ -539,12 +539,12 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) + { + sprintf(cpu->name, "Intel 2nd generation core"); + +- cpu->pstate.min_pstate = pstate_funcs.get_min(); +- cpu->pstate.max_pstate = pstate_funcs.get_max(); +- cpu->pstate.turbo_pstate = pstate_funcs.get_turbo(); ++ cpu->pstate.min_pstate = pstate_funcs->get_min(); ++ cpu->pstate.max_pstate = pstate_funcs->get_max(); ++ cpu->pstate.turbo_pstate = pstate_funcs->get_turbo(); + +- if (pstate_funcs.get_vid) +- pstate_funcs.get_vid(cpu); ++ if (pstate_funcs->get_vid) ++ pstate_funcs->get_vid(cpu); + + /* + * goto max pstate so we don't slow up boot if we are built-in if we are +@@ -808,9 +808,9 @@ static int intel_pstate_msrs_not_valid(void) + rdmsrl(MSR_IA32_APERF, aperf); + rdmsrl(MSR_IA32_MPERF, mperf); + +- if (!pstate_funcs.get_max() || +- !pstate_funcs.get_min() || +- !pstate_funcs.get_turbo()) ++ if (!pstate_funcs->get_max() || ++ !pstate_funcs->get_min() || ++ !pstate_funcs->get_turbo()) + return -ENODEV; + + rdmsrl(MSR_IA32_APERF, tmp); +@@ -824,7 +824,7 @@ static int intel_pstate_msrs_not_valid(void) + return 0; + } + +-static void copy_pid_params(struct pstate_adjust_policy *policy) ++static void copy_pid_params(const struct pstate_adjust_policy *policy) + { + pid_params.sample_rate_ms = policy->sample_rate_ms; + pid_params.p_gain_pct = policy->p_gain_pct; +@@ -836,11 +836,7 @@ static void copy_pid_params(struct pstate_adjust_policy *policy) + + static void copy_cpu_funcs(struct pstate_funcs *funcs) + { +- pstate_funcs.get_max = funcs->get_max; +- pstate_funcs.get_min = funcs->get_min; +- pstate_funcs.get_turbo = funcs->get_turbo; +- pstate_funcs.set = funcs->set; +- pstate_funcs.get_vid = funcs->get_vid; ++ pstate_funcs = funcs; + } + + #if IS_ENABLED(CONFIG_ACPI) diff --git a/drivers/cpufreq/p4-clockmod.c b/drivers/cpufreq/p4-clockmod.c -index 2f0a2a6..93d728e 100644 +index 3d1cba9..0ab21d2 100644 --- a/drivers/cpufreq/p4-clockmod.c +++ b/drivers/cpufreq/p4-clockmod.c -@@ -160,10 +160,14 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) +@@ -134,10 +134,14 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) case 0x0F: /* Core Duo */ case 0x16: /* Celeron Core */ case 0x1C: /* Atom */ @@ -38107,7 +39069,7 @@ index 2f0a2a6..93d728e 100644 /* fall through */ case 0x09: /* Pentium M (Banias) */ return speedstep_get_frequency(SPEEDSTEP_CPU_PM); -@@ -175,7 +179,9 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) +@@ -149,7 +153,9 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) /* on P-4s, the TSC runs with constant frequency independent whether * throttling is active or not. */ @@ -38119,7 +39081,7 @@ index 2f0a2a6..93d728e 100644 if (speedstep_detect_processor() == SPEEDSTEP_CPU_P4M) { printk(KERN_WARNING PFX "Warning: Pentium 4-M detected. " diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c -index ac76b48..2445bc6 100644 +index 724ffbd..ad83692 100644 --- a/drivers/cpufreq/sparc-us3-cpufreq.c +++ b/drivers/cpufreq/sparc-us3-cpufreq.c @@ -18,14 +18,12 @@ @@ -38138,13 +39100,16 @@ index ac76b48..2445bc6 100644 /* UltraSPARC-III has three dividers: 1, 2, and 32. These are controlled * in the Safari config register. -@@ -186,12 +184,25 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) +@@ -156,14 +154,26 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) static int us3_freq_cpu_exit(struct cpufreq_policy *policy) { -- if (cpufreq_us3_driver) -- us3_set_cpu_divider_index(policy, 0); -+ us3_set_cpu_divider_index(policy->cpu, 0); +- if (cpufreq_us3_driver) { +- cpufreq_frequency_table_put_attr(policy->cpu); +- us3_freq_target(policy, 0); +- } ++ cpufreq_frequency_table_put_attr(policy->cpu); ++ us3_freq_target(policy, 0); return 0; } @@ -38153,20 +39118,20 @@ index ac76b48..2445bc6 100644 +static void __exit us3_freq_exit(void); + +static struct cpufreq_driver cpufreq_us3_driver = { -+ .init = us3_freq_cpu_init, -+ .verify = us3_freq_verify, -+ .target = us3_freq_target, -+ .get = us3_freq_get, -+ .exit = us3_freq_cpu_exit, -+ .owner = THIS_MODULE, -+ .name = "UltraSPARC-III", ++ .init = us3_freq_cpu_init, ++ .verify = cpufreq_generic_frequency_table_verify, ++ .target_index = us3_freq_target, ++ .get = us3_freq_get, ++ .exit = us3_freq_cpu_exit, ++ .owner = THIS_MODULE, ++ .name = "UltraSPARC-III", + +}; + static int __init us3_freq_init(void) { unsigned long manuf, impl, ver; -@@ -208,55 +219,15 @@ static int __init us3_freq_init(void) +@@ -180,55 +190,15 @@ static int __init us3_freq_init(void) (impl == CHEETAH_IMPL || impl == CHEETAH_PLUS_IMPL || impl == JAGUAR_IMPL || @@ -38184,8 +39149,8 @@ index ac76b48..2445bc6 100644 - goto err_out; - - driver->init = us3_freq_cpu_init; -- driver->verify = us3_freq_verify; -- driver->target = us3_freq_target; +- driver->verify = cpufreq_generic_frequency_table_verify; +- driver->target_index = us3_freq_target; - driver->get = us3_freq_get; - driver->exit = us3_freq_cpu_exit; - strcpy(driver->name, "UltraSPARC-III"); @@ -38226,10 +39191,10 @@ index ac76b48..2445bc6 100644 MODULE_AUTHOR("David S. Miller "); diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c -index f897d51..15da295 100644 +index 4e1daca..e707b61 100644 --- a/drivers/cpufreq/speedstep-centrino.c +++ b/drivers/cpufreq/speedstep-centrino.c -@@ -353,8 +353,11 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) +@@ -351,8 +351,11 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) !cpu_has(cpu, X86_FEATURE_EST)) return -ENODEV; @@ -38243,11 +39208,11 @@ index f897d51..15da295 100644 if (policy->cpu != 0) return -ENODEV; -diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c -index 22c07fb..9dff5ac 100644 ---- a/drivers/cpuidle/cpuidle.c -+++ b/drivers/cpuidle/cpuidle.c -@@ -252,7 +252,7 @@ static int poll_idle(struct cpuidle_device *dev, +diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c +index 06dbe7c..c2c8671 100644 +--- a/drivers/cpuidle/driver.c ++++ b/drivers/cpuidle/driver.c +@@ -202,7 +202,7 @@ static int poll_idle(struct cpuidle_device *dev, static void poll_idle_init(struct cpuidle_driver *drv) { @@ -38257,7 +39222,7 @@ index 22c07fb..9dff5ac 100644 snprintf(state->name, CPUIDLE_NAME_LEN, "POLL"); snprintf(state->desc, CPUIDLE_DESC_LEN, "CPUIDLE CORE POLL IDLE"); diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c -index ea2f8e7..70ac501 100644 +index ca89412..a7b9c49 100644 --- a/drivers/cpuidle/governor.c +++ b/drivers/cpuidle/governor.c @@ -87,7 +87,7 @@ int cpuidle_register_governor(struct cpuidle_governor *gov) @@ -38269,20 +39234,11 @@ index ea2f8e7..70ac501 100644 if (!cpuidle_curr_governor || cpuidle_curr_governor->rating < gov->rating) cpuidle_switch_governor(gov); -@@ -135,7 +135,7 @@ void cpuidle_unregister_governor(struct cpuidle_governor *gov) - new_gov = cpuidle_replace_governor(gov->rating); - cpuidle_switch_governor(new_gov); - } -- list_del(&gov->governor_list); -+ pax_list_del((struct list_head *)&gov->governor_list); - mutex_unlock(&cpuidle_lock); - } - diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c -index 8739cc0..dc859d0 100644 +index e918b6d..f87ea80 100644 --- a/drivers/cpuidle/sysfs.c +++ b/drivers/cpuidle/sysfs.c -@@ -134,7 +134,7 @@ static struct attribute *cpuidle_switch_attrs[] = { +@@ -135,7 +135,7 @@ static struct attribute *cpuidle_switch_attrs[] = { NULL }; @@ -38314,7 +39270,7 @@ index 12fea3e..1e28f47 100644 err = pci_request_regions(pdev, name); if (err) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c -index c99c00d..990a4b2 100644 +index a0b2f7e..1b6f028 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -607,7 +607,7 @@ int devfreq_add_governor(struct devfreq_governor *governor) @@ -38336,7 +39292,7 @@ index c99c00d..990a4b2 100644 mutex_unlock(&devfreq_list_lock); diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c -index 1069e88..dfcd642 100644 +index 0d765c0..60b7480 100644 --- a/drivers/dma/sh/shdmac.c +++ b/drivers/dma/sh/shdmac.c @@ -511,7 +511,7 @@ static int sh_dmae_nmi_handler(struct notifier_block *self, @@ -38349,7 +39305,7 @@ index 1069e88..dfcd642 100644 /* Run before NMI debug handler and KGDB */ diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c -index 211021d..201d47f 100644 +index 1026743..80b081c 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, @@ -38365,10 +39321,10 @@ index 211021d..201d47f 100644 EXPORT_SYMBOL_GPL(edac_device_alloc_index); diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c -index 9f7e0e60..348c875 100644 +index e5bdf21..b8f9055 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c -@@ -150,7 +150,7 @@ static const char * const edac_caps[] = { +@@ -152,7 +152,7 @@ static const char * const edac_caps[] = { struct dev_ch_attribute { struct device_attribute attr; int channel; @@ -38377,7 +39333,7 @@ index 9f7e0e60..348c875 100644 #define DEVICE_CHANNEL(_name, _mode, _show, _store, _var) \ struct dev_ch_attribute dev_attr_legacy_##_name = \ -@@ -1007,14 +1007,16 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) +@@ -1009,14 +1009,16 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) } if (mci->set_sdram_scrub_rate || mci->get_sdram_scrub_rate) { @@ -38399,7 +39355,7 @@ index 9f7e0e60..348c875 100644 &dev_attr_sdram_scrub_rate); if (err) { diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c -index dd370f9..0281629 100644 +index 2cf44b4d..6dd2dc7 100644 --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c @@ -29,7 +29,7 @@ @@ -38555,7 +39511,7 @@ index 57ea7f4..af06b76 100644 card->driver->update_phy_reg(card, 4, PHY_LINK_ACTIVE | PHY_CONTENDER, 0); diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c -index de4aa40..49ab1f2 100644 +index 2c6d5e1..a2cca6b 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c @@ -253,7 +253,7 @@ EXPORT_SYMBOL(fw_device_enable_phys_dma); @@ -38568,7 +39524,7 @@ index de4aa40..49ab1f2 100644 static ssize_t show_immediate(struct device *dev, struct device_attribute *dattr, char *buf) diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c -index e5af0e3..d318058 100644 +index 0e79951..b180217 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -38,6 +38,7 @@ @@ -38605,10 +39561,10 @@ index 94a58a0..f5eba42 100644 container_of(_dev_attr, struct dmi_device_attribute, dev_attr) diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c -index fa0affb..aa448eb 100644 +index c7e81ff..94a7401 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c -@@ -791,7 +791,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *), +@@ -835,7 +835,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *), if (buf == NULL) return -1; @@ -38617,11 +39573,32 @@ index fa0affb..aa448eb 100644 iounmap(buf); return 0; +diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c +index 1491dd4..aa910db 100644 +--- a/drivers/firmware/efi/cper.c ++++ b/drivers/firmware/efi/cper.c +@@ -41,12 +41,12 @@ + */ + u64 cper_next_record_id(void) + { +- static atomic64_t seq; ++ static atomic64_unchecked_t seq; + +- if (!atomic64_read(&seq)) +- atomic64_set(&seq, ((u64)get_seconds()) << 32); ++ if (!atomic64_read_unchecked(&seq)) ++ atomic64_set_unchecked(&seq, ((u64)get_seconds()) << 32); + +- return atomic64_inc_return(&seq); ++ return atomic64_inc_return_unchecked(&seq); + } + EXPORT_SYMBOL_GPL(cper_next_record_id); + diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c -index 5145fa3..0d3babd 100644 +index 2e2fbde..7676c8b 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c -@@ -65,14 +65,16 @@ static struct attribute_group efi_subsys_attr_group = { +@@ -81,14 +81,16 @@ static struct attribute_group efi_subsys_attr_group = { }; static struct efivars generic_efivars; @@ -38644,7 +39621,7 @@ index 5145fa3..0d3babd 100644 return efivars_register(&generic_efivars, &generic_ops, efi_kobj); } diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c -index 8c5a61a..cf07bd0 100644 +index 3dc2482..7bd2f61 100644 --- a/drivers/firmware/efi/efivars.c +++ b/drivers/firmware/efi/efivars.c @@ -456,7 +456,7 @@ efivar_create_sysfs_entry(struct efivar_entry *new_var) @@ -38671,6 +39648,19 @@ index 2a90ba6..07f3733 100644 ret = sysfs_create_bin_file(firmware_kobj, &memconsole_bin_attr); +diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c +index ec19036..8ffafc2 100644 +--- a/drivers/gpio/gpio-em.c ++++ b/drivers/gpio/gpio-em.c +@@ -257,7 +257,7 @@ static int em_gio_probe(struct platform_device *pdev) + struct em_gio_priv *p; + struct resource *io[2], *irq[2]; + struct gpio_chip *gpio_chip; +- struct irq_chip *irq_chip; ++ irq_chip_no_const *irq_chip; + const char *name = dev_name(&pdev->dev); + int ret; + diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c index 814addb..0937d7f 100644 --- a/drivers/gpio/gpio-ich.c @@ -38684,6 +39674,19 @@ index 814addb..0937d7f 100644 static struct { spinlock_t lock; +diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c +index 8b7e719..dc089dc 100644 +--- a/drivers/gpio/gpio-rcar.c ++++ b/drivers/gpio/gpio-rcar.c +@@ -316,7 +316,7 @@ static int gpio_rcar_probe(struct platform_device *pdev) + struct gpio_rcar_priv *p; + struct resource *io, *irq; + struct gpio_chip *gpio_chip; +- struct irq_chip *irq_chip; ++ irq_chip_no_const *irq_chip; + const char *name = dev_name(&pdev->dev); + int ret; + diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c index 9902732..64b62dd 100644 --- a/drivers/gpio/gpio-vr41xx.c @@ -38697,11 +39700,24 @@ index 9902732..64b62dd 100644 return -EINVAL; } +diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c +index d6cf77c..2842146 100644 +--- a/drivers/gpu/drm/drm_crtc.c ++++ b/drivers/gpu/drm/drm_crtc.c +@@ -3102,7 +3102,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev, + goto done; + } + +- if (copy_to_user(&enum_ptr[copied].name, ++ if (copy_to_user(enum_ptr[copied].name, + &prop_enum->name, DRM_PROP_NAME_LEN)) { + ret = -EFAULT; + goto done; diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c -index c722c3b..2ec6040 100644 +index 01361ab..891e821 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c -@@ -328,7 +328,7 @@ static bool drm_encoder_crtc_ok(struct drm_encoder *encoder, +@@ -338,7 +338,7 @@ static bool drm_encoder_crtc_ok(struct drm_encoder *encoder, struct drm_crtc *tmp; int crtc_mask = 1; @@ -38711,19 +39727,10 @@ index c722c3b..2ec6040 100644 dev = crtc->dev; diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c -index fe58d08..07bc38e 100644 +index d9137e4..69b73a0 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c -@@ -186,7 +186,7 @@ static void drm_legacy_dev_reinit(struct drm_device *dev) - atomic_set(&dev->vma_count, 0); - - for (i = 0; i < ARRAY_SIZE(dev->counts); i++) -- atomic_set(&dev->counts[i], 0); -+ atomic_set_unchecked(&dev->counts[i], 0); - - dev->sigdata.lock = NULL; - -@@ -302,7 +302,7 @@ module_exit(drm_core_exit); +@@ -233,7 +233,7 @@ module_exit(drm_core_exit); /** * Copy and IOCTL return string to user space */ @@ -38732,7 +39739,7 @@ index fe58d08..07bc38e 100644 { int len; -@@ -372,7 +372,7 @@ long drm_ioctl(struct file *filp, +@@ -303,7 +303,7 @@ long drm_ioctl(struct file *filp, struct drm_file *file_priv = filp->private_data; struct drm_device *dev; const struct drm_ioctl_desc *ioctl = NULL; @@ -38741,17 +39748,8 @@ index fe58d08..07bc38e 100644 unsigned int nr = DRM_IOCTL_NR(cmd); int retcode = -EINVAL; char stack_kdata[128]; -@@ -385,7 +385,7 @@ long drm_ioctl(struct file *filp, - return -ENODEV; - - atomic_inc(&dev->ioctl_count); -- atomic_inc(&dev->counts[_DRM_STAT_IOCTLS]); -+ atomic_inc_unchecked(&dev->counts[_DRM_STAT_IOCTLS]); - ++file_priv->ioctl_count; - - if ((nr >= DRM_CORE_IOCTL_COUNT) && diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c -index 3f84277..c627c54 100644 +index c5b929c..8a3b8be 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -97,7 +97,7 @@ int drm_open(struct inode *inode, struct file *filp) @@ -38763,16 +39761,7 @@ index 3f84277..c627c54 100644 need_setup = 1; mutex_lock(&dev->struct_mutex); old_imapping = inode->i_mapping; -@@ -113,7 +113,7 @@ int drm_open(struct inode *inode, struct file *filp) - retcode = drm_open_helper(inode, filp, dev); - if (retcode) - goto err_undo; -- atomic_inc(&dev->counts[_DRM_STAT_OPENS]); -+ atomic_inc_unchecked(&dev->counts[_DRM_STAT_OPENS]); - if (need_setup) { - retcode = drm_setup(dev); - if (retcode) -@@ -128,7 +128,7 @@ err_undo: +@@ -127,7 +127,7 @@ err_undo: iput(container_of(dev->dev_mapping, struct inode, i_data)); dev->dev_mapping = old_mapping; mutex_unlock(&dev->struct_mutex); @@ -38781,7 +39770,7 @@ index 3f84277..c627c54 100644 return retcode; } EXPORT_SYMBOL(drm_open); -@@ -405,7 +405,7 @@ int drm_release(struct inode *inode, struct file *filp) +@@ -467,7 +467,7 @@ int drm_release(struct inode *inode, struct file *filp) mutex_lock(&drm_global_mutex); @@ -38790,7 +39779,7 @@ index 3f84277..c627c54 100644 if (dev->driver->preclose) dev->driver->preclose(dev, file_priv); -@@ -414,10 +414,10 @@ int drm_release(struct inode *inode, struct file *filp) +@@ -476,10 +476,10 @@ int drm_release(struct inode *inode, struct file *filp) * Begin inline drm_release */ @@ -38803,19 +39792,17 @@ index 3f84277..c627c54 100644 /* Release any auth tokens that might point to this file_priv, (do that under the drm_global_mutex) */ -@@ -516,8 +516,8 @@ int drm_release(struct inode *inode, struct file *filp) +@@ -577,7 +577,7 @@ int drm_release(struct inode *inode, struct file *filp) * End inline drm_release */ -- atomic_inc(&dev->counts[_DRM_STAT_CLOSES]); - if (!--dev->open_count) { -+ atomic_inc_unchecked(&dev->counts[_DRM_STAT_CLOSES]); + if (local_dec_and_test(&dev->open_count)) { if (atomic_read(&dev->ioctl_count)) { DRM_ERROR("Device busy: %d\n", atomic_read(&dev->ioctl_count)); diff --git a/drivers/gpu/drm/drm_global.c b/drivers/gpu/drm/drm_global.c -index f731116..629842c 100644 +index 3d2e91c..d31c4c9 100644 --- a/drivers/gpu/drm/drm_global.c +++ b/drivers/gpu/drm/drm_global.c @@ -36,7 +36,7 @@ @@ -38845,8 +39832,8 @@ index f731116..629842c 100644 } } -@@ -70,7 +70,7 @@ int drm_global_item_ref(struct drm_global_reference *ref) - void *object; +@@ -69,7 +69,7 @@ int drm_global_item_ref(struct drm_global_reference *ref) + struct drm_global_item *item = &glob[ref->global_type]; mutex_lock(&item->mutex); - if (item->refcount == 0) { @@ -38854,16 +39841,16 @@ index f731116..629842c 100644 item->object = kzalloc(ref->size, GFP_KERNEL); if (unlikely(item->object == NULL)) { ret = -ENOMEM; -@@ -83,7 +83,7 @@ int drm_global_item_ref(struct drm_global_reference *ref) +@@ -82,7 +82,7 @@ int drm_global_item_ref(struct drm_global_reference *ref) goto out_err; } - ++item->refcount; + atomic_inc(&item->refcount); ref->object = item->object; - object = item->object; mutex_unlock(&item->mutex); -@@ -100,9 +100,9 @@ void drm_global_item_unref(struct drm_global_reference *ref) + return 0; +@@ -98,9 +98,9 @@ void drm_global_item_unref(struct drm_global_reference *ref) struct drm_global_item *item = &glob[ref->global_type]; mutex_lock(&item->mutex); @@ -38876,7 +39863,7 @@ index f731116..629842c 100644 item->object = NULL; } diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c -index 5329832..b503f49 100644 +index 7d5a152..d7186da 100644 --- a/drivers/gpu/drm/drm_info.c +++ b/drivers/gpu/drm/drm_info.c @@ -75,10 +75,14 @@ int drm_vm_info(struct seq_file *m, void *data) @@ -38920,7 +39907,7 @@ index 5329832..b503f49 100644 #if defined(__i386__) pgprot = pgprot_val(vma->vm_page_prot); diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c -index 2f4c434..dd12cd2 100644 +index 2f4c4343..dd12cd2 100644 --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c @@ -457,7 +457,7 @@ static int compat_drm_infobufs(struct file *file, unsigned int cmd, @@ -38971,33 +39958,11 @@ index 2f4c434..dd12cd2 100644 else ret = drm_ioctl(filp, cmd, arg); -diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c -index d752c96..fe08455 100644 ---- a/drivers/gpu/drm/drm_lock.c -+++ b/drivers/gpu/drm/drm_lock.c -@@ -86,7 +86,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) - if (drm_lock_take(&master->lock, lock->context)) { - master->lock.file_priv = file_priv; - master->lock.lock_time = jiffies; -- atomic_inc(&dev->counts[_DRM_STAT_LOCKS]); -+ atomic_inc_unchecked(&dev->counts[_DRM_STAT_LOCKS]); - break; /* Got lock */ - } - -@@ -157,7 +157,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) - return -EINVAL; - } - -- atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]); -+ atomic_inc_unchecked(&dev->counts[_DRM_STAT_UNLOCKS]); - - if (drm_lock_free(&master->lock, lock->context)) { - /* FIXME: Should really bail out here. */ diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c -index 39d8645..59e06fa 100644 +index 66dd3a0..3bed6c4 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c -@@ -484,7 +484,7 @@ void drm_unplug_dev(struct drm_device *dev) +@@ -403,7 +403,7 @@ void drm_unplug_dev(struct drm_device *dev) drm_device_set_unplugged(dev); @@ -39007,44 +39972,18 @@ index 39d8645..59e06fa 100644 } mutex_unlock(&drm_global_mutex); diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c -index 2290b3b..22056a1 100644 +index c22c309..ae758c3 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c -@@ -524,7 +524,7 @@ EXPORT_SYMBOL(drm_sysfs_hotplug_event); +@@ -505,7 +505,7 @@ static void drm_sysfs_release(struct device *dev) + */ int drm_sysfs_device_add(struct drm_minor *minor) { - int err; - char *minor_str; + const char *minor_str; + int r; - minor->kdev.parent = minor->dev->dev; - -diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c -index ab1892eb..d7009ca 100644 ---- a/drivers/gpu/drm/i810/i810_dma.c -+++ b/drivers/gpu/drm/i810/i810_dma.c -@@ -944,8 +944,8 @@ static int i810_dma_vertex(struct drm_device *dev, void *data, - dma->buflist[vertex->idx], - vertex->discard, vertex->used); - -- atomic_add(vertex->used, &dev->counts[_DRM_STAT_SECONDARY]); -- atomic_inc(&dev->counts[_DRM_STAT_DMA]); -+ atomic_add_unchecked(vertex->used, &dev->counts[_DRM_STAT_SECONDARY]); -+ atomic_inc_unchecked(&dev->counts[_DRM_STAT_DMA]); - sarea_priv->last_enqueue = dev_priv->counter - 1; - sarea_priv->last_dispatch = (int)hw_status[5]; - -@@ -1105,8 +1105,8 @@ static int i810_dma_mc(struct drm_device *dev, void *data, - i810_dma_dispatch_mc(dev, dma->buflist[mc->idx], mc->used, - mc->last_render); - -- atomic_add(mc->used, &dev->counts[_DRM_STAT_SECONDARY]); -- atomic_inc(&dev->counts[_DRM_STAT_DMA]); -+ atomic_add_unchecked(mc->used, &dev->counts[_DRM_STAT_SECONDARY]); -+ atomic_inc_unchecked(&dev->counts[_DRM_STAT_DMA]); - sarea_priv->last_enqueue = dev_priv->counter - 1; - sarea_priv->last_dispatch = (int)hw_status[5]; - + if (minor->type == DRM_MINOR_CONTROL) diff --git a/drivers/gpu/drm/i810/i810_drv.h b/drivers/gpu/drm/i810/i810_drv.h index d4d16ed..8fb0b51 100644 --- a/drivers/gpu/drm/i810/i810_drv.h @@ -39061,20 +40000,20 @@ index d4d16ed..8fb0b51 100644 int front_offset; } drm_i810_private_t; diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c -index a6f4cb5..6b2beb2 100644 +index 6ed45a9..eb6dc41 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c -@@ -624,7 +624,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) +@@ -702,7 +702,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) I915_READ(GTIMR)); } seq_printf(m, "Interrupts received: %d\n", - atomic_read(&dev_priv->irq_received)); + atomic_read_unchecked(&dev_priv->irq_received)); for_each_ring(ring, dev_priv, i) { - if (IS_GEN6(dev) || IS_GEN7(dev)) { + if (INTEL_INFO(dev)->gen >= 6) { seq_printf(m, diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c -index 5a25f24..5af2004 100644 +index e02266a..e3411aa 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1271,7 +1271,7 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev) @@ -39087,10 +40026,10 @@ index 5a25f24..5af2004 100644 return can_switch; } diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h -index ab0f2c0..53c1bda 100644 +index 221ac62..f56acc8 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h -@@ -1181,7 +1181,7 @@ typedef struct drm_i915_private { +@@ -1326,7 +1326,7 @@ typedef struct drm_i915_private { drm_dma_handle_t *status_page_dmah; struct resource mch_res; @@ -39100,10 +40039,10 @@ index ab0f2c0..53c1bda 100644 /* protects the irq masks */ spinlock_t irq_lock; diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c -index bf34577..3fd2ffa 100644 +index a3ba9a8..ee52ddd 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c -@@ -768,9 +768,9 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec) +@@ -861,9 +861,9 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec) static int validate_exec_list(struct drm_i915_gem_exec_object2 *exec, @@ -39112,8 +40051,8 @@ index bf34577..3fd2ffa 100644 { - int i; + unsigned int i; - int relocs_total = 0; - int relocs_max = INT_MAX / sizeof(struct drm_i915_gem_relocation_entry); + unsigned relocs_total = 0; + unsigned relocs_max = UINT_MAX / sizeof(struct drm_i915_gem_relocation_entry); diff --git a/drivers/gpu/drm/i915/i915_ioc32.c b/drivers/gpu/drm/i915/i915_ioc32.c index 3c59584..500f2e9 100644 @@ -39151,10 +40090,10 @@ index 3c59584..500f2e9 100644 return ret; diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c -index 4b91228..590c643 100644 +index a209177..842a89a 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c -@@ -1085,7 +1085,7 @@ static irqreturn_t valleyview_irq_handler(int irq, void *arg) +@@ -1419,7 +1419,7 @@ static irqreturn_t valleyview_irq_handler(int irq, void *arg) int pipe; u32 pipe_stats[I915_MAX_PIPES]; @@ -39163,16 +40102,25 @@ index 4b91228..590c643 100644 while (true) { iir = I915_READ(VLV_IIR); -@@ -1390,7 +1390,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg) +@@ -1729,7 +1729,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg) + u32 de_iir, gt_iir, de_ier, sde_ier = 0; irqreturn_t ret = IRQ_NONE; - bool err_int_reenable = false; - atomic_inc(&dev_priv->irq_received); + atomic_inc_unchecked(&dev_priv->irq_received); /* We get interrupts on unclaimed registers, so check for this before we * do any I915_{READ,WRITE}. */ -@@ -2146,7 +2146,7 @@ static void ironlake_irq_preinstall(struct drm_device *dev) +@@ -1799,7 +1799,7 @@ static irqreturn_t gen8_irq_handler(int irq, void *arg) + uint32_t tmp = 0; + enum pipe pipe; + +- atomic_inc(&dev_priv->irq_received); ++ atomic_inc_unchecked(&dev_priv->irq_received); + + master_ctl = I915_READ(GEN8_MASTER_IRQ); + master_ctl &= ~GEN8_MASTER_IRQ_CONTROL; +@@ -2623,7 +2623,7 @@ static void ironlake_irq_preinstall(struct drm_device *dev) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; @@ -39181,7 +40129,7 @@ index 4b91228..590c643 100644 I915_WRITE(HWSTAM, 0xeffe); -@@ -2164,7 +2164,7 @@ static void valleyview_irq_preinstall(struct drm_device *dev) +@@ -2641,7 +2641,7 @@ static void valleyview_irq_preinstall(struct drm_device *dev) drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int pipe; @@ -39190,7 +40138,25 @@ index 4b91228..590c643 100644 /* VLV magic */ I915_WRITE(VLV_IMR, 0); -@@ -2452,7 +2452,7 @@ static void i8xx_irq_preinstall(struct drm_device * dev) +@@ -2672,7 +2672,7 @@ static void gen8_irq_preinstall(struct drm_device *dev) + struct drm_i915_private *dev_priv = dev->dev_private; + int pipe; + +- atomic_set(&dev_priv->irq_received, 0); ++ atomic_set_unchecked(&dev_priv->irq_received, 0); + + I915_WRITE(GEN8_MASTER_IRQ, 0); + POSTING_READ(GEN8_MASTER_IRQ); +@@ -2998,7 +2998,7 @@ static void gen8_irq_uninstall(struct drm_device *dev) + if (!dev_priv) + return; + +- atomic_set(&dev_priv->irq_received, 0); ++ atomic_set_unchecked(&dev_priv->irq_received, 0); + + I915_WRITE(GEN8_MASTER_IRQ, 0); + +@@ -3092,7 +3092,7 @@ static void i8xx_irq_preinstall(struct drm_device * dev) drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int pipe; @@ -39199,7 +40165,7 @@ index 4b91228..590c643 100644 for_each_pipe(pipe) I915_WRITE(PIPESTAT(pipe), 0); -@@ -2530,7 +2530,7 @@ static irqreturn_t i8xx_irq_handler(int irq, void *arg) +@@ -3178,7 +3178,7 @@ static irqreturn_t i8xx_irq_handler(int irq, void *arg) I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT | I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT; @@ -39208,7 +40174,7 @@ index 4b91228..590c643 100644 iir = I915_READ16(IIR); if (iir == 0) -@@ -2604,7 +2604,7 @@ static void i915_irq_preinstall(struct drm_device * dev) +@@ -3253,7 +3253,7 @@ static void i915_irq_preinstall(struct drm_device * dev) drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int pipe; @@ -39217,7 +40183,7 @@ index 4b91228..590c643 100644 if (I915_HAS_HOTPLUG(dev)) { I915_WRITE(PORT_HOTPLUG_EN, 0); -@@ -2703,7 +2703,7 @@ static irqreturn_t i915_irq_handler(int irq, void *arg) +@@ -3360,7 +3360,7 @@ static irqreturn_t i915_irq_handler(int irq, void *arg) I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT; int pipe, ret = IRQ_NONE; @@ -39226,7 +40192,7 @@ index 4b91228..590c643 100644 iir = I915_READ(IIR); do { -@@ -2827,7 +2827,7 @@ static void i965_irq_preinstall(struct drm_device * dev) +@@ -3487,7 +3487,7 @@ static void i965_irq_preinstall(struct drm_device * dev) drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int pipe; @@ -39235,7 +40201,7 @@ index 4b91228..590c643 100644 I915_WRITE(PORT_HOTPLUG_EN, 0); I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT)); -@@ -2941,7 +2941,7 @@ static irqreturn_t i965_irq_handler(int irq, void *arg) +@@ -3603,7 +3603,7 @@ static irqreturn_t i965_irq_handler(int irq, void *arg) I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT | I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT; @@ -39245,10 +40211,10 @@ index 4b91228..590c643 100644 iir = I915_READ(IIR); diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c -index aad6f7b..dcc91447 100644 +index 3c5ff7a..ae759ca 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c -@@ -10019,13 +10019,13 @@ struct intel_quirk { +@@ -10506,13 +10506,13 @@ struct intel_quirk { int subsystem_vendor; int subsystem_device; void (*hook)(struct drm_device *dev); @@ -39264,7 +40230,7 @@ index aad6f7b..dcc91447 100644 static int intel_dmi_reverse_brightness(const struct dmi_system_id *id) { -@@ -10033,18 +10033,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id) +@@ -10520,18 +10520,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id) return 1; } @@ -39347,7 +40313,7 @@ index 709e90d..89a1c0d 100644 return ret; diff --git a/drivers/gpu/drm/mga/mga_irq.c b/drivers/gpu/drm/mga/mga_irq.c -index 598c281..60d590e 100644 +index 2b0ceb8..517e99e 100644 --- a/drivers/gpu/drm/mga/mga_irq.c +++ b/drivers/gpu/drm/mga/mga_irq.c @@ -43,7 +43,7 @@ u32 mga_get_vblank_counter(struct drm_device *dev, int crtc) @@ -39387,7 +40353,7 @@ index 598c281..60d590e 100644 *sequence = cur_fence; diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c -index 3e72876..d1c15ad 100644 +index 4c3feaa..26391ce 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c @@ -965,7 +965,7 @@ static int parse_bit_tmds_tbl_entry(struct drm_device *dev, struct nvbios *bios, @@ -39400,10 +40366,10 @@ index 3e72876..d1c15ad 100644 #define BIT_TABLE(id, funcid) ((struct bit_table){ id, parse_bit_##funcid##_tbl_entry }) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.h b/drivers/gpu/drm/nouveau/nouveau_drm.h -index 994fd6e..6e12565 100644 +index 4b0fb6c..67667a9 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.h +++ b/drivers/gpu/drm/nouveau/nouveau_drm.h -@@ -94,7 +94,6 @@ struct nouveau_drm { +@@ -96,7 +96,6 @@ struct nouveau_drm { struct drm_global_reference mem_global_ref; struct ttm_bo_global_ref bo_global_ref; struct ttm_bo_device bdev; @@ -39424,6 +40390,61 @@ index c1a7e5a..38b8539 100644 int ret; if (nr < DRM_COMMAND_BASE) +diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c +index 19e3757..ad16478 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c ++++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c +@@ -130,11 +130,11 @@ nouveau_vram_manager_debug(struct ttm_mem_type_manager *man, const char *prefix) + } + + const struct ttm_mem_type_manager_func nouveau_vram_manager = { +- nouveau_vram_manager_init, +- nouveau_vram_manager_fini, +- nouveau_vram_manager_new, +- nouveau_vram_manager_del, +- nouveau_vram_manager_debug ++ .init = nouveau_vram_manager_init, ++ .takedown = nouveau_vram_manager_fini, ++ .get_node = nouveau_vram_manager_new, ++ .put_node = nouveau_vram_manager_del, ++ .debug = nouveau_vram_manager_debug + }; + + static int +@@ -198,11 +198,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix) + } + + const struct ttm_mem_type_manager_func nouveau_gart_manager = { +- nouveau_gart_manager_init, +- nouveau_gart_manager_fini, +- nouveau_gart_manager_new, +- nouveau_gart_manager_del, +- nouveau_gart_manager_debug ++ .init = nouveau_gart_manager_init, ++ .takedown = nouveau_gart_manager_fini, ++ .get_node = nouveau_gart_manager_new, ++ .put_node = nouveau_gart_manager_del, ++ .debug = nouveau_gart_manager_debug + }; + + #include +@@ -270,11 +270,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix) + } + + const struct ttm_mem_type_manager_func nv04_gart_manager = { +- nv04_gart_manager_init, +- nv04_gart_manager_fini, +- nv04_gart_manager_new, +- nv04_gart_manager_del, +- nv04_gart_manager_debug ++ .init = nv04_gart_manager_init, ++ .takedown = nv04_gart_manager_fini, ++ .get_node = nv04_gart_manager_new, ++ .put_node = nv04_gart_manager_del, ++ .debug = nv04_gart_manager_debug + }; + + int diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c index 81638d7..2e45854 100644 --- a/drivers/gpu/drm/nouveau/nouveau_vga.c @@ -39495,7 +40516,7 @@ index c3c2bbd..bc3c0fb 100644 return 0; } diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h -index f7c9add..fb971d2 100644 +index 7bda32f..dd98fc5 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.h +++ b/drivers/gpu/drm/qxl/qxl_drv.h @@ -290,10 +290,10 @@ struct qxl_device { @@ -39513,6 +40534,37 @@ index f7c9add..fb971d2 100644 unsigned irq_received_error; wait_queue_head_t display_event; wait_queue_head_t cursor_event; +diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c +index 7b95c75..9cffb4f 100644 +--- a/drivers/gpu/drm/qxl/qxl_ioctl.c ++++ b/drivers/gpu/drm/qxl/qxl_ioctl.c +@@ -181,7 +181,7 @@ static int qxl_process_single_command(struct qxl_device *qdev, + + /* TODO copy slow path code from i915 */ + fb_cmd = qxl_bo_kmap_atomic_page(qdev, cmd_bo, (release->release_offset & PAGE_SIZE)); +- unwritten = __copy_from_user_inatomic_nocache(fb_cmd + sizeof(union qxl_release_info) + (release->release_offset & ~PAGE_SIZE), (void *)(unsigned long)cmd->command, cmd->command_size); ++ unwritten = __copy_from_user_inatomic_nocache(fb_cmd + sizeof(union qxl_release_info) + (release->release_offset & ~PAGE_SIZE), (void __force_user *)(unsigned long)cmd->command, cmd->command_size); + + { + struct qxl_drawable *draw = fb_cmd; +@@ -201,7 +201,7 @@ static int qxl_process_single_command(struct qxl_device *qdev, + struct drm_qxl_reloc reloc; + + if (DRM_COPY_FROM_USER(&reloc, +- &((struct drm_qxl_reloc *)(uintptr_t)cmd->relocs)[i], ++ &((struct drm_qxl_reloc __force_user *)(uintptr_t)cmd->relocs)[i], + sizeof(reloc))) { + ret = -EFAULT; + goto out_free_bos; +@@ -297,7 +297,7 @@ static int qxl_execbuffer_ioctl(struct drm_device *dev, void *data, + struct drm_qxl_command *commands = + (struct drm_qxl_command *)(uintptr_t)execbuffer->commands; + +- if (DRM_COPY_FROM_USER(&user_cmd, &commands[cmd_num], ++ if (DRM_COPY_FROM_USER(&user_cmd, (struct drm_qxl_command __force_user *)&commands[cmd_num], + sizeof(user_cmd))) + return -EFAULT; + diff --git a/drivers/gpu/drm/qxl/qxl_irq.c b/drivers/gpu/drm/qxl/qxl_irq.c index 21393dc..329f3a9 100644 --- a/drivers/gpu/drm/qxl/qxl_irq.c @@ -39557,7 +40609,7 @@ index 21393dc..329f3a9 100644 ret = drm_irq_install(qdev->ddev); 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 037786d..2a95e33 100644 +index c7e7e65..7dddd4d 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) @@ -39580,7 +40632,7 @@ index 037786d..2a95e33 100644 } vma->vm_ops = &qxl_ttm_vm_ops; return 0; -@@ -558,25 +560,23 @@ static int qxl_mm_dump_table(struct seq_file *m, void *data) +@@ -560,25 +562,23 @@ static int qxl_mm_dump_table(struct seq_file *m, void *data) static int qxl_ttm_debugfs_init(struct qxl_device *qdev) { #if defined(CONFIG_DEBUG_FS) @@ -39751,10 +40803,10 @@ index af85299..ed9ac8d 100644 if (regcomp (&mask_rex, "(0x[0-9a-fA-F]*) *([_a-zA-Z0-9]*)", REG_EXTENDED)) { diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c -index 841d0e0..9eaa268 100644 +index 39b033b..6efc056 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c -@@ -1117,7 +1117,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev) +@@ -1120,7 +1120,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev) bool can_switch; spin_lock(&dev->count_lock); @@ -39764,10 +40816,10 @@ index 841d0e0..9eaa268 100644 return can_switch; } diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h -index b369d42..8dd04eb 100644 +index 00e0d44..08381a4 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.h +++ b/drivers/gpu/drm/radeon/radeon_drv.h -@@ -258,7 +258,7 @@ typedef struct drm_radeon_private { +@@ -262,7 +262,7 @@ typedef struct drm_radeon_private { /* SW interrupt */ wait_queue_head_t swi_queue; @@ -39777,7 +40829,7 @@ index b369d42..8dd04eb 100644 uint32_t irq_enable_reg; uint32_t r500_disp_irq_reg; diff --git a/drivers/gpu/drm/radeon/radeon_ioc32.c b/drivers/gpu/drm/radeon/radeon_ioc32.c -index c180df8..5fd8186 100644 +index bdb0f93..5ff558f 100644 --- a/drivers/gpu/drm/radeon/radeon_ioc32.c +++ b/drivers/gpu/drm/radeon/radeon_ioc32.c @@ -358,7 +358,7 @@ static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd, @@ -39867,10 +40919,10 @@ index 4d20910..6726b6d 100644 DRM_DEBUG("pid=%d\n", DRM_CURRENTPID); diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c -index 71245d6..94c556d 100644 +index 84323c9..cf07baf 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c -@@ -784,7 +784,7 @@ void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size) +@@ -787,7 +787,7 @@ void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size) man->size = size >> PAGE_SHIFT; } @@ -39879,7 +40931,7 @@ index 71245d6..94c556d 100644 static const struct vm_operations_struct *ttm_vm_ops = NULL; static int radeon_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) -@@ -825,8 +825,10 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma) +@@ -828,8 +828,10 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma) } if (unlikely(ttm_vm_ops == NULL)) { ttm_vm_ops = vma->vm_ops; @@ -39890,7 +40942,7 @@ index 71245d6..94c556d 100644 } vma->vm_ops = &radeon_ttm_vm_ops; return 0; -@@ -855,38 +857,33 @@ static int radeon_mm_dump_table(struct seq_file *m, void *data) +@@ -858,38 +860,33 @@ static int radeon_mm_dump_table(struct seq_file *m, void *data) static int radeon_ttm_debugfs_init(struct radeon_device *rdev) { #if defined(CONFIG_DEBUG_FS) @@ -39954,23 +41006,52 @@ index 71245d6..94c556d 100644 #endif return radeon_debugfs_add_files(rdev, radeon_mem_types_list, i); -diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c -index 3c38f0a..13816e3 100644 ---- a/drivers/gpu/drm/radeon/rs690.c -+++ b/drivers/gpu/drm/radeon/rs690.c -@@ -355,9 +355,11 @@ static void rs690_crtc_bandwidth_compute(struct radeon_device *rdev, - if (max_bandwidth.full > rdev->pm.sideport_bandwidth.full && - rdev->pm.sideport_bandwidth.full) - max_bandwidth = rdev->pm.sideport_bandwidth; -- read_delay_latency.full = dfixed_const(370 * 800 * 1000); -+ read_delay_latency.full = dfixed_const(800 * 1000); - read_delay_latency.full = dfixed_div(read_delay_latency, - rdev->pm.igp_sideport_mclk); -+ a.full = dfixed_const(370); -+ read_delay_latency.full = dfixed_mul(read_delay_latency, a); - } else { - if (max_bandwidth.full > rdev->pm.k8_bandwidth.full && - rdev->pm.k8_bandwidth.full) +diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c +index ae1cb31..5b5b6b7c 100644 +--- a/drivers/gpu/drm/tegra/dc.c ++++ b/drivers/gpu/drm/tegra/dc.c +@@ -1064,7 +1064,7 @@ static int tegra_dc_debugfs_init(struct tegra_dc *dc, struct drm_minor *minor) + } + + for (i = 0; i < ARRAY_SIZE(debugfs_files); i++) +- dc->debugfs_files[i].data = dc; ++ *(void **)&dc->debugfs_files[i].data = dc; + + err = drm_debugfs_create_files(dc->debugfs_files, + ARRAY_SIZE(debugfs_files), +diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c +index 0cd9bc2..9759be4 100644 +--- a/drivers/gpu/drm/tegra/hdmi.c ++++ b/drivers/gpu/drm/tegra/hdmi.c +@@ -57,7 +57,7 @@ struct tegra_hdmi { + bool stereo; + bool dvi; + +- struct drm_info_list *debugfs_files; ++ drm_info_list_no_const *debugfs_files; + struct drm_minor *minor; + struct dentry *debugfs; + }; +diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c +index c58eba33..83c2728 100644 +--- a/drivers/gpu/drm/ttm/ttm_bo_manager.c ++++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c +@@ -141,10 +141,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man, + } + + const struct ttm_mem_type_manager_func ttm_bo_manager_func = { +- ttm_bo_man_init, +- ttm_bo_man_takedown, +- ttm_bo_man_get_node, +- ttm_bo_man_put_node, +- ttm_bo_man_debug ++ .init = ttm_bo_man_init, ++ .takedown = ttm_bo_man_takedown, ++ .get_node = ttm_bo_man_get_node, ++ .put_node = ttm_bo_man_put_node, ++ .debug = ttm_bo_man_debug + }; + EXPORT_SYMBOL(ttm_bo_manager_func); diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index dbc2def..0a9f710 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c @@ -40118,10 +41199,10 @@ index ac98964..5dbf512 100644 case VIA_IRQ_ABSOLUTE: break; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h -index 150ec64..f5165f2 100644 +index c0b73b9..f6f7f34 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h -@@ -290,7 +290,7 @@ struct vmw_private { +@@ -341,7 +341,7 @@ struct vmw_private { * Fencing and IRQs. */ @@ -40170,11 +41251,30 @@ index 3eb1486..0a47ee9 100644 } while (*seqno == 0); if (!(fifo_state->capabilities & SVGA_FIFO_CAP_FENCE)) { +diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c +index c5c054a..46f0548 100644 +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c +@@ -153,9 +153,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man, + } + + const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = { +- vmw_gmrid_man_init, +- vmw_gmrid_man_takedown, +- vmw_gmrid_man_get_node, +- vmw_gmrid_man_put_node, +- vmw_gmrid_man_debug ++ .init = vmw_gmrid_man_init, ++ .takedown = vmw_gmrid_man_takedown, ++ .get_node = vmw_gmrid_man_get_node, ++ .put_node = vmw_gmrid_man_put_node, ++ .debug = vmw_gmrid_man_debug + }; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c -index c509d40..3b640c3 100644 +index 45d5b5a..f3f5e4e 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c -@@ -138,7 +138,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, +@@ -141,7 +141,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, int ret; num_clips = arg->num_clips; @@ -40183,7 +41283,7 @@ index c509d40..3b640c3 100644 if (unlikely(num_clips == 0)) return 0; -@@ -222,7 +222,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, +@@ -225,7 +225,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, int ret; num_clips = arg->num_clips; @@ -40227,19 +41327,6 @@ index 8a8725c2..afed796 100644 else { marker = list_first_entry(&queue->head, struct vmw_marker, head); -diff --git a/drivers/gpu/host1x/drm/dc.c b/drivers/gpu/host1x/drm/dc.c -index b1a05ad..1c9d899 100644 ---- a/drivers/gpu/host1x/drm/dc.c -+++ b/drivers/gpu/host1x/drm/dc.c -@@ -1004,7 +1004,7 @@ static int tegra_dc_debugfs_init(struct tegra_dc *dc, struct drm_minor *minor) - } - - for (i = 0; i < ARRAY_SIZE(debugfs_files); i++) -- dc->debugfs_files[i].data = dc; -+ *(void **)&dc->debugfs_files[i].data = dc; - - err = drm_debugfs_create_files(dc->debugfs_files, - ARRAY_SIZE(debugfs_files), diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index ec0ae2d..dc0780b 100644 --- a/drivers/gpu/vga/vga_switcheroo.c @@ -40263,7 +41350,7 @@ index ec0ae2d..dc0780b 100644 /* copy over all the bus versions */ if (dev->bus && dev->bus->pm) { diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c -index aedfe50..1dc929b 100644 +index 253fe23..0dfec5f 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2416,7 +2416,7 @@ EXPORT_SYMBOL_GPL(hid_ignore); @@ -40329,10 +41416,10 @@ index cedc6da..2c3da2a 100644 if (atomic_read(&uhid->report_done)) goto unlock; diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c -index 6de6c98..18319e9 100644 +index cea623c..73011b0 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c -@@ -406,8 +406,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer, +@@ -362,8 +362,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer, int ret = 0; int t; @@ -40344,7 +41431,7 @@ index 6de6c98..18319e9 100644 ret = create_gpadl_header(kbuffer, size, &msginfo, &msgcount); if (ret) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c -index 88f4096..e50452e 100644 +index f0c5e07..399256e 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -112,7 +112,7 @@ static u64 do_hypercall(u64 control, void *input, void *output) @@ -40442,10 +41529,10 @@ index 7e17a54..a50a33d 100644 cap_msg.caps.cap_bits.balloon = 1; cap_msg.caps.cap_bits.hot_add = 1; diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h -index d84918f..7f38f9f 100644 +index e055176..c22ff1f 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h -@@ -595,7 +595,7 @@ enum vmbus_connect_state { +@@ -602,7 +602,7 @@ enum vmbus_connect_state { struct vmbus_connection { enum vmbus_connect_state conn_state; @@ -40455,10 +41542,10 @@ index d84918f..7f38f9f 100644 /* * Represents channel interrupts. Each bit position represents a diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c -index f9fe46f..356b119 100644 +index 48aad4f..c768fb2 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c -@@ -672,10 +672,10 @@ int vmbus_device_register(struct hv_device *child_device_obj) +@@ -846,10 +846,10 @@ int vmbus_device_register(struct hv_device *child_device_obj) { int ret = 0; @@ -40472,7 +41559,7 @@ index f9fe46f..356b119 100644 child_device_obj->device.bus = &hv_bus; child_device_obj->device.parent = &hv_acpi_dev->dev; diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c -index a9e3d01..9dd246e 100644 +index 6a34f7f..aa4c3a6 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c @@ -117,7 +117,7 @@ struct sensor_template { @@ -40484,7 +41571,7 @@ index a9e3d01..9dd246e 100644 /* Averaging interval */ static int update_avg_interval(struct acpi_power_meter_resource *resource) -@@ -629,7 +629,7 @@ static int register_attrs(struct acpi_power_meter_resource *resource, +@@ -632,7 +632,7 @@ static int register_attrs(struct acpi_power_meter_resource *resource, struct sensor_template *attrs) { struct device *dev = &resource->acpi_dev->dev; @@ -40507,10 +41594,10 @@ index 3288f13..71cfb4e 100644 for (grp = groups; grp->format; grp++) { diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c -index b25c643..a13460d 100644 +index dafc63c..4abb96c 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c -@@ -152,10 +152,10 @@ MODULE_DEVICE_TABLE(acpi, atk_ids); +@@ -151,10 +151,10 @@ MODULE_DEVICE_TABLE(acpi, atk_ids); struct atk_sensor_data { struct list_head list; struct atk_data *data; @@ -40525,7 +41612,7 @@ index b25c643..a13460d 100644 char label_attr_name[ATTR_NAME_SIZE]; char input_attr_name[ATTR_NAME_SIZE]; char limit1_attr_name[ATTR_NAME_SIZE]; -@@ -275,7 +275,7 @@ static ssize_t atk_name_show(struct device *dev, +@@ -274,7 +274,7 @@ static ssize_t atk_name_show(struct device *dev, static struct device_attribute atk_name_attr = __ATTR(name, 0444, atk_name_show, NULL); @@ -40535,7 +41622,7 @@ index b25c643..a13460d 100644 { sysfs_attr_init(&attr->attr); diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c -index 78be661..4dd032f 100644 +index 9425098..7646cc5 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c @@ -797,7 +797,7 @@ static int coretemp_cpu_callback(struct notifier_block *nfb, @@ -40574,10 +41661,10 @@ index 708081b..fe2d4ab 100644 int in_i = 1, temp_i = 1, curr_i = 1; enum iio_chan_type type; diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c -index 6eb03ce..bea7e3e 100644 +index cf811c1..4c17110 100644 --- a/drivers/hwmon/nct6775.c +++ b/drivers/hwmon/nct6775.c -@@ -936,10 +936,10 @@ static struct attribute_group * +@@ -944,10 +944,10 @@ static struct attribute_group * nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg, int repeat) { @@ -40590,12 +41677,12 @@ index 6eb03ce..bea7e3e 100644 + sensor_device_attribute_2_no_const *a2; struct attribute **attrs; struct sensor_device_template **t; - int err, i, j, count; + int i, count; diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c -index 9319fcf..189ff45 100644 +index 3cbf66e..8c5cc2a 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c -@@ -781,7 +781,7 @@ static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr) +@@ -782,7 +782,7 @@ static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr) return 0; } @@ -40604,7 +41691,7 @@ index 9319fcf..189ff45 100644 const char *name, umode_t mode, ssize_t (*show)(struct device *dev, -@@ -798,7 +798,7 @@ static void pmbus_dev_attr_init(struct device_attribute *dev_attr, +@@ -799,7 +799,7 @@ static void pmbus_dev_attr_init(struct device_attribute *dev_attr, dev_attr->store = store; } @@ -40613,7 +41700,7 @@ index 9319fcf..189ff45 100644 const char *name, umode_t mode, ssize_t (*show)(struct device *dev, -@@ -820,7 +820,7 @@ static int pmbus_add_boolean(struct pmbus_data *data, +@@ -821,7 +821,7 @@ static int pmbus_add_boolean(struct pmbus_data *data, u16 reg, u8 mask) { struct pmbus_boolean *boolean; @@ -40622,7 +41709,7 @@ index 9319fcf..189ff45 100644 boolean = devm_kzalloc(data->dev, sizeof(*boolean), GFP_KERNEL); if (!boolean) -@@ -845,7 +845,7 @@ static struct pmbus_sensor *pmbus_add_sensor(struct pmbus_data *data, +@@ -846,7 +846,7 @@ static struct pmbus_sensor *pmbus_add_sensor(struct pmbus_data *data, bool update, bool readonly) { struct pmbus_sensor *sensor; @@ -40631,7 +41718,7 @@ index 9319fcf..189ff45 100644 sensor = devm_kzalloc(data->dev, sizeof(*sensor), GFP_KERNEL); if (!sensor) -@@ -876,7 +876,7 @@ static int pmbus_add_label(struct pmbus_data *data, +@@ -877,7 +877,7 @@ static int pmbus_add_label(struct pmbus_data *data, const char *lstring, int index) { struct pmbus_label *label; @@ -40719,10 +41806,10 @@ index 07f01ac..d79ad3d 100644 /* Wrapper access functions for multiplexed SMBus */ static DEFINE_MUTEX(amd756_lock); diff --git a/drivers/i2c/busses/i2c-diolan-u2c.c b/drivers/i2c/busses/i2c-diolan-u2c.c -index dae3ddf..26e21d1 100644 +index 721f7eb..0fd2a09 100644 --- a/drivers/i2c/busses/i2c-diolan-u2c.c +++ b/drivers/i2c/busses/i2c-diolan-u2c.c -@@ -99,7 +99,7 @@ MODULE_PARM_DESC(frequency, "I2C clock frequency in hertz"); +@@ -98,7 +98,7 @@ MODULE_PARM_DESC(frequency, "I2C clock frequency in hertz"); /* usb layer */ /* Send command to device, and get response. */ @@ -40745,10 +41832,10 @@ index 2ca268d..c6acbdf 100644 /* Wrapper access functions for multiplexed SMBus */ static DEFINE_MUTEX(nforce2_lock); diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c -index c3ccdea..5b3dc1a 100644 +index 80b47e8..1a6040d9 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c -@@ -271,7 +271,7 @@ static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client, +@@ -277,7 +277,7 @@ static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client, break; } @@ -40771,10 +41858,10 @@ index 0b510ba..4fbb5085 100644 } } diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c -index f95c697..0a1b05c 100644 +index 18f72e3..3722327 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c -@@ -506,7 +506,7 @@ static ssize_t iio_write_channel_info(struct device *dev, +@@ -521,7 +521,7 @@ static ssize_t iio_write_channel_info(struct device *dev, } static @@ -40784,7 +41871,7 @@ index f95c697..0a1b05c 100644 struct iio_chan_spec const *chan, ssize_t (*readfunc)(struct device *dev, diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c -index 784b97c..c9ceadf 100644 +index f2ef7ef..743d02f 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -114,7 +114,7 @@ static char const counter_group_names[CM_COUNTER_GROUPS] @@ -40796,7 +41883,7 @@ index 784b97c..c9ceadf 100644 }; struct cm_counter_attribute { -@@ -1395,7 +1395,7 @@ static void cm_dup_req_handler(struct cm_work *work, +@@ -1392,7 +1392,7 @@ static void cm_dup_req_handler(struct cm_work *work, struct ib_mad_send_buf *msg = NULL; int ret; @@ -40805,7 +41892,7 @@ index 784b97c..c9ceadf 100644 counter[CM_REQ_COUNTER]); /* Quick state check to discard duplicate REQs. */ -@@ -1779,7 +1779,7 @@ static void cm_dup_rep_handler(struct cm_work *work) +@@ -1776,7 +1776,7 @@ static void cm_dup_rep_handler(struct cm_work *work) if (!cm_id_priv) return; @@ -40814,7 +41901,7 @@ index 784b97c..c9ceadf 100644 counter[CM_REP_COUNTER]); ret = cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg); if (ret) -@@ -1946,7 +1946,7 @@ static int cm_rtu_handler(struct cm_work *work) +@@ -1943,7 +1943,7 @@ static int cm_rtu_handler(struct cm_work *work) if (cm_id_priv->id.state != IB_CM_REP_SENT && cm_id_priv->id.state != IB_CM_MRA_REP_RCVD) { spin_unlock_irq(&cm_id_priv->lock); @@ -40823,7 +41910,7 @@ index 784b97c..c9ceadf 100644 counter[CM_RTU_COUNTER]); goto out; } -@@ -2129,7 +2129,7 @@ static int cm_dreq_handler(struct cm_work *work) +@@ -2126,7 +2126,7 @@ static int cm_dreq_handler(struct cm_work *work) cm_id_priv = cm_acquire_id(dreq_msg->remote_comm_id, dreq_msg->local_comm_id); if (!cm_id_priv) { @@ -40832,7 +41919,7 @@ index 784b97c..c9ceadf 100644 counter[CM_DREQ_COUNTER]); cm_issue_drep(work->port, work->mad_recv_wc); return -EINVAL; -@@ -2154,7 +2154,7 @@ static int cm_dreq_handler(struct cm_work *work) +@@ -2151,7 +2151,7 @@ static int cm_dreq_handler(struct cm_work *work) case IB_CM_MRA_REP_RCVD: break; case IB_CM_TIMEWAIT: @@ -40841,7 +41928,7 @@ index 784b97c..c9ceadf 100644 counter[CM_DREQ_COUNTER]); if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg)) goto unlock; -@@ -2168,7 +2168,7 @@ static int cm_dreq_handler(struct cm_work *work) +@@ -2165,7 +2165,7 @@ static int cm_dreq_handler(struct cm_work *work) cm_free_msg(msg); goto deref; case IB_CM_DREQ_RCVD: @@ -40850,7 +41937,7 @@ index 784b97c..c9ceadf 100644 counter[CM_DREQ_COUNTER]); goto unlock; default: -@@ -2535,7 +2535,7 @@ static int cm_mra_handler(struct cm_work *work) +@@ -2532,7 +2532,7 @@ static int cm_mra_handler(struct cm_work *work) ib_modify_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg, timeout)) { if (cm_id_priv->id.lap_state == IB_CM_MRA_LAP_RCVD) @@ -40859,7 +41946,7 @@ index 784b97c..c9ceadf 100644 counter_group[CM_RECV_DUPLICATES]. counter[CM_MRA_COUNTER]); goto out; -@@ -2544,7 +2544,7 @@ static int cm_mra_handler(struct cm_work *work) +@@ -2541,7 +2541,7 @@ static int cm_mra_handler(struct cm_work *work) break; case IB_CM_MRA_REQ_RCVD: case IB_CM_MRA_REP_RCVD: @@ -40868,7 +41955,7 @@ index 784b97c..c9ceadf 100644 counter[CM_MRA_COUNTER]); /* fall through */ default: -@@ -2706,7 +2706,7 @@ static int cm_lap_handler(struct cm_work *work) +@@ -2703,7 +2703,7 @@ static int cm_lap_handler(struct cm_work *work) case IB_CM_LAP_IDLE: break; case IB_CM_MRA_LAP_SENT: @@ -40877,7 +41964,7 @@ index 784b97c..c9ceadf 100644 counter[CM_LAP_COUNTER]); if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg)) goto unlock; -@@ -2722,7 +2722,7 @@ static int cm_lap_handler(struct cm_work *work) +@@ -2719,7 +2719,7 @@ static int cm_lap_handler(struct cm_work *work) cm_free_msg(msg); goto deref; case IB_CM_LAP_RCVD: @@ -40886,7 +41973,7 @@ index 784b97c..c9ceadf 100644 counter[CM_LAP_COUNTER]); goto unlock; default: -@@ -3006,7 +3006,7 @@ static int cm_sidr_req_handler(struct cm_work *work) +@@ -3003,7 +3003,7 @@ static int cm_sidr_req_handler(struct cm_work *work) cur_cm_id_priv = cm_insert_remote_sidr(cm_id_priv); if (cur_cm_id_priv) { spin_unlock_irq(&cm.lock); @@ -40895,7 +41982,7 @@ index 784b97c..c9ceadf 100644 counter[CM_SIDR_REQ_COUNTER]); goto out; /* Duplicate message. */ } -@@ -3218,10 +3218,10 @@ static void cm_send_handler(struct ib_mad_agent *mad_agent, +@@ -3215,10 +3215,10 @@ static void cm_send_handler(struct ib_mad_agent *mad_agent, if (!msg->context[0] && (attr_index != CM_REJ_COUNTER)) msg->retries = 1; @@ -40908,7 +41995,7 @@ index 784b97c..c9ceadf 100644 &port->counter_group[CM_XMIT_RETRIES]. counter[attr_index]); -@@ -3431,7 +3431,7 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent, +@@ -3428,7 +3428,7 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent, } attr_id = be16_to_cpu(mad_recv_wc->recv_buf.mad->mad_hdr.attr_id); @@ -40917,7 +42004,7 @@ index 784b97c..c9ceadf 100644 counter[attr_id - CM_ATTR_ID_OFFSET]); work = kmalloc(sizeof *work + sizeof(struct ib_sa_path_rec) * paths, -@@ -3636,7 +3636,7 @@ static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr, +@@ -3633,7 +3633,7 @@ static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr, cm_attr = container_of(attr, struct cm_counter_attribute, attr); return sprintf(buf, "%ld\n", @@ -40998,7 +42085,7 @@ index 9f5ad7c..588cd84 100644 } } diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c -index 4cb8eb2..146bf60 100644 +index 84e4500..2c9beeb 100644 --- a/drivers/infiniband/hw/cxgb4/mem.c +++ b/drivers/infiniband/hw/cxgb4/mem.c @@ -249,7 +249,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry, @@ -41019,6 +42106,41 @@ index 4cb8eb2..146bf60 100644 } PDBG("%s stag_state 0x%0x type 0x%0x pdid 0x%0x, stag_idx 0x%x\n", __func__, stag_state, type, pdid, stag_idx); +diff --git a/drivers/infiniband/hw/ipath/ipath_dma.c b/drivers/infiniband/hw/ipath/ipath_dma.c +index 644c2c7..ecf0879 100644 +--- a/drivers/infiniband/hw/ipath/ipath_dma.c ++++ b/drivers/infiniband/hw/ipath/ipath_dma.c +@@ -176,17 +176,17 @@ static void ipath_dma_free_coherent(struct ib_device *dev, size_t size, + } + + struct ib_dma_mapping_ops ipath_dma_mapping_ops = { +- ipath_mapping_error, +- ipath_dma_map_single, +- ipath_dma_unmap_single, +- ipath_dma_map_page, +- ipath_dma_unmap_page, +- ipath_map_sg, +- ipath_unmap_sg, +- ipath_sg_dma_address, +- ipath_sg_dma_len, +- ipath_sync_single_for_cpu, +- ipath_sync_single_for_device, +- ipath_dma_alloc_coherent, +- ipath_dma_free_coherent ++ .mapping_error = ipath_mapping_error, ++ .map_single = ipath_dma_map_single, ++ .unmap_single = ipath_dma_unmap_single, ++ .map_page = ipath_dma_map_page, ++ .unmap_page = ipath_dma_unmap_page, ++ .map_sg = ipath_map_sg, ++ .unmap_sg = ipath_unmap_sg, ++ .dma_address = ipath_sg_dma_address, ++ .dma_len = ipath_sg_dma_len, ++ .sync_single_for_cpu = ipath_sync_single_for_cpu, ++ .sync_single_for_device = ipath_sync_single_for_device, ++ .alloc_coherent = ipath_dma_alloc_coherent, ++ .free_coherent = ipath_dma_free_coherent + }; diff --git a/drivers/infiniband/hw/ipath/ipath_rc.c b/drivers/infiniband/hw/ipath/ipath_rc.c index 79b3dbc..96e5fcc 100644 --- a/drivers/infiniband/hw/ipath/ipath_rc.c @@ -41291,7 +42413,7 @@ index 33cc589..3bd6538 100644 extern u32 int_mod_timer_init; extern u32 int_mod_cq_depth_256; diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c -index 6b29249..57081dd 100644 +index 6b29249..461d143 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -68,14 +68,14 @@ u32 cm_packets_dropped; @@ -41316,7 +42438,33 @@ index 6b29249..57081dd 100644 static inline int mini_cm_accelerated(struct nes_cm_core *, struct nes_cm_node *); static struct nes_cm_listener *mini_cm_listen(struct nes_cm_core *, struct nes_vnic *, struct nes_cm_info *); -@@ -148,13 +148,13 @@ static struct nes_cm_ops nes_cm_api = { +@@ -133,28 +133,28 @@ static void print_core(struct nes_cm_core *core); + /* instance of function pointers for client API */ + /* set address of this instance to cm_core->cm_ops at cm_core alloc */ + static struct nes_cm_ops nes_cm_api = { +- mini_cm_accelerated, +- mini_cm_listen, +- mini_cm_del_listen, +- mini_cm_connect, +- mini_cm_close, +- mini_cm_accept, +- mini_cm_reject, +- mini_cm_recv_pkt, +- mini_cm_dealloc_core, +- mini_cm_get, +- mini_cm_set ++ .accelerated = mini_cm_accelerated, ++ .listen = mini_cm_listen, ++ .stop_listener = mini_cm_del_listen, ++ .connect = mini_cm_connect, ++ .close = mini_cm_close, ++ .accept = mini_cm_accept, ++ .reject = mini_cm_reject, ++ .recv_pkt = mini_cm_recv_pkt, ++ .destroy_cm_core = mini_cm_dealloc_core, ++ .get = mini_cm_get, ++ .set = mini_cm_set + }; static struct nes_cm_core *g_cm_core; @@ -41588,7 +42736,7 @@ index 49eb511..a774366 100644 /** diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c -index 5b53ca5..443da3c 100644 +index 8308e36..ae0d3b5 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c @@ -46,9 +46,9 @@ @@ -41635,10 +42783,10 @@ index 1946101..09766d2 100644 #include "qib_common.h" #include "qib_verbs.h" diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c -index 922a7fe..bb035db 100644 +index 24c41ba..102d71f 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c -@@ -487,14 +487,14 @@ EXPORT_SYMBOL(gameport_set_phys); +@@ -490,14 +490,14 @@ EXPORT_SYMBOL(gameport_set_phys); */ static void gameport_init_port(struct gameport *gameport) { @@ -41656,7 +42804,7 @@ index 922a7fe..bb035db 100644 gameport->dev.release = gameport_release_port; if (gameport->parent) diff --git a/drivers/input/input.c b/drivers/input/input.c -index 74f4798..d9f7168 100644 +index d2965e4..f52b7d7 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1734,7 +1734,7 @@ EXPORT_SYMBOL_GPL(input_class); @@ -41760,10 +42908,10 @@ index 4c842c3..590b0bf 100644 return count; diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c -index 2b56855..5a55837 100644 +index 8f4c4ab..5fc8a45 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c -@@ -496,7 +496,7 @@ static void serio_release_port(struct device *dev) +@@ -505,7 +505,7 @@ static void serio_release_port(struct device *dev) */ static void serio_init_port(struct serio *serio) { @@ -41772,7 +42920,7 @@ index 2b56855..5a55837 100644 __module_get(THIS_MODULE); -@@ -507,7 +507,7 @@ static void serio_init_port(struct serio *serio) +@@ -516,7 +516,7 @@ static void serio_init_port(struct serio *serio) mutex_init(&serio->drv_mutex); device_initialize(&serio->dev); dev_set_name(&serio->dev, "serio%ld", @@ -41804,10 +42952,10 @@ index 59df2e7..8f1cafb 100644 INIT_LIST_HEAD(&serio_raw->client_list); init_waitqueue_head(&serio_raw->wait); diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c -index fbe9ca7..dbee61d 100644 +index e5555fc..937986d 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c -@@ -583,7 +583,7 @@ static struct notifier_block iommu_bus_nb = { +@@ -588,7 +588,7 @@ static struct notifier_block iommu_bus_nb = { static void iommu_bus_init(struct bus_type *bus, struct iommu_ops *ops) { bus_register_notifier(bus, &iommu_bus_nb); @@ -41847,7 +42995,7 @@ index 39f81ae..2660096 100644 bool setup_remapped_irq(int irq, struct irq_cfg *cfg, struct irq_chip *chip) diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c -index d0e9480..d2b6340 100644 +index 341c601..e5f407e 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -84,7 +84,7 @@ static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly; @@ -41859,7 +43007,7 @@ index d0e9480..d2b6340 100644 .irq_eoi = NULL, .irq_mask = NULL, .irq_unmask = NULL, -@@ -333,7 +333,7 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) +@@ -332,7 +332,7 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) chained_irq_exit(chip, desc); } @@ -41909,6 +43057,49 @@ index ac6f72b..81150f2 100644 capimsg_setu32(skb->data, 8, mp->ncci); /* NCCI */ capimsg_setu32(skb->data, 12, (u32)(long)skb->data);/* Data32 */ capimsg_setu16(skb->data, 16, len); /* Data length */ +diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c +index c44950d..10ac276 100644 +--- a/drivers/isdn/gigaset/bas-gigaset.c ++++ b/drivers/isdn/gigaset/bas-gigaset.c +@@ -2564,22 +2564,22 @@ static int gigaset_post_reset(struct usb_interface *intf) + + + static const struct gigaset_ops gigops = { +- gigaset_write_cmd, +- gigaset_write_room, +- gigaset_chars_in_buffer, +- gigaset_brkchars, +- gigaset_init_bchannel, +- gigaset_close_bchannel, +- gigaset_initbcshw, +- gigaset_freebcshw, +- gigaset_reinitbcshw, +- gigaset_initcshw, +- gigaset_freecshw, +- gigaset_set_modem_ctrl, +- gigaset_baud_rate, +- gigaset_set_line_ctrl, +- gigaset_isoc_send_skb, +- gigaset_isoc_input, ++ .write_cmd = gigaset_write_cmd, ++ .write_room = gigaset_write_room, ++ .chars_in_buffer = gigaset_chars_in_buffer, ++ .brkchars = gigaset_brkchars, ++ .init_bchannel = gigaset_init_bchannel, ++ .close_bchannel = gigaset_close_bchannel, ++ .initbcshw = gigaset_initbcshw, ++ .freebcshw = gigaset_freebcshw, ++ .reinitbcshw = gigaset_reinitbcshw, ++ .initcshw = gigaset_initcshw, ++ .freecshw = gigaset_freecshw, ++ .set_modem_ctrl = gigaset_set_modem_ctrl, ++ .baud_rate = gigaset_baud_rate, ++ .set_line_ctrl = gigaset_set_line_ctrl, ++ .send_skb = gigaset_isoc_send_skb, ++ .handle_input = gigaset_isoc_input, + }; + + /* bas_gigaset_init diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index 600c79b..3752bab 100644 --- a/drivers/isdn/gigaset/interface.c @@ -41937,8 +43128,51 @@ index 600c79b..3752bab 100644 tty_port_tty_set(&cs->port, NULL); mutex_unlock(&cs->mutex); +diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c +index 8c91fd5..14f13ce 100644 +--- a/drivers/isdn/gigaset/ser-gigaset.c ++++ b/drivers/isdn/gigaset/ser-gigaset.c +@@ -453,22 +453,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag) + } + + static const struct gigaset_ops ops = { +- gigaset_write_cmd, +- gigaset_write_room, +- gigaset_chars_in_buffer, +- gigaset_brkchars, +- gigaset_init_bchannel, +- gigaset_close_bchannel, +- gigaset_initbcshw, +- gigaset_freebcshw, +- gigaset_reinitbcshw, +- gigaset_initcshw, +- gigaset_freecshw, +- gigaset_set_modem_ctrl, +- gigaset_baud_rate, +- gigaset_set_line_ctrl, +- gigaset_m10x_send_skb, /* asyncdata.c */ +- gigaset_m10x_input, /* asyncdata.c */ ++ .write_cmd = gigaset_write_cmd, ++ .write_room = gigaset_write_room, ++ .chars_in_buffer = gigaset_chars_in_buffer, ++ .brkchars = gigaset_brkchars, ++ .init_bchannel = gigaset_init_bchannel, ++ .close_bchannel = gigaset_close_bchannel, ++ .initbcshw = gigaset_initbcshw, ++ .freebcshw = gigaset_freebcshw, ++ .reinitbcshw = gigaset_reinitbcshw, ++ .initcshw = gigaset_initcshw, ++ .freecshw = gigaset_freecshw, ++ .set_modem_ctrl = gigaset_set_modem_ctrl, ++ .baud_rate = gigaset_baud_rate, ++ .set_line_ctrl = gigaset_set_line_ctrl, ++ .send_skb = gigaset_m10x_send_skb, /* asyncdata.c */ ++ .handle_input = gigaset_m10x_input, /* asyncdata.c */ + }; + + diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c -index d0a41cb..f0cdb8c 100644 +index d0a41cb..b953e50 100644 --- a/drivers/isdn/gigaset/usb-gigaset.c +++ b/drivers/isdn/gigaset/usb-gigaset.c @@ -547,7 +547,7 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6]) @@ -41950,6 +43184,45 @@ index d0a41cb..f0cdb8c 100644 } static void gigaset_freebcshw(struct bc_state *bcs) +@@ -869,22 +869,22 @@ static int gigaset_pre_reset(struct usb_interface *intf) + } + + static const struct gigaset_ops ops = { +- gigaset_write_cmd, +- gigaset_write_room, +- gigaset_chars_in_buffer, +- gigaset_brkchars, +- gigaset_init_bchannel, +- gigaset_close_bchannel, +- gigaset_initbcshw, +- gigaset_freebcshw, +- gigaset_reinitbcshw, +- gigaset_initcshw, +- gigaset_freecshw, +- gigaset_set_modem_ctrl, +- gigaset_baud_rate, +- gigaset_set_line_ctrl, +- gigaset_m10x_send_skb, +- gigaset_m10x_input, ++ .write_cmd = gigaset_write_cmd, ++ .write_room = gigaset_write_room, ++ .chars_in_buffer = gigaset_chars_in_buffer, ++ .brkchars = gigaset_brkchars, ++ .init_bchannel = gigaset_init_bchannel, ++ .close_bchannel = gigaset_close_bchannel, ++ .initbcshw = gigaset_initbcshw, ++ .freebcshw = gigaset_freebcshw, ++ .reinitbcshw = gigaset_reinitbcshw, ++ .initcshw = gigaset_initcshw, ++ .freecshw = gigaset_freecshw, ++ .set_modem_ctrl = gigaset_set_modem_ctrl, ++ .baud_rate = gigaset_baud_rate, ++ .set_line_ctrl = gigaset_set_line_ctrl, ++ .send_skb = gigaset_m10x_send_skb, ++ .handle_input = gigaset_m10x_input, + }; + + /* diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c index 4d9b195..455075c 100644 --- a/drivers/isdn/hardware/avm/b1.c @@ -41985,6 +43258,23 @@ index 9bb12ba..d4262f7 100644 if (arg) { if (copy_to_user(argp, &dev, sizeof(ulong))) return -EFAULT; +diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c +index 91d5730..336523e 100644 +--- a/drivers/isdn/i4l/isdn_concap.c ++++ b/drivers/isdn/i4l/isdn_concap.c +@@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap) + } + + struct concap_device_ops isdn_concap_reliable_dl_dops = { +- &isdn_concap_dl_data_req, +- &isdn_concap_dl_connect_req, +- &isdn_concap_dl_disconn_req ++ .data_req = &isdn_concap_dl_data_req, ++ .connect_req = &isdn_concap_dl_connect_req, ++ .disconn_req = &isdn_concap_dl_disconn_req + }; + + /* The following should better go into a dedicated source file such that diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 3c5f249..5fac4d0 100644 --- a/drivers/isdn/i4l/isdn_tty.c @@ -42050,8 +43340,35 @@ index 3c5f249..5fac4d0 100644 continue; if ((info->emu.mdmreg[REG_SI1] & si2bit[si1]) && /* SI1 is matching */ (info->emu.mdmreg[REG_SI2] == si2)) { /* SI2 is matching */ +diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c +index e2d4e58..40cd045 100644 +--- a/drivers/isdn/i4l/isdn_x25iface.c ++++ b/drivers/isdn/i4l/isdn_x25iface.c +@@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *); + + + static struct concap_proto_ops ix25_pops = { +- &isdn_x25iface_proto_new, +- &isdn_x25iface_proto_del, +- &isdn_x25iface_proto_restart, +- &isdn_x25iface_proto_close, +- &isdn_x25iface_xmit, +- &isdn_x25iface_receive, +- &isdn_x25iface_connect_ind, +- &isdn_x25iface_disconn_ind ++ .proto_new = &isdn_x25iface_proto_new, ++ .proto_del = &isdn_x25iface_proto_del, ++ .restart = &isdn_x25iface_proto_restart, ++ .close = &isdn_x25iface_proto_close, ++ .encap_and_xmit = &isdn_x25iface_xmit, ++ .data_ind = &isdn_x25iface_receive, ++ .connect_ind = &isdn_x25iface_connect_ind, ++ .disconn_ind = &isdn_x25iface_disconn_ind + }; + + /* error message helper function */ diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c -index e74df7c..03a03ba 100644 +index 53d487f..f020f41 100644 --- a/drivers/isdn/icn/icn.c +++ b/drivers/isdn/icn/icn.c @@ -1045,7 +1045,7 @@ icn_writecmd(const u_char *buf, int len, int user, icn_card *card) @@ -42147,7 +43464,7 @@ index bfb39bb..08a603b 100644 /* If the entry's not present, there's nothing to release. */ if (pmd_flags(*spmd) & _PAGE_PRESENT) { diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c -index 5169239..47cb4db 100644 +index 922a1ac..9dd0c2a 100644 --- a/drivers/lguest/x86/core.c +++ b/drivers/lguest/x86/core.c @@ -59,7 +59,7 @@ static struct { @@ -42173,7 +43490,7 @@ index 5169239..47cb4db 100644 /* * Set up the Guest's page tables to see this CPU's pages (and no * other CPU's pages). -@@ -475,7 +481,7 @@ void __init lguest_arch_host_init(void) +@@ -477,7 +483,7 @@ void __init lguest_arch_host_init(void) * compiled-in switcher code and the high-mapped copy we just made. */ for (i = 0; i < IDT_ENTRIES; i++) @@ -42182,7 +43499,7 @@ index 5169239..47cb4db 100644 /* * Set up the Switcher's per-cpu areas. -@@ -558,7 +564,7 @@ void __init lguest_arch_host_init(void) +@@ -560,7 +566,7 @@ void __init lguest_arch_host_init(void) * it will be undisturbed when we switch. To change %cs and jump we * need this structure to feed to Intel's "lcall" instruction. */ @@ -42254,10 +43571,10 @@ index 40634b0..4f5855e 100644 // Every interrupt can come to us here // But we must truly tell each apart. diff --git a/drivers/md/bcache/closure.h b/drivers/md/bcache/closure.h -index 0003992..854bbce 100644 +index 9762f1b..3e79734 100644 --- a/drivers/md/bcache/closure.h +++ b/drivers/md/bcache/closure.h -@@ -622,7 +622,7 @@ static inline void closure_wake_up(struct closure_waitlist *list) +@@ -483,7 +483,7 @@ static inline void closure_queue(struct closure *cl) static inline void set_closure_fn(struct closure *cl, closure_fn *fn, struct workqueue_struct *wq) { @@ -42266,21 +43583,8 @@ index 0003992..854bbce 100644 closure_set_ip(cl); cl->fn = fn; cl->wq = wq; -diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c -index 547c4c5..5be1de4 100644 ---- a/drivers/md/bcache/super.c -+++ b/drivers/md/bcache/super.c -@@ -1644,7 +1644,7 @@ err_unlock_gc: - err: - closure_sync(&op.cl); - /* XXX: test this, it's broken */ -- bch_cache_set_error(c, err); -+ bch_cache_set_error(c, "%s", err); - } - - static bool can_attach_cache(struct cache *ca, struct cache_set *c) diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c -index a7fd821..9dcf6c3 100644 +index 12dc29b..1596277 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -1779,7 +1779,7 @@ void bitmap_status(struct seq_file *seq, struct bitmap *bitmap) @@ -42293,10 +43597,10 @@ index a7fd821..9dcf6c3 100644 seq_printf(seq, "\n"); diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c -index afe0814..8cf3794 100644 +index 5152142..623d141 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c -@@ -1745,7 +1745,7 @@ static int validate_params(uint cmd, struct dm_ioctl *param) +@@ -1769,7 +1769,7 @@ static int validate_params(uint cmd, struct dm_ioctl *param) cmd == DM_LIST_VERSIONS_CMD) return 0; @@ -42448,7 +43752,7 @@ index 73c1712..7347292 100644 schedule_work(&sc->trigger_event); } diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c -index 20a8cc0..5447b11 100644 +index 3ba6a38..b0fa9b0 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -291,7 +291,7 @@ static struct dm_dev_internal *find_device(struct list_head *l, dev_t dev) @@ -42470,7 +43774,7 @@ index 20a8cc0..5447b11 100644 "start=%llu, len=%llu, dev_size=%llu", dm_device_name(ti->table->md), bdevname(bdev, b), diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c -index 8a30ad5..72792d3 100644 +index 3bb4506..56e20cc 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c @@ -397,7 +397,7 @@ static void __setup_btree_details(struct dm_pool_metadata *pmd) @@ -42492,10 +43796,10 @@ index 8a30ad5..72792d3 100644 pmd->bl_info.value_type.inc = data_block_inc; pmd->bl_info.value_type.dec = data_block_dec; diff --git a/drivers/md/dm.c b/drivers/md/dm.c -index b3e26c7..1efca94 100644 +index b49c762..c9503cf 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c -@@ -179,9 +179,9 @@ struct mapped_device { +@@ -185,9 +185,9 @@ struct mapped_device { /* * Event handling. */ @@ -42507,7 +43811,7 @@ index b3e26c7..1efca94 100644 struct list_head uevent_list; spinlock_t uevent_lock; /* Protect access to uevent_list */ -@@ -1985,8 +1985,8 @@ static struct mapped_device *alloc_dev(int minor) +@@ -2021,8 +2021,8 @@ static struct mapped_device *alloc_dev(int minor) spin_lock_init(&md->deferred_lock); atomic_set(&md->holders, 1); atomic_set(&md->open_count, 0); @@ -42518,7 +43822,7 @@ index b3e26c7..1efca94 100644 INIT_LIST_HEAD(&md->uevent_list); spin_lock_init(&md->uevent_lock); -@@ -2139,7 +2139,7 @@ static void event_callback(void *context) +@@ -2176,7 +2176,7 @@ static void event_callback(void *context) dm_send_uevents(&uevents, &disk_to_dev(md->disk)->kobj); @@ -42527,7 +43831,7 @@ index b3e26c7..1efca94 100644 wake_up(&md->eventq); } -@@ -2832,18 +2832,18 @@ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action, +@@ -2869,18 +2869,18 @@ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action, uint32_t dm_next_uevent_seq(struct mapped_device *md) { @@ -42550,10 +43854,10 @@ index b3e26c7..1efca94 100644 void dm_uevent_add(struct mapped_device *md, struct list_head *elist) diff --git a/drivers/md/md.c b/drivers/md/md.c -index ba46d97..f8f5019 100644 +index 369d919..ba7049c 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c -@@ -234,10 +234,10 @@ EXPORT_SYMBOL_GPL(md_trim_bio); +@@ -194,10 +194,10 @@ EXPORT_SYMBOL_GPL(bio_clone_mddev); * start build, activate spare */ static DECLARE_WAIT_QUEUE_HEAD(md_event_waiters); @@ -42566,7 +43870,7 @@ index ba46d97..f8f5019 100644 wake_up(&md_event_waiters); } EXPORT_SYMBOL_GPL(md_new_event); -@@ -247,7 +247,7 @@ EXPORT_SYMBOL_GPL(md_new_event); +@@ -207,7 +207,7 @@ EXPORT_SYMBOL_GPL(md_new_event); */ static void md_new_event_inintr(struct mddev *mddev) { @@ -42575,7 +43879,7 @@ index ba46d97..f8f5019 100644 wake_up(&md_event_waiters); } -@@ -1502,7 +1502,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ +@@ -1463,7 +1463,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ if ((le32_to_cpu(sb->feature_map) & MD_FEATURE_RESHAPE_ACTIVE) && (le32_to_cpu(sb->feature_map) & MD_FEATURE_NEW_OFFSET)) rdev->new_data_offset += (s32)le32_to_cpu(sb->new_offset); @@ -42584,7 +43888,7 @@ index ba46d97..f8f5019 100644 rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256; bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1; -@@ -1746,7 +1746,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev) +@@ -1710,7 +1710,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev) else sb->resync_offset = cpu_to_le64(0); @@ -42593,7 +43897,7 @@ index ba46d97..f8f5019 100644 sb->raid_disks = cpu_to_le32(mddev->raid_disks); sb->size = cpu_to_le64(mddev->dev_sectors); -@@ -2751,7 +2751,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store); +@@ -2715,7 +2715,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store); static ssize_t errors_show(struct md_rdev *rdev, char *page) { @@ -42602,7 +43906,7 @@ index ba46d97..f8f5019 100644 } static ssize_t -@@ -2760,7 +2760,7 @@ errors_store(struct md_rdev *rdev, const char *buf, size_t len) +@@ -2724,7 +2724,7 @@ errors_store(struct md_rdev *rdev, const char *buf, size_t len) char *e; unsigned long n = simple_strtoul(buf, &e, 10); if (*buf && (*e == 0 || *e == '\n')) { @@ -42611,7 +43915,7 @@ index ba46d97..f8f5019 100644 return len; } return -EINVAL; -@@ -3208,8 +3208,8 @@ int md_rdev_init(struct md_rdev *rdev) +@@ -3173,8 +3173,8 @@ int md_rdev_init(struct md_rdev *rdev) rdev->sb_loaded = 0; rdev->bb_page = NULL; atomic_set(&rdev->nr_pending, 0); @@ -42622,7 +43926,7 @@ index ba46d97..f8f5019 100644 INIT_LIST_HEAD(&rdev->same_set); init_waitqueue_head(&rdev->blocked_wait); -@@ -7043,7 +7043,7 @@ static int md_seq_show(struct seq_file *seq, void *v) +@@ -7038,7 +7038,7 @@ static int md_seq_show(struct seq_file *seq, void *v) spin_unlock(&pers_lock); seq_printf(seq, "\n"); @@ -42631,7 +43935,7 @@ index ba46d97..f8f5019 100644 return 0; } if (v == (void*)2) { -@@ -7146,7 +7146,7 @@ static int md_seq_open(struct inode *inode, struct file *file) +@@ -7141,7 +7141,7 @@ static int md_seq_open(struct inode *inode, struct file *file) return error; seq = file->private_data; @@ -42640,7 +43944,7 @@ index ba46d97..f8f5019 100644 return error; } -@@ -7160,7 +7160,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait) +@@ -7155,7 +7155,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait) /* always allow read */ mask = POLLIN | POLLRDNORM; @@ -42649,7 +43953,7 @@ index ba46d97..f8f5019 100644 mask |= POLLERR | POLLPRI; return mask; } -@@ -7204,7 +7204,7 @@ static int is_mddev_idle(struct mddev *mddev, int init) +@@ -7199,7 +7199,7 @@ static int is_mddev_idle(struct mddev *mddev, int init) struct gendisk *disk = rdev->bdev->bd_contains->bd_disk; curr_events = (int)part_stat_read(&disk->part0, sectors[0]) + (int)part_stat_read(&disk->part0, sectors[1]) - @@ -42659,7 +43963,7 @@ index ba46d97..f8f5019 100644 * as sync_io is counted when a request starts, and * disk_stats is counted when it completes. diff --git a/drivers/md/md.h b/drivers/md/md.h -index 608050c..6e77db5d 100644 +index 0095ec8..c89277a 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -94,13 +94,13 @@ struct md_rdev { @@ -42678,7 +43982,7 @@ index 608050c..6e77db5d 100644 * for reporting to userspace and storing * in superblock. */ -@@ -446,7 +446,7 @@ static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev) +@@ -449,7 +449,7 @@ static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev) static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors) { @@ -42700,10 +44004,10 @@ index 3e6d115..ffecdeb 100644 /*----------------------------------------------------------------*/ diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c -index aacf6bf..67d63f2 100644 +index 63b2e8d..225f16b 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c -@@ -1824,7 +1824,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio) +@@ -1921,7 +1921,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio) if (r1_sync_page_io(rdev, sect, s, bio->bi_io_vec[idx].bv_page, READ) != 0) @@ -42712,7 +44016,7 @@ index aacf6bf..67d63f2 100644 } sectors -= s; sect += s; -@@ -2051,7 +2051,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk, +@@ -2155,7 +2155,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk, test_bit(In_sync, &rdev->flags)) { if (r1_sync_page_io(rdev, sect, s, conf->tmppage, READ)) { @@ -42722,27 +44026,9 @@ index aacf6bf..67d63f2 100644 "md/raid1:%s: read error corrected " "(%d sectors at %llu on %s)\n", diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c -index 73dc8a3..859d581f6 100644 +index 06eeb99..770613e 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c -@@ -1319,7 +1319,7 @@ read_again: - /* Could not read all from this device, so we will - * need another r10_bio. - */ -- sectors_handled = (r10_bio->sectors + max_sectors -+ sectors_handled = (r10_bio->sector + max_sectors - - bio->bi_sector); - r10_bio->sectors = max_sectors; - spin_lock_irq(&conf->device_lock); -@@ -1327,7 +1327,7 @@ read_again: - bio->bi_phys_segments = 2; - else - bio->bi_phys_segments++; -- spin_unlock(&conf->device_lock); -+ spin_unlock_irq(&conf->device_lock); - /* Cannot call generic_make_request directly - * as that will be queued in __generic_make_request - * and subsequent mempool_alloc might block @@ -1963,7 +1963,7 @@ static void end_sync_read(struct bio *bio, int error) /* The write handler will notice the lack of * R10BIO_Uptodate and record any errors etc @@ -42802,33 +44088,11 @@ index 73dc8a3..859d581f6 100644 } rdev_dec_pending(rdev, mddev); -@@ -3220,10 +3220,6 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, - if (j == conf->copies) { - /* Cannot recover, so abort the recovery or - * record a bad block */ -- put_buf(r10_bio); -- if (rb2) -- atomic_dec(&rb2->remaining); -- r10_bio = rb2; - if (any_working) { - /* problem is that there are bad blocks - * on other device(s) -@@ -3255,6 +3251,10 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, - mirror->recovery_disabled - = mddev->recovery_disabled; - } -+ put_buf(r10_bio); -+ if (rb2) -+ atomic_dec(&rb2->remaining); -+ r10_bio = rb2; - break; - } - } diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c -index 8a0665d..b322118 100644 +index 48cdec8..c7726b1 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c -@@ -1887,21 +1887,21 @@ static void raid5_end_read_request(struct bio * bi, int error) +@@ -1991,21 +1991,21 @@ static void raid5_end_read_request(struct bio * bi, int error) mdname(conf->mddev), STRIPE_SECTORS, (unsigned long long)s, bdevname(rdev->bdev, b)); @@ -42854,7 +44118,7 @@ index 8a0665d..b322118 100644 if (test_bit(R5_ReadRepl, &sh->dev[i].flags)) printk_ratelimited( KERN_WARNING -@@ -1929,7 +1929,7 @@ static void raid5_end_read_request(struct bio * bi, int error) +@@ -2033,7 +2033,7 @@ static void raid5_end_read_request(struct bio * bi, int error) mdname(conf->mddev), (unsigned long long)s, bdn); @@ -42863,29 +44127,11 @@ index 8a0665d..b322118 100644 > conf->max_nr_stripes) printk(KERN_WARNING "md/raid:%s: Too many read errors, failing device %s.\n", -@@ -3502,7 +3502,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s) - */ - set_bit(R5_Insync, &dev->flags); - -- if (rdev && test_bit(R5_WriteError, &dev->flags)) { -+ if (test_bit(R5_WriteError, &dev->flags)) { - /* This flag does not apply to '.replacement' - * only to .rdev, so make sure to check that*/ - struct md_rdev *rdev2 = rcu_dereference( -@@ -3515,7 +3515,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s) - } else - clear_bit(R5_WriteError, &dev->flags); - } -- if (rdev && test_bit(R5_MadeGood, &dev->flags)) { -+ if (test_bit(R5_MadeGood, &dev->flags)) { - /* This flag does not apply to '.replacement' - * only to .rdev, so make sure to check that*/ - struct md_rdev *rdev2 = rcu_dereference( diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c -index 401ef64..836e563 100644 +index 983db75..ef9248c 100644 --- a/drivers/media/dvb-core/dvbdev.c +++ b/drivers/media/dvb-core/dvbdev.c -@@ -192,7 +192,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, +@@ -185,7 +185,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, const struct dvb_device *template, void *priv, int type) { struct dvb_device *dvbdev; @@ -42908,7 +44154,7 @@ index 9b6c3bb..baeb5c7 100644 #if IS_ENABLED(CONFIG_DVB_DIB3000MB) extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c -index ecf21d9..b992428d 100644 +index ed8cb90..5ef7f79 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c @@ -50,9 +50,9 @@ MODULE_VERSION(CX88_VERSION); @@ -42925,7 +44171,7 @@ index ecf21d9..b992428d 100644 module_param_array(video_nr, int, NULL, 0444); module_param_array(vbi_nr, int, NULL, 0444); diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c -index c08ae3e..eb59af1 100644 +index 802642d..5534900 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.c +++ b/drivers/media/pci/ivtv/ivtv-driver.c @@ -83,7 +83,7 @@ static struct pci_device_id ivtv_pci_tbl[] = { @@ -42974,7 +44220,7 @@ index dfd0a21..6bbb465 100644 videobuf_queue_dma_contig_init(q, &video_vbq_ops, q->dev, diff --git a/drivers/media/platform/s5p-tv/mixer.h b/drivers/media/platform/s5p-tv/mixer.h -index 04e6490..2df65bf 100644 +index fb2acc5..a2fcbdc4 100644 --- a/drivers/media/platform/s5p-tv/mixer.h +++ b/drivers/media/platform/s5p-tv/mixer.h @@ -156,7 +156,7 @@ struct mxr_layer { @@ -42987,7 +44233,7 @@ index 04e6490..2df65bf 100644 const struct mxr_format **fmt_array; /** size of format array */ diff --git a/drivers/media/platform/s5p-tv/mixer_grp_layer.c b/drivers/media/platform/s5p-tv/mixer_grp_layer.c -index b93a21f..2535195 100644 +index 74344c7..a39e70e 100644 --- a/drivers/media/platform/s5p-tv/mixer_grp_layer.c +++ b/drivers/media/platform/s5p-tv/mixer_grp_layer.c @@ -235,7 +235,7 @@ struct mxr_layer *mxr_graph_layer_create(struct mxr_device *mdev, int idx) @@ -43013,7 +44259,7 @@ index b713403..53cb5ad 100644 if (done && done != layer->shadow_buf) vb2_buffer_done(&done->vb, VB2_BUF_STATE_DONE); diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c -index 641b1f0..49cff30 100644 +index 81b97db..b089ccd 100644 --- a/drivers/media/platform/s5p-tv/mixer_video.c +++ b/drivers/media/platform/s5p-tv/mixer_video.c @@ -210,7 +210,7 @@ static void mxr_layer_default_geo(struct mxr_layer *layer) @@ -43113,7 +44359,7 @@ index 641b1f0..49cff30 100644 spin_lock_init(&layer->enq_slock); INIT_LIST_HEAD(&layer->enq_list); diff --git a/drivers/media/platform/s5p-tv/mixer_vp_layer.c b/drivers/media/platform/s5p-tv/mixer_vp_layer.c -index 3d13a63..da31bf1 100644 +index c9388c4..ce71ece 100644 --- a/drivers/media/platform/s5p-tv/mixer_vp_layer.c +++ b/drivers/media/platform/s5p-tv/mixer_vp_layer.c @@ -206,7 +206,7 @@ struct mxr_layer *mxr_vp_layer_create(struct mxr_device *mdev, int idx) @@ -43126,7 +44372,7 @@ index 3d13a63..da31bf1 100644 .buffer_set = mxr_vp_buffer_set, .stream_set = mxr_vp_stream_set, diff --git a/drivers/media/platform/vivi.c b/drivers/media/platform/vivi.c -index 1d3f119..75f40bb 100644 +index 2d4e73b..8b4d5b6 100644 --- a/drivers/media/platform/vivi.c +++ b/drivers/media/platform/vivi.c @@ -58,8 +58,8 @@ MODULE_AUTHOR("Mauro Carvalho Chehab, Ted Walther and John Sokol"); @@ -43176,7 +44422,7 @@ index 5236035..c622c74 100644 #define PCI_VENDOR_ID_GUILLEMOT 0x5046 #define PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO 0x1001 diff --git a/drivers/media/radio/radio-shark.c b/drivers/media/radio/radio-shark.c -index b914772..7ddbf9b 100644 +index 050b3bb..79f62b9 100644 --- a/drivers/media/radio/radio-shark.c +++ b/drivers/media/radio/radio-shark.c @@ -79,7 +79,7 @@ struct shark_device { @@ -43189,7 +44435,7 @@ index b914772..7ddbf9b 100644 static void shark_write_val(struct snd_tea575x *tea, u32 val) { diff --git a/drivers/media/radio/radio-shark2.c b/drivers/media/radio/radio-shark2.c -index 9fb6697..f167415 100644 +index 8654e0d..0608a64 100644 --- a/drivers/media/radio/radio-shark2.c +++ b/drivers/media/radio/radio-shark2.c @@ -74,7 +74,7 @@ struct shark_device { @@ -43202,7 +44448,7 @@ index 9fb6697..f167415 100644 static int shark_write_reg(struct radio_tea5777 *tea, u64 reg) { diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c -index 9c9084c..a9e8dfb 100644 +index 2fd9009..278cc1e 100644 --- a/drivers/media/radio/radio-si476x.c +++ b/drivers/media/radio/radio-si476x.c @@ -1445,7 +1445,7 @@ static int si476x_radio_probe(struct platform_device *pdev) @@ -43250,7 +44496,7 @@ index 20e345d..da56fe4 100644 static int dib7070_set_param_override(struct dvb_frontend *fe) { diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c -index 71b22f5..a63b33f 100644 +index c1a63b2..dbcbfb6 100644 --- a/drivers/media/usb/dvb-usb/dw2102.c +++ b/drivers/media/usb/dvb-usb/dw2102.c @@ -121,7 +121,7 @@ struct su3000_state { @@ -43263,7 +44509,7 @@ index 71b22f5..a63b33f 100644 /* debug */ static int dvb_usb_dw2102_debug; diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c -index 8f7a6a4..59502dd 100644 +index 8f7a6a4..eb0e1d4 100644 --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -326,7 +326,7 @@ struct v4l2_buffer32 { @@ -43284,6 +44530,51 @@ index 8f7a6a4..59502dd 100644 enum v4l2_memory memory) { if (copy_in_user(up32, up, 2 * sizeof(__u32)) || +@@ -425,7 +425,7 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user + * by passing a very big num_planes value */ + uplane = compat_alloc_user_space(num_planes * + sizeof(struct v4l2_plane)); +- kp->m.planes = uplane; ++ kp->m.planes = (struct v4l2_plane __force_kernel *)uplane; + + while (--num_planes >= 0) { + ret = get_v4l2_plane32(uplane, uplane32, kp->memory); +@@ -496,7 +496,7 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user + if (num_planes == 0) + return 0; + +- uplane = kp->m.planes; ++ uplane = (struct v4l2_plane __force_user *)kp->m.planes; + if (get_user(p, &up->m.planes)) + return -EFAULT; + uplane32 = compat_ptr(p); +@@ -550,7 +550,7 @@ static int get_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame + get_user(kp->capability, &up->capability) || + get_user(kp->flags, &up->flags)) + return -EFAULT; +- kp->base = compat_ptr(tmp); ++ kp->base = (void __force_kernel *)compat_ptr(tmp); + get_v4l2_pix_format(&kp->fmt, &up->fmt); + return 0; + } +@@ -656,7 +656,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext + n * sizeof(struct v4l2_ext_control32))) + return -EFAULT; + kcontrols = compat_alloc_user_space(n * sizeof(struct v4l2_ext_control)); +- kp->controls = kcontrols; ++ kp->controls = (struct v4l2_ext_control __force_kernel *)kcontrols; + while (--n >= 0) { + if (copy_in_user(kcontrols, ucontrols, sizeof(*ucontrols))) + return -EFAULT; +@@ -678,7 +678,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext + static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext_controls32 __user *up) + { + struct v4l2_ext_control32 __user *ucontrols; +- struct v4l2_ext_control __user *kcontrols = kp->controls; ++ struct v4l2_ext_control __user *kcontrols = (struct v4l2_ext_control __force_user *)kp->controls; + int n = kp->count; + compat_caddr_t p; + @@ -772,7 +772,7 @@ static int put_v4l2_subdev_edid32(struct v4l2_subdev_edid *kp, struct v4l2_subde put_user(kp->start_block, &up->start_block) || put_user(kp->blocks, &up->blocks) || @@ -43293,6 +44584,21 @@ index 8f7a6a4..59502dd 100644 return -EFAULT; return 0; } +diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c +index fb46790..ae1f8fa 100644 +--- a/drivers/media/v4l2-core/v4l2-ctrls.c ++++ b/drivers/media/v4l2-core/v4l2-ctrls.c +@@ -1396,8 +1396,8 @@ static int validate_new(const struct v4l2_ctrl *ctrl, + return 0; + + case V4L2_CTRL_TYPE_STRING: +- len = strlen(c->string); +- if (len < ctrl->minimum) ++ len = strlen_user(c->string); ++ if (!len || len < ctrl->minimum) + return -ERANGE; + if ((len - ctrl->minimum) % ctrl->step) + return -ERANGE; diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c index 02d1b63..5fd6b16 100644 --- a/drivers/media/v4l2-core/v4l2-device.c @@ -43310,7 +44616,7 @@ index 02d1b63..5fd6b16 100644 if (basename[len - 1] >= '0' && basename[len - 1] <= '9') diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c -index 68e6b5e..d8b923e 100644 +index 68e6b5e..8eb2aec 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1939,7 +1939,8 @@ struct v4l2_ioctl_info { @@ -43359,6 +44665,15 @@ index 68e6b5e..d8b923e 100644 *kernel_ptr = (void *)&ctrls->controls; *array_size = sizeof(struct v4l2_ext_control) * ctrls->count; +@@ -2340,7 +2341,7 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg, + err = -ENOTTY; + + if (has_array_args) { +- *kernel_ptr = user_ptr; ++ *kernel_ptr = (void __force_kernel *)user_ptr; + if (copy_to_user(user_ptr, mbuf, array_size)) + err = -EFAULT; + goto out_array_args; diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 767ff4d..c69d259 100644 --- a/drivers/message/fusion/mptbase.c @@ -43661,6 +44976,19 @@ index a8c08f3..155fe3d 100644 INIT_LIST_HEAD(&c->context_list); #endif +diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c +index e33e385..28dfd23 100644 +--- a/drivers/mfd/ab8500-debugfs.c ++++ b/drivers/mfd/ab8500-debugfs.c +@@ -100,7 +100,7 @@ static int irq_last; + static u32 *irq_count; + static int num_irqs; + +-static struct device_attribute **dev_attr; ++static device_attribute_no_const **dev_attr; + static char **event_name; + + static u8 avg_sample = SAMPLE_16; diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c index fcbb2e9..2635e11 100644 --- a/drivers/mfd/janz-cmodio.c @@ -43674,7 +45002,7 @@ index fcbb2e9..2635e11 100644 #include #include diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c -index de7fb80..7c1b931 100644 +index 176aa26..27811b2 100644 --- a/drivers/mfd/max8925-i2c.c +++ b/drivers/mfd/max8925-i2c.c @@ -152,7 +152,7 @@ static int max8925_probe(struct i2c_client *client, @@ -43687,10 +45015,10 @@ index de7fb80..7c1b931 100644 if (node && !pdata) { diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c -index d792772..cd73ba3 100644 +index c0f608e..286f8ec 100644 --- a/drivers/mfd/tps65910.c +++ b/drivers/mfd/tps65910.c -@@ -229,7 +229,7 @@ static int tps65910_irq_init(struct tps65910 *tps65910, int irq, +@@ -230,7 +230,7 @@ static int tps65910_irq_init(struct tps65910 *tps65910, int irq, struct tps65910_platform_data *pdata) { int ret = 0; @@ -43742,6 +45070,21 @@ index 464419b..64bae8d 100644 c2dev->dev = device_create(c2port_class, NULL, 0, c2dev, "c2port%d", c2dev->id); +diff --git a/drivers/misc/eeprom/sunxi_sid.c b/drivers/misc/eeprom/sunxi_sid.c +index 9c34e57..b981cda 100644 +--- a/drivers/misc/eeprom/sunxi_sid.c ++++ b/drivers/misc/eeprom/sunxi_sid.c +@@ -127,7 +127,9 @@ static int sunxi_sid_probe(struct platform_device *pdev) + + platform_set_drvdata(pdev, sid_data); + +- sid_bin_attr.size = sid_data->keysize; ++ pax_open_kernel(); ++ *(size_t *)&sid_bin_attr.size = sid_data->keysize; ++ pax_close_kernel(); + if (device_create_bin_file(&pdev->dev, &sid_bin_attr)) + return -ENODEV; + diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c index 36f5d52..32311c3 100644 --- a/drivers/misc/kgdbts.c @@ -44053,6 +45396,30 @@ index c862cd4..0d176fe 100644 extern struct xpc_interface xpc_interface; +diff --git a/drivers/misc/sgi-xp/xp_main.c b/drivers/misc/sgi-xp/xp_main.c +index 01be66d..e3a0c7e 100644 +--- a/drivers/misc/sgi-xp/xp_main.c ++++ b/drivers/misc/sgi-xp/xp_main.c +@@ -78,13 +78,13 @@ xpc_notloaded(void) + } + + struct xpc_interface xpc_interface = { +- (void (*)(int))xpc_notloaded, +- (void (*)(int))xpc_notloaded, +- (enum xp_retval(*)(short, int, u32, void *, u16))xpc_notloaded, +- (enum xp_retval(*)(short, int, u32, void *, u16, xpc_notify_func, ++ .connect = (void (*)(int))xpc_notloaded, ++ .disconnect = (void (*)(int))xpc_notloaded, ++ .send = (enum xp_retval(*)(short, int, u32, void *, u16))xpc_notloaded, ++ .send_notify = (enum xp_retval(*)(short, int, u32, void *, u16, xpc_notify_func, + void *))xpc_notloaded, +- (void (*)(short, int, void *))xpc_notloaded, +- (enum xp_retval(*)(short, void *))xpc_notloaded ++ .received = (void (*)(short, int, void *))xpc_notloaded, ++ .partid_to_nasids = (enum xp_retval(*)(short, void *))xpc_notloaded + }; + EXPORT_SYMBOL_GPL(xpc_interface); + diff --git a/drivers/misc/sgi-xp/xpc.h b/drivers/misc/sgi-xp/xpc.h index b94d5f7..7f494c5 100644 --- a/drivers/misc/sgi-xp/xpc.h @@ -44096,11 +45463,37 @@ index 82dc574..8539ab2 100644 xpc_die_deactivate(); break; +diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c +index 7b5424f..ed1d6ac 100644 +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -575,7 +575,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev, + if (idata->ic.postsleep_min_us) + usleep_range(idata->ic.postsleep_min_us, idata->ic.postsleep_max_us); + +- if (copy_to_user(&(ic_ptr->response), cmd.resp, sizeof(cmd.resp))) { ++ if (copy_to_user(ic_ptr->response, cmd.resp, sizeof(cmd.resp))) { + err = -EFAULT; + goto cmd_rel_host; + } +diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c +index 357bbc5..3e049c1 100644 +--- a/drivers/mmc/card/queue.c ++++ b/drivers/mmc/card/queue.c +@@ -197,7 +197,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, + struct mmc_queue_req *mqrq_prev = &mq->mqrq[1]; + + if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask) +- limit = dma_max_pfn(mmc_dev(host)) << PAGE_SHIFT; ++ limit = (u64)dma_max_pfn(mmc_dev(host)) << PAGE_SHIFT; + + mq->card = card; + mq->queue = blk_init_queue(mmc_request_fn, lock); diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c -index ef18348..1b53cf0 100644 +index e5b5eeb..7bf2212 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c -@@ -213,7 +213,7 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host, +@@ -247,7 +247,7 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host, void *data_buf; int is_on_stack; @@ -44110,21 +45503,21 @@ index ef18348..1b53cf0 100644 /* * dma onto stack is unsafe/nonportable, but callers to this diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h -index 81b2994..dce857e 100644 +index 6bf24ab..13d0293b 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h -@@ -203,5 +203,5 @@ struct dw_mci_drv_data { - void (*prepare_command)(struct dw_mci *host, u32 *cmdr); - void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios); +@@ -258,5 +258,5 @@ struct dw_mci_drv_data { int (*parse_dt)(struct dw_mci *host); + int (*execute_tuning)(struct dw_mci_slot *slot, u32 opcode, + struct dw_mci_tuning_data *tuning_data); -}; +} __do_const; #endif /* _DW_MMC_H_ */ diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c -index c3785ed..1984c44 100644 +index f320579..7b7ebac 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c -@@ -1482,7 +1482,9 @@ static int mmci_probe(struct amba_device *dev, +@@ -1504,7 +1504,9 @@ static int mmci_probe(struct amba_device *dev, } if (variant->busy_detect) { @@ -44135,6 +45528,25 @@ index c3785ed..1984c44 100644 mmci_write_datactrlreg(host, MCI_ST_DPSM_BUSYMODE); } +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c +index 1dcaf8a..025af25 100644 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c +@@ -1009,9 +1009,12 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) + host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN; + } + +- if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) +- sdhci_esdhc_ops.platform_execute_tuning = ++ if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) { ++ pax_open_kernel(); ++ *(void **)&sdhci_esdhc_ops.platform_execute_tuning = + esdhc_executing_tuning; ++ pax_close_kernel(); ++ } + boarddata = &imx_data->boarddata; + if (sdhci_esdhc_imx_probe_dt(pdev, boarddata) < 0) { + if (!host->mmc->parent->platform_data) { diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 6debda9..2ba7427 100644 --- a/drivers/mmc/host/sdhci-s3c.c @@ -44168,7 +45580,7 @@ index 096993f..f02c23b 100644 if (!ECCBUF_SIZE) { /* We should fall back to a general writev implementation. diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c -index 2ed2bb3..2d0b82e 100644 +index 370b9dd..1a1176b 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -24,6 +24,7 @@ @@ -44205,30 +45617,45 @@ index 4b8e895..6b3c498 100644 struct sm_sysfs_attribute *vendor_attribute; diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c -index dd8057d..22aaf36 100644 +index 4b8c58b..a200546 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c -@@ -4511,7 +4511,7 @@ static unsigned int bond_get_num_tx_queues(void) - return tx_queues; - } +@@ -4527,6 +4527,7 @@ static void __exit bonding_exit(void) --static struct rtnl_link_ops bond_link_ops __read_mostly = { -+static struct rtnl_link_ops bond_link_ops = { - .kind = "bond", - .priv_size = sizeof(struct bonding), - .setup = bond_setup, -@@ -4636,8 +4636,8 @@ static void __exit bonding_exit(void) - - bond_destroy_debugfs(); - -- rtnl_link_unregister(&bond_link_ops); + bond_netlink_fini(); unregister_pernet_subsys(&bond_net_ops); + rtnl_link_unregister(&bond_link_ops); #ifdef CONFIG_NET_POLL_CONTROLLER /* +diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c +index 40e7b1c..6a70fff 100644 +--- a/drivers/net/bonding/bond_netlink.c ++++ b/drivers/net/bonding/bond_netlink.c +@@ -102,7 +102,7 @@ nla_put_failure: + return -EMSGSIZE; + } + +-struct rtnl_link_ops bond_link_ops __read_mostly = { ++struct rtnl_link_ops bond_link_ops = { + .kind = "bond", + .priv_size = sizeof(struct bonding), + .setup = bond_setup, +diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig +index 3c06947..fd0e5de 100644 +--- a/drivers/net/can/Kconfig ++++ b/drivers/net/can/Kconfig +@@ -104,7 +104,7 @@ config CAN_JANZ_ICAN3 + + config CAN_FLEXCAN + tristate "Support for Freescale FLEXCAN based chips" +- depends on ARM || PPC ++ depends on (ARM && CPU_LITTLE_ENDIAN) || PPC + ---help--- + Say Y here if you want to support for Freescale FlexCAN. + diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c -index f92f001..0b2f9bf 100644 +index 36fa577..a158806 100644 --- a/drivers/net/ethernet/8390/ax88796.c +++ b/drivers/net/ethernet/8390/ax88796.c @@ -872,9 +872,11 @@ static int ax_probe(struct platform_device *pdev) @@ -44245,10 +45672,10 @@ index f92f001..0b2f9bf 100644 if (!request_mem_region(mem->start, mem_size, pdev->name)) { diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h -index da8fcaa..f4b5d3b 100644 +index 41f3ca5a..1ee5364 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h -@@ -1138,7 +1138,7 @@ static inline u8 bnx2x_get_path_func_num(struct bnx2x *bp) +@@ -1139,7 +1139,7 @@ static inline u8 bnx2x_get_path_func_num(struct bnx2x *bp) static inline void bnx2x_init_bp_objs(struct bnx2x *bp) { /* RX_MODE controlling object */ @@ -44258,10 +45685,10 @@ index da8fcaa..f4b5d3b 100644 /* multicast configuration controlling object */ bnx2x_init_mcast_obj(bp, &bp->mcast_obj, bp->fp->cl_id, bp->fp->cid, diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c -index 9fbeee5..5e3e37a 100644 +index 18438a5..c923b8e 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c -@@ -2590,15 +2590,14 @@ int bnx2x_config_rx_mode(struct bnx2x *bp, +@@ -2591,15 +2591,14 @@ int bnx2x_config_rx_mode(struct bnx2x *bp, return rc; } @@ -44283,10 +45710,10 @@ index 9fbeee5..5e3e37a 100644 } diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h -index 658f4e3..15074a6 100644 +index 6a53c15..6e7d1e7 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h -@@ -1325,8 +1325,7 @@ int bnx2x_vlan_mac_move(struct bnx2x *bp, +@@ -1332,8 +1332,7 @@ int bnx2x_vlan_mac_move(struct bnx2x *bp, /********************* RX MODE ****************/ @@ -44297,10 +45724,10 @@ index 658f4e3..15074a6 100644 /** * bnx2x_config_rx_mode - Send and RX_MODE ramrod according to the provided parameters. diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h -index 7025780..e55a71c 100644 +index cf9917b..c658558 100644 --- a/drivers/net/ethernet/broadcom/tg3.h +++ b/drivers/net/ethernet/broadcom/tg3.h -@@ -147,6 +147,7 @@ +@@ -150,6 +150,7 @@ #define CHIPREV_ID_5750_A0 0x4000 #define CHIPREV_ID_5750_A1 0x4001 #define CHIPREV_ID_5750_A3 0x4003 @@ -44308,6 +45735,25 @@ index 7025780..e55a71c 100644 #define CHIPREV_ID_5750_C2 0x4202 #define CHIPREV_ID_5752_A0_HW 0x5000 #define CHIPREV_ID_5752_A0 0x6000 +diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c +index 3ca77fa..fcc015f 100644 +--- a/drivers/net/ethernet/brocade/bna/bna_enet.c ++++ b/drivers/net/ethernet/brocade/bna/bna_enet.c +@@ -1690,10 +1690,10 @@ bna_cb_ioceth_reset(void *arg) + } + + static struct bfa_ioc_cbfn bna_ioceth_cbfn = { +- bna_cb_ioceth_enable, +- bna_cb_ioceth_disable, +- bna_cb_ioceth_hbfail, +- bna_cb_ioceth_reset ++ .enable_cbfn = bna_cb_ioceth_enable, ++ .disable_cbfn = bna_cb_ioceth_disable, ++ .hbfail_cbfn = bna_cb_ioceth_hbfail, ++ .reset_cbfn = bna_cb_ioceth_reset + }; + + static void bna_attr_init(struct bna_ioceth *ioceth) diff --git a/drivers/net/ethernet/chelsio/cxgb3/l2t.h b/drivers/net/ethernet/chelsio/cxgb3/l2t.h index 8cffcdf..aadf043 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/l2t.h @@ -44322,10 +45768,10 @@ index 8cffcdf..aadf043 100644 #define L2T_SKB_CB(skb) ((struct l2t_skb_cb *)(skb)->cb) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c -index c73cabd..cd278b1 100644 +index fff02ed..d421412 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c -@@ -2186,7 +2186,7 @@ static void get_regs(struct net_device *dev, struct ethtool_regs *regs, +@@ -2120,7 +2120,7 @@ static void get_regs(struct net_device *dev, struct ethtool_regs *regs, int i; struct adapter *ap = netdev2adap(dev); @@ -44333,9 +45779,9 @@ index c73cabd..cd278b1 100644 + const unsigned int *reg_ranges; int arr_size = 0, buf_size = 0; - if (is_t4(ap->chip)) { + if (is_t4(ap->params.chip)) { diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c -index 263b92c..f05134b 100644 +index c05b66d..ed69872 100644 --- a/drivers/net/ethernet/dec/tulip/de4x5.c +++ b/drivers/net/ethernet/dec/tulip/de4x5.c @@ -5388,7 +5388,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) @@ -44357,10 +45803,10 @@ index 263b92c..f05134b 100644 break; } diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c -index 2c38cc4..0323f6e 100644 +index a37039d..a51d7e8 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c -@@ -470,7 +470,7 @@ static void accumulate_16bit_val(u32 *acc, u16 val) +@@ -533,7 +533,7 @@ static void accumulate_16bit_val(u32 *acc, u16 val) if (wrapped) newacc += 65536; @@ -44434,25 +45880,25 @@ index fbe5363..266b4e3 100644 __vxge_hw_mempool_create(vpath->hldev, fifo->config->memblock_size, diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c -index f09e787..f3916a8 100644 +index 918e18d..4ca3650 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c -@@ -2055,7 +2055,9 @@ int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter) - +@@ -2086,7 +2086,9 @@ int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter) + adapter->max_tx_rings = QLCNIC_MAX_VNIC_TX_RINGS; } else if (ret == QLC_83XX_DEFAULT_OPMODE) { - ahw->nic_mode = QLC_83XX_DEFAULT_MODE; + ahw->nic_mode = QLCNIC_DEFAULT_MODE; - adapter->nic_ops->init_driver = qlcnic_83xx_init_default_driver; + pax_open_kernel(); + *(void **)&adapter->nic_ops->init_driver = qlcnic_83xx_init_default_driver; + pax_close_kernel(); ahw->idc.state_entry = qlcnic_83xx_idc_ready_state_entry; - } else { - return -EIO; + adapter->max_sds_rings = QLCNIC_MAX_SDS_RINGS; + adapter->max_tx_rings = QLCNIC_MAX_TX_RINGS; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c -index 0248a4c..9648d96 100644 +index 734d286..b017bf5 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c -@@ -191,17 +191,23 @@ int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *adapter) +@@ -207,17 +207,23 @@ int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *adapter) case QLCNIC_NON_PRIV_FUNC: ahw->op_mode = QLCNIC_NON_PRIV_FUNC; ahw->idc.state_entry = qlcnic_83xx_idc_ready_state_entry; @@ -44480,7 +45926,7 @@ index 0248a4c..9648d96 100644 default: dev_err(&adapter->pdev->dev, "Invalid Virtual NIC opmode\n"); diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c -index 1551360..ed6510f 100644 +index 7763962..c3499a7 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c @@ -1108,7 +1108,7 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter) @@ -44493,7 +45939,7 @@ index 1551360..ed6510f 100644 struct qlcnic_hardware_context *ahw; void *temp_buffer; diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c -index fb3f8dc..9d2ff38 100644 +index c737f0e..32b8682 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -759,22 +759,22 @@ struct rtl8169_private { @@ -44524,7 +45970,7 @@ index fb3f8dc..9d2ff38 100644 int (*set_speed)(struct net_device *, u8 aneg, u16 sp, u8 dpx, u32 adv); int (*get_settings)(struct net_device *, struct ethtool_cmd *); diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c -index 3dd39dc..85efa46 100644 +index a124103..59c74f8 100644 --- a/drivers/net/ethernet/sfc/ptp.c +++ b/drivers/net/ethernet/sfc/ptp.c @@ -541,7 +541,7 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings) @@ -44600,10 +46046,10 @@ index bf0d55e..82bcfbd1 100644 priv = netdev_priv(dev); priv->phy = phy; diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c -index 9bf46bd..bfdaa84 100644 +index d7e2907..1f8bfee 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c -@@ -939,13 +939,15 @@ static const struct nla_policy macvlan_policy[IFLA_MACVLAN_MAX + 1] = { +@@ -993,13 +993,15 @@ static const struct nla_policy macvlan_policy[IFLA_MACVLAN_MAX + 1] = { int macvlan_link_register(struct rtnl_link_ops *ops) { /* common fields */ @@ -44626,7 +46072,7 @@ index 9bf46bd..bfdaa84 100644 return rtnl_link_register(ops); }; -@@ -1001,7 +1003,7 @@ static int macvlan_device_event(struct notifier_block *unused, +@@ -1054,7 +1056,7 @@ static int macvlan_device_event(struct notifier_block *unused, return NOTIFY_DONE; } @@ -44636,9 +46082,18 @@ index 9bf46bd..bfdaa84 100644 }; diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c -index 5895e4d..0343d45 100644 +index 2a89da0..c17fe1d 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c +@@ -1012,7 +1012,7 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd, + } + + ret = 0; +- if (copy_to_user(&ifr->ifr_name, vlan->dev->name, IFNAMSIZ) || ++ if (copy_to_user(ifr->ifr_name, vlan->dev->name, IFNAMSIZ) || + put_user(q->flags, &ifr->ifr_flags)) + ret = -EFAULT; + macvtap_put_vlan(vlan); @@ -1182,7 +1182,7 @@ static int macvtap_device_event(struct notifier_block *unused, return NOTIFY_DONE; } @@ -44696,10 +46151,10 @@ index 1252d9c..80e660b 100644 /* We've got a compressed packet; read the change byte */ diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c -index 6327df2..e6e1ebe 100644 +index b75ae5b..953c157 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c -@@ -2873,7 +2873,7 @@ static int team_device_event(struct notifier_block *unused, +@@ -2865,7 +2865,7 @@ static int team_device_event(struct notifier_block *unused, return NOTIFY_DONE; } @@ -44709,10 +46164,10 @@ index 6327df2..e6e1ebe 100644 }; diff --git a/drivers/net/tun.c b/drivers/net/tun.c -index 7c8343a..80d1e69 100644 +index 55c9238..ebb6ee5 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c -@@ -1838,7 +1838,7 @@ unlock: +@@ -1841,7 +1841,7 @@ unlock: } static long __tun_chr_ioctl(struct file *file, unsigned int cmd, @@ -44721,7 +46176,7 @@ index 7c8343a..80d1e69 100644 { struct tun_file *tfile = file->private_data; struct tun_struct *tun; -@@ -1851,6 +1851,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, +@@ -1854,6 +1854,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, unsigned int ifindex; int ret; @@ -44732,7 +46187,7 @@ index 7c8343a..80d1e69 100644 if (copy_from_user(&ifr, argp, ifreq_len)) return -EFAULT; diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c -index 86292e6..8d34433 100644 +index 1a48234..a555339 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -71,7 +71,7 @@ @@ -44744,7 +46199,7 @@ index 86292e6..8d34433 100644 #define MOD_AUTHOR "Option Wireless" #define MOD_DESCRIPTION "USB High Speed Option driver" -@@ -1180,7 +1180,7 @@ static void put_rxbuf_data_and_resubmit_ctrl_urb(struct hso_serial *serial) +@@ -1179,7 +1179,7 @@ static void put_rxbuf_data_and_resubmit_ctrl_urb(struct hso_serial *serial) struct urb *urb; urb = serial->rx_urb[0]; @@ -44753,7 +46208,7 @@ index 86292e6..8d34433 100644 count = put_rxbuf_data(urb, serial); if (count == -1) return; -@@ -1216,7 +1216,7 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb) +@@ -1215,7 +1215,7 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb) DUMP1(urb->transfer_buffer, urb->actual_length); /* Anyone listening? */ @@ -44762,7 +46217,7 @@ index 86292e6..8d34433 100644 return; if (status == 0) { -@@ -1298,8 +1298,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) +@@ -1297,8 +1297,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) tty_port_tty_set(&serial->port, tty); /* check for port already opened, if not set the termios */ @@ -44772,7 +46227,7 @@ index 86292e6..8d34433 100644 serial->rx_state = RX_IDLE; /* Force default termio settings */ _hso_serial_set_termios(tty, NULL); -@@ -1311,7 +1310,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) +@@ -1310,7 +1309,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) result = hso_start_serial_device(serial->parent, GFP_KERNEL); if (result) { hso_stop_serial_device(serial->parent); @@ -44781,7 +46236,7 @@ index 86292e6..8d34433 100644 kref_put(&serial->parent->ref, hso_serial_ref_free); } } else { -@@ -1348,10 +1347,10 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp) +@@ -1347,10 +1346,10 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp) /* reset the rts and dtr */ /* do the actual close */ @@ -44795,7 +46250,7 @@ index 86292e6..8d34433 100644 tty_port_tty_set(&serial->port, NULL); if (!usb_gone) hso_stop_serial_device(serial->parent); -@@ -1427,7 +1426,7 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old) +@@ -1426,7 +1425,7 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old) /* the actual setup */ spin_lock_irqsave(&serial->serial_lock, flags); @@ -44804,7 +46259,7 @@ index 86292e6..8d34433 100644 _hso_serial_set_termios(tty, old); else tty->termios = *old; -@@ -1886,7 +1885,7 @@ static void intr_callback(struct urb *urb) +@@ -1895,7 +1894,7 @@ static void intr_callback(struct urb *urb) D1("Pending read interrupt on port %d\n", i); spin_lock(&serial->serial_lock); if (serial->rx_state == RX_IDLE && @@ -44813,7 +46268,7 @@ index 86292e6..8d34433 100644 /* Setup and send a ctrl req read on * port i */ if (!serial->rx_urb_filled[0]) { -@@ -3062,7 +3061,7 @@ static int hso_resume(struct usb_interface *iface) +@@ -3071,7 +3070,7 @@ static int hso_resume(struct usb_interface *iface) /* Start all serial ports */ for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) { if (serial_table[i] && (serial_table[i]->interface == iface)) { @@ -44845,7 +46300,7 @@ index a79e9d3..78cd4fa 100644 /* we will have to manufacture ethernet headers, prepare template */ diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c -index 1462368..578941c 100644 +index 0247973..088193a 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -2615,7 +2615,7 @@ nla_put_failure: @@ -44857,6 +46312,174 @@ index 1462368..578941c 100644 .kind = "vxlan", .maxtype = IFLA_VXLAN_MAX, .policy = vxlan_policy, +diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c +index 5920c99..ff2e4a5 100644 +--- a/drivers/net/wan/lmc/lmc_media.c ++++ b/drivers/net/wan/lmc/lmc_media.c +@@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int); + static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32); + + lmc_media_t lmc_ds3_media = { +- lmc_ds3_init, /* special media init stuff */ +- lmc_ds3_default, /* reset to default state */ +- lmc_ds3_set_status, /* reset status to state provided */ +- lmc_dummy_set_1, /* set clock source */ +- lmc_dummy_set2_1, /* set line speed */ +- lmc_ds3_set_100ft, /* set cable length */ +- lmc_ds3_set_scram, /* set scrambler */ +- lmc_ds3_get_link_status, /* get link status */ +- lmc_dummy_set_1, /* set link status */ +- lmc_ds3_set_crc_length, /* set CRC length */ +- lmc_dummy_set_1, /* set T1 or E1 circuit type */ +- lmc_ds3_watchdog ++ .init = lmc_ds3_init, /* special media init stuff */ ++ .defaults = lmc_ds3_default, /* reset to default state */ ++ .set_status = lmc_ds3_set_status, /* reset status to state provided */ ++ .set_clock_source = lmc_dummy_set_1, /* set clock source */ ++ .set_speed = lmc_dummy_set2_1, /* set line speed */ ++ .set_cable_length = lmc_ds3_set_100ft, /* set cable length */ ++ .set_scrambler = lmc_ds3_set_scram, /* set scrambler */ ++ .get_link_status = lmc_ds3_get_link_status, /* get link status */ ++ .set_link_status = lmc_dummy_set_1, /* set link status */ ++ .set_crc_length = lmc_ds3_set_crc_length, /* set CRC length */ ++ .set_circuit_type = lmc_dummy_set_1, /* set T1 or E1 circuit type */ ++ .watchdog = lmc_ds3_watchdog + }; + + lmc_media_t lmc_hssi_media = { +- lmc_hssi_init, /* special media init stuff */ +- lmc_hssi_default, /* reset to default state */ +- lmc_hssi_set_status, /* reset status to state provided */ +- lmc_hssi_set_clock, /* set clock source */ +- lmc_dummy_set2_1, /* set line speed */ +- lmc_dummy_set_1, /* set cable length */ +- lmc_dummy_set_1, /* set scrambler */ +- lmc_hssi_get_link_status, /* get link status */ +- lmc_hssi_set_link_status, /* set link status */ +- lmc_hssi_set_crc_length, /* set CRC length */ +- lmc_dummy_set_1, /* set T1 or E1 circuit type */ +- lmc_hssi_watchdog ++ .init = lmc_hssi_init, /* special media init stuff */ ++ .defaults = lmc_hssi_default, /* reset to default state */ ++ .set_status = lmc_hssi_set_status, /* reset status to state provided */ ++ .set_clock_source = lmc_hssi_set_clock, /* set clock source */ ++ .set_speed = lmc_dummy_set2_1, /* set line speed */ ++ .set_cable_length = lmc_dummy_set_1, /* set cable length */ ++ .set_scrambler = lmc_dummy_set_1, /* set scrambler */ ++ .get_link_status = lmc_hssi_get_link_status, /* get link status */ ++ .set_link_status = lmc_hssi_set_link_status, /* set link status */ ++ .set_crc_length = lmc_hssi_set_crc_length, /* set CRC length */ ++ .set_circuit_type = lmc_dummy_set_1, /* set T1 or E1 circuit type */ ++ .watchdog = lmc_hssi_watchdog + }; + +-lmc_media_t lmc_ssi_media = { lmc_ssi_init, /* special media init stuff */ +- lmc_ssi_default, /* reset to default state */ +- lmc_ssi_set_status, /* reset status to state provided */ +- lmc_ssi_set_clock, /* set clock source */ +- lmc_ssi_set_speed, /* set line speed */ +- lmc_dummy_set_1, /* set cable length */ +- lmc_dummy_set_1, /* set scrambler */ +- lmc_ssi_get_link_status, /* get link status */ +- lmc_ssi_set_link_status, /* set link status */ +- lmc_ssi_set_crc_length, /* set CRC length */ +- lmc_dummy_set_1, /* set T1 or E1 circuit type */ +- lmc_ssi_watchdog ++lmc_media_t lmc_ssi_media = { ++ .init = lmc_ssi_init, /* special media init stuff */ ++ .defaults = lmc_ssi_default, /* reset to default state */ ++ .set_status = lmc_ssi_set_status, /* reset status to state provided */ ++ .set_clock_source = lmc_ssi_set_clock, /* set clock source */ ++ .set_speed = lmc_ssi_set_speed, /* set line speed */ ++ .set_cable_length = lmc_dummy_set_1, /* set cable length */ ++ .set_scrambler = lmc_dummy_set_1, /* set scrambler */ ++ .get_link_status = lmc_ssi_get_link_status, /* get link status */ ++ .set_link_status = lmc_ssi_set_link_status, /* set link status */ ++ .set_crc_length = lmc_ssi_set_crc_length, /* set CRC length */ ++ .set_circuit_type = lmc_dummy_set_1, /* set T1 or E1 circuit type */ ++ .watchdog = lmc_ssi_watchdog + }; + + lmc_media_t lmc_t1_media = { +- lmc_t1_init, /* special media init stuff */ +- lmc_t1_default, /* reset to default state */ +- lmc_t1_set_status, /* reset status to state provided */ +- lmc_t1_set_clock, /* set clock source */ +- lmc_dummy_set2_1, /* set line speed */ +- lmc_dummy_set_1, /* set cable length */ +- lmc_dummy_set_1, /* set scrambler */ +- lmc_t1_get_link_status, /* get link status */ +- lmc_dummy_set_1, /* set link status */ +- lmc_t1_set_crc_length, /* set CRC length */ +- lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */ +- lmc_t1_watchdog ++ .init = lmc_t1_init, /* special media init stuff */ ++ .defaults = lmc_t1_default, /* reset to default state */ ++ .set_status = lmc_t1_set_status, /* reset status to state provided */ ++ .set_clock_source = lmc_t1_set_clock, /* set clock source */ ++ .set_speed = lmc_dummy_set2_1, /* set line speed */ ++ .set_cable_length = lmc_dummy_set_1, /* set cable length */ ++ .set_scrambler = lmc_dummy_set_1, /* set scrambler */ ++ .get_link_status = lmc_t1_get_link_status, /* get link status */ ++ .set_link_status = lmc_dummy_set_1, /* set link status */ ++ .set_crc_length = lmc_t1_set_crc_length, /* set CRC length */ ++ .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */ ++ .watchdog = lmc_t1_watchdog + }; + + static void +diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c +index feacc3b..5bac0de 100644 +--- a/drivers/net/wan/z85230.c ++++ b/drivers/net/wan/z85230.c +@@ -485,9 +485,9 @@ static void z8530_status(struct z8530_channel *chan) + + struct z8530_irqhandler z8530_sync = + { +- z8530_rx, +- z8530_tx, +- z8530_status ++ .rx = z8530_rx, ++ .tx = z8530_tx, ++ .status = z8530_status + }; + + EXPORT_SYMBOL(z8530_sync); +@@ -605,15 +605,15 @@ static void z8530_dma_status(struct z8530_channel *chan) + } + + static struct z8530_irqhandler z8530_dma_sync = { +- z8530_dma_rx, +- z8530_dma_tx, +- z8530_dma_status ++ .rx = z8530_dma_rx, ++ .tx = z8530_dma_tx, ++ .status = z8530_dma_status + }; + + static struct z8530_irqhandler z8530_txdma_sync = { +- z8530_rx, +- z8530_dma_tx, +- z8530_dma_status ++ .rx = z8530_rx, ++ .tx = z8530_dma_tx, ++ .status = z8530_dma_status + }; + + /** +@@ -680,9 +680,9 @@ static void z8530_status_clear(struct z8530_channel *chan) + + struct z8530_irqhandler z8530_nop= + { +- z8530_rx_clear, +- z8530_tx_clear, +- z8530_status_clear ++ .rx = z8530_rx_clear, ++ .tx = z8530_tx_clear, ++ .status = z8530_status_clear + }; + + diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c index 0b60295..b8bfa5b 100644 --- a/drivers/net/wimax/i2400m/rx.c @@ -44871,10 +46494,10 @@ index 0b60295..b8bfa5b 100644 if (rd == NULL) { result = -ENOMEM; diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c -index 7fe1964..7016de0 100644 +index edf4b57..68b51c0 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c -@@ -7844,7 +7844,7 @@ static int writerids(struct net_device *dev, aironet_ioctl *comp) { +@@ -7843,7 +7843,7 @@ static int writerids(struct net_device *dev, aironet_ioctl *comp) { struct airo_info *ai = dev->ml_priv; int ridcode; int enabled; @@ -44897,10 +46520,10 @@ index 34c8a33..3261fdc 100644 return msecs_to_jiffies((s->poll_timeout[2] << 16) | (s->poll_timeout[1] << 8) diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c -index ef3329e..c28ff5d 100644 +index edae50b..b24278c 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c -@@ -963,7 +963,10 @@ void ath10k_htc_stop(struct ath10k_htc *htc) +@@ -842,7 +842,10 @@ void ath10k_htc_stop(struct ath10k_htc *htc) /* registered target arrival callback from the HIF layer */ int ath10k_htc_init(struct ath10k *ar) { @@ -44912,7 +46535,7 @@ index ef3329e..c28ff5d 100644 struct ath10k_htc_ep *ep = NULL; struct ath10k_htc *htc = &ar->htc; -@@ -973,8 +976,6 @@ int ath10k_htc_init(struct ath10k *ar) +@@ -852,8 +855,6 @@ int ath10k_htc_init(struct ath10k *ar) ath10k_htc_reset_endpoint_states(htc); /* setup HIF layer callbacks */ @@ -44922,10 +46545,10 @@ index ef3329e..c28ff5d 100644 /* Get HIF default pipe for HTC message exchange */ diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h -index e1dd8c7..9f91b3f 100644 +index 4716d33..a688310 100644 --- a/drivers/net/wireless/ath/ath10k/htc.h +++ b/drivers/net/wireless/ath/ath10k/htc.h -@@ -271,12 +271,12 @@ enum ath10k_htc_ep_id { +@@ -271,13 +271,13 @@ enum ath10k_htc_ep_id { struct ath10k_htc_ops { void (*target_send_suspend_complete)(struct ath10k *ar); @@ -44935,6 +46558,7 @@ index e1dd8c7..9f91b3f 100644 struct ath10k_htc_ep_ops { void (*ep_tx_complete)(struct ath10k *, struct sk_buff *); void (*ep_rx_complete)(struct ath10k *, struct sk_buff *); + void (*ep_tx_credits)(struct ath10k *); -}; +} __no_const; @@ -45146,10 +46770,10 @@ index f6c5c1b..6058354 100644 static u16 ar9003_calc_ptr_chksum(struct ar9003_txc *ads) diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h -index 69a907b..91e071c 100644 +index a2c9a5d..b52273e 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h -@@ -657,7 +657,7 @@ struct ath_hw_private_ops { +@@ -635,7 +635,7 @@ struct ath_hw_private_ops { /* ANI */ void (*ani_cache_ini_regs)(struct ath_hw *ah); @@ -45158,7 +46782,7 @@ index 69a907b..91e071c 100644 /** * struct ath_spec_scan - parameters for Atheros spectral scan -@@ -729,7 +729,7 @@ struct ath_hw_ops { +@@ -711,7 +711,7 @@ struct ath_hw_ops { #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT void (*set_bt_ant_diversity)(struct ath_hw *hw, bool enable); #endif @@ -45181,7 +46805,7 @@ index 92190da..f3a4c4c 100644 u32 freqref, vco_freq, val1, val2, val3, timeout, timeoutref, count; u16 old_comm15, scale; diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c -index 9581d07..84f6a76 100644 +index dea3b50..543db99 100644 --- a/drivers/net/wireless/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/iwlegacy/3945-mac.c @@ -3639,7 +3639,9 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) @@ -45353,10 +46977,10 @@ index 7aad766..06addb4 100644 data->sku_cap_band_24GHz_enable ? "" : "NOT", "enabled", data->sku_cap_band_52GHz_enable ? "" : "NOT", "enabled", diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c -index 6bc3100..dd1b80d 100644 +index f53ef83..5e34bcb 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c -@@ -1249,7 +1249,7 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file, +@@ -1390,7 +1390,7 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file, struct isr_statistics *isr_stats = &trans_pcie->isr_stats; char buf[8]; @@ -45365,7 +46989,7 @@ index 6bc3100..dd1b80d 100644 u32 reset_flag; memset(buf, 0, sizeof(buf)); -@@ -1270,7 +1270,7 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file, +@@ -1411,7 +1411,7 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file, { struct iwl_trans *trans = file->private_data; char buf[8]; @@ -45375,10 +46999,10 @@ index 6bc3100..dd1b80d 100644 memset(buf, 0, sizeof(buf)); diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c -index 2cd3f54..e936f90 100644 +index a1b32ee..94b3c3d 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c -@@ -2196,25 +2196,19 @@ static int __init init_mac80211_hwsim(void) +@@ -2224,25 +2224,19 @@ static int __init init_mac80211_hwsim(void) if (channels > 1) { hwsim_if_comb.num_different_channels = channels; @@ -45431,10 +47055,10 @@ index 8169a85..7fa3b47 100644 tmp = cpu_to_le32(rts_threshold); diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h -index fe4c572..99dedfa 100644 +index e4ba2ce..63d7417 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h -@@ -387,7 +387,7 @@ struct rt2x00_intf { +@@ -377,7 +377,7 @@ struct rt2x00_intf { * for hardware which doesn't support hardware * sequence counting. */ @@ -45444,7 +47068,7 @@ index fe4c572..99dedfa 100644 static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif) diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c -index 66a2db8..70cad04 100644 +index a5d38e8..d3c24ea 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c @@ -252,9 +252,9 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev, @@ -45486,7 +47110,7 @@ index e2b3d9c..67a5184 100644 wl1251_info("using SDIO interrupt"); } diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c -index 1c627da..69f7d17 100644 +index be7129b..4161356 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c @@ -656,7 +656,9 @@ static int wl12xx_identify_chip(struct wl1271 *wl) @@ -45512,10 +47136,10 @@ index 1c627da..69f7d17 100644 wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER, WL127X_IFTYPE_SR_VER, WL127X_MAJOR_SR_VER, diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c -index 7aa0eb8..5a9ef38 100644 +index ec37b16..7e34d66 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c -@@ -1730,8 +1730,10 @@ static int wl18xx_setup(struct wl1271 *wl) +@@ -1823,8 +1823,10 @@ static int wl18xx_setup(struct wl1271 *wl) } if (!checksum_param) { @@ -45529,7 +47153,7 @@ index 7aa0eb8..5a9ef38 100644 /* Enable 11a Band only if we have 5G antennas */ diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c -index 7ef0b4a..ff65c28 100644 +index 84d94f5..bd6c61c 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c @@ -386,7 +386,7 @@ static inline void handle_regs_int(struct urb *urb) @@ -45542,10 +47166,10 @@ index 7ef0b4a..ff65c28 100644 ZD_ASSERT(in_interrupt()); diff --git a/drivers/nfc/nfcwilink.c b/drivers/nfc/nfcwilink.c -index 59f95d8..53e0e7f 100644 +index 7130864..00e64de 100644 --- a/drivers/nfc/nfcwilink.c +++ b/drivers/nfc/nfcwilink.c -@@ -513,7 +513,7 @@ static struct nci_ops nfcwilink_ops = { +@@ -498,7 +498,7 @@ static struct nci_ops nfcwilink_ops = { static int nfcwilink_probe(struct platform_device *pdev) { @@ -45734,10 +47358,10 @@ index 92ed045..62d39bd7 100644 #endif /* IEEE1284.3 support. */ diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c -index 2f5786c..61ab4d1 100644 +index ecfac7e..41be7028 100644 --- a/drivers/pci/hotplug/acpiphp_ibm.c +++ b/drivers/pci/hotplug/acpiphp_ibm.c -@@ -463,7 +463,9 @@ static int __init ibm_acpiphp_init(void) +@@ -453,7 +453,9 @@ static int __init ibm_acpiphp_init(void) goto init_cleanup; } @@ -45749,7 +47373,7 @@ index 2f5786c..61ab4d1 100644 return retval; diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c -index a6a71c4..c91097b 100644 +index 7536eef..52dc8fa 100644 --- a/drivers/pci/hotplug/cpcihp_generic.c +++ b/drivers/pci/hotplug/cpcihp_generic.c @@ -73,7 +73,6 @@ static u16 port; @@ -45780,7 +47404,7 @@ index a6a71c4..c91097b 100644 status = cpci_hp_register_controller(&generic_hpc); diff --git a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c -index 449b4bb..257e2e8 100644 +index e8c4a7c..7046f5c 100644 --- a/drivers/pci/hotplug/cpcihp_zt5550.c +++ b/drivers/pci/hotplug/cpcihp_zt5550.c @@ -59,7 +59,6 @@ @@ -45843,7 +47467,7 @@ index 76ba8a1..20ca857 100644 /* initialize our int15 lock */ diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c -index ec20f74..c1d961e 100644 +index cfa92a9..29539c5 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c @@ -441,8 +441,10 @@ int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, @@ -45860,7 +47484,7 @@ index ec20f74..c1d961e 100644 mutex_lock(&pci_hp_mutex); /* diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c -index f4a18f5..ff2463c 100644 +index bbd48bb..6907ef4 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c @@ -92,7 +92,7 @@ static int init_slot(struct controller *ctrl) @@ -45873,10 +47497,10 @@ index f4a18f5..ff2463c 100644 int retval = -ENOMEM; diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c -index 7128cfd..a0640d6 100644 +index c91e6c1..5c723ef 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c -@@ -1083,7 +1083,7 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine) +@@ -1117,7 +1117,7 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine) { /* allocate attribute structure, piggyback attribute name */ int name_len = write_combine ? 13 : 10; @@ -45885,7 +47509,7 @@ index 7128cfd..a0640d6 100644 int retval; res_attr = kzalloc(sizeof(*res_attr) + name_len, GFP_ATOMIC); -@@ -1268,7 +1268,7 @@ static struct device_attribute reset_attr = __ATTR(reset, 0200, NULL, reset_stor +@@ -1302,7 +1302,7 @@ static struct device_attribute reset_attr = __ATTR(reset, 0200, NULL, reset_stor static int pci_create_capabilities_sysfs(struct pci_dev *dev) { int retval; @@ -45894,7 +47518,7 @@ index 7128cfd..a0640d6 100644 /* If the device has VPD, try to expose it in sysfs. */ if (dev->vpd) { -@@ -1315,7 +1315,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev) +@@ -1349,7 +1349,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev) { int retval; int rom_size = 0; @@ -45904,7 +47528,7 @@ index 7128cfd..a0640d6 100644 if (!sysfs_initialized) return -EACCES; diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h -index 8a00c06..18a9715 100644 +index 9c91ecc..bda4796 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -95,7 +95,7 @@ struct pci_vpd_ops { @@ -45917,7 +47541,7 @@ index 8a00c06..18a9715 100644 int pci_vpd_pci22_init(struct pci_dev *dev); diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c -index 403a443..034e050 100644 +index f1272dc..e92a1ac 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -27,9 +27,9 @@ @@ -45934,7 +47558,7 @@ index 403a443..034e050 100644 #define ASPM_STATE_ALL (ASPM_STATE_L0S | ASPM_STATE_L1) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c -index 7ef0f86..17b710f 100644 +index 38e403d..a2ce55a 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -175,7 +175,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, @@ -45947,7 +47571,7 @@ index 7ef0f86..17b710f 100644 /* No printks while decoding is disabled! */ if (!dev->mmio_always_on) { diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c -index cdc7836..528635c 100644 +index 46d1378..30e452b 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -434,7 +434,16 @@ static const struct file_operations proc_bus_pci_dev_operations = { @@ -45967,6 +47591,19 @@ index cdc7836..528635c 100644 proc_create("devices", 0, proc_bus_pci_dir, &proc_bus_pci_dev_operations); proc_initialized = 1; +diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c +index 3e5b4497..dcdfb70 100644 +--- a/drivers/platform/chrome/chromeos_laptop.c ++++ b/drivers/platform/chrome/chromeos_laptop.c +@@ -301,7 +301,7 @@ static int __init setup_tsl2563_als(const struct dmi_system_id *id) + return 0; + } + +-static struct dmi_system_id __initdata chromeos_laptop_dmi_table[] = { ++static struct dmi_system_id __initconst chromeos_laptop_dmi_table[] = { + { + .ident = "Samsung Series 5 550 - Touchpad", + .matches = { diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 19c313b..ed28b38 100644 --- a/drivers/platform/x86/asus-wmi.c @@ -46004,19 +47641,6 @@ index 19c313b..ed28b38 100644 status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, 1, asus->debug.method_id, &input, &output); -diff --git a/drivers/platform/x86/chromeos_laptop.c b/drivers/platform/x86/chromeos_laptop.c -index 3e5b4497..dcdfb70 100644 ---- a/drivers/platform/x86/chromeos_laptop.c -+++ b/drivers/platform/x86/chromeos_laptop.c -@@ -301,7 +301,7 @@ static int __init setup_tsl2563_als(const struct dmi_system_id *id) - return 0; - } - --static struct dmi_system_id __initdata chromeos_laptop_dmi_table[] = { -+static struct dmi_system_id __initconst chromeos_laptop_dmi_table[] = { - { - .ident = "Samsung Series 5 550 - Touchpad", - .matches = { diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c index 62f8030..c7f2a45 100644 --- a/drivers/platform/x86/msi-laptop.c @@ -46056,10 +47680,10 @@ index 70222f2..8c8ce66 100644 acpi_status status; diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c -index 3484dd2..13ee730 100644 +index fb233ae..23a325c 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c -@@ -2448,7 +2448,7 @@ static void sony_nc_gfx_switch_cleanup(struct platform_device *pd) +@@ -2453,7 +2453,7 @@ static void sony_nc_gfx_switch_cleanup(struct platform_device *pd) } /* High speed charging function */ @@ -46069,10 +47693,10 @@ index 3484dd2..13ee730 100644 static ssize_t sony_nc_highspeed_charging_store(struct device *dev, struct device_attribute *attr, diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c -index 4e86e97..04d50d1 100644 +index 58b0274..6704626 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c -@@ -2091,7 +2091,7 @@ static int hotkey_mask_get(void) +@@ -2100,7 +2100,7 @@ static int hotkey_mask_get(void) return 0; } @@ -46081,7 +47705,7 @@ index 4e86e97..04d50d1 100644 { /* log only what the user can fix... */ const u32 wantedmask = hotkey_driver_mask & -@@ -2318,11 +2318,6 @@ static void hotkey_read_nvram(struct tp_nvram_state *n, const u32 m) +@@ -2327,11 +2327,6 @@ static void hotkey_read_nvram(struct tp_nvram_state *n, const u32 m) } } @@ -46093,7 +47717,7 @@ index 4e86e97..04d50d1 100644 #define TPACPI_COMPARE_KEY(__scancode, __member) \ do { \ if ((event_mask & (1 << __scancode)) && \ -@@ -2336,36 +2331,42 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, +@@ -2345,36 +2340,42 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, tpacpi_hotkey_send_key(__scancode); \ } while (0) @@ -46160,7 +47784,7 @@ index 4e86e97..04d50d1 100644 TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_THINKPAD, thinkpad_toggle); TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_FNSPACE, zoom_toggle); TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_FNF7, display_toggle); -@@ -2399,7 +2400,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, +@@ -2408,7 +2409,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, oldn->volume_level != newn->volume_level) { /* recently muted, or repeated mute keypress, or * multiple presses ending in mute */ @@ -46169,7 +47793,7 @@ index 4e86e97..04d50d1 100644 TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_MUTE); } } else { -@@ -2409,7 +2410,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, +@@ -2418,7 +2419,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEUP); } if (oldn->volume_level != newn->volume_level) { @@ -46178,7 +47802,7 @@ index 4e86e97..04d50d1 100644 } else if (oldn->volume_toggle != newn->volume_toggle) { /* repeated vol up/down keypress at end of scale ? */ if (newn->volume_level == 0) -@@ -2422,7 +2423,8 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, +@@ -2431,7 +2432,8 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, /* handle brightness */ if (oldn->brightness_level != newn->brightness_level) { issue_brightnesschange(oldn->brightness_level, @@ -46188,7 +47812,7 @@ index 4e86e97..04d50d1 100644 } else if (oldn->brightness_toggle != newn->brightness_toggle) { /* repeated key presses that didn't change state */ if (newn->brightness_level == 0) -@@ -2431,10 +2433,10 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, +@@ -2440,10 +2442,10 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, && !tp_features.bright_unkfw) TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNHOME); } @@ -46375,11 +47999,200 @@ index 44420d1..967126e 100644 for (i = 0; i < ARRAY_SIZE(power_supply_attrs); i++) __power_supply_attrs[i] = &power_supply_attrs[i].attr; } +diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c +index 84419af..268ede8 100644 +--- a/drivers/powercap/powercap_sys.c ++++ b/drivers/powercap/powercap_sys.c +@@ -154,8 +154,77 @@ struct powercap_constraint_attr { + struct device_attribute name_attr; + }; + ++static ssize_t show_constraint_name(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf); ++ + static struct powercap_constraint_attr +- constraint_attrs[MAX_CONSTRAINTS_PER_ZONE]; ++ constraint_attrs[MAX_CONSTRAINTS_PER_ZONE] = { ++ [0 ... MAX_CONSTRAINTS_PER_ZONE - 1] = { ++ .power_limit_attr = { ++ .attr = { ++ .name = NULL, ++ .mode = S_IWUSR | S_IRUGO ++ }, ++ .show = show_constraint_power_limit_uw, ++ .store = store_constraint_power_limit_uw ++ }, ++ ++ .time_window_attr = { ++ .attr = { ++ .name = NULL, ++ .mode = S_IWUSR | S_IRUGO ++ }, ++ .show = show_constraint_time_window_us, ++ .store = store_constraint_time_window_us ++ }, ++ ++ .max_power_attr = { ++ .attr = { ++ .name = NULL, ++ .mode = S_IRUGO ++ }, ++ .show = show_constraint_max_power_uw, ++ .store = NULL ++ }, ++ ++ .min_power_attr = { ++ .attr = { ++ .name = NULL, ++ .mode = S_IRUGO ++ }, ++ .show = show_constraint_min_power_uw, ++ .store = NULL ++ }, ++ ++ .max_time_window_attr = { ++ .attr = { ++ .name = NULL, ++ .mode = S_IRUGO ++ }, ++ .show = show_constraint_max_time_window_us, ++ .store = NULL ++ }, ++ ++ .min_time_window_attr = { ++ .attr = { ++ .name = NULL, ++ .mode = S_IRUGO ++ }, ++ .show = show_constraint_min_time_window_us, ++ .store = NULL ++ }, ++ ++ .name_attr = { ++ .attr = { ++ .name = NULL, ++ .mode = S_IRUGO ++ }, ++ .show = show_constraint_name, ++ .store = NULL ++ } ++ } ++}; + + /* A list of powercap control_types */ + static LIST_HEAD(powercap_cntrl_list); +@@ -193,23 +262,16 @@ static ssize_t show_constraint_name(struct device *dev, + } + + static int create_constraint_attribute(int id, const char *name, +- int mode, +- struct device_attribute *dev_attr, +- ssize_t (*show)(struct device *, +- struct device_attribute *, char *), +- ssize_t (*store)(struct device *, +- struct device_attribute *, +- const char *, size_t) +- ) ++ struct device_attribute *dev_attr) + { ++ name = kasprintf(GFP_KERNEL, "constraint_%d_%s", id, name); + +- dev_attr->attr.name = kasprintf(GFP_KERNEL, "constraint_%d_%s", +- id, name); +- if (!dev_attr->attr.name) ++ if (!name) + return -ENOMEM; +- dev_attr->attr.mode = mode; +- dev_attr->show = show; +- dev_attr->store = store; ++ ++ pax_open_kernel(); ++ *(const char **)&dev_attr->attr.name = name; ++ pax_close_kernel(); + + return 0; + } +@@ -236,49 +298,31 @@ static int seed_constraint_attributes(void) + + for (i = 0; i < MAX_CONSTRAINTS_PER_ZONE; ++i) { + ret = create_constraint_attribute(i, "power_limit_uw", +- S_IWUSR | S_IRUGO, +- &constraint_attrs[i].power_limit_attr, +- show_constraint_power_limit_uw, +- store_constraint_power_limit_uw); ++ &constraint_attrs[i].power_limit_attr); + if (ret) + goto err_alloc; + ret = create_constraint_attribute(i, "time_window_us", +- S_IWUSR | S_IRUGO, +- &constraint_attrs[i].time_window_attr, +- show_constraint_time_window_us, +- store_constraint_time_window_us); ++ &constraint_attrs[i].time_window_attr); + if (ret) + goto err_alloc; +- ret = create_constraint_attribute(i, "name", S_IRUGO, +- &constraint_attrs[i].name_attr, +- show_constraint_name, +- NULL); ++ ret = create_constraint_attribute(i, "name", ++ &constraint_attrs[i].name_attr); + if (ret) + goto err_alloc; +- ret = create_constraint_attribute(i, "max_power_uw", S_IRUGO, +- &constraint_attrs[i].max_power_attr, +- show_constraint_max_power_uw, +- NULL); ++ ret = create_constraint_attribute(i, "max_power_uw", ++ &constraint_attrs[i].max_power_attr); + if (ret) + goto err_alloc; +- ret = create_constraint_attribute(i, "min_power_uw", S_IRUGO, +- &constraint_attrs[i].min_power_attr, +- show_constraint_min_power_uw, +- NULL); ++ ret = create_constraint_attribute(i, "min_power_uw", ++ &constraint_attrs[i].min_power_attr); + if (ret) + goto err_alloc; + ret = create_constraint_attribute(i, "max_time_window_us", +- S_IRUGO, +- &constraint_attrs[i].max_time_window_attr, +- show_constraint_max_time_window_us, +- NULL); ++ &constraint_attrs[i].max_time_window_attr); + if (ret) + goto err_alloc; + ret = create_constraint_attribute(i, "min_time_window_us", +- S_IRUGO, +- &constraint_attrs[i].min_time_window_attr, +- show_constraint_min_time_window_us, +- NULL); ++ &constraint_attrs[i].min_time_window_attr); + if (ret) + goto err_alloc; + +@@ -378,10 +422,12 @@ static void create_power_zone_common_attributes( + power_zone->zone_dev_attrs[count++] = + &dev_attr_max_energy_range_uj.attr; + if (power_zone->ops->get_energy_uj) { ++ pax_open_kernel(); + if (power_zone->ops->reset_energy_uj) +- dev_attr_energy_uj.attr.mode = S_IWUSR | S_IRUGO; ++ *(umode_t *)&dev_attr_energy_uj.attr.mode = S_IWUSR | S_IRUGO; + else +- dev_attr_energy_uj.attr.mode = S_IRUGO; ++ *(umode_t *)&dev_attr_energy_uj.attr.mode = S_IRUGO; ++ pax_close_kernel(); + power_zone->zone_dev_attrs[count++] = + &dev_attr_energy_uj.attr; + } diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c -index a01b8b3..37c2afe 100644 +index 75dffb79..df850cd 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c -@@ -3307,7 +3307,7 @@ regulator_register(const struct regulator_desc *regulator_desc, +@@ -3370,7 +3370,7 @@ regulator_register(const struct regulator_desc *regulator_desc, { const struct regulation_constraints *constraints = NULL; const struct regulator_init_data *init_data; @@ -46388,7 +48201,7 @@ index a01b8b3..37c2afe 100644 struct regulator_dev *rdev; struct device *dev; int ret, i; -@@ -3377,7 +3377,7 @@ regulator_register(const struct regulator_desc *regulator_desc, +@@ -3440,7 +3440,7 @@ regulator_register(const struct regulator_desc *regulator_desc, rdev->dev.of_node = config->of_node; rdev->dev.parent = dev; dev_set_name(&rdev->dev, "regulator.%d", @@ -46398,7 +48211,7 @@ index a01b8b3..37c2afe 100644 if (ret != 0) { put_device(&rdev->dev); diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c -index 144bcac..d20e7db 100644 +index 8d94d3d..653b623 100644 --- a/drivers/regulator/max8660.c +++ b/drivers/regulator/max8660.c @@ -420,8 +420,10 @@ static int max8660_probe(struct i2c_client *client, @@ -46415,7 +48228,7 @@ index 144bcac..d20e7db 100644 /* diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c -index 5b77ab7..a62f061 100644 +index 892aa1e..ebd1b9c 100644 --- a/drivers/regulator/max8973-regulator.c +++ b/drivers/regulator/max8973-regulator.c @@ -406,9 +406,11 @@ static int max8973_probe(struct i2c_client *client, @@ -46434,7 +48247,7 @@ index 5b77ab7..a62f061 100644 if (pdata) { diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c -index 1037e07..e64dea1 100644 +index 96c9f80..90974ca 100644 --- a/drivers/regulator/mc13892-regulator.c +++ b/drivers/regulator/mc13892-regulator.c @@ -582,10 +582,12 @@ static int mc13892_regulator_probe(struct platform_device *pdev) @@ -46453,10 +48266,10 @@ index 1037e07..e64dea1 100644 mc13xxx_data = mc13xxx_parse_regulators_dt(pdev, mc13892_regulators, ARRAY_SIZE(mc13892_regulators)); diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c -index 24e733c..bfbaa3e 100644 +index a2325bc..04c549f 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c -@@ -731,7 +731,9 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq) +@@ -779,7 +779,9 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq) hpet_rtc_timer_init(); /* export at least the first block of NVRAM */ @@ -46489,7 +48302,7 @@ index d049393..bb20be0 100644 case RTC_PIE_ON: diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c -index ca18fd1..055e42d 100644 +index 4e75345..09f8663 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -107,7 +107,7 @@ struct ds1307 { @@ -46502,7 +48315,7 @@ index ca18fd1..055e42d 100644 unsigned long flags; #define HAS_NVRAM 0 /* bit 0 == sysfs file active */ diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c -index fcb0329..d77b7f2 100644 +index 11880c1..b823aa4 100644 --- a/drivers/rtc/rtc-m48t59.c +++ b/drivers/rtc/rtc-m48t59.c @@ -483,7 +483,9 @@ static int m48t59_rtc_probe(struct platform_device *pdev) @@ -46570,6 +48383,76 @@ index e693af6..2e525b6 100644 void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport, void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m)); +diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c +index a3ab5cc..8143622 100644 +--- a/drivers/scsi/bfa/bfa_fcs.c ++++ b/drivers/scsi/bfa/bfa_fcs.c +@@ -38,10 +38,21 @@ struct bfa_fcs_mod_s { + #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit } + + static struct bfa_fcs_mod_s fcs_modules[] = { +- { bfa_fcs_port_attach, NULL, NULL }, +- { bfa_fcs_uf_attach, NULL, NULL }, +- { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit, +- bfa_fcs_fabric_modexit }, ++ { ++ .attach = bfa_fcs_port_attach, ++ .modinit = NULL, ++ .modexit = NULL ++ }, ++ { ++ .attach = bfa_fcs_uf_attach, ++ .modinit = NULL, ++ .modexit = NULL ++ }, ++ { ++ .attach = bfa_fcs_fabric_attach, ++ .modinit = bfa_fcs_fabric_modinit, ++ .modexit = bfa_fcs_fabric_modexit ++ }, + }; + + /* +diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c +index f5e4e61..a0acaf6 100644 +--- a/drivers/scsi/bfa/bfa_fcs_lport.c ++++ b/drivers/scsi/bfa/bfa_fcs_lport.c +@@ -89,15 +89,26 @@ static struct { + void (*offline) (struct bfa_fcs_lport_s *port); + } __port_action[] = { + { +- bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online, +- bfa_fcs_lport_unknown_offline}, { +- bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online, +- bfa_fcs_lport_fab_offline}, { +- bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online, +- bfa_fcs_lport_n2n_offline}, { +- bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online, +- bfa_fcs_lport_loop_offline}, +- }; ++ .init = bfa_fcs_lport_unknown_init, ++ .online = bfa_fcs_lport_unknown_online, ++ .offline = bfa_fcs_lport_unknown_offline ++ }, ++ { ++ .init = bfa_fcs_lport_fab_init, ++ .online = bfa_fcs_lport_fab_online, ++ .offline = bfa_fcs_lport_fab_offline ++ }, ++ { ++ .init = bfa_fcs_lport_n2n_init, ++ .online = bfa_fcs_lport_n2n_online, ++ .offline = bfa_fcs_lport_n2n_offline ++ }, ++ { ++ .init = bfa_fcs_lport_loop_init, ++ .online = bfa_fcs_lport_loop_online, ++ .offline = bfa_fcs_lport_loop_offline ++ }, ++}; + + /* + * fcs_port_sm FCS logical port state machine diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index 90814fe..4384138 100644 --- a/drivers/scsi/bfa/bfa_ioc.h @@ -46592,8 +48475,31 @@ index 90814fe..4384138 100644 /* * Queue element to wait for room in request queue. FIFO order is +diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h +index a14c784..6de6790 100644 +--- a/drivers/scsi/bfa/bfa_modules.h ++++ b/drivers/scsi/bfa/bfa_modules.h +@@ -78,12 +78,12 @@ enum { + \ + extern struct bfa_module_s hal_mod_ ## __mod; \ + struct bfa_module_s hal_mod_ ## __mod = { \ +- bfa_ ## __mod ## _meminfo, \ +- bfa_ ## __mod ## _attach, \ +- bfa_ ## __mod ## _detach, \ +- bfa_ ## __mod ## _start, \ +- bfa_ ## __mod ## _stop, \ +- bfa_ ## __mod ## _iocdisable, \ ++ .meminfo = bfa_ ## __mod ## _meminfo, \ ++ .attach = bfa_ ## __mod ## _attach, \ ++ .detach = bfa_ ## __mod ## _detach, \ ++ .start = bfa_ ## __mod ## _start, \ ++ .stop = bfa_ ## __mod ## _stop, \ ++ .iocdisable = bfa_ ## __mod ## _iocdisable, \ + } + + #define BFA_CACHELINE_SZ (256) diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c -index c9382d6..6619864 100644 +index 045c4e1..13de803 100644 --- a/drivers/scsi/fcoe/fcoe_sysfs.c +++ b/drivers/scsi/fcoe/fcoe_sysfs.c @@ -33,8 +33,8 @@ @@ -46607,7 +48513,7 @@ index c9382d6..6619864 100644 /* * fcoe_fcf_dev_loss_tmo: the default number of seconds that fcoe sysfs -@@ -681,7 +681,7 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent, +@@ -685,7 +685,7 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent, if (!ctlr) goto out; @@ -46616,7 +48522,7 @@ index c9382d6..6619864 100644 ctlr->f = f; ctlr->mode = FIP_CONN_TYPE_FABRIC; INIT_LIST_HEAD(&ctlr->fcfs); -@@ -898,7 +898,7 @@ struct fcoe_fcf_device *fcoe_fcf_device_add(struct fcoe_ctlr_device *ctlr, +@@ -902,7 +902,7 @@ struct fcoe_fcf_device *fcoe_fcf_device_add(struct fcoe_ctlr_device *ctlr, fcf->dev.parent = &ctlr->dev; fcf->dev.bus = &fcoe_bus_type; fcf->dev.type = &fcoe_fcf_device_type; @@ -46625,7 +48531,7 @@ index c9382d6..6619864 100644 fcf->state = FCOE_FCF_STATE_UNKNOWN; fcf->dev_loss_tmo = ctlr->fcf_dev_loss_tmo; -@@ -934,8 +934,8 @@ int __init fcoe_sysfs_setup(void) +@@ -938,8 +938,8 @@ int __init fcoe_sysfs_setup(void) { int error; @@ -46637,7 +48543,7 @@ index c9382d6..6619864 100644 error = bus_register(&fcoe_bus_type); if (error) diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c -index 3cafe0d..f1e87f8 100644 +index f2c5005..db36c02 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -42,7 +42,7 @@ @@ -46649,7 +48555,7 @@ index 3cafe0d..f1e87f8 100644 static void scsi_host_cls_release(struct device *dev) -@@ -361,7 +361,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) +@@ -367,7 +367,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) * subtract one because we increment first then return, but we need to * know what the next host number was before increment */ @@ -46659,10 +48565,10 @@ index 3cafe0d..f1e87f8 100644 /* These three are default values which can be overridden */ diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c -index 0eb0940..3ca9b79 100644 +index 20a5e6e..8b23cea 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c -@@ -579,7 +579,7 @@ static inline u32 next_command(struct ctlr_info *h, u8 q) +@@ -578,7 +578,7 @@ static inline u32 next_command(struct ctlr_info *h, u8 q) unsigned long flags; if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant))) @@ -46671,7 +48577,7 @@ index 0eb0940..3ca9b79 100644 if ((rq->head[rq->current_entry] & 1) == rq->wraparound) { a = rq->head[rq->current_entry]; -@@ -3445,7 +3445,7 @@ static void start_io(struct ctlr_info *h) +@@ -3444,7 +3444,7 @@ static void start_io(struct ctlr_info *h) while (!list_empty(&h->reqQ)) { c = list_entry(h->reqQ.next, struct CommandList, list); /* can't do anything if fifo is full */ @@ -46680,7 +48586,7 @@ index 0eb0940..3ca9b79 100644 dev_warn(&h->pdev->dev, "fifo full\n"); break; } -@@ -3467,7 +3467,7 @@ static void start_io(struct ctlr_info *h) +@@ -3466,7 +3466,7 @@ static void start_io(struct ctlr_info *h) /* Tell the controller execute command */ spin_unlock_irqrestore(&h->lock, flags); @@ -46689,7 +48595,7 @@ index 0eb0940..3ca9b79 100644 spin_lock_irqsave(&h->lock, flags); } spin_unlock_irqrestore(&h->lock, flags); -@@ -3475,17 +3475,17 @@ static void start_io(struct ctlr_info *h) +@@ -3474,17 +3474,17 @@ static void start_io(struct ctlr_info *h) static inline unsigned long get_next_completion(struct ctlr_info *h, u8 q) { @@ -46710,7 +48616,7 @@ index 0eb0940..3ca9b79 100644 (h->interrupts_enabled == 0); } -@@ -4387,7 +4387,7 @@ static int hpsa_pci_init(struct ctlr_info *h) +@@ -4386,7 +4386,7 @@ static int hpsa_pci_init(struct ctlr_info *h) if (prod_index < 0) return -ENODEV; h->product_name = products[prod_index].product_name; @@ -46719,7 +48625,7 @@ index 0eb0940..3ca9b79 100644 pci_disable_link_state(h->pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_CLKPM); -@@ -4669,7 +4669,7 @@ static void controller_lockup_detected(struct ctlr_info *h) +@@ -4668,7 +4668,7 @@ static void controller_lockup_detected(struct ctlr_info *h) assert_spin_locked(&lockup_detector_lock); remove_ctlr_from_lockup_detector_list(h); @@ -46728,7 +48634,7 @@ index 0eb0940..3ca9b79 100644 spin_lock_irqsave(&h->lock, flags); h->lockup_detected = readl(h->vaddr + SA5_SCRATCHPAD_OFFSET); spin_unlock_irqrestore(&h->lock, flags); -@@ -4846,7 +4846,7 @@ reinit_after_soft_reset: +@@ -4845,7 +4845,7 @@ reinit_after_soft_reset: } /* make sure the board interrupts are off */ @@ -46737,7 +48643,7 @@ index 0eb0940..3ca9b79 100644 if (hpsa_request_irq(h, do_hpsa_intr_msi, do_hpsa_intr_intx)) goto clean2; -@@ -4880,7 +4880,7 @@ reinit_after_soft_reset: +@@ -4879,7 +4879,7 @@ reinit_after_soft_reset: * fake ones to scoop up any residual completions. */ spin_lock_irqsave(&h->lock, flags); @@ -46746,7 +48652,7 @@ index 0eb0940..3ca9b79 100644 spin_unlock_irqrestore(&h->lock, flags); free_irqs(h); rc = hpsa_request_irq(h, hpsa_msix_discard_completions, -@@ -4899,9 +4899,9 @@ reinit_after_soft_reset: +@@ -4898,9 +4898,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"); @@ -46758,7 +48664,7 @@ index 0eb0940..3ca9b79 100644 rc = controller_reset_failed(h->cfgtable); if (rc) -@@ -4922,7 +4922,7 @@ reinit_after_soft_reset: +@@ -4921,7 +4921,7 @@ reinit_after_soft_reset: } /* Turn the interrupts on so we can service requests */ @@ -46767,7 +48673,7 @@ index 0eb0940..3ca9b79 100644 hpsa_hba_inquiry(h); hpsa_register_scsi(h); /* hook ourselves into SCSI subsystem */ -@@ -4977,7 +4977,7 @@ static void hpsa_shutdown(struct pci_dev *pdev) +@@ -4976,7 +4976,7 @@ static void hpsa_shutdown(struct pci_dev *pdev) * To write all data in the battery backed cache to disks */ hpsa_flush_cache(h); @@ -46776,7 +48682,7 @@ index 0eb0940..3ca9b79 100644 hpsa_free_irqs_and_disable_msix(h); } -@@ -5145,7 +5145,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 use_short_tags) +@@ -5143,7 +5143,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 use_short_tags) return; } /* Change the access methods to the performant access methods */ @@ -46786,7 +48692,7 @@ index 0eb0940..3ca9b79 100644 } diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h -index bc85e72..ae04a39 100644 +index bc85e72..d463049 100644 --- a/drivers/scsi/hpsa.h +++ b/drivers/scsi/hpsa.h @@ -79,7 +79,7 @@ struct ctlr_info { @@ -46798,11 +48704,41 @@ index bc85e72..ae04a39 100644 /* queue and queue Info */ struct list_head reqQ; +@@ -381,19 +381,19 @@ static bool SA5_performant_intr_pending(struct ctlr_info *h) + } + + static struct access_method SA5_access = { +- SA5_submit_command, +- SA5_intr_mask, +- SA5_fifo_full, +- SA5_intr_pending, +- SA5_completed, ++ .submit_command = SA5_submit_command, ++ .set_intr_mask = SA5_intr_mask, ++ .fifo_full = SA5_fifo_full, ++ .intr_pending = SA5_intr_pending, ++ .command_completed = SA5_completed, + }; + + static struct access_method SA5_performant_access = { +- SA5_submit_command, +- SA5_performant_intr_mask, +- SA5_fifo_full, +- SA5_performant_intr_pending, +- SA5_performant_completed, ++ .submit_command = SA5_submit_command, ++ .set_intr_mask = SA5_performant_intr_mask, ++ .fifo_full = SA5_fifo_full, ++ .intr_pending = SA5_performant_intr_pending, ++ .command_completed = SA5_performant_completed, + }; + + struct board_type { diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c -index 5879929..32b241d 100644 +index 1b3a094..068e683 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c -@@ -100,12 +100,12 @@ struct fc_exch_mgr { +@@ -101,12 +101,12 @@ struct fc_exch_mgr { u16 pool_max_index; struct { @@ -46821,7 +48757,7 @@ index 5879929..32b241d 100644 } stats; }; -@@ -736,7 +736,7 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport, +@@ -811,7 +811,7 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport, /* allocate memory for exchange */ ep = mempool_alloc(mp->ep_pool, GFP_ATOMIC); if (!ep) { @@ -46830,7 +48766,7 @@ index 5879929..32b241d 100644 goto out; } memset(ep, 0, sizeof(*ep)); -@@ -797,7 +797,7 @@ out: +@@ -874,7 +874,7 @@ out: return ep; err: spin_unlock_bh(&pool->lock); @@ -46839,7 +48775,7 @@ index 5879929..32b241d 100644 mempool_free(ep, mp->ep_pool); return NULL; } -@@ -940,7 +940,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, +@@ -1023,7 +1023,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, xid = ntohs(fh->fh_ox_id); /* we originated exch */ ep = fc_exch_find(mp, xid); if (!ep) { @@ -46848,7 +48784,7 @@ index 5879929..32b241d 100644 reject = FC_RJT_OX_ID; goto out; } -@@ -970,7 +970,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, +@@ -1053,7 +1053,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, ep = fc_exch_find(mp, xid); if ((f_ctl & FC_FC_FIRST_SEQ) && fc_sof_is_init(fr_sof(fp))) { if (ep) { @@ -46857,7 +48793,7 @@ index 5879929..32b241d 100644 reject = FC_RJT_RX_ID; goto rel; } -@@ -981,7 +981,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, +@@ -1064,7 +1064,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, } xid = ep->xid; /* get our XID */ } else if (!ep) { @@ -46866,7 +48802,7 @@ index 5879929..32b241d 100644 reject = FC_RJT_RX_ID; /* XID not found */ goto out; } -@@ -998,7 +998,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, +@@ -1082,7 +1082,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, } else { sp = &ep->seq; if (sp->id != fh->fh_seq_id) { @@ -46875,7 +48811,7 @@ index 5879929..32b241d 100644 if (f_ctl & FC_FC_END_SEQ) { /* * Update sequence_id based on incoming last -@@ -1448,22 +1448,22 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) +@@ -1533,22 +1533,22 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) ep = fc_exch_find(mp, ntohs(fh->fh_ox_id)); if (!ep) { @@ -46902,7 +48838,7 @@ index 5879929..32b241d 100644 goto rel; } sof = fr_sof(fp); -@@ -1472,7 +1472,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) +@@ -1557,7 +1557,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) sp->ssb_stat |= SSB_ST_RESP; sp->id = fh->fh_seq_id; } else if (sp->id != fh->fh_seq_id) { @@ -46911,7 +48847,7 @@ index 5879929..32b241d 100644 goto rel; } -@@ -1536,9 +1536,9 @@ static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) +@@ -1619,9 +1619,9 @@ static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) sp = fc_seq_lookup_orig(mp, fp); /* doesn't hold sequence */ if (!sp) @@ -46923,7 +48859,7 @@ index 5879929..32b241d 100644 fc_frame_free(fp); } -@@ -2185,13 +2185,13 @@ void fc_exch_update_stats(struct fc_lport *lport) +@@ -2261,13 +2261,13 @@ void fc_exch_update_stats(struct fc_lport *lport) list_for_each_entry(ema, &lport->ema_list, ema_list) { mp = ema->mp; @@ -47073,10 +49009,10 @@ index 60084e6..0e2e700 100644 snprintf(name, sizeof(name), "discovery_trace"); vport->debug_disc_trc = diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c -index 647f5bf..d0068b9 100644 +index 68c94cc..8c27be5 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c -@@ -10952,8 +10952,10 @@ lpfc_init(void) +@@ -10949,8 +10949,10 @@ lpfc_init(void) "misc_register returned with status %d", error); if (lpfc_enable_npiv) { @@ -47090,7 +49026,7 @@ index 647f5bf..d0068b9 100644 lpfc_transport_template = fc_attach_transport(&lpfc_transport_functions); diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c -index c913e8c..d34a119 100644 +index b2ede05..aaf482ca 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -353,7 +353,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba) @@ -47185,7 +49121,7 @@ index 7f0af4f..193ac3e 100644 unsigned long flags; diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c -index a38f71b..f3bc572 100644 +index be8ce54..94ed33a 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -200,8 +200,8 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev) @@ -47199,7 +49135,7 @@ index a38f71b..f3bc572 100644 rc = 0; } spin_unlock_irqrestore(&pinstance->resource_lock, lock_flags); -@@ -2676,9 +2676,9 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd) +@@ -2687,9 +2687,9 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd) /* If this was a SCSI read/write command keep count of errors */ if (SCSI_CMD_TYPE(scsi_cmd->cmnd[0]) == SCSI_READ_CMD) @@ -47211,7 +49147,7 @@ index a38f71b..f3bc572 100644 if (!RES_IS_GSCSI(res->cfg_entry) && masked_ioasc != PMCRAID_IOASC_HW_DEVICE_BUS_STATUS_ERROR) { -@@ -3534,7 +3534,7 @@ static int pmcraid_queuecommand_lck( +@@ -3545,7 +3545,7 @@ static int pmcraid_queuecommand_lck( * block of scsi_cmd which is re-used (e.g. cancel/abort), which uses * hrrq_id assigned here in queuecommand */ @@ -47220,7 +49156,7 @@ index a38f71b..f3bc572 100644 pinstance->num_hrrq; cmd->cmd_done = pmcraid_io_done; -@@ -3846,7 +3846,7 @@ static long pmcraid_ioctl_passthrough( +@@ -3857,7 +3857,7 @@ static long pmcraid_ioctl_passthrough( * block of scsi_cmd which is re-used (e.g. cancel/abort), which uses * hrrq_id assigned here in queuecommand */ @@ -47229,7 +49165,7 @@ index a38f71b..f3bc572 100644 pinstance->num_hrrq; if (request_size) { -@@ -4484,7 +4484,7 @@ static void pmcraid_worker_function(struct work_struct *workp) +@@ -4495,7 +4495,7 @@ static void pmcraid_worker_function(struct work_struct *workp) pinstance = container_of(workp, struct pmcraid_instance, worker_q); /* add resources only after host is added into system */ @@ -47238,7 +49174,7 @@ index a38f71b..f3bc572 100644 return; fw_version = be16_to_cpu(pinstance->inq_data->fw_version); -@@ -5311,8 +5311,8 @@ static int pmcraid_init_instance(struct pci_dev *pdev, struct Scsi_Host *host, +@@ -5322,8 +5322,8 @@ static int pmcraid_init_instance(struct pci_dev *pdev, struct Scsi_Host *host, init_waitqueue_head(&pinstance->reset_wait_q); atomic_set(&pinstance->outstanding_cmds, 0); @@ -47249,7 +49185,7 @@ index a38f71b..f3bc572 100644 INIT_LIST_HEAD(&pinstance->free_res_q); INIT_LIST_HEAD(&pinstance->used_res_q); -@@ -6025,7 +6025,7 @@ static int pmcraid_probe(struct pci_dev *pdev, +@@ -6036,7 +6036,7 @@ static int pmcraid_probe(struct pci_dev *pdev, /* Schedule worker thread to handle CCN and take care of adding and * removing devices to OS */ @@ -47329,10 +49265,10 @@ index 4446bf5..9a3574d 100644 extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *); extern void qla2x00_init_host_attr(scsi_qla_host_t *); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c -index 9f01bbb..5e1dcee 100644 +index 52be35e..b933907 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c -@@ -1572,8 +1572,10 @@ qla2x00_config_dma_addressing(struct qla_hw_data *ha) +@@ -1568,8 +1568,10 @@ qla2x00_config_dma_addressing(struct qla_hw_data *ha) !pci_set_consistent_dma_mask(ha->pdev, DMA_BIT_MASK(64))) { /* Ok, a 64bit DMA mask is applicable. */ ha->flags.enable_64bit_addressing = 1; @@ -47346,7 +49282,7 @@ index 9f01bbb..5e1dcee 100644 } } diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h -index 41327d4..feb03d479 100644 +index 084d1fd..9f939eb 100644 --- a/drivers/scsi/qla4xxx/ql4_def.h +++ b/drivers/scsi/qla4xxx/ql4_def.h @@ -296,7 +296,7 @@ struct ddb_entry { @@ -47359,10 +49295,10 @@ index 41327d4..feb03d479 100644 uint32_t default_time2wait; /* Default Min time between * relogins (+aens) */ diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c -index f8a0a26..ec03cee 100644 +index cf174a4..128a420 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c -@@ -3066,12 +3066,12 @@ static void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess) +@@ -3311,12 +3311,12 @@ static void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess) */ if (!iscsi_is_session_online(cls_sess)) { /* Reset retry relogin timer */ @@ -47377,7 +49313,7 @@ index f8a0a26..ec03cee 100644 ddb_entry->default_time2wait + 4)); set_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags); atomic_set(&ddb_entry->retry_relogin_timer, -@@ -5209,7 +5209,7 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha, +@@ -5458,7 +5458,7 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha, atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY); atomic_set(&ddb_entry->relogin_timer, 0); @@ -47387,11 +49323,11 @@ index f8a0a26..ec03cee 100644 ddb_entry->default_relogin_timeout = (def_timeout > LOGIN_TOV) && (def_timeout < LOGIN_TOV * 10) ? diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c -index eaa808e..95f8841 100644 +index fe0bcb1..c9255be 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c -@@ -661,7 +661,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) - unsigned long timeout; +@@ -655,7 +655,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) + struct Scsi_Host *host = cmd->device->host; int rtn = 0; - atomic_inc(&cmd->device->iorequest_cnt); @@ -47400,7 +49336,7 @@ index eaa808e..95f8841 100644 /* check if the device is still usable */ if (unlikely(cmd->device->sdev_state == SDEV_DEL)) { diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c -index d1549b7..2f60767 100644 +index 7bd7f0d..93159d8 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1474,7 +1474,7 @@ static void scsi_kill_request(struct request *req, struct request_queue *q) @@ -47424,11 +49360,20 @@ index d1549b7..2f60767 100644 disposition = scsi_decide_disposition(cmd); if (disposition != SUCCESS && +@@ -1684,7 +1684,7 @@ u64 scsi_calculate_bounce_limit(struct Scsi_Host *shost) + + host_dev = scsi_get_device(shost); + if (host_dev && host_dev->dma_mask) +- bounce_limit = dma_max_pfn(host_dev) << PAGE_SHIFT; ++ bounce_limit = (u64)dma_max_pfn(host_dev) << PAGE_SHIFT; + + return bounce_limit; + } diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c -index 40c6394..62356c2 100644 +index 8ff62c2..693b6f7 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c -@@ -687,7 +687,7 @@ show_iostat_##field(struct device *dev, struct device_attribute *attr, \ +@@ -725,7 +725,7 @@ show_iostat_##field(struct device *dev, struct device_attribute *attr, \ char *buf) \ { \ struct scsi_device *sdev = to_scsi_device(dev); \ @@ -47491,7 +49436,7 @@ index 4628fd5..a94a1c2 100644 /* * Check for overflow; dev_loss_tmo is u32 diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c -index e4a989f..293090c 100644 +index 63a6ca4..5d5cadd 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -79,7 +79,7 @@ struct iscsi_internal { @@ -47512,7 +49457,7 @@ index e4a989f..293090c 100644 if (target_id == ISCSI_MAX_TARGET) { id = ida_simple_get(&iscsi_sess_ida, 0, 0, GFP_KERNEL); -@@ -4077,7 +4077,7 @@ static __init int iscsi_transport_init(void) +@@ -4103,7 +4103,7 @@ static __init int iscsi_transport_init(void) printk(KERN_INFO "Loading iSCSI transport class v%s.\n", ISCSI_TRANSPORT_VERSION); @@ -47522,10 +49467,10 @@ index e4a989f..293090c 100644 err = class_register(&iscsi_transport_class); if (err) diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c -index f379c7f..e8fc69c 100644 +index 2700a5a..752ec38 100644 --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c -@@ -33,7 +33,7 @@ +@@ -36,7 +36,7 @@ #include "scsi_transport_srp_internal.h" struct srp_host_attrs { @@ -47534,7 +49479,7 @@ index f379c7f..e8fc69c 100644 }; #define to_srp_host_attrs(host) ((struct srp_host_attrs *)(host)->shost_data) -@@ -61,7 +61,7 @@ static int srp_host_setup(struct transport_container *tc, struct device *dev, +@@ -94,7 +94,7 @@ static int srp_host_setup(struct transport_container *tc, struct device *dev, struct Scsi_Host *shost = dev_to_shost(dev); struct srp_host_attrs *srp_host = to_srp_host_attrs(shost); @@ -47543,9 +49488,9 @@ index f379c7f..e8fc69c 100644 return 0; } -@@ -210,7 +210,7 @@ struct srp_rport *srp_rport_add(struct Scsi_Host *shost, - memcpy(rport->port_id, ids->port_id, sizeof(rport->port_id)); - rport->roles = ids->roles; +@@ -730,7 +730,7 @@ struct srp_rport *srp_rport_add(struct Scsi_Host *shost, + rport_fast_io_fail_timedout); + INIT_DELAYED_WORK(&rport->dev_loss_work, rport_dev_loss_timedout); - id = atomic_inc_return(&to_srp_host_attrs(shost)->next_port_id); + id = atomic_inc_return_unchecked(&to_srp_host_attrs(shost)->next_port_id); @@ -47553,10 +49498,10 @@ index f379c7f..e8fc69c 100644 transport_setup_device(&rport->dev); diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c -index dbc024b..6e3b837 100644 +index 69725f7..03aaee1 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c -@@ -2943,7 +2943,7 @@ static int sd_probe(struct device *dev) +@@ -2964,7 +2964,7 @@ static int sd_probe(struct device *dev) sdkp->disk = gd; sdkp->index = index; atomic_set(&sdkp->openers, 0); @@ -47579,15 +49524,15 @@ index df5e961..df6b97f 100644 return blk_trace_startstop(sdp->device->request_queue, 1); case BLKTRACESTOP: diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c -index 9e039c6..ae9e800 100644 +index 349ebba..ff2a249 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c -@@ -1762,7 +1762,7 @@ int spi_bus_unlock(struct spi_master *master) +@@ -1945,7 +1945,7 @@ int spi_bus_unlock(struct spi_master *master) EXPORT_SYMBOL_GPL(spi_bus_unlock); /* portable code must never pass more than 32 bytes */ --#define SPI_BUFSIZ max(32,SMP_CACHE_BYTES) -+#define SPI_BUFSIZ max(32UL,SMP_CACHE_BYTES) +-#define SPI_BUFSIZ max(32, SMP_CACHE_BYTES) ++#define SPI_BUFSIZ max(32UL, SMP_CACHE_BYTES) static u8 *buf; @@ -47623,7 +49568,7 @@ index 2c61783..4d49e4e 100644 MKDEV(0, tdev->index), NULL, "%s", tdev->name); if (IS_ERR(tdev->dev)) diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c -index 0247a20..cb9595c 100644 +index c0f7cd7..5424212 100644 --- a/drivers/staging/gdm724x/gdm_tty.c +++ b/drivers/staging/gdm724x/gdm_tty.c @@ -45,7 +45,7 @@ @@ -47635,11 +49580,42 @@ index 0247a20..cb9595c 100644 static struct tty_driver *gdm_driver[TTY_MAX_COUNT]; static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR]; +diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c +index 96e4eee..6d7c37e 100644 +--- a/drivers/staging/imx-drm/imx-drm-core.c ++++ b/drivers/staging/imx-drm/imx-drm-core.c +@@ -510,7 +510,7 @@ int imx_drm_add_crtc(struct drm_crtc *crtc, + goto err_busy; + } + +- if (imxdrm->drm->open_count) { ++ if (local_read(&imxdrm->drm->open_count)) { + ret = -EBUSY; + goto err_busy; + } +@@ -590,7 +590,7 @@ int imx_drm_add_encoder(struct drm_encoder *encoder, + + mutex_lock(&imxdrm->mutex); + +- if (imxdrm->drm->open_count) { ++ if (local_read(&imxdrm->drm->open_count)) { + ret = -EBUSY; + goto err_busy; + } +@@ -729,7 +729,7 @@ int imx_drm_add_connector(struct drm_connector *connector, + + mutex_lock(&imxdrm->mutex); + +- if (imxdrm->drm->open_count) { ++ if (local_read(&imxdrm->drm->open_count)) { + ret = -EBUSY; + goto err_busy; + } diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c -index ef5064e..fce01db 100644 +index b7613c8..c302392 100644 --- a/drivers/staging/lustre/lnet/selftest/brw_test.c +++ b/drivers/staging/lustre/lnet/selftest/brw_test.c -@@ -478,13 +478,11 @@ brw_server_handle(struct srpc_server_rpc *rpc) +@@ -487,13 +487,11 @@ brw_server_handle(struct srpc_server_rpc *rpc) return 0; } @@ -47714,7 +49690,7 @@ index f0f9194..b589047 100644 srpc_service_t ping_test_service; void ping_init_test_service(void) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h -index 7020d9c..0d3b580 100644 +index bc2b82f..67fd598 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1141,7 +1141,7 @@ struct ldlm_callback_suite { @@ -47727,7 +49703,7 @@ index 7020d9c..0d3b580 100644 /* ldlm_lockd.c */ int ldlm_del_waiting_lock(struct ldlm_lock *lock); diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h -index a612255..9a9e2dd 100644 +index d0aea15..7af68e1 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -1417,7 +1417,7 @@ struct md_ops { @@ -47739,6 +49715,19 @@ index a612255..9a9e2dd 100644 struct lsm_operations { void (*lsm_free)(struct lov_stripe_md *); +diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +index 39fcdac..222780f 100644 +--- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c ++++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +@@ -249,7 +249,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, + int added = (mode == LCK_NL); + int overlaps = 0; + int splitted = 0; +- const struct ldlm_callback_suite null_cbs = { NULL }; ++ const struct ldlm_callback_suite null_cbs = { }; + int rc; + + CDEBUG(D_DLMTRACE, "flags %#llx owner "LPU64" pid %u mode %u start " diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c index fc6c977..df1f956 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c @@ -47770,6 +49759,40 @@ index fc6c977..df1f956 100644 dummy.data = &backoff; dummy.proc_handler = &proc_dointvec; +diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c +index f3108c7..cd4f9da 100644 +--- a/drivers/staging/lustre/lustre/libcfs/module.c ++++ b/drivers/staging/lustre/lustre/libcfs/module.c +@@ -348,11 +348,11 @@ out: + + + struct cfs_psdev_ops libcfs_psdev_ops = { +- libcfs_psdev_open, +- libcfs_psdev_release, +- NULL, +- NULL, +- libcfs_ioctl ++ .p_open = libcfs_psdev_open, ++ .p_close = libcfs_psdev_release, ++ .p_read = NULL, ++ .p_write = NULL, ++ .p_ioctl = libcfs_ioctl + }; + + extern int insert_proc(void); +diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c +index a4e0472..05d854c 100644 +--- a/drivers/staging/lustre/lustre/llite/dir.c ++++ b/drivers/staging/lustre/lustre/llite/dir.c +@@ -660,7 +660,7 @@ int ll_dir_setdirstripe(struct inode *dir, struct lmv_user_md *lump, + int mode; + int err; + +- mode = (0755 & (S_IRWXUGO|S_ISVTX) & ~current->fs->umask) | S_IFDIR; ++ mode = (0755 & (S_IRWXUGO|S_ISVTX) & ~current_umask()) | S_IFDIR; + op_data = ll_prep_md_op_data(NULL, dir, NULL, filename, + strlen(filename), mode, LUSTRE_OPC_MKDIR, + lump); diff --git a/drivers/staging/media/solo6x10/solo6x10-core.c b/drivers/staging/media/solo6x10/solo6x10-core.c index 3675020..e80d92c 100644 --- a/drivers/staging/media/solo6x10/solo6x10-core.c @@ -47783,8 +49806,21 @@ index 3675020..e80d92c 100644 struct device *dev = &solo_dev->dev; const char *driver; int i; +diff --git a/drivers/staging/media/solo6x10/solo6x10-g723.c b/drivers/staging/media/solo6x10/solo6x10-g723.c +index 1db18c7..35e6afc 100644 +--- a/drivers/staging/media/solo6x10/solo6x10-g723.c ++++ b/drivers/staging/media/solo6x10/solo6x10-g723.c +@@ -355,7 +355,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev) + + int solo_g723_init(struct solo_dev *solo_dev) + { +- static struct snd_device_ops ops = { NULL }; ++ static struct snd_device_ops ops = { }; + struct snd_card *card; + struct snd_kcontrol_new kctl; + char name[32]; diff --git a/drivers/staging/media/solo6x10/solo6x10-p2m.c b/drivers/staging/media/solo6x10/solo6x10-p2m.c -index 3335941..2b26186 100644 +index 7f2f247..d999137 100644 --- a/drivers/staging/media/solo6x10/solo6x10-p2m.c +++ b/drivers/staging/media/solo6x10/solo6x10-p2m.c @@ -77,7 +77,7 @@ int solo_p2m_dma_desc(struct solo_dev *solo_dev, @@ -47797,10 +49833,10 @@ index 3335941..2b26186 100644 p2m_id = -p2m_id; } diff --git a/drivers/staging/media/solo6x10/solo6x10.h b/drivers/staging/media/solo6x10/solo6x10.h -index 6f91d2e..3f011d2 100644 +index f1bbb8c..a73eaba 100644 --- a/drivers/staging/media/solo6x10/solo6x10.h +++ b/drivers/staging/media/solo6x10/solo6x10.h -@@ -238,7 +238,7 @@ struct solo_dev { +@@ -237,7 +237,7 @@ struct solo_dev { /* P2M DMA Engine */ struct solo_p2m_dev p2m_dev[SOLO_NR_P2M]; @@ -47810,10 +49846,10 @@ index 6f91d2e..3f011d2 100644 unsigned int p2m_timeouts; diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c -index e14a1bb..9cb9bbe 100644 +index 0315f60..ce93f406 100644 --- a/drivers/staging/octeon/ethernet-rx.c +++ b/drivers/staging/octeon/ethernet-rx.c -@@ -419,11 +419,11 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) +@@ -418,11 +418,11 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) /* Increment RX stats for virtual ports */ if (work->ipprt >= CVMX_PIP_NUM_INPUT_PORTS) { #ifdef CONFIG_64BIT @@ -47829,12 +49865,12 @@ index e14a1bb..9cb9bbe 100644 #endif } netif_receive_skb(skb); -@@ -434,9 +434,9 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) +@@ -433,9 +433,9 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) dev->name); */ #ifdef CONFIG_64BIT - atomic64_add(1, (atomic64_t *)&priv->stats.rx_dropped); -+ atomic64_unchecked_add(1, (atomic64_unchecked_t *)&priv->stats.rx_dropped); ++ atomic64_add_unchecked(1, (atomic64_unchecked_t *)&priv->stats.rx_dropped); #else - atomic_add(1, (atomic_t *)&priv->stats.rx_dropped); + atomic_add_unchecked(1, (atomic_unchecked_t *)&priv->stats.rx_dropped); @@ -47842,10 +49878,10 @@ index e14a1bb..9cb9bbe 100644 dev_kfree_skb_irq(skb); } diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c -index c3a90e7..023619a 100644 +index bd6ca71..8f0961e 100644 --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c -@@ -252,11 +252,11 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev) +@@ -254,11 +254,11 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev) * since the RX tasklet also increments it. */ #ifdef CONFIG_64BIT @@ -47927,7 +49963,7 @@ index a863a98..d272795 100644 /* * NOTE: diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c -index d7974cb..d78076b 100644 +index e810ad5..931336f 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c @@ -441,7 +441,7 @@ static void vhci_tx_urb(struct urb *urb) @@ -47971,7 +50007,7 @@ index d07fcb5..358e1e1 100644 return; } diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c -index 8acff44..bdb2fca 100644 +index ab8b2ba..99184aa 100644 --- a/drivers/staging/vt6655/hostap.c +++ b/drivers/staging/vt6655/hostap.c @@ -69,14 +69,13 @@ static int msglevel = MSG_LEVEL_INFO; @@ -48001,7 +50037,7 @@ index 8acff44..bdb2fca 100644 pDevice->apdev->type = ARPHRD_IEEE80211; diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c -index c699a30..b90a5fd 100644 +index 67ba48b..24e602f 100644 --- a/drivers/staging/vt6656/hostap.c +++ b/drivers/staging/vt6656/hostap.c @@ -60,14 +60,13 @@ static int msglevel =MSG_LEVEL_INFO; @@ -48031,7 +50067,7 @@ index c699a30..b90a5fd 100644 pDevice->apdev->type = ARPHRD_IEEE80211; diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c -index e51b09a..5ebac31 100644 +index 24884ca..26c8220 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c @@ -62,7 +62,7 @@ static const u32 sbp_unit_directory_template[] = { @@ -48053,10 +50089,10 @@ index e51b09a..5ebac31 100644 login->tgt_agt = sbp_target_agent_register(login); if (IS_ERR(login->tgt_agt)) { diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c -index e5e3965..a7b487c 100644 +index d06de84..fd38c9b 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c -@@ -1436,7 +1436,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name) +@@ -1435,7 +1435,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name) spin_lock_init(&dev->se_tmr_lock); spin_lock_init(&dev->qf_cmd_lock); sema_init(&dev->caw_sem, 1); @@ -48066,10 +50102,10 @@ index e5e3965..a7b487c 100644 spin_lock_init(&dev->t10_wwn.t10_vpd_lock); INIT_LIST_HEAD(&dev->t10_pr.registration_list); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c -index 0b0009b..215e88e 100644 +index dee2be1..f5fd8ca 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c -@@ -1137,7 +1137,7 @@ transport_check_alloc_task_attr(struct se_cmd *cmd) +@@ -1113,7 +1113,7 @@ transport_check_alloc_task_attr(struct se_cmd *cmd) * Used to determine when ORDERED commands should go from * Dormant to Active status. */ @@ -48260,7 +50296,7 @@ index 81e939e..95ead10 100644 return HVCS_BUFF_LEN - hvcsd->chars_in_buffer; diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c -index 4190199..48f2920 100644 +index 4190199..06d5bfa 100644 --- a/drivers/tty/hvc/hvsi.c +++ b/drivers/tty/hvc/hvsi.c @@ -85,7 +85,7 @@ struct hvsi_struct { @@ -48317,16 +50353,55 @@ index 4190199..48f2920 100644 packet.hdr.len = 6; packet.verb = VSV_CLOSE_PROTOCOL; +@@ -725,7 +725,7 @@ static int hvsi_open(struct tty_struct *tty, struct file *filp) + + tty_port_tty_set(&hp->port, tty); + spin_lock_irqsave(&hp->lock, flags); +- hp->port.count++; ++ atomic_inc(&hp->port.count); + atomic_set(&hp->seqno, 0); + h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE); + spin_unlock_irqrestore(&hp->lock, flags); +@@ -782,7 +782,7 @@ static void hvsi_close(struct tty_struct *tty, struct file *filp) + + spin_lock_irqsave(&hp->lock, flags); + +- if (--hp->port.count == 0) { ++ if (atomic_dec_return(&hp->port.count) == 0) { + tty_port_tty_set(&hp->port, NULL); + hp->inbuf_end = hp->inbuf; /* discard remaining partial packets */ + +@@ -815,9 +815,9 @@ static void hvsi_close(struct tty_struct *tty, struct file *filp) + + spin_lock_irqsave(&hp->lock, flags); + } +- } else if (hp->port.count < 0) ++ } else if (atomic_read(&hp->port.count) < 0) + printk(KERN_ERR "hvsi_close %lu: oops, count is %d\n", +- hp - hvsi_ports, hp->port.count); ++ hp - hvsi_ports, atomic_read(&hp->port.count)); + + spin_unlock_irqrestore(&hp->lock, flags); + } +@@ -832,7 +832,7 @@ static void hvsi_hangup(struct tty_struct *tty) + tty_port_tty_set(&hp->port, NULL); + + spin_lock_irqsave(&hp->lock, flags); +- hp->port.count = 0; ++ atomic_set(&hp->port.count, 0); + hp->n_outbuf = 0; + spin_unlock_irqrestore(&hp->lock, flags); + } diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c -index ac27671..0f627ee 100644 +index 347050e..14f8fbf 100644 --- a/drivers/tty/hvc/hvsi_lib.c +++ b/drivers/tty/hvc/hvsi_lib.c @@ -9,7 +9,7 @@ static int hvsi_send_packet(struct hvsi_priv *pv, struct hvsi_header *packet) { -- packet->seqno = atomic_inc_return(&pv->seqno); -+ packet->seqno = atomic_inc_return_unchecked(&pv->seqno); +- packet->seqno = cpu_to_be16(atomic_inc_return(&pv->seqno)); ++ packet->seqno = cpu_to_be16(atomic_inc_return_unchecked(&pv->seqno)); /* Assumes that always succeeds, works in practice */ return pv->put_chars(pv->termno, (char *)packet, packet->len); @@ -48339,15 +50414,6 @@ index ac27671..0f627ee 100644 pr_devel("HVSI@%x: Handshaking started\n", pv->termno); -@@ -265,7 +265,7 @@ int hvsilib_read_mctrl(struct hvsi_priv *pv) - pv->mctrl_update = 0; - q.hdr.type = VS_QUERY_PACKET_HEADER; - q.hdr.len = sizeof(struct hvsi_query); -- q.hdr.seqno = atomic_inc_return(&pv->seqno); -+ q.hdr.seqno = atomic_inc_return_unchecked(&pv->seqno); - q.verb = VSV_SEND_MODEM_CTL_STATUS; - rc = hvsi_send_packet(pv, &q.hdr); - if (rc <= 0) { diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c index 8fd72ff..34a0bed 100644 --- a/drivers/tty/ipwireless/tty.c @@ -48479,10 +50545,10 @@ index 1deaca4..c8582d4 100644 tty_port_tty_set(&ch->port, tty); mutex_lock(&ch->port.mutex); diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c -index c0f76da..d974c32 100644 +index 5056090..c80ca04 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c -@@ -1632,7 +1632,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr) +@@ -1643,7 +1643,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr) spin_lock_init(&dlci->lock); mutex_init(&dlci->mutex); dlci->fifo = &dlci->_fifo; @@ -48491,7 +50557,7 @@ index c0f76da..d974c32 100644 kfree(dlci); return NULL; } -@@ -2935,7 +2935,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp) +@@ -2946,7 +2946,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp) struct gsm_dlci *dlci = tty->driver_data; struct tty_port *port = &dlci->port; @@ -48501,7 +50567,7 @@ index c0f76da..d974c32 100644 dlci_get(dlci->gsm->dlci[0]); mux_get(dlci->gsm); diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c -index d4a89db..dbe8d8c 100644 +index 4c10837..a40ec45 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -114,7 +114,7 @@ struct n_tty_data { @@ -48513,7 +50579,7 @@ index d4a89db..dbe8d8c 100644 size_t line_start; /* protected by output lock */ -@@ -2509,6 +2509,7 @@ void n_tty_inherit_ops(struct tty_ldisc_ops *ops) +@@ -2504,6 +2504,7 @@ void n_tty_inherit_ops(struct tty_ldisc_ops *ops) { *ops = tty_ldisc_N_TTY; ops->owner = NULL; @@ -48729,10 +50795,10 @@ index b5d779c..3622cfe 100644 if (unlikely(pdev->id < 0 || pdev->id >= UART_NR)) return -ENXIO; diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c -index f3dfa19..342f2ff 100644 +index c1af04d..0815c8a 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c -@@ -456,11 +456,16 @@ static void s3c24xx_serial_shutdown(struct uart_port *port) +@@ -463,11 +463,16 @@ static void s3c24xx_serial_shutdown(struct uart_port *port) } } @@ -48749,7 +50815,7 @@ index f3dfa19..342f2ff 100644 dbg("s3c24xx_serial_startup: port=%p (%08lx,%p)\n", port->mapbase, port->membase); -@@ -1127,10 +1132,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, +@@ -1141,10 +1146,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, /* setup info for port */ port->dev = &platdev->dev; @@ -49190,7 +51256,7 @@ index dc6e969..5dc8786 100644 if (!retval) port->flags |= ASYNC_NORMAL_ACTIVE; diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c -index 40a9fe9..a3f10cc 100644 +index ce396ec..04a37be 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -1075,7 +1075,7 @@ EXPORT_SYMBOL(unregister_sysrq_key); @@ -49256,10 +51322,10 @@ index 6458e11..6cfc218 100644 raw_spin_unlock_irqrestore(&tty_ldiscs_lock, flags); } diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c -index f597e88..b7f68ed 100644 +index c94d234..8210f2d 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c -@@ -232,7 +232,7 @@ void tty_port_hangup(struct tty_port *port) +@@ -236,7 +236,7 @@ void tty_port_hangup(struct tty_port *port) unsigned long flags; spin_lock_irqsave(&port->lock, flags); @@ -49268,7 +51334,7 @@ index f597e88..b7f68ed 100644 port->flags &= ~ASYNC_NORMAL_ACTIVE; tty = port->tty; if (tty) -@@ -390,7 +390,7 @@ int tty_port_block_til_ready(struct tty_port *port, +@@ -394,7 +394,7 @@ int tty_port_block_til_ready(struct tty_port *port, /* The port lock protects the port counts */ spin_lock_irqsave(&port->lock, flags); if (!tty_hung_up_p(filp)) @@ -49277,7 +51343,7 @@ index f597e88..b7f68ed 100644 port->blocked_open++; spin_unlock_irqrestore(&port->lock, flags); -@@ -432,7 +432,7 @@ int tty_port_block_til_ready(struct tty_port *port, +@@ -436,7 +436,7 @@ int tty_port_block_til_ready(struct tty_port *port, we must not mess that up further */ spin_lock_irqsave(&port->lock, flags); if (!tty_hung_up_p(filp)) @@ -49286,7 +51352,7 @@ index f597e88..b7f68ed 100644 port->blocked_open--; if (retval == 0) port->flags |= ASYNC_NORMAL_ACTIVE; -@@ -466,19 +466,19 @@ int tty_port_close_start(struct tty_port *port, +@@ -470,19 +470,19 @@ int tty_port_close_start(struct tty_port *port, return 0; } @@ -49311,8 +51377,8 @@ index f597e88..b7f68ed 100644 - if (port->count) { + if (atomic_read(&port->count)) { spin_unlock_irqrestore(&port->lock, flags); - if (port->ops->drop) - port->ops->drop(port); + return 0; + } @@ -564,7 +564,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty, { spin_lock_irq(&port->lock); @@ -49384,7 +51450,7 @@ index d0e3a44..5f8b754 100644 ret = -EPERM; goto reterr; diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c -index 0e808cf..d7d274b 100644 +index a673e5b..36e5d32 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -25,6 +25,7 @@ @@ -49413,7 +51479,7 @@ index 0e808cf..d7d274b 100644 } static DEVICE_ATTR_RO(event); -@@ -401,7 +402,7 @@ void uio_event_notify(struct uio_info *info) +@@ -405,7 +406,7 @@ void uio_event_notify(struct uio_info *info) { struct uio_device *idev = info->uio_dev; @@ -49422,7 +51488,7 @@ index 0e808cf..d7d274b 100644 wake_up_interruptible(&idev->wait); kill_fasync(&idev->async_queue, SIGIO, POLL_IN); } -@@ -454,7 +455,7 @@ static int uio_open(struct inode *inode, struct file *filep) +@@ -458,7 +459,7 @@ static int uio_open(struct inode *inode, struct file *filep) } listener->dev = idev; @@ -49431,7 +51497,7 @@ index 0e808cf..d7d274b 100644 filep->private_data = listener; if (idev->info->open) { -@@ -505,7 +506,7 @@ static unsigned int uio_poll(struct file *filep, poll_table *wait) +@@ -509,7 +510,7 @@ static unsigned int uio_poll(struct file *filep, poll_table *wait) return -EIO; poll_wait(filep, &idev->wait, wait); @@ -49440,7 +51506,7 @@ index 0e808cf..d7d274b 100644 return POLLIN | POLLRDNORM; return 0; } -@@ -530,7 +531,7 @@ static ssize_t uio_read(struct file *filep, char __user *buf, +@@ -534,7 +535,7 @@ static ssize_t uio_read(struct file *filep, char __user *buf, do { set_current_state(TASK_INTERRUPTIBLE); @@ -49449,7 +51515,7 @@ index 0e808cf..d7d274b 100644 if (event_count != listener->event_count) { if (copy_to_user(buf, &event_count, count)) retval = -EFAULT; -@@ -587,9 +588,13 @@ static ssize_t uio_write(struct file *filep, const char __user *buf, +@@ -591,9 +592,13 @@ static ssize_t uio_write(struct file *filep, const char __user *buf, static int uio_find_mem_index(struct vm_area_struct *vma) { struct uio_device *idev = vma->vm_private_data; @@ -49464,16 +51530,7 @@ index 0e808cf..d7d274b 100644 return -1; return (int)vma->vm_pgoff; } -@@ -647,6 +652,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma) - return -EINVAL; - mem = idev->info->mem + mi; - -+ if (mem->addr & ~PAGE_MASK) -+ return -ENODEV; - if (vma->vm_end - vma->vm_start > mem->size) - return -EINVAL; - -@@ -818,7 +825,7 @@ int __uio_register_device(struct module *owner, +@@ -825,7 +830,7 @@ int __uio_register_device(struct module *owner, idev->owner = owner; idev->info = info; init_waitqueue_head(&idev->wait); @@ -49610,7 +51667,7 @@ index 2a3bbdf..91d72cf 100644 file->f_version = event_count; return POLLIN | POLLRDNORM; diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c -index 71dc5d7..d4c488f 100644 +index 967152a..16fa2e5 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -187,7 +187,7 @@ static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, @@ -49650,10 +51707,10 @@ index 71dc5d7..d4c488f 100644 dev->rawdescriptors[i] + (*ppos - pos), min(len, alloclen))) { diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c -index f20a044..d1059aa 100644 +index d39106c..bfe13a4 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c -@@ -1552,7 +1552,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags) +@@ -1549,7 +1549,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags) */ usb_get_urb(urb); atomic_inc(&urb->use_count); @@ -49662,7 +51719,7 @@ index f20a044..d1059aa 100644 usbmon_urb_submit(&hcd->self, urb); /* NOTE requirements on root-hub callers (usbfs and the hub -@@ -1579,7 +1579,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags) +@@ -1576,7 +1576,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags) urb->hcpriv = NULL; INIT_LIST_HEAD(&urb->urb_list); atomic_dec(&urb->use_count); @@ -49672,7 +51729,7 @@ index f20a044..d1059aa 100644 wake_up(&usb_kill_urb_queue); usb_put_urb(urb); diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index c5c3667..e54e5cd 100644 +index ebcd3bf..be93a64 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -27,6 +27,7 @@ @@ -49683,8 +51740,8 @@ index c5c3667..e54e5cd 100644 #include #include -@@ -4467,6 +4468,10 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, - goto done; +@@ -4437,6 +4438,10 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, + goto done; return; } + @@ -49695,7 +51752,7 @@ index c5c3667..e54e5cd 100644 unit_load = 150; else diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c -index 82927e1..4993dbf 100644 +index bb31597..6c5ef8b 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -129,7 +129,7 @@ static int usb_internal_control_msg(struct usb_device *usb_dev, @@ -49726,10 +51783,10 @@ index 82927e1..4993dbf 100644 { struct urb *urb; diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c -index ca516ac..6c36ee4 100644 +index 52a97ad..e73330f 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c -@@ -236,7 +236,7 @@ static ssize_t urbnum_show(struct device *dev, struct device_attribute *attr, +@@ -244,7 +244,7 @@ static ssize_t urbnum_show(struct device *dev, struct device_attribute *attr, struct usb_device *udev; udev = to_usb_device(dev); @@ -49739,7 +51796,7 @@ index ca516ac..6c36ee4 100644 static DEVICE_ATTR_RO(urbnum); diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c -index 0a6ee2e..6f8d7e8 100644 +index 4d11449..f4ccabf 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -433,7 +433,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent, @@ -49765,7 +51822,7 @@ index 02e44fc..3c4fe64 100644 trb_st_hw = &dep->trb_pool[0]; diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c -index 5e29dde..eca992f 100644 +index 8cfc319..4868255 100644 --- a/drivers/usb/early/ehci-dbgp.c +++ b/drivers/usb/early/ehci-dbgp.c @@ -98,7 +98,8 @@ static inline u32 dbgp_len_update(u32 x, u32 len) @@ -49778,7 +51835,7 @@ index 5e29dde..eca992f 100644 #else #define dbgp_kgdb_mode (0) #endif -@@ -1047,6 +1048,13 @@ static struct kgdb_io kgdbdbgp_io_ops = { +@@ -1043,6 +1044,13 @@ static struct kgdb_io kgdbdbgp_io_ops = { .write_char = kgdbdbgp_write_char, }; @@ -49792,7 +51849,7 @@ index 5e29dde..eca992f 100644 static int kgdbdbgp_wait_time; static int __init kgdbdbgp_parse_config(char *str) -@@ -1062,8 +1070,10 @@ static int __init kgdbdbgp_parse_config(char *str) +@@ -1058,8 +1066,10 @@ static int __init kgdbdbgp_parse_config(char *str) ptr++; kgdbdbgp_wait_time = simple_strtoul(ptr, &ptr, 10); } @@ -49891,10 +51948,10 @@ index b369292..9f3ba40 100644 gs_free_requests(gser->out, &port->read_pool, NULL); gs_free_requests(gser->out, &port->read_queue, NULL); diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c -index 835fc08..f8b22bf 100644 +index 1bb85be..29e28d9 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c -@@ -762,7 +762,7 @@ static struct urb *request_single_step_set_feature_urb( +@@ -780,7 +780,7 @@ static struct urb *request_single_step_set_feature_urb( urb->transfer_flags = URB_DIR_IN; usb_get_urb(urb); atomic_inc(&urb->use_count); @@ -49903,7 +51960,7 @@ index 835fc08..f8b22bf 100644 urb->setup_dma = dma_map_single( hcd->self.controller, urb->setup_packet, -@@ -829,7 +829,7 @@ static int ehset_single_step_set_feature(struct usb_hcd *hcd, int port) +@@ -847,7 +847,7 @@ static int ehset_single_step_set_feature(struct usb_hcd *hcd, int port) urb->status = -EINPROGRESS; usb_get_urb(urb); atomic_inc(&urb->use_count); @@ -49988,32 +52045,32 @@ index 75f70f0..d467e1a 100644 /* Dynamic bitflag definitions (us->dflags): used in set_bit() etc. */ diff --git a/drivers/usb/wusbcore/wa-hc.h b/drivers/usb/wusbcore/wa-hc.h -index cf250c2..ad9d904 100644 +index e614f02..3fd60e2 100644 --- a/drivers/usb/wusbcore/wa-hc.h +++ b/drivers/usb/wusbcore/wa-hc.h -@@ -199,7 +199,7 @@ struct wahc { +@@ -225,7 +225,7 @@ struct wahc { spinlock_t xfer_list_lock; struct work_struct xfer_enqueue_work; struct work_struct xfer_error_work; - atomic_t xfer_id_count; + atomic_unchecked_t xfer_id_count; + + kernel_ulong_t quirks; }; - - -@@ -255,7 +255,7 @@ static inline void wa_init(struct wahc *wa) - spin_lock_init(&wa->xfer_list_lock); +@@ -287,7 +287,7 @@ static inline void wa_init(struct wahc *wa) INIT_WORK(&wa->xfer_enqueue_work, wa_urb_enqueue_run); INIT_WORK(&wa->xfer_error_work, wa_process_errored_transfers_run); + wa->dto_in_use = 0; - atomic_set(&wa->xfer_id_count, 1); + atomic_set_unchecked(&wa->xfer_id_count, 1); } /** diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c -index 3dcf66f..8faaf6e 100644 +index ed5abe8..7036400 100644 --- a/drivers/usb/wusbcore/wa-xfer.c +++ b/drivers/usb/wusbcore/wa-xfer.c -@@ -300,7 +300,7 @@ out: +@@ -312,7 +312,7 @@ static void wa_xfer_completion(struct wa_xfer *xfer) */ static void wa_xfer_id_init(struct wa_xfer *xfer) { @@ -50021,7 +52078,7 @@ index 3dcf66f..8faaf6e 100644 + xfer->id = atomic_add_return_unchecked(1, &xfer->wa->xfer_id_count); } - /* + /* Return the xfer's ID. */ diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 1eab4ac..e21efc9 100644 --- a/drivers/vfio/vfio.c @@ -50036,9 +52093,66 @@ index 1eab4ac..e21efc9 100644 return 0; diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c -index 5174eba..86e764a 100644 +index 5174eba..451e6bc 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c +@@ -530,17 +530,17 @@ static inline void __vringh_notify_disable(struct vringh *vrh, + /* Userspace access helpers: in this case, addresses are really userspace. */ + static inline int getu16_user(u16 *val, const u16 *p) + { +- return get_user(*val, (__force u16 __user *)p); ++ return get_user(*val, (u16 __force_user *)p); + } + + static inline int putu16_user(u16 *p, u16 val) + { +- return put_user(val, (__force u16 __user *)p); ++ return put_user(val, (u16 __force_user *)p); + } + + static inline int copydesc_user(void *dst, const void *src, size_t len) + { +- return copy_from_user(dst, (__force void __user *)src, len) ? ++ return copy_from_user(dst, (void __force_user *)src, len) ? + -EFAULT : 0; + } + +@@ -548,19 +548,19 @@ static inline int putused_user(struct vring_used_elem *dst, + const struct vring_used_elem *src, + unsigned int num) + { +- return copy_to_user((__force void __user *)dst, src, ++ return copy_to_user((void __force_user *)dst, src, + sizeof(*dst) * num) ? -EFAULT : 0; + } + + static inline int xfer_from_user(void *src, void *dst, size_t len) + { +- return copy_from_user(dst, (__force void __user *)src, len) ? ++ return copy_from_user(dst, (void __force_user *)src, len) ? + -EFAULT : 0; + } + + static inline int xfer_to_user(void *dst, void *src, size_t len) + { +- return copy_to_user((__force void __user *)dst, src, len) ? ++ return copy_to_user((void __force_user *)dst, src, len) ? + -EFAULT : 0; + } + +@@ -596,9 +596,9 @@ int vringh_init_user(struct vringh *vrh, u32 features, + vrh->last_used_idx = 0; + vrh->vring.num = num; + /* vring expects kernel addresses, but only used via accessors. */ +- vrh->vring.desc = (__force struct vring_desc *)desc; +- vrh->vring.avail = (__force struct vring_avail *)avail; +- vrh->vring.used = (__force struct vring_used *)used; ++ vrh->vring.desc = (__force_kernel struct vring_desc *)desc; ++ vrh->vring.avail = (__force_kernel struct vring_avail *)avail; ++ vrh->vring.used = (__force_kernel struct vring_used *)used; + return 0; + } + EXPORT_SYMBOL(vringh_init_user); @@ -800,7 +800,7 @@ static inline int getu16_kern(u16 *val, const u16 *p) static inline int putu16_kern(u16 *p, u16 val) @@ -50049,7 +52163,7 @@ index 5174eba..86e764a 100644 } diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c -index e43401a..dd49b3f 100644 +index 1b0b233..6f34c2c 100644 --- a/drivers/video/arcfb.c +++ b/drivers/video/arcfb.c @@ -458,7 +458,7 @@ static ssize_t arcfb_write(struct fb_info *info, const char __user *buf, @@ -50062,7 +52176,7 @@ index e43401a..dd49b3f 100644 err = -ENOSPC; } diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c -index a4dfe8c..297ddd9 100644 +index 12ca031..84a8a74 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -149,7 +149,7 @@ enum { @@ -50075,7 +52189,7 @@ index a4dfe8c..297ddd9 100644 "PCI", "PRO AGP", diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c -index 9b0f12c..024673d 100644 +index 28fafbf..ae91651 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -1326,10 +1326,14 @@ static int atyfb_set_par(struct fb_info *info) @@ -50119,7 +52233,7 @@ index 95ec042..e6affdd 100644 return 0; } diff --git a/drivers/video/backlight/kb3886_bl.c b/drivers/video/backlight/kb3886_bl.c -index bca6ccc..252107e 100644 +index 7592cc2..92feb56 100644 --- a/drivers/video/backlight/kb3886_bl.c +++ b/drivers/video/backlight/kb3886_bl.c @@ -78,7 +78,7 @@ static struct kb3886bl_machinfo *bl_machinfo; @@ -50156,7 +52270,7 @@ index 900aa4e..6d49418 100644 } EXPORT_SYMBOL_GPL(fb_deferred_io_cleanup); diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c -index dacaf74..8478a46 100644 +index 010d191..7b8235a 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -433,7 +433,7 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, @@ -50177,7 +52291,7 @@ index dacaf74..8478a46 100644 info->fbops->fb_imageblit(info, image); image->dy -= image->height + 8; } -@@ -1175,7 +1175,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, +@@ -1179,7 +1179,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, return -EFAULT; if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) return -EINVAL; @@ -50186,8 +52300,17 @@ index dacaf74..8478a46 100644 return -EINVAL; if (!registered_fb[con2fb.framebuffer]) request_module("fb%d", con2fb.framebuffer); +@@ -1300,7 +1300,7 @@ static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix, + __u32 data; + int err; + +- err = copy_to_user(&fix32->id, &fix->id, sizeof(fix32->id)); ++ err = copy_to_user(fix32->id, &fix->id, sizeof(fix32->id)); + + data = (__u32) (unsigned long) fix->smem_start; + err |= put_user(data, &fix32->smem_start); diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c -index 8d456dc..b4fa44b 100644 +index 130708f..cdac1a9 100644 --- a/drivers/video/hyperv_fb.c +++ b/drivers/video/hyperv_fb.c @@ -233,7 +233,7 @@ static uint screen_fb_size; @@ -52948,6 +55071,49 @@ index 3c14e43..2630570 100644 +4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 +4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 +4 4 4 4 4 4 +diff --git a/drivers/video/matrox/matroxfb_DAC1064.c b/drivers/video/matrox/matroxfb_DAC1064.c +index a01147f..5d896f8 100644 +--- a/drivers/video/matrox/matroxfb_DAC1064.c ++++ b/drivers/video/matrox/matroxfb_DAC1064.c +@@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo) + + #ifdef CONFIG_FB_MATROX_MYSTIQUE + struct matrox_switch matrox_mystique = { +- MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore, ++ .preinit = MGA1064_preinit, ++ .reset = MGA1064_reset, ++ .init = MGA1064_init, ++ .restore = MGA1064_restore, + }; + EXPORT_SYMBOL(matrox_mystique); + #endif + + #ifdef CONFIG_FB_MATROX_G + struct matrox_switch matrox_G100 = { +- MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore, ++ .preinit = MGAG100_preinit, ++ .reset = MGAG100_reset, ++ .init = MGAG100_init, ++ .restore = MGAG100_restore, + }; + EXPORT_SYMBOL(matrox_G100); + #endif +diff --git a/drivers/video/matrox/matroxfb_Ti3026.c b/drivers/video/matrox/matroxfb_Ti3026.c +index 195ad7c..09743fc 100644 +--- a/drivers/video/matrox/matroxfb_Ti3026.c ++++ b/drivers/video/matrox/matroxfb_Ti3026.c +@@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo) + } + + struct matrox_switch matrox_millennium = { +- Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore ++ .preinit = Ti3026_preinit, ++ .reset = Ti3026_reset, ++ .init = Ti3026_init, ++ .restore = Ti3026_restore + }; + EXPORT_SYMBOL(matrox_millennium); + #endif diff --git a/drivers/video/mb862xx/mb862xxfb_accel.c b/drivers/video/mb862xx/mb862xxfb_accel.c index fe92eed..106e085 100644 --- a/drivers/video/mb862xx/mb862xxfb_accel.c @@ -53028,7 +55194,7 @@ index ff22871..b129bed 100644 info->var.accel_flags = (!noaccel); diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c -index fafe7c9..93197b9 100644 +index 669a81f..e216d76 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c @@ -137,12 +137,14 @@ int omapdss_register_display(struct omap_dss_device *dssdev) @@ -53050,7 +55216,7 @@ index fafe7c9..93197b9 100644 mutex_lock(&panel_list_mutex); list_add_tail(&dssdev->panel_list, &panel_list); diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c -index 05c2dc3..ea1f391 100644 +index 83433cb..71e9b98 100644 --- a/drivers/video/s1d13xxxfb.c +++ b/drivers/video/s1d13xxxfb.c @@ -881,8 +881,10 @@ static int s1d13xxxfb_probe(struct platform_device *pdev) @@ -53067,7 +55233,7 @@ index 05c2dc3..ea1f391 100644 FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA; break; diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c -index e188ada..aac63c8 100644 +index d513ed6..90b0de9 100644 --- a/drivers/video/smscufx.c +++ b/drivers/video/smscufx.c @@ -1175,7 +1175,9 @@ static int ufx_ops_release(struct fb_info *info, int user) @@ -53082,7 +55248,7 @@ index e188ada..aac63c8 100644 pr_debug("released /dev/fb%d user=%d count=%d", diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c -index d2e5bc3..4cb05d1 100644 +index 025f14e..20eb4db 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -623,11 +623,11 @@ static int dlfb_handle_damage(struct dlfb_data *dev, int x, int y, @@ -53180,7 +55346,7 @@ index d2e5bc3..4cb05d1 100644 return count; } diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c -index 7aec6f3..e3b2d55 100644 +index 256fba7..6e75516 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -19,6 +19,7 @@ @@ -53191,7 +55357,7 @@ index 7aec6f3..e3b2d55 100644 #include