Browse Source

Merge branch 'akpm' (patches from Andrew)

Merge more updates from Andrew Morton:

 - the rest of MM

 - various misc things

 - procfs updates

 - lib/ updates

 - checkpatch updates

 - kdump/kexec updates

 - add kvmalloc helpers, use them

 - time helper updates for Y2038 issues. We're almost ready to remove
   current_fs_time() but that awaits a btrfs merge.

 - add tracepoints to DAX

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (114 commits)
  drivers/staging/ccree/ssi_hash.c: fix build with gcc-4.4.4
  selftests/vm: add a test for virtual address range mapping
  dax: add tracepoint to dax_insert_mapping()
  dax: add tracepoint to dax_writeback_one()
  dax: add tracepoints to dax_writeback_mapping_range()
  dax: add tracepoints to dax_load_hole()
  dax: add tracepoints to dax_pfn_mkwrite()
  dax: add tracepoints to dax_iomap_pte_fault()
  mtd: nand: nandsim: convert to memalloc_noreclaim_*()
  treewide: convert PF_MEMALLOC manipulations to new helpers
  mm: introduce memalloc_noreclaim_{save,restore}
  mm: prevent potential recursive reclaim due to clearing PF_MEMALLOC
  mm/huge_memory.c: deposit a pgtable for DAX PMD faults when required
  mm/huge_memory.c: use zap_deposited_table() more
  time: delete CURRENT_TIME_SEC and CURRENT_TIME
  gfs2: replace CURRENT_TIME with current_time
  apparmorfs: replace CURRENT_TIME with current_time()
  lustre: replace CURRENT_TIME macro
  fs: ubifs: replace CURRENT_TIME_SEC with current_time
  fs: ufs: use ktime_get_real_ts64() for birthtime
  ...
Linus Torvalds 8 years ago
parent
commit
bf5f89463f
100 changed files with 293 additions and 290 deletions
  1. 1 2
      Documentation/filesystems/vfs.txt
  2. 15 8
      Documentation/powerpc/firmware-assisted-dump.txt
  3. 5 5
      Documentation/vm/transhuge.txt
  4. 6 2
      Makefile
  5. 4 0
      arch/Kconfig
  6. 1 1
      arch/arc/kernel/unwind.c
  7. 0 20
      arch/arm/include/asm/cacheflush.h
  8. 32 0
      arch/arm/include/asm/set_memory.h
  9. 1 0
      arch/arm/kernel/ftrace.c
  10. 1 1
      arch/arm/kernel/kgdb.c
  11. 1 0
      arch/arm/kernel/machine_kexec.c
  12. 2 2
      arch/arm/mach-ixp4xx/common-pci.c
  13. 1 1
      arch/arm/mach-omap2/board-n8x0.c
  14. 1 0
      arch/arm/mm/pageattr.c
  15. 1 0
      arch/arm/net/bpf_jit_32.c
  16. 1 0
      arch/arm64/include/asm/Kbuild
  17. 0 4
      arch/arm64/include/asm/cacheflush.h
  18. 1 0
      arch/arm64/mm/pageattr.c
  19. 1 0
      arch/arm64/net/bpf_jit_comp.c
  20. 0 22
      arch/ia64/kernel/crash.c
  21. 1 1
      arch/m68k/ifpsp060/src/ilsp.S
  22. 1 1
      arch/m68k/ifpsp060/src/isp.S
  23. 1 1
      arch/mips/cavium-octeon/executive/cvmx-helper-rgmii.c
  24. 3 3
      arch/mips/dec/prom/init.c
  25. 1 1
      arch/mips/include/asm/octeon/cvmx-helper-rgmii.h
  26. 1 1
      arch/mips/kernel/perf_event_mipsxx.c
  27. 2 2
      arch/mips/kernel/traps.c
  28. 1 1
      arch/parisc/kernel/entry.S
  29. 1 1
      arch/parisc/kernel/module.c
  30. 6 4
      arch/powerpc/Kconfig
  31. 2 0
      arch/powerpc/include/asm/fadump.h
  32. 0 2
      arch/powerpc/kernel/crash.c
  33. 13 44
      arch/powerpc/kernel/fadump.c
  34. 5 0
      arch/powerpc/kernel/setup-common.c
  35. 1 1
      arch/powerpc/mm/icswx.c
  36. 1 0
      arch/s390/include/asm/Kbuild
  37. 3 6
      arch/s390/include/asm/set_memory.h
  38. 1 0
      arch/s390/kernel/ftrace.c
  39. 1 1
      arch/s390/kernel/kprobes.c
  40. 1 0
      arch/s390/kernel/machine_kexec.c
  41. 1 1
      arch/s390/kernel/perf_cpum_sf.c
  42. 2 8
      arch/s390/kvm/kvm-s390.c
  43. 1 0
      arch/s390/mm/init.c
  44. 1 0
      arch/s390/mm/pageattr.c
  45. 1 0
      arch/s390/mm/vmem.c
  46. 1 0
      arch/s390/net/bpf_jit_comp.c
  47. 0 85
      arch/x86/include/asm/cacheflush.h
  48. 87 0
      arch/x86/include/asm/set_memory.h
  49. 1 1
      arch/x86/kernel/amd_gart_64.c
  50. 1 1
      arch/x86/kernel/cpu/amd.c
  51. 1 1
      arch/x86/kernel/cpu/bugs.c
  52. 1 1
      arch/x86/kernel/ftrace.c
  53. 1 0
      arch/x86/kernel/kprobes/core.c
  54. 1 0
      arch/x86/kernel/kprobes/opt.c
  55. 1 1
      arch/x86/kernel/machine_kexec_32.c
  56. 1 0
      arch/x86/kernel/machine_kexec_64.c
  57. 1 1
      arch/x86/kernel/module.c
  58. 2 2
      arch/x86/kvm/lapic.c
  59. 2 2
      arch/x86/kvm/page_track.c
  60. 2 2
      arch/x86/kvm/x86.c
  61. 1 1
      arch/x86/mm/init.c
  62. 1 1
      arch/x86/mm/init_32.c
  63. 1 1
      arch/x86/mm/init_64.c
  64. 1 1
      arch/x86/mm/ioremap.c
  65. 1 0
      arch/x86/mm/pageattr.c
  66. 1 0
      arch/x86/net/bpf_jit_comp.c
  67. 1 1
      arch/x86/pci/pcbios.c
  68. 1 1
      arch/x86/platform/efi/efi.c
  69. 1 1
      arch/x86/realmode/init.c
  70. 1 1
      certs/blacklist.c
  71. 1 3
      crypto/lzo.c
  72. 2 6
      drivers/acpi/apei/erst.c
  73. 1 1
      drivers/acpi/cppc_acpi.c
  74. 1 1
      drivers/block/drbd/drbd_bitmap.c
  75. 4 3
      drivers/block/nbd.c
  76. 1 1
      drivers/block/rbd.c
  77. 1 0
      drivers/char/agp/amd-k7-agp.c
  78. 1 0
      drivers/char/agp/ati-agp.c
  79. 4 8
      drivers/char/agp/generic.c
  80. 1 0
      drivers/char/agp/intel-gtt.c
  81. 1 0
      drivers/char/agp/sworks-agp.c
  82. 1 1
      drivers/char/dsp56k.c
  83. 1 1
      drivers/clk/qcom/common.c
  84. 2 1
      drivers/cpufreq/powernow-k8.c
  85. 2 2
      drivers/cpufreq/sti-cpufreq.c
  86. 3 0
      drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
  87. 1 1
      drivers/gpu/drm/drm_fb_helper.c
  88. 2 2
      drivers/gpu/drm/etnaviv/etnaviv_dump.c
  89. 1 0
      drivers/gpu/drm/gma500/gtt.c
  90. 1 0
      drivers/gpu/drm/gma500/psb_drv.c
  91. 2 0
      drivers/gpu/drm/i915/i915_gem_gtt.c
  92. 1 3
      drivers/gpu/drm/nouveau/nouveau_gem.c
  93. 3 0
      drivers/gpu/drm/radeon/radeon_gart.c
  94. 3 0
      drivers/gpu/drm/ttm/ttm_page_alloc.c
  95. 3 0
      drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
  96. 3 0
      drivers/gpu/drm/ttm/ttm_tt.c
  97. 3 1
      drivers/hwtracing/intel_th/msu.c
  98. 1 1
      drivers/infiniband/hw/hns/hns_roce_hw_v1.c
  99. 1 1
      drivers/infiniband/hw/hns/hns_roce_mr.c
  100. 1 1
      drivers/leds/leds-lp5521.c

+ 1 - 2
Documentation/filesystems/vfs.txt

@@ -694,8 +694,7 @@ struct address_space_operations {
 
 
   write_end: After a successful write_begin, and data copy, write_end must
   write_end: After a successful write_begin, and data copy, write_end must
         be called. len is the original len passed to write_begin, and copied
         be called. len is the original len passed to write_begin, and copied
-        is the amount that was able to be copied (copied == len is always true
-	if write_begin was called with the AOP_FLAG_UNINTERRUPTIBLE flag).
+        is the amount that was able to be copied.
 
 
         The filesystem must take care of unlocking the page and releasing it
         The filesystem must take care of unlocking the page and releasing it
         refcount, and updating i_size.
         refcount, and updating i_size.

+ 15 - 8
Documentation/powerpc/firmware-assisted-dump.txt

@@ -55,10 +55,14 @@ as follows:
          booted with restricted memory. By default, the boot memory
          booted with restricted memory. By default, the boot memory
          size will be the larger of 5% of system RAM or 256MB.
          size will be the larger of 5% of system RAM or 256MB.
          Alternatively, user can also specify boot memory size
          Alternatively, user can also specify boot memory size
-         through boot parameter 'fadump_reserve_mem=' which will
-         override the default calculated size. Use this option
-         if default boot memory size is not sufficient for second
-         kernel to boot successfully.
+         through boot parameter 'crashkernel=' which will override
+         the default calculated size. Use this option if default
+         boot memory size is not sufficient for second kernel to
+         boot successfully. For syntax of crashkernel= parameter,
+         refer to Documentation/kdump/kdump.txt. If any offset is
+         provided in crashkernel= parameter, it will be ignored
+         as fadump reserves memory at end of RAM for boot memory
+         dump preservation in case of a crash.
 
 
 -- After the low memory (boot memory) area has been saved, the
 -- After the low memory (boot memory) area has been saved, the
    firmware will reset PCI and other hardware state.  It will
    firmware will reset PCI and other hardware state.  It will
@@ -158,13 +162,16 @@ How to enable firmware-assisted dump (fadump):
 
 
 1. Set config option CONFIG_FA_DUMP=y and build kernel.
 1. Set config option CONFIG_FA_DUMP=y and build kernel.
 2. Boot into linux kernel with 'fadump=on' kernel cmdline option.
 2. Boot into linux kernel with 'fadump=on' kernel cmdline option.
-3. Optionally, user can also set 'fadump_reserve_mem=' kernel cmdline
+3. Optionally, user can also set 'crashkernel=' kernel cmdline
    to specify size of the memory to reserve for boot memory dump
    to specify size of the memory to reserve for boot memory dump
    preservation.
    preservation.
 
 
-NOTE: If firmware-assisted dump fails to reserve memory then it will
-   fallback to existing kdump mechanism if 'crashkernel=' option
-   is set at kernel cmdline.
+NOTE: 1. 'fadump_reserve_mem=' parameter has been deprecated. Instead
+         use 'crashkernel=' to specify size of the memory to reserve
+         for boot memory dump preservation.
+      2. If firmware-assisted dump fails to reserve memory then it
+         will fallback to existing kdump mechanism if 'crashkernel='
+         option is set at kernel cmdline.
 
 
 Sysfs/debugfs files:
 Sysfs/debugfs files:
 ------------
 ------------

+ 5 - 5
Documentation/vm/transhuge.txt

@@ -266,7 +266,7 @@ for each mapping.
 
 
 The number of file transparent huge pages mapped to userspace is available
 The number of file transparent huge pages mapped to userspace is available
 by reading ShmemPmdMapped and ShmemHugePages fields in /proc/meminfo.
 by reading ShmemPmdMapped and ShmemHugePages fields in /proc/meminfo.
-To identify what applications are mapping file  transparent huge pages, it
+To identify what applications are mapping file transparent huge pages, it
 is necessary to read /proc/PID/smaps and count the FileHugeMapped fields
 is necessary to read /proc/PID/smaps and count the FileHugeMapped fields
 for each mapping.
 for each mapping.
 
 
@@ -292,7 +292,7 @@ thp_collapse_alloc_failed is incremented if khugepaged found a range
 	the allocation.
 	the allocation.
 
 
 thp_file_alloc is incremented every time a file huge page is successfully
 thp_file_alloc is incremented every time a file huge page is successfully
-i	allocated.
+	allocated.
 
 
 thp_file_mapped is incremented every time a file huge page is mapped into
 thp_file_mapped is incremented every time a file huge page is mapped into
 	user address space.
 	user address space.
@@ -501,7 +501,7 @@ scanner can get reference to a page is get_page_unless_zero().
 
 
 All tail pages have zero ->_refcount until atomic_add(). This prevents the
 All tail pages have zero ->_refcount until atomic_add(). This prevents the
 scanner from getting a reference to the tail page up to that point. After the
 scanner from getting a reference to the tail page up to that point. After the
-atomic_add() we don't care about the ->_refcount value.  We already known how
+atomic_add() we don't care about the ->_refcount value. We already known how
 many references should be uncharged from the head page.
 many references should be uncharged from the head page.
 
 
 For head page get_page_unless_zero() will succeed and we don't mind. It's
 For head page get_page_unless_zero() will succeed and we don't mind. It's
@@ -519,8 +519,8 @@ comes. Splitting will free up unused subpages.
 
 
 Splitting the page right away is not an option due to locking context in
 Splitting the page right away is not an option due to locking context in
 the place where we can detect partial unmap. It's also might be
 the place where we can detect partial unmap. It's also might be
-counterproductive since in many cases partial unmap unmap happens during
-exit(2) if an THP crosses VMA boundary.
+counterproductive since in many cases partial unmap happens during exit(2) if
+a THP crosses a VMA boundary.
 
 
 Function deferred_split_huge_page() is used to queue page for splitting.
 Function deferred_split_huge_page() is used to queue page for splitting.
 The splitting itself will happen when we get memory pressure via shrinker
 The splitting itself will happen when we get memory pressure via shrinker

+ 6 - 2
Makefile

@@ -1374,7 +1374,7 @@ help:
 	@echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
 	@echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
 	 echo  '                    (default: $(INSTALL_HDR_PATH))'; \
 	 echo  '                    (default: $(INSTALL_HDR_PATH))'; \
 	 echo  ''
 	 echo  ''
-	@echo  'Static analysers'
+	@echo  'Static analysers:'
 	@echo  '  checkstack      - Generate a list of stack hogs'
 	@echo  '  checkstack      - Generate a list of stack hogs'
 	@echo  '  namespacecheck  - Name space analysis on compiled kernel'
 	@echo  '  namespacecheck  - Name space analysis on compiled kernel'
 	@echo  '  versioncheck    - Sanity check on version.h usage'
 	@echo  '  versioncheck    - Sanity check on version.h usage'
@@ -1384,7 +1384,7 @@ help:
 	@echo  '  headerdep       - Detect inclusion cycles in headers'
 	@echo  '  headerdep       - Detect inclusion cycles in headers'
 	@$(MAKE) -f $(srctree)/scripts/Makefile.help checker-help
 	@$(MAKE) -f $(srctree)/scripts/Makefile.help checker-help
 	@echo  ''
 	@echo  ''
-	@echo  'Kernel selftest'
+	@echo  'Kernel selftest:'
 	@echo  '  kselftest       - Build and run kernel selftest (run as root)'
 	@echo  '  kselftest       - Build and run kernel selftest (run as root)'
 	@echo  '                    Build, install, and boot kernel before'
 	@echo  '                    Build, install, and boot kernel before'
 	@echo  '                    running kselftest on it'
 	@echo  '                    running kselftest on it'
@@ -1392,6 +1392,10 @@ help:
 	@echo  '  kselftest-merge - Merge all the config dependencies of kselftest to existed'
 	@echo  '  kselftest-merge - Merge all the config dependencies of kselftest to existed'
 	@echo  '                    .config.'
 	@echo  '                    .config.'
 	@echo  ''
 	@echo  ''
+	@echo 'Userspace tools targets:'
+	@echo '  use "make tools/help"'
+	@echo '  or  "cd tools; make help"'
+	@echo  ''
 	@echo  'Kernel packaging:'
 	@echo  'Kernel packaging:'
 	@$(MAKE) $(build)=$(package-dir) help
 	@$(MAKE) $(build)=$(package-dir) help
 	@echo  ''
 	@echo  ''

+ 4 - 0
arch/Kconfig

@@ -2,7 +2,11 @@
 # General architecture dependent options
 # General architecture dependent options
 #
 #
 
 
+config CRASH_CORE
+	bool
+
 config KEXEC_CORE
 config KEXEC_CORE
+	select CRASH_CORE
 	bool
 	bool
 
 
 config HAVE_IMA_KEXEC
 config HAVE_IMA_KEXEC

+ 1 - 1
arch/arc/kernel/unwind.c

@@ -845,7 +845,7 @@ static int processCFI(const u8 *start, const u8 *end, unsigned long targetLoc,
 				    * state->dataAlign;
 				    * state->dataAlign;
 				break;
 				break;
 			case DW_CFA_def_cfa_register:
 			case DW_CFA_def_cfa_register:
-				unw_debug("cfa_def_cfa_regsiter: ");
+				unw_debug("cfa_def_cfa_register: ");
 				state->cfa.reg = get_uleb128(&ptr.p8, end);
 				state->cfa.reg = get_uleb128(&ptr.p8, end);
 				break;
 				break;
 				/*todo case DW_CFA_def_cfa_expression: */
 				/*todo case DW_CFA_def_cfa_expression: */

+ 0 - 20
arch/arm/include/asm/cacheflush.h

@@ -478,26 +478,6 @@ static inline void __sync_cache_range_r(volatile void *p, size_t size)
 	: : : "r0","r1","r2","r3","r4","r5","r6","r7", \
 	: : : "r0","r1","r2","r3","r4","r5","r6","r7", \
 	      "r9","r10","lr","memory" )
 	      "r9","r10","lr","memory" )
 
 
-#ifdef CONFIG_MMU
-int set_memory_ro(unsigned long addr, int numpages);
-int set_memory_rw(unsigned long addr, int numpages);
-int set_memory_x(unsigned long addr, int numpages);
-int set_memory_nx(unsigned long addr, int numpages);
-#else
-static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
-static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
-static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
-static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
-#endif
-
-#ifdef CONFIG_STRICT_KERNEL_RWX
-void set_kernel_text_rw(void);
-void set_kernel_text_ro(void);
-#else
-static inline void set_kernel_text_rw(void) { }
-static inline void set_kernel_text_ro(void) { }
-#endif
-
 void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
 void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
 			     void *kaddr, unsigned long len);
 			     void *kaddr, unsigned long len);
 
 

+ 32 - 0
arch/arm/include/asm/set_memory.h

@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 1999-2002 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _ASMARM_SET_MEMORY_H
+#define _ASMARM_SET_MEMORY_H
+
+#ifdef CONFIG_MMU
+int set_memory_ro(unsigned long addr, int numpages);
+int set_memory_rw(unsigned long addr, int numpages);
+int set_memory_x(unsigned long addr, int numpages);
+int set_memory_nx(unsigned long addr, int numpages);
+#else
+static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
+static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
+static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
+static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
+#endif
+
+#ifdef CONFIG_STRICT_KERNEL_RWX
+void set_kernel_text_rw(void);
+void set_kernel_text_ro(void);
+#else
+static inline void set_kernel_text_rw(void) { }
+static inline void set_kernel_text_ro(void) { }
+#endif
+
+#endif

+ 1 - 0
arch/arm/kernel/ftrace.c

@@ -21,6 +21,7 @@
 #include <asm/opcodes.h>
 #include <asm/opcodes.h>
 #include <asm/ftrace.h>
 #include <asm/ftrace.h>
 #include <asm/insn.h>
 #include <asm/insn.h>
+#include <asm/set_memory.h>
 
 
 #ifdef CONFIG_THUMB2_KERNEL
 #ifdef CONFIG_THUMB2_KERNEL
 #define	NOP		0xf85deb04	/* pop.w {lr} */
 #define	NOP		0xf85deb04	/* pop.w {lr} */

+ 1 - 1
arch/arm/kernel/kgdb.c

@@ -269,7 +269,7 @@ int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
 
 
 /*
 /*
  * Register our undef instruction hooks with ARM undef core.
  * Register our undef instruction hooks with ARM undef core.
- * We regsiter a hook specifically looking for the KGB break inst
+ * We register a hook specifically looking for the KGB break inst
  * and we handle the normal undef case within the do_undefinstr
  * and we handle the normal undef case within the do_undefinstr
  * handler.
  * handler.
  */
  */

+ 1 - 0
arch/arm/kernel/machine_kexec.c

@@ -18,6 +18,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach-types.h>
 #include <asm/smp_plat.h>
 #include <asm/smp_plat.h>
 #include <asm/system_misc.h>
 #include <asm/system_misc.h>
+#include <asm/set_memory.h>
 
 
 extern void relocate_new_kernel(void);
 extern void relocate_new_kernel(void);
 extern const unsigned int relocate_new_kernel_size;
 extern const unsigned int relocate_new_kernel_size;

+ 2 - 2
arch/arm/mach-ixp4xx/common-pci.c

@@ -43,14 +43,14 @@
 int (*ixp4xx_pci_read)(u32 addr, u32 cmd, u32* data);
 int (*ixp4xx_pci_read)(u32 addr, u32 cmd, u32* data);
 
 
 /*
 /*
- * Base address for PCI regsiter region
+ * Base address for PCI register region
  */
  */
 unsigned long ixp4xx_pci_reg_base = 0;
 unsigned long ixp4xx_pci_reg_base = 0;
 
 
 /*
 /*
  * PCI cfg an I/O routines are done by programming a 
  * PCI cfg an I/O routines are done by programming a 
  * command/byte enable register, and then read/writing
  * command/byte enable register, and then read/writing
- * the data from a data regsiter. We need to ensure
+ * the data from a data register. We need to ensure
  * these transactions are atomic or we will end up
  * these transactions are atomic or we will end up
  * with corrupt data on the bus or in a driver.
  * with corrupt data on the bus or in a driver.
  */
  */

+ 1 - 1
arch/arm/mach-omap2/board-n8x0.c

@@ -117,7 +117,7 @@ static struct musb_hdrc_platform_data tusb_data = {
 static void __init n8x0_usb_init(void)
 static void __init n8x0_usb_init(void)
 {
 {
 	int ret = 0;
 	int ret = 0;
-	static char	announce[] __initdata = KERN_INFO "TUSB 6010\n";
+	static const char announce[] __initconst = KERN_INFO "TUSB 6010\n";
 
 
 	/* PM companion chip power control pin */
 	/* PM companion chip power control pin */
 	ret = gpio_request_one(TUSB6010_GPIO_ENABLE, GPIOF_OUT_INIT_LOW,
 	ret = gpio_request_one(TUSB6010_GPIO_ENABLE, GPIOF_OUT_INIT_LOW,

+ 1 - 0
arch/arm/mm/pageattr.c

@@ -15,6 +15,7 @@
 
 
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/tlbflush.h>
+#include <asm/set_memory.h>
 
 
 struct page_change_data {
 struct page_change_data {
 	pgprot_t set_mask;
 	pgprot_t set_mask;

+ 1 - 0
arch/arm/net/bpf_jit_32.c

@@ -18,6 +18,7 @@
 #include <linux/if_vlan.h>
 #include <linux/if_vlan.h>
 
 
 #include <asm/cacheflush.h>
 #include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/hwcap.h>
 #include <asm/hwcap.h>
 #include <asm/opcodes.h>
 #include <asm/opcodes.h>
 
 

+ 1 - 0
arch/arm64/include/asm/Kbuild

@@ -29,6 +29,7 @@ generic-y += rwsem.h
 generic-y += segment.h
 generic-y += segment.h
 generic-y += sembuf.h
 generic-y += sembuf.h
 generic-y += serial.h
 generic-y += serial.h
+generic-y += set_memory.h
 generic-y += shmbuf.h
 generic-y += shmbuf.h
 generic-y += simd.h
 generic-y += simd.h
 generic-y += sizes.h
 generic-y += sizes.h

+ 0 - 4
arch/arm64/include/asm/cacheflush.h

@@ -150,10 +150,6 @@ static inline void flush_cache_vunmap(unsigned long start, unsigned long end)
 {
 {
 }
 }
 
 
-int set_memory_ro(unsigned long addr, int numpages);
-int set_memory_rw(unsigned long addr, int numpages);
-int set_memory_x(unsigned long addr, int numpages);
-int set_memory_nx(unsigned long addr, int numpages);
 int set_memory_valid(unsigned long addr, unsigned long size, int enable);
 int set_memory_valid(unsigned long addr, unsigned long size, int enable);
 
 
 #endif
 #endif

+ 1 - 0
arch/arm64/mm/pageattr.c

@@ -17,6 +17,7 @@
 #include <linux/vmalloc.h>
 #include <linux/vmalloc.h>
 
 
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
+#include <asm/set_memory.h>
 #include <asm/tlbflush.h>
 #include <asm/tlbflush.h>
 
 
 struct page_change_data {
 struct page_change_data {

+ 1 - 0
arch/arm64/net/bpf_jit_comp.c

@@ -27,6 +27,7 @@
 #include <asm/byteorder.h>
 #include <asm/byteorder.h>
 #include <asm/cacheflush.h>
 #include <asm/cacheflush.h>
 #include <asm/debug-monitors.h>
 #include <asm/debug-monitors.h>
+#include <asm/set_memory.h>
 
 
 #include "bpf_jit.h"
 #include "bpf_jit.h"
 
 

+ 0 - 22
arch/ia64/kernel/crash.c

@@ -27,28 +27,6 @@ static int kdump_freeze_monarch;
 static int kdump_on_init = 1;
 static int kdump_on_init = 1;
 static int kdump_on_fatal_mca = 1;
 static int kdump_on_fatal_mca = 1;
 
 
-static inline Elf64_Word
-*append_elf_note(Elf64_Word *buf, char *name, unsigned type, void *data,
-		size_t data_len)
-{
-	struct elf_note *note = (struct elf_note *)buf;
-	note->n_namesz = strlen(name) + 1;
-	note->n_descsz = data_len;
-	note->n_type   = type;
-	buf += (sizeof(*note) + 3)/4;
-	memcpy(buf, name, note->n_namesz);
-	buf += (note->n_namesz + 3)/4;
-	memcpy(buf, data, data_len);
-	buf += (data_len + 3)/4;
-	return buf;
-}
-
-static void
-final_note(void *buf)
-{
-	memset(buf, 0, sizeof(struct elf_note));
-}
-
 extern void ia64_dump_cpu_regs(void *);
 extern void ia64_dump_cpu_regs(void *);
 
 
 static DEFINE_PER_CPU(struct elf_prstatus, elf_prstatus);
 static DEFINE_PER_CPU(struct elf_prstatus, elf_prstatus);

+ 1 - 1
arch/m68k/ifpsp060/src/ilsp.S

@@ -776,7 +776,7 @@ muls64_zero:
 # ALGORITHM ***********************************************************	#
 # ALGORITHM ***********************************************************	#
 #	In the interest of simplicity, all operands are converted to	#
 #	In the interest of simplicity, all operands are converted to	#
 # longword size whether the operation is byte, word, or long. The	#
 # longword size whether the operation is byte, word, or long. The	#
-# bounds are sign extended accordingly. If Rn is a data regsiter, Rn is #
+# bounds are sign extended accordingly. If Rn is a data register, Rn is #
 # also sign extended. If Rn is an address register, it need not be sign #
 # also sign extended. If Rn is an address register, it need not be sign #
 # extended since the full register is always used.			#
 # extended since the full register is always used.			#
 #	The condition codes are set correctly before the final "rts".	#
 #	The condition codes are set correctly before the final "rts".	#

+ 1 - 1
arch/m68k/ifpsp060/src/isp.S

@@ -1876,7 +1876,7 @@ movp_read_err:
 # word, or longword sized operands. Then, in the interest of		#
 # word, or longword sized operands. Then, in the interest of		#
 # simplicity, all operands are converted to longword size whether the	#
 # simplicity, all operands are converted to longword size whether the	#
 # operation is byte, word, or long. The bounds are sign extended	#
 # operation is byte, word, or long. The bounds are sign extended	#
-# accordingly. If Rn is a data regsiter, Rn is also sign extended. If	#
+# accordingly. If Rn is a data register, Rn is also sign extended. If	#
 # Rn is an address register, it need not be sign extended since the	#
 # Rn is an address register, it need not be sign extended since the	#
 # full register is always used.						#
 # full register is always used.						#
 #	The comparisons are made and the condition codes calculated.	#
 #	The comparisons are made and the condition codes calculated.	#

+ 1 - 1
arch/mips/cavium-octeon/executive/cvmx-helper-rgmii.c

@@ -152,7 +152,7 @@ static int __cvmx_helper_errata_asx_pass1(int interface, int port,
 }
 }
 
 
 /**
 /**
- * Configure all of the ASX, GMX, and PKO regsiters required
+ * Configure all of the ASX, GMX, and PKO registers required
  * to get RGMII to function on the supplied interface.
  * to get RGMII to function on the supplied interface.
  *
  *
  * @interface: PKO Interface to configure (0 or 1)
  * @interface: PKO Interface to configure (0 or 1)

+ 3 - 3
arch/mips/dec/prom/init.c

@@ -88,7 +88,7 @@ void __init which_prom(s32 magic, s32 *prom_vec)
 void __init prom_init(void)
 void __init prom_init(void)
 {
 {
 	extern void dec_machine_halt(void);
 	extern void dec_machine_halt(void);
-	static char cpu_msg[] __initdata =
+	static const char cpu_msg[] __initconst =
 		"Sorry, this kernel is compiled for a wrong CPU type!\n";
 		"Sorry, this kernel is compiled for a wrong CPU type!\n";
 	s32 argc = fw_arg0;
 	s32 argc = fw_arg0;
 	s32 *argv = (void *)fw_arg1;
 	s32 *argv = (void *)fw_arg1;
@@ -111,7 +111,7 @@ void __init prom_init(void)
 #if defined(CONFIG_CPU_R3000)
 #if defined(CONFIG_CPU_R3000)
 	if ((current_cpu_type() == CPU_R4000SC) ||
 	if ((current_cpu_type() == CPU_R4000SC) ||
 	    (current_cpu_type() == CPU_R4400SC)) {
 	    (current_cpu_type() == CPU_R4400SC)) {
-		static char r4k_msg[] __initdata =
+		static const char r4k_msg[] __initconst =
 			"Please recompile with \"CONFIG_CPU_R4x00 = y\".\n";
 			"Please recompile with \"CONFIG_CPU_R4x00 = y\".\n";
 		printk(cpu_msg);
 		printk(cpu_msg);
 		printk(r4k_msg);
 		printk(r4k_msg);
@@ -122,7 +122,7 @@ void __init prom_init(void)
 #if defined(CONFIG_CPU_R4X00)
 #if defined(CONFIG_CPU_R4X00)
 	if ((current_cpu_type() == CPU_R3000) ||
 	if ((current_cpu_type() == CPU_R3000) ||
 	    (current_cpu_type() == CPU_R3000A)) {
 	    (current_cpu_type() == CPU_R3000A)) {
-		static char r3k_msg[] __initdata =
+		static const char r3k_msg[] __initconst =
 			"Please recompile with \"CONFIG_CPU_R3000 = y\".\n";
 			"Please recompile with \"CONFIG_CPU_R3000 = y\".\n";
 		printk(cpu_msg);
 		printk(cpu_msg);
 		printk(r3k_msg);
 		printk(r3k_msg);

+ 1 - 1
arch/mips/include/asm/octeon/cvmx-helper-rgmii.h

@@ -55,7 +55,7 @@ extern int __cvmx_helper_rgmii_probe(int interface);
 extern void cvmx_helper_rgmii_internal_loopback(int port);
 extern void cvmx_helper_rgmii_internal_loopback(int port);
 
 
 /**
 /**
- * Configure all of the ASX, GMX, and PKO regsiters required
+ * Configure all of the ASX, GMX, and PKO registers required
  * to get RGMII to function on the supplied interface.
  * to get RGMII to function on the supplied interface.
  *
  *
  * @interface: PKO Interface to configure (0 or 1)
  * @interface: PKO Interface to configure (0 or 1)

+ 1 - 1
arch/mips/kernel/perf_event_mipsxx.c

@@ -618,7 +618,7 @@ static int mipspmu_event_init(struct perf_event *event)
 		return -ENOENT;
 		return -ENOENT;
 	}
 	}
 
 
-	if (event->cpu >= nr_cpumask_bits ||
+	if ((unsigned int)event->cpu >= nr_cpumask_bits ||
 	    (event->cpu >= 0 && !cpu_online(event->cpu)))
 	    (event->cpu >= 0 && !cpu_online(event->cpu)))
 		return -ENODEV;
 		return -ENODEV;
 
 

+ 2 - 2
arch/mips/kernel/traps.c

@@ -2256,8 +2256,8 @@ void set_handler(unsigned long offset, void *addr, unsigned long size)
 	local_flush_icache_range(ebase + offset, ebase + offset + size);
 	local_flush_icache_range(ebase + offset, ebase + offset + size);
 }
 }
 
 
-static char panic_null_cerr[] =
-	"Trying to set NULL cache error exception handler";
+static const char panic_null_cerr[] =
+	"Trying to set NULL cache error exception handler\n";
 
 
 /*
 /*
  * Install uncached CPU exception handler.
  * Install uncached CPU exception handler.

+ 1 - 1
arch/parisc/kernel/entry.S

@@ -1369,7 +1369,7 @@ nadtlb_nullify:
 
 
 	/* 
 	/* 
 		When there is no translation for the probe address then we
 		When there is no translation for the probe address then we
-		must nullify the insn and return zero in the target regsiter.
+		must nullify the insn and return zero in the target register.
 		This will indicate to the calling code that it does not have 
 		This will indicate to the calling code that it does not have 
 		write/read privileges to this address.
 		write/read privileges to this address.
 
 

+ 1 - 1
arch/parisc/kernel/module.c

@@ -218,7 +218,7 @@ void *module_alloc(unsigned long size)
 	 * easier than trying to map the text, data, init_text and
 	 * easier than trying to map the text, data, init_text and
 	 * init_data correctly */
 	 * init_data correctly */
 	return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END,
 	return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END,
-				    GFP_KERNEL | __GFP_HIGHMEM,
+				    GFP_KERNEL,
 				    PAGE_KERNEL_RWX, 0, NUMA_NO_NODE,
 				    PAGE_KERNEL_RWX, 0, NUMA_NO_NODE,
 				    __builtin_return_address(0));
 				    __builtin_return_address(0));
 }
 }

+ 6 - 4
arch/powerpc/Kconfig

@@ -571,21 +571,23 @@ config RELOCATABLE_TEST
 	  relocation code.
 	  relocation code.
 
 
 config CRASH_DUMP
 config CRASH_DUMP
-	bool "Build a kdump crash kernel"
+	bool "Build a dump capture kernel"
 	depends on PPC64 || 6xx || FSL_BOOKE || (44x && !SMP)
 	depends on PPC64 || 6xx || FSL_BOOKE || (44x && !SMP)
 	select RELOCATABLE if PPC64 || 44x || FSL_BOOKE
 	select RELOCATABLE if PPC64 || 44x || FSL_BOOKE
 	help
 	help
-	  Build a kernel suitable for use as a kdump capture kernel.
+	  Build a kernel suitable for use as a dump capture kernel.
 	  The same kernel binary can be used as production kernel and dump
 	  The same kernel binary can be used as production kernel and dump
 	  capture kernel.
 	  capture kernel.
 
 
 config FA_DUMP
 config FA_DUMP
 	bool "Firmware-assisted dump"
 	bool "Firmware-assisted dump"
-	depends on PPC64 && PPC_RTAS && CRASH_DUMP && KEXEC_CORE
+	depends on PPC64 && PPC_RTAS
+	select CRASH_CORE
+	select CRASH_DUMP
 	help
 	help
 	  A robust mechanism to get reliable kernel crash dump with
 	  A robust mechanism to get reliable kernel crash dump with
 	  assistance from firmware. This approach does not use kexec,
 	  assistance from firmware. This approach does not use kexec,
-	  instead firmware assists in booting the kdump kernel
+	  instead firmware assists in booting the capture kernel
 	  while preserving memory contents. Firmware-assisted dump
 	  while preserving memory contents. Firmware-assisted dump
 	  is meant to be a kdump replacement offering robustness and
 	  is meant to be a kdump replacement offering robustness and
 	  speed not possible without system firmware assistance.
 	  speed not possible without system firmware assistance.

+ 2 - 0
arch/powerpc/include/asm/fadump.h

@@ -73,6 +73,8 @@
 	reg_entry++;							\
 	reg_entry++;							\
 })
 })
 
 
+extern int crashing_cpu;
+
 /* Kernel Dump section info */
 /* Kernel Dump section info */
 struct fadump_section {
 struct fadump_section {
 	__be32	request_flag;
 	__be32	request_flag;

+ 0 - 2
arch/powerpc/kernel/crash.c

@@ -43,8 +43,6 @@
 #define IPI_TIMEOUT		10000
 #define IPI_TIMEOUT		10000
 #define REAL_MODE_TIMEOUT	10000
 #define REAL_MODE_TIMEOUT	10000
 
 
-/* This keeps a track of which one is the crashing cpu. */
-int crashing_cpu = -1;
 static int time_to_dump;
 static int time_to_dump;
 
 
 #define CRASH_HANDLER_MAX 3
 #define CRASH_HANDLER_MAX 3

+ 13 - 44
arch/powerpc/kernel/fadump.c

@@ -209,14 +209,20 @@ static unsigned long init_fadump_mem_struct(struct fadump_mem_struct *fdm,
  */
  */
 static inline unsigned long fadump_calculate_reserve_size(void)
 static inline unsigned long fadump_calculate_reserve_size(void)
 {
 {
-	unsigned long size;
+	int ret;
+	unsigned long long base, size;
 
 
 	/*
 	/*
-	 * Check if the size is specified through fadump_reserve_mem= cmdline
-	 * option. If yes, then use that.
+	 * Check if the size is specified through crashkernel= cmdline
+	 * option. If yes, then use that but ignore base as fadump
+	 * reserves memory at end of RAM.
 	 */
 	 */
-	if (fw_dump.reserve_bootvar)
+	ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
+				&size, &base);
+	if (ret == 0 && size > 0) {
+		fw_dump.reserve_bootvar = (unsigned long)size;
 		return fw_dump.reserve_bootvar;
 		return fw_dump.reserve_bootvar;
+	}
 
 
 	/* divide by 20 to get 5% of value */
 	/* divide by 20 to get 5% of value */
 	size = memblock_end_of_DRAM() / 20;
 	size = memblock_end_of_DRAM() / 20;
@@ -371,15 +377,6 @@ static int __init early_fadump_param(char *p)
 }
 }
 early_param("fadump", early_fadump_param);
 early_param("fadump", early_fadump_param);
 
 
-/* Look for fadump_reserve_mem= cmdline option */
-static int __init early_fadump_reserve_mem(char *p)
-{
-	if (p)
-		fw_dump.reserve_bootvar = memparse(p, &p);
-	return 0;
-}
-early_param("fadump_reserve_mem", early_fadump_reserve_mem);
-
 static void register_fw_dump(struct fadump_mem_struct *fdm)
 static void register_fw_dump(struct fadump_mem_struct *fdm)
 {
 {
 	int rc;
 	int rc;
@@ -527,34 +524,6 @@ fadump_read_registers(struct fadump_reg_entry *reg_entry, struct pt_regs *regs)
 	return reg_entry;
 	return reg_entry;
 }
 }
 
 
-static u32 *fadump_append_elf_note(u32 *buf, char *name, unsigned type,
-						void *data, size_t data_len)
-{
-	struct elf_note note;
-
-	note.n_namesz = strlen(name) + 1;
-	note.n_descsz = data_len;
-	note.n_type   = type;
-	memcpy(buf, &note, sizeof(note));
-	buf += (sizeof(note) + 3)/4;
-	memcpy(buf, name, note.n_namesz);
-	buf += (note.n_namesz + 3)/4;
-	memcpy(buf, data, note.n_descsz);
-	buf += (note.n_descsz + 3)/4;
-
-	return buf;
-}
-
-static void fadump_final_note(u32 *buf)
-{
-	struct elf_note note;
-
-	note.n_namesz = 0;
-	note.n_descsz = 0;
-	note.n_type   = 0;
-	memcpy(buf, &note, sizeof(note));
-}
-
 static u32 *fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)
 static u32 *fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)
 {
 {
 	struct elf_prstatus prstatus;
 	struct elf_prstatus prstatus;
@@ -565,8 +534,8 @@ static u32 *fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)
 	 * prstatus.pr_pid = ????
 	 * prstatus.pr_pid = ????
 	 */
 	 */
 	elf_core_copy_kernel_regs(&prstatus.pr_reg, regs);
 	elf_core_copy_kernel_regs(&prstatus.pr_reg, regs);
-	buf = fadump_append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_PRSTATUS,
-				&prstatus, sizeof(prstatus));
+	buf = append_elf_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS,
+			      &prstatus, sizeof(prstatus));
 	return buf;
 	return buf;
 }
 }
 
 
@@ -707,7 +676,7 @@ static int __init fadump_build_cpu_notes(const struct fadump_mem_struct *fdm)
 			note_buf = fadump_regs_to_elf_notes(note_buf, &regs);
 			note_buf = fadump_regs_to_elf_notes(note_buf, &regs);
 		}
 		}
 	}
 	}
-	fadump_final_note(note_buf);
+	final_note(note_buf);
 
 
 	if (fdh) {
 	if (fdh) {
 		pr_debug("Updating elfcore header (%llx) with cpu notes\n",
 		pr_debug("Updating elfcore header (%llx) with cpu notes\n",

+ 5 - 0
arch/powerpc/kernel/setup-common.c

@@ -125,6 +125,11 @@ int ppc_do_canonicalize_irqs;
 EXPORT_SYMBOL(ppc_do_canonicalize_irqs);
 EXPORT_SYMBOL(ppc_do_canonicalize_irqs);
 #endif
 #endif
 
 
+#ifdef CONFIG_CRASH_CORE
+/* This keeps a track of which one is the crashing cpu. */
+int crashing_cpu = -1;
+#endif
+
 /* also used by kexec */
 /* also used by kexec */
 void machine_shutdown(void)
 void machine_shutdown(void)
 {
 {

+ 1 - 1
arch/powerpc/mm/icswx.c

@@ -186,7 +186,7 @@ static u32 acop_get_inst(struct pt_regs *regs)
 }
 }
 
 
 /**
 /**
- * @regs: regsiters at time of interrupt
+ * @regs: registers at time of interrupt
  * @address: storage address
  * @address: storage address
  * @error_code: Fault code, usually the DSISR or ESR depending on
  * @error_code: Fault code, usually the DSISR or ESR depending on
  *		processor type
  *		processor type

+ 1 - 0
arch/s390/include/asm/Kbuild

@@ -1,4 +1,5 @@
 generic-y += asm-offsets.h
 generic-y += asm-offsets.h
+generic-y += cacheflush.h
 generic-y += clkdev.h
 generic-y += clkdev.h
 generic-y += dma-contiguous.h
 generic-y += dma-contiguous.h
 generic-y += div64.h
 generic-y += div64.h

+ 3 - 6
arch/s390/include/asm/cacheflush.h → arch/s390/include/asm/set_memory.h

@@ -1,8 +1,5 @@
-#ifndef _S390_CACHEFLUSH_H
-#define _S390_CACHEFLUSH_H
-
-/* Caches aren't brain-dead on the s390. */
-#include <asm-generic/cacheflush.h>
+#ifndef _ASMS390_SET_MEMORY_H
+#define _ASMS390_SET_MEMORY_H
 
 
 #define SET_MEMORY_RO	1UL
 #define SET_MEMORY_RO	1UL
 #define SET_MEMORY_RW	2UL
 #define SET_MEMORY_RW	2UL
@@ -31,4 +28,4 @@ static inline int set_memory_x(unsigned long addr, int numpages)
 	return __set_memory(addr, numpages, SET_MEMORY_X);
 	return __set_memory(addr, numpages, SET_MEMORY_X);
 }
 }
 
 
-#endif /* _S390_CACHEFLUSH_H */
+#endif

+ 1 - 0
arch/s390/kernel/ftrace.c

@@ -17,6 +17,7 @@
 #include <trace/syscall.h>
 #include <trace/syscall.h>
 #include <asm/asm-offsets.h>
 #include <asm/asm-offsets.h>
 #include <asm/cacheflush.h>
 #include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include "entry.h"
 #include "entry.h"
 
 
 /*
 /*

+ 1 - 1
arch/s390/kernel/kprobes.c

@@ -31,7 +31,7 @@
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/hardirq.h>
 #include <linux/hardirq.h>
 #include <linux/ftrace.h>
 #include <linux/ftrace.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/sections.h>
 #include <asm/sections.h>
 #include <linux/uaccess.h>
 #include <linux/uaccess.h>
 #include <asm/dis.h>
 #include <asm/dis.h>

+ 1 - 0
arch/s390/kernel/machine_kexec.c

@@ -26,6 +26,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/asm-offsets.h>
 #include <asm/cacheflush.h>
 #include <asm/cacheflush.h>
 #include <asm/os_info.h>
 #include <asm/os_info.h>
+#include <asm/set_memory.h>
 #include <asm/switch_to.h>
 #include <asm/switch_to.h>
 #include <asm/nmi.h>
 #include <asm/nmi.h>
 
 

+ 1 - 1
arch/s390/kernel/perf_cpum_sf.c

@@ -823,7 +823,7 @@ static int cpumsf_pmu_event_init(struct perf_event *event)
 	}
 	}
 
 
 	/* Check online status of the CPU to which the event is pinned */
 	/* Check online status of the CPU to which the event is pinned */
-	if (event->cpu >= nr_cpumask_bits ||
+	if ((unsigned int)event->cpu >= nr_cpumask_bits ||
 	    (event->cpu >= 0 && !cpu_online(event->cpu)))
 	    (event->cpu >= 0 && !cpu_online(event->cpu)))
 		return -ENODEV;
 		return -ENODEV;
 
 

+ 2 - 8
arch/s390/kvm/kvm-s390.c

@@ -1204,10 +1204,7 @@ static long kvm_s390_get_skeys(struct kvm *kvm, struct kvm_s390_skeys *args)
 	if (args->count < 1 || args->count > KVM_S390_SKEYS_MAX)
 	if (args->count < 1 || args->count > KVM_S390_SKEYS_MAX)
 		return -EINVAL;
 		return -EINVAL;
 
 
-	keys = kmalloc_array(args->count, sizeof(uint8_t),
-			     GFP_KERNEL | __GFP_NOWARN);
-	if (!keys)
-		keys = vmalloc(sizeof(uint8_t) * args->count);
+	keys = kvmalloc_array(args->count, sizeof(uint8_t), GFP_KERNEL);
 	if (!keys)
 	if (!keys)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
@@ -1249,10 +1246,7 @@ static long kvm_s390_set_skeys(struct kvm *kvm, struct kvm_s390_skeys *args)
 	if (args->count < 1 || args->count > KVM_S390_SKEYS_MAX)
 	if (args->count < 1 || args->count > KVM_S390_SKEYS_MAX)
 		return -EINVAL;
 		return -EINVAL;
 
 
-	keys = kmalloc_array(args->count, sizeof(uint8_t),
-			     GFP_KERNEL | __GFP_NOWARN);
-	if (!keys)
-		keys = vmalloc(sizeof(uint8_t) * args->count);
+	keys = kvmalloc_array(args->count, sizeof(uint8_t), GFP_KERNEL);
 	if (!keys)
 	if (!keys)
 		return -ENOMEM;
 		return -ENOMEM;
 
 

+ 1 - 0
arch/s390/mm/init.c

@@ -39,6 +39,7 @@
 #include <asm/sections.h>
 #include <asm/sections.h>
 #include <asm/ctl_reg.h>
 #include <asm/ctl_reg.h>
 #include <asm/sclp.h>
 #include <asm/sclp.h>
+#include <asm/set_memory.h>
 
 
 pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
 pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
 
 

+ 1 - 0
arch/s390/mm/pageattr.c

@@ -8,6 +8,7 @@
 #include <asm/facility.h>
 #include <asm/facility.h>
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/page.h>
+#include <asm/set_memory.h>
 
 
 static inline unsigned long sske_frame(unsigned long addr, unsigned char skey)
 static inline unsigned long sske_frame(unsigned long addr, unsigned char skey)
 {
 {

+ 1 - 0
arch/s390/mm/vmem.c

@@ -17,6 +17,7 @@
 #include <asm/setup.h>
 #include <asm/setup.h>
 #include <asm/tlbflush.h>
 #include <asm/tlbflush.h>
 #include <asm/sections.h>
 #include <asm/sections.h>
+#include <asm/set_memory.h>
 
 
 static DEFINE_MUTEX(vmem_mutex);
 static DEFINE_MUTEX(vmem_mutex);
 
 

+ 1 - 0
arch/s390/net/bpf_jit_comp.c

@@ -24,6 +24,7 @@
 #include <linux/bpf.h>
 #include <linux/bpf.h>
 #include <asm/cacheflush.h>
 #include <asm/cacheflush.h>
 #include <asm/dis.h>
 #include <asm/dis.h>
+#include <asm/set_memory.h>
 #include "bpf_jit.h"
 #include "bpf_jit.h"
 
 
 int bpf_jit_enable __read_mostly;
 int bpf_jit_enable __read_mostly;

+ 0 - 85
arch/x86/include/asm/cacheflush.h

@@ -5,93 +5,8 @@
 #include <asm-generic/cacheflush.h>
 #include <asm-generic/cacheflush.h>
 #include <asm/special_insns.h>
 #include <asm/special_insns.h>
 
 
-/*
- * The set_memory_* API can be used to change various attributes of a virtual
- * address range. The attributes include:
- * Cachability   : UnCached, WriteCombining, WriteThrough, WriteBack
- * Executability : eXeutable, NoteXecutable
- * Read/Write    : ReadOnly, ReadWrite
- * Presence      : NotPresent
- *
- * Within a category, the attributes are mutually exclusive.
- *
- * The implementation of this API will take care of various aspects that
- * are associated with changing such attributes, such as:
- * - Flushing TLBs
- * - Flushing CPU caches
- * - Making sure aliases of the memory behind the mapping don't violate
- *   coherency rules as defined by the CPU in the system.
- *
- * What this API does not do:
- * - Provide exclusion between various callers - including callers that
- *   operation on other mappings of the same physical page
- * - Restore default attributes when a page is freed
- * - Guarantee that mappings other than the requested one are
- *   in any state, other than that these do not violate rules for
- *   the CPU you have. Do not depend on any effects on other mappings,
- *   CPUs other than the one you have may have more relaxed rules.
- * The caller is required to take care of these.
- */
-
-int _set_memory_uc(unsigned long addr, int numpages);
-int _set_memory_wc(unsigned long addr, int numpages);
-int _set_memory_wt(unsigned long addr, int numpages);
-int _set_memory_wb(unsigned long addr, int numpages);
-int set_memory_uc(unsigned long addr, int numpages);
-int set_memory_wc(unsigned long addr, int numpages);
-int set_memory_wt(unsigned long addr, int numpages);
-int set_memory_wb(unsigned long addr, int numpages);
-int set_memory_x(unsigned long addr, int numpages);
-int set_memory_nx(unsigned long addr, int numpages);
-int set_memory_ro(unsigned long addr, int numpages);
-int set_memory_rw(unsigned long addr, int numpages);
-int set_memory_np(unsigned long addr, int numpages);
-int set_memory_4k(unsigned long addr, int numpages);
-
-int set_memory_array_uc(unsigned long *addr, int addrinarray);
-int set_memory_array_wc(unsigned long *addr, int addrinarray);
-int set_memory_array_wt(unsigned long *addr, int addrinarray);
-int set_memory_array_wb(unsigned long *addr, int addrinarray);
-
-int set_pages_array_uc(struct page **pages, int addrinarray);
-int set_pages_array_wc(struct page **pages, int addrinarray);
-int set_pages_array_wt(struct page **pages, int addrinarray);
-int set_pages_array_wb(struct page **pages, int addrinarray);
-
-/*
- * For legacy compatibility with the old APIs, a few functions
- * are provided that work on a "struct page".
- * These functions operate ONLY on the 1:1 kernel mapping of the
- * memory that the struct page represents, and internally just
- * call the set_memory_* function. See the description of the
- * set_memory_* function for more details on conventions.
- *
- * These APIs should be considered *deprecated* and are likely going to
- * be removed in the future.
- * The reason for this is the implicit operation on the 1:1 mapping only,
- * making this not a generally useful API.
- *
- * Specifically, many users of the old APIs had a virtual address,
- * called virt_to_page() or vmalloc_to_page() on that address to
- * get a struct page* that the old API required.
- * To convert these cases, use set_memory_*() on the original
- * virtual address, do not use these functions.
- */
-
-int set_pages_uc(struct page *page, int numpages);
-int set_pages_wb(struct page *page, int numpages);
-int set_pages_x(struct page *page, int numpages);
-int set_pages_nx(struct page *page, int numpages);
-int set_pages_ro(struct page *page, int numpages);
-int set_pages_rw(struct page *page, int numpages);
-
-
 void clflush_cache_range(void *addr, unsigned int size);
 void clflush_cache_range(void *addr, unsigned int size);
 
 
 #define mmio_flush_range(addr, size) clflush_cache_range(addr, size)
 #define mmio_flush_range(addr, size) clflush_cache_range(addr, size)
 
 
-extern int kernel_set_to_readonly;
-void set_kernel_text_rw(void);
-void set_kernel_text_ro(void);
-
 #endif /* _ASM_X86_CACHEFLUSH_H */
 #endif /* _ASM_X86_CACHEFLUSH_H */

+ 87 - 0
arch/x86/include/asm/set_memory.h

@@ -0,0 +1,87 @@
+#ifndef _ASM_X86_SET_MEMORY_H
+#define _ASM_X86_SET_MEMORY_H
+
+#include <asm/page.h>
+#include <asm-generic/set_memory.h>
+
+/*
+ * The set_memory_* API can be used to change various attributes of a virtual
+ * address range. The attributes include:
+ * Cachability   : UnCached, WriteCombining, WriteThrough, WriteBack
+ * Executability : eXeutable, NoteXecutable
+ * Read/Write    : ReadOnly, ReadWrite
+ * Presence      : NotPresent
+ *
+ * Within a category, the attributes are mutually exclusive.
+ *
+ * The implementation of this API will take care of various aspects that
+ * are associated with changing such attributes, such as:
+ * - Flushing TLBs
+ * - Flushing CPU caches
+ * - Making sure aliases of the memory behind the mapping don't violate
+ *   coherency rules as defined by the CPU in the system.
+ *
+ * What this API does not do:
+ * - Provide exclusion between various callers - including callers that
+ *   operation on other mappings of the same physical page
+ * - Restore default attributes when a page is freed
+ * - Guarantee that mappings other than the requested one are
+ *   in any state, other than that these do not violate rules for
+ *   the CPU you have. Do not depend on any effects on other mappings,
+ *   CPUs other than the one you have may have more relaxed rules.
+ * The caller is required to take care of these.
+ */
+
+int _set_memory_uc(unsigned long addr, int numpages);
+int _set_memory_wc(unsigned long addr, int numpages);
+int _set_memory_wt(unsigned long addr, int numpages);
+int _set_memory_wb(unsigned long addr, int numpages);
+int set_memory_uc(unsigned long addr, int numpages);
+int set_memory_wc(unsigned long addr, int numpages);
+int set_memory_wt(unsigned long addr, int numpages);
+int set_memory_wb(unsigned long addr, int numpages);
+int set_memory_np(unsigned long addr, int numpages);
+int set_memory_4k(unsigned long addr, int numpages);
+
+int set_memory_array_uc(unsigned long *addr, int addrinarray);
+int set_memory_array_wc(unsigned long *addr, int addrinarray);
+int set_memory_array_wt(unsigned long *addr, int addrinarray);
+int set_memory_array_wb(unsigned long *addr, int addrinarray);
+
+int set_pages_array_uc(struct page **pages, int addrinarray);
+int set_pages_array_wc(struct page **pages, int addrinarray);
+int set_pages_array_wt(struct page **pages, int addrinarray);
+int set_pages_array_wb(struct page **pages, int addrinarray);
+
+/*
+ * For legacy compatibility with the old APIs, a few functions
+ * are provided that work on a "struct page".
+ * These functions operate ONLY on the 1:1 kernel mapping of the
+ * memory that the struct page represents, and internally just
+ * call the set_memory_* function. See the description of the
+ * set_memory_* function for more details on conventions.
+ *
+ * These APIs should be considered *deprecated* and are likely going to
+ * be removed in the future.
+ * The reason for this is the implicit operation on the 1:1 mapping only,
+ * making this not a generally useful API.
+ *
+ * Specifically, many users of the old APIs had a virtual address,
+ * called virt_to_page() or vmalloc_to_page() on that address to
+ * get a struct page* that the old API required.
+ * To convert these cases, use set_memory_*() on the original
+ * virtual address, do not use these functions.
+ */
+
+int set_pages_uc(struct page *page, int numpages);
+int set_pages_wb(struct page *page, int numpages);
+int set_pages_x(struct page *page, int numpages);
+int set_pages_nx(struct page *page, int numpages);
+int set_pages_ro(struct page *page, int numpages);
+int set_pages_rw(struct page *page, int numpages);
+
+extern int kernel_set_to_readonly;
+void set_kernel_text_rw(void);
+void set_kernel_text_ro(void);
+
+#endif /* _ASM_X86_SET_MEMORY_H */

+ 1 - 1
arch/x86/kernel/amd_gart_64.c

@@ -36,7 +36,7 @@
 #include <asm/proto.h>
 #include <asm/proto.h>
 #include <asm/iommu.h>
 #include <asm/iommu.h>
 #include <asm/gart.h>
 #include <asm/gart.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/swiotlb.h>
 #include <asm/swiotlb.h>
 #include <asm/dma.h>
 #include <asm/dma.h>
 #include <asm/amd_nb.h>
 #include <asm/amd_nb.h>

+ 1 - 1
arch/x86/kernel/cpu/amd.c

@@ -16,7 +16,7 @@
 
 
 #ifdef CONFIG_X86_64
 #ifdef CONFIG_X86_64
 # include <asm/mmconfig.h>
 # include <asm/mmconfig.h>
-# include <asm/cacheflush.h>
+# include <asm/set_memory.h>
 #endif
 #endif
 
 
 #include "cpu.h"
 #include "cpu.h"

+ 1 - 1
arch/x86/kernel/cpu/bugs.c

@@ -17,7 +17,7 @@
 #include <asm/paravirt.h>
 #include <asm/paravirt.h>
 #include <asm/alternative.h>
 #include <asm/alternative.h>
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 
 
 void __init check_bugs(void)
 void __init check_bugs(void)
 {
 {

+ 1 - 1
arch/x86/kernel/ftrace.c

@@ -24,7 +24,7 @@
 
 
 #include <trace/syscall.h>
 #include <trace/syscall.h>
 
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/kprobes.h>
 #include <asm/kprobes.h>
 #include <asm/ftrace.h>
 #include <asm/ftrace.h>
 #include <asm/nops.h>
 #include <asm/nops.h>

+ 1 - 0
arch/x86/kernel/kprobes/core.c

@@ -61,6 +61,7 @@
 #include <asm/alternative.h>
 #include <asm/alternative.h>
 #include <asm/insn.h>
 #include <asm/insn.h>
 #include <asm/debugreg.h>
 #include <asm/debugreg.h>
+#include <asm/set_memory.h>
 
 
 #include "common.h"
 #include "common.h"
 
 

+ 1 - 0
arch/x86/kernel/kprobes/opt.c

@@ -37,6 +37,7 @@
 #include <asm/alternative.h>
 #include <asm/alternative.h>
 #include <asm/insn.h>
 #include <asm/insn.h>
 #include <asm/debugreg.h>
 #include <asm/debugreg.h>
+#include <asm/set_memory.h>
 
 
 #include "common.h"
 #include "common.h"
 
 

+ 1 - 1
arch/x86/kernel/machine_kexec_32.c

@@ -23,7 +23,7 @@
 #include <asm/io_apic.h>
 #include <asm/io_apic.h>
 #include <asm/cpufeature.h>
 #include <asm/cpufeature.h>
 #include <asm/desc.h>
 #include <asm/desc.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/debugreg.h>
 #include <asm/debugreg.h>
 
 
 static void set_idt(void *newidt, __u16 limit)
 static void set_idt(void *newidt, __u16 limit)

+ 1 - 0
arch/x86/kernel/machine_kexec_64.c

@@ -27,6 +27,7 @@
 #include <asm/debugreg.h>
 #include <asm/debugreg.h>
 #include <asm/kexec-bzimage64.h>
 #include <asm/kexec-bzimage64.h>
 #include <asm/setup.h>
 #include <asm/setup.h>
+#include <asm/set_memory.h>
 
 
 #ifdef CONFIG_KEXEC_FILE
 #ifdef CONFIG_KEXEC_FILE
 static struct kexec_file_ops *kexec_file_loaders[] = {
 static struct kexec_file_ops *kexec_file_loaders[] = {

+ 1 - 1
arch/x86/kernel/module.c

@@ -85,7 +85,7 @@ void *module_alloc(unsigned long size)
 
 
 	p = __vmalloc_node_range(size, MODULE_ALIGN,
 	p = __vmalloc_node_range(size, MODULE_ALIGN,
 				    MODULES_VADDR + get_module_load_offset(),
 				    MODULES_VADDR + get_module_load_offset(),
-				    MODULES_END, GFP_KERNEL | __GFP_HIGHMEM,
+				    MODULES_END, GFP_KERNEL,
 				    PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE,
 				    PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE,
 				    __builtin_return_address(0));
 				    __builtin_return_address(0));
 	if (p && (kasan_module_alloc(p, size) < 0)) {
 	if (p && (kasan_module_alloc(p, size) < 0)) {

+ 2 - 2
arch/x86/kvm/lapic.c

@@ -177,8 +177,8 @@ static void recalculate_apic_map(struct kvm *kvm)
 		if (kvm_apic_present(vcpu))
 		if (kvm_apic_present(vcpu))
 			max_id = max(max_id, kvm_x2apic_id(vcpu->arch.apic));
 			max_id = max(max_id, kvm_x2apic_id(vcpu->arch.apic));
 
 
-	new = kvm_kvzalloc(sizeof(struct kvm_apic_map) +
-	                   sizeof(struct kvm_lapic *) * ((u64)max_id + 1));
+	new = kvzalloc(sizeof(struct kvm_apic_map) +
+	                   sizeof(struct kvm_lapic *) * ((u64)max_id + 1), GFP_KERNEL);
 
 
 	if (!new)
 	if (!new)
 		goto out;
 		goto out;

+ 2 - 2
arch/x86/kvm/page_track.c

@@ -40,8 +40,8 @@ int kvm_page_track_create_memslot(struct kvm_memory_slot *slot,
 	int  i;
 	int  i;
 
 
 	for (i = 0; i < KVM_PAGE_TRACK_MAX; i++) {
 	for (i = 0; i < KVM_PAGE_TRACK_MAX; i++) {
-		slot->arch.gfn_track[i] = kvm_kvzalloc(npages *
-					    sizeof(*slot->arch.gfn_track[i]));
+		slot->arch.gfn_track[i] = kvzalloc(npages *
+					    sizeof(*slot->arch.gfn_track[i]), GFP_KERNEL);
 		if (!slot->arch.gfn_track[i])
 		if (!slot->arch.gfn_track[i])
 			goto track_free;
 			goto track_free;
 	}
 	}

+ 2 - 2
arch/x86/kvm/x86.c

@@ -8190,13 +8190,13 @@ int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot,
 				      slot->base_gfn, level) + 1;
 				      slot->base_gfn, level) + 1;
 
 
 		slot->arch.rmap[i] =
 		slot->arch.rmap[i] =
-			kvm_kvzalloc(lpages * sizeof(*slot->arch.rmap[i]));
+			kvzalloc(lpages * sizeof(*slot->arch.rmap[i]), GFP_KERNEL);
 		if (!slot->arch.rmap[i])
 		if (!slot->arch.rmap[i])
 			goto out_free;
 			goto out_free;
 		if (i == 0)
 		if (i == 0)
 			continue;
 			continue;
 
 
-		linfo = kvm_kvzalloc(lpages * sizeof(*linfo));
+		linfo = kvzalloc(lpages * sizeof(*linfo), GFP_KERNEL);
 		if (!linfo)
 		if (!linfo)
 			goto out_free;
 			goto out_free;
 
 

+ 1 - 1
arch/x86/mm/init.c

@@ -5,7 +5,7 @@
 #include <linux/memblock.h>
 #include <linux/memblock.h>
 #include <linux/bootmem.h>	/* for max_low_pfn */
 #include <linux/bootmem.h>	/* for max_low_pfn */
 
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/e820/api.h>
 #include <asm/e820/api.h>
 #include <asm/init.h>
 #include <asm/init.h>
 #include <asm/page.h>
 #include <asm/page.h>

+ 1 - 1
arch/x86/mm/init_32.c

@@ -48,7 +48,7 @@
 #include <asm/sections.h>
 #include <asm/sections.h>
 #include <asm/paravirt.h>
 #include <asm/paravirt.h>
 #include <asm/setup.h>
 #include <asm/setup.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/page_types.h>
 #include <asm/page_types.h>
 #include <asm/init.h>
 #include <asm/init.h>
 
 

+ 1 - 1
arch/x86/mm/init_64.c

@@ -50,7 +50,7 @@
 #include <asm/sections.h>
 #include <asm/sections.h>
 #include <asm/kdebug.h>
 #include <asm/kdebug.h>
 #include <asm/numa.h>
 #include <asm/numa.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/init.h>
 #include <asm/init.h>
 #include <asm/uv/uv.h>
 #include <asm/uv/uv.h>
 #include <asm/setup.h>
 #include <asm/setup.h>

+ 1 - 1
arch/x86/mm/ioremap.c

@@ -14,7 +14,7 @@
 #include <linux/vmalloc.h>
 #include <linux/vmalloc.h>
 #include <linux/mmiotrace.h>
 #include <linux/mmiotrace.h>
 
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/e820/api.h>
 #include <asm/e820/api.h>
 #include <asm/fixmap.h>
 #include <asm/fixmap.h>
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>

+ 1 - 0
arch/x86/mm/pageattr.c

@@ -24,6 +24,7 @@
 #include <asm/pgalloc.h>
 #include <asm/pgalloc.h>
 #include <asm/proto.h>
 #include <asm/proto.h>
 #include <asm/pat.h>
 #include <asm/pat.h>
+#include <asm/set_memory.h>
 
 
 /*
 /*
  * The current flushing context - we pass it instead of 5 arguments:
  * The current flushing context - we pass it instead of 5 arguments:

+ 1 - 0
arch/x86/net/bpf_jit_comp.c

@@ -12,6 +12,7 @@
 #include <linux/filter.h>
 #include <linux/filter.h>
 #include <linux/if_vlan.h>
 #include <linux/if_vlan.h>
 #include <asm/cacheflush.h>
 #include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <linux/bpf.h>
 #include <linux/bpf.h>
 
 
 int bpf_jit_enable __read_mostly;
 int bpf_jit_enable __read_mostly;

+ 1 - 1
arch/x86/pci/pcbios.c

@@ -11,7 +11,7 @@
 #include <asm/pci_x86.h>
 #include <asm/pci_x86.h>
 #include <asm/e820/types.h>
 #include <asm/e820/types.h>
 #include <asm/pci-functions.h>
 #include <asm/pci-functions.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 
 
 /* BIOS32 signature: "_32_" */
 /* BIOS32 signature: "_32_" */
 #define BIOS32_SIGNATURE	(('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24))
 #define BIOS32_SIGNATURE	(('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24))

+ 1 - 1
arch/x86/platform/efi/efi.c

@@ -49,7 +49,7 @@
 #include <asm/efi.h>
 #include <asm/efi.h>
 #include <asm/e820/api.h>
 #include <asm/e820/api.h>
 #include <asm/time.h>
 #include <asm/time.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/tlbflush.h>
 #include <asm/tlbflush.h>
 #include <asm/x86_init.h>
 #include <asm/x86_init.h>
 #include <asm/uv/uv.h>
 #include <asm/uv/uv.h>

+ 1 - 1
arch/x86/realmode/init.c

@@ -2,7 +2,7 @@
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/memblock.h>
 #include <linux/memblock.h>
 
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
 #include <asm/realmode.h>
 #include <asm/realmode.h>
 #include <asm/tlbflush.h>
 #include <asm/tlbflush.h>

+ 1 - 1
certs/blacklist.c

@@ -140,7 +140,7 @@ int is_hash_blacklisted(const u8 *hash, size_t hash_len, const char *type)
 EXPORT_SYMBOL_GPL(is_hash_blacklisted);
 EXPORT_SYMBOL_GPL(is_hash_blacklisted);
 
 
 /*
 /*
- * Intialise the blacklist
+ * Initialise the blacklist
  */
  */
 static int __init blacklist_init(void)
 static int __init blacklist_init(void)
 {
 {

+ 1 - 3
crypto/lzo.c

@@ -32,9 +32,7 @@ static void *lzo_alloc_ctx(struct crypto_scomp *tfm)
 {
 {
 	void *ctx;
 	void *ctx;
 
 
-	ctx = kmalloc(LZO1X_MEM_COMPRESS, GFP_KERNEL | __GFP_NOWARN);
-	if (!ctx)
-		ctx = vmalloc(LZO1X_MEM_COMPRESS);
+	ctx = kvmalloc(LZO1X_MEM_COMPRESS, GFP_KERNEL);
 	if (!ctx)
 	if (!ctx)
 		return ERR_PTR(-ENOMEM);
 		return ERR_PTR(-ENOMEM);
 
 

+ 2 - 6
drivers/acpi/apei/erst.c

@@ -513,7 +513,7 @@ retry:
 	if (i < erst_record_id_cache.len)
 	if (i < erst_record_id_cache.len)
 		goto retry;
 		goto retry;
 	if (erst_record_id_cache.len >= erst_record_id_cache.size) {
 	if (erst_record_id_cache.len >= erst_record_id_cache.size) {
-		int new_size, alloc_size;
+		int new_size;
 		u64 *new_entries;
 		u64 *new_entries;
 
 
 		new_size = erst_record_id_cache.size * 2;
 		new_size = erst_record_id_cache.size * 2;
@@ -524,11 +524,7 @@ retry:
 				pr_warn(FW_WARN "too many record IDs!\n");
 				pr_warn(FW_WARN "too many record IDs!\n");
 			return 0;
 			return 0;
 		}
 		}
-		alloc_size = new_size * sizeof(entries[0]);
-		if (alloc_size < PAGE_SIZE)
-			new_entries = kmalloc(alloc_size, GFP_KERNEL);
-		else
-			new_entries = vmalloc(alloc_size);
+		new_entries = kvmalloc(new_size * sizeof(entries[0]), GFP_KERNEL);
 		if (!new_entries)
 		if (!new_entries)
 			return -ENOMEM;
 			return -ENOMEM;
 		memcpy(new_entries, entries,
 		memcpy(new_entries, entries,

+ 1 - 1
drivers/acpi/cppc_acpi.c

@@ -95,7 +95,7 @@ static DEFINE_PER_CPU(struct cpc_desc *, cpc_desc_ptr);
 /* pcc mapped address + header size + offset within PCC subspace */
 /* pcc mapped address + header size + offset within PCC subspace */
 #define GET_PCC_VADDR(offs) (pcc_data.pcc_comm_addr + 0x8 + (offs))
 #define GET_PCC_VADDR(offs) (pcc_data.pcc_comm_addr + 0x8 + (offs))
 
 
-/* Check if a CPC regsiter is in PCC */
+/* Check if a CPC register is in PCC */
 #define CPC_IN_PCC(cpc) ((cpc)->type == ACPI_TYPE_BUFFER &&		\
 #define CPC_IN_PCC(cpc) ((cpc)->type == ACPI_TYPE_BUFFER &&		\
 				(cpc)->cpc_entry.reg.space_id ==	\
 				(cpc)->cpc_entry.reg.space_id ==	\
 				ACPI_ADR_SPACE_PLATFORM_COMM)
 				ACPI_ADR_SPACE_PLATFORM_COMM)

+ 1 - 1
drivers/block/drbd/drbd_bitmap.c

@@ -409,7 +409,7 @@ static struct page **bm_realloc_pages(struct drbd_bitmap *b, unsigned long want)
 	new_pages = kzalloc(bytes, GFP_NOIO | __GFP_NOWARN);
 	new_pages = kzalloc(bytes, GFP_NOIO | __GFP_NOWARN);
 	if (!new_pages) {
 	if (!new_pages) {
 		new_pages = __vmalloc(bytes,
 		new_pages = __vmalloc(bytes,
-				GFP_NOIO | __GFP_HIGHMEM | __GFP_ZERO,
+				GFP_NOIO | __GFP_ZERO,
 				PAGE_KERNEL);
 				PAGE_KERNEL);
 		if (!new_pages)
 		if (!new_pages)
 			return NULL;
 			return NULL;

+ 4 - 3
drivers/block/nbd.c

@@ -18,6 +18,7 @@
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/sched.h>
+#include <linux/sched/mm.h>
 #include <linux/fs.h>
 #include <linux/fs.h>
 #include <linux/bio.h>
 #include <linux/bio.h>
 #include <linux/stat.h>
 #include <linux/stat.h>
@@ -347,7 +348,7 @@ static int sock_xmit(struct nbd_device *nbd, int index, int send,
 	struct socket *sock = config->socks[index]->sock;
 	struct socket *sock = config->socks[index]->sock;
 	int result;
 	int result;
 	struct msghdr msg;
 	struct msghdr msg;
-	unsigned long pflags = current->flags;
+	unsigned int noreclaim_flag;
 
 
 	if (unlikely(!sock)) {
 	if (unlikely(!sock)) {
 		dev_err_ratelimited(disk_to_dev(nbd->disk),
 		dev_err_ratelimited(disk_to_dev(nbd->disk),
@@ -358,7 +359,7 @@ static int sock_xmit(struct nbd_device *nbd, int index, int send,
 
 
 	msg.msg_iter = *iter;
 	msg.msg_iter = *iter;
 
 
-	current->flags |= PF_MEMALLOC;
+	noreclaim_flag = memalloc_noreclaim_save();
 	do {
 	do {
 		sock->sk->sk_allocation = GFP_NOIO | __GFP_MEMALLOC;
 		sock->sk->sk_allocation = GFP_NOIO | __GFP_MEMALLOC;
 		msg.msg_name = NULL;
 		msg.msg_name = NULL;
@@ -381,7 +382,7 @@ static int sock_xmit(struct nbd_device *nbd, int index, int send,
 			*sent += result;
 			*sent += result;
 	} while (msg_data_left(&msg));
 	} while (msg_data_left(&msg));
 
 
-	current_restore_flags(pflags, PF_MEMALLOC);
+	memalloc_noreclaim_restore(noreclaim_flag);
 
 
 	return result;
 	return result;
 }
 }

+ 1 - 1
drivers/block/rbd.c

@@ -1922,7 +1922,7 @@ static void rbd_osd_req_format_write(struct rbd_obj_request *obj_request)
 {
 {
 	struct ceph_osd_request *osd_req = obj_request->osd_req;
 	struct ceph_osd_request *osd_req = obj_request->osd_req;
 
 
-	osd_req->r_mtime = CURRENT_TIME;
+	ktime_get_real_ts(&osd_req->r_mtime);
 	osd_req->r_data_offset = obj_request->offset;
 	osd_req->r_data_offset = obj_request->offset;
 }
 }
 
 

+ 1 - 0
drivers/char/agp/amd-k7-agp.c

@@ -9,6 +9,7 @@
 #include <linux/page-flags.h>
 #include <linux/page-flags.h>
 #include <linux/mm.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
+#include <asm/set_memory.h>
 #include "agp.h"
 #include "agp.h"
 
 
 #define AMD_MMBASE_BAR	1
 #define AMD_MMBASE_BAR	1

+ 1 - 0
drivers/char/agp/ati-agp.c

@@ -10,6 +10,7 @@
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/agp_backend.h>
 #include <linux/agp_backend.h>
 #include <asm/agp.h>
 #include <asm/agp.h>
+#include <asm/set_memory.h>
 #include "agp.h"
 #include "agp.h"
 
 
 #define ATI_GART_MMBASE_BAR	1
 #define ATI_GART_MMBASE_BAR	1

+ 4 - 8
drivers/char/agp/generic.c

@@ -39,7 +39,9 @@
 #include <linux/sched.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <asm/io.h>
 #include <asm/io.h>
-#include <asm/cacheflush.h>
+#ifdef CONFIG_X86
+#include <asm/set_memory.h>
+#endif
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
 #include "agp.h"
 #include "agp.h"
 
 
@@ -88,13 +90,7 @@ static int agp_get_key(void)
 
 
 void agp_alloc_page_array(size_t size, struct agp_memory *mem)
 void agp_alloc_page_array(size_t size, struct agp_memory *mem)
 {
 {
-	mem->pages = NULL;
-
-	if (size <= 2*PAGE_SIZE)
-		mem->pages = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
-	if (mem->pages == NULL) {
-		mem->pages = vmalloc(size);
-	}
+	mem->pages = kvmalloc(size, GFP_KERNEL);
 }
 }
 EXPORT_SYMBOL(agp_alloc_page_array);
 EXPORT_SYMBOL(agp_alloc_page_array);
 
 

+ 1 - 0
drivers/char/agp/intel-gtt.c

@@ -25,6 +25,7 @@
 #include "agp.h"
 #include "agp.h"
 #include "intel-agp.h"
 #include "intel-agp.h"
 #include <drm/intel-gtt.h>
 #include <drm/intel-gtt.h>
+#include <asm/set_memory.h>
 
 
 /*
 /*
  * If we have Intel graphics, we're not going to have anything other than
  * If we have Intel graphics, we're not going to have anything other than

+ 1 - 0
drivers/char/agp/sworks-agp.c

@@ -9,6 +9,7 @@
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/jiffies.h>
 #include <linux/jiffies.h>
 #include <linux/agp_backend.h>
 #include <linux/agp_backend.h>
+#include <asm/set_memory.h>
 #include "agp.h"
 #include "agp.h"
 
 
 #define SVWRKS_COMMAND		0x04
 #define SVWRKS_COMMAND		0x04

+ 1 - 1
drivers/char/dsp56k.c

@@ -489,7 +489,7 @@ static const struct file_operations dsp56k_fops = {
 
 
 /****** Init and module functions ******/
 /****** Init and module functions ******/
 
 
-static char banner[] __initdata = KERN_INFO "DSP56k driver installed\n";
+static const char banner[] __initconst = KERN_INFO "DSP56k driver installed\n";
 
 
 static int __init dsp56k_init_driver(void)
 static int __init dsp56k_init_driver(void)
 {
 {

+ 1 - 1
drivers/clk/qcom/common.c

@@ -128,7 +128,7 @@ static void qcom_cc_gdsc_unregister(void *data)
 
 
 /*
 /*
  * Backwards compatibility with old DTs. Register a pass-through factor 1/1
  * Backwards compatibility with old DTs. Register a pass-through factor 1/1
- * clock to translate 'path' clk into 'name' clk and regsiter the 'path'
+ * clock to translate 'path' clk into 'name' clk and register the 'path'
  * clk as a fixed rate clock if it isn't present.
  * clk as a fixed rate clock if it isn't present.
  */
  */
 static int _qcom_cc_register_board_clk(struct device *dev, const char *path,
 static int _qcom_cc_register_board_clk(struct device *dev, const char *path,

+ 2 - 1
drivers/cpufreq/powernow-k8.c

@@ -1171,7 +1171,8 @@ static struct cpufreq_driver cpufreq_amd64_driver = {
 
 
 static void __request_acpi_cpufreq(void)
 static void __request_acpi_cpufreq(void)
 {
 {
-	const char *cur_drv, *drv = "acpi-cpufreq";
+	const char drv[] = "acpi-cpufreq";
+	const char *cur_drv;
 
 
 	cur_drv = cpufreq_get_current_driver();
 	cur_drv = cpufreq_get_current_driver();
 	if (!cur_drv)
 	if (!cur_drv)

+ 2 - 2
drivers/cpufreq/sti-cpufreq.c

@@ -236,7 +236,7 @@ use_defaults:
 	return 0;
 	return 0;
 }
 }
 
 
-static int sti_cpufreq_fetch_syscon_regsiters(void)
+static int sti_cpufreq_fetch_syscon_registers(void)
 {
 {
 	struct device *dev = ddata.cpu;
 	struct device *dev = ddata.cpu;
 	struct device_node *np = dev->of_node;
 	struct device_node *np = dev->of_node;
@@ -275,7 +275,7 @@ static int sti_cpufreq_init(void)
 		goto skip_voltage_scaling;
 		goto skip_voltage_scaling;
 	}
 	}
 
 
-	ret = sti_cpufreq_fetch_syscon_regsiters();
+	ret = sti_cpufreq_fetch_syscon_registers();
 	if (ret)
 	if (ret)
 		goto skip_voltage_scaling;
 		goto skip_voltage_scaling;
 
 

+ 3 - 0
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c

@@ -27,6 +27,9 @@
  */
  */
 #include <drm/drmP.h>
 #include <drm/drmP.h>
 #include <drm/amdgpu_drm.h>
 #include <drm/amdgpu_drm.h>
+#ifdef CONFIG_X86
+#include <asm/set_memory.h>
+#endif
 #include "amdgpu.h"
 #include "amdgpu.h"
 
 
 /*
 /*

+ 1 - 1
drivers/gpu/drm/drm_fb_helper.c

@@ -2446,7 +2446,7 @@ EXPORT_SYMBOL(drm_fb_helper_hotplug_event);
 int __init drm_fb_helper_modinit(void)
 int __init drm_fb_helper_modinit(void)
 {
 {
 #if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT)
 #if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT)
-	const char *name = "fbcon";
+	const char name[] = "fbcon";
 	struct module *fbcon;
 	struct module *fbcon;
 
 
 	mutex_lock(&module_mutex);
 	mutex_lock(&module_mutex);

+ 2 - 2
drivers/gpu/drm/etnaviv/etnaviv_dump.c

@@ -161,8 +161,8 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
 	file_size += sizeof(*iter.hdr) * n_obj;
 	file_size += sizeof(*iter.hdr) * n_obj;
 
 
 	/* Allocate the file in vmalloc memory, it's likely to be big */
 	/* Allocate the file in vmalloc memory, it's likely to be big */
-	iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_HIGHMEM |
-			       __GFP_NOWARN | __GFP_NORETRY, PAGE_KERNEL);
+	iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY,
+			       PAGE_KERNEL);
 	if (!iter.start) {
 	if (!iter.start) {
 		dev_warn(gpu->dev, "failed to allocate devcoredump file\n");
 		dev_warn(gpu->dev, "failed to allocate devcoredump file\n");
 		return;
 		return;

+ 1 - 0
drivers/gpu/drm/gma500/gtt.c

@@ -21,6 +21,7 @@
 
 
 #include <drm/drmP.h>
 #include <drm/drmP.h>
 #include <linux/shmem_fs.h>
 #include <linux/shmem_fs.h>
+#include <asm/set_memory.h>
 #include "psb_drv.h"
 #include "psb_drv.h"
 #include "blitter.h"
 #include "blitter.h"
 
 

+ 1 - 0
drivers/gpu/drm/gma500/psb_drv.c

@@ -35,6 +35,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/pm_runtime.h>
 #include <acpi/video.h>
 #include <acpi/video.h>
 #include <linux/module.h>
 #include <linux/module.h>
+#include <asm/set_memory.h>
 
 
 static struct drm_driver driver;
 static struct drm_driver driver;
 static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
 static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent);

+ 2 - 0
drivers/gpu/drm/i915/i915_gem_gtt.c

@@ -31,6 +31,8 @@
 #include <linux/seq_file.h>
 #include <linux/seq_file.h>
 #include <linux/stop_machine.h>
 #include <linux/stop_machine.h>
 
 
+#include <asm/set_memory.h>
+
 #include <drm/drmP.h>
 #include <drm/drmP.h>
 #include <drm/i915_drm.h>
 #include <drm/i915_drm.h>
 
 

+ 1 - 3
drivers/gpu/drm/nouveau/nouveau_gem.c

@@ -568,9 +568,7 @@ u_memcpya(uint64_t user, unsigned nmemb, unsigned size)
 
 
 	size *= nmemb;
 	size *= nmemb;
 
 
-	mem = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
-	if (!mem)
-		mem = vmalloc(size);
+	mem = kvmalloc(size, GFP_KERNEL);
 	if (!mem)
 	if (!mem)
 		return ERR_PTR(-ENOMEM);
 		return ERR_PTR(-ENOMEM);
 
 

+ 3 - 0
drivers/gpu/drm/radeon/radeon_gart.c

@@ -27,6 +27,9 @@
  */
  */
 #include <drm/drmP.h>
 #include <drm/drmP.h>
 #include <drm/radeon_drm.h>
 #include <drm/radeon_drm.h>
+#ifdef CONFIG_X86
+#include <asm/set_memory.h>
+#endif
 #include "radeon.h"
 #include "radeon.h"
 
 
 /*
 /*

+ 3 - 0
drivers/gpu/drm/ttm/ttm_page_alloc.c

@@ -51,6 +51,9 @@
 #if IS_ENABLED(CONFIG_AGP)
 #if IS_ENABLED(CONFIG_AGP)
 #include <asm/agp.h>
 #include <asm/agp.h>
 #endif
 #endif
+#ifdef CONFIG_X86
+#include <asm/set_memory.h>
+#endif
 
 
 #define NUM_PAGES_TO_ALLOC		(PAGE_SIZE/sizeof(struct page *))
 #define NUM_PAGES_TO_ALLOC		(PAGE_SIZE/sizeof(struct page *))
 #define SMALL_ALLOCATION		16
 #define SMALL_ALLOCATION		16

+ 3 - 0
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c

@@ -53,6 +53,9 @@
 #if IS_ENABLED(CONFIG_AGP)
 #if IS_ENABLED(CONFIG_AGP)
 #include <asm/agp.h>
 #include <asm/agp.h>
 #endif
 #endif
+#ifdef CONFIG_X86
+#include <asm/set_memory.h>
+#endif
 
 
 #define NUM_PAGES_TO_ALLOC		(PAGE_SIZE/sizeof(struct page *))
 #define NUM_PAGES_TO_ALLOC		(PAGE_SIZE/sizeof(struct page *))
 #define SMALL_ALLOCATION		4
 #define SMALL_ALLOCATION		4

+ 3 - 0
drivers/gpu/drm/ttm/ttm_tt.c

@@ -44,6 +44,9 @@
 #include <drm/ttm/ttm_bo_driver.h>
 #include <drm/ttm/ttm_bo_driver.h>
 #include <drm/ttm/ttm_placement.h>
 #include <drm/ttm/ttm_placement.h>
 #include <drm/ttm/ttm_page_alloc.h>
 #include <drm/ttm/ttm_page_alloc.h>
+#ifdef CONFIG_X86
+#include <asm/set_memory.h>
+#endif
 
 
 /**
 /**
  * Allocates storage for pointers to the pages that back the ttm.
  * Allocates storage for pointers to the pages that back the ttm.

+ 3 - 1
drivers/hwtracing/intel_th/msu.c

@@ -27,7 +27,9 @@
 #include <linux/io.h>
 #include <linux/io.h>
 #include <linux/dma-mapping.h>
 #include <linux/dma-mapping.h>
 
 
-#include <asm/cacheflush.h>
+#ifdef CONFIG_X86
+#include <asm/set_memory.h>
+#endif
 
 
 #include "intel_th.h"
 #include "intel_th.h"
 #include "msu.h"
 #include "msu.h"

+ 1 - 1
drivers/infiniband/hw/hns/hns_roce_hw_v1.c

@@ -1721,7 +1721,7 @@ int hns_roce_v1_write_mtpt(void *mb_buf, struct hns_roce_mr *mr,
 	roce_set_field(mpt_entry->mpt_byte_64, MPT_BYTE_64_L_KEY_IDX_H_M,
 	roce_set_field(mpt_entry->mpt_byte_64, MPT_BYTE_64_L_KEY_IDX_H_M,
 		       MPT_BYTE_64_L_KEY_IDX_H_S, mtpt_idx >> MTPT_IDX_SHIFT);
 		       MPT_BYTE_64_L_KEY_IDX_H_S, mtpt_idx >> MTPT_IDX_SHIFT);
 
 
-	/* DMA momery regsiter */
+	/* DMA memory register */
 	if (mr->type == MR_TYPE_DMA)
 	if (mr->type == MR_TYPE_DMA)
 		return 0;
 		return 0;
 
 

+ 1 - 1
drivers/infiniband/hw/hns/hns_roce_mr.c

@@ -205,7 +205,7 @@ int hns_roce_mtt_init(struct hns_roce_dev *hr_dev, int npages, int page_shift,
 		return 0;
 		return 0;
 	}
 	}
 
 
-	/* Note: if page_shift is zero, FAST memory regsiter */
+	/* Note: if page_shift is zero, FAST memory register */
 	mtt->page_shift = page_shift;
 	mtt->page_shift = page_shift;
 
 
 	/* Compute MTT entry necessary */
 	/* Compute MTT entry necessary */

+ 1 - 1
drivers/leds/leds-lp5521.c

@@ -281,7 +281,7 @@ static void lp5521_firmware_loaded(struct lp55xx_chip *chip)
 	}
 	}
 
 
 	/*
 	/*
-	 * Program momery sequence
+	 * Program memory sequence
 	 *  1) set engine mode to "LOAD"
 	 *  1) set engine mode to "LOAD"
 	 *  2) write firmware data into program memory
 	 *  2) write firmware data into program memory
 	 */
 	 */

Some files were not shown because too many files changed in this diff