Browse Source

Merge branches 'x86/apic', 'x86/asm', 'x86/mm' and 'x86/platform' into x86/core, to merge last updates

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Ingo Molnar 10 years ago
parent
commit
7ef3d7d58d
100 changed files with 603 additions and 213 deletions
  1. 1 1
      Documentation/ABI/testing/sysfs-devices-system-cpu
  2. 3 1
      Documentation/devicetree/bindings/clock/silabs,si5351.txt
  3. 3 3
      Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt
  4. 2 1
      Documentation/devicetree/bindings/net/cdns-emac.txt
  5. 1 1
      Documentation/hwmon/tmp401
  6. 3 3
      Documentation/memory-barriers.txt
  7. 7 26
      Documentation/target/tcmu-design.txt
  8. 14 4
      Documentation/virtual/kvm/mmu.txt
  9. 2 2
      Documentation/x86/entry_64.txt
  10. 15 3
      Documentation/x86/mtrr.txt
  11. 43 5
      Documentation/x86/pat.txt
  12. 3 0
      Documentation/x86/x86_64/boot-options.txt
  13. 11 10
      MAINTAINERS
  14. 1 1
      Makefile
  15. 10 6
      arch/alpha/boot/Makefile
  16. 0 1
      arch/alpha/boot/main.c
  17. 306 0
      arch/alpha/boot/stdio.c
  18. 3 0
      arch/alpha/boot/tools/objstrip.c
  19. 0 2
      arch/alpha/include/asm/cmpxchg.h
  20. 0 1
      arch/alpha/include/asm/types.h
  21. 1 1
      arch/alpha/include/asm/unistd.h
  22. 3 0
      arch/alpha/include/uapi/asm/unistd.h
  23. 0 1
      arch/alpha/kernel/err_ev6.c
  24. 0 1
      arch/alpha/kernel/irq.c
  25. 1 2
      arch/alpha/kernel/osf_sys.c
  26. 3 4
      arch/alpha/kernel/process.c
  27. 1 7
      arch/alpha/kernel/smp.c
  28. 1 2
      arch/alpha/kernel/srmcons.c
  29. 1 1
      arch/alpha/kernel/sys_marvel.c
  30. 3 0
      arch/alpha/kernel/systbls.S
  31. 0 1
      arch/alpha/kernel/traps.c
  32. 0 1
      arch/alpha/oprofile/op_model_ev4.c
  33. 0 1
      arch/alpha/oprofile/op_model_ev5.c
  34. 0 1
      arch/alpha/oprofile/op_model_ev6.c
  35. 0 1
      arch/alpha/oprofile/op_model_ev67.c
  36. 1 0
      arch/arc/include/asm/io.h
  37. 1 1
      arch/arm/boot/dts/Makefile
  38. 0 4
      arch/arm/boot/dts/am335x-boneblack.dts
  39. 1 1
      arch/arm/boot/dts/am335x-evmsk.dts
  40. 1 1
      arch/arm/boot/dts/exynos4412-trats2.dts
  41. 1 1
      arch/arm/boot/dts/imx27.dtsi
  42. 2 0
      arch/arm/boot/dts/omap3-devkit8000.dts
  43. 2 2
      arch/arm/boot/dts/zynq-7000.dtsi
  44. 1 1
      arch/arm/configs/multi_v7_defconfig
  45. 1 1
      arch/arm/include/asm/barrier.h
  46. 1 0
      arch/arm/include/asm/io.h
  47. 3 1
      arch/arm/kernel/entry-common.S
  48. 5 4
      arch/arm/kernel/perf_event_cpu.c
  49. 13 3
      arch/arm/mach-imx/gpc.c
  50. 1 1
      arch/arm/mach-pxa/pxa_cplds_irqs.c
  51. 10 10
      arch/arm/mm/mmu.c
  52. 1 0
      arch/arm/xen/enlighten.c
  53. 1 1
      arch/arm64/include/asm/barrier.h
  54. 1 0
      arch/arm64/include/asm/io.h
  55. 0 2
      arch/avr32/include/asm/cmpxchg.h
  56. 1 0
      arch/avr32/include/asm/io.h
  57. 3 1
      arch/frv/include/asm/io.h
  58. 0 1
      arch/hexagon/include/asm/cmpxchg.h
  59. 1 6
      arch/ia64/include/asm/barrier.h
  60. 0 2
      arch/ia64/include/uapi/asm/cmpxchg.h
  61. 10 3
      arch/ia64/pci/pci.c
  62. 0 2
      arch/m32r/include/asm/cmpxchg.h
  63. 1 0
      arch/m32r/include/asm/io.h
  64. 0 1
      arch/m68k/include/asm/cmpxchg.h
  65. 3 1
      arch/m68k/include/asm/io_mm.h
  66. 3 1
      arch/m68k/include/asm/io_no.h
  67. 1 1
      arch/metag/include/asm/barrier.h
  68. 0 2
      arch/metag/include/asm/cmpxchg.h
  69. 3 0
      arch/metag/include/asm/io.h
  70. 1 1
      arch/microblaze/include/asm/io.h
  71. 3 0
      arch/mips/ath79/prom.c
  72. 1 1
      arch/mips/configs/fuloong2e_defconfig
  73. 2 2
      arch/mips/include/asm/barrier.h
  74. 0 2
      arch/mips/include/asm/cmpxchg.h
  75. 1 1
      arch/mips/kernel/irq.c
  76. 1 1
      arch/mips/kernel/smp-bmips.c
  77. 13 2
      arch/mips/lib/strnlen_user.S
  78. 1 0
      arch/mn10300/include/asm/io.h
  79. 1 0
      arch/nios2/include/asm/io.h
  80. 0 2
      arch/parisc/include/asm/cmpxchg.h
  81. 1 1
      arch/powerpc/include/asm/barrier.h
  82. 0 1
      arch/powerpc/include/asm/cmpxchg.h
  83. 2 2
      arch/powerpc/kernel/mce.c
  84. 1 0
      arch/powerpc/kernel/vmlinux.lds.S
  85. 3 2
      arch/powerpc/kvm/book3s_hv.c
  86. 16 9
      arch/powerpc/mm/hugetlbpage.c
  87. 11 0
      arch/powerpc/mm/pgtable_64.c
  88. 13 12
      arch/s390/crypto/ghash_s390.c
  89. 1 1
      arch/s390/crypto/prng.c
  90. 1 1
      arch/s390/include/asm/barrier.h
  91. 0 2
      arch/s390/include/asm/cmpxchg.h
  92. 1 0
      arch/s390/include/asm/io.h
  93. 1 1
      arch/s390/include/asm/pgtable.h
  94. 10 9
      arch/s390/net/bpf_jit_comp.c
  95. 0 2
      arch/score/include/asm/cmpxchg.h
  96. 1 1
      arch/sh/include/asm/barrier.h
  97. 0 2
      arch/sh/include/asm/cmpxchg.h
  98. 2 2
      arch/sparc/include/asm/barrier_64.h
  99. 0 1
      arch/sparc/include/asm/cmpxchg_32.h
  100. 0 2
      arch/sparc/include/asm/cmpxchg_64.h

+ 1 - 1
Documentation/ABI/testing/sysfs-devices-system-cpu

@@ -162,7 +162,7 @@ Description:	Discover CPUs in the same CPU frequency coordination domain
 What:		/sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}
 What:		/sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}
 Date:		August 2008
 Date:		August 2008
 KernelVersion:	2.6.27
 KernelVersion:	2.6.27
-Contact:	discuss@x86-64.org
+Contact:	Linux kernel mailing list <linux-kernel@vger.kernel.org>
 Description:	Disable L3 cache indices
 Description:	Disable L3 cache indices
 
 
 		These files exist in every CPU's cache/index3 directory. Each
 		These files exist in every CPU's cache/index3 directory. Each

+ 3 - 1
Documentation/devicetree/bindings/clock/silabs,si5351.txt

@@ -17,7 +17,8 @@ Required properties:
 - #clock-cells: from common clock binding; shall be set to 1.
 - #clock-cells: from common clock binding; shall be set to 1.
 - clocks: from common clock binding; list of parent clock
 - clocks: from common clock binding; list of parent clock
   handles, shall be xtal reference clock or xtal and clkin for
   handles, shall be xtal reference clock or xtal and clkin for
-  si5351c only.
+  si5351c only. Corresponding clock input names are "xtal" and
+  "clkin" respectively.
 - #address-cells: shall be set to 1.
 - #address-cells: shall be set to 1.
 - #size-cells: shall be set to 0.
 - #size-cells: shall be set to 0.
 
 
@@ -71,6 +72,7 @@ i2c-master-node {
 
 
 		/* connect xtal input to 25MHz reference */
 		/* connect xtal input to 25MHz reference */
 		clocks = <&ref25>;
 		clocks = <&ref25>;
+		clock-names = "xtal";
 
 
 		/* connect xtal input as source of pll0 and pll1 */
 		/* connect xtal input as source of pll0 and pll1 */
 		silabs,pll-source = <0 0>, <1 0>;
 		silabs,pll-source = <0 0>, <1 0>;

+ 3 - 3
Documentation/devicetree/bindings/mtd/m25p80.txt → Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt

@@ -8,8 +8,8 @@ Required properties:
                is not Linux-only, but in case of Linux, see the "m25p_ids"
                is not Linux-only, but in case of Linux, see the "m25p_ids"
                table in drivers/mtd/devices/m25p80.c for the list of supported
                table in drivers/mtd/devices/m25p80.c for the list of supported
                chips.
                chips.
-               Must also include "nor-jedec" for any SPI NOR flash that can be
-               identified by the JEDEC READ ID opcode (0x9F).
+               Must also include "jedec,spi-nor" for any SPI NOR flash that can
+               be identified by the JEDEC READ ID opcode (0x9F).
 - reg : Chip-Select number
 - reg : Chip-Select number
 - spi-max-frequency : Maximum frequency of the SPI bus the chip can operate at
 - spi-max-frequency : Maximum frequency of the SPI bus the chip can operate at
 
 
@@ -25,7 +25,7 @@ Example:
 	flash: m25p80@0 {
 	flash: m25p80@0 {
 		#address-cells = <1>;
 		#address-cells = <1>;
 		#size-cells = <1>;
 		#size-cells = <1>;
-		compatible = "spansion,m25p80", "nor-jedec";
+		compatible = "spansion,m25p80", "jedec,spi-nor";
 		reg = <0>;
 		reg = <0>;
 		spi-max-frequency = <40000000>;
 		spi-max-frequency = <40000000>;
 		m25p,fast-read;
 		m25p,fast-read;

+ 2 - 1
Documentation/devicetree/bindings/net/cdns-emac.txt

@@ -3,7 +3,8 @@
 Required properties:
 Required properties:
 - compatible: Should be "cdns,[<chip>-]{emac}"
 - compatible: Should be "cdns,[<chip>-]{emac}"
   Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC.
   Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC.
-  or the generic form: "cdns,emac".
+  Use "cdns,zynq-gem" Xilinx Zynq-7xxx SoC.
+  Or the generic form: "cdns,emac".
 - reg: Address and length of the register set for the device
 - reg: Address and length of the register set for the device
 - interrupts: Should contain macb interrupt
 - interrupts: Should contain macb interrupt
 - phy-mode: see ethernet.txt file in the same directory.
 - phy-mode: see ethernet.txt file in the same directory.

+ 1 - 1
Documentation/hwmon/tmp401

@@ -20,7 +20,7 @@ Supported chips:
     Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp432.html
     Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp432.html
   * Texas Instruments TMP435
   * Texas Instruments TMP435
     Prefix: 'tmp435'
     Prefix: 'tmp435'
-    Addresses scanned: I2C 0x37, 0x48 - 0x4f
+    Addresses scanned: I2C 0x48 - 0x4f
     Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp435.html
     Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp435.html
 
 
 Authors:
 Authors:

+ 3 - 3
Documentation/memory-barriers.txt

@@ -1662,7 +1662,7 @@ CPU from reordering them.
 
 
 There are some more advanced barrier functions:
 There are some more advanced barrier functions:
 
 
- (*) set_mb(var, value)
+ (*) smp_store_mb(var, value)
 
 
      This assigns the value to the variable and then inserts a full memory
      This assigns the value to the variable and then inserts a full memory
      barrier after it, depending on the function.  It isn't guaranteed to
      barrier after it, depending on the function.  It isn't guaranteed to
@@ -1975,7 +1975,7 @@ after it has altered the task state:
 	CPU 1
 	CPU 1
 	===============================
 	===============================
 	set_current_state();
 	set_current_state();
-	  set_mb();
+	  smp_store_mb();
 	    STORE current->state
 	    STORE current->state
 	    <general barrier>
 	    <general barrier>
 	LOAD event_indicated
 	LOAD event_indicated
@@ -2016,7 +2016,7 @@ between the STORE to indicate the event and the STORE to set TASK_RUNNING:
 	CPU 1				CPU 2
 	CPU 1				CPU 2
 	===============================	===============================
 	===============================	===============================
 	set_current_state();		STORE event_indicated
 	set_current_state();		STORE event_indicated
-	  set_mb();			wake_up();
+	  smp_store_mb();		wake_up();
 	    STORE current->state	  <write barrier>
 	    STORE current->state	  <write barrier>
 	    <general barrier>		  STORE current->state
 	    <general barrier>		  STORE current->state
 	LOAD event_indicated
 	LOAD event_indicated

+ 7 - 26
Documentation/target/tcmu-design.txt

@@ -15,8 +15,7 @@ Contents:
   a) Discovering and configuring TCMU uio devices
   a) Discovering and configuring TCMU uio devices
   b) Waiting for events on the device(s)
   b) Waiting for events on the device(s)
   c) Managing the command ring
   c) Managing the command ring
-3) Command filtering and pass_level
-4) A final note
+3) A final note
 
 
 
 
 TCM Userspace Design
 TCM Userspace Design
@@ -324,7 +323,7 @@ int handle_device_events(int fd, void *map)
   /* Process events from cmd ring until we catch up with cmd_head */
   /* Process events from cmd ring until we catch up with cmd_head */
   while (ent != (void *)mb + mb->cmdr_off + mb->cmd_head) {
   while (ent != (void *)mb + mb->cmdr_off + mb->cmd_head) {
 
 
-    if (tcmu_hdr_get_op(&ent->hdr) == TCMU_OP_CMD) {
+    if (tcmu_hdr_get_op(ent->hdr.len_op) == TCMU_OP_CMD) {
       uint8_t *cdb = (void *)mb + ent->req.cdb_off;
       uint8_t *cdb = (void *)mb + ent->req.cdb_off;
       bool success = true;
       bool success = true;
 
 
@@ -339,8 +338,12 @@ int handle_device_events(int fd, void *map)
         ent->rsp.scsi_status = SCSI_CHECK_CONDITION;
         ent->rsp.scsi_status = SCSI_CHECK_CONDITION;
       }
       }
     }
     }
+    else if (tcmu_hdr_get_op(ent->hdr.len_op) != TCMU_OP_PAD) {
+      /* Tell the kernel we didn't handle unknown opcodes */
+      ent->hdr.uflags |= TCMU_UFLAG_UNKNOWN_OP;
+    }
     else {
     else {
-      /* Do nothing for PAD entries */
+      /* Do nothing for PAD entries except update cmd_tail */
     }
     }
 
 
     /* update cmd_tail */
     /* update cmd_tail */
@@ -360,28 +363,6 @@ int handle_device_events(int fd, void *map)
 }
 }
 
 
 
 
-Command filtering and pass_level
---------------------------------
-
-TCMU supports a "pass_level" option with valid values of 0 or 1.  When
-the value is 0 (the default), nearly all SCSI commands received for
-the device are passed through to the handler. This allows maximum
-flexibility but increases the amount of code required by the handler,
-to support all mandatory SCSI commands. If pass_level is set to 1,
-then only IO-related commands are presented, and the rest are handled
-by LIO's in-kernel command emulation. The commands presented at level
-1 include all versions of:
-
-READ
-WRITE
-WRITE_VERIFY
-XDWRITEREAD
-WRITE_SAME
-COMPARE_AND_WRITE
-SYNCHRONIZE_CACHE
-UNMAP
-
-
 A final note
 A final note
 ------------
 ------------
 
 

+ 14 - 4
Documentation/virtual/kvm/mmu.txt

@@ -169,6 +169,10 @@ Shadow pages contain the following information:
     Contains the value of cr4.smep && !cr0.wp for which the page is valid
     Contains the value of cr4.smep && !cr0.wp for which the page is valid
     (pages for which this is true are different from other pages; see the
     (pages for which this is true are different from other pages; see the
     treatment of cr0.wp=0 below).
     treatment of cr0.wp=0 below).
+  role.smap_andnot_wp:
+    Contains the value of cr4.smap && !cr0.wp for which the page is valid
+    (pages for which this is true are different from other pages; see the
+    treatment of cr0.wp=0 below).
   gfn:
   gfn:
     Either the guest page table containing the translations shadowed by this
     Either the guest page table containing the translations shadowed by this
     page, or the base page frame for linear translations.  See role.direct.
     page, or the base page frame for linear translations.  See role.direct.
@@ -344,10 +348,16 @@ on fault type:
 
 
 (user write faults generate a #PF)
 (user write faults generate a #PF)
 
 
-In the first case there is an additional complication if CR4.SMEP is
-enabled: since we've turned the page into a kernel page, the kernel may now
-execute it.  We handle this by also setting spte.nx.  If we get a user
-fetch or read fault, we'll change spte.u=1 and spte.nx=gpte.nx back.
+In the first case there are two additional complications:
+- if CR4.SMEP is enabled: since we've turned the page into a kernel page,
+  the kernel may now execute it.  We handle this by also setting spte.nx.
+  If we get a user fetch or read fault, we'll change spte.u=1 and
+  spte.nx=gpte.nx back.
+- if CR4.SMAP is disabled: since the page has been changed to a kernel
+  page, it can not be reused when CR4.SMAP is enabled. We set
+  CR4.SMAP && !CR0.WP into shadow page's role to avoid this case. Note,
+  here we do not care the case that CR4.SMAP is enabled since KVM will
+  directly inject #PF to guest due to failed permission check.
 
 
 To prevent an spte that was converted into a kernel page with cr0.wp=0
 To prevent an spte that was converted into a kernel page with cr0.wp=0
 from being written by the kernel after cr0.wp has changed to 1, we make
 from being written by the kernel after cr0.wp has changed to 1, we make

+ 2 - 2
Documentation/x86/entry_64.txt

@@ -18,10 +18,10 @@ Some of these entries are:
 
 
  - system_call: syscall instruction from 64-bit code.
  - system_call: syscall instruction from 64-bit code.
 
 
- - ia32_syscall: int 0x80 from 32-bit or 64-bit code; compat syscall
+ - entry_INT80_compat: int 0x80 from 32-bit or 64-bit code; compat syscall
    either way.
    either way.
 
 
- - ia32_syscall, ia32_sysenter: syscall and sysenter from 32-bit
+ - entry_INT80_compat, ia32_sysenter: syscall and sysenter from 32-bit
    code
    code
 
 
  - interrupt: An array of entries.  Every IDT vector that doesn't
  - interrupt: An array of entries.  Every IDT vector that doesn't

+ 15 - 3
Documentation/x86/mtrr.txt

@@ -1,7 +1,19 @@
 MTRR (Memory Type Range Register) control
 MTRR (Memory Type Range Register) control
-3 Jun 1999
-Richard Gooch
-<rgooch@atnf.csiro.au>
+
+Richard Gooch <rgooch@atnf.csiro.au> - 3 Jun 1999
+Luis R. Rodriguez <mcgrof@do-not-panic.com> - April 9, 2015
+
+===============================================================================
+Phasing out MTRR use
+
+MTRR use is replaced on modern x86 hardware with PAT. Over time the only type
+of effective MTRR that is expected to be supported will be for write-combining.
+As MTRR use is phased out device drivers should use arch_phys_wc_add() to make
+MTRR effective on non-PAT systems while a no-op on PAT enabled systems.
+
+For details refer to Documentation/x86/pat.txt.
+
+===============================================================================
 
 
   On Intel P6 family processors (Pentium Pro, Pentium II and later)
   On Intel P6 family processors (Pentium Pro, Pentium II and later)
   the Memory Type Range Registers (MTRRs) may be used to control
   the Memory Type Range Registers (MTRRs) may be used to control

+ 43 - 5
Documentation/x86/pat.txt

@@ -12,7 +12,7 @@ virtual addresses.
 
 
 PAT allows for different types of memory attributes. The most commonly used
 PAT allows for different types of memory attributes. The most commonly used
 ones that will be supported at this time are Write-back, Uncached,
 ones that will be supported at this time are Write-back, Uncached,
-Write-combined and Uncached Minus.
+Write-combined, Write-through and Uncached Minus.
 
 
 
 
 PAT APIs
 PAT APIs
@@ -34,16 +34,23 @@ ioremap                |    --    |    UC-     |       UC-        |
                        |          |            |                  |
                        |          |            |                  |
 ioremap_cache          |    --    |    WB      |       WB         |
 ioremap_cache          |    --    |    WB      |       WB         |
                        |          |            |                  |
                        |          |            |                  |
+ioremap_uc             |    --    |    UC      |       UC         |
+                       |          |            |                  |
 ioremap_nocache        |    --    |    UC-     |       UC-        |
 ioremap_nocache        |    --    |    UC-     |       UC-        |
                        |          |            |                  |
                        |          |            |                  |
 ioremap_wc             |    --    |    --      |       WC         |
 ioremap_wc             |    --    |    --      |       WC         |
                        |          |            |                  |
                        |          |            |                  |
+ioremap_wt             |    --    |    --      |       WT         |
+                       |          |            |                  |
 set_memory_uc          |    UC-   |    --      |       --         |
 set_memory_uc          |    UC-   |    --      |       --         |
  set_memory_wb         |          |            |                  |
  set_memory_wb         |          |            |                  |
                        |          |            |                  |
                        |          |            |                  |
 set_memory_wc          |    WC    |    --      |       --         |
 set_memory_wc          |    WC    |    --      |       --         |
  set_memory_wb         |          |            |                  |
  set_memory_wb         |          |            |                  |
                        |          |            |                  |
                        |          |            |                  |
+set_memory_wt          |    WT    |    --      |       --         |
+ set_memory_wb         |          |            |                  |
+                       |          |            |                  |
 pci sysfs resource     |    --    |    --      |       UC-        |
 pci sysfs resource     |    --    |    --      |       UC-        |
                        |          |            |                  |
                        |          |            |                  |
 pci sysfs resource_wc  |    --    |    --      |       WC         |
 pci sysfs resource_wc  |    --    |    --      |       WC         |
@@ -102,7 +109,38 @@ wants to export a RAM region, it has to do set_memory_uc() or set_memory_wc()
 as step 0 above and also track the usage of those pages and use set_memory_wb()
 as step 0 above and also track the usage of those pages and use set_memory_wb()
 before the page is freed to free pool.
 before the page is freed to free pool.
 
 
-
+MTRR effects on PAT / non-PAT systems
+-------------------------------------
+
+The following table provides the effects of using write-combining MTRRs when
+using ioremap*() calls on x86 for both non-PAT and PAT systems. Ideally
+mtrr_add() usage will be phased out in favor of arch_phys_wc_add() which will
+be a no-op on PAT enabled systems. The region over which a arch_phys_wc_add()
+is made, should already have been ioremapped with WC attributes or PAT entries,
+this can be done by using ioremap_wc() / set_memory_wc().  Devices which
+combine areas of IO memory desired to remain uncacheable with areas where
+write-combining is desirable should consider use of ioremap_uc() followed by
+set_memory_wc() to white-list effective write-combined areas.  Such use is
+nevertheless discouraged as the effective memory type is considered
+implementation defined, yet this strategy can be used as last resort on devices
+with size-constrained regions where otherwise MTRR write-combining would
+otherwise not be effective.
+
+----------------------------------------------------------------------
+MTRR Non-PAT   PAT    Linux ioremap value        Effective memory type
+----------------------------------------------------------------------
+                                                  Non-PAT |  PAT
+     PAT
+     |PCD
+     ||PWT
+     |||
+WC   000      WB      _PAGE_CACHE_MODE_WB            WC   |   WC
+WC   001      WC      _PAGE_CACHE_MODE_WC            WC*  |   WC
+WC   010      UC-     _PAGE_CACHE_MODE_UC_MINUS      WC*  |   UC
+WC   011      UC      _PAGE_CACHE_MODE_UC            UC   |   UC
+----------------------------------------------------------------------
+
+(*) denotes implementation defined and is discouraged
 
 
 Notes:
 Notes:
 
 
@@ -115,8 +153,8 @@ can be more restrictive, in case of any existing aliasing for that address.
 For example: If there is an existing uncached mapping, a new ioremap_wc can
 For example: If there is an existing uncached mapping, a new ioremap_wc can
 return uncached mapping in place of write-combine requested.
 return uncached mapping in place of write-combine requested.
 
 
-set_memory_[uc|wc] and set_memory_wb should be used in pairs, where driver will
-first make a region uc or wc and switch it back to wb after use.
+set_memory_[uc|wc|wt] and set_memory_wb should be used in pairs, where driver
+will first make a region uc, wc or wt and switch it back to wb after use.
 
 
 Over time writes to /proc/mtrr will be deprecated in favor of using PAT based
 Over time writes to /proc/mtrr will be deprecated in favor of using PAT based
 interfaces. Users writing to /proc/mtrr are suggested to use above interfaces.
 interfaces. Users writing to /proc/mtrr are suggested to use above interfaces.
@@ -124,7 +162,7 @@ interfaces. Users writing to /proc/mtrr are suggested to use above interfaces.
 Drivers should use ioremap_[uc|wc] to access PCI BARs with [uc|wc] access
 Drivers should use ioremap_[uc|wc] to access PCI BARs with [uc|wc] access
 types.
 types.
 
 
-Drivers should use set_memory_[uc|wc] to set access type for RAM ranges.
+Drivers should use set_memory_[uc|wc|wt] to set access type for RAM ranges.
 
 
 
 
 PAT debugging
 PAT debugging

+ 3 - 0
Documentation/x86/x86_64/boot-options.txt

@@ -31,6 +31,9 @@ Machine check
 		(e.g. BIOS or hardware monitoring applications), conflicting
 		(e.g. BIOS or hardware monitoring applications), conflicting
 		with OS's error handling, and you cannot deactivate the agent,
 		with OS's error handling, and you cannot deactivate the agent,
 		then this option will be a help.
 		then this option will be a help.
+   mce=no_lmce
+		Do not opt-in to Local MCE delivery. Use legacy method
+		to broadcast MCEs.
    mce=bootlog
    mce=bootlog
 		Enable logging of machine checks left over from booting.
 		Enable logging of machine checks left over from booting.
 		Disabled by default on AMD because some BIOS leave bogus ones.
 		Disabled by default on AMD because some BIOS leave bogus ones.

+ 11 - 10
MAINTAINERS

@@ -2427,7 +2427,6 @@ L:	linux-security-module@vger.kernel.org
 S:	Supported
 S:	Supported
 F:	include/linux/capability.h
 F:	include/linux/capability.h
 F:	include/uapi/linux/capability.h
 F:	include/uapi/linux/capability.h
-F:	security/capability.c
 F:	security/commoncap.c
 F:	security/commoncap.c
 F:	kernel/capability.c
 F:	kernel/capability.c
 
 
@@ -3825,10 +3824,11 @@ M:	David Woodhouse <dwmw2@infradead.org>
 L:	linux-embedded@vger.kernel.org
 L:	linux-embedded@vger.kernel.org
 S:	Maintained
 S:	Maintained
 
 
-EMULEX LPFC FC SCSI DRIVER
-M:	James Smart <james.smart@emulex.com>
+EMULEX/AVAGO LPFC FC/FCOE SCSI DRIVER
+M:	James Smart <james.smart@avagotech.com>
+M:	Dick Kennedy <dick.kennedy@avagotech.com>
 L:	linux-scsi@vger.kernel.org
 L:	linux-scsi@vger.kernel.org
-W:	http://sourceforge.net/projects/lpfcxxxx
+W:	http://www.avagotech.com
 S:	Supported
 S:	Supported
 F:	drivers/scsi/lpfc/
 F:	drivers/scsi/lpfc/
 
 
@@ -4536,7 +4536,7 @@ M:	Jean Delvare <jdelvare@suse.de>
 M:	Guenter Roeck <linux@roeck-us.net>
 M:	Guenter Roeck <linux@roeck-us.net>
 L:	lm-sensors@lm-sensors.org
 L:	lm-sensors@lm-sensors.org
 W:	http://www.lm-sensors.org/
 W:	http://www.lm-sensors.org/
-T:	quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/
+T:	quilt http://jdelvare.nerim.net/devel/linux/jdelvare-hwmon/
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
 S:	Maintained
 S:	Maintained
 F:	Documentation/hwmon/
 F:	Documentation/hwmon/
@@ -8829,9 +8829,11 @@ F:	drivers/misc/phantom.c
 F:	include/uapi/linux/phantom.h
 F:	include/uapi/linux/phantom.h
 
 
 SERVER ENGINES 10Gbps iSCSI - BladeEngine 2 DRIVER
 SERVER ENGINES 10Gbps iSCSI - BladeEngine 2 DRIVER
-M:	Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
+M:	Jayamohan Kallickal <jayamohan.kallickal@avagotech.com>
+M:	Minh Tran <minh.tran@avagotech.com>
+M:	John Soni Jose <sony.john-n@avagotech.com>
 L:	linux-scsi@vger.kernel.org
 L:	linux-scsi@vger.kernel.org
-W:	http://www.emulex.com
+W:	http://www.avagotech.com
 S:	Supported
 S:	Supported
 F:	drivers/scsi/be2iscsi/
 F:	drivers/scsi/be2iscsi/
 
 
@@ -10585,8 +10587,7 @@ F:	drivers/virtio/virtio_input.c
 F:	include/uapi/linux/virtio_input.h
 F:	include/uapi/linux/virtio_input.h
 
 
 VIA RHINE NETWORK DRIVER
 VIA RHINE NETWORK DRIVER
-M:	Roger Luethi <rl@hellgate.ch>
-S:	Maintained
+S:	Orphan
 F:	drivers/net/ethernet/via/via-rhine.c
 F:	drivers/net/ethernet/via/via-rhine.c
 
 
 VIA SD/MMC CARD CONTROLLER DRIVER
 VIA SD/MMC CARD CONTROLLER DRIVER
@@ -10892,7 +10893,7 @@ M:	Andy Lutomirski <luto@amacapital.net>
 L:	linux-kernel@vger.kernel.org
 L:	linux-kernel@vger.kernel.org
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/vdso
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/vdso
 S:	Maintained
 S:	Maintained
-F:	arch/x86/vdso/
+F:	arch/x86/entry/vdso/
 
 
 XC2028/3028 TUNER DRIVER
 XC2028/3028 TUNER DRIVER
 M:	Mauro Carvalho Chehab <mchehab@osg.samsung.com>
 M:	Mauro Carvalho Chehab <mchehab@osg.samsung.com>

+ 1 - 1
Makefile

@@ -1,7 +1,7 @@
 VERSION = 4
 VERSION = 4
 PATCHLEVEL = 1
 PATCHLEVEL = 1
 SUBLEVEL = 0
 SUBLEVEL = 0
-EXTRAVERSION = -rc3
+EXTRAVERSION = -rc6
 NAME = Hurr durr I'ma sheep
 NAME = Hurr durr I'ma sheep
 
 
 # *DOCUMENTATION*
 # *DOCUMENTATION*

+ 10 - 6
arch/alpha/boot/Makefile

@@ -14,6 +14,9 @@ targets		:= vmlinux.gz vmlinux \
 		   tools/bootpzh bootloader bootpheader bootpzheader 
 		   tools/bootpzh bootloader bootpheader bootpzheader 
 OBJSTRIP	:= $(obj)/tools/objstrip
 OBJSTRIP	:= $(obj)/tools/objstrip
 
 
+HOSTCFLAGS	:= -Wall -I$(objtree)/usr/include
+BOOTCFLAGS	+= -I$(obj) -I$(srctree)/$(obj)
+
 # SRM bootable image.  Copy to offset 512 of a partition.
 # SRM bootable image.  Copy to offset 512 of a partition.
 $(obj)/bootimage: $(addprefix $(obj)/tools/,mkbb lxboot bootlx) $(obj)/vmlinux.nh
 $(obj)/bootimage: $(addprefix $(obj)/tools/,mkbb lxboot bootlx) $(obj)/vmlinux.nh
 	( cat $(obj)/tools/lxboot $(obj)/tools/bootlx $(obj)/vmlinux.nh ) > $@ 
 	( cat $(obj)/tools/lxboot $(obj)/tools/bootlx $(obj)/vmlinux.nh ) > $@ 
@@ -96,13 +99,14 @@ $(obj)/tools/bootph: $(obj)/bootpheader $(OBJSTRIP) FORCE
 $(obj)/tools/bootpzh: $(obj)/bootpzheader $(OBJSTRIP) FORCE
 $(obj)/tools/bootpzh: $(obj)/bootpzheader $(OBJSTRIP) FORCE
 	$(call if_changed,objstrip)
 	$(call if_changed,objstrip)
 
 
-LDFLAGS_bootloader   := -static -uvsprintf -T  #-N -relax
-LDFLAGS_bootpheader  := -static -uvsprintf -T  #-N -relax
-LDFLAGS_bootpzheader := -static -uvsprintf -T  #-N -relax
+LDFLAGS_bootloader   := -static -T # -N -relax
+LDFLAGS_bootloader   := -static -T # -N -relax
+LDFLAGS_bootpheader  := -static -T # -N -relax
+LDFLAGS_bootpzheader := -static -T # -N -relax
 
 
-OBJ_bootlx   := $(obj)/head.o $(obj)/main.o
-OBJ_bootph   := $(obj)/head.o $(obj)/bootp.o
-OBJ_bootpzh  := $(obj)/head.o $(obj)/bootpz.o $(obj)/misc.o
+OBJ_bootlx   := $(obj)/head.o $(obj)/stdio.o $(obj)/main.o
+OBJ_bootph   := $(obj)/head.o $(obj)/stdio.o $(obj)/bootp.o
+OBJ_bootpzh  := $(obj)/head.o $(obj)/stdio.o $(obj)/bootpz.o $(obj)/misc.o
 
 
 $(obj)/bootloader: $(obj)/bootloader.lds $(OBJ_bootlx) $(LIBS_Y) FORCE
 $(obj)/bootloader: $(obj)/bootloader.lds $(OBJ_bootlx) $(LIBS_Y) FORCE
 	$(call if_changed,ld)
 	$(call if_changed,ld)

+ 0 - 1
arch/alpha/boot/main.c

@@ -19,7 +19,6 @@
 
 
 #include "ksize.h"
 #include "ksize.h"
 
 
-extern int vsprintf(char *, const char *, va_list);
 extern unsigned long switch_to_osf_pal(unsigned long nr,
 extern unsigned long switch_to_osf_pal(unsigned long nr,
 	struct pcb_struct * pcb_va, struct pcb_struct * pcb_pa,
 	struct pcb_struct * pcb_va, struct pcb_struct * pcb_pa,
 	unsigned long *vptb);
 	unsigned long *vptb);

+ 306 - 0
arch/alpha/boot/stdio.c

@@ -0,0 +1,306 @@
+/*
+ * Copyright (C) Paul Mackerras 1997.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include <stdarg.h>
+#include <stddef.h>
+
+size_t strnlen(const char * s, size_t count)
+{
+	const char *sc;
+
+	for (sc = s; count-- && *sc != '\0'; ++sc)
+		/* nothing */;
+	return sc - s;
+}
+
+# define do_div(n, base) ({						\
+	unsigned int __base = (base);					\
+	unsigned int __rem;						\
+	__rem = ((unsigned long long)(n)) % __base;			\
+	(n) = ((unsigned long long)(n)) / __base;			\
+	__rem;								\
+})
+
+
+static int skip_atoi(const char **s)
+{
+	int i, c;
+
+	for (i = 0; '0' <= (c = **s) && c <= '9'; ++*s)
+		i = i*10 + c - '0';
+	return i;
+}
+
+#define ZEROPAD	1		/* pad with zero */
+#define SIGN	2		/* unsigned/signed long */
+#define PLUS	4		/* show plus */
+#define SPACE	8		/* space if plus */
+#define LEFT	16		/* left justified */
+#define SPECIAL	32		/* 0x */
+#define LARGE	64		/* use 'ABCDEF' instead of 'abcdef' */
+
+static char * number(char * str, unsigned long long num, int base, int size, int precision, int type)
+{
+	char c,sign,tmp[66];
+	const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
+	int i;
+
+	if (type & LARGE)
+		digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+	if (type & LEFT)
+		type &= ~ZEROPAD;
+	if (base < 2 || base > 36)
+		return 0;
+	c = (type & ZEROPAD) ? '0' : ' ';
+	sign = 0;
+	if (type & SIGN) {
+		if ((signed long long)num < 0) {
+			sign = '-';
+			num = - (signed long long)num;
+			size--;
+		} else if (type & PLUS) {
+			sign = '+';
+			size--;
+		} else if (type & SPACE) {
+			sign = ' ';
+			size--;
+		}
+	}
+	if (type & SPECIAL) {
+		if (base == 16)
+			size -= 2;
+		else if (base == 8)
+			size--;
+	}
+	i = 0;
+	if (num == 0)
+		tmp[i++]='0';
+	else while (num != 0) {
+		tmp[i++] = digits[do_div(num, base)];
+	}
+	if (i > precision)
+		precision = i;
+	size -= precision;
+	if (!(type&(ZEROPAD+LEFT)))
+		while(size-->0)
+			*str++ = ' ';
+	if (sign)
+		*str++ = sign;
+	if (type & SPECIAL) {
+		if (base==8)
+			*str++ = '0';
+		else if (base==16) {
+			*str++ = '0';
+			*str++ = digits[33];
+		}
+	}
+	if (!(type & LEFT))
+		while (size-- > 0)
+			*str++ = c;
+	while (i < precision--)
+		*str++ = '0';
+	while (i-- > 0)
+		*str++ = tmp[i];
+	while (size-- > 0)
+		*str++ = ' ';
+	return str;
+}
+
+int vsprintf(char *buf, const char *fmt, va_list args)
+{
+	int len;
+	unsigned long long num;
+	int i, base;
+	char * str;
+	const char *s;
+
+	int flags;		/* flags to number() */
+
+	int field_width;	/* width of output field */
+	int precision;		/* min. # of digits for integers; max
+				   number of chars for from string */
+	int qualifier;		/* 'h', 'l', or 'L' for integer fields */
+	                        /* 'z' support added 23/7/1999 S.H.    */
+				/* 'z' changed to 'Z' --davidm 1/25/99 */
+
+
+	for (str=buf ; *fmt ; ++fmt) {
+		if (*fmt != '%') {
+			*str++ = *fmt;
+			continue;
+		}
+
+		/* process flags */
+		flags = 0;
+		repeat:
+			++fmt;		/* this also skips first '%' */
+			switch (*fmt) {
+				case '-': flags |= LEFT; goto repeat;
+				case '+': flags |= PLUS; goto repeat;
+				case ' ': flags |= SPACE; goto repeat;
+				case '#': flags |= SPECIAL; goto repeat;
+				case '0': flags |= ZEROPAD; goto repeat;
+				}
+
+		/* get field width */
+		field_width = -1;
+		if ('0' <= *fmt && *fmt <= '9')
+			field_width = skip_atoi(&fmt);
+		else if (*fmt == '*') {
+			++fmt;
+			/* it's the next argument */
+			field_width = va_arg(args, int);
+			if (field_width < 0) {
+				field_width = -field_width;
+				flags |= LEFT;
+			}
+		}
+
+		/* get the precision */
+		precision = -1;
+		if (*fmt == '.') {
+			++fmt;
+			if ('0' <= *fmt && *fmt <= '9')
+				precision = skip_atoi(&fmt);
+			else if (*fmt == '*') {
+				++fmt;
+				/* it's the next argument */
+				precision = va_arg(args, int);
+			}
+			if (precision < 0)
+				precision = 0;
+		}
+
+		/* get the conversion qualifier */
+		qualifier = -1;
+		if (*fmt == 'l' && *(fmt + 1) == 'l') {
+			qualifier = 'q';
+			fmt += 2;
+		} else if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L'
+			|| *fmt == 'Z') {
+			qualifier = *fmt;
+			++fmt;
+		}
+
+		/* default base */
+		base = 10;
+
+		switch (*fmt) {
+		case 'c':
+			if (!(flags & LEFT))
+				while (--field_width > 0)
+					*str++ = ' ';
+			*str++ = (unsigned char) va_arg(args, int);
+			while (--field_width > 0)
+				*str++ = ' ';
+			continue;
+
+		case 's':
+			s = va_arg(args, char *);
+			if (!s)
+				s = "<NULL>";
+
+			len = strnlen(s, precision);
+
+			if (!(flags & LEFT))
+				while (len < field_width--)
+					*str++ = ' ';
+			for (i = 0; i < len; ++i)
+				*str++ = *s++;
+			while (len < field_width--)
+				*str++ = ' ';
+			continue;
+
+		case 'p':
+			if (field_width == -1) {
+				field_width = 2*sizeof(void *);
+				flags |= ZEROPAD;
+			}
+			str = number(str,
+				(unsigned long) va_arg(args, void *), 16,
+				field_width, precision, flags);
+			continue;
+
+
+		case 'n':
+			if (qualifier == 'l') {
+				long * ip = va_arg(args, long *);
+				*ip = (str - buf);
+			} else if (qualifier == 'Z') {
+				size_t * ip = va_arg(args, size_t *);
+				*ip = (str - buf);
+			} else {
+				int * ip = va_arg(args, int *);
+				*ip = (str - buf);
+			}
+			continue;
+
+		case '%':
+			*str++ = '%';
+			continue;
+
+		/* integer number formats - set up the flags and "break" */
+		case 'o':
+			base = 8;
+			break;
+
+		case 'X':
+			flags |= LARGE;
+		case 'x':
+			base = 16;
+			break;
+
+		case 'd':
+		case 'i':
+			flags |= SIGN;
+		case 'u':
+			break;
+
+		default:
+			*str++ = '%';
+			if (*fmt)
+				*str++ = *fmt;
+			else
+				--fmt;
+			continue;
+		}
+		if (qualifier == 'l') {
+			num = va_arg(args, unsigned long);
+			if (flags & SIGN)
+				num = (signed long) num;
+		} else if (qualifier == 'q') {
+			num = va_arg(args, unsigned long long);
+			if (flags & SIGN)
+				num = (signed long long) num;
+		} else if (qualifier == 'Z') {
+			num = va_arg(args, size_t);
+		} else if (qualifier == 'h') {
+			num = (unsigned short) va_arg(args, int);
+			if (flags & SIGN)
+				num = (signed short) num;
+		} else {
+			num = va_arg(args, unsigned int);
+			if (flags & SIGN)
+				num = (signed int) num;
+		}
+		str = number(str, num, base, field_width, precision, flags);
+	}
+	*str = '\0';
+	return str-buf;
+}
+
+int sprintf(char * buf, const char *fmt, ...)
+{
+	va_list args;
+	int i;
+
+	va_start(args, fmt);
+	i=vsprintf(buf,fmt,args);
+	va_end(args);
+	return i;
+}

+ 3 - 0
arch/alpha/boot/tools/objstrip.c

@@ -27,6 +27,9 @@
 #include <linux/param.h>
 #include <linux/param.h>
 #ifdef __ELF__
 #ifdef __ELF__
 # include <linux/elf.h>
 # include <linux/elf.h>
+# define elfhdr elf64_hdr
+# define elf_phdr elf64_phdr
+# define elf_check_arch(x) ((x)->e_machine == EM_ALPHA)
 #endif
 #endif
 
 
 /* bootfile size must be multiple of BLOCK_SIZE: */
 /* bootfile size must be multiple of BLOCK_SIZE: */

+ 0 - 2
arch/alpha/include/asm/cmpxchg.h

@@ -66,6 +66,4 @@
 #undef __ASM__MB
 #undef __ASM__MB
 #undef ____cmpxchg
 #undef ____cmpxchg
 
 
-#define __HAVE_ARCH_CMPXCHG 1
-
 #endif /* _ALPHA_CMPXCHG_H */
 #endif /* _ALPHA_CMPXCHG_H */

+ 0 - 1
arch/alpha/include/asm/types.h

@@ -2,6 +2,5 @@
 #define _ALPHA_TYPES_H
 #define _ALPHA_TYPES_H
 
 
 #include <asm-generic/int-ll64.h>
 #include <asm-generic/int-ll64.h>
-#include <uapi/asm/types.h>
 
 
 #endif /* _ALPHA_TYPES_H */
 #endif /* _ALPHA_TYPES_H */

+ 1 - 1
arch/alpha/include/asm/unistd.h

@@ -3,7 +3,7 @@
 
 
 #include <uapi/asm/unistd.h>
 #include <uapi/asm/unistd.h>
 
 
-#define NR_SYSCALLS			511
+#define NR_SYSCALLS			514
 
 
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_STAT64

+ 3 - 0
arch/alpha/include/uapi/asm/unistd.h

@@ -472,5 +472,8 @@
 #define __NR_sched_setattr		508
 #define __NR_sched_setattr		508
 #define __NR_sched_getattr		509
 #define __NR_sched_getattr		509
 #define __NR_renameat2			510
 #define __NR_renameat2			510
+#define __NR_getrandom			511
+#define __NR_memfd_create		512
+#define __NR_execveat			513
 
 
 #endif /* _UAPI_ALPHA_UNISTD_H */
 #endif /* _UAPI_ALPHA_UNISTD_H */

+ 0 - 1
arch/alpha/kernel/err_ev6.c

@@ -6,7 +6,6 @@
  *	Error handling code supporting Alpha systems
  *	Error handling code supporting Alpha systems
  */
  */
 
 
-#include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/sched.h>
 
 
 #include <asm/io.h>
 #include <asm/io.h>

+ 0 - 1
arch/alpha/kernel/irq.c

@@ -19,7 +19,6 @@
 #include <linux/ptrace.h>
 #include <linux/ptrace.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/random.h>
 #include <linux/random.h>
-#include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/irq.h>
 #include <linux/proc_fs.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/seq_file.h>

+ 1 - 2
arch/alpha/kernel/osf_sys.c

@@ -1019,14 +1019,13 @@ SYSCALL_DEFINE2(osf_settimeofday, struct timeval32 __user *, tv,
  	if (tv) {
  	if (tv) {
 		if (get_tv32((struct timeval *)&kts, tv))
 		if (get_tv32((struct timeval *)&kts, tv))
 			return -EFAULT;
 			return -EFAULT;
+		kts.tv_nsec *= 1000;
 	}
 	}
 	if (tz) {
 	if (tz) {
 		if (copy_from_user(&ktz, tz, sizeof(*tz)))
 		if (copy_from_user(&ktz, tz, sizeof(*tz)))
 			return -EFAULT;
 			return -EFAULT;
 	}
 	}
 
 
-	kts.tv_nsec *= 1000;
-
 	return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
 	return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
 }
 }
 
 

+ 3 - 4
arch/alpha/kernel/process.c

@@ -236,12 +236,11 @@ release_thread(struct task_struct *dead_task)
 }
 }
 
 
 /*
 /*
- * Copy an alpha thread..
+ * Copy architecture-specific thread state
  */
  */
-
 int
 int
 copy_thread(unsigned long clone_flags, unsigned long usp,
 copy_thread(unsigned long clone_flags, unsigned long usp,
-	    unsigned long arg,
+	    unsigned long kthread_arg,
 	    struct task_struct *p)
 	    struct task_struct *p)
 {
 {
 	extern void ret_from_fork(void);
 	extern void ret_from_fork(void);
@@ -262,7 +261,7 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
 			sizeof(struct switch_stack) + sizeof(struct pt_regs));
 			sizeof(struct switch_stack) + sizeof(struct pt_regs));
 		childstack->r26 = (unsigned long) ret_from_kernel_thread;
 		childstack->r26 = (unsigned long) ret_from_kernel_thread;
 		childstack->r9 = usp;	/* function */
 		childstack->r9 = usp;	/* function */
-		childstack->r10 = arg;
+		childstack->r10 = kthread_arg;
 		childregs->hae = alpha_mv.hae_cache,
 		childregs->hae = alpha_mv.hae_cache,
 		childti->pcb.usp = 0;
 		childti->pcb.usp = 0;
 		return 0;
 		return 0;

+ 1 - 7
arch/alpha/kernel/smp.c

@@ -63,7 +63,6 @@ static struct {
 enum ipi_message_type {
 enum ipi_message_type {
 	IPI_RESCHEDULE,
 	IPI_RESCHEDULE,
 	IPI_CALL_FUNC,
 	IPI_CALL_FUNC,
-	IPI_CALL_FUNC_SINGLE,
 	IPI_CPU_STOP,
 	IPI_CPU_STOP,
 };
 };
 
 
@@ -506,7 +505,6 @@ setup_profiling_timer(unsigned int multiplier)
 	return -EINVAL;
 	return -EINVAL;
 }
 }
 
 
-
 static void
 static void
 send_ipi_message(const struct cpumask *to_whom, enum ipi_message_type operation)
 send_ipi_message(const struct cpumask *to_whom, enum ipi_message_type operation)
 {
 {
@@ -552,10 +550,6 @@ handle_ipi(struct pt_regs *regs)
 			generic_smp_call_function_interrupt();
 			generic_smp_call_function_interrupt();
 			break;
 			break;
 
 
-		case IPI_CALL_FUNC_SINGLE:
-			generic_smp_call_function_single_interrupt();
-			break;
-
 		case IPI_CPU_STOP:
 		case IPI_CPU_STOP:
 			halt();
 			halt();
 
 
@@ -606,7 +600,7 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask)
 
 
 void arch_send_call_function_single_ipi(int cpu)
 void arch_send_call_function_single_ipi(int cpu)
 {
 {
-	send_ipi_message(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE);
+	send_ipi_message(cpumask_of(cpu), IPI_CALL_FUNC);
 }
 }
 
 
 static void
 static void

+ 1 - 2
arch/alpha/kernel/srmcons.c

@@ -237,8 +237,7 @@ srmcons_init(void)
 
 
 	return -ENODEV;
 	return -ENODEV;
 }
 }
-
-module_init(srmcons_init);
+device_initcall(srmcons_init);
 
 
 
 
 /*
 /*

+ 1 - 1
arch/alpha/kernel/sys_marvel.c

@@ -331,7 +331,7 @@ marvel_map_irq(const struct pci_dev *cdev, u8 slot, u8 pin)
 	pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &intline);
 	pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &intline);
 	irq = intline;
 	irq = intline;
 
 
-	msi_loc = pci_find_capability(dev, PCI_CAP_ID_MSI);
+	msi_loc = dev->msi_cap;
 	msg_ctl = 0;
 	msg_ctl = 0;
 	if (msi_loc) 
 	if (msi_loc) 
 		pci_read_config_word(dev, msi_loc + PCI_MSI_FLAGS, &msg_ctl);
 		pci_read_config_word(dev, msi_loc + PCI_MSI_FLAGS, &msg_ctl);

+ 3 - 0
arch/alpha/kernel/systbls.S

@@ -529,6 +529,9 @@ sys_call_table:
 	.quad sys_sched_setattr
 	.quad sys_sched_setattr
 	.quad sys_sched_getattr
 	.quad sys_sched_getattr
 	.quad sys_renameat2			/* 510 */
 	.quad sys_renameat2			/* 510 */
+	.quad sys_getrandom
+	.quad sys_memfd_create
+	.quad sys_execveat
 
 
 	.size sys_call_table, . - sys_call_table
 	.size sys_call_table, . - sys_call_table
 	.type sys_call_table, @object
 	.type sys_call_table, @object

+ 0 - 1
arch/alpha/kernel/traps.c

@@ -14,7 +14,6 @@
 #include <linux/tty.h>
 #include <linux/tty.h>
 #include <linux/delay.h>
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/module.h>
-#include <linux/init.h>
 #include <linux/kallsyms.h>
 #include <linux/kallsyms.h>
 #include <linux/ratelimit.h>
 #include <linux/ratelimit.h>
 
 

+ 0 - 1
arch/alpha/oprofile/op_model_ev4.c

@@ -8,7 +8,6 @@
  */
  */
 
 
 #include <linux/oprofile.h>
 #include <linux/oprofile.h>
-#include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/smp.h>
 #include <asm/ptrace.h>
 #include <asm/ptrace.h>
 
 

+ 0 - 1
arch/alpha/oprofile/op_model_ev5.c

@@ -8,7 +8,6 @@
  */
  */
 
 
 #include <linux/oprofile.h>
 #include <linux/oprofile.h>
-#include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/smp.h>
 #include <asm/ptrace.h>
 #include <asm/ptrace.h>
 
 

+ 0 - 1
arch/alpha/oprofile/op_model_ev6.c

@@ -8,7 +8,6 @@
  */
  */
 
 
 #include <linux/oprofile.h>
 #include <linux/oprofile.h>
-#include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/smp.h>
 #include <asm/ptrace.h>
 #include <asm/ptrace.h>
 
 

+ 0 - 1
arch/alpha/oprofile/op_model_ev67.c

@@ -9,7 +9,6 @@
  */
  */
 
 
 #include <linux/oprofile.h>
 #include <linux/oprofile.h>
-#include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/smp.h>
 #include <asm/ptrace.h>
 #include <asm/ptrace.h>
 
 

+ 1 - 0
arch/arc/include/asm/io.h

@@ -20,6 +20,7 @@ extern void iounmap(const void __iomem *addr);
 
 
 #define ioremap_nocache(phy, sz)	ioremap(phy, sz)
 #define ioremap_nocache(phy, sz)	ioremap(phy, sz)
 #define ioremap_wc(phy, sz)		ioremap(phy, sz)
 #define ioremap_wc(phy, sz)		ioremap(phy, sz)
+#define ioremap_wt(phy, sz)		ioremap(phy, sz)
 
 
 /* Change struct page to physical address */
 /* Change struct page to physical address */
 #define page_to_phys(page)		(page_to_pfn(page) << PAGE_SHIFT)
 #define page_to_phys(page)		(page_to_pfn(page) << PAGE_SHIFT)

+ 1 - 1
arch/arm/boot/dts/Makefile

@@ -223,7 +223,7 @@ dtb-$(CONFIG_SOC_IMX25) += \
 	imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dtb \
 	imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dtb \
 	imx25-karo-tx25.dtb \
 	imx25-karo-tx25.dtb \
 	imx25-pdk.dtb
 	imx25-pdk.dtb
-dtb-$(CONFIG_SOC_IMX31) += \
+dtb-$(CONFIG_SOC_IMX27) += \
 	imx27-apf27.dtb \
 	imx27-apf27.dtb \
 	imx27-apf27dev.dtb \
 	imx27-apf27dev.dtb \
 	imx27-eukrea-mbimxsd27-baseboard.dtb \
 	imx27-eukrea-mbimxsd27-baseboard.dtb \

+ 0 - 4
arch/arm/boot/dts/am335x-boneblack.dts

@@ -80,7 +80,3 @@
 		status = "okay";
 		status = "okay";
 	};
 	};
 };
 };
-
-&rtc {
-	system-power-controller;
-};

+ 1 - 1
arch/arm/boot/dts/am335x-evmsk.dts

@@ -654,7 +654,7 @@
 	wlcore: wlcore@2 {
 	wlcore: wlcore@2 {
 		compatible = "ti,wl1271";
 		compatible = "ti,wl1271";
 		reg = <2>;
 		reg = <2>;
-		interrupt-parent = <&gpio1>;
+		interrupt-parent = <&gpio0>;
 		interrupts = <31 IRQ_TYPE_LEVEL_HIGH>; /* gpio 31 */
 		interrupts = <31 IRQ_TYPE_LEVEL_HIGH>; /* gpio 31 */
 		ref-clock-frequency = <38400000>;
 		ref-clock-frequency = <38400000>;
 	};
 	};

+ 1 - 1
arch/arm/boot/dts/exynos4412-trats2.dts

@@ -736,7 +736,7 @@
 
 
 			display-timings {
 			display-timings {
 				timing-0 {
 				timing-0 {
-					clock-frequency = <0>;
+					clock-frequency = <57153600>;
 					hactive = <720>;
 					hactive = <720>;
 					vactive = <1280>;
 					vactive = <1280>;
 					hfront-porch = <5>;
 					hfront-porch = <5>;

+ 1 - 1
arch/arm/boot/dts/imx27.dtsi

@@ -533,7 +533,7 @@
 
 
 			fec: ethernet@1002b000 {
 			fec: ethernet@1002b000 {
 				compatible = "fsl,imx27-fec";
 				compatible = "fsl,imx27-fec";
-				reg = <0x1002b000 0x4000>;
+				reg = <0x1002b000 0x1000>;
 				interrupts = <50>;
 				interrupts = <50>;
 				clocks = <&clks IMX27_CLK_FEC_IPG_GATE>,
 				clocks = <&clks IMX27_CLK_FEC_IPG_GATE>,
 					 <&clks IMX27_CLK_FEC_AHB_GATE>;
 					 <&clks IMX27_CLK_FEC_AHB_GATE>;

+ 2 - 0
arch/arm/boot/dts/omap3-devkit8000.dts

@@ -110,6 +110,8 @@
 	nand@0,0 {
 	nand@0,0 {
 		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
 		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
 		nand-bus-width = <16>;
 		nand-bus-width = <16>;
+		gpmc,device-width = <2>;
+		ti,nand-ecc-opt = "sw";
 
 
 		gpmc,sync-clk-ps = <0>;
 		gpmc,sync-clk-ps = <0>;
 		gpmc,cs-on-ns = <0>;
 		gpmc,cs-on-ns = <0>;

+ 2 - 2
arch/arm/boot/dts/zynq-7000.dtsi

@@ -193,7 +193,7 @@
 		};
 		};
 
 
 		gem0: ethernet@e000b000 {
 		gem0: ethernet@e000b000 {
-			compatible = "cdns,gem";
+			compatible = "cdns,zynq-gem";
 			reg = <0xe000b000 0x1000>;
 			reg = <0xe000b000 0x1000>;
 			status = "disabled";
 			status = "disabled";
 			interrupts = <0 22 4>;
 			interrupts = <0 22 4>;
@@ -204,7 +204,7 @@
 		};
 		};
 
 
 		gem1: ethernet@e000c000 {
 		gem1: ethernet@e000c000 {
-			compatible = "cdns,gem";
+			compatible = "cdns,zynq-gem";
 			reg = <0xe000c000 0x1000>;
 			reg = <0xe000c000 0x1000>;
 			status = "disabled";
 			status = "disabled";
 			interrupts = <0 45 4>;
 			interrupts = <0 45 4>;

+ 1 - 1
arch/arm/configs/multi_v7_defconfig

@@ -429,7 +429,7 @@ CONFIG_USB_EHCI_EXYNOS=y
 CONFIG_USB_EHCI_TEGRA=y
 CONFIG_USB_EHCI_TEGRA=y
 CONFIG_USB_EHCI_HCD_STI=y
 CONFIG_USB_EHCI_HCD_STI=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
-CONFIG_USB_ISP1760_HCD=y
+CONFIG_USB_ISP1760=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_OHCI_HCD_STI=y
 CONFIG_USB_OHCI_HCD_STI=y
 CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_USB_OHCI_HCD_PLATFORM=y

+ 1 - 1
arch/arm/include/asm/barrier.h

@@ -81,7 +81,7 @@ do {									\
 #define read_barrier_depends()		do { } while(0)
 #define read_barrier_depends()		do { } while(0)
 #define smp_read_barrier_depends()	do { } while(0)
 #define smp_read_barrier_depends()	do { } while(0)
 
 
-#define set_mb(var, value)	do { var = value; smp_mb(); } while (0)
+#define smp_store_mb(var, value)	do { WRITE_ONCE(var, value); smp_mb(); } while (0)
 
 
 #define smp_mb__before_atomic()	smp_mb()
 #define smp_mb__before_atomic()	smp_mb()
 #define smp_mb__after_atomic()	smp_mb()
 #define smp_mb__after_atomic()	smp_mb()

+ 1 - 0
arch/arm/include/asm/io.h

@@ -336,6 +336,7 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
 #define ioremap_nocache(cookie,size)	__arm_ioremap((cookie), (size), MT_DEVICE)
 #define ioremap_nocache(cookie,size)	__arm_ioremap((cookie), (size), MT_DEVICE)
 #define ioremap_cache(cookie,size)	__arm_ioremap((cookie), (size), MT_DEVICE_CACHED)
 #define ioremap_cache(cookie,size)	__arm_ioremap((cookie), (size), MT_DEVICE_CACHED)
 #define ioremap_wc(cookie,size)		__arm_ioremap((cookie), (size), MT_DEVICE_WC)
 #define ioremap_wc(cookie,size)		__arm_ioremap((cookie), (size), MT_DEVICE_WC)
+#define ioremap_wt(cookie,size)		__arm_ioremap((cookie), (size), MT_DEVICE)
 #define iounmap				__arm_iounmap
 #define iounmap				__arm_iounmap
 
 
 /*
 /*

+ 3 - 1
arch/arm/kernel/entry-common.S

@@ -33,7 +33,9 @@ ret_fast_syscall:
  UNWIND(.fnstart	)
  UNWIND(.fnstart	)
  UNWIND(.cantunwind	)
  UNWIND(.cantunwind	)
 	disable_irq				@ disable interrupts
 	disable_irq				@ disable interrupts
-	ldr	r1, [tsk, #TI_FLAGS]
+	ldr	r1, [tsk, #TI_FLAGS]		@ re-check for syscall tracing
+	tst	r1, #_TIF_SYSCALL_WORK
+	bne	__sys_trace_return
 	tst	r1, #_TIF_WORK_MASK
 	tst	r1, #_TIF_WORK_MASK
 	bne	fast_work_pending
 	bne	fast_work_pending
 	asm_trace_hardirqs_on
 	asm_trace_hardirqs_on

+ 5 - 4
arch/arm/kernel/perf_event_cpu.c

@@ -304,16 +304,17 @@ static int probe_current_pmu(struct arm_pmu *pmu)
 static int of_pmu_irq_cfg(struct platform_device *pdev)
 static int of_pmu_irq_cfg(struct platform_device *pdev)
 {
 {
 	int i, irq;
 	int i, irq;
-	int *irqs = kcalloc(pdev->num_resources, sizeof(*irqs), GFP_KERNEL);
-
-	if (!irqs)
-		return -ENOMEM;
+	int *irqs;
 
 
 	/* Don't bother with PPIs; they're already affine */
 	/* Don't bother with PPIs; they're already affine */
 	irq = platform_get_irq(pdev, 0);
 	irq = platform_get_irq(pdev, 0);
 	if (irq >= 0 && irq_is_percpu(irq))
 	if (irq >= 0 && irq_is_percpu(irq))
 		return 0;
 		return 0;
 
 
+	irqs = kcalloc(pdev->num_resources, sizeof(*irqs), GFP_KERNEL);
+	if (!irqs)
+		return -ENOMEM;
+
 	for (i = 0; i < pdev->num_resources; ++i) {
 	for (i = 0; i < pdev->num_resources; ++i) {
 		struct device_node *dn;
 		struct device_node *dn;
 		int cpu;
 		int cpu;

+ 13 - 3
arch/arm/mach-imx/gpc.c

@@ -280,9 +280,15 @@ void __init imx_gpc_check_dt(void)
 	struct device_node *np;
 	struct device_node *np;
 
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpc");
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpc");
-	if (WARN_ON(!np ||
-		    !of_find_property(np, "interrupt-controller", NULL)))
-		pr_warn("Outdated DT detected, system is about to crash!!!\n");
+	if (WARN_ON(!np))
+		return;
+
+	if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL))) {
+		pr_warn("Outdated DT detected, suspend/resume will NOT work\n");
+
+		/* map GPC, so that at least CPUidle and WARs keep working */
+		gpc_base = of_iomap(np, 0);
+	}
 }
 }
 
 
 #ifdef CONFIG_PM_GENERIC_DOMAINS
 #ifdef CONFIG_PM_GENERIC_DOMAINS
@@ -443,6 +449,10 @@ static int imx_gpc_probe(struct platform_device *pdev)
 	struct regulator *pu_reg;
 	struct regulator *pu_reg;
 	int ret;
 	int ret;
 
 
+	/* bail out if DT too old and doesn't provide the necessary info */
+	if (!of_property_read_bool(pdev->dev.of_node, "#power-domain-cells"))
+		return 0;
+
 	pu_reg = devm_regulator_get_optional(&pdev->dev, "pu");
 	pu_reg = devm_regulator_get_optional(&pdev->dev, "pu");
 	if (PTR_ERR(pu_reg) == -ENODEV)
 	if (PTR_ERR(pu_reg) == -ENODEV)
 		pu_reg = NULL;
 		pu_reg = NULL;

+ 1 - 1
arch/arm/mach-pxa/pxa_cplds_irqs.c

@@ -107,7 +107,7 @@ static int cplds_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct resource *res;
 	struct cplds *fpga;
 	struct cplds *fpga;
 	int ret;
 	int ret;
-	unsigned int base_irq = 0;
+	int base_irq;
 	unsigned long irqflags = 0;
 	unsigned long irqflags = 0;
 
 
 	fpga = devm_kzalloc(&pdev->dev, sizeof(*fpga), GFP_KERNEL);
 	fpga = devm_kzalloc(&pdev->dev, sizeof(*fpga), GFP_KERNEL);

+ 10 - 10
arch/arm/mm/mmu.c

@@ -1112,22 +1112,22 @@ void __init sanity_check_meminfo(void)
 			}
 			}
 
 
 			/*
 			/*
-			 * Find the first non-section-aligned page, and point
+			 * Find the first non-pmd-aligned page, and point
 			 * memblock_limit at it. This relies on rounding the
 			 * memblock_limit at it. This relies on rounding the
-			 * limit down to be section-aligned, which happens at
-			 * the end of this function.
+			 * limit down to be pmd-aligned, which happens at the
+			 * end of this function.
 			 *
 			 *
 			 * With this algorithm, the start or end of almost any
 			 * With this algorithm, the start or end of almost any
-			 * bank can be non-section-aligned. The only exception
-			 * is that the start of the bank 0 must be section-
+			 * bank can be non-pmd-aligned. The only exception is
+			 * that the start of the bank 0 must be section-
 			 * aligned, since otherwise memory would need to be
 			 * aligned, since otherwise memory would need to be
 			 * allocated when mapping the start of bank 0, which
 			 * allocated when mapping the start of bank 0, which
 			 * occurs before any free memory is mapped.
 			 * occurs before any free memory is mapped.
 			 */
 			 */
 			if (!memblock_limit) {
 			if (!memblock_limit) {
-				if (!IS_ALIGNED(block_start, SECTION_SIZE))
+				if (!IS_ALIGNED(block_start, PMD_SIZE))
 					memblock_limit = block_start;
 					memblock_limit = block_start;
-				else if (!IS_ALIGNED(block_end, SECTION_SIZE))
+				else if (!IS_ALIGNED(block_end, PMD_SIZE))
 					memblock_limit = arm_lowmem_limit;
 					memblock_limit = arm_lowmem_limit;
 			}
 			}
 
 
@@ -1137,12 +1137,12 @@ void __init sanity_check_meminfo(void)
 	high_memory = __va(arm_lowmem_limit - 1) + 1;
 	high_memory = __va(arm_lowmem_limit - 1) + 1;
 
 
 	/*
 	/*
-	 * Round the memblock limit down to a section size.  This
+	 * Round the memblock limit down to a pmd size.  This
 	 * helps to ensure that we will allocate memory from the
 	 * helps to ensure that we will allocate memory from the
-	 * last full section, which should be mapped.
+	 * last full pmd, which should be mapped.
 	 */
 	 */
 	if (memblock_limit)
 	if (memblock_limit)
-		memblock_limit = round_down(memblock_limit, SECTION_SIZE);
+		memblock_limit = round_down(memblock_limit, PMD_SIZE);
 	if (!memblock_limit)
 	if (!memblock_limit)
 		memblock_limit = arm_lowmem_limit;
 		memblock_limit = arm_lowmem_limit;
 
 

+ 1 - 0
arch/arm/xen/enlighten.c

@@ -272,6 +272,7 @@ void xen_arch_pre_suspend(void) { }
 void xen_arch_post_suspend(int suspend_cancelled) { }
 void xen_arch_post_suspend(int suspend_cancelled) { }
 void xen_timer_resume(void) { }
 void xen_timer_resume(void) { }
 void xen_arch_resume(void) { }
 void xen_arch_resume(void) { }
+void xen_arch_suspend(void) { }
 
 
 
 
 /* In the hypervisor.S file. */
 /* In the hypervisor.S file. */

+ 1 - 1
arch/arm64/include/asm/barrier.h

@@ -114,7 +114,7 @@ do {									\
 #define read_barrier_depends()		do { } while(0)
 #define read_barrier_depends()		do { } while(0)
 #define smp_read_barrier_depends()	do { } while(0)
 #define smp_read_barrier_depends()	do { } while(0)
 
 
-#define set_mb(var, value)	do { var = value; smp_mb(); } while (0)
+#define smp_store_mb(var, value)	do { WRITE_ONCE(var, value); smp_mb(); } while (0)
 #define nop()		asm volatile("nop");
 #define nop()		asm volatile("nop");
 
 
 #define smp_mb__before_atomic()	smp_mb()
 #define smp_mb__before_atomic()	smp_mb()

+ 1 - 0
arch/arm64/include/asm/io.h

@@ -170,6 +170,7 @@ extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size);
 #define ioremap(addr, size)		__ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
 #define ioremap(addr, size)		__ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
 #define ioremap_nocache(addr, size)	__ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
 #define ioremap_nocache(addr, size)	__ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
 #define ioremap_wc(addr, size)		__ioremap((addr), (size), __pgprot(PROT_NORMAL_NC))
 #define ioremap_wc(addr, size)		__ioremap((addr), (size), __pgprot(PROT_NORMAL_NC))
+#define ioremap_wt(addr, size)		__ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
 #define iounmap				__iounmap
 #define iounmap				__iounmap
 
 
 /*
 /*

+ 0 - 2
arch/avr32/include/asm/cmpxchg.h

@@ -70,8 +70,6 @@ extern unsigned long __cmpxchg_u64_unsupported_on_32bit_kernels(
    if something tries to do an invalid cmpxchg().  */
    if something tries to do an invalid cmpxchg().  */
 extern void __cmpxchg_called_with_bad_pointer(void);
 extern void __cmpxchg_called_with_bad_pointer(void);
 
 
-#define __HAVE_ARCH_CMPXCHG 1
-
 static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
 static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
 				      unsigned long new, int size)
 				      unsigned long new, int size)
 {
 {

+ 1 - 0
arch/avr32/include/asm/io.h

@@ -296,6 +296,7 @@ extern void __iounmap(void __iomem *addr);
 	__iounmap(addr)
 	__iounmap(addr)
 
 
 #define ioremap_wc ioremap_nocache
 #define ioremap_wc ioremap_nocache
+#define ioremap_wt ioremap_nocache
 
 
 #define cached(addr) P1SEGADDR(addr)
 #define cached(addr) P1SEGADDR(addr)
 #define uncached(addr) P2SEGADDR(addr)
 #define uncached(addr) P2SEGADDR(addr)

+ 3 - 1
arch/frv/include/asm/io.h

@@ -17,6 +17,8 @@
 
 
 #ifdef __KERNEL__
 #ifdef __KERNEL__
 
 
+#define ARCH_HAS_IOREMAP_WT
+
 #include <linux/types.h>
 #include <linux/types.h>
 #include <asm/virtconvert.h>
 #include <asm/virtconvert.h>
 #include <asm/string.h>
 #include <asm/string.h>
@@ -265,7 +267,7 @@ static inline void __iomem *ioremap_nocache(unsigned long physaddr, unsigned lon
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
 }
 }
 
 
-static inline void __iomem *ioremap_writethrough(unsigned long physaddr, unsigned long size)
+static inline void __iomem *ioremap_wt(unsigned long physaddr, unsigned long size)
 {
 {
 	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
 	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
 }
 }

+ 0 - 1
arch/hexagon/include/asm/cmpxchg.h

@@ -64,7 +64,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
  *  looks just like atomic_cmpxchg on our arch currently with a bunch of
  *  looks just like atomic_cmpxchg on our arch currently with a bunch of
  *  variable casting.
  *  variable casting.
  */
  */
-#define __HAVE_ARCH_CMPXCHG 1
 
 
 #define cmpxchg(ptr, old, new)					\
 #define cmpxchg(ptr, old, new)					\
 ({								\
 ({								\

+ 1 - 6
arch/ia64/include/asm/barrier.h

@@ -77,12 +77,7 @@ do {									\
 	___p1;								\
 	___p1;								\
 })
 })
 
 
-/*
- * XXX check on this ---I suspect what Linus really wants here is
- * acquire vs release semantics but we can't discuss this stuff with
- * Linus just yet.  Grrr...
- */
-#define set_mb(var, value)	do { (var) = (value); mb(); } while (0)
+#define smp_store_mb(var, value)	do { WRITE_ONCE(var, value); mb(); } while (0)
 
 
 /*
 /*
  * The group barrier in front of the rsm & ssm are necessary to ensure
  * The group barrier in front of the rsm & ssm are necessary to ensure

+ 0 - 2
arch/ia64/include/uapi/asm/cmpxchg.h

@@ -61,8 +61,6 @@ extern void ia64_xchg_called_with_bad_pointer(void);
  * indicated by comparing RETURN with OLD.
  * indicated by comparing RETURN with OLD.
  */
  */
 
 
-#define __HAVE_ARCH_CMPXCHG 1
-
 /*
 /*
  * This function doesn't exist, so you'll get a linker error
  * This function doesn't exist, so you'll get a linker error
  * if something tries to do an invalid cmpxchg().
  * if something tries to do an invalid cmpxchg().

+ 10 - 3
arch/ia64/pci/pci.c

@@ -478,9 +478,16 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
 
 
 int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
 int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
 {
 {
-	struct pci_controller *controller = bridge->bus->sysdata;
-
-	ACPI_COMPANION_SET(&bridge->dev, controller->companion);
+	/*
+	 * We pass NULL as parent to pci_create_root_bus(), so if it is not NULL
+	 * here, pci_create_root_bus() has been called by someone else and
+	 * sysdata is likely to be different from what we expect.  Let it go in
+	 * that case.
+	 */
+	if (!bridge->dev.parent) {
+		struct pci_controller *controller = bridge->bus->sysdata;
+		ACPI_COMPANION_SET(&bridge->dev, controller->companion);
+	}
 	return 0;
 	return 0;
 }
 }
 
 

+ 0 - 2
arch/m32r/include/asm/cmpxchg.h

@@ -107,8 +107,6 @@ __xchg_local(unsigned long x, volatile void *ptr, int size)
 	((__typeof__(*(ptr)))__xchg_local((unsigned long)(x), (ptr),	\
 	((__typeof__(*(ptr)))__xchg_local((unsigned long)(x), (ptr),	\
 			sizeof(*(ptr))))
 			sizeof(*(ptr))))
 
 
-#define __HAVE_ARCH_CMPXCHG	1
-
 static inline unsigned long
 static inline unsigned long
 __cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new)
 __cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new)
 {
 {

+ 1 - 0
arch/m32r/include/asm/io.h

@@ -68,6 +68,7 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
 extern void iounmap(volatile void __iomem *addr);
 extern void iounmap(volatile void __iomem *addr);
 #define ioremap_nocache(off,size) ioremap(off,size)
 #define ioremap_nocache(off,size) ioremap(off,size)
 #define ioremap_wc ioremap_nocache
 #define ioremap_wc ioremap_nocache
+#define ioremap_wt ioremap_nocache
 
 
 /*
 /*
  * IO bus memory addresses are also 1:1 with the physical address
  * IO bus memory addresses are also 1:1 with the physical address

+ 0 - 1
arch/m68k/include/asm/cmpxchg.h

@@ -90,7 +90,6 @@ extern unsigned long __invalid_cmpxchg_size(volatile void *,
  * indicated by comparing RETURN with OLD.
  * indicated by comparing RETURN with OLD.
  */
  */
 #ifdef CONFIG_RMW_INSNS
 #ifdef CONFIG_RMW_INSNS
-#define __HAVE_ARCH_CMPXCHG	1
 
 
 static inline unsigned long __cmpxchg(volatile void *p, unsigned long old,
 static inline unsigned long __cmpxchg(volatile void *p, unsigned long old,
 				      unsigned long new, int size)
 				      unsigned long new, int size)

+ 3 - 1
arch/m68k/include/asm/io_mm.h

@@ -20,6 +20,8 @@
 
 
 #ifdef __KERNEL__
 #ifdef __KERNEL__
 
 
+#define ARCH_HAS_IOREMAP_WT
+
 #include <linux/compiler.h>
 #include <linux/compiler.h>
 #include <asm/raw_io.h>
 #include <asm/raw_io.h>
 #include <asm/virtconvert.h>
 #include <asm/virtconvert.h>
@@ -465,7 +467,7 @@ static inline void __iomem *ioremap_nocache(unsigned long physaddr, unsigned lon
 {
 {
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
 }
 }
-static inline void __iomem *ioremap_writethrough(unsigned long physaddr,
+static inline void __iomem *ioremap_wt(unsigned long physaddr,
 					 unsigned long size)
 					 unsigned long size)
 {
 {
 	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
 	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);

+ 3 - 1
arch/m68k/include/asm/io_no.h

@@ -3,6 +3,8 @@
 
 
 #ifdef __KERNEL__
 #ifdef __KERNEL__
 
 
+#define ARCH_HAS_IOREMAP_WT
+
 #include <asm/virtconvert.h>
 #include <asm/virtconvert.h>
 #include <asm-generic/iomap.h>
 #include <asm-generic/iomap.h>
 
 
@@ -153,7 +155,7 @@ static inline void *ioremap_nocache(unsigned long physaddr, unsigned long size)
 {
 {
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
 	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
 }
 }
-static inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size)
+static inline void *ioremap_wt(unsigned long physaddr, unsigned long size)
 {
 {
 	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
 	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
 }
 }

+ 1 - 1
arch/metag/include/asm/barrier.h

@@ -84,7 +84,7 @@ static inline void fence(void)
 #define read_barrier_depends()		do { } while (0)
 #define read_barrier_depends()		do { } while (0)
 #define smp_read_barrier_depends()	do { } while (0)
 #define smp_read_barrier_depends()	do { } while (0)
 
 
-#define set_mb(var, value) do { var = value; smp_mb(); } while (0)
+#define smp_store_mb(var, value) do { WRITE_ONCE(var, value); smp_mb(); } while (0)
 
 
 #define smp_store_release(p, v)						\
 #define smp_store_release(p, v)						\
 do {									\
 do {									\

+ 0 - 2
arch/metag/include/asm/cmpxchg.h

@@ -51,8 +51,6 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
 	return old;
 	return old;
 }
 }
 
 
-#define __HAVE_ARCH_CMPXCHG 1
-
 #define cmpxchg(ptr, o, n)						\
 #define cmpxchg(ptr, o, n)						\
 	({								\
 	({								\
 		__typeof__(*(ptr)) _o_ = (o);				\
 		__typeof__(*(ptr)) _o_ = (o);				\

+ 3 - 0
arch/metag/include/asm/io.h

@@ -160,6 +160,9 @@ extern void __iounmap(void __iomem *addr);
 #define ioremap_wc(offset, size)                \
 #define ioremap_wc(offset, size)                \
 	__ioremap((offset), (size), _PAGE_WR_COMBINE)
 	__ioremap((offset), (size), _PAGE_WR_COMBINE)
 
 
+#define ioremap_wt(offset, size)                \
+	__ioremap((offset), (size), 0)
+
 #define iounmap(addr)                           \
 #define iounmap(addr)                           \
 	__iounmap(addr)
 	__iounmap(addr)
 
 

+ 1 - 1
arch/microblaze/include/asm/io.h

@@ -39,10 +39,10 @@ extern resource_size_t isa_mem_base;
 extern void iounmap(void __iomem *addr);
 extern void iounmap(void __iomem *addr);
 
 
 extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
 extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
-#define ioremap_writethrough(addr, size)	ioremap((addr), (size))
 #define ioremap_nocache(addr, size)		ioremap((addr), (size))
 #define ioremap_nocache(addr, size)		ioremap((addr), (size))
 #define ioremap_fullcache(addr, size)		ioremap((addr), (size))
 #define ioremap_fullcache(addr, size)		ioremap((addr), (size))
 #define ioremap_wc(addr, size)			ioremap((addr), (size))
 #define ioremap_wc(addr, size)			ioremap((addr), (size))
+#define ioremap_wt(addr, size)			ioremap((addr), (size))
 
 
 #endif /* CONFIG_MMU */
 #endif /* CONFIG_MMU */
 
 

+ 3 - 0
arch/mips/ath79/prom.c

@@ -1,6 +1,7 @@
 /*
 /*
  *  Atheros AR71XX/AR724X/AR913X specific prom routines
  *  Atheros AR71XX/AR724X/AR913X specific prom routines
  *
  *
+ *  Copyright (C) 2015 Laurent Fasnacht <l@libres.ch>
  *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
  *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
  *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
  *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
  *
  *
@@ -25,12 +26,14 @@ void __init prom_init(void)
 {
 {
 	fw_init_cmdline();
 	fw_init_cmdline();
 
 
+#ifdef CONFIG_BLK_DEV_INITRD
 	/* Read the initrd address from the firmware environment */
 	/* Read the initrd address from the firmware environment */
 	initrd_start = fw_getenvl("initrd_start");
 	initrd_start = fw_getenvl("initrd_start");
 	if (initrd_start) {
 	if (initrd_start) {
 		initrd_start = KSEG0ADDR(initrd_start);
 		initrd_start = KSEG0ADDR(initrd_start);
 		initrd_end = initrd_start + fw_getenvl("initrd_size");
 		initrd_end = initrd_start + fw_getenvl("initrd_size");
 	}
 	}
+#endif
 }
 }
 
 
 void __init prom_free_prom_memory(void)
 void __init prom_free_prom_memory(void)

+ 1 - 1
arch/mips/configs/fuloong2e_defconfig

@@ -194,7 +194,7 @@ CONFIG_USB_WUSB_CBAF=m
 CONFIG_USB_C67X00_HCD=m
 CONFIG_USB_C67X00_HCD=m
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
-CONFIG_USB_ISP1760_HCD=m
+CONFIG_USB_ISP1760=m
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_UHCI_HCD=m
 CONFIG_USB_UHCI_HCD=m
 CONFIG_USB_R8A66597_HCD=m
 CONFIG_USB_R8A66597_HCD=m

+ 2 - 2
arch/mips/include/asm/barrier.h

@@ -112,8 +112,8 @@
 #define __WEAK_LLSC_MB		"		\n"
 #define __WEAK_LLSC_MB		"		\n"
 #endif
 #endif
 
 
-#define set_mb(var, value) \
-	do { var = value; smp_mb(); } while (0)
+#define smp_store_mb(var, value) \
+	do { WRITE_ONCE(var, value); smp_mb(); } while (0)
 
 
 #define smp_llsc_mb()	__asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
 #define smp_llsc_mb()	__asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
 
 

+ 0 - 2
arch/mips/include/asm/cmpxchg.h

@@ -138,8 +138,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
 		__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))));	\
 		__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))));	\
 })
 })
 
 
-#define __HAVE_ARCH_CMPXCHG 1
-
 #define __cmpxchg_asm(ld, st, m, old, new)				\
 #define __cmpxchg_asm(ld, st, m, old, new)				\
 ({									\
 ({									\
 	__typeof(*(m)) __ret;						\
 	__typeof(*(m)) __ret;						\

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

@@ -29,7 +29,7 @@
 int kgdb_early_setup;
 int kgdb_early_setup;
 #endif
 #endif
 
 
-static unsigned long irq_map[NR_IRQS / BITS_PER_LONG];
+static DECLARE_BITMAP(irq_map, NR_IRQS);
 
 
 int allocate_irqno(void)
 int allocate_irqno(void)
 {
 {

+ 1 - 1
arch/mips/kernel/smp-bmips.c

@@ -444,7 +444,7 @@ struct plat_smp_ops bmips5000_smp_ops = {
 static void bmips_wr_vec(unsigned long dst, char *start, char *end)
 static void bmips_wr_vec(unsigned long dst, char *start, char *end)
 {
 {
 	memcpy((void *)dst, start, end - start);
 	memcpy((void *)dst, start, end - start);
-	dma_cache_wback((unsigned long)start, end - start);
+	dma_cache_wback(dst, end - start);
 	local_flush_icache_range(dst, dst + (end - start));
 	local_flush_icache_range(dst, dst + (end - start));
 	instruction_hazard();
 	instruction_hazard();
 }
 }

+ 13 - 2
arch/mips/lib/strnlen_user.S

@@ -34,7 +34,12 @@ LEAF(__strnlen_\func\()_asm)
 FEXPORT(__strnlen_\func\()_nocheck_asm)
 FEXPORT(__strnlen_\func\()_nocheck_asm)
 	move		v0, a0
 	move		v0, a0
 	PTR_ADDU	a1, a0			# stop pointer
 	PTR_ADDU	a1, a0			# stop pointer
-1:	beq		v0, a1, 1f		# limit reached?
+1:
+#ifdef CONFIG_CPU_DADDI_WORKAROUNDS
+	.set		noat
+	li		AT, 1
+#endif
+	beq		v0, a1, 1f		# limit reached?
 .ifeqs "\func", "kernel"
 .ifeqs "\func", "kernel"
 	EX(lb, t0, (v0), .Lfault\@)
 	EX(lb, t0, (v0), .Lfault\@)
 .else
 .else
@@ -42,7 +47,13 @@ FEXPORT(__strnlen_\func\()_nocheck_asm)
 .endif
 .endif
 	.set		noreorder
 	.set		noreorder
 	bnez		t0, 1b
 	bnez		t0, 1b
-1:	 PTR_ADDIU	v0, 1
+1:
+#ifndef CONFIG_CPU_DADDI_WORKAROUNDS
+	 PTR_ADDIU	v0, 1
+#else
+	 PTR_ADDU	v0, AT
+	.set		at
+#endif
 	.set		reorder
 	.set		reorder
 	PTR_SUBU	v0, a0
 	PTR_SUBU	v0, a0
 	jr		ra
 	jr		ra

+ 1 - 0
arch/mn10300/include/asm/io.h

@@ -282,6 +282,7 @@ static inline void __iomem *ioremap_nocache(unsigned long offset, unsigned long
 }
 }
 
 
 #define ioremap_wc ioremap_nocache
 #define ioremap_wc ioremap_nocache
+#define ioremap_wt ioremap_nocache
 
 
 static inline void iounmap(void __iomem *addr)
 static inline void iounmap(void __iomem *addr)
 {
 {

+ 1 - 0
arch/nios2/include/asm/io.h

@@ -46,6 +46,7 @@ static inline void iounmap(void __iomem *addr)
 }
 }
 
 
 #define ioremap_wc ioremap_nocache
 #define ioremap_wc ioremap_nocache
+#define ioremap_wt ioremap_nocache
 
 
 /* Pages to physical address... */
 /* Pages to physical address... */
 #define page_to_phys(page)	virt_to_phys(page_to_virt(page))
 #define page_to_phys(page)	virt_to_phys(page_to_virt(page))

+ 0 - 2
arch/parisc/include/asm/cmpxchg.h

@@ -46,8 +46,6 @@ __xchg(unsigned long x, __volatile__ void *ptr, int size)
 #define xchg(ptr, x) \
 #define xchg(ptr, x) \
 	((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
 	((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
 
 
-#define __HAVE_ARCH_CMPXCHG	1
-
 /* bug catcher for when unsupported size is used - won't link */
 /* bug catcher for when unsupported size is used - won't link */
 extern void __cmpxchg_called_with_bad_pointer(void);
 extern void __cmpxchg_called_with_bad_pointer(void);
 
 

+ 1 - 1
arch/powerpc/include/asm/barrier.h

@@ -34,7 +34,7 @@
 #define rmb()  __asm__ __volatile__ ("sync" : : : "memory")
 #define rmb()  __asm__ __volatile__ ("sync" : : : "memory")
 #define wmb()  __asm__ __volatile__ ("sync" : : : "memory")
 #define wmb()  __asm__ __volatile__ ("sync" : : : "memory")
 
 
-#define set_mb(var, value)	do { var = value; mb(); } while (0)
+#define smp_store_mb(var, value)	do { WRITE_ONCE(var, value); mb(); } while (0)
 
 
 #ifdef __SUBARCH_HAS_LWSYNC
 #ifdef __SUBARCH_HAS_LWSYNC
 #    define SMPWMB      LWSYNC
 #    define SMPWMB      LWSYNC

+ 0 - 1
arch/powerpc/include/asm/cmpxchg.h

@@ -144,7 +144,6 @@ __xchg_local(volatile void *ptr, unsigned long x, unsigned int size)
  * Compare and exchange - if *p == old, set it to new,
  * Compare and exchange - if *p == old, set it to new,
  * and return the old value of *p.
  * and return the old value of *p.
  */
  */
-#define __HAVE_ARCH_CMPXCHG	1
 
 
 static __always_inline unsigned long
 static __always_inline unsigned long
 __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
 __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)

+ 2 - 2
arch/powerpc/kernel/mce.c

@@ -73,7 +73,7 @@ void save_mce_event(struct pt_regs *regs, long handled,
 		    uint64_t nip, uint64_t addr)
 		    uint64_t nip, uint64_t addr)
 {
 {
 	uint64_t srr1;
 	uint64_t srr1;
-	int index = __this_cpu_inc_return(mce_nest_count);
+	int index = __this_cpu_inc_return(mce_nest_count) - 1;
 	struct machine_check_event *mce = this_cpu_ptr(&mce_event[index]);
 	struct machine_check_event *mce = this_cpu_ptr(&mce_event[index]);
 
 
 	/*
 	/*
@@ -184,7 +184,7 @@ void machine_check_queue_event(void)
 	if (!get_mce_event(&evt, MCE_EVENT_RELEASE))
 	if (!get_mce_event(&evt, MCE_EVENT_RELEASE))
 		return;
 		return;
 
 
-	index = __this_cpu_inc_return(mce_queue_count);
+	index = __this_cpu_inc_return(mce_queue_count) - 1;
 	/* If queue is full, just return for now. */
 	/* If queue is full, just return for now. */
 	if (index >= MAX_MC_EVT) {
 	if (index >= MAX_MC_EVT) {
 		__this_cpu_dec(mce_queue_count);
 		__this_cpu_dec(mce_queue_count);

+ 1 - 0
arch/powerpc/kernel/vmlinux.lds.S

@@ -213,6 +213,7 @@ SECTIONS
 		*(.opd)
 		*(.opd)
 	}
 	}
 
 
+	. = ALIGN(256);
 	.got : AT(ADDR(.got) - LOAD_OFFSET) {
 	.got : AT(ADDR(.got) - LOAD_OFFSET) {
 		__toc_start = .;
 		__toc_start = .;
 #ifndef CONFIG_RELOCATABLE
 #ifndef CONFIG_RELOCATABLE

+ 3 - 2
arch/powerpc/kvm/book3s_hv.c

@@ -1952,7 +1952,7 @@ static void post_guest_process(struct kvmppc_vcore *vc)
  */
  */
 static noinline void kvmppc_run_core(struct kvmppc_vcore *vc)
 static noinline void kvmppc_run_core(struct kvmppc_vcore *vc)
 {
 {
-	struct kvm_vcpu *vcpu;
+	struct kvm_vcpu *vcpu, *vnext;
 	int i;
 	int i;
 	int srcu_idx;
 	int srcu_idx;
 
 
@@ -1982,7 +1982,8 @@ static noinline void kvmppc_run_core(struct kvmppc_vcore *vc)
 	 */
 	 */
 	if ((threads_per_core > 1) &&
 	if ((threads_per_core > 1) &&
 	    ((vc->num_threads > threads_per_subcore) || !on_primary_thread())) {
 	    ((vc->num_threads > threads_per_subcore) || !on_primary_thread())) {
-		list_for_each_entry(vcpu, &vc->runnable_threads, arch.run_list) {
+		list_for_each_entry_safe(vcpu, vnext, &vc->runnable_threads,
+					 arch.run_list) {
 			vcpu->arch.ret = -EBUSY;
 			vcpu->arch.ret = -EBUSY;
 			kvmppc_remove_runnable(vc, vcpu);
 			kvmppc_remove_runnable(vc, vcpu);
 			wake_up(&vcpu->arch.cpu_run);
 			wake_up(&vcpu->arch.cpu_run);

+ 16 - 9
arch/powerpc/mm/hugetlbpage.c

@@ -689,27 +689,34 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb,
 struct page *
 struct page *
 follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
 follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
 {
 {
-	pte_t *ptep;
-	struct page *page;
+	pte_t *ptep, pte;
 	unsigned shift;
 	unsigned shift;
 	unsigned long mask, flags;
 	unsigned long mask, flags;
+	struct page *page = ERR_PTR(-EINVAL);
+
+	local_irq_save(flags);
+	ptep = find_linux_pte_or_hugepte(mm->pgd, address, &shift);
+	if (!ptep)
+		goto no_page;
+	pte = READ_ONCE(*ptep);
 	/*
 	/*
+	 * Verify it is a huge page else bail.
 	 * Transparent hugepages are handled by generic code. We can skip them
 	 * Transparent hugepages are handled by generic code. We can skip them
 	 * here.
 	 * here.
 	 */
 	 */
-	local_irq_save(flags);
-	ptep = find_linux_pte_or_hugepte(mm->pgd, address, &shift);
+	if (!shift || pmd_trans_huge(__pmd(pte_val(pte))))
+		goto no_page;
 
 
-	/* Verify it is a huge page else bail. */
-	if (!ptep || !shift || pmd_trans_huge(*(pmd_t *)ptep)) {
-		local_irq_restore(flags);
-		return ERR_PTR(-EINVAL);
+	if (!pte_present(pte)) {
+		page = NULL;
+		goto no_page;
 	}
 	}
 	mask = (1UL << shift) - 1;
 	mask = (1UL << shift) - 1;
-	page = pte_page(*ptep);
+	page = pte_page(pte);
 	if (page)
 	if (page)
 		page += (address & mask) / PAGE_SIZE;
 		page += (address & mask) / PAGE_SIZE;
 
 
+no_page:
 	local_irq_restore(flags);
 	local_irq_restore(flags);
 	return page;
 	return page;
 }
 }

+ 11 - 0
arch/powerpc/mm/pgtable_64.c

@@ -839,6 +839,17 @@ pmd_t pmdp_get_and_clear(struct mm_struct *mm,
 	 * hash fault look at them.
 	 * hash fault look at them.
 	 */
 	 */
 	memset(pgtable, 0, PTE_FRAG_SIZE);
 	memset(pgtable, 0, PTE_FRAG_SIZE);
+	/*
+	 * Serialize against find_linux_pte_or_hugepte which does lock-less
+	 * lookup in page tables with local interrupts disabled. For huge pages
+	 * it casts pmd_t to pte_t. Since format of pte_t is different from
+	 * pmd_t we want to prevent transit from pmd pointing to page table
+	 * to pmd pointing to huge page (and back) while interrupts are disabled.
+	 * We clear pmd to possibly replace it with page table pointer in
+	 * different code paths. So make sure we wait for the parallel
+	 * find_linux_pte_or_hugepage to finish.
+	 */
+	kick_all_cpus_sync();
 	return old_pmd;
 	return old_pmd;
 }
 }
 
 

+ 13 - 12
arch/s390/crypto/ghash_s390.c

@@ -16,11 +16,12 @@
 #define GHASH_DIGEST_SIZE	16
 #define GHASH_DIGEST_SIZE	16
 
 
 struct ghash_ctx {
 struct ghash_ctx {
-	u8 icv[16];
-	u8 key[16];
+	u8 key[GHASH_BLOCK_SIZE];
 };
 };
 
 
 struct ghash_desc_ctx {
 struct ghash_desc_ctx {
+	u8 icv[GHASH_BLOCK_SIZE];
+	u8 key[GHASH_BLOCK_SIZE];
 	u8 buffer[GHASH_BLOCK_SIZE];
 	u8 buffer[GHASH_BLOCK_SIZE];
 	u32 bytes;
 	u32 bytes;
 };
 };
@@ -28,8 +29,10 @@ struct ghash_desc_ctx {
 static int ghash_init(struct shash_desc *desc)
 static int ghash_init(struct shash_desc *desc)
 {
 {
 	struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
 	struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
+	struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
 
 
 	memset(dctx, 0, sizeof(*dctx));
 	memset(dctx, 0, sizeof(*dctx));
+	memcpy(dctx->key, ctx->key, GHASH_BLOCK_SIZE);
 
 
 	return 0;
 	return 0;
 }
 }
@@ -45,7 +48,6 @@ static int ghash_setkey(struct crypto_shash *tfm,
 	}
 	}
 
 
 	memcpy(ctx->key, key, GHASH_BLOCK_SIZE);
 	memcpy(ctx->key, key, GHASH_BLOCK_SIZE);
-	memset(ctx->icv, 0, GHASH_BLOCK_SIZE);
 
 
 	return 0;
 	return 0;
 }
 }
@@ -54,7 +56,6 @@ static int ghash_update(struct shash_desc *desc,
 			 const u8 *src, unsigned int srclen)
 			 const u8 *src, unsigned int srclen)
 {
 {
 	struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
 	struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
-	struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
 	unsigned int n;
 	unsigned int n;
 	u8 *buf = dctx->buffer;
 	u8 *buf = dctx->buffer;
 	int ret;
 	int ret;
@@ -70,7 +71,7 @@ static int ghash_update(struct shash_desc *desc,
 		src += n;
 		src += n;
 
 
 		if (!dctx->bytes) {
 		if (!dctx->bytes) {
-			ret = crypt_s390_kimd(KIMD_GHASH, ctx, buf,
+			ret = crypt_s390_kimd(KIMD_GHASH, dctx, buf,
 					      GHASH_BLOCK_SIZE);
 					      GHASH_BLOCK_SIZE);
 			if (ret != GHASH_BLOCK_SIZE)
 			if (ret != GHASH_BLOCK_SIZE)
 				return -EIO;
 				return -EIO;
@@ -79,7 +80,7 @@ static int ghash_update(struct shash_desc *desc,
 
 
 	n = srclen & ~(GHASH_BLOCK_SIZE - 1);
 	n = srclen & ~(GHASH_BLOCK_SIZE - 1);
 	if (n) {
 	if (n) {
-		ret = crypt_s390_kimd(KIMD_GHASH, ctx, src, n);
+		ret = crypt_s390_kimd(KIMD_GHASH, dctx, src, n);
 		if (ret != n)
 		if (ret != n)
 			return -EIO;
 			return -EIO;
 		src += n;
 		src += n;
@@ -94,7 +95,7 @@ static int ghash_update(struct shash_desc *desc,
 	return 0;
 	return 0;
 }
 }
 
 
-static int ghash_flush(struct ghash_ctx *ctx, struct ghash_desc_ctx *dctx)
+static int ghash_flush(struct ghash_desc_ctx *dctx)
 {
 {
 	u8 *buf = dctx->buffer;
 	u8 *buf = dctx->buffer;
 	int ret;
 	int ret;
@@ -104,24 +105,24 @@ static int ghash_flush(struct ghash_ctx *ctx, struct ghash_desc_ctx *dctx)
 
 
 		memset(pos, 0, dctx->bytes);
 		memset(pos, 0, dctx->bytes);
 
 
-		ret = crypt_s390_kimd(KIMD_GHASH, ctx, buf, GHASH_BLOCK_SIZE);
+		ret = crypt_s390_kimd(KIMD_GHASH, dctx, buf, GHASH_BLOCK_SIZE);
 		if (ret != GHASH_BLOCK_SIZE)
 		if (ret != GHASH_BLOCK_SIZE)
 			return -EIO;
 			return -EIO;
+
+		dctx->bytes = 0;
 	}
 	}
 
 
-	dctx->bytes = 0;
 	return 0;
 	return 0;
 }
 }
 
 
 static int ghash_final(struct shash_desc *desc, u8 *dst)
 static int ghash_final(struct shash_desc *desc, u8 *dst)
 {
 {
 	struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
 	struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
-	struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
 	int ret;
 	int ret;
 
 
-	ret = ghash_flush(ctx, dctx);
+	ret = ghash_flush(dctx);
 	if (!ret)
 	if (!ret)
-		memcpy(dst, ctx->icv, GHASH_BLOCK_SIZE);
+		memcpy(dst, dctx->icv, GHASH_BLOCK_SIZE);
 	return ret;
 	return ret;
 }
 }
 
 

+ 1 - 1
arch/s390/crypto/prng.c

@@ -125,7 +125,7 @@ static int generate_entropy(u8 *ebuf, size_t nbytes)
 		/* fill page with urandom bytes */
 		/* fill page with urandom bytes */
 		get_random_bytes(pg, PAGE_SIZE);
 		get_random_bytes(pg, PAGE_SIZE);
 		/* exor page with stckf values */
 		/* exor page with stckf values */
-		for (n = 0; n < sizeof(PAGE_SIZE/sizeof(u64)); n++) {
+		for (n = 0; n < PAGE_SIZE / sizeof(u64); n++) {
 			u64 *p = ((u64 *)pg) + n;
 			u64 *p = ((u64 *)pg) + n;
 			*p ^= get_tod_clock_fast();
 			*p ^= get_tod_clock_fast();
 		}
 		}

+ 1 - 1
arch/s390/include/asm/barrier.h

@@ -36,7 +36,7 @@
 #define smp_mb__before_atomic()		smp_mb()
 #define smp_mb__before_atomic()		smp_mb()
 #define smp_mb__after_atomic()		smp_mb()
 #define smp_mb__after_atomic()		smp_mb()
 
 
-#define set_mb(var, value)		do { var = value; mb(); } while (0)
+#define smp_store_mb(var, value)		do { WRITE_ONCE(var, value); mb(); } while (0)
 
 
 #define smp_store_release(p, v)						\
 #define smp_store_release(p, v)						\
 do {									\
 do {									\

+ 0 - 2
arch/s390/include/asm/cmpxchg.h

@@ -32,8 +32,6 @@
 	__old;								\
 	__old;								\
 })
 })
 
 
-#define __HAVE_ARCH_CMPXCHG
-
 #define __cmpxchg_double_op(p1, p2, o1, o2, n1, n2, insn)		\
 #define __cmpxchg_double_op(p1, p2, o1, o2, n1, n2, insn)		\
 ({									\
 ({									\
 	register __typeof__(*(p1)) __old1 asm("2") = (o1);		\
 	register __typeof__(*(p1)) __old1 asm("2") = (o1);		\

+ 1 - 0
arch/s390/include/asm/io.h

@@ -29,6 +29,7 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
 
 
 #define ioremap_nocache(addr, size)	ioremap(addr, size)
 #define ioremap_nocache(addr, size)	ioremap(addr, size)
 #define ioremap_wc			ioremap_nocache
 #define ioremap_wc			ioremap_nocache
+#define ioremap_wt			ioremap_nocache
 
 
 static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
 static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
 {
 {

+ 1 - 1
arch/s390/include/asm/pgtable.h

@@ -494,7 +494,7 @@ static inline int pmd_large(pmd_t pmd)
 	return (pmd_val(pmd) & _SEGMENT_ENTRY_LARGE) != 0;
 	return (pmd_val(pmd) & _SEGMENT_ENTRY_LARGE) != 0;
 }
 }
 
 
-static inline int pmd_pfn(pmd_t pmd)
+static inline unsigned long pmd_pfn(pmd_t pmd)
 {
 {
 	unsigned long origin_mask;
 	unsigned long origin_mask;
 
 

+ 10 - 9
arch/s390/net/bpf_jit_comp.c

@@ -443,8 +443,11 @@ static void bpf_jit_epilogue(struct bpf_jit *jit)
 
 
 /*
 /*
  * Compile one eBPF instruction into s390x code
  * Compile one eBPF instruction into s390x code
+ *
+ * NOTE: Use noinline because for gcov (-fprofile-arcs) gcc allocates a lot of
+ * stack space for the large switch statement.
  */
  */
-static int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i)
+static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i)
 {
 {
 	struct bpf_insn *insn = &fp->insnsi[i];
 	struct bpf_insn *insn = &fp->insnsi[i];
 	int jmp_off, last, insn_count = 1;
 	int jmp_off, last, insn_count = 1;
@@ -588,8 +591,8 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i)
 		EMIT4(0xb9160000, dst_reg, rc_reg);
 		EMIT4(0xb9160000, dst_reg, rc_reg);
 		break;
 		break;
 	}
 	}
-	case BPF_ALU64 | BPF_DIV | BPF_X: /* dst = dst / (u32) src */
-	case BPF_ALU64 | BPF_MOD | BPF_X: /* dst = dst % (u32) src */
+	case BPF_ALU64 | BPF_DIV | BPF_X: /* dst = dst / src */
+	case BPF_ALU64 | BPF_MOD | BPF_X: /* dst = dst % src */
 	{
 	{
 		int rc_reg = BPF_OP(insn->code) == BPF_DIV ? REG_W1 : REG_W0;
 		int rc_reg = BPF_OP(insn->code) == BPF_DIV ? REG_W1 : REG_W0;
 
 
@@ -602,10 +605,8 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i)
 		EMIT4_IMM(0xa7090000, REG_W0, 0);
 		EMIT4_IMM(0xa7090000, REG_W0, 0);
 		/* lgr %w1,%dst */
 		/* lgr %w1,%dst */
 		EMIT4(0xb9040000, REG_W1, dst_reg);
 		EMIT4(0xb9040000, REG_W1, dst_reg);
-		/* llgfr %dst,%src (u32 cast) */
-		EMIT4(0xb9160000, dst_reg, src_reg);
 		/* dlgr %w0,%dst */
 		/* dlgr %w0,%dst */
-		EMIT4(0xb9870000, REG_W0, dst_reg);
+		EMIT4(0xb9870000, REG_W0, src_reg);
 		/* lgr %dst,%rc */
 		/* lgr %dst,%rc */
 		EMIT4(0xb9040000, dst_reg, rc_reg);
 		EMIT4(0xb9040000, dst_reg, rc_reg);
 		break;
 		break;
@@ -632,8 +633,8 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i)
 		EMIT4(0xb9160000, dst_reg, rc_reg);
 		EMIT4(0xb9160000, dst_reg, rc_reg);
 		break;
 		break;
 	}
 	}
-	case BPF_ALU64 | BPF_DIV | BPF_K: /* dst = dst / (u32) imm */
-	case BPF_ALU64 | BPF_MOD | BPF_K: /* dst = dst % (u32) imm */
+	case BPF_ALU64 | BPF_DIV | BPF_K: /* dst = dst / imm */
+	case BPF_ALU64 | BPF_MOD | BPF_K: /* dst = dst % imm */
 	{
 	{
 		int rc_reg = BPF_OP(insn->code) == BPF_DIV ? REG_W1 : REG_W0;
 		int rc_reg = BPF_OP(insn->code) == BPF_DIV ? REG_W1 : REG_W0;
 
 
@@ -649,7 +650,7 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i)
 		EMIT4(0xb9040000, REG_W1, dst_reg);
 		EMIT4(0xb9040000, REG_W1, dst_reg);
 		/* dlg %w0,<d(imm)>(%l) */
 		/* dlg %w0,<d(imm)>(%l) */
 		EMIT6_DISP_LH(0xe3000000, 0x0087, REG_W0, REG_0, REG_L,
 		EMIT6_DISP_LH(0xe3000000, 0x0087, REG_W0, REG_0, REG_L,
-			      EMIT_CONST_U64((u32) imm));
+			      EMIT_CONST_U64(imm));
 		/* lgr %dst,%rc */
 		/* lgr %dst,%rc */
 		EMIT4(0xb9040000, dst_reg, rc_reg);
 		EMIT4(0xb9040000, dst_reg, rc_reg);
 		break;
 		break;

+ 0 - 2
arch/score/include/asm/cmpxchg.h

@@ -42,8 +42,6 @@ static inline unsigned long __cmpxchg(volatile unsigned long *m,
 					(unsigned long)(o),	\
 					(unsigned long)(o),	\
 					(unsigned long)(n)))
 					(unsigned long)(n)))
 
 
-#define __HAVE_ARCH_CMPXCHG	1
-
 #include <asm-generic/cmpxchg-local.h>
 #include <asm-generic/cmpxchg-local.h>
 
 
 #endif /* _ASM_SCORE_CMPXCHG_H */
 #endif /* _ASM_SCORE_CMPXCHG_H */

+ 1 - 1
arch/sh/include/asm/barrier.h

@@ -32,7 +32,7 @@
 #define ctrl_barrier()	__asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop")
 #define ctrl_barrier()	__asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop")
 #endif
 #endif
 
 
-#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
+#define smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0)
 
 
 #include <asm-generic/barrier.h>
 #include <asm-generic/barrier.h>
 
 

+ 0 - 2
arch/sh/include/asm/cmpxchg.h

@@ -46,8 +46,6 @@ extern void __xchg_called_with_bad_pointer(void);
  * if something tries to do an invalid cmpxchg(). */
  * if something tries to do an invalid cmpxchg(). */
 extern void __cmpxchg_called_with_bad_pointer(void);
 extern void __cmpxchg_called_with_bad_pointer(void);
 
 
-#define __HAVE_ARCH_CMPXCHG 1
-
 static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
 static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
 		unsigned long new, int size)
 		unsigned long new, int size)
 {
 {

+ 2 - 2
arch/sparc/include/asm/barrier_64.h

@@ -40,8 +40,8 @@ do {	__asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" \
 #define dma_rmb()	rmb()
 #define dma_rmb()	rmb()
 #define dma_wmb()	wmb()
 #define dma_wmb()	wmb()
 
 
-#define set_mb(__var, __value) \
-	do { __var = __value; membar_safe("#StoreLoad"); } while(0)
+#define smp_store_mb(__var, __value) \
+	do { WRITE_ONCE(__var, __value); membar_safe("#StoreLoad"); } while(0)
 
 
 #ifdef CONFIG_SMP
 #ifdef CONFIG_SMP
 #define smp_mb()	mb()
 #define smp_mb()	mb()

+ 0 - 1
arch/sparc/include/asm/cmpxchg_32.h

@@ -34,7 +34,6 @@ static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int
  *
  *
  * Cribbed from <asm-parisc/atomic.h>
  * Cribbed from <asm-parisc/atomic.h>
  */
  */
-#define __HAVE_ARCH_CMPXCHG	1
 
 
 /* bug catcher for when unsupported size is used - won't link */
 /* bug catcher for when unsupported size is used - won't link */
 void __cmpxchg_called_with_bad_pointer(void);
 void __cmpxchg_called_with_bad_pointer(void);

+ 0 - 2
arch/sparc/include/asm/cmpxchg_64.h

@@ -65,8 +65,6 @@ static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
 
 
 #include <asm-generic/cmpxchg-local.h>
 #include <asm-generic/cmpxchg-local.h>
 
 
-#define __HAVE_ARCH_CMPXCHG 1
-
 static inline unsigned long
 static inline unsigned long
 __cmpxchg_u32(volatile int *m, int old, int new)
 __cmpxchg_u32(volatile int *m, int old, int new)
 {
 {

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