소스 검색

Merge tag 'v4.18-rc6' into for-4.19/block2

Pull in 4.18-rc6 to get the NVMe core AEN change to avoid a
merge conflict down the line.

Signed-of-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe 7 년 전
부모
커밋
05b9ba4b55
100개의 변경된 파일770개의 추가작업 그리고 414개의 파일을 삭제
  1. 5 0
      Documentation/admin-guide/kernel-parameters.txt
  2. 2 0
      Documentation/device-mapper/writecache.txt
  3. 1 1
      Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt
  4. 1 1
      Documentation/devicetree/bindings/display/tilcdc/tilcdc.txt
  5. 1 1
      Documentation/devicetree/bindings/gpio/nintendo,hollywood-gpio.txt
  6. 1 1
      Documentation/devicetree/bindings/input/touchscreen/hideep.txt
  7. 1 1
      Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra20-ictlr.txt
  8. 1 1
      Documentation/devicetree/bindings/interrupt-controller/st,stm32-exti.txt
  9. 1 1
      Documentation/devicetree/bindings/mips/brcm/soc.txt
  10. 1 1
      Documentation/devicetree/bindings/net/fsl-fman.txt
  11. 1 1
      Documentation/devicetree/bindings/power/power_domain.txt
  12. 1 1
      Documentation/devicetree/bindings/regulator/tps65090.txt
  13. 1 1
      Documentation/devicetree/bindings/reset/st,sti-softreset.txt
  14. 1 1
      Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt
  15. 1 1
      Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt
  16. 1 1
      Documentation/devicetree/bindings/sound/qcom,apq8096.txt
  17. 1 1
      Documentation/devicetree/bindings/w1/w1-gpio.txt
  18. 7 10
      Documentation/kbuild/kbuild.txt
  19. 43 8
      Documentation/kbuild/kconfig.txt
  20. 1 1
      Documentation/networking/bonding.txt
  21. 17 10
      Documentation/networking/e100.rst
  22. 112 75
      Documentation/networking/e1000.rst
  23. 10 8
      MAINTAINERS
  24. 5 5
      Makefile
  25. 1 4
      arch/alpha/kernel/osf_sys.c
  26. 1 1
      arch/arc/Kconfig
  27. 1 14
      arch/arc/Makefile
  28. 0 1
      arch/arc/configs/axs101_defconfig
  29. 0 1
      arch/arc/configs/axs103_defconfig
  30. 0 1
      arch/arc/configs/axs103_smp_defconfig
  31. 0 1
      arch/arc/configs/haps_hs_defconfig
  32. 0 1
      arch/arc/configs/haps_hs_smp_defconfig
  33. 0 1
      arch/arc/configs/hsdk_defconfig
  34. 0 1
      arch/arc/configs/nsim_700_defconfig
  35. 0 1
      arch/arc/configs/nsim_hs_defconfig
  36. 0 1
      arch/arc/configs/nsim_hs_smp_defconfig
  37. 0 1
      arch/arc/configs/nsimosci_defconfig
  38. 0 1
      arch/arc/configs/nsimosci_hs_defconfig
  39. 0 1
      arch/arc/configs/nsimosci_hs_smp_defconfig
  40. 0 1
      arch/arc/configs/tb10x_defconfig
  41. 6 0
      arch/arc/include/asm/entry-compact.h
  42. 0 3
      arch/arc/include/asm/entry.h
  43. 0 2
      arch/arc/include/asm/mach_desc.h
  44. 1 1
      arch/arc/include/asm/page.h
  45. 1 1
      arch/arc/include/asm/pgtable.h
  46. 1 1
      arch/arc/kernel/irq.c
  47. 36 11
      arch/arc/kernel/process.c
  48. 3 0
      arch/arc/plat-hsdk/Kconfig
  49. 62 0
      arch/arc/plat-hsdk/platform.c
  50. 5 0
      arch/arm/boot/dts/am3517.dtsi
  51. 1 1
      arch/arm/boot/dts/armada-38x.dtsi
  52. 1 1
      arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
  53. 3 6
      arch/arm/boot/dts/omap4-droid4-xt894.dts
  54. 1 1
      arch/arm/kernel/head-nommu.S
  55. 41 0
      arch/arm/mach-omap2/omap-smp.c
  56. 2 2
      arch/arm/mach-pxa/irq.c
  57. 9 0
      arch/arm/mm/init.c
  58. 4 2
      arch/arm64/Makefile
  59. 7 12
      arch/arm64/include/asm/simd.h
  60. 2 4
      arch/ia64/kernel/perfmon.c
  61. 4 8
      arch/ia64/mm/init.c
  62. 29 14
      arch/mips/kernel/process.c
  63. 1 0
      arch/mips/kernel/traps.c
  64. 25 12
      arch/mips/mm/ioremap.c
  65. 6 6
      arch/nds32/Kconfig
  66. 2 0
      arch/nds32/Makefile
  67. 7 2
      arch/nds32/include/asm/cacheflush.h
  68. 1 1
      arch/nds32/include/asm/futex.h
  69. 2 1
      arch/nds32/kernel/setup.c
  70. 40 60
      arch/nds32/mm/cacheflush.c
  71. 1 0
      arch/powerpc/Makefile
  72. 2 2
      arch/powerpc/include/asm/mmu_context.h
  73. 2 0
      arch/powerpc/kernel/idle_book3s.S
  74. 1 1
      arch/powerpc/kvm/book3s_64_vio.c
  75. 4 2
      arch/powerpc/kvm/book3s_64_vio_hv.c
  76. 35 2
      arch/powerpc/mm/mmu_context_iommu.c
  77. 2 2
      arch/powerpc/xmon/xmon.c
  78. 1 1
      arch/x86/Kconfig
  79. 3 9
      arch/x86/boot/compressed/eboot.c
  80. 5 3
      arch/x86/events/intel/ds.c
  81. 0 6
      arch/x86/include/asm/apm.h
  82. 6 1
      arch/x86/include/asm/uaccess_64.h
  83. 5 0
      arch/x86/kernel/apm_32.c
  84. 0 3
      arch/x86/kernel/cpu/mcheck/mce.c
  85. 6 6
      arch/x86/kernel/kvmclock.c
  86. 1 1
      arch/x86/kvm/Kconfig
  87. 42 19
      arch/x86/kvm/vmx.c
  88. 3 1
      arch/x86/kvm/x86.c
  89. 1 1
      arch/x86/purgatory/Makefile
  90. 12 13
      arch/x86/xen/enlighten_pv.c
  91. 1 3
      arch/x86/xen/irq.c
  92. 0 2
      block/bsg.c
  93. 3 1
      crypto/af_alg.c
  94. 11 4
      drivers/acpi/acpica/hwsleep.c
  95. 1 1
      drivers/acpi/ec.c
  96. 37 11
      drivers/acpi/nfit/core.c
  97. 1 0
      drivers/acpi/nfit/nfit.h
  98. 0 2
      drivers/ata/Kconfig
  99. 60 0
      drivers/ata/ahci.c
  100. 1 1
      drivers/ata/ahci_mvebu.c

+ 5 - 0
Documentation/admin-guide/kernel-parameters.txt

@@ -4846,3 +4846,8 @@
 	xirc2ps_cs=	[NET,PCMCIA]
 	xirc2ps_cs=	[NET,PCMCIA]
 			Format:
 			Format:
 			<irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
 			<irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
+
+	xhci-hcd.quirks		[USB,KNL]
+			A hex value specifying bitmask with supplemental xhci
+			host controller quirks. Meaning of each bit can be
+			consulted in header drivers/usb/host/xhci.h.

+ 2 - 0
Documentation/device-mapper/writecache.txt

@@ -15,6 +15,8 @@ Constructor parameters:
    size)
    size)
 5. the number of optional parameters (the parameters with an argument
 5. the number of optional parameters (the parameters with an argument
    count as two)
    count as two)
+	start_sector n		(default: 0)
+		offset from the start of cache device in 512-byte sectors
 	high_watermark n	(default: 50)
 	high_watermark n	(default: 50)
 		start writeback when the number of used blocks reach this
 		start writeback when the number of used blocks reach this
 		watermark
 		watermark

+ 1 - 1
Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt

@@ -66,7 +66,7 @@ Required root node properties:
 	- "insignal,arndale-octa" - for Exynos5420-based Insignal Arndale
 	- "insignal,arndale-octa" - for Exynos5420-based Insignal Arndale
 				    Octa board.
 				    Octa board.
 	- "insignal,origen"       - for Exynos4210-based Insignal Origen board.
 	- "insignal,origen"       - for Exynos4210-based Insignal Origen board.
-	- "insignal,origen4412    - for Exynos4412-based Insignal Origen board.
+	- "insignal,origen4412"   - for Exynos4412-based Insignal Origen board.
 
 
 
 
 Optional nodes:
 Optional nodes:

+ 1 - 1
Documentation/devicetree/bindings/display/tilcdc/tilcdc.txt

@@ -36,7 +36,7 @@ Optional nodes:
 
 
  - port/ports: to describe a connection to an external encoder. The
  - port/ports: to describe a connection to an external encoder. The
    binding follows Documentation/devicetree/bindings/graph.txt and
    binding follows Documentation/devicetree/bindings/graph.txt and
-   suppors a single port with a single endpoint.
+   supports a single port with a single endpoint.
 
 
  - See also Documentation/devicetree/bindings/display/tilcdc/panel.txt and
  - See also Documentation/devicetree/bindings/display/tilcdc/panel.txt and
    Documentation/devicetree/bindings/display/tilcdc/tfp410.txt for connecting
    Documentation/devicetree/bindings/display/tilcdc/tfp410.txt for connecting

+ 1 - 1
Documentation/devicetree/bindings/gpio/nintendo,hollywood-gpio.txt

@@ -1,7 +1,7 @@
 Nintendo Wii (Hollywood) GPIO controller
 Nintendo Wii (Hollywood) GPIO controller
 
 
 Required properties:
 Required properties:
-- compatible: "nintendo,hollywood-gpio
+- compatible: "nintendo,hollywood-gpio"
 - reg: Physical base address and length of the controller's registers.
 - reg: Physical base address and length of the controller's registers.
 - gpio-controller: Marks the device node as a GPIO controller.
 - gpio-controller: Marks the device node as a GPIO controller.
 - #gpio-cells: Should be <2>. The first cell is the pin number and the
 - #gpio-cells: Should be <2>. The first cell is the pin number and the

+ 1 - 1
Documentation/devicetree/bindings/input/touchscreen/hideep.txt

@@ -32,7 +32,7 @@ i2c@00000000 {
 		reg = <0x6c>;
 		reg = <0x6c>;
 		interrupt-parent = <&gpx1>;
 		interrupt-parent = <&gpx1>;
 		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
 		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
-		vdd-supply = <&ldo15_reg>";
+		vdd-supply = <&ldo15_reg>;
 		vid-supply = <&ldo18_reg>;
 		vid-supply = <&ldo18_reg>;
 		reset-gpios = <&gpx1 5 0>;
 		reset-gpios = <&gpx1 5 0>;
 		touchscreen-size-x = <1080>;
 		touchscreen-size-x = <1080>;

+ 1 - 1
Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra20-ictlr.txt

@@ -15,7 +15,7 @@ Required properties:
   include "nvidia,tegra30-ictlr".	
   include "nvidia,tegra30-ictlr".	
 - reg : Specifies base physical address and size of the registers.
 - reg : Specifies base physical address and size of the registers.
   Each controller must be described separately (Tegra20 has 4 of them,
   Each controller must be described separately (Tegra20 has 4 of them,
-  whereas Tegra30 and later have 5"  
+  whereas Tegra30 and later have 5).
 - interrupt-controller : Identifies the node as an interrupt controller.
 - interrupt-controller : Identifies the node as an interrupt controller.
 - #interrupt-cells : Specifies the number of cells needed to encode an
 - #interrupt-cells : Specifies the number of cells needed to encode an
   interrupt source. The value must be 3.
   interrupt source. The value must be 3.

+ 1 - 1
Documentation/devicetree/bindings/interrupt-controller/st,stm32-exti.txt

@@ -12,7 +12,7 @@ Required properties:
   specifier, shall be 2
   specifier, shall be 2
 - interrupts: interrupts references to primary interrupt controller
 - interrupts: interrupts references to primary interrupt controller
   (only needed for exti controller with multiple exti under
   (only needed for exti controller with multiple exti under
-  same parent interrupt: st,stm32-exti and st,stm32h7-exti")
+  same parent interrupt: st,stm32-exti and st,stm32h7-exti)
 
 
 Example:
 Example:
 
 

+ 1 - 1
Documentation/devicetree/bindings/mips/brcm/soc.txt

@@ -152,7 +152,7 @@ Required properties:
 - compatible	: should contain one of:
 - compatible	: should contain one of:
 		  "brcm,bcm7425-timers"
 		  "brcm,bcm7425-timers"
 		  "brcm,bcm7429-timers"
 		  "brcm,bcm7429-timers"
-		  "brcm,bcm7435-timers and
+		  "brcm,bcm7435-timers" and
 		  "brcm,brcmstb-timers"
 		  "brcm,brcmstb-timers"
 - reg		: the timers register range
 - reg		: the timers register range
 - interrupts	: the interrupt line for this timer block
 - interrupts	: the interrupt line for this timer block

+ 1 - 1
Documentation/devicetree/bindings/net/fsl-fman.txt

@@ -238,7 +238,7 @@ PROPERTIES
 		Must include one of the following:
 		Must include one of the following:
 		- "fsl,fman-dtsec" for dTSEC MAC
 		- "fsl,fman-dtsec" for dTSEC MAC
 		- "fsl,fman-xgec" for XGEC MAC
 		- "fsl,fman-xgec" for XGEC MAC
-		- "fsl,fman-memac for mEMAC MAC
+		- "fsl,fman-memac" for mEMAC MAC
 
 
 - cell-index
 - cell-index
 		Usage: required
 		Usage: required

+ 1 - 1
Documentation/devicetree/bindings/power/power_domain.txt

@@ -133,7 +133,7 @@ located inside a PM domain with index 0 of a power controller represented by a
 node with the label "power".
 node with the label "power".
 In the second example the consumer device are partitioned across two PM domains,
 In the second example the consumer device are partitioned across two PM domains,
 the first with index 0 and the second with index 1, of a power controller that
 the first with index 0 and the second with index 1, of a power controller that
-is represented by a node with the label "power.
+is represented by a node with the label "power".
 
 
 Optional properties:
 Optional properties:
 - required-opps: This contains phandle to an OPP node in another device's OPP
 - required-opps: This contains phandle to an OPP node in another device's OPP

+ 1 - 1
Documentation/devicetree/bindings/regulator/tps65090.txt

@@ -16,7 +16,7 @@ Required properties:
 Optional properties:
 Optional properties:
 - ti,enable-ext-control: This is applicable for DCDC1, DCDC2 and DCDC3.
 - ti,enable-ext-control: This is applicable for DCDC1, DCDC2 and DCDC3.
   If DCDCs are externally controlled then this property should be there.
   If DCDCs are externally controlled then this property should be there.
-- "dcdc-ext-control-gpios: This is applicable for DCDC1, DCDC2 and DCDC3.
+- dcdc-ext-control-gpios: This is applicable for DCDC1, DCDC2 and DCDC3.
   If DCDCs are externally controlled and if it is from GPIO then GPIO
   If DCDCs are externally controlled and if it is from GPIO then GPIO
   number should be provided. If it is externally controlled and no GPIO
   number should be provided. If it is externally controlled and no GPIO
   entry then driver will just configure this rails as external control
   entry then driver will just configure this rails as external control

+ 1 - 1
Documentation/devicetree/bindings/reset/st,sti-softreset.txt

@@ -15,7 +15,7 @@ Please refer to reset.txt in this directory for common reset
 controller binding usage.
 controller binding usage.
 
 
 Required properties:
 Required properties:
-- compatible: Should be st,stih407-softreset";
+- compatible: Should be "st,stih407-softreset";
 - #reset-cells: 1, see below
 - #reset-cells: 1, see below
 
 
 example:
 example:

+ 1 - 1
Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt

@@ -39,7 +39,7 @@ Required properties:
 
 
 Optional property:
 Optional property:
 - clock-frequency:	Desired I2C bus clock frequency in Hz.
 - clock-frequency:	Desired I2C bus clock frequency in Hz.
-			When missing default to 400000Hz.
+			When missing default to 100000Hz.
 
 
 Child nodes should conform to I2C bus binding as described in i2c.txt.
 Child nodes should conform to I2C bus binding as described in i2c.txt.
 
 

+ 1 - 1
Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt

@@ -30,7 +30,7 @@ Required properties:
 
 
 			  Board connectors:
 			  Board connectors:
 			  * Headset Mic
 			  * Headset Mic
-			  * Secondary Mic",
+			  * Secondary Mic
 			  * DMIC
 			  * DMIC
 			  * Ext Spk
 			  * Ext Spk
 
 

+ 1 - 1
Documentation/devicetree/bindings/sound/qcom,apq8096.txt

@@ -35,7 +35,7 @@ This binding describes the APQ8096 sound card, which uses qdsp for audio.
 			"Digital Mic3"
 			"Digital Mic3"
 
 
 		Audio pins and MicBias on WCD9335 Codec:
 		Audio pins and MicBias on WCD9335 Codec:
-			"MIC_BIAS1
+			"MIC_BIAS1"
 			"MIC_BIAS2"
 			"MIC_BIAS2"
 			"MIC_BIAS3"
 			"MIC_BIAS3"
 			"MIC_BIAS4"
 			"MIC_BIAS4"

+ 1 - 1
Documentation/devicetree/bindings/w1/w1-gpio.txt

@@ -15,7 +15,7 @@ Optional properties:
 
 
 Examples:
 Examples:
 
 
-	onewire@0 {
+	onewire {
 		compatible = "w1-gpio";
 		compatible = "w1-gpio";
 		gpios = <&gpio 126 0>, <&gpio 105 0>;
 		gpios = <&gpio 126 0>, <&gpio 105 0>;
 	};
 	};

+ 7 - 10
Documentation/kbuild/kbuild.txt

@@ -50,6 +50,11 @@ LDFLAGS_MODULE
 --------------------------------------------------
 --------------------------------------------------
 Additional options used for $(LD) when linking modules.
 Additional options used for $(LD) when linking modules.
 
 
+KBUILD_KCONFIG
+--------------------------------------------------
+Set the top-level Kconfig file to the value of this environment
+variable.  The default name is "Kconfig".
+
 KBUILD_VERBOSE
 KBUILD_VERBOSE
 --------------------------------------------------
 --------------------------------------------------
 Set the kbuild verbosity. Can be assigned same values as "V=...".
 Set the kbuild verbosity. Can be assigned same values as "V=...".
@@ -88,7 +93,8 @@ In most cases the name of the architecture is the same as the
 directory name found in the arch/ directory.
 directory name found in the arch/ directory.
 But some architectures such as x86 and sparc have aliases.
 But some architectures such as x86 and sparc have aliases.
 x86: i386 for 32 bit, x86_64 for 64 bit
 x86: i386 for 32 bit, x86_64 for 64 bit
-sparc: sparc for 32 bit, sparc64 for 64 bit
+sh: sh for 32 bit, sh64 for 64 bit
+sparc: sparc32 for 32 bit, sparc64 for 64 bit
 
 
 CROSS_COMPILE
 CROSS_COMPILE
 --------------------------------------------------
 --------------------------------------------------
@@ -148,15 +154,6 @@ stripped after they are installed.  If INSTALL_MOD_STRIP is '1', then
 the default option --strip-debug will be used.  Otherwise,
 the default option --strip-debug will be used.  Otherwise,
 INSTALL_MOD_STRIP value will be used as the options to the strip command.
 INSTALL_MOD_STRIP value will be used as the options to the strip command.
 
 
-INSTALL_FW_PATH
---------------------------------------------------
-INSTALL_FW_PATH specifies where to install the firmware blobs.
-The default value is:
-
-    $(INSTALL_MOD_PATH)/lib/firmware
-
-The value can be overridden in which case the default value is ignored.
-
 INSTALL_HDR_PATH
 INSTALL_HDR_PATH
 --------------------------------------------------
 --------------------------------------------------
 INSTALL_HDR_PATH specifies where to install user space headers when
 INSTALL_HDR_PATH specifies where to install user space headers when

+ 43 - 8
Documentation/kbuild/kconfig.txt

@@ -2,9 +2,9 @@ This file contains some assistance for using "make *config".
 
 
 Use "make help" to list all of the possible configuration targets.
 Use "make help" to list all of the possible configuration targets.
 
 
-The xconfig ('qconf') and menuconfig ('mconf') programs also
-have embedded help text.  Be sure to check it for navigation,
-search, and other general help text.
+The xconfig ('qconf'), menuconfig ('mconf'), and nconfig ('nconf')
+programs also have embedded help text.  Be sure to check that for
+navigation, search, and other general help text.
 
 
 ======================================================================
 ======================================================================
 General
 General
@@ -17,13 +17,16 @@ this happens, using a previously working .config file and running
 for you, so you may find that you need to see what NEW kernel
 for you, so you may find that you need to see what NEW kernel
 symbols have been introduced.
 symbols have been introduced.
 
 
-To see a list of new config symbols when using "make oldconfig", use
+To see a list of new config symbols, use
 
 
 	cp user/some/old.config .config
 	cp user/some/old.config .config
 	make listnewconfig
 	make listnewconfig
 
 
 and the config program will list any new symbols, one per line.
 and the config program will list any new symbols, one per line.
 
 
+Alternatively, you can use the brute force method:
+
+	make oldconfig
 	scripts/diffconfig .config.old .config | less
 	scripts/diffconfig .config.old .config | less
 
 
 ______________________________________________________________________
 ______________________________________________________________________
@@ -160,7 +163,7 @@ Searching in menuconfig:
 		This lists all config symbols that contain "hotplug",
 		This lists all config symbols that contain "hotplug",
 		e.g., HOTPLUG_CPU, MEMORY_HOTPLUG.
 		e.g., HOTPLUG_CPU, MEMORY_HOTPLUG.
 
 
-	For search help, enter / followed TAB-TAB-TAB (to highlight
+	For search help, enter / followed by TAB-TAB (to highlight
 	<Help>) and Enter.  This will tell you that you can also use
 	<Help>) and Enter.  This will tell you that you can also use
 	regular expressions (regexes) in the search string, so if you
 	regular expressions (regexes) in the search string, so if you
 	are not interested in MEMORY_HOTPLUG, you could try
 	are not interested in MEMORY_HOTPLUG, you could try
@@ -202,6 +205,39 @@ Example:
 	make MENUCONFIG_MODE=single_menu menuconfig
 	make MENUCONFIG_MODE=single_menu menuconfig
 
 
 
 
+======================================================================
+nconfig
+--------------------------------------------------
+
+nconfig is an alternate text-based configurator.  It lists function
+keys across the bottom of the terminal (window) that execute commands.
+You can also just use the corresponding numeric key to execute the
+commands unless you are in a data entry window.  E.g., instead of F6
+for Save, you can just press 6.
+
+Use F1 for Global help or F3 for the Short help menu.
+
+Searching in nconfig:
+
+	You can search either in the menu entry "prompt" strings
+	or in the configuration symbols.
+
+	Use / to begin a search through the menu entries.  This does
+	not support regular expressions.  Use <Down> or <Up> for
+	Next hit and Previous hit, respectively.  Use <Esc> to
+	terminate the search mode.
+
+	F8 (SymSearch) searches the configuration symbols for the
+	given string or regular expression (regex).
+
+NCONFIG_MODE
+--------------------------------------------------
+This mode shows all sub-menus in one large tree.
+
+Example:
+	make NCONFIG_MODE=single_menu nconfig
+
+
 ======================================================================
 ======================================================================
 xconfig
 xconfig
 --------------------------------------------------
 --------------------------------------------------
@@ -230,8 +266,7 @@ gconfig
 
 
 Searching in gconfig:
 Searching in gconfig:
 
 
-	None (gconfig isn't maintained as well as xconfig or menuconfig);
-	however, gconfig does have a few more viewing choices than
-	xconfig does.
+	There is no search command in gconfig.  However, gconfig does
+	have several different viewing choices, modes, and options.
 
 
 ###
 ###

+ 1 - 1
Documentation/networking/bonding.txt

@@ -1490,7 +1490,7 @@ To remove an ARP target:
 
 
 To configure the interval between learning packet transmits:
 To configure the interval between learning packet transmits:
 # echo 12 > /sys/class/net/bond0/bonding/lp_interval
 # echo 12 > /sys/class/net/bond0/bonding/lp_interval
-	NOTE: the lp_inteval is the number of seconds between instances where
+	NOTE: the lp_interval is the number of seconds between instances where
 the bonding driver sends learning packets to each slaves peer switch.  The
 the bonding driver sends learning packets to each slaves peer switch.  The
 default interval is 1 second.
 default interval is 1 second.
 
 

+ 17 - 10
Documentation/networking/e100.rst

@@ -47,41 +47,45 @@ Driver Configuration Parameters
 The default value for each parameter is generally the recommended setting,
 The default value for each parameter is generally the recommended setting,
 unless otherwise noted.
 unless otherwise noted.
 
 
-Rx Descriptors: Number of receive descriptors. A receive descriptor is a data
+Rx Descriptors:
+   Number of receive descriptors. A receive descriptor is a data
    structure that describes a receive buffer and its attributes to the network
    structure that describes a receive buffer and its attributes to the network
    controller. The data in the descriptor is used by the controller to write
    controller. The data in the descriptor is used by the controller to write
    data from the controller to host memory. In the 3.x.x driver the valid range
    data from the controller to host memory. In the 3.x.x driver the valid range
    for this parameter is 64-256. The default value is 256. This parameter can be
    for this parameter is 64-256. The default value is 256. This parameter can be
    changed using the command::
    changed using the command::
 
 
-   ethtool -G eth? rx n
+     ethtool -G eth? rx n
 
 
    Where n is the number of desired Rx descriptors.
    Where n is the number of desired Rx descriptors.
 
 
-Tx Descriptors: Number of transmit descriptors. A transmit descriptor is a data
+Tx Descriptors:
+   Number of transmit descriptors. A transmit descriptor is a data
    structure that describes a transmit buffer and its attributes to the network
    structure that describes a transmit buffer and its attributes to the network
    controller. The data in the descriptor is used by the controller to read
    controller. The data in the descriptor is used by the controller to read
    data from the host memory to the controller. In the 3.x.x driver the valid
    data from the host memory to the controller. In the 3.x.x driver the valid
    range for this parameter is 64-256. The default value is 128. This parameter
    range for this parameter is 64-256. The default value is 128. This parameter
    can be changed using the command::
    can be changed using the command::
 
 
-   ethtool -G eth? tx n
+     ethtool -G eth? tx n
 
 
    Where n is the number of desired Tx descriptors.
    Where n is the number of desired Tx descriptors.
 
 
-Speed/Duplex: The driver auto-negotiates the link speed and duplex settings by
+Speed/Duplex:
+   The driver auto-negotiates the link speed and duplex settings by
    default. The ethtool utility can be used as follows to force speed/duplex.::
    default. The ethtool utility can be used as follows to force speed/duplex.::
 
 
-   ethtool -s eth?  autoneg off speed {10|100} duplex {full|half}
+     ethtool -s eth?  autoneg off speed {10|100} duplex {full|half}
 
 
    NOTE: setting the speed/duplex to incorrect values will cause the link to
    NOTE: setting the speed/duplex to incorrect values will cause the link to
    fail.
    fail.
 
 
-Event Log Message Level:  The driver uses the message level flag to log events
+Event Log Message Level:
+   The driver uses the message level flag to log events
    to syslog. The message level can be set at driver load time. It can also be
    to syslog. The message level can be set at driver load time. It can also be
    set using the command::
    set using the command::
 
 
-   ethtool -s eth? msglvl n
+     ethtool -s eth? msglvl n
 
 
 
 
 Additional Configurations
 Additional Configurations
@@ -92,7 +96,7 @@ Configuring the Driver on Different Distributions
 
 
 Configuring a network driver to load properly when the system is started
 Configuring a network driver to load properly when the system is started
 is distribution dependent.  Typically, the configuration process involves
 is distribution dependent.  Typically, the configuration process involves
-adding an alias line to /etc/modprobe.d/*.conf as well as editing other
+adding an alias line to `/etc/modprobe.d/*.conf` as well as editing other
 system startup scripts and/or configuration files.  Many popular Linux
 system startup scripts and/or configuration files.  Many popular Linux
 distributions ship with tools to make these changes for you.  To learn
 distributions ship with tools to make these changes for you.  To learn
 the proper way to configure a network device for your system, refer to
 the proper way to configure a network device for your system, refer to
@@ -160,7 +164,10 @@ This results in unbalanced receive traffic.
 If you have multiple interfaces in a server, either turn on ARP
 If you have multiple interfaces in a server, either turn on ARP
 filtering by
 filtering by
 
 
-(1) entering:: echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
+(1) entering::
+
+	echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
+
     (this only works if your kernel's version is higher than 2.4.5), or
     (this only works if your kernel's version is higher than 2.4.5), or
 
 
 (2) installing the interfaces in separate broadcast domains (either
 (2) installing the interfaces in separate broadcast domains (either

+ 112 - 75
Documentation/networking/e1000.rst

@@ -34,7 +34,8 @@ Command Line Parameters
 The default value for each parameter is generally the recommended setting,
 The default value for each parameter is generally the recommended setting,
 unless otherwise noted.
 unless otherwise noted.
 
 
-NOTES:  For more information about the AutoNeg, Duplex, and Speed
+NOTES:
+	For more information about the AutoNeg, Duplex, and Speed
         parameters, see the "Speed and Duplex Configuration" section in
         parameters, see the "Speed and Duplex Configuration" section in
         this document.
         this document.
 
 
@@ -45,22 +46,27 @@ NOTES:  For more information about the AutoNeg, Duplex, and Speed
 
 
 AutoNeg
 AutoNeg
 -------
 -------
+
 (Supported only on adapters with copper connections)
 (Supported only on adapters with copper connections)
-Valid Range:   0x01-0x0F, 0x20-0x2F
-Default Value: 0x2F
+
+:Valid Range:   0x01-0x0F, 0x20-0x2F
+:Default Value: 0x2F
 
 
 This parameter is a bit-mask that specifies the speed and duplex settings
 This parameter is a bit-mask that specifies the speed and duplex settings
 advertised by the adapter.  When this parameter is used, the Speed and
 advertised by the adapter.  When this parameter is used, the Speed and
 Duplex parameters must not be specified.
 Duplex parameters must not be specified.
 
 
-NOTE:  Refer to the Speed and Duplex section of this readme for more
+NOTE:
+       Refer to the Speed and Duplex section of this readme for more
        information on the AutoNeg parameter.
        information on the AutoNeg parameter.
 
 
 Duplex
 Duplex
 ------
 ------
+
 (Supported only on adapters with copper connections)
 (Supported only on adapters with copper connections)
-Valid Range:   0-2 (0=auto-negotiate, 1=half, 2=full)
-Default Value: 0
+
+:Valid Range:   0-2 (0=auto-negotiate, 1=half, 2=full)
+:Default Value: 0
 
 
 This defines the direction in which data is allowed to flow.  Can be
 This defines the direction in which data is allowed to flow.  Can be
 either one or two-directional.  If both Duplex and the link partner are
 either one or two-directional.  If both Duplex and the link partner are
@@ -70,18 +76,22 @@ duplex.
 
 
 FlowControl
 FlowControl
 -----------
 -----------
-Valid Range:   0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx)
-Default Value: Reads flow control settings from the EEPROM
+
+:Valid Range:   0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx)
+:Default Value: Reads flow control settings from the EEPROM
 
 
 This parameter controls the automatic generation(Tx) and response(Rx)
 This parameter controls the automatic generation(Tx) and response(Rx)
 to Ethernet PAUSE frames.
 to Ethernet PAUSE frames.
 
 
 InterruptThrottleRate
 InterruptThrottleRate
 ---------------------
 ---------------------
+
 (not supported on Intel(R) 82542, 82543 or 82544-based adapters)
 (not supported on Intel(R) 82542, 82543 or 82544-based adapters)
-Valid Range:   0,1,3,4,100-100000 (0=off, 1=dynamic, 3=dynamic conservative,
-                                 4=simplified balancing)
-Default Value: 3
+
+:Valid Range:
+   0,1,3,4,100-100000 (0=off, 1=dynamic, 3=dynamic conservative,
+   4=simplified balancing)
+:Default Value: 3
 
 
 The driver can limit the amount of interrupts per second that the adapter
 The driver can limit the amount of interrupts per second that the adapter
 will generate for incoming packets. It does this by writing a value to the
 will generate for incoming packets. It does this by writing a value to the
@@ -135,13 +145,15 @@ Setting InterruptThrottleRate to 0 turns off any interrupt moderation
 and may improve small packet latency, but is generally not suitable
 and may improve small packet latency, but is generally not suitable
 for bulk throughput traffic.
 for bulk throughput traffic.
 
 
-NOTE:  InterruptThrottleRate takes precedence over the TxAbsIntDelay and
+NOTE:
+       InterruptThrottleRate takes precedence over the TxAbsIntDelay and
        RxAbsIntDelay parameters.  In other words, minimizing the receive
        RxAbsIntDelay parameters.  In other words, minimizing the receive
        and/or transmit absolute delays does not force the controller to
        and/or transmit absolute delays does not force the controller to
        generate more interrupts than what the Interrupt Throttle Rate
        generate more interrupts than what the Interrupt Throttle Rate
        allows.
        allows.
 
 
-CAUTION:  If you are using the Intel(R) PRO/1000 CT Network Connection
+CAUTION:
+          If you are using the Intel(R) PRO/1000 CT Network Connection
           (controller 82547), setting InterruptThrottleRate to a value
           (controller 82547), setting InterruptThrottleRate to a value
           greater than 75,000, may hang (stop transmitting) adapters
           greater than 75,000, may hang (stop transmitting) adapters
           under certain network conditions.  If this occurs a NETDEV
           under certain network conditions.  If this occurs a NETDEV
@@ -151,7 +163,8 @@ CAUTION:  If you are using the Intel(R) PRO/1000 CT Network Connection
           hang, ensure that InterruptThrottleRate is set no greater
           hang, ensure that InterruptThrottleRate is set no greater
           than 75,000 and is not set to 0.
           than 75,000 and is not set to 0.
 
 
-NOTE:  When e1000 is loaded with default settings and multiple adapters
+NOTE:
+       When e1000 is loaded with default settings and multiple adapters
        are in use simultaneously, the CPU utilization may increase non-
        are in use simultaneously, the CPU utilization may increase non-
        linearly.  In order to limit the CPU utilization without impacting
        linearly.  In order to limit the CPU utilization without impacting
        the overall throughput, we recommend that you load the driver as
        the overall throughput, we recommend that you load the driver as
@@ -168,9 +181,11 @@ NOTE:  When e1000 is loaded with default settings and multiple adapters
 
 
 RxDescriptors
 RxDescriptors
 -------------
 -------------
-Valid Range:   48-256 for 82542 and 82543-based adapters
-               48-4096 for all other supported adapters
-Default Value: 256
+
+:Valid Range:
+ - 48-256 for 82542 and 82543-based adapters
+ - 48-4096 for all other supported adapters
+:Default Value: 256
 
 
 This value specifies the number of receive buffer descriptors allocated
 This value specifies the number of receive buffer descriptors allocated
 by the driver.  Increasing this value allows the driver to buffer more
 by the driver.  Increasing this value allows the driver to buffer more
@@ -180,15 +195,17 @@ Each descriptor is 16 bytes.  A receive buffer is also allocated for each
 descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending
 descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending
 on the MTU setting. The maximum MTU size is 16110.
 on the MTU setting. The maximum MTU size is 16110.
 
 
-NOTE:  MTU designates the frame size.  It only needs to be set for Jumbo
+NOTE:
+       MTU designates the frame size.  It only needs to be set for Jumbo
        Frames.  Depending on the available system resources, the request
        Frames.  Depending on the available system resources, the request
        for a higher number of receive descriptors may be denied.  In this
        for a higher number of receive descriptors may be denied.  In this
        case, use a lower number.
        case, use a lower number.
 
 
 RxIntDelay
 RxIntDelay
 ----------
 ----------
-Valid Range:   0-65535 (0=off)
-Default Value: 0
+
+:Valid Range:   0-65535 (0=off)
+:Default Value: 0
 
 
 This value delays the generation of receive interrupts in units of 1.024
 This value delays the generation of receive interrupts in units of 1.024
 microseconds.  Receive interrupt reduction can improve CPU efficiency if
 microseconds.  Receive interrupt reduction can improve CPU efficiency if
@@ -198,7 +215,8 @@ of TCP traffic.  If the system is reporting dropped receives, this value
 may be set too high, causing the driver to run out of available receive
 may be set too high, causing the driver to run out of available receive
 descriptors.
 descriptors.
 
 
-CAUTION:  When setting RxIntDelay to a value other than 0, adapters may
+CAUTION:
+          When setting RxIntDelay to a value other than 0, adapters may
           hang (stop transmitting) under certain network conditions.  If
           hang (stop transmitting) under certain network conditions.  If
           this occurs a NETDEV WATCHDOG message is logged in the system
           this occurs a NETDEV WATCHDOG message is logged in the system
           event log.  In addition, the controller is automatically reset,
           event log.  In addition, the controller is automatically reset,
@@ -207,9 +225,11 @@ CAUTION:  When setting RxIntDelay to a value other than 0, adapters may
 
 
 RxAbsIntDelay
 RxAbsIntDelay
 -------------
 -------------
+
 (This parameter is supported only on 82540, 82545 and later adapters.)
 (This parameter is supported only on 82540, 82545 and later adapters.)
-Valid Range:   0-65535 (0=off)
-Default Value: 128
+
+:Valid Range:   0-65535 (0=off)
+:Default Value: 128
 
 
 This value, in units of 1.024 microseconds, limits the delay in which a
 This value, in units of 1.024 microseconds, limits the delay in which a
 receive interrupt is generated.  Useful only if RxIntDelay is non-zero,
 receive interrupt is generated.  Useful only if RxIntDelay is non-zero,
@@ -220,9 +240,11 @@ conditions.
 
 
 Speed
 Speed
 -----
 -----
+
 (This parameter is supported only on adapters with copper connections.)
 (This parameter is supported only on adapters with copper connections.)
-Valid Settings: 0, 10, 100, 1000
-Default Value:  0 (auto-negotiate at all supported speeds)
+
+:Valid Settings: 0, 10, 100, 1000
+:Default Value:  0 (auto-negotiate at all supported speeds)
 
 
 Speed forces the line speed to the specified value in megabits per second
 Speed forces the line speed to the specified value in megabits per second
 (Mbps).  If this parameter is not specified or is set to 0 and the link
 (Mbps).  If this parameter is not specified or is set to 0 and the link
@@ -231,22 +253,26 @@ speed.  Duplex should also be set when Speed is set to either 10 or 100.
 
 
 TxDescriptors
 TxDescriptors
 -------------
 -------------
-Valid Range:   48-256 for 82542 and 82543-based adapters
-               48-4096 for all other supported adapters
-Default Value: 256
+
+:Valid Range:
+  - 48-256 for 82542 and 82543-based adapters
+  - 48-4096 for all other supported adapters
+:Default Value: 256
 
 
 This value is the number of transmit descriptors allocated by the driver.
 This value is the number of transmit descriptors allocated by the driver.
 Increasing this value allows the driver to queue more transmits.  Each
 Increasing this value allows the driver to queue more transmits.  Each
 descriptor is 16 bytes.
 descriptor is 16 bytes.
 
 
-NOTE:  Depending on the available system resources, the request for a
+NOTE:
+       Depending on the available system resources, the request for a
        higher number of transmit descriptors may be denied.  In this case,
        higher number of transmit descriptors may be denied.  In this case,
        use a lower number.
        use a lower number.
 
 
 TxIntDelay
 TxIntDelay
 ----------
 ----------
-Valid Range:   0-65535 (0=off)
-Default Value: 8
+
+:Valid Range:   0-65535 (0=off)
+:Default Value: 8
 
 
 This value delays the generation of transmit interrupts in units of
 This value delays the generation of transmit interrupts in units of
 1.024 microseconds.  Transmit interrupt reduction can improve CPU
 1.024 microseconds.  Transmit interrupt reduction can improve CPU
@@ -256,9 +282,11 @@ causing the driver to run out of available transmit descriptors.
 
 
 TxAbsIntDelay
 TxAbsIntDelay
 -------------
 -------------
+
 (This parameter is supported only on 82540, 82545 and later adapters.)
 (This parameter is supported only on 82540, 82545 and later adapters.)
-Valid Range:   0-65535 (0=off)
-Default Value: 32
+
+:Valid Range:   0-65535 (0=off)
+:Default Value: 32
 
 
 This value, in units of 1.024 microseconds, limits the delay in which a
 This value, in units of 1.024 microseconds, limits the delay in which a
 transmit interrupt is generated.  Useful only if TxIntDelay is non-zero,
 transmit interrupt is generated.  Useful only if TxIntDelay is non-zero,
@@ -269,18 +297,21 @@ network conditions.
 
 
 XsumRX
 XsumRX
 ------
 ------
+
 (This parameter is NOT supported on the 82542-based adapter.)
 (This parameter is NOT supported on the 82542-based adapter.)
-Valid Range:   0-1
-Default Value: 1
+
+:Valid Range:   0-1
+:Default Value: 1
 
 
 A value of '1' indicates that the driver should enable IP checksum
 A value of '1' indicates that the driver should enable IP checksum
 offload for received packets (both UDP and TCP) to the adapter hardware.
 offload for received packets (both UDP and TCP) to the adapter hardware.
 
 
 Copybreak
 Copybreak
 ---------
 ---------
-Valid Range:   0-xxxxxxx (0=off)
-Default Value: 256
-Usage: modprobe e1000.ko copybreak=128
+
+:Valid Range:   0-xxxxxxx (0=off)
+:Default Value: 256
+:Usage: modprobe e1000.ko copybreak=128
 
 
 Driver copies all packets below or equaling this size to a fresh RX
 Driver copies all packets below or equaling this size to a fresh RX
 buffer before handing it up the stack.
 buffer before handing it up the stack.
@@ -292,8 +323,9 @@ it is also available during runtime at
 
 
 SmartPowerDownEnable
 SmartPowerDownEnable
 --------------------
 --------------------
-Valid Range: 0-1
-Default Value:  0 (disabled)
+
+:Valid Range: 0-1
+:Default Value:  0 (disabled)
 
 
 Allows PHY to turn off in lower power states. The user can turn off
 Allows PHY to turn off in lower power states. The user can turn off
 this parameter in supported chipsets.
 this parameter in supported chipsets.
@@ -309,14 +341,14 @@ fiber interface board only links at 1000 Mbps full-duplex.
 
 
 For copper-based boards, the keywords interact as follows:
 For copper-based boards, the keywords interact as follows:
 
 
-  The default operation is auto-negotiate.  The board advertises all
+- The default operation is auto-negotiate.  The board advertises all
   supported speed and duplex combinations, and it links at the highest
   supported speed and duplex combinations, and it links at the highest
   common speed and duplex mode IF the link partner is set to auto-negotiate.
   common speed and duplex mode IF the link partner is set to auto-negotiate.
 
 
-  If Speed = 1000, limited auto-negotiation is enabled and only 1000 Mbps
+- If Speed = 1000, limited auto-negotiation is enabled and only 1000 Mbps
   is advertised (The 1000BaseT spec requires auto-negotiation.)
   is advertised (The 1000BaseT spec requires auto-negotiation.)
 
 
-  If Speed = 10 or 100, then both Speed and Duplex should be set.  Auto-
+- If Speed = 10 or 100, then both Speed and Duplex should be set.  Auto-
   negotiation is disabled, and the AutoNeg parameter is ignored.  Partner
   negotiation is disabled, and the AutoNeg parameter is ignored.  Partner
   SHOULD also be forced.
   SHOULD also be forced.
 
 
@@ -328,13 +360,15 @@ process.
 The parameter may be specified as either a decimal or hexadecimal value as
 The parameter may be specified as either a decimal or hexadecimal value as
 determined by the bitmap below.
 determined by the bitmap below.
 
 
+============== ====== ====== ======= ======= ====== ====== ======= ======
 Bit position   7      6      5       4       3      2      1       0
 Bit position   7      6      5       4       3      2      1       0
 Decimal Value  128    64     32      16      8      4      2       1
 Decimal Value  128    64     32      16      8      4      2       1
 Hex value      80     40     20      10      8      4      2       1
 Hex value      80     40     20      10      8      4      2       1
 Speed (Mbps)   N/A    N/A    1000    N/A     100    100    10      10
 Speed (Mbps)   N/A    N/A    1000    N/A     100    100    10      10
 Duplex                       Full            Full   Half   Full    Half
 Duplex                       Full            Full   Half   Full    Half
+============== ====== ====== ======= ======= ====== ====== ======= ======
 
 
-Some examples of using AutoNeg:
+Some examples of using AutoNeg::
 
 
   modprobe e1000 AutoNeg=0x01 (Restricts autonegotiation to 10 Half)
   modprobe e1000 AutoNeg=0x01 (Restricts autonegotiation to 10 Half)
   modprobe e1000 AutoNeg=1 (Same as above)
   modprobe e1000 AutoNeg=1 (Same as above)
@@ -357,56 +391,59 @@ Additional Configurations
 
 
 Jumbo Frames
 Jumbo Frames
 ------------
 ------------
-Jumbo Frames support is enabled by changing the MTU to a value larger
-than the default of 1500.  Use the ifconfig command to increase the MTU
-size.  For example::
+
+  Jumbo Frames support is enabled by changing the MTU to a value larger than
+  the default of 1500.  Use the ifconfig command to increase the MTU size.
+  For example::
 
 
        ifconfig eth<x> mtu 9000 up
        ifconfig eth<x> mtu 9000 up
 
 
-This setting is not saved across reboots.  It can be made permanent if
-you add::
+  This setting is not saved across reboots.  It can be made permanent if
+  you add::
 
 
        MTU=9000
        MTU=9000
 
 
-to the file /etc/sysconfig/network-scripts/ifcfg-eth<x>.  This example
-applies to the Red Hat distributions; other distributions may store this
-setting in a different location.
+  to the file /etc/sysconfig/network-scripts/ifcfg-eth<x>.  This example
+  applies to the Red Hat distributions; other distributions may store this
+  setting in a different location.
+
+Notes:
+  Degradation in throughput performance may be observed in some Jumbo frames
+  environments. If this is observed, increasing the application's socket buffer
+  size and/or increasing the /proc/sys/net/ipv4/tcp_*mem entry values may help.
+  See the specific application manual and /usr/src/linux*/Documentation/
+  networking/ip-sysctl.txt for more details.
 
 
-Notes: Degradation in throughput performance may be observed in some
-Jumbo frames environments.  If this is observed, increasing the
-application's socket buffer size and/or increasing the
-/proc/sys/net/ipv4/tcp_*mem entry values may help.  See the specific
-application manual and /usr/src/linux*/Documentation/
-networking/ip-sysctl.txt for more details.
+  - The maximum MTU setting for Jumbo Frames is 16110.  This value coincides
+    with the maximum Jumbo Frames size of 16128.
 
 
-- The maximum MTU setting for Jumbo Frames is 16110.  This value
-  coincides with the maximum Jumbo Frames size of 16128.
+  - Using Jumbo frames at 10 or 100 Mbps is not supported and may result in
+    poor performance or loss of link.
 
 
-- Using Jumbo frames at 10 or 100 Mbps is not supported and may result
-  in poor performance or loss of link.
+  - Adapters based on the Intel(R) 82542 and 82573V/E controller do not
+    support Jumbo Frames. These correspond to the following product names::
 
 
-- Adapters based on the Intel(R) 82542 and 82573V/E controller do not
-  support Jumbo Frames.  These correspond to the following product names:
-  Intel(R) PRO/1000 Gigabit Server Adapter Intel(R) PRO/1000 PM Network
-  Connection
+     Intel(R) PRO/1000 Gigabit Server Adapter
+     Intel(R) PRO/1000 PM Network Connection
 
 
 ethtool
 ethtool
 -------
 -------
-The driver utilizes the ethtool interface for driver configuration and
-diagnostics, as well as displaying statistical information.  The ethtool
-version 1.6 or later is required for this functionality.
 
 
-The latest release of ethtool can be found from
-https://www.kernel.org/pub/software/network/ethtool/
+  The driver utilizes the ethtool interface for driver configuration and
+  diagnostics, as well as displaying statistical information.  The ethtool
+  version 1.6 or later is required for this functionality.
+
+  The latest release of ethtool can be found from
+  https://www.kernel.org/pub/software/network/ethtool/
 
 
 Enabling Wake on LAN* (WoL)
 Enabling Wake on LAN* (WoL)
 ---------------------------
 ---------------------------
-WoL is configured through the ethtool* utility.
 
 
-WoL will be enabled on the system during the next shut down or reboot.
-For this driver version, in order to enable WoL, the e1000 driver must be
-loaded when shutting down or rebooting the system.
+  WoL is configured through the ethtool* utility.
 
 
+  WoL will be enabled on the system during the next shut down or reboot.
+  For this driver version, in order to enable WoL, the e1000 driver must be
+  loaded when shutting down or rebooting the system.
 
 
 Support
 Support
 =======
 =======

+ 10 - 8
MAINTAINERS

@@ -581,7 +581,7 @@ W:	https://www.infradead.org/~dhowells/kafs/
 
 
 AGPGART DRIVER
 AGPGART DRIVER
 M:	David Airlie <airlied@linux.ie>
 M:	David Airlie <airlied@linux.ie>
-T:	git git://people.freedesktop.org/~airlied/linux (part of drm maint)
+T:	git git://anongit.freedesktop.org/drm/drm
 S:	Maintained
 S:	Maintained
 F:	drivers/char/agp/
 F:	drivers/char/agp/
 F:	include/linux/agp*
 F:	include/linux/agp*
@@ -2523,7 +2523,7 @@ S:	Supported
 F:	drivers/scsi/esas2r
 F:	drivers/scsi/esas2r
 
 
 ATUSB IEEE 802.15.4 RADIO DRIVER
 ATUSB IEEE 802.15.4 RADIO DRIVER
-M:	Stefan Schmidt <stefan@osg.samsung.com>
+M:	Stefan Schmidt <stefan@datenfreihafen.org>
 L:	linux-wpan@vger.kernel.org
 L:	linux-wpan@vger.kernel.org
 S:	Maintained
 S:	Maintained
 F:	drivers/net/ieee802154/atusb.c
 F:	drivers/net/ieee802154/atusb.c
@@ -4460,6 +4460,7 @@ F:	Documentation/blockdev/drbd/
 
 
 DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS
 DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS
 M:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 M:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+R:	"Rafael J. Wysocki" <rafael@kernel.org>
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
 S:	Supported
 S:	Supported
 F:	Documentation/kobject.txt
 F:	Documentation/kobject.txt
@@ -4630,7 +4631,7 @@ F:	include/uapi/drm/vmwgfx_drm.h
 DRM DRIVERS
 DRM DRIVERS
 M:	David Airlie <airlied@linux.ie>
 M:	David Airlie <airlied@linux.ie>
 L:	dri-devel@lists.freedesktop.org
 L:	dri-devel@lists.freedesktop.org
-T:	git git://people.freedesktop.org/~airlied/linux
+T:	git git://anongit.freedesktop.org/drm/drm
 B:	https://bugs.freedesktop.org/
 B:	https://bugs.freedesktop.org/
 C:	irc://chat.freenode.net/dri-devel
 C:	irc://chat.freenode.net/dri-devel
 S:	Maintained
 S:	Maintained
@@ -5789,7 +5790,6 @@ F:	include/linux/fsl/
 
 
 FREESCALE SOC FS_ENET DRIVER
 FREESCALE SOC FS_ENET DRIVER
 M:	Pantelis Antoniou <pantelis.antoniou@gmail.com>
 M:	Pantelis Antoniou <pantelis.antoniou@gmail.com>
-M:	Vitaly Bordug <vbordug@ru.mvista.com>
 L:	linuxppc-dev@lists.ozlabs.org
 L:	linuxppc-dev@lists.ozlabs.org
 L:	netdev@vger.kernel.org
 L:	netdev@vger.kernel.org
 S:	Maintained
 S:	Maintained
@@ -6908,7 +6908,7 @@ F:	drivers/clk/clk-versaclock5.c
 
 
 IEEE 802.15.4 SUBSYSTEM
 IEEE 802.15.4 SUBSYSTEM
 M:	Alexander Aring <alex.aring@gmail.com>
 M:	Alexander Aring <alex.aring@gmail.com>
-M:	Stefan Schmidt <stefan@osg.samsung.com>
+M:	Stefan Schmidt <stefan@datenfreihafen.org>
 L:	linux-wpan@vger.kernel.org
 L:	linux-wpan@vger.kernel.org
 W:	http://wpan.cakelab.org/
 W:	http://wpan.cakelab.org/
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan.git
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan.git
@@ -8628,7 +8628,7 @@ MARVELL MWIFIEX WIRELESS DRIVER
 M:	Amitkumar Karwar <amitkarwar@gmail.com>
 M:	Amitkumar Karwar <amitkarwar@gmail.com>
 M:	Nishant Sarmukadam <nishants@marvell.com>
 M:	Nishant Sarmukadam <nishants@marvell.com>
 M:	Ganapathi Bhat <gbhat@marvell.com>
 M:	Ganapathi Bhat <gbhat@marvell.com>
-M:	Xinming Hu <huxm@marvell.com>
+M:	Xinming Hu <huxinming820@gmail.com>
 L:	linux-wireless@vger.kernel.org
 L:	linux-wireless@vger.kernel.org
 S:	Maintained
 S:	Maintained
 F:	drivers/net/wireless/marvell/mwifiex/
 F:	drivers/net/wireless/marvell/mwifiex/
@@ -9074,7 +9074,7 @@ S:	Maintained
 F:	drivers/usb/mtu3/
 F:	drivers/usb/mtu3/
 
 
 MEGACHIPS STDPXXXX-GE-B850V3-FW LVDS/DP++ BRIDGES
 MEGACHIPS STDPXXXX-GE-B850V3-FW LVDS/DP++ BRIDGES
-M:	Peter Senna Tschudin <peter.senna@collabora.com>
+M:	Peter Senna Tschudin <peter.senna@gmail.com>
 M:	Martin Donnelly <martin.donnelly@ge.com>
 M:	Martin Donnelly <martin.donnelly@ge.com>
 M:	Martyn Welch <martyn.welch@collabora.co.uk>
 M:	Martyn Welch <martyn.welch@collabora.co.uk>
 S:	Maintained
 S:	Maintained
@@ -10213,11 +10213,13 @@ F:	sound/soc/codecs/sgtl5000*
 
 
 NXP TDA998X DRM DRIVER
 NXP TDA998X DRM DRIVER
 M:	Russell King <linux@armlinux.org.uk>
 M:	Russell King <linux@armlinux.org.uk>
-S:	Supported
+S:	Maintained
 T:	git git://git.armlinux.org.uk/~rmk/linux-arm.git drm-tda998x-devel
 T:	git git://git.armlinux.org.uk/~rmk/linux-arm.git drm-tda998x-devel
 T:	git git://git.armlinux.org.uk/~rmk/linux-arm.git drm-tda998x-fixes
 T:	git git://git.armlinux.org.uk/~rmk/linux-arm.git drm-tda998x-fixes
 F:	drivers/gpu/drm/i2c/tda998x_drv.c
 F:	drivers/gpu/drm/i2c/tda998x_drv.c
 F:	include/drm/i2c/tda998x.h
 F:	include/drm/i2c/tda998x.h
+F:	include/dt-bindings/display/tda998x.h
+K:	"nxp,tda998x"
 
 
 NXP TFA9879 DRIVER
 NXP TFA9879 DRIVER
 M:	Peter Rosin <peda@axentia.se>
 M:	Peter Rosin <peda@axentia.se>

+ 5 - 5
Makefile

@@ -2,7 +2,7 @@
 VERSION = 4
 VERSION = 4
 PATCHLEVEL = 18
 PATCHLEVEL = 18
 SUBLEVEL = 0
 SUBLEVEL = 0
-EXTRAVERSION = -rc4
+EXTRAVERSION = -rc6
 NAME = Merciless Moray
 NAME = Merciless Moray
 
 
 # *DOCUMENTATION*
 # *DOCUMENTATION*
@@ -353,9 +353,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
 	  else if [ -x /bin/bash ]; then echo /bin/bash; \
 	  else if [ -x /bin/bash ]; then echo /bin/bash; \
 	  else echo sh; fi ; fi)
 	  else echo sh; fi ; fi)
 
 
-HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS)
-HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS)
-HOST_LFS_LIBS := $(shell getconf LFS_LIBS)
+HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null)
+HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null)
+HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null)
 
 
 HOSTCC       = gcc
 HOSTCC       = gcc
 HOSTCXX      = g++
 HOSTCXX      = g++
@@ -1712,6 +1712,6 @@ endif	# skip-makefile
 PHONY += FORCE
 PHONY += FORCE
 FORCE:
 FORCE:
 
 
-# Declare the contents of the .PHONY variable as phony.  We keep that
+# Declare the contents of the PHONY variable as phony.  We keep that
 # information in a variable so we can use it in if_changed and friends.
 # information in a variable so we can use it in if_changed and friends.
 .PHONY: $(PHONY)
 .PHONY: $(PHONY)

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

@@ -1180,13 +1180,10 @@ SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru)
 SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options,
 SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options,
 		struct rusage32 __user *, ur)
 		struct rusage32 __user *, ur)
 {
 {
-	unsigned int status = 0;
 	struct rusage r;
 	struct rusage r;
-	long err = kernel_wait4(pid, &status, options, &r);
+	long err = kernel_wait4(pid, ustatus, options, &r);
 	if (err <= 0)
 	if (err <= 0)
 		return err;
 		return err;
-	if (put_user(status, ustatus))
-		return -EFAULT;
 	if (!ur)
 	if (!ur)
 		return err;
 		return err;
 	if (put_tv_to_tv32(&ur->ru_utime, &r.ru_utime))
 	if (put_tv_to_tv32(&ur->ru_utime, &r.ru_utime))

+ 1 - 1
arch/arc/Kconfig

@@ -413,7 +413,7 @@ config ARC_HAS_DIV_REM
 
 
 config ARC_HAS_ACCL_REGS
 config ARC_HAS_ACCL_REGS
 	bool "Reg Pair ACCL:ACCH (FPU and/or MPY > 6)"
 	bool "Reg Pair ACCL:ACCH (FPU and/or MPY > 6)"
-	default n
+	default y
 	help
 	help
 	  Depending on the configuration, CPU can contain accumulator reg-pair
 	  Depending on the configuration, CPU can contain accumulator reg-pair
 	  (also referred to as r58:r59). These can also be used by gcc as GPR so
 	  (also referred to as r58:r59). These can also be used by gcc as GPR so

+ 1 - 14
arch/arc/Makefile

@@ -16,7 +16,7 @@ endif
 
 
 KBUILD_DEFCONFIG := nsim_700_defconfig
 KBUILD_DEFCONFIG := nsim_700_defconfig
 
 
-cflags-y	+= -fno-common -pipe -fno-builtin -D__linux__
+cflags-y	+= -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
 cflags-$(CONFIG_ISA_ARCOMPACT)	+= -mA7
 cflags-$(CONFIG_ISA_ARCOMPACT)	+= -mA7
 cflags-$(CONFIG_ISA_ARCV2)	+= -mcpu=archs
 cflags-$(CONFIG_ISA_ARCV2)	+= -mcpu=archs
 
 
@@ -140,16 +140,3 @@ dtbs: scripts
 
 
 archclean:
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 	$(Q)$(MAKE) $(clean)=$(boot)
-
-# Hacks to enable final link due to absence of link-time branch relexation
-# and gcc choosing optimal(shorter) branches at -O3
-#
-# vineetg Feb 2010: -mlong-calls switched off for overall kernel build
-# However lib/decompress_inflate.o (.init.text) calls
-# zlib_inflate_workspacesize (.text) causing relocation errors.
-# Thus forcing all exten calls in this file to be long calls
-export CFLAGS_decompress_inflate.o = -mmedium-calls
-export CFLAGS_initramfs.o = -mmedium-calls
-ifdef CONFIG_SMP
-export CFLAGS_core.o = -mmedium-calls
-endif

+ 0 - 1
arch/arc/configs/axs101_defconfig

@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/"
 CONFIG_EMBEDDED=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y
 # CONFIG_VM_EVENT_COUNTERS is not set
 # CONFIG_VM_EVENT_COUNTERS is not set

+ 0 - 1
arch/arc/configs/axs103_defconfig

@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/"
 CONFIG_EMBEDDED=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y
 # CONFIG_VM_EVENT_COUNTERS is not set
 # CONFIG_VM_EVENT_COUNTERS is not set

+ 0 - 1
arch/arc/configs/axs103_smp_defconfig

@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/"
 CONFIG_EMBEDDED=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y
 # CONFIG_VM_EVENT_COUNTERS is not set
 # CONFIG_VM_EVENT_COUNTERS is not set

+ 0 - 1
arch/arc/configs/haps_hs_defconfig

@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/"
 CONFIG_EXPERT=y
 CONFIG_EXPERT=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y
 # CONFIG_COMPAT_BRK is not set
 # CONFIG_COMPAT_BRK is not set

+ 0 - 1
arch/arc/configs/haps_hs_smp_defconfig

@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/"
 CONFIG_EMBEDDED=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y
 # CONFIG_VM_EVENT_COUNTERS is not set
 # CONFIG_VM_EVENT_COUNTERS is not set

+ 0 - 1
arch/arc/configs/hsdk_defconfig

@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/"
 CONFIG_EMBEDDED=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y
 # CONFIG_VM_EVENT_COUNTERS is not set
 # CONFIG_VM_EVENT_COUNTERS is not set

+ 0 - 1
arch/arc/configs/nsim_700_defconfig

@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/"
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y

+ 0 - 1
arch/arc/configs/nsim_hs_defconfig

@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/"
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y

+ 0 - 1
arch/arc/configs/nsim_hs_smp_defconfig

@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/"
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y

+ 0 - 1
arch/arc/configs/nsimosci_defconfig

@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/"
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y

+ 0 - 1
arch/arc/configs/nsimosci_hs_defconfig

@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/"
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y

+ 0 - 1
arch/arc/configs/nsimosci_hs_smp_defconfig

@@ -9,7 +9,6 @@ CONFIG_IKCONFIG_PROC=y
 # CONFIG_UTS_NS is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/"
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_EVENTS=y
 # CONFIG_COMPAT_BRK is not set
 # CONFIG_COMPAT_BRK is not set
 CONFIG_KPROBES=y
 CONFIG_KPROBES=y

+ 0 - 1
arch/arc/configs/tb10x_defconfig

@@ -56,7 +56,6 @@ CONFIG_STMMAC_ETH=y
 # CONFIG_INPUT is not set
 # CONFIG_INPUT is not set
 # CONFIG_SERIO is not set
 # CONFIG_SERIO is not set
 # CONFIG_VT is not set
 # CONFIG_VT is not set
-CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
 # CONFIG_LEGACY_PTYS is not set
 # CONFIG_LEGACY_PTYS is not set
 # CONFIG_DEVKMEM is not set
 # CONFIG_DEVKMEM is not set
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250=y

+ 6 - 0
arch/arc/include/asm/entry-compact.h

@@ -234,6 +234,9 @@
 	POP	gp
 	POP	gp
 	RESTORE_R12_TO_R0
 	RESTORE_R12_TO_R0
 
 
+#ifdef CONFIG_ARC_CURR_IN_REG
+	ld	r25, [sp, 12]
+#endif
 	ld  sp, [sp] /* restore original sp */
 	ld  sp, [sp] /* restore original sp */
 	/* orig_r0, ECR, user_r25 skipped automatically */
 	/* orig_r0, ECR, user_r25 skipped automatically */
 .endm
 .endm
@@ -315,6 +318,9 @@
 	POP	gp
 	POP	gp
 	RESTORE_R12_TO_R0
 	RESTORE_R12_TO_R0
 
 
+#ifdef CONFIG_ARC_CURR_IN_REG
+	ld	r25, [sp, 12]
+#endif
 	ld  sp, [sp] /* restore original sp */
 	ld  sp, [sp] /* restore original sp */
 	/* orig_r0, ECR, user_r25 skipped automatically */
 	/* orig_r0, ECR, user_r25 skipped automatically */
 .endm
 .endm

+ 0 - 3
arch/arc/include/asm/entry.h

@@ -86,9 +86,6 @@
 	POP	r1
 	POP	r1
 	POP	r0
 	POP	r0
 
 
-#ifdef CONFIG_ARC_CURR_IN_REG
-	ld	r25, [sp, 12]
-#endif
 .endm
 .endm
 
 
 /*--------------------------------------------------------------
 /*--------------------------------------------------------------

+ 0 - 2
arch/arc/include/asm/mach_desc.h

@@ -34,9 +34,7 @@ struct machine_desc {
 	const char		*name;
 	const char		*name;
 	const char		**dt_compat;
 	const char		**dt_compat;
 	void			(*init_early)(void);
 	void			(*init_early)(void);
-#ifdef CONFIG_SMP
 	void			(*init_per_cpu)(unsigned int);
 	void			(*init_per_cpu)(unsigned int);
-#endif
 	void			(*init_machine)(void);
 	void			(*init_machine)(void);
 	void			(*init_late)(void);
 	void			(*init_late)(void);
 
 

+ 1 - 1
arch/arc/include/asm/page.h

@@ -105,7 +105,7 @@ typedef pte_t * pgtable_t;
 #define virt_addr_valid(kaddr)  pfn_valid(virt_to_pfn(kaddr))
 #define virt_addr_valid(kaddr)  pfn_valid(virt_to_pfn(kaddr))
 
 
 /* Default Permissions for stack/heaps pages (Non Executable) */
 /* Default Permissions for stack/heaps pages (Non Executable) */
-#define VM_DATA_DEFAULT_FLAGS   (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE)
+#define VM_DATA_DEFAULT_FLAGS   (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
 
 
 #define WANT_PAGE_VIRTUAL   1
 #define WANT_PAGE_VIRTUAL   1
 
 

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

@@ -377,7 +377,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
 
 
 /* Decode a PTE containing swap "identifier "into constituents */
 /* Decode a PTE containing swap "identifier "into constituents */
 #define __swp_type(pte_lookalike)	(((pte_lookalike).val) & 0x1f)
 #define __swp_type(pte_lookalike)	(((pte_lookalike).val) & 0x1f)
-#define __swp_offset(pte_lookalike)	((pte_lookalike).val << 13)
+#define __swp_offset(pte_lookalike)	((pte_lookalike).val >> 13)
 
 
 /* NOPs, to keep generic kernel happy */
 /* NOPs, to keep generic kernel happy */
 #define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })
 #define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })

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

@@ -31,10 +31,10 @@ void __init init_IRQ(void)
 	/* a SMP H/w block could do IPI IRQ request here */
 	/* a SMP H/w block could do IPI IRQ request here */
 	if (plat_smp_ops.init_per_cpu)
 	if (plat_smp_ops.init_per_cpu)
 		plat_smp_ops.init_per_cpu(smp_processor_id());
 		plat_smp_ops.init_per_cpu(smp_processor_id());
+#endif
 
 
 	if (machine_desc->init_per_cpu)
 	if (machine_desc->init_per_cpu)
 		machine_desc->init_per_cpu(smp_processor_id());
 		machine_desc->init_per_cpu(smp_processor_id());
-#endif
 }
 }
 
 
 /*
 /*

+ 36 - 11
arch/arc/kernel/process.c

@@ -47,7 +47,8 @@ SYSCALL_DEFINE0(arc_gettls)
 SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new)
 SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new)
 {
 {
 	struct pt_regs *regs = current_pt_regs();
 	struct pt_regs *regs = current_pt_regs();
-	int uval = -EFAULT;
+	u32 uval;
+	int ret;
 
 
 	/*
 	/*
 	 * This is only for old cores lacking LLOCK/SCOND, which by defintion
 	 * This is only for old cores lacking LLOCK/SCOND, which by defintion
@@ -60,23 +61,47 @@ SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new)
 	/* Z indicates to userspace if operation succeded */
 	/* Z indicates to userspace if operation succeded */
 	regs->status32 &= ~STATUS_Z_MASK;
 	regs->status32 &= ~STATUS_Z_MASK;
 
 
-	if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
-		return -EFAULT;
+	ret = access_ok(VERIFY_WRITE, uaddr, sizeof(*uaddr));
+	if (!ret)
+		 goto fail;
 
 
+again:
 	preempt_disable();
 	preempt_disable();
 
 
-	if (__get_user(uval, uaddr))
-		goto done;
+	ret = __get_user(uval, uaddr);
+	if (ret)
+		 goto fault;
 
 
-	if (uval == expected) {
-		if (!__put_user(new, uaddr))
-			regs->status32 |= STATUS_Z_MASK;
-	}
+	if (uval != expected)
+		 goto out;
 
 
-done:
-	preempt_enable();
+	ret = __put_user(new, uaddr);
+	if (ret)
+		 goto fault;
+
+	regs->status32 |= STATUS_Z_MASK;
 
 
+out:
+	preempt_enable();
 	return uval;
 	return uval;
+
+fault:
+	preempt_enable();
+
+	if (unlikely(ret != -EFAULT))
+		 goto fail;
+
+	down_read(&current->mm->mmap_sem);
+	ret = fixup_user_fault(current, current->mm, (unsigned long) uaddr,
+			       FAULT_FLAG_WRITE, NULL);
+	up_read(&current->mm->mmap_sem);
+
+	if (likely(!ret))
+		 goto again;
+
+fail:
+	force_sig(SIGSEGV, current);
+	return ret;
 }
 }
 
 
 #ifdef CONFIG_ISA_ARCV2
 #ifdef CONFIG_ISA_ARCV2

+ 3 - 0
arch/arc/plat-hsdk/Kconfig

@@ -7,5 +7,8 @@
 
 
 menuconfig ARC_SOC_HSDK
 menuconfig ARC_SOC_HSDK
 	bool "ARC HS Development Kit SOC"
 	bool "ARC HS Development Kit SOC"
+	depends on ISA_ARCV2
+	select ARC_HAS_ACCL_REGS
 	select CLK_HSDK
 	select CLK_HSDK
 	select RESET_HSDK
 	select RESET_HSDK
+	select MIGHT_HAVE_PCI

+ 62 - 0
arch/arc/plat-hsdk/platform.c

@@ -42,6 +42,66 @@ static void __init hsdk_init_per_cpu(unsigned int cpu)
 #define SDIO_UHS_REG_EXT	(SDIO_BASE + 0x108)
 #define SDIO_UHS_REG_EXT	(SDIO_BASE + 0x108)
 #define SDIO_UHS_REG_EXT_DIV_2	(2 << 30)
 #define SDIO_UHS_REG_EXT_DIV_2	(2 << 30)
 
 
+#define HSDK_GPIO_INTC          (ARC_PERIPHERAL_BASE + 0x3000)
+
+static void __init hsdk_enable_gpio_intc_wire(void)
+{
+	/*
+	 * Peripherals on CPU Card are wired to cpu intc via intermediate
+	 * DW APB GPIO blocks (mainly for debouncing)
+	 *
+	 *         ---------------------
+	 *        |  snps,archs-intc  |
+	 *        ---------------------
+	 *                  |
+	 *        ----------------------
+	 *        | snps,archs-idu-intc |
+	 *        ----------------------
+	 *         |   |     |   |    |
+	 *         | [eth] [USB]    [... other peripherals]
+	 *         |
+	 * -------------------
+	 * | snps,dw-apb-intc |
+	 * -------------------
+	 *  |      |   |   |
+	 * [Bt] [HAPS]   [... other peripherals]
+	 *
+	 * Current implementation of "irq-dw-apb-ictl" driver doesn't work well
+	 * with stacked INTCs. In particular problem happens if its master INTC
+	 * not yet instantiated. See discussion here -
+	 * https://lkml.org/lkml/2015/3/4/755
+	 *
+	 * So setup the first gpio block as a passive pass thru and hide it from
+	 * DT hardware topology - connect intc directly to cpu intc
+	 * The GPIO "wire" needs to be init nevertheless (here)
+	 *
+	 * One side adv is that peripheral interrupt handling avoids one nested
+	 * intc ISR hop
+	 *
+	 * According to HSDK User's Manual [1], "Table 2 Interrupt Mapping"
+	 * we have the following GPIO input lines used as sources of interrupt:
+	 * - GPIO[0] - Bluetooth interrupt of RS9113 module
+	 * - GPIO[2] - HAPS interrupt (on HapsTrak 3 connector)
+	 * - GPIO[3] - Audio codec (MAX9880A) interrupt
+	 * - GPIO[8-23] - Available on Arduino and PMOD_x headers
+	 * For now there's no use of Arduino and PMOD_x headers in Linux
+	 * use-case so we only enable lines 0, 2 and 3.
+	 *
+	 * [1] https://github.com/foss-for-synopsys-dwc-arc-processors/ARC-Development-Systems-Forum/wiki/docs/ARC_HSDK_User_Guide.pdf
+	 */
+#define GPIO_INTEN              (HSDK_GPIO_INTC + 0x30)
+#define GPIO_INTMASK            (HSDK_GPIO_INTC + 0x34)
+#define GPIO_INTTYPE_LEVEL      (HSDK_GPIO_INTC + 0x38)
+#define GPIO_INT_POLARITY       (HSDK_GPIO_INTC + 0x3c)
+#define GPIO_INT_CONNECTED_MASK	0x0d
+
+	iowrite32(0xffffffff, (void __iomem *) GPIO_INTMASK);
+	iowrite32(~GPIO_INT_CONNECTED_MASK, (void __iomem *) GPIO_INTMASK);
+	iowrite32(0x00000000, (void __iomem *) GPIO_INTTYPE_LEVEL);
+	iowrite32(0xffffffff, (void __iomem *) GPIO_INT_POLARITY);
+	iowrite32(GPIO_INT_CONNECTED_MASK, (void __iomem *) GPIO_INTEN);
+}
+
 static void __init hsdk_init_early(void)
 static void __init hsdk_init_early(void)
 {
 {
 	/*
 	/*
@@ -62,6 +122,8 @@ static void __init hsdk_init_early(void)
 	 * minimum possible div-by-2.
 	 * minimum possible div-by-2.
 	 */
 	 */
 	iowrite32(SDIO_UHS_REG_EXT_DIV_2, (void __iomem *) SDIO_UHS_REG_EXT);
 	iowrite32(SDIO_UHS_REG_EXT_DIV_2, (void __iomem *) SDIO_UHS_REG_EXT);
+
+	hsdk_enable_gpio_intc_wire();
 }
 }
 
 
 static const char *hsdk_compat[] __initconst = {
 static const char *hsdk_compat[] __initconst = {

+ 5 - 0
arch/arm/boot/dts/am3517.dtsi

@@ -91,6 +91,11 @@
 	};
 	};
 };
 };
 
 
+/* Table Table 5-79 of the TRM shows 480ab000 is reserved */
+&usb_otg_hs {
+	status = "disabled";
+};
+
 &iva {
 &iva {
 	status = "disabled";
 	status = "disabled";
 };
 };

+ 1 - 1
arch/arm/boot/dts/armada-38x.dtsi

@@ -547,7 +547,7 @@
 
 
 			thermal: thermal@e8078 {
 			thermal: thermal@e8078 {
 				compatible = "marvell,armada380-thermal";
 				compatible = "marvell,armada380-thermal";
-				reg = <0xe4078 0x4>, <0xe4074 0x4>;
+				reg = <0xe4078 0x4>, <0xe4070 0x8>;
 				status = "okay";
 				status = "okay";
 			};
 			};
 
 

+ 1 - 1
arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi

@@ -692,7 +692,7 @@
 			dsa,member = <0 0>;
 			dsa,member = <0 0>;
 			eeprom-length = <512>;
 			eeprom-length = <512>;
 			interrupt-parent = <&gpio6>;
 			interrupt-parent = <&gpio6>;
-			interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
+			interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
 			interrupt-controller;
 			interrupt-controller;
 			#interrupt-cells = <2>;
 			#interrupt-cells = <2>;
 
 

+ 3 - 6
arch/arm/boot/dts/omap4-droid4-xt894.dts

@@ -159,13 +159,7 @@
 
 
 		dais = <&mcbsp2_port>, <&mcbsp3_port>;
 		dais = <&mcbsp2_port>, <&mcbsp3_port>;
 	};
 	};
-};
-
-&dss {
-	status = "okay";
-};
 
 
-&gpio6 {
 	pwm8: dmtimer-pwm-8 {
 	pwm8: dmtimer-pwm-8 {
 		pinctrl-names = "default";
 		pinctrl-names = "default";
 		pinctrl-0 = <&vibrator_direction_pin>;
 		pinctrl-0 = <&vibrator_direction_pin>;
@@ -192,7 +186,10 @@
 		pwm-names = "enable", "direction";
 		pwm-names = "enable", "direction";
 		direction-duty-cycle-ns = <10000000>;
 		direction-duty-cycle-ns = <10000000>;
 	};
 	};
+};
 
 
+&dss {
+	status = "okay";
 };
 };
 
 
 &dsi1 {
 &dsi1 {

+ 1 - 1
arch/arm/kernel/head-nommu.S

@@ -177,7 +177,7 @@ M_CLASS(streq	r3, [r12, #PMSAv8_MAIR1])
 	bic	r0, r0, #CR_I
 	bic	r0, r0, #CR_I
 #endif
 #endif
 	mcr	p15, 0, r0, c1, c0, 0		@ write control reg
 	mcr	p15, 0, r0, c1, c0, 0		@ write control reg
-	isb
+	instr_sync
 #elif defined (CONFIG_CPU_V7M)
 #elif defined (CONFIG_CPU_V7M)
 #ifdef CONFIG_ARM_MPU
 #ifdef CONFIG_ARM_MPU
 	ldreq	r3, [r12, MPU_CTRL]
 	ldreq	r3, [r12, MPU_CTRL]

+ 41 - 0
arch/arm/mach-omap2/omap-smp.c

@@ -109,6 +109,45 @@ void omap5_erratum_workaround_801819(void)
 static inline void omap5_erratum_workaround_801819(void) { }
 static inline void omap5_erratum_workaround_801819(void) { }
 #endif
 #endif
 
 
+#ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
+/*
+ * Configure ACR and enable ACTLR[0] (Enable invalidates of BTB with
+ * ICIALLU) to activate the workaround for secondary Core.
+ * NOTE: it is assumed that the primary core's configuration is done
+ * by the boot loader (kernel will detect a misconfiguration and complain
+ * if this is not done).
+ *
+ * In General Purpose(GP) devices, ACR bit settings can only be done
+ * by ROM code in "secure world" using the smc call and there is no
+ * option to update the "firmware" on such devices. This also works for
+ * High security(HS) devices, as a backup option in case the
+ * "update" is not done in the "security firmware".
+ */
+static void omap5_secondary_harden_predictor(void)
+{
+	u32 acr, acr_mask;
+
+	asm volatile ("mrc p15, 0, %0, c1, c0, 1" : "=r" (acr));
+
+	/*
+	 * ACTLR[0] (Enable invalidates of BTB with ICIALLU)
+	 */
+	acr_mask = BIT(0);
+
+	/* Do we already have it done.. if yes, skip expensive smc */
+	if ((acr & acr_mask) == acr_mask)
+		return;
+
+	acr |= acr_mask;
+	omap_smc1(OMAP5_DRA7_MON_SET_ACR_INDEX, acr);
+
+	pr_debug("%s: ARM ACR setup for CVE_2017_5715 applied on CPU%d\n",
+		 __func__, smp_processor_id());
+}
+#else
+static inline void omap5_secondary_harden_predictor(void) { }
+#endif
+
 static void omap4_secondary_init(unsigned int cpu)
 static void omap4_secondary_init(unsigned int cpu)
 {
 {
 	/*
 	/*
@@ -131,6 +170,8 @@ static void omap4_secondary_init(unsigned int cpu)
 		set_cntfreq();
 		set_cntfreq();
 		/* Configure ACR to disable streaming WA for 801819 */
 		/* Configure ACR to disable streaming WA for 801819 */
 		omap5_erratum_workaround_801819();
 		omap5_erratum_workaround_801819();
+		/* Enable ACR to allow for ICUALLU workaround */
+		omap5_secondary_harden_predictor();
 	}
 	}
 
 
 	/*
 	/*

+ 2 - 2
arch/arm/mach-pxa/irq.c

@@ -185,7 +185,7 @@ static int pxa_irq_suspend(void)
 {
 {
 	int i;
 	int i;
 
 
-	for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
+	for (i = 0; i < DIV_ROUND_UP(pxa_internal_irq_nr, 32); i++) {
 		void __iomem *base = irq_base(i);
 		void __iomem *base = irq_base(i);
 
 
 		saved_icmr[i] = __raw_readl(base + ICMR);
 		saved_icmr[i] = __raw_readl(base + ICMR);
@@ -204,7 +204,7 @@ static void pxa_irq_resume(void)
 {
 {
 	int i;
 	int i;
 
 
-	for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
+	for (i = 0; i < DIV_ROUND_UP(pxa_internal_irq_nr, 32); i++) {
 		void __iomem *base = irq_base(i);
 		void __iomem *base = irq_base(i);
 
 
 		__raw_writel(saved_icmr[i], base + ICMR);
 		__raw_writel(saved_icmr[i], base + ICMR);

+ 9 - 0
arch/arm/mm/init.c

@@ -736,20 +736,29 @@ static int __mark_rodata_ro(void *unused)
 	return 0;
 	return 0;
 }
 }
 
 
+static int kernel_set_to_readonly __read_mostly;
+
 void mark_rodata_ro(void)
 void mark_rodata_ro(void)
 {
 {
+	kernel_set_to_readonly = 1;
 	stop_machine(__mark_rodata_ro, NULL, NULL);
 	stop_machine(__mark_rodata_ro, NULL, NULL);
 	debug_checkwx();
 	debug_checkwx();
 }
 }
 
 
 void set_kernel_text_rw(void)
 void set_kernel_text_rw(void)
 {
 {
+	if (!kernel_set_to_readonly)
+		return;
+
 	set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), false,
 	set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), false,
 				current->active_mm);
 				current->active_mm);
 }
 }
 
 
 void set_kernel_text_ro(void)
 void set_kernel_text_ro(void)
 {
 {
+	if (!kernel_set_to_readonly)
+		return;
+
 	set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), true,
 	set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), true,
 				current->active_mm);
 				current->active_mm);
 }
 }

+ 4 - 2
arch/arm64/Makefile

@@ -60,13 +60,15 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
 KBUILD_CPPFLAGS	+= -mbig-endian
 KBUILD_CPPFLAGS	+= -mbig-endian
 CHECKFLAGS	+= -D__AARCH64EB__
 CHECKFLAGS	+= -D__AARCH64EB__
 AS		+= -EB
 AS		+= -EB
-LDFLAGS		+= -EB -maarch64elfb
+# We must use the linux target here, since distributions don't tend to package
+# the ELF linker scripts with binutils, and this results in a build failure.
+LDFLAGS		+= -EB -maarch64linuxb
 UTS_MACHINE	:= aarch64_be
 UTS_MACHINE	:= aarch64_be
 else
 else
 KBUILD_CPPFLAGS	+= -mlittle-endian
 KBUILD_CPPFLAGS	+= -mlittle-endian
 CHECKFLAGS	+= -D__AARCH64EL__
 CHECKFLAGS	+= -D__AARCH64EL__
 AS		+= -EL
 AS		+= -EL
-LDFLAGS		+= -EL -maarch64elf
+LDFLAGS		+= -EL -maarch64linux # See comment above
 UTS_MACHINE	:= aarch64
 UTS_MACHINE	:= aarch64
 endif
 endif
 
 

+ 7 - 12
arch/arm64/include/asm/simd.h

@@ -29,20 +29,15 @@ DECLARE_PER_CPU(bool, kernel_neon_busy);
 static __must_check inline bool may_use_simd(void)
 static __must_check inline bool may_use_simd(void)
 {
 {
 	/*
 	/*
-	 * The raw_cpu_read() is racy if called with preemption enabled.
-	 * This is not a bug: kernel_neon_busy is only set when
-	 * preemption is disabled, so we cannot migrate to another CPU
-	 * while it is set, nor can we migrate to a CPU where it is set.
-	 * So, if we find it clear on some CPU then we're guaranteed to
-	 * find it clear on any CPU we could migrate to.
-	 *
-	 * If we are in between kernel_neon_begin()...kernel_neon_end(),
-	 * the flag will be set, but preemption is also disabled, so we
-	 * can't migrate to another CPU and spuriously see it become
-	 * false.
+	 * kernel_neon_busy is only set while preemption is disabled,
+	 * and is clear whenever preemption is enabled. Since
+	 * this_cpu_read() is atomic w.r.t. preemption, kernel_neon_busy
+	 * cannot change under our feet -- if it's set we cannot be
+	 * migrated, and if it's clear we cannot be migrated to a CPU
+	 * where it is set.
 	 */
 	 */
 	return !in_irq() && !irqs_disabled() && !in_nmi() &&
 	return !in_irq() && !irqs_disabled() && !in_nmi() &&
-		!raw_cpu_read(kernel_neon_busy);
+		!this_cpu_read(kernel_neon_busy);
 }
 }
 
 
 #else /* ! CONFIG_KERNEL_MODE_NEON */
 #else /* ! CONFIG_KERNEL_MODE_NEON */

+ 2 - 4
arch/ia64/kernel/perfmon.c

@@ -2278,17 +2278,15 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
 	DPRINT(("smpl_buf @%p\n", smpl_buf));
 	DPRINT(("smpl_buf @%p\n", smpl_buf));
 
 
 	/* allocate vma */
 	/* allocate vma */
-	vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
+	vma = vm_area_alloc(mm);
 	if (!vma) {
 	if (!vma) {
 		DPRINT(("Cannot allocate vma\n"));
 		DPRINT(("Cannot allocate vma\n"));
 		goto error_kmem;
 		goto error_kmem;
 	}
 	}
-	INIT_LIST_HEAD(&vma->anon_vma_chain);
 
 
 	/*
 	/*
 	 * partially initialize the vma for the sampling buffer
 	 * partially initialize the vma for the sampling buffer
 	 */
 	 */
-	vma->vm_mm	     = mm;
 	vma->vm_file	     = get_file(filp);
 	vma->vm_file	     = get_file(filp);
 	vma->vm_flags	     = VM_READ|VM_MAYREAD|VM_DONTEXPAND|VM_DONTDUMP;
 	vma->vm_flags	     = VM_READ|VM_MAYREAD|VM_DONTEXPAND|VM_DONTDUMP;
 	vma->vm_page_prot    = PAGE_READONLY; /* XXX may need to change */
 	vma->vm_page_prot    = PAGE_READONLY; /* XXX may need to change */
@@ -2346,7 +2344,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
 	return 0;
 	return 0;
 
 
 error:
 error:
-	kmem_cache_free(vm_area_cachep, vma);
+	vm_area_free(vma);
 error_kmem:
 error_kmem:
 	pfm_rvfree(smpl_buf, size);
 	pfm_rvfree(smpl_buf, size);
 
 

+ 4 - 8
arch/ia64/mm/init.c

@@ -114,10 +114,8 @@ ia64_init_addr_space (void)
 	 * the problem.  When the process attempts to write to the register backing store
 	 * the problem.  When the process attempts to write to the register backing store
 	 * for the first time, it will get a SEGFAULT in this case.
 	 * for the first time, it will get a SEGFAULT in this case.
 	 */
 	 */
-	vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
+	vma = vm_area_alloc(current->mm);
 	if (vma) {
 	if (vma) {
-		INIT_LIST_HEAD(&vma->anon_vma_chain);
-		vma->vm_mm = current->mm;
 		vma->vm_start = current->thread.rbs_bot & PAGE_MASK;
 		vma->vm_start = current->thread.rbs_bot & PAGE_MASK;
 		vma->vm_end = vma->vm_start + PAGE_SIZE;
 		vma->vm_end = vma->vm_start + PAGE_SIZE;
 		vma->vm_flags = VM_DATA_DEFAULT_FLAGS|VM_GROWSUP|VM_ACCOUNT;
 		vma->vm_flags = VM_DATA_DEFAULT_FLAGS|VM_GROWSUP|VM_ACCOUNT;
@@ -125,7 +123,7 @@ ia64_init_addr_space (void)
 		down_write(&current->mm->mmap_sem);
 		down_write(&current->mm->mmap_sem);
 		if (insert_vm_struct(current->mm, vma)) {
 		if (insert_vm_struct(current->mm, vma)) {
 			up_write(&current->mm->mmap_sem);
 			up_write(&current->mm->mmap_sem);
-			kmem_cache_free(vm_area_cachep, vma);
+			vm_area_free(vma);
 			return;
 			return;
 		}
 		}
 		up_write(&current->mm->mmap_sem);
 		up_write(&current->mm->mmap_sem);
@@ -133,10 +131,8 @@ ia64_init_addr_space (void)
 
 
 	/* map NaT-page at address zero to speed up speculative dereferencing of NULL: */
 	/* map NaT-page at address zero to speed up speculative dereferencing of NULL: */
 	if (!(current->personality & MMAP_PAGE_ZERO)) {
 	if (!(current->personality & MMAP_PAGE_ZERO)) {
-		vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
+		vma = vm_area_alloc(current->mm);
 		if (vma) {
 		if (vma) {
-			INIT_LIST_HEAD(&vma->anon_vma_chain);
-			vma->vm_mm = current->mm;
 			vma->vm_end = PAGE_SIZE;
 			vma->vm_end = PAGE_SIZE;
 			vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT);
 			vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT);
 			vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO |
 			vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO |
@@ -144,7 +140,7 @@ ia64_init_addr_space (void)
 			down_write(&current->mm->mmap_sem);
 			down_write(&current->mm->mmap_sem);
 			if (insert_vm_struct(current->mm, vma)) {
 			if (insert_vm_struct(current->mm, vma)) {
 				up_write(&current->mm->mmap_sem);
 				up_write(&current->mm->mmap_sem);
-				kmem_cache_free(vm_area_cachep, vma);
+				vm_area_free(vma);
 				return;
 				return;
 			}
 			}
 			up_write(&current->mm->mmap_sem);
 			up_write(&current->mm->mmap_sem);

+ 29 - 14
arch/mips/kernel/process.c

@@ -29,6 +29,7 @@
 #include <linux/kallsyms.h>
 #include <linux/kallsyms.h>
 #include <linux/random.h>
 #include <linux/random.h>
 #include <linux/prctl.h>
 #include <linux/prctl.h>
+#include <linux/nmi.h>
 
 
 #include <asm/asm.h>
 #include <asm/asm.h>
 #include <asm/bootinfo.h>
 #include <asm/bootinfo.h>
@@ -655,28 +656,42 @@ unsigned long arch_align_stack(unsigned long sp)
 	return sp & ALMASK;
 	return sp & ALMASK;
 }
 }
 
 
-static void arch_dump_stack(void *info)
+static DEFINE_PER_CPU(call_single_data_t, backtrace_csd);
+static struct cpumask backtrace_csd_busy;
+
+static void handle_backtrace(void *info)
 {
 {
-	struct pt_regs *regs;
+	nmi_cpu_backtrace(get_irq_regs());
+	cpumask_clear_cpu(smp_processor_id(), &backtrace_csd_busy);
+}
 
 
-	regs = get_irq_regs();
+static void raise_backtrace(cpumask_t *mask)
+{
+	call_single_data_t *csd;
+	int cpu;
 
 
-	if (regs)
-		show_regs(regs);
+	for_each_cpu(cpu, mask) {
+		/*
+		 * If we previously sent an IPI to the target CPU & it hasn't
+		 * cleared its bit in the busy cpumask then it didn't handle
+		 * our previous IPI & it's not safe for us to reuse the
+		 * call_single_data_t.
+		 */
+		if (cpumask_test_and_set_cpu(cpu, &backtrace_csd_busy)) {
+			pr_warn("Unable to send backtrace IPI to CPU%u - perhaps it hung?\n",
+				cpu);
+			continue;
+		}
 
 
-	dump_stack();
+		csd = &per_cpu(backtrace_csd, cpu);
+		csd->func = handle_backtrace;
+		smp_call_function_single_async(cpu, csd);
+	}
 }
 }
 
 
 void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self)
 void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self)
 {
 {
-	long this_cpu = get_cpu();
-
-	if (cpumask_test_cpu(this_cpu, mask) && !exclude_self)
-		dump_stack();
-
-	smp_call_function_many(mask, arch_dump_stack, NULL, 1);
-
-	put_cpu();
+	nmi_trigger_cpumask_backtrace(mask, exclude_self, raise_backtrace);
 }
 }
 
 
 int mips_get_process_fp_mode(struct task_struct *task)
 int mips_get_process_fp_mode(struct task_struct *task)

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

@@ -351,6 +351,7 @@ static void __show_regs(const struct pt_regs *regs)
 void show_regs(struct pt_regs *regs)
 void show_regs(struct pt_regs *regs)
 {
 {
 	__show_regs((struct pt_regs *)regs);
 	__show_regs((struct pt_regs *)regs);
+	dump_stack();
 }
 }
 
 
 void show_registers(struct pt_regs *regs)
 void show_registers(struct pt_regs *regs)

+ 25 - 12
arch/mips/mm/ioremap.c

@@ -9,6 +9,7 @@
 #include <linux/export.h>
 #include <linux/export.h>
 #include <asm/addrspace.h>
 #include <asm/addrspace.h>
 #include <asm/byteorder.h>
 #include <asm/byteorder.h>
+#include <linux/ioport.h>
 #include <linux/sched.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/vmalloc.h>
@@ -98,6 +99,20 @@ static int remap_area_pages(unsigned long address, phys_addr_t phys_addr,
 	return error;
 	return error;
 }
 }
 
 
+static int __ioremap_check_ram(unsigned long start_pfn, unsigned long nr_pages,
+			       void *arg)
+{
+	unsigned long i;
+
+	for (i = 0; i < nr_pages; i++) {
+		if (pfn_valid(start_pfn + i) &&
+		    !PageReserved(pfn_to_page(start_pfn + i)))
+			return 1;
+	}
+
+	return 0;
+}
+
 /*
 /*
  * Generic mapping function (not visible outside):
  * Generic mapping function (not visible outside):
  */
  */
@@ -116,8 +131,8 @@ static int remap_area_pages(unsigned long address, phys_addr_t phys_addr,
 
 
 void __iomem * __ioremap(phys_addr_t phys_addr, phys_addr_t size, unsigned long flags)
 void __iomem * __ioremap(phys_addr_t phys_addr, phys_addr_t size, unsigned long flags)
 {
 {
+	unsigned long offset, pfn, last_pfn;
 	struct vm_struct * area;
 	struct vm_struct * area;
-	unsigned long offset;
 	phys_addr_t last_addr;
 	phys_addr_t last_addr;
 	void * addr;
 	void * addr;
 
 
@@ -137,18 +152,16 @@ void __iomem * __ioremap(phys_addr_t phys_addr, phys_addr_t size, unsigned long
 		return (void __iomem *) CKSEG1ADDR(phys_addr);
 		return (void __iomem *) CKSEG1ADDR(phys_addr);
 
 
 	/*
 	/*
-	 * Don't allow anybody to remap normal RAM that we're using..
+	 * Don't allow anybody to remap RAM that may be allocated by the page
+	 * allocator, since that could lead to races & data clobbering.
 	 */
 	 */
-	if (phys_addr < virt_to_phys(high_memory)) {
-		char *t_addr, *t_end;
-		struct page *page;
-
-		t_addr = __va(phys_addr);
-		t_end = t_addr + (size - 1);
-
-		for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++)
-			if(!PageReserved(page))
-				return NULL;
+	pfn = PFN_DOWN(phys_addr);
+	last_pfn = PFN_DOWN(last_addr);
+	if (walk_system_ram_range(pfn, last_pfn - pfn + 1, NULL,
+				  __ioremap_check_ram) == 1) {
+		WARN_ONCE(1, "ioremap on RAM at %pa - %pa\n",
+			  &phys_addr, &last_addr);
+		return NULL;
 	}
 	}
 
 
 	/*
 	/*

+ 6 - 6
arch/nds32/Kconfig

@@ -12,17 +12,17 @@ config NDS32
 	select CLONE_BACKWARDS
 	select CLONE_BACKWARDS
 	select COMMON_CLK
 	select COMMON_CLK
 	select DMA_NONCOHERENT_OPS
 	select DMA_NONCOHERENT_OPS
-	select GENERIC_ASHLDI3
-	select GENERIC_ASHRDI3
-	select GENERIC_LSHRDI3
-	select GENERIC_CMPDI2
-	select GENERIC_MULDI3
-	select GENERIC_UCMPDI2
 	select GENERIC_ATOMIC64
 	select GENERIC_ATOMIC64
 	select GENERIC_CPU_DEVICES
 	select GENERIC_CPU_DEVICES
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
 	select GENERIC_IRQ_CHIP
 	select GENERIC_IRQ_SHOW
 	select GENERIC_IRQ_SHOW
+	select GENERIC_LIB_ASHLDI3
+	select GENERIC_LIB_ASHRDI3
+	select GENERIC_LIB_CMPDI2
+	select GENERIC_LIB_LSHRDI3
+	select GENERIC_LIB_MULDI3
+	select GENERIC_LIB_UCMPDI2
 	select GENERIC_STRNCPY_FROM_USER
 	select GENERIC_STRNCPY_FROM_USER
 	select GENERIC_STRNLEN_USER
 	select GENERIC_STRNLEN_USER
 	select GENERIC_TIME_VSYSCALL
 	select GENERIC_TIME_VSYSCALL

+ 2 - 0
arch/nds32/Makefile

@@ -34,10 +34,12 @@ ifdef CONFIG_CPU_LITTLE_ENDIAN
 KBUILD_CFLAGS   += $(call cc-option, -EL)
 KBUILD_CFLAGS   += $(call cc-option, -EL)
 KBUILD_AFLAGS   += $(call cc-option, -EL)
 KBUILD_AFLAGS   += $(call cc-option, -EL)
 LDFLAGS         += $(call cc-option, -EL)
 LDFLAGS         += $(call cc-option, -EL)
+CHECKFLAGS      += -D__NDS32_EL__
 else
 else
 KBUILD_CFLAGS   += $(call cc-option, -EB)
 KBUILD_CFLAGS   += $(call cc-option, -EB)
 KBUILD_AFLAGS   += $(call cc-option, -EB)
 KBUILD_AFLAGS   += $(call cc-option, -EB)
 LDFLAGS         += $(call cc-option, -EB)
 LDFLAGS         += $(call cc-option, -EB)
+CHECKFLAGS      += -D__NDS32_EB__
 endif
 endif
 
 
 boot := arch/nds32/boot
 boot := arch/nds32/boot

+ 7 - 2
arch/nds32/include/asm/cacheflush.h

@@ -8,6 +8,8 @@
 
 
 #define PG_dcache_dirty PG_arch_1
 #define PG_dcache_dirty PG_arch_1
 
 
+void flush_icache_range(unsigned long start, unsigned long end);
+void flush_icache_page(struct vm_area_struct *vma, struct page *page);
 #ifdef CONFIG_CPU_CACHE_ALIASING
 #ifdef CONFIG_CPU_CACHE_ALIASING
 void flush_cache_mm(struct mm_struct *mm);
 void flush_cache_mm(struct mm_struct *mm);
 void flush_cache_dup_mm(struct mm_struct *mm);
 void flush_cache_dup_mm(struct mm_struct *mm);
@@ -34,13 +36,16 @@ void flush_anon_page(struct vm_area_struct *vma,
 void flush_kernel_dcache_page(struct page *page);
 void flush_kernel_dcache_page(struct page *page);
 void flush_kernel_vmap_range(void *addr, int size);
 void flush_kernel_vmap_range(void *addr, int size);
 void invalidate_kernel_vmap_range(void *addr, int size);
 void invalidate_kernel_vmap_range(void *addr, int size);
-void flush_icache_range(unsigned long start, unsigned long end);
-void flush_icache_page(struct vm_area_struct *vma, struct page *page);
 #define flush_dcache_mmap_lock(mapping)   xa_lock_irq(&(mapping)->i_pages)
 #define flush_dcache_mmap_lock(mapping)   xa_lock_irq(&(mapping)->i_pages)
 #define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&(mapping)->i_pages)
 #define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&(mapping)->i_pages)
 
 
 #else
 #else
 #include <asm-generic/cacheflush.h>
 #include <asm-generic/cacheflush.h>
+#undef flush_icache_range
+#undef flush_icache_page
+#undef flush_icache_user_range
+void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
+	                     unsigned long addr, int len);
 #endif
 #endif
 
 
 #endif /* __NDS32_CACHEFLUSH_H__ */
 #endif /* __NDS32_CACHEFLUSH_H__ */

+ 1 - 1
arch/nds32/include/asm/futex.h

@@ -16,7 +16,7 @@
 	"	.popsection\n"					\
 	"	.popsection\n"					\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"4:	move	%0, " err_reg "\n"			\
 	"4:	move	%0, " err_reg "\n"			\
-	"	j	3b\n"					\
+	"	b	3b\n"					\
 	"	.popsection"
 	"	.popsection"
 
 
 #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg)	\
 #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg)	\

+ 2 - 1
arch/nds32/kernel/setup.c

@@ -278,7 +278,8 @@ static void __init setup_memory(void)
 
 
 void __init setup_arch(char **cmdline_p)
 void __init setup_arch(char **cmdline_p)
 {
 {
-	early_init_devtree( __dtb_start);
+	early_init_devtree(__atags_pointer ? \
+		phys_to_virt(__atags_pointer) : __dtb_start);
 
 
 	setup_cpuinfo();
 	setup_cpuinfo();
 
 

+ 40 - 60
arch/nds32/mm/cacheflush.c

@@ -13,7 +13,39 @@
 
 
 extern struct cache_info L1_cache_info[2];
 extern struct cache_info L1_cache_info[2];
 
 
-#ifndef CONFIG_CPU_CACHE_ALIASING
+void flush_icache_range(unsigned long start, unsigned long end)
+{
+	unsigned long line_size, flags;
+	line_size = L1_cache_info[DCACHE].line_size;
+	start = start & ~(line_size - 1);
+	end = (end + line_size - 1) & ~(line_size - 1);
+	local_irq_save(flags);
+	cpu_cache_wbinval_range(start, end, 1);
+	local_irq_restore(flags);
+}
+EXPORT_SYMBOL(flush_icache_range);
+
+void flush_icache_page(struct vm_area_struct *vma, struct page *page)
+{
+	unsigned long flags;
+	unsigned long kaddr;
+	local_irq_save(flags);
+	kaddr = (unsigned long)kmap_atomic(page);
+	cpu_cache_wbinval_page(kaddr, vma->vm_flags & VM_EXEC);
+	kunmap_atomic((void *)kaddr);
+	local_irq_restore(flags);
+}
+EXPORT_SYMBOL(flush_icache_page);
+
+void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
+	                     unsigned long addr, int len)
+{
+	unsigned long kaddr;
+	kaddr = (unsigned long)kmap_atomic(page) + (addr & ~PAGE_MASK);
+	flush_icache_range(kaddr, kaddr + len);
+	kunmap_atomic((void *)kaddr);
+}
+
 void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
 void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
 		      pte_t * pte)
 		      pte_t * pte)
 {
 {
@@ -35,19 +67,15 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
 
 
 	if ((test_and_clear_bit(PG_dcache_dirty, &page->flags)) ||
 	if ((test_and_clear_bit(PG_dcache_dirty, &page->flags)) ||
 	    (vma->vm_flags & VM_EXEC)) {
 	    (vma->vm_flags & VM_EXEC)) {
-
-		if (!PageHighMem(page)) {
-			cpu_cache_wbinval_page((unsigned long)
-					       page_address(page),
-					       vma->vm_flags & VM_EXEC);
-		} else {
-			unsigned long kaddr = (unsigned long)kmap_atomic(page);
-			cpu_cache_wbinval_page(kaddr, vma->vm_flags & VM_EXEC);
-			kunmap_atomic((void *)kaddr);
-		}
+		unsigned long kaddr;
+		local_irq_save(flags);
+		kaddr = (unsigned long)kmap_atomic(page);
+		cpu_cache_wbinval_page(kaddr, vma->vm_flags & VM_EXEC);
+		kunmap_atomic((void *)kaddr);
+		local_irq_restore(flags);
 	}
 	}
 }
 }
-#else
+#ifdef CONFIG_CPU_CACHE_ALIASING
 extern pte_t va_present(struct mm_struct *mm, unsigned long addr);
 extern pte_t va_present(struct mm_struct *mm, unsigned long addr);
 
 
 static inline unsigned long aliasing(unsigned long addr, unsigned long page)
 static inline unsigned long aliasing(unsigned long addr, unsigned long page)
@@ -317,52 +345,4 @@ void invalidate_kernel_vmap_range(void *addr, int size)
 	local_irq_restore(flags);
 	local_irq_restore(flags);
 }
 }
 EXPORT_SYMBOL(invalidate_kernel_vmap_range);
 EXPORT_SYMBOL(invalidate_kernel_vmap_range);
-
-void flush_icache_range(unsigned long start, unsigned long end)
-{
-	unsigned long line_size, flags;
-	line_size = L1_cache_info[DCACHE].line_size;
-	start = start & ~(line_size - 1);
-	end = (end + line_size - 1) & ~(line_size - 1);
-	local_irq_save(flags);
-	cpu_cache_wbinval_range(start, end, 1);
-	local_irq_restore(flags);
-}
-EXPORT_SYMBOL(flush_icache_range);
-
-void flush_icache_page(struct vm_area_struct *vma, struct page *page)
-{
-	unsigned long flags;
-	local_irq_save(flags);
-	cpu_cache_wbinval_page((unsigned long)page_address(page),
-			       vma->vm_flags & VM_EXEC);
-	local_irq_restore(flags);
-}
-
-void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
-		      pte_t * pte)
-{
-	struct page *page;
-	unsigned long flags;
-	unsigned long pfn = pte_pfn(*pte);
-
-	if (!pfn_valid(pfn))
-		return;
-
-	if (vma->vm_mm == current->active_mm) {
-		local_irq_save(flags);
-		__nds32__mtsr_dsb(addr, NDS32_SR_TLB_VPN);
-		__nds32__tlbop_rwr(*pte);
-		__nds32__isb();
-		local_irq_restore(flags);
-	}
-
-	page = pfn_to_page(pfn);
-	if (test_and_clear_bit(PG_dcache_dirty, &page->flags) ||
-	    (vma->vm_flags & VM_EXEC)) {
-		local_irq_save(flags);
-		cpu_dcache_wbinval_page((unsigned long)page_address(page));
-		local_irq_restore(flags);
-	}
-}
 #endif
 #endif

+ 1 - 0
arch/powerpc/Makefile

@@ -243,6 +243,7 @@ endif
 cpu-as-$(CONFIG_4xx)		+= -Wa,-m405
 cpu-as-$(CONFIG_4xx)		+= -Wa,-m405
 cpu-as-$(CONFIG_ALTIVEC)	+= $(call as-option,-Wa$(comma)-maltivec)
 cpu-as-$(CONFIG_ALTIVEC)	+= $(call as-option,-Wa$(comma)-maltivec)
 cpu-as-$(CONFIG_E200)		+= -Wa,-me200
 cpu-as-$(CONFIG_E200)		+= -Wa,-me200
+cpu-as-$(CONFIG_E500)		+= -Wa,-me500
 cpu-as-$(CONFIG_PPC_BOOK3S_64)	+= -Wa,-mpower4
 cpu-as-$(CONFIG_PPC_BOOK3S_64)	+= -Wa,-mpower4
 cpu-as-$(CONFIG_PPC_E500MC)	+= $(call as-option,-Wa$(comma)-me500mc)
 cpu-as-$(CONFIG_PPC_E500MC)	+= $(call as-option,-Wa$(comma)-me500mc)
 
 

+ 2 - 2
arch/powerpc/include/asm/mmu_context.h

@@ -35,9 +35,9 @@ extern struct mm_iommu_table_group_mem_t *mm_iommu_lookup_rm(
 extern struct mm_iommu_table_group_mem_t *mm_iommu_find(struct mm_struct *mm,
 extern struct mm_iommu_table_group_mem_t *mm_iommu_find(struct mm_struct *mm,
 		unsigned long ua, unsigned long entries);
 		unsigned long ua, unsigned long entries);
 extern long mm_iommu_ua_to_hpa(struct mm_iommu_table_group_mem_t *mem,
 extern long mm_iommu_ua_to_hpa(struct mm_iommu_table_group_mem_t *mem,
-		unsigned long ua, unsigned long *hpa);
+		unsigned long ua, unsigned int pageshift, unsigned long *hpa);
 extern long mm_iommu_ua_to_hpa_rm(struct mm_iommu_table_group_mem_t *mem,
 extern long mm_iommu_ua_to_hpa_rm(struct mm_iommu_table_group_mem_t *mem,
-		unsigned long ua, unsigned long *hpa);
+		unsigned long ua, unsigned int pageshift, unsigned long *hpa);
 extern long mm_iommu_mapped_inc(struct mm_iommu_table_group_mem_t *mem);
 extern long mm_iommu_mapped_inc(struct mm_iommu_table_group_mem_t *mem);
 extern void mm_iommu_mapped_dec(struct mm_iommu_table_group_mem_t *mem);
 extern void mm_iommu_mapped_dec(struct mm_iommu_table_group_mem_t *mem);
 #endif
 #endif

+ 2 - 0
arch/powerpc/kernel/idle_book3s.S

@@ -144,7 +144,9 @@ power9_restore_additional_sprs:
 	mtspr	SPRN_MMCR1, r4
 	mtspr	SPRN_MMCR1, r4
 
 
 	ld	r3, STOP_MMCR2(r13)
 	ld	r3, STOP_MMCR2(r13)
+	ld	r4, PACA_SPRG_VDSO(r13)
 	mtspr	SPRN_MMCR2, r3
 	mtspr	SPRN_MMCR2, r3
+	mtspr	SPRN_SPRG3, r4
 	blr
 	blr
 
 
 /*
 /*

+ 1 - 1
arch/powerpc/kvm/book3s_64_vio.c

@@ -449,7 +449,7 @@ long kvmppc_tce_iommu_do_map(struct kvm *kvm, struct iommu_table *tbl,
 		/* This only handles v2 IOMMU type, v1 is handled via ioctl() */
 		/* This only handles v2 IOMMU type, v1 is handled via ioctl() */
 		return H_TOO_HARD;
 		return H_TOO_HARD;
 
 
-	if (WARN_ON_ONCE(mm_iommu_ua_to_hpa(mem, ua, &hpa)))
+	if (WARN_ON_ONCE(mm_iommu_ua_to_hpa(mem, ua, tbl->it_page_shift, &hpa)))
 		return H_HARDWARE;
 		return H_HARDWARE;
 
 
 	if (mm_iommu_mapped_inc(mem))
 	if (mm_iommu_mapped_inc(mem))

+ 4 - 2
arch/powerpc/kvm/book3s_64_vio_hv.c

@@ -279,7 +279,8 @@ static long kvmppc_rm_tce_iommu_do_map(struct kvm *kvm, struct iommu_table *tbl,
 	if (!mem)
 	if (!mem)
 		return H_TOO_HARD;
 		return H_TOO_HARD;
 
 
-	if (WARN_ON_ONCE_RM(mm_iommu_ua_to_hpa_rm(mem, ua, &hpa)))
+	if (WARN_ON_ONCE_RM(mm_iommu_ua_to_hpa_rm(mem, ua, tbl->it_page_shift,
+			&hpa)))
 		return H_HARDWARE;
 		return H_HARDWARE;
 
 
 	pua = (void *) vmalloc_to_phys(pua);
 	pua = (void *) vmalloc_to_phys(pua);
@@ -469,7 +470,8 @@ long kvmppc_rm_h_put_tce_indirect(struct kvm_vcpu *vcpu,
 
 
 		mem = mm_iommu_lookup_rm(vcpu->kvm->mm, ua, IOMMU_PAGE_SIZE_4K);
 		mem = mm_iommu_lookup_rm(vcpu->kvm->mm, ua, IOMMU_PAGE_SIZE_4K);
 		if (mem)
 		if (mem)
-			prereg = mm_iommu_ua_to_hpa_rm(mem, ua, &tces) == 0;
+			prereg = mm_iommu_ua_to_hpa_rm(mem, ua,
+					IOMMU_PAGE_SHIFT_4K, &tces) == 0;
 	}
 	}
 
 
 	if (!prereg) {
 	if (!prereg) {

+ 35 - 2
arch/powerpc/mm/mmu_context_iommu.c

@@ -19,6 +19,7 @@
 #include <linux/hugetlb.h>
 #include <linux/hugetlb.h>
 #include <linux/swap.h>
 #include <linux/swap.h>
 #include <asm/mmu_context.h>
 #include <asm/mmu_context.h>
+#include <asm/pte-walk.h>
 
 
 static DEFINE_MUTEX(mem_list_mutex);
 static DEFINE_MUTEX(mem_list_mutex);
 
 
@@ -27,6 +28,7 @@ struct mm_iommu_table_group_mem_t {
 	struct rcu_head rcu;
 	struct rcu_head rcu;
 	unsigned long used;
 	unsigned long used;
 	atomic64_t mapped;
 	atomic64_t mapped;
+	unsigned int pageshift;
 	u64 ua;			/* userspace address */
 	u64 ua;			/* userspace address */
 	u64 entries;		/* number of entries in hpas[] */
 	u64 entries;		/* number of entries in hpas[] */
 	u64 *hpas;		/* vmalloc'ed */
 	u64 *hpas;		/* vmalloc'ed */
@@ -125,6 +127,8 @@ long mm_iommu_get(struct mm_struct *mm, unsigned long ua, unsigned long entries,
 {
 {
 	struct mm_iommu_table_group_mem_t *mem;
 	struct mm_iommu_table_group_mem_t *mem;
 	long i, j, ret = 0, locked_entries = 0;
 	long i, j, ret = 0, locked_entries = 0;
+	unsigned int pageshift;
+	unsigned long flags;
 	struct page *page = NULL;
 	struct page *page = NULL;
 
 
 	mutex_lock(&mem_list_mutex);
 	mutex_lock(&mem_list_mutex);
@@ -159,6 +163,12 @@ long mm_iommu_get(struct mm_struct *mm, unsigned long ua, unsigned long entries,
 		goto unlock_exit;
 		goto unlock_exit;
 	}
 	}
 
 
+	/*
+	 * For a starting point for a maximum page size calculation
+	 * we use @ua and @entries natural alignment to allow IOMMU pages
+	 * smaller than huge pages but still bigger than PAGE_SIZE.
+	 */
+	mem->pageshift = __ffs(ua | (entries << PAGE_SHIFT));
 	mem->hpas = vzalloc(array_size(entries, sizeof(mem->hpas[0])));
 	mem->hpas = vzalloc(array_size(entries, sizeof(mem->hpas[0])));
 	if (!mem->hpas) {
 	if (!mem->hpas) {
 		kfree(mem);
 		kfree(mem);
@@ -199,6 +209,23 @@ long mm_iommu_get(struct mm_struct *mm, unsigned long ua, unsigned long entries,
 			}
 			}
 		}
 		}
 populate:
 populate:
+		pageshift = PAGE_SHIFT;
+		if (PageCompound(page)) {
+			pte_t *pte;
+			struct page *head = compound_head(page);
+			unsigned int compshift = compound_order(head);
+
+			local_irq_save(flags); /* disables as well */
+			pte = find_linux_pte(mm->pgd, ua, NULL, &pageshift);
+			local_irq_restore(flags);
+
+			/* Double check it is still the same pinned page */
+			if (pte && pte_page(*pte) == head &&
+					pageshift == compshift)
+				pageshift = max_t(unsigned int, pageshift,
+						PAGE_SHIFT);
+		}
+		mem->pageshift = min(mem->pageshift, pageshift);
 		mem->hpas[i] = page_to_pfn(page) << PAGE_SHIFT;
 		mem->hpas[i] = page_to_pfn(page) << PAGE_SHIFT;
 	}
 	}
 
 
@@ -349,7 +376,7 @@ struct mm_iommu_table_group_mem_t *mm_iommu_find(struct mm_struct *mm,
 EXPORT_SYMBOL_GPL(mm_iommu_find);
 EXPORT_SYMBOL_GPL(mm_iommu_find);
 
 
 long mm_iommu_ua_to_hpa(struct mm_iommu_table_group_mem_t *mem,
 long mm_iommu_ua_to_hpa(struct mm_iommu_table_group_mem_t *mem,
-		unsigned long ua, unsigned long *hpa)
+		unsigned long ua, unsigned int pageshift, unsigned long *hpa)
 {
 {
 	const long entry = (ua - mem->ua) >> PAGE_SHIFT;
 	const long entry = (ua - mem->ua) >> PAGE_SHIFT;
 	u64 *va = &mem->hpas[entry];
 	u64 *va = &mem->hpas[entry];
@@ -357,6 +384,9 @@ long mm_iommu_ua_to_hpa(struct mm_iommu_table_group_mem_t *mem,
 	if (entry >= mem->entries)
 	if (entry >= mem->entries)
 		return -EFAULT;
 		return -EFAULT;
 
 
+	if (pageshift > mem->pageshift)
+		return -EFAULT;
+
 	*hpa = *va | (ua & ~PAGE_MASK);
 	*hpa = *va | (ua & ~PAGE_MASK);
 
 
 	return 0;
 	return 0;
@@ -364,7 +394,7 @@ long mm_iommu_ua_to_hpa(struct mm_iommu_table_group_mem_t *mem,
 EXPORT_SYMBOL_GPL(mm_iommu_ua_to_hpa);
 EXPORT_SYMBOL_GPL(mm_iommu_ua_to_hpa);
 
 
 long mm_iommu_ua_to_hpa_rm(struct mm_iommu_table_group_mem_t *mem,
 long mm_iommu_ua_to_hpa_rm(struct mm_iommu_table_group_mem_t *mem,
-		unsigned long ua, unsigned long *hpa)
+		unsigned long ua, unsigned int pageshift, unsigned long *hpa)
 {
 {
 	const long entry = (ua - mem->ua) >> PAGE_SHIFT;
 	const long entry = (ua - mem->ua) >> PAGE_SHIFT;
 	void *va = &mem->hpas[entry];
 	void *va = &mem->hpas[entry];
@@ -373,6 +403,9 @@ long mm_iommu_ua_to_hpa_rm(struct mm_iommu_table_group_mem_t *mem,
 	if (entry >= mem->entries)
 	if (entry >= mem->entries)
 		return -EFAULT;
 		return -EFAULT;
 
 
+	if (pageshift > mem->pageshift)
+		return -EFAULT;
+
 	pa = (void *) vmalloc_to_phys(va);
 	pa = (void *) vmalloc_to_phys(va);
 	if (!pa)
 	if (!pa)
 		return -EFAULT;
 		return -EFAULT;

+ 2 - 2
arch/powerpc/xmon/xmon.c

@@ -2734,7 +2734,7 @@ generic_inst_dump(unsigned long adr, long count, int praddr,
 {
 {
 	int nr, dotted;
 	int nr, dotted;
 	unsigned long first_adr;
 	unsigned long first_adr;
-	unsigned long inst, last_inst = 0;
+	unsigned int inst, last_inst = 0;
 	unsigned char val[4];
 	unsigned char val[4];
 
 
 	dotted = 0;
 	dotted = 0;
@@ -2758,7 +2758,7 @@ generic_inst_dump(unsigned long adr, long count, int praddr,
 		dotted = 0;
 		dotted = 0;
 		last_inst = inst;
 		last_inst = inst;
 		if (praddr)
 		if (praddr)
-			printf(REG"  %.8lx", adr, inst);
+			printf(REG"  %.8x", adr, inst);
 		printf("\t");
 		printf("\t");
 		dump_func(inst, adr);
 		dump_func(inst, adr);
 		printf("\n");
 		printf("\n");

+ 1 - 1
arch/x86/Kconfig

@@ -63,7 +63,7 @@ config X86
 	select ARCH_HAS_PTE_SPECIAL
 	select ARCH_HAS_PTE_SPECIAL
 	select ARCH_HAS_REFCOUNT
 	select ARCH_HAS_REFCOUNT
 	select ARCH_HAS_UACCESS_FLUSHCACHE	if X86_64
 	select ARCH_HAS_UACCESS_FLUSHCACHE	if X86_64
-	select ARCH_HAS_UACCESS_MCSAFE		if X86_64
+	select ARCH_HAS_UACCESS_MCSAFE		if X86_64 && X86_MCE
 	select ARCH_HAS_SET_MEMORY
 	select ARCH_HAS_SET_MEMORY
 	select ARCH_HAS_SG_CHAIN
 	select ARCH_HAS_SG_CHAIN
 	select ARCH_HAS_STRICT_KERNEL_RWX
 	select ARCH_HAS_STRICT_KERNEL_RWX

+ 3 - 9
arch/x86/boot/compressed/eboot.c

@@ -114,18 +114,12 @@ __setup_efi_pci(efi_pci_io_protocol_t *pci, struct pci_setup_rom **__rom)
 	struct pci_setup_rom *rom = NULL;
 	struct pci_setup_rom *rom = NULL;
 	efi_status_t status;
 	efi_status_t status;
 	unsigned long size;
 	unsigned long size;
-	uint64_t attributes, romsize;
+	uint64_t romsize;
 	void *romimage;
 	void *romimage;
 
 
-	status = efi_call_proto(efi_pci_io_protocol, attributes, pci,
-				EfiPciIoAttributeOperationGet, 0ULL,
-				&attributes);
-	if (status != EFI_SUCCESS)
-		return status;
-
 	/*
 	/*
-	 * Some firmware images contain EFI function pointers at the place where the
-	 * romimage and romsize fields are supposed to be. Typically the EFI
+	 * Some firmware images contain EFI function pointers at the place where
+	 * the romimage and romsize fields are supposed to be. Typically the EFI
 	 * code is mapped at high addresses, translating to an unrealistically
 	 * code is mapped at high addresses, translating to an unrealistically
 	 * large romsize. The UEFI spec limits the size of option ROMs to 16
 	 * large romsize. The UEFI spec limits the size of option ROMs to 16
 	 * MiB so we reject any ROMs over 16 MiB in size to catch this.
 	 * MiB so we reject any ROMs over 16 MiB in size to catch this.

+ 5 - 3
arch/x86/events/intel/ds.c

@@ -408,9 +408,11 @@ static int alloc_bts_buffer(int cpu)
 	ds->bts_buffer_base = (unsigned long) cea;
 	ds->bts_buffer_base = (unsigned long) cea;
 	ds_update_cea(cea, buffer, BTS_BUFFER_SIZE, PAGE_KERNEL);
 	ds_update_cea(cea, buffer, BTS_BUFFER_SIZE, PAGE_KERNEL);
 	ds->bts_index = ds->bts_buffer_base;
 	ds->bts_index = ds->bts_buffer_base;
-	max = BTS_RECORD_SIZE * (BTS_BUFFER_SIZE / BTS_RECORD_SIZE);
-	ds->bts_absolute_maximum = ds->bts_buffer_base + max;
-	ds->bts_interrupt_threshold = ds->bts_absolute_maximum - (max / 16);
+	max = BTS_BUFFER_SIZE / BTS_RECORD_SIZE;
+	ds->bts_absolute_maximum = ds->bts_buffer_base +
+					max * BTS_RECORD_SIZE;
+	ds->bts_interrupt_threshold = ds->bts_absolute_maximum -
+					(max / 16) * BTS_RECORD_SIZE;
 	return 0;
 	return 0;
 }
 }
 
 

+ 0 - 6
arch/x86/include/asm/apm.h

@@ -7,8 +7,6 @@
 #ifndef _ASM_X86_MACH_DEFAULT_APM_H
 #ifndef _ASM_X86_MACH_DEFAULT_APM_H
 #define _ASM_X86_MACH_DEFAULT_APM_H
 #define _ASM_X86_MACH_DEFAULT_APM_H
 
 
-#include <asm/nospec-branch.h>
-
 #ifdef APM_ZERO_SEGS
 #ifdef APM_ZERO_SEGS
 #	define APM_DO_ZERO_SEGS \
 #	define APM_DO_ZERO_SEGS \
 		"pushl %%ds\n\t" \
 		"pushl %%ds\n\t" \
@@ -34,7 +32,6 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in,
 	 * N.B. We do NOT need a cld after the BIOS call
 	 * N.B. We do NOT need a cld after the BIOS call
 	 * because we always save and restore the flags.
 	 * because we always save and restore the flags.
 	 */
 	 */
-	firmware_restrict_branch_speculation_start();
 	__asm__ __volatile__(APM_DO_ZERO_SEGS
 	__asm__ __volatile__(APM_DO_ZERO_SEGS
 		"pushl %%edi\n\t"
 		"pushl %%edi\n\t"
 		"pushl %%ebp\n\t"
 		"pushl %%ebp\n\t"
@@ -47,7 +44,6 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in,
 		  "=S" (*esi)
 		  "=S" (*esi)
 		: "a" (func), "b" (ebx_in), "c" (ecx_in)
 		: "a" (func), "b" (ebx_in), "c" (ecx_in)
 		: "memory", "cc");
 		: "memory", "cc");
-	firmware_restrict_branch_speculation_end();
 }
 }
 
 
 static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in,
 static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in,
@@ -60,7 +56,6 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in,
 	 * N.B. We do NOT need a cld after the BIOS call
 	 * N.B. We do NOT need a cld after the BIOS call
 	 * because we always save and restore the flags.
 	 * because we always save and restore the flags.
 	 */
 	 */
-	firmware_restrict_branch_speculation_start();
 	__asm__ __volatile__(APM_DO_ZERO_SEGS
 	__asm__ __volatile__(APM_DO_ZERO_SEGS
 		"pushl %%edi\n\t"
 		"pushl %%edi\n\t"
 		"pushl %%ebp\n\t"
 		"pushl %%ebp\n\t"
@@ -73,7 +68,6 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in,
 		  "=S" (si)
 		  "=S" (si)
 		: "a" (func), "b" (ebx_in), "c" (ecx_in)
 		: "a" (func), "b" (ebx_in), "c" (ecx_in)
 		: "memory", "cc");
 		: "memory", "cc");
-	firmware_restrict_branch_speculation_end();
 	return error;
 	return error;
 }
 }
 
 

+ 6 - 1
arch/x86/include/asm/uaccess_64.h

@@ -52,7 +52,12 @@ copy_to_user_mcsafe(void *to, const void *from, unsigned len)
 	unsigned long ret;
 	unsigned long ret;
 
 
 	__uaccess_begin();
 	__uaccess_begin();
-	ret = memcpy_mcsafe(to, from, len);
+	/*
+	 * Note, __memcpy_mcsafe() is explicitly used since it can
+	 * handle exceptions / faults.  memcpy_mcsafe() may fall back to
+	 * memcpy() which lacks this handling.
+	 */
+	ret = __memcpy_mcsafe(to, from, len);
 	__uaccess_end();
 	__uaccess_end();
 	return ret;
 	return ret;
 }
 }

+ 5 - 0
arch/x86/kernel/apm_32.c

@@ -240,6 +240,7 @@
 #include <asm/olpc.h>
 #include <asm/olpc.h>
 #include <asm/paravirt.h>
 #include <asm/paravirt.h>
 #include <asm/reboot.h>
 #include <asm/reboot.h>
+#include <asm/nospec-branch.h>
 
 
 #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT)
 #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT)
 extern int (*console_blank_hook)(int);
 extern int (*console_blank_hook)(int);
@@ -614,11 +615,13 @@ static long __apm_bios_call(void *_call)
 	gdt[0x40 / 8] = bad_bios_desc;
 	gdt[0x40 / 8] = bad_bios_desc;
 
 
 	apm_irq_save(flags);
 	apm_irq_save(flags);
+	firmware_restrict_branch_speculation_start();
 	APM_DO_SAVE_SEGS;
 	APM_DO_SAVE_SEGS;
 	apm_bios_call_asm(call->func, call->ebx, call->ecx,
 	apm_bios_call_asm(call->func, call->ebx, call->ecx,
 			  &call->eax, &call->ebx, &call->ecx, &call->edx,
 			  &call->eax, &call->ebx, &call->ecx, &call->edx,
 			  &call->esi);
 			  &call->esi);
 	APM_DO_RESTORE_SEGS;
 	APM_DO_RESTORE_SEGS;
+	firmware_restrict_branch_speculation_end();
 	apm_irq_restore(flags);
 	apm_irq_restore(flags);
 	gdt[0x40 / 8] = save_desc_40;
 	gdt[0x40 / 8] = save_desc_40;
 	put_cpu();
 	put_cpu();
@@ -690,10 +693,12 @@ static long __apm_bios_call_simple(void *_call)
 	gdt[0x40 / 8] = bad_bios_desc;
 	gdt[0x40 / 8] = bad_bios_desc;
 
 
 	apm_irq_save(flags);
 	apm_irq_save(flags);
+	firmware_restrict_branch_speculation_start();
 	APM_DO_SAVE_SEGS;
 	APM_DO_SAVE_SEGS;
 	error = apm_bios_call_simple_asm(call->func, call->ebx, call->ecx,
 	error = apm_bios_call_simple_asm(call->func, call->ebx, call->ecx,
 					 &call->eax);
 					 &call->eax);
 	APM_DO_RESTORE_SEGS;
 	APM_DO_RESTORE_SEGS;
+	firmware_restrict_branch_speculation_end();
 	apm_irq_restore(flags);
 	apm_irq_restore(flags);
 	gdt[0x40 / 8] = save_desc_40;
 	gdt[0x40 / 8] = save_desc_40;
 	put_cpu();
 	put_cpu();

+ 0 - 3
arch/x86/kernel/cpu/mcheck/mce.c

@@ -2165,9 +2165,6 @@ static ssize_t store_int_with_restart(struct device *s,
 	if (check_interval == old_check_interval)
 	if (check_interval == old_check_interval)
 		return ret;
 		return ret;
 
 
-	if (check_interval < 1)
-		check_interval = 1;
-
 	mutex_lock(&mce_sysfs_mutex);
 	mutex_lock(&mce_sysfs_mutex);
 	mce_restart();
 	mce_restart();
 	mutex_unlock(&mce_sysfs_mutex);
 	mutex_unlock(&mce_sysfs_mutex);

+ 6 - 6
arch/x86/kernel/kvmclock.c

@@ -138,6 +138,7 @@ static unsigned long kvm_get_tsc_khz(void)
 	src = &hv_clock[cpu].pvti;
 	src = &hv_clock[cpu].pvti;
 	tsc_khz = pvclock_tsc_khz(src);
 	tsc_khz = pvclock_tsc_khz(src);
 	put_cpu();
 	put_cpu();
+	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 	return tsc_khz;
 	return tsc_khz;
 }
 }
 
 
@@ -319,6 +320,8 @@ void __init kvmclock_init(void)
 	printk(KERN_INFO "kvm-clock: Using msrs %x and %x",
 	printk(KERN_INFO "kvm-clock: Using msrs %x and %x",
 		msr_kvm_system_time, msr_kvm_wall_clock);
 		msr_kvm_system_time, msr_kvm_wall_clock);
 
 
+	pvclock_set_pvti_cpu0_va(hv_clock);
+
 	if (kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE_STABLE_BIT))
 	if (kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE_STABLE_BIT))
 		pvclock_set_flags(PVCLOCK_TSC_STABLE_BIT);
 		pvclock_set_flags(PVCLOCK_TSC_STABLE_BIT);
 
 
@@ -366,14 +369,11 @@ int __init kvm_setup_vsyscall_timeinfo(void)
 	vcpu_time = &hv_clock[cpu].pvti;
 	vcpu_time = &hv_clock[cpu].pvti;
 	flags = pvclock_read_flags(vcpu_time);
 	flags = pvclock_read_flags(vcpu_time);
 
 
-	if (!(flags & PVCLOCK_TSC_STABLE_BIT)) {
-		put_cpu();
-		return 1;
-	}
-
-	pvclock_set_pvti_cpu0_va(hv_clock);
 	put_cpu();
 	put_cpu();
 
 
+	if (!(flags & PVCLOCK_TSC_STABLE_BIT))
+		return 1;
+
 	kvm_clock.archdata.vclock_mode = VCLOCK_PVCLOCK;
 	kvm_clock.archdata.vclock_mode = VCLOCK_PVCLOCK;
 #endif
 #endif
 	return 0;
 	return 0;

+ 1 - 1
arch/x86/kvm/Kconfig

@@ -85,7 +85,7 @@ config KVM_AMD_SEV
 	def_bool y
 	def_bool y
 	bool "AMD Secure Encrypted Virtualization (SEV) support"
 	bool "AMD Secure Encrypted Virtualization (SEV) support"
 	depends on KVM_AMD && X86_64
 	depends on KVM_AMD && X86_64
-	depends on CRYPTO_DEV_CCP && CRYPTO_DEV_CCP_DD && CRYPTO_DEV_SP_PSP
+	depends on CRYPTO_DEV_SP_PSP && !(KVM_AMD=y && CRYPTO_DEV_CCP_DD=m)
 	---help---
 	---help---
 	Provides support for launching Encrypted VMs on AMD processors.
 	Provides support for launching Encrypted VMs on AMD processors.
 
 

+ 42 - 19
arch/x86/kvm/vmx.c

@@ -2571,6 +2571,7 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
 	struct vcpu_vmx *vmx = to_vmx(vcpu);
 	struct vcpu_vmx *vmx = to_vmx(vcpu);
 #ifdef CONFIG_X86_64
 #ifdef CONFIG_X86_64
 	int cpu = raw_smp_processor_id();
 	int cpu = raw_smp_processor_id();
+	unsigned long fs_base, kernel_gs_base;
 #endif
 #endif
 	int i;
 	int i;
 
 
@@ -2586,12 +2587,20 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
 	vmx->host_state.gs_ldt_reload_needed = vmx->host_state.ldt_sel;
 	vmx->host_state.gs_ldt_reload_needed = vmx->host_state.ldt_sel;
 
 
 #ifdef CONFIG_X86_64
 #ifdef CONFIG_X86_64
-	save_fsgs_for_kvm();
-	vmx->host_state.fs_sel = current->thread.fsindex;
-	vmx->host_state.gs_sel = current->thread.gsindex;
-#else
-	savesegment(fs, vmx->host_state.fs_sel);
-	savesegment(gs, vmx->host_state.gs_sel);
+	if (likely(is_64bit_mm(current->mm))) {
+		save_fsgs_for_kvm();
+		vmx->host_state.fs_sel = current->thread.fsindex;
+		vmx->host_state.gs_sel = current->thread.gsindex;
+		fs_base = current->thread.fsbase;
+		kernel_gs_base = current->thread.gsbase;
+	} else {
+#endif
+		savesegment(fs, vmx->host_state.fs_sel);
+		savesegment(gs, vmx->host_state.gs_sel);
+#ifdef CONFIG_X86_64
+		fs_base = read_msr(MSR_FS_BASE);
+		kernel_gs_base = read_msr(MSR_KERNEL_GS_BASE);
+	}
 #endif
 #endif
 	if (!(vmx->host_state.fs_sel & 7)) {
 	if (!(vmx->host_state.fs_sel & 7)) {
 		vmcs_write16(HOST_FS_SELECTOR, vmx->host_state.fs_sel);
 		vmcs_write16(HOST_FS_SELECTOR, vmx->host_state.fs_sel);
@@ -2611,10 +2620,10 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
 	savesegment(ds, vmx->host_state.ds_sel);
 	savesegment(ds, vmx->host_state.ds_sel);
 	savesegment(es, vmx->host_state.es_sel);
 	savesegment(es, vmx->host_state.es_sel);
 
 
-	vmcs_writel(HOST_FS_BASE, current->thread.fsbase);
+	vmcs_writel(HOST_FS_BASE, fs_base);
 	vmcs_writel(HOST_GS_BASE, cpu_kernelmode_gs_base(cpu));
 	vmcs_writel(HOST_GS_BASE, cpu_kernelmode_gs_base(cpu));
 
 
-	vmx->msr_host_kernel_gs_base = current->thread.gsbase;
+	vmx->msr_host_kernel_gs_base = kernel_gs_base;
 	if (is_long_mode(&vmx->vcpu))
 	if (is_long_mode(&vmx->vcpu))
 		wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
 		wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
 #else
 #else
@@ -4322,11 +4331,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
 	vmcs_conf->order = get_order(vmcs_conf->size);
 	vmcs_conf->order = get_order(vmcs_conf->size);
 	vmcs_conf->basic_cap = vmx_msr_high & ~0x1fff;
 	vmcs_conf->basic_cap = vmx_msr_high & ~0x1fff;
 
 
-	/* KVM supports Enlightened VMCS v1 only */
-	if (static_branch_unlikely(&enable_evmcs))
-		vmcs_conf->revision_id = KVM_EVMCS_VERSION;
-	else
-		vmcs_conf->revision_id = vmx_msr_low;
+	vmcs_conf->revision_id = vmx_msr_low;
 
 
 	vmcs_conf->pin_based_exec_ctrl = _pin_based_exec_control;
 	vmcs_conf->pin_based_exec_ctrl = _pin_based_exec_control;
 	vmcs_conf->cpu_based_exec_ctrl = _cpu_based_exec_control;
 	vmcs_conf->cpu_based_exec_ctrl = _cpu_based_exec_control;
@@ -4396,7 +4401,13 @@ static struct vmcs *alloc_vmcs_cpu(int cpu)
 		return NULL;
 		return NULL;
 	vmcs = page_address(pages);
 	vmcs = page_address(pages);
 	memset(vmcs, 0, vmcs_config.size);
 	memset(vmcs, 0, vmcs_config.size);
-	vmcs->revision_id = vmcs_config.revision_id; /* vmcs revision id */
+
+	/* KVM supports Enlightened VMCS v1 only */
+	if (static_branch_unlikely(&enable_evmcs))
+		vmcs->revision_id = KVM_EVMCS_VERSION;
+	else
+		vmcs->revision_id = vmcs_config.revision_id;
+
 	return vmcs;
 	return vmcs;
 }
 }
 
 
@@ -4564,6 +4575,19 @@ static __init int alloc_kvm_area(void)
 			return -ENOMEM;
 			return -ENOMEM;
 		}
 		}
 
 
+		/*
+		 * When eVMCS is enabled, alloc_vmcs_cpu() sets
+		 * vmcs->revision_id to KVM_EVMCS_VERSION instead of
+		 * revision_id reported by MSR_IA32_VMX_BASIC.
+		 *
+		 * However, even though not explictly documented by
+		 * TLFS, VMXArea passed as VMXON argument should
+		 * still be marked with revision_id reported by
+		 * physical CPU.
+		 */
+		if (static_branch_unlikely(&enable_evmcs))
+			vmcs->revision_id = vmcs_config.revision_id;
+
 		per_cpu(vmxarea, cpu) = vmcs;
 		per_cpu(vmxarea, cpu) = vmcs;
 	}
 	}
 	return 0;
 	return 0;
@@ -11753,7 +11777,6 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu)
 {
 {
 	struct vcpu_vmx *vmx = to_vmx(vcpu);
 	struct vcpu_vmx *vmx = to_vmx(vcpu);
 	struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
 	struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
-	u32 msr_entry_idx;
 	u32 exit_qual;
 	u32 exit_qual;
 	int r;
 	int r;
 
 
@@ -11775,10 +11798,10 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu)
 	nested_get_vmcs12_pages(vcpu, vmcs12);
 	nested_get_vmcs12_pages(vcpu, vmcs12);
 
 
 	r = EXIT_REASON_MSR_LOAD_FAIL;
 	r = EXIT_REASON_MSR_LOAD_FAIL;
-	msr_entry_idx = nested_vmx_load_msr(vcpu,
-					    vmcs12->vm_entry_msr_load_addr,
-					    vmcs12->vm_entry_msr_load_count);
-	if (msr_entry_idx)
+	exit_qual = nested_vmx_load_msr(vcpu,
+					vmcs12->vm_entry_msr_load_addr,
+					vmcs12->vm_entry_msr_load_count);
+	if (exit_qual)
 		goto fail;
 		goto fail;
 
 
 	/*
 	/*

+ 3 - 1
arch/x86/kvm/x86.c

@@ -1097,6 +1097,7 @@ static u32 msr_based_features[] = {
 
 
 	MSR_F10H_DECFG,
 	MSR_F10H_DECFG,
 	MSR_IA32_UCODE_REV,
 	MSR_IA32_UCODE_REV,
+	MSR_IA32_ARCH_CAPABILITIES,
 };
 };
 
 
 static unsigned int num_msr_based_features;
 static unsigned int num_msr_based_features;
@@ -1105,7 +1106,8 @@ static int kvm_get_msr_feature(struct kvm_msr_entry *msr)
 {
 {
 	switch (msr->index) {
 	switch (msr->index) {
 	case MSR_IA32_UCODE_REV:
 	case MSR_IA32_UCODE_REV:
-		rdmsrl(msr->index, msr->data);
+	case MSR_IA32_ARCH_CAPABILITIES:
+		rdmsrl_safe(msr->index, &msr->data);
 		break;
 		break;
 	default:
 	default:
 		if (kvm_x86_ops->get_msr_feature(msr))
 		if (kvm_x86_ops->get_msr_feature(msr))

+ 1 - 1
arch/x86/purgatory/Makefile

@@ -6,7 +6,7 @@ purgatory-y := purgatory.o stack.o setup-x86_$(BITS).o sha256.o entry64.o string
 targets += $(purgatory-y)
 targets += $(purgatory-y)
 PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y))
 PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y))
 
 
-$(obj)/sha256.o: $(srctree)/lib/sha256.c
+$(obj)/sha256.o: $(srctree)/lib/sha256.c FORCE
 	$(call if_changed_rule,cc_o_c)
 	$(call if_changed_rule,cc_o_c)
 
 
 LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib -z nodefaultlib
 LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib -z nodefaultlib

+ 12 - 13
arch/x86/xen/enlighten_pv.c

@@ -1207,12 +1207,20 @@ asmlinkage __visible void __init xen_start_kernel(void)
 
 
 	xen_setup_features();
 	xen_setup_features();
 
 
-	xen_setup_machphys_mapping();
-
 	/* Install Xen paravirt ops */
 	/* Install Xen paravirt ops */
 	pv_info = xen_info;
 	pv_info = xen_info;
 	pv_init_ops.patch = paravirt_patch_default;
 	pv_init_ops.patch = paravirt_patch_default;
 	pv_cpu_ops = xen_cpu_ops;
 	pv_cpu_ops = xen_cpu_ops;
+	xen_init_irq_ops();
+
+	/*
+	 * Setup xen_vcpu early because it is needed for
+	 * local_irq_disable(), irqs_disabled(), e.g. in printk().
+	 *
+	 * Don't do the full vcpu_info placement stuff until we have
+	 * the cpu_possible_mask and a non-dummy shared_info.
+	 */
+	xen_vcpu_info_reset(0);
 
 
 	x86_platform.get_nmi_reason = xen_get_nmi_reason;
 	x86_platform.get_nmi_reason = xen_get_nmi_reason;
 
 
@@ -1225,10 +1233,12 @@ asmlinkage __visible void __init xen_start_kernel(void)
 	 * Set up some pagetable state before starting to set any ptes.
 	 * Set up some pagetable state before starting to set any ptes.
 	 */
 	 */
 
 
+	xen_setup_machphys_mapping();
 	xen_init_mmu_ops();
 	xen_init_mmu_ops();
 
 
 	/* Prevent unwanted bits from being set in PTEs. */
 	/* Prevent unwanted bits from being set in PTEs. */
 	__supported_pte_mask &= ~_PAGE_GLOBAL;
 	__supported_pte_mask &= ~_PAGE_GLOBAL;
+	__default_kernel_pte_mask &= ~_PAGE_GLOBAL;
 
 
 	/*
 	/*
 	 * Prevent page tables from being allocated in highmem, even
 	 * Prevent page tables from being allocated in highmem, even
@@ -1249,20 +1259,9 @@ asmlinkage __visible void __init xen_start_kernel(void)
 	get_cpu_cap(&boot_cpu_data);
 	get_cpu_cap(&boot_cpu_data);
 	x86_configure_nx();
 	x86_configure_nx();
 
 
-	xen_init_irq_ops();
-
 	/* Let's presume PV guests always boot on vCPU with id 0. */
 	/* Let's presume PV guests always boot on vCPU with id 0. */
 	per_cpu(xen_vcpu_id, 0) = 0;
 	per_cpu(xen_vcpu_id, 0) = 0;
 
 
-	/*
-	 * Setup xen_vcpu early because idt_setup_early_handler needs it for
-	 * local_irq_disable(), irqs_disabled().
-	 *
-	 * Don't do the full vcpu_info placement stuff until we have
-	 * the cpu_possible_mask and a non-dummy shared_info.
-	 */
-	xen_vcpu_info_reset(0);
-
 	idt_setup_early_handler();
 	idt_setup_early_handler();
 
 
 	xen_init_capabilities();
 	xen_init_capabilities();

+ 1 - 3
arch/x86/xen/irq.c

@@ -128,8 +128,6 @@ static const struct pv_irq_ops xen_irq_ops __initconst = {
 
 
 void __init xen_init_irq_ops(void)
 void __init xen_init_irq_ops(void)
 {
 {
-	/* For PVH we use default pv_irq_ops settings. */
-	if (!xen_feature(XENFEAT_hvm_callback_vector))
-		pv_irq_ops = xen_irq_ops;
+	pv_irq_ops = xen_irq_ops;
 	x86_init.irqs.intr_init = xen_init_IRQ;
 	x86_init.irqs.intr_init = xen_init_IRQ;
 }
 }

+ 0 - 2
block/bsg.c

@@ -196,8 +196,6 @@ bsg_map_hdr(struct request_queue *q, struct sg_io_v4 *hdr, fmode_t mode)
 	} else if (hdr->din_xfer_len) {
 	} else if (hdr->din_xfer_len) {
 		ret = blk_rq_map_user(q, rq, NULL, uptr64(hdr->din_xferp),
 		ret = blk_rq_map_user(q, rq, NULL, uptr64(hdr->din_xferp),
 				hdr->din_xfer_len, GFP_KERNEL);
 				hdr->din_xfer_len, GFP_KERNEL);
-	} else {
-		ret = blk_rq_map_user(q, rq, NULL, NULL, 0, GFP_KERNEL);
 	}
 	}
 
 
 	if (ret)
 	if (ret)

+ 3 - 1
crypto/af_alg.c

@@ -1155,8 +1155,10 @@ int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags,
 
 
 		/* make one iovec available as scatterlist */
 		/* make one iovec available as scatterlist */
 		err = af_alg_make_sg(&rsgl->sgl, &msg->msg_iter, seglen);
 		err = af_alg_make_sg(&rsgl->sgl, &msg->msg_iter, seglen);
-		if (err < 0)
+		if (err < 0) {
+			rsgl->sg_num_bytes = 0;
 			return err;
 			return err;
+		}
 
 
 		/* chain the new scatterlist with previous one */
 		/* chain the new scatterlist with previous one */
 		if (areq->last_rsgl)
 		if (areq->last_rsgl)

+ 11 - 4
drivers/acpi/acpica/hwsleep.c

@@ -51,16 +51,23 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state)
 		return_ACPI_STATUS(status);
 		return_ACPI_STATUS(status);
 	}
 	}
 
 
-	/*
-	 * 1) Disable all GPEs
-	 * 2) Enable all wakeup GPEs
-	 */
+	/* Disable all GPEs */
 	status = acpi_hw_disable_all_gpes();
 	status = acpi_hw_disable_all_gpes();
 	if (ACPI_FAILURE(status)) {
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 		return_ACPI_STATUS(status);
 	}
 	}
+	/*
+	 * If the target sleep state is S5, clear all GPEs and fixed events too
+	 */
+	if (sleep_state == ACPI_STATE_S5) {
+		status = acpi_hw_clear_acpi_status();
+		if (ACPI_FAILURE(status)) {
+			return_ACPI_STATUS(status);
+		}
+	}
 	acpi_gbl_system_awake_and_running = FALSE;
 	acpi_gbl_system_awake_and_running = FALSE;
 
 
+	 /* Enable all wakeup GPEs */
 	status = acpi_hw_enable_all_wakeup_gpes();
 	status = acpi_hw_enable_all_wakeup_gpes();
 	if (ACPI_FAILURE(status)) {
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 		return_ACPI_STATUS(status);

+ 1 - 1
drivers/acpi/ec.c

@@ -2042,7 +2042,7 @@ static const struct dmi_system_id acpi_ec_no_wakeup[] = {
 		.ident = "Thinkpad X1 Carbon 6th",
 		.ident = "Thinkpad X1 Carbon 6th",
 		.matches = {
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "20KGS3JF01"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Thinkpad X1 Carbon 6th"),
 		},
 		},
 	},
 	},
 	{ },
 	{ },

+ 37 - 11
drivers/acpi/nfit/core.c

@@ -408,6 +408,8 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 	const guid_t *guid;
 	const guid_t *guid;
 	int rc, i;
 	int rc, i;
 
 
+	if (cmd_rc)
+		*cmd_rc = -EINVAL;
 	func = cmd;
 	func = cmd;
 	if (cmd == ND_CMD_CALL) {
 	if (cmd == ND_CMD_CALL) {
 		call_pkg = buf;
 		call_pkg = buf;
@@ -518,6 +520,8 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		 * If we return an error (like elsewhere) then caller wouldn't
 		 * If we return an error (like elsewhere) then caller wouldn't
 		 * be able to rely upon data returned to make calculation.
 		 * be able to rely upon data returned to make calculation.
 		 */
 		 */
+		if (cmd_rc)
+			*cmd_rc = 0;
 		return 0;
 		return 0;
 	}
 	}
 
 
@@ -1273,7 +1277,7 @@ static ssize_t scrub_show(struct device *dev,
 
 
 		mutex_lock(&acpi_desc->init_mutex);
 		mutex_lock(&acpi_desc->init_mutex);
 		rc = sprintf(buf, "%d%s", acpi_desc->scrub_count,
 		rc = sprintf(buf, "%d%s", acpi_desc->scrub_count,
-				work_busy(&acpi_desc->dwork.work)
+				acpi_desc->scrub_busy
 				&& !acpi_desc->cancel ? "+\n" : "\n");
 				&& !acpi_desc->cancel ? "+\n" : "\n");
 		mutex_unlock(&acpi_desc->init_mutex);
 		mutex_unlock(&acpi_desc->init_mutex);
 	}
 	}
@@ -2939,6 +2943,32 @@ static unsigned int __acpi_nfit_scrub(struct acpi_nfit_desc *acpi_desc,
 	return 0;
 	return 0;
 }
 }
 
 
+static void __sched_ars(struct acpi_nfit_desc *acpi_desc, unsigned int tmo)
+{
+	lockdep_assert_held(&acpi_desc->init_mutex);
+
+	acpi_desc->scrub_busy = 1;
+	/* note this should only be set from within the workqueue */
+	if (tmo)
+		acpi_desc->scrub_tmo = tmo;
+	queue_delayed_work(nfit_wq, &acpi_desc->dwork, tmo * HZ);
+}
+
+static void sched_ars(struct acpi_nfit_desc *acpi_desc)
+{
+	__sched_ars(acpi_desc, 0);
+}
+
+static void notify_ars_done(struct acpi_nfit_desc *acpi_desc)
+{
+	lockdep_assert_held(&acpi_desc->init_mutex);
+
+	acpi_desc->scrub_busy = 0;
+	acpi_desc->scrub_count++;
+	if (acpi_desc->scrub_count_state)
+		sysfs_notify_dirent(acpi_desc->scrub_count_state);
+}
+
 static void acpi_nfit_scrub(struct work_struct *work)
 static void acpi_nfit_scrub(struct work_struct *work)
 {
 {
 	struct acpi_nfit_desc *acpi_desc;
 	struct acpi_nfit_desc *acpi_desc;
@@ -2949,14 +2979,10 @@ static void acpi_nfit_scrub(struct work_struct *work)
 	mutex_lock(&acpi_desc->init_mutex);
 	mutex_lock(&acpi_desc->init_mutex);
 	query_rc = acpi_nfit_query_poison(acpi_desc);
 	query_rc = acpi_nfit_query_poison(acpi_desc);
 	tmo = __acpi_nfit_scrub(acpi_desc, query_rc);
 	tmo = __acpi_nfit_scrub(acpi_desc, query_rc);
-	if (tmo) {
-		queue_delayed_work(nfit_wq, &acpi_desc->dwork, tmo * HZ);
-		acpi_desc->scrub_tmo = tmo;
-	} else {
-		acpi_desc->scrub_count++;
-		if (acpi_desc->scrub_count_state)
-			sysfs_notify_dirent(acpi_desc->scrub_count_state);
-	}
+	if (tmo)
+		__sched_ars(acpi_desc, tmo);
+	else
+		notify_ars_done(acpi_desc);
 	memset(acpi_desc->ars_status, 0, acpi_desc->max_ars);
 	memset(acpi_desc->ars_status, 0, acpi_desc->max_ars);
 	mutex_unlock(&acpi_desc->init_mutex);
 	mutex_unlock(&acpi_desc->init_mutex);
 }
 }
@@ -3037,7 +3063,7 @@ static int acpi_nfit_register_regions(struct acpi_nfit_desc *acpi_desc)
 			break;
 			break;
 		}
 		}
 
 
-	queue_delayed_work(nfit_wq, &acpi_desc->dwork, 0);
+	sched_ars(acpi_desc);
 	return 0;
 	return 0;
 }
 }
 
 
@@ -3239,7 +3265,7 @@ int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, unsigned long flags)
 		}
 		}
 	}
 	}
 	if (scheduled) {
 	if (scheduled) {
-		queue_delayed_work(nfit_wq, &acpi_desc->dwork, 0);
+		sched_ars(acpi_desc);
 		dev_dbg(dev, "ars_scan triggered\n");
 		dev_dbg(dev, "ars_scan triggered\n");
 	}
 	}
 	mutex_unlock(&acpi_desc->init_mutex);
 	mutex_unlock(&acpi_desc->init_mutex);

+ 1 - 0
drivers/acpi/nfit/nfit.h

@@ -203,6 +203,7 @@ struct acpi_nfit_desc {
 	unsigned int max_ars;
 	unsigned int max_ars;
 	unsigned int scrub_count;
 	unsigned int scrub_count;
 	unsigned int scrub_mode;
 	unsigned int scrub_mode;
+	unsigned int scrub_busy:1;
 	unsigned int cancel:1;
 	unsigned int cancel:1;
 	unsigned long dimm_cmd_force_en;
 	unsigned long dimm_cmd_force_en;
 	unsigned long bus_cmd_force_en;
 	unsigned long bus_cmd_force_en;

+ 0 - 2
drivers/ata/Kconfig

@@ -398,7 +398,6 @@ config SATA_DWC_VDEBUG
 
 
 config SATA_HIGHBANK
 config SATA_HIGHBANK
 	tristate "Calxeda Highbank SATA support"
 	tristate "Calxeda Highbank SATA support"
-	depends on HAS_DMA
 	depends on ARCH_HIGHBANK || COMPILE_TEST
 	depends on ARCH_HIGHBANK || COMPILE_TEST
 	help
 	help
 	  This option enables support for the Calxeda Highbank SoC's
 	  This option enables support for the Calxeda Highbank SoC's
@@ -408,7 +407,6 @@ config SATA_HIGHBANK
 
 
 config SATA_MV
 config SATA_MV
 	tristate "Marvell SATA support"
 	tristate "Marvell SATA support"
-	depends on HAS_DMA
 	depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \
 	depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \
 		   ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST
 		   ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST
 	select GENERIC_PHY
 	select GENERIC_PHY

+ 60 - 0
drivers/ata/ahci.c

@@ -400,6 +400,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, 0x0f23), board_ahci_mobile }, /* Bay Trail AHCI */
 	{ PCI_VDEVICE(INTEL, 0x0f23), board_ahci_mobile }, /* Bay Trail AHCI */
 	{ PCI_VDEVICE(INTEL, 0x22a3), board_ahci_mobile }, /* Cherry Tr. AHCI */
 	{ PCI_VDEVICE(INTEL, 0x22a3), board_ahci_mobile }, /* Cherry Tr. AHCI */
 	{ PCI_VDEVICE(INTEL, 0x5ae3), board_ahci_mobile }, /* ApolloLake AHCI */
 	{ PCI_VDEVICE(INTEL, 0x5ae3), board_ahci_mobile }, /* ApolloLake AHCI */
+	{ PCI_VDEVICE(INTEL, 0x34d3), board_ahci_mobile }, /* Ice Lake LP AHCI */
 
 
 	/* JMicron 360/1/3/5/6, match class to avoid IDE function */
 	/* JMicron 360/1/3/5/6, match class to avoid IDE function */
 	{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
 	{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
@@ -1280,6 +1281,59 @@ static bool ahci_broken_suspend(struct pci_dev *pdev)
 	return strcmp(buf, dmi->driver_data) < 0;
 	return strcmp(buf, dmi->driver_data) < 0;
 }
 }
 
 
+static bool ahci_broken_lpm(struct pci_dev *pdev)
+{
+	static const struct dmi_system_id sysids[] = {
+		/* Various Lenovo 50 series have LPM issues with older BIOSen */
+		{
+			.matches = {
+				DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+				DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X250"),
+			},
+			.driver_data = "20180406", /* 1.31 */
+		},
+		{
+			.matches = {
+				DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+				DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L450"),
+			},
+			.driver_data = "20180420", /* 1.28 */
+		},
+		{
+			.matches = {
+				DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+				DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T450s"),
+			},
+			.driver_data = "20180315", /* 1.33 */
+		},
+		{
+			.matches = {
+				DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+				DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W541"),
+			},
+			/*
+			 * Note date based on release notes, 2.35 has been
+			 * reported to be good, but I've been unable to get
+			 * a hold of the reporter to get the DMI BIOS date.
+			 * TODO: fix this.
+			 */
+			.driver_data = "20180310", /* 2.35 */
+		},
+		{ }	/* terminate list */
+	};
+	const struct dmi_system_id *dmi = dmi_first_match(sysids);
+	int year, month, date;
+	char buf[9];
+
+	if (!dmi)
+		return false;
+
+	dmi_get_date(DMI_BIOS_DATE, &year, &month, &date);
+	snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date);
+
+	return strcmp(buf, dmi->driver_data) < 0;
+}
+
 static bool ahci_broken_online(struct pci_dev *pdev)
 static bool ahci_broken_online(struct pci_dev *pdev)
 {
 {
 #define ENCODE_BUSDEVFN(bus, slot, func)			\
 #define ENCODE_BUSDEVFN(bus, slot, func)			\
@@ -1694,6 +1748,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 			"quirky BIOS, skipping spindown on poweroff\n");
 			"quirky BIOS, skipping spindown on poweroff\n");
 	}
 	}
 
 
+	if (ahci_broken_lpm(pdev)) {
+		pi.flags |= ATA_FLAG_NO_LPM;
+		dev_warn(&pdev->dev,
+			 "BIOS update required for Link Power Management support\n");
+	}
+
 	if (ahci_broken_suspend(pdev)) {
 	if (ahci_broken_suspend(pdev)) {
 		hpriv->flags |= AHCI_HFLAG_NO_SUSPEND;
 		hpriv->flags |= AHCI_HFLAG_NO_SUSPEND;
 		dev_warn(&pdev->dev,
 		dev_warn(&pdev->dev,

+ 1 - 1
drivers/ata/ahci_mvebu.c

@@ -82,7 +82,7 @@ static void ahci_mvebu_regret_option(struct ahci_host_priv *hpriv)
  *
  *
  * Return: 0 on success; Error code otherwise.
  * Return: 0 on success; Error code otherwise.
  */
  */
-int ahci_mvebu_stop_engine(struct ata_port *ap)
+static int ahci_mvebu_stop_engine(struct ata_port *ap)
 {
 {
 	void __iomem *port_mmio = ahci_port_base(ap);
 	void __iomem *port_mmio = ahci_port_base(ap);
 	u32 tmp, port_fbs;
 	u32 tmp, port_fbs;

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.