Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Jan 2016 20:39:07 +0000 (12:39 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Jan 2016 20:39:07 +0000 (12:39 -0800)
Pull ARM updates from Russell King:

 - UEFI boot and runtime services support for ARM from Ard Biesheuvel
   and Roy Franz.

 - DT compatibility with old atags booting protocol for Nokia N900
   devices from Ivaylo Dimitrov.

 - PSCI firmware interface using new arm-smc calling convention from
   Jens Wiklander.

 - Runtime patching for udiv/sdiv instructions for ARMv7 CPUs that
   support these instructions from Nicolas Pitre.

 - L2x0 cache updates from Dirk B and Linus Walleij.

 - Randconfig fixes from Arnd Bergmann.

 - ARMv7M (nommu) updates from Ezequiel Garcia

* 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: (34 commits)
  ARM: 8481/2: drivers: psci: replace psci firmware calls
  ARM: 8480/2: arm64: add implementation for arm-smccc
  ARM: 8479/2: add implementation for arm-smccc
  ARM: 8478/2: arm/arm64: add arm-smccc
  ARM: 8494/1: mm: Enable PXN when running non-LPAE kernel on LPAE processor
  ARM: 8496/1: OMAP: RX51: save ATAGS data in the early boot stage
  ARM: 8495/1: ATAGS: move save_atags() to arch/arm/include/asm/setup.h
  ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode
  ARM: 8482/1: l2x0: make it possible to disable outer sync from DT
  ARM: 8488/1: Make IPI_CPU_BACKTRACE a "non-secure" SGI
  ARM: 8487/1: Remove IPI_CALL_FUNC_SINGLE
  ARM: 8485/1: cpuidle: remove cpu parameter from the cpuidle_ops suspend hook
  ARM: 8484/1: Documentation: l2c2x0: Mention separate controllers explicitly
  ARM: 8483/1: Documentation: l2c: Rename l2cc to l2c2x0
  ARM: 8477/1: runtime patch udiv/sdiv instructions into __aeabi_{u}idiv()
  ARM: 8476/1: VDSO: use PTR_ERR_OR_ZERO for vma check
  ARM: 8453/2: proc-v7.S: don't locate temporary stack space in .text section
  ARM: add UEFI stub support
  ARM: wire up UEFI init and runtime support
  ARM: only consider memblocks with NOMAP cleared for linear mapping
  ...

1  2 
arch/arm/Kconfig
arch/arm64/Kconfig
drivers/firmware/efi/libstub/Makefile

diff --combined arch/arm/Kconfig
index 688dc7b0d95121a95285a998b6f019a4b8f30cf5,a4a756bfe8893ee640871772a076cc4d3317eafb..b0e7ff176028c7140c7ad8c67f902551c7c79dcf
@@@ -20,6 -20,7 +20,7 @@@ config AR
        select GENERIC_ALLOCATOR
        select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI)
        select GENERIC_CLOCKEVENTS_BROADCAST if SMP
+       select GENERIC_EARLY_IOREMAP
        select GENERIC_IDLE_POLL_SETUP
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
        select HARDIRQS_SW_RESEND
        select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
        select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
-       select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32
-       select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32
+       select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
+       select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
        select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)
        select HAVE_ARCH_TRACEHOOK
+       select HAVE_ARM_SMCCC if CPU_V7
        select HAVE_BPF_JIT
        select HAVE_CC_STACKPROTECTOR
        select HAVE_CONTEXT_TRACKING
@@@ -45,7 -47,7 +47,7 @@@
        select HAVE_DMA_API_DEBUG
        select HAVE_DMA_ATTRS
        select HAVE_DMA_CONTIGUOUS if MMU
-       select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE32
+       select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE32 && MMU
        select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
        select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
        select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
@@@ -611,7 -613,6 +613,7 @@@ config ARCH_PX
        select AUTO_ZRELADDR
        select COMMON_CLK
        select CLKDEV_LOOKUP
 +      select CLKSRC_PXA
        select CLKSRC_MMIO
        select CLKSRC_OF
        select GENERIC_CLOCKEVENTS
@@@ -651,8 -652,6 +653,8 @@@ config ARCH_SA110
        select ARCH_SPARSEMEM_ENABLE
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 +      select CLKSRC_PXA
 +      select CLKSRC_OF if OF
        select CPU_FREQ
        select CPU_SA1100
        select GENERIC_CLOCKEVENTS
@@@ -802,6 -801,7 +804,7 @@@ config ARCH_VIR
        bool "Dummy Virtual Machine" if ARCH_MULTI_V7
        select ARM_AMBA
        select ARM_GIC
+       select ARM_GIC_V2M if PCI_MSI
        select ARM_GIC_V3
        select ARM_PSCI
        select HAVE_ARM_ARCH_TIMER
@@@ -1425,7 -1425,7 +1428,7 @@@ config BIG_LITTL
  
  config BL_SWITCHER
        bool "big.LITTLE switcher support"
-       depends on BIG_LITTLE && MCPM && HOTPLUG_CPU
+       depends on BIG_LITTLE && MCPM && HOTPLUG_CPU && ARM_GIC
        select ARM_CPU_SUSPEND
        select CPU_PM
        help
@@@ -1484,7 -1484,7 +1487,7 @@@ config HOTPLUG_CP
  
  config ARM_PSCI
        bool "Support for the ARM Power State Coordination Interface (PSCI)"
-       depends on CPU_V7
+       depends on HAVE_ARM_SMCCC
        select ARM_PSCI_FW
        help
          Say Y here if you want Linux to communicate with system firmware
@@@ -1607,6 -1607,24 +1610,24 @@@ config THUMB2_AVOID_R_ARM_THM_JUMP1
  config ARM_ASM_UNIFIED
        bool
  
+ config ARM_PATCH_IDIV
+       bool "Runtime patch udiv/sdiv instructions into __aeabi_{u}idiv()"
+       depends on CPU_32v7 && !XIP_KERNEL
+       default y
+       help
+         The ARM compiler inserts calls to __aeabi_idiv() and
+         __aeabi_uidiv() when it needs to perform division on signed
+         and unsigned integers. Some v7 CPUs have support for the sdiv
+         and udiv instructions that can be used to implement those
+         functions.
+         Enabling this option allows the kernel to modify itself to
+         replace the first two instructions of these library functions
+         with the sdiv or udiv plus "bx lr" instructions when the CPU
+         it is running on supports them. Typically this will be faster
+         and less power intensive than running the original library
+         code to do integer division.
  config AEABI
        bool "Use the ARM EABI to compile the kernel"
        help
@@@ -2043,6 -2061,25 +2064,25 @@@ config AUTO_ZRELADD
          0xf8000000. This assumes the zImage being placed in the first 128MB
          from start of memory.
  
+ config EFI_STUB
+       bool
+ config EFI
+       bool "UEFI runtime support"
+       depends on OF && !CPU_BIG_ENDIAN && MMU && AUTO_ZRELADDR && !XIP_KERNEL
+       select UCS2_STRING
+       select EFI_PARAMS_FROM_FDT
+       select EFI_STUB
+       select EFI_ARMSTUB
+       select EFI_RUNTIME_WRAPPERS
+       ---help---
+         This option provides support for runtime services provided
+         by UEFI firmware (such as non-volatile variables, realtime
+         clock, and platform reset). A UEFI stub is also provided to
+         allow the kernel to be booted as an EFI application. This
+         is only useful for kernels that may run on systems that have
+         UEFI firmware.
  endmenu
  
  menu "CPU Power Management"
diff --combined arch/arm64/Kconfig
index ffa3c549a4baca5aebcafc3e1bc111dee42b1301,96513d09d345dcba8479bd3fc81b600c0c62401c..bf82ffe895bf558bcdbdcf3092cd9aa6d7aa19e3
@@@ -70,7 -70,6 +70,7 @@@ config ARM6
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_GENERIC_DMA_COHERENT
        select HAVE_HW_BREAKPOINT if PERF_EVENTS
 +      select HAVE_IRQ_TIME_ACCOUNTING
        select HAVE_MEMBLOCK
        select HAVE_PATA_PLATFORM
        select HAVE_PERF_EVENTS
@@@ -93,6 -92,7 +93,7 @@@
        select SPARSE_IRQ
        select SYSCTL_EXCEPTION_TRACE
        select HAVE_CONTEXT_TRACKING
+       select HAVE_ARM_SMCCC
        help
          ARM 64-bit (AArch64) Linux support.
  
@@@ -530,6 -530,9 +531,6 @@@ config HW_PERF_EVENT
  config SYS_SUPPORTS_HUGETLBFS
        def_bool y
  
 -config ARCH_WANT_GENERAL_HUGETLB
 -      def_bool y
 -
  config ARCH_WANT_HUGE_PMD_SHARE
        def_bool y if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36)
  
index c0ddd1b8dca32fc66dd328606f64bbf26d527145,8cf9ccbf42d5829f366f48aaa967f98086b134d5..9c12e18031d57b29b1a18547447b17207b3054de
@@@ -8,7 -8,7 +8,7 @@@ cflags-$(CONFIG_X86_32)          := -march=i38
  cflags-$(CONFIG_X86_64)               := -mcmodel=small
  cflags-$(CONFIG_X86)          += -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 \
                                   -fPIC -fno-strict-aliasing -mno-red-zone \
 -                                 -mno-mmx -mno-sse -DDISABLE_BRANCH_PROFILING
 +                                 -mno-mmx -mno-sse
  
  cflags-$(CONFIG_ARM64)                := $(subst -pg,,$(KBUILD_CFLAGS))
  cflags-$(CONFIG_ARM)          := $(subst -pg,,$(KBUILD_CFLAGS)) \
@@@ -16,7 -16,7 +16,7 @@@
  
  cflags-$(CONFIG_EFI_ARMSTUB)  += -I$(srctree)/scripts/dtc/libfdt
  
 -KBUILD_CFLAGS                 := $(cflags-y) \
 +KBUILD_CFLAGS                 := $(cflags-y) -DDISABLE_BRANCH_PROFILING \
                                   $(call cc-option,-ffreestanding) \
                                   $(call cc-option,-fno-stack-protector)
  
@@@ -34,6 -34,7 +34,7 @@@ $(obj)/lib-%.o: $(srctree)/lib/%.c FORC
  lib-$(CONFIG_EFI_ARMSTUB)     += arm-stub.o fdt.o string.o \
                                   $(patsubst %.c,lib-%.o,$(arm-deps))
  
+ lib-$(CONFIG_ARM)             += arm32-stub.o
  lib-$(CONFIG_ARM64)           += arm64-stub.o
  CFLAGS_arm64-stub.o           := -DTEXT_OFFSET=$(TEXT_OFFSET)
  
@@@ -67,3 -68,11 +68,11 @@@ quiet_cmd_stubcopy = STUBCPY $
                     $(OBJDUMP) -r $@ | grep $(STUBCOPY_RELOC-y)        \
                     && (echo >&2 "$@: absolute symbol references not allowed in the EFI stub"; \
                         rm -f $@; /bin/false); else /bin/false; fi
+ #
+ # ARM discards the .data section because it disallows r/w data in the
+ # decompressor. So move our .data to .data.efistub, which is preserved
+ # explicitly by the decompressor linker script.
+ #
+ STUBCOPY_FLAGS-$(CONFIG_ARM)  += --rename-section .data=.data.efistub
+ STUBCOPY_RELOC-$(CONFIG_ARM)  := R_ARM_ABS