]> Git Repo - linux.git/commitdiff
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux
authorLinus Torvalds <[email protected]>
Tue, 22 Dec 2020 21:34:27 +0000 (13:34 -0800)
committerLinus Torvalds <[email protected]>
Tue, 22 Dec 2020 21:34:27 +0000 (13:34 -0800)
Pull ARM updates from Russell King:

 - Rework phys/virt translation

 - Add KASan support

 - Move DT out of linear map region

 - Use more PC-relative addressing in assembly

 - Remove FP emulation handling while in kernel mode

 - Link with '-z norelro'

 - remove old check for GCC <= 4.2 in ARM unwinder code

 - disable big endian if using clang's linker

* tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: (46 commits)
  ARM: 9027/1: head.S: explicitly map DT even if it lives in the first physical section
  ARM: 9038/1: Link with '-z norelro'
  ARM: 9037/1: uncompress: Add OF_DT_MAGIC macro
  ARM: 9036/1: uncompress: Fix dbgadtb size parameter name
  ARM: 9035/1: uncompress: Add be32tocpu macro
  ARM: 9033/1: arm/smp: Drop the macro S(x,s)
  ARM: 9032/1: arm/mm: Convert PUD level pgtable helper macros into functions
  ARM: 9031/1: hyp-stub: remove unused .L__boot_cpu_mode_offset symbol
  ARM: 9044/1: vfp: use undef hook for VFP support detection
  ARM: 9034/1: __div64_32(): straighten up inline asm constraints
  ARM: 9030/1: entry: omit FP emulation for UND exceptions taken in kernel mode
  ARM: 9029/1: Make iwmmxt.S support Clang's integrated assembler
  ARM: 9028/1: disable KASAN in call stack capturing routines
  ARM: 9026/1: unwind: remove old check for GCC <= 4.2
  ARM: 9025/1: Kconfig: CPU_BIG_ENDIAN depends on !LD_IS_LLD
  ARM: 9024/1: Drop useless cast of "u64" to "long long"
  ARM: 9023/1: Spelling s/mmeory/memory/
  ARM: 9022/1: Change arch/arm/lib/mem*.S to use WEAK instead of .weak
  ARM: kvm: replace open coded VA->PA calculations with adr_l call
  ARM: head.S: use PC relative insn sequence to calculate PHYS_OFFSET
  ...

13 files changed:
1  2 
Documentation/dev-tools/kasan.rst
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/boot/compressed/Makefile
arch/arm/boot/compressed/head.S
arch/arm/include/asm/elf.h
arch/arm/include/asm/fixmap.h
arch/arm/include/asm/pgtable-2level.h
arch/arm/include/asm/thread_info.h
arch/arm/kernel/Makefile
arch/arm/kernel/entry-common.S
arch/arm/mm/Makefile
arch/arm/mm/init.c

index 6b752a45a936b367959491fdaafe1aa744d6a492,3edd3946d4c7acc7e6b8340dfdb3889a05c77ce2..748149bca8d873fa84f4b1b5c269f644ea429992
@@@ -18,8 -18,8 +18,8 @@@ out-of-bounds accesses for global varia
  
  Tag-based KASAN is only supported in Clang.
  
- Currently generic KASAN is supported for the x86_64, arm64, xtensa, s390 and
- riscv architectures, and tag-based KASAN is supported only for arm64.
+ Currently generic KASAN is supported for the x86_64, arm, arm64, xtensa, s390
and riscv architectures, and tag-based KASAN is supported only for arm64.
  
  Usage
  -----
@@@ -190,9 -190,8 +190,9 @@@ function calls GCC directly inserts th
  This option significantly enlarges kernel but it gives x1.1-x2 performance
  boost over outline instrumented kernel.
  
 -Generic KASAN prints up to 2 call_rcu() call stacks in reports, the last one
 -and the second to last.
 +Generic KASAN also reports the last 2 call stacks to creation of work that
 +potentially has access to an object. Call stacks for the following are shown:
 +call_rcu() and workqueue queuing.
  
  Software tag-based KASAN
  ~~~~~~~~~~~~~~~~~~~~~~~~
@@@ -296,13 -295,11 +296,13 @@@ print the number of the test and the st
  pass::
  
          ok 28 - kmalloc_double_kzfree
 +
  or, if kmalloc failed::
  
          # kmalloc_large_oob_right: ASSERTION FAILED at lib/test_kasan.c:163
          Expected ptr is not null, but is
          not ok 4 - kmalloc_large_oob_right
 +
  or, if a KASAN report was expected, but not found::
  
          # kmalloc_double_kzfree: EXPECTATION FAILED at lib/test_kasan.c:629
@@@ -331,7 -328,7 +331,7 @@@ using something like insmod or modprobe
  ~~~~~~~~~~~~~
  
  With ``CONFIG_KUNIT`` built-in, ``CONFIG_KASAN_KUNIT_TEST`` can be built-in
 -on any architecure that supports KASAN. These and any other KUnit
 +on any architecture that supports KASAN. These and any other KUnit
  tests enabled will run and print the results at boot as a late-init
  call.
  
@@@ -352,5 -349,5 +352,5 @@@ converted to KUnit. These tests can be 
  ``CONFIG_KASAN`` built-in. The type of error expected and the
  function being run is printed before the expression expected to give
  an error. Then the error is printed, if found, and that test
 -should be interpretted to pass only if the error was the one expected
 +should be interpreted to pass only if the error was the one expected
  by the test.
diff --combined arch/arm/Kconfig
index b8ade91281bc5954057c2bc2514da17c0d57a88f,b2bf019dcefa63796e94cd39053dcca898c45b60..138248999df7421e31652c613b5fea65e5de4389
@@@ -5,6 -5,7 +5,6 @@@ config AR
        select ARCH_32BIT_OFF_T
        select ARCH_HAS_BINFMT_FLAT
        select ARCH_HAS_DEBUG_VIRTUAL if MMU
 -      select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_HAS_DMA_WRITE_COMBINE if !ARM_DMA_MEM_BUFFERABLE
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_FORTIFY_SOURCE
@@@ -24,7 -25,7 +24,7 @@@
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAVE_CUSTOM_GPIO_H
        select ARCH_HAS_GCOV_PROFILE_ALL
 -      select ARCH_KEEP_MEMBLOCK if HAVE_ARCH_PFN_VALID || KEXEC
 +      select ARCH_KEEP_MEMBLOCK
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select ARCH_NO_SG_CHAIN if !ARM_HAS_SG_CHAIN
        select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
@@@ -34,7 -35,6 +34,7 @@@
        select ARCH_USE_CMPXCHG_LOCKREF
        select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
        select ARCH_WANT_IPC_PARSE_VERSION
 +      select ARCH_WANT_LD_ORPHAN_WARN
        select BINFMT_FLAT_ARGVP_ENVP_ON_STACK
        select BUILDTIME_TABLE_SORT if MMU
        select CLONE_BACKWARDS
@@@ -56,7 -56,6 +56,7 @@@
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
        select GENERIC_IRQ_SHOW_LEVEL
 +      select GENERIC_LIB_DEVMEM_IS_ALLOWED
        select GENERIC_PCI_IOMAP
        select GENERIC_SCHED_CLOCK
        select GENERIC_SMP_IDLE_THREAD
@@@ -68,8 -67,8 +68,9 @@@
        select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
        select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
        select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
+       select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL
        select HAVE_ARCH_MMAP_RND_BITS if MMU
 +      select HAVE_ARCH_PFN_VALID
        select HAVE_ARCH_SECCOMP
        select HAVE_ARCH_SECCOMP_FILTER if AEABI && !OABI_COMPAT
        select HAVE_ARCH_THREAD_STRUCT_WHITELIST
@@@ -245,7 -244,7 +246,7 @@@ config ARM_PATCH_PHYS_VIR
          kernel in system memory.
  
          This can only be used with non-XIP MMU kernels where the base
-         of physical memory is at a 16MB boundary.
+         of physical memory is at a 2 MiB boundary.
  
          Only disable this option if you know that you do not require
          this feature (eg, building a kernel for a single machine) and
@@@ -269,7 -268,8 +270,7 @@@ config PHYS_OFFSE
        hex "Physical address of main memory" if MMU
        depends on !ARM_PATCH_PHYS_VIRT
        default DRAM_BASE if !MMU
 -      default 0x00000000 if ARCH_EBSA110 || \
 -                      ARCH_FOOTBRIDGE
 +      default 0x00000000 if ARCH_FOOTBRIDGE
        default 0x10000000 if ARCH_OMAP1 || ARCH_RPC
        default 0x20000000 if ARCH_S5PV210
        default 0xc0000000 if ARCH_SA1100
@@@ -323,6 -323,7 +324,6 @@@ config ARCH_MULTIPLATFOR
        select AUTO_ZRELADDR
        select TIMER_OF
        select COMMON_CLK
 -      select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_MULTI_HANDLER
        select HAVE_PCI
        select PCI_DOMAINS_GENERIC if PCI
@@@ -337,10 -338,25 +338,10 @@@ config ARM_SINGLE_ARMV7
        select TIMER_OF
        select COMMON_CLK
        select CPU_V7M
 -      select GENERIC_CLOCKEVENTS
        select NO_IOPORT_MAP
        select SPARSE_IRQ
        select USE_OF
  
 -config ARCH_EBSA110
 -      bool "EBSA-110"
 -      select ARCH_USES_GETTIMEOFFSET
 -      select CPU_SA110
 -      select ISA
 -      select NEED_MACH_IO_H
 -      select NEED_MACH_MEMORY_H
 -      select NO_IOPORT_MAP
 -      help
 -        This is an evaluation board for the StrongARM processor available
 -        from Digital. It has limited hardware on-board, including an
 -        Ethernet interface, two PCMCIA sockets, two serial ports and a
 -        parallel port.
 -
  config ARCH_EP93XX
        bool "EP93xx-based"
        select ARCH_SPARSEMEM_ENABLE
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select CPU_ARM920T
 -      select GENERIC_CLOCKEVENTS
        select GPIOLIB
        select HAVE_LEGACY_CLK
        help
@@@ -360,6 -377,7 +361,6 @@@ config ARCH_FOOTBRIDG
        bool "FootBridge"
        select CPU_SA110
        select FOOTBRIDGE
 -      select GENERIC_CLOCKEVENTS
        select HAVE_IDE
        select NEED_MACH_IO_H if !MMU
        select NEED_MACH_MEMORY_H
@@@ -387,6 -405,7 +388,6 @@@ config ARCH_IXP4X
        select ARCH_SUPPORTS_BIG_ENDIAN
        select CPU_XSCALE
        select DMABOUNCE if PCI
 -      select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_MULTI_HANDLER
        select GPIO_IXP4XX
        select GPIOLIB
  config ARCH_DOVE
        bool "Marvell Dove"
        select CPU_PJ4
 -      select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_MULTI_HANDLER
        select GPIOLIB
        select HAVE_PCI
@@@ -425,6 -445,7 +426,6 @@@ config ARCH_PX
        select CLKSRC_MMIO
        select TIMER_OF
        select CPU_XSCALE if !CPU_XSC3
 -      select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_MULTI_HANDLER
        select GPIO_PXA
        select GPIOLIB
@@@ -447,7 -468,6 +448,7 @@@ config ARCH_RP
        select HAVE_IDE
        select HAVE_PATA_PLATFORM
        select ISA_DMA_API
 +      select LEGACY_TIMER_TICK
        select NEED_MACH_IO_H
        select NEED_MACH_MEMORY_H
        select NO_IOPORT_MAP
@@@ -465,6 -485,7 +466,6 @@@ config ARCH_SA110
        select COMMON_CLK
        select CPU_FREQ
        select CPU_SA1100
 -      select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_MULTI_HANDLER
        select GPIOLIB
        select HAVE_IDE
@@@ -479,6 -500,7 +480,6 @@@ config ARCH_S3C24X
        bool "Samsung S3C24XX SoCs"
        select ATAGS
        select CLKSRC_SAMSUNG_PWM
 -      select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
        select GPIOLIB
        select GENERIC_IRQ_MULTI_HANDLER
  config ARCH_OMAP1
        bool "TI OMAP1"
        depends on MMU
 -      select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_OMAP
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 -      select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
        select GENERIC_IRQ_MULTI_HANDLER
        select GPIOLIB
@@@ -763,6 -787,7 +764,6 @@@ config ARCH_ACOR
  
  config PLAT_IOP
        bool
 -      select GENERIC_CLOCKEVENTS
  
  config PLAT_ORION
        bool
@@@ -1153,6 -1178,7 +1154,6 @@@ config HAVE_SM
  config SMP
        bool "Symmetric Multi-Processing"
        depends on CPU_V6K || CPU_V7
 -      depends on GENERIC_CLOCKEVENTS
        depends on HAVE_SMP
        depends on MMU || ARM_MPU
        select IRQ_WORK
@@@ -1298,6 -1324,15 +1299,15 @@@ config PAGE_OFFSE
        default 0xB0000000 if VMSPLIT_3G_OPT
        default 0xC0000000
  
+ config KASAN_SHADOW_OFFSET
+       hex
+       depends on KASAN
+       default 0x1f000000 if PAGE_OFFSET=0x40000000
+       default 0x5f000000 if PAGE_OFFSET=0x80000000
+       default 0x9f000000 if PAGE_OFFSET=0xC0000000
+       default 0x8f000000 if PAGE_OFFSET=0xB0000000
+       default 0xffffffff
  config NR_CPUS
        int "Maximum number of CPUs (2-32)"
        range 2 32
@@@ -1346,6 -1381,7 +1356,6 @@@ config ARCH_NR_GPI
  
  config HZ_FIXED
        int
 -      default 200 if ARCH_EBSA110
        default 128 if SOC_AT91RM9200
        default 0
  
@@@ -1453,6 -1489,9 +1463,6 @@@ config OABI_COMPA
          UNPREDICTABLE (in fact it can be predicted that it won't work
          at all). If in doubt say N.
  
 -config ARCH_HAS_HOLES_MEMORYMODEL
 -      bool
 -
  config ARCH_SELECT_MEMORY_MODEL
        bool
  
@@@ -1463,10 -1502,12 +1473,10 @@@ config ARCH_SPARSEMEM_ENABL
        bool
        select SPARSEMEM_STATIC if SPARSEMEM
  
 -config HAVE_ARCH_PFN_VALID
 -      def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
 -
  config HIGHMEM
        bool "High Memory Support"
        depends on MMU
 +      select KMAP_LOCAL
        help
          The address space of ARM processors is only 4 Gigabytes large
          and it has to accommodate user address space, kernel address
@@@ -1556,7 -1597,9 +1566,7 @@@ config FORCE_MAX_ZONEORDE
          a value of 11 means that the largest free memory block is 2^10 pages.
  
  config ALIGNMENT_TRAP
 -      bool
 -      depends on CPU_CP15_MMU
 -      default y if !ARCH_EBSA110
 +      def_bool CPU_CP15_MMU
        select HAVE_PROC_CPU if PROC_FS
        help
          ARM processors cannot fetch/store information which is not
@@@ -1751,7 -1794,7 +1761,7 @@@ config CMDLIN
        string "Default kernel command string"
        default ""
        help
 -        On some architectures (EBSA110 and CATS), there is currently no way
 +        On some architectures (e.g. CATS), there is currently no way
          for the boot loader to pass arguments to the kernel. For these
          architectures, you should supply some command-line options at build
          time by entering them here. As a minimum, you should specify the
diff --combined arch/arm/Makefile
index 4a066c687cec352f4e7bc73820a7d1860e4ed2b1,3c0a64cefe52f65aee35d55014cd6bd5f14cff9d..4aaec9599e8ab618b53ecbf422421c8713bca3da
  #
  # Copyright (C) 1995-2001 by Russell King
  
- LDFLAGS_vmlinux       := --no-undefined -X --pic-veneer
+ LDFLAGS_vmlinux       := --no-undefined -X --pic-veneer -z norelro
  ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
  LDFLAGS_vmlinux       += --be8
  KBUILD_LDFLAGS_MODULE += --be8
  endif
  
 -# We never want expected sections to be placed heuristically by the
 -# linker. All sections should be explicitly named in the linker script.
 -LDFLAGS_vmlinux += $(call ld-option, --orphan-handling=warn)
 -
  GZFLAGS               :=-9
  #KBUILD_CFLAGS        +=-pipe
  
@@@ -168,6 -172,7 +168,6 @@@ machine-$(CONFIG_ARCH_CNS3XXX)             += cns3
  machine-$(CONFIG_ARCH_DAVINCI)                += davinci
  machine-$(CONFIG_ARCH_DIGICOLOR)      += digicolor
  machine-$(CONFIG_ARCH_DOVE)           += dove
 -machine-$(CONFIG_ARCH_EBSA110)                += ebsa110
  machine-$(CONFIG_ARCH_EFM32)          += efm32
  machine-$(CONFIG_ARCH_EP93XX)         += ep93xx
  machine-$(CONFIG_ARCH_EXYNOS)         += exynos
@@@ -234,6 -239,13 +234,6 @@@ plat-$(CONFIG_PLAT_ORION) += orio
  plat-$(CONFIG_PLAT_PXA)               += pxa
  plat-$(CONFIG_PLAT_VERSATILE) += versatile
  
 -ifeq ($(CONFIG_ARCH_EBSA110),y)
 -# This is what happens if you forget the IOCS16 line.
 -# PCMCIA cards stop working.
 -CFLAGS_3c589_cs.o :=-DISA_SIXTEEN_BIT_PERIPHERAL
 -export CFLAGS_3c589_cs.o
 -endif
 -
  # The byte offset of the kernel image in RAM from the start of RAM.
  TEXT_OFFSET := $(textofs-y)
  
index e1567418a2b149583f130faa13eb15183b1e6324,a815b1ae990d2d487308e21555ccc53b48af3bdd..fb521efcc6c20a4f482df6d976049eeb3ce18d10
@@@ -24,6 -24,7 +24,7 @@@ OBJS          += hyp-stub.
  endif
  
  GCOV_PROFILE          := n
+ KASAN_SANITIZE                := n
  
  # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
  KCOV_INSTRUMENT               := n
@@@ -129,9 -130,7 +130,9 @@@ LDFLAGS_vmlinux += --no-undefine
  # Delete all temporary local symbols
  LDFLAGS_vmlinux += -X
  # Report orphan sections
 -LDFLAGS_vmlinux += $(call ld-option, --orphan-handling=warn)
 +ifdef CONFIG_LD_ORPHAN_WARN
 +LDFLAGS_vmlinux += --orphan-handling=warn
 +endif
  # Next argument is a linker script
  LDFLAGS_vmlinux += -T
  
index caa27322a0ab709606215701f73897c48f4bbf3e,804d6666801905f709b865c5a83b3b37eb3b2523..d9cce7238a3650811514396a302237b8b6ca0d0e
  
  #include "efi-header.S"
  
+ #ifdef __ARMEB__
+ #define OF_DT_MAGIC 0xd00dfeed
+ #else
+ #define OF_DT_MAGIC 0xedfe0dd0
+ #endif
   AR_CLASS(    .arch   armv7-a )
   M_CLASS(     .arch   armv7-m )
  
                /*
                 * Debug print of the final appended DTB location
                 */
-               .macro dbgadtb, begin, end
+               .macro dbgadtb, begin, size
  #ifdef DEBUG
                kputc   #'D'
                kputc   #'T'
                kputc   #'('
                kputc   #'0'
                kputc   #'x'
-               kphex   \end, 8         /* End of appended DTB */
+               kphex   \size, 8        /* Size of appended DTB */
                kputc   #')'
                kputc   #'\n'
  #endif
                orr     \res, \res, \tmp1, lsl #24
                .endm
  
+               .macro  be32tocpu, val, tmp
+ #ifndef __ARMEB__
+               /* convert to little endian */
+               eor     \tmp, \val, \val, ror #16
+               bic     \tmp, \tmp, #0x00ff0000
+               mov     \val, \val, ror #8
+               eor     \val, \val, \tmp, lsr #8
+ #endif
+               .endm
                .section ".start", "ax"
  /*
   * sort out different calling conventions
@@@ -325,11 -341,7 +341,7 @@@ restart:  adr     r0, LC
   */
  
                ldr     lr, [r6, #0]
- #ifndef __ARMEB__
-               ldr     r1, =0xedfe0dd0         @ sig is 0xd00dfeed big endian
- #else
-               ldr     r1, =0xd00dfeed
- #endif
+               ldr     r1, =OF_DT_MAGIC
                cmp     lr, r1
                bne     dtb_check_done          @ not found
  
  
                /* Get the initial DTB size */
                ldr     r5, [r6, #4]
- #ifndef __ARMEB__
-               /* convert to little endian */
-               eor     r1, r5, r5, ror #16
-               bic     r1, r1, #0x00ff0000
-               mov     r5, r5, ror #8
-               eor     r5, r5, r1, lsr #8
- #endif
+               be32tocpu r5, r1
                dbgadtb r6, r5
                /* 50% DTB growth should be good enough */
                add     r5, r5, r5, lsr #1
  
                /* Get the current DTB size */
                ldr     r5, [r6, #4]
- #ifndef __ARMEB__
-               /* convert r5 (dtb size) to little endian */
-               eor     r1, r5, r5, ror #16
-               bic     r1, r1, #0x00ff0000
-               mov     r5, r5, ror #8
-               eor     r5, r5, r1, lsr #8
- #endif
+               be32tocpu r5, r1
  
                /* preserve 64-bit alignment */
                add     r5, r5, #7
@@@ -468,15 -468,10 +468,10 @@@ dtb_check_done
  
                /*
                 * Compute the address of the hyp vectors after relocation.
-                * This requires some arithmetic since we cannot directly
-                * reference __hyp_stub_vectors in a PC-relative way.
                 * Call __hyp_set_vectors with the new address so that we
                 * can HVC again after the copy.
                 */
- 0:            adr     r0, 0b
-               movw    r1, #:lower16:__hyp_stub_vectors - 0b
-               movt    r1, #:upper16:__hyp_stub_vectors - 0b
-               add     r0, r0, r1
+               adr_l   r0, __hyp_stub_vectors
                sub     r0, r0, r5
                add     r0, r0, r10
                bl      __hyp_set_vectors
@@@ -627,17 -622,11 +622,11 @@@ not_relocated:  mov     r0, #
                cmp     r0, #HYP_MODE           @ if not booted in HYP mode...
                bne     __enter_kernel          @ boot kernel directly
  
-               adr     r12, .L__hyp_reentry_vectors_offset
-               ldr     r0, [r12]
-               add     r0, r0, r12
+               adr_l   r0, __hyp_reentry_vectors
                bl      __hyp_set_vectors
                __HVC(0)                        @ otherwise bounce to hyp mode
  
                b       .                       @ should never be reached
-               .align  2
- .L__hyp_reentry_vectors_offset:       .long   __hyp_reentry_vectors - .
  #else
                b       __enter_kernel
  #endif
@@@ -1440,8 -1429,7 +1429,7 @@@ ENTRY(efi_enter_kernel
                mov     r4, r0                  @ preserve image base
                mov     r8, r1                  @ preserve DT pointer
  
-  ARM(         adrl    r0, call_cache_fn       )
-  THUMB(               adr     r0, call_cache_fn       )
+               adr_l   r0, call_cache_fn
                adr     r1, 0f                  @ clean the region of code we
                bl      cache_clean_flush       @ may run with the MMU off
  
                @ issued from HYP mode take us to the correct handler code. We
                @ will disable the MMU before jumping to the kernel proper.
                @
 + ARM(         bic     r1, r1, #(1 << 30)      ) @ clear HSCTLR.TE
 + THUMB(               orr     r1, r1, #(1 << 30)      ) @ set HSCTLR.TE
 +              mcr     p15, 4, r1, c1, c0, 0
                adr     r0, __hyp_reentry_vectors
                mcr     p15, 4, r0, c12, c0, 0  @ set HYP vector base (HVBAR)
                isb
index 61941f3698619e0eb635467a430cd3081a0a5227,0ac62a54b73c2a0a6dbe1de45f736c5c484cd140..b8102a6ddf1665fe5e393eda94c5d2ffa1932e34
@@@ -51,6 -51,7 +51,7 @@@ typedef struct user_fp elf_fpregset_t
  #define R_ARM_NONE            0
  #define R_ARM_PC24            1
  #define R_ARM_ABS32           2
+ #define R_ARM_REL32           3
  #define R_ARM_CALL            28
  #define R_ARM_JUMP24          29
  #define R_ARM_TARGET1         38
  #define R_ARM_PREL31          42
  #define R_ARM_MOVW_ABS_NC     43
  #define R_ARM_MOVT_ABS                44
+ #define R_ARM_MOVW_PREL_NC    45
+ #define R_ARM_MOVT_PREL               46
  
  #define R_ARM_THM_CALL                10
  #define R_ARM_THM_JUMP24      30
  #define R_ARM_THM_MOVW_ABS_NC 47
  #define R_ARM_THM_MOVT_ABS    48
+ #define R_ARM_THM_MOVW_PREL_NC        49
+ #define R_ARM_THM_MOVT_PREL   50
  
  /*
   * These are used to set parameters in the core dumps.
@@@ -111,6 -116,10 +116,6 @@@ extern int elf_check_arch(const struct 
  extern int arm_elf_read_implies_exec(int);
  #define elf_read_implies_exec(ex,stk) arm_elf_read_implies_exec(stk)
  
 -struct task_struct;
 -int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
 -#define ELF_CORE_COPY_TASK_REGS dump_task_regs
 -
  #define CORE_DUMP_USE_REGSET
  #define ELF_EXEC_PAGESIZE     4096
  
index c279a8a463a2e1fa1711a96570aa2d88b519967d,9575b404019c963a834dd71ba7a2076f847560ca..707068f852c27873ad3b298d827bebab054bc930
@@@ -2,19 -2,19 +2,19 @@@
  #ifndef _ASM_FIXMAP_H
  #define _ASM_FIXMAP_H
  
- #define FIXADDR_START         0xffc00000UL
+ #define FIXADDR_START         0xffc80000UL
  #define FIXADDR_END           0xfff00000UL
  #define FIXADDR_TOP           (FIXADDR_END - PAGE_SIZE)
  
  #include <linux/pgtable.h>
 -#include <asm/kmap_types.h>
 +#include <asm/kmap_size.h>
  
  enum fixed_addresses {
        FIX_EARLYCON_MEM_BASE,
        __end_of_permanent_fixed_addresses,
  
        FIX_KMAP_BEGIN = __end_of_permanent_fixed_addresses,
 -      FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1,
 +      FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * NR_CPUS) - 1,
  
        /* Support writing RO kernel text via kprobes, jump labels, etc. */
        FIX_TEXT_POKE0,
index baf7d0204eb5a5394c20f17c45098ba6cb0053e4,9d4f5eef410b9205e1765a679e47c08f6b82e53f..70fe69bdcce2dccb4737f42dd8f6446bd98ab224
@@@ -75,8 -75,6 +75,8 @@@
  #define PTE_HWTABLE_OFF               (PTE_HWTABLE_PTRS * sizeof(pte_t))
  #define PTE_HWTABLE_SIZE      (PTRS_PER_PTE * sizeof(u32))
  
 +#define MAX_POSSIBLE_PHYSMEM_BITS     32
 +
  /*
   * PMD_SHIFT determines the size of the area a second-level page table can map
   * PGDIR_SHIFT determines what a third-level page table entry can map
   * the pud: the pud entry is never bad, always exists, and can't be set or
   * cleared.
   */
- #define pud_none(pud)         (0)
- #define pud_bad(pud)          (0)
- #define pud_present(pud)      (1)
- #define pud_clear(pudp)               do { } while (0)
- #define set_pud(pud,pudp)     do { } while (0)
+ static inline int pud_none(pud_t pud)
+ {
+       return 0;
+ }
+ static inline int pud_bad(pud_t pud)
+ {
+       return 0;
+ }
+ static inline int pud_present(pud_t pud)
+ {
+       return 1;
+ }
+ static inline void pud_clear(pud_t *pudp)
+ {
+ }
+ static inline void set_pud(pud_t *pudp, pud_t pud)
+ {
+ }
  
  static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
  {
index eb7ce2747eb00e8549fe66194b1683386cb73b2e,56fae7861fd38528808dd199373209652e25b29a..70d4cbc49ae122b35f676133cab34062e2ec0bed
  #include <asm/fpstate.h>
  #include <asm/page.h>
  
+ #ifdef CONFIG_KASAN
+ /*
+  * KASan uses a lot of extra stack space so the thread size order needs to
+  * be increased.
+  */
+ #define THREAD_SIZE_ORDER     2
+ #else
  #define THREAD_SIZE_ORDER     1
+ #endif
  #define THREAD_SIZE           (PAGE_SIZE << THREAD_SIZE_ORDER)
  #define THREAD_START_SP               (THREAD_SIZE - 8)
  
@@@ -126,8 -134,6 +134,8 @@@ extern int vfp_restore_user_hwstate(str
   * thread information flags:
   *  TIF_USEDFPU               - FPU was used by this task this quantum (SMP)
   *  TIF_POLLING_NRFLAG        - true if poll_idle() is polling TIF_NEED_RESCHED
 + *
 + * Any bit in the range of 0..15 will cause do_work_pending() to be invoked.
   */
  #define TIF_SIGPENDING                0       /* signal pending */
  #define TIF_NEED_RESCHED      1       /* rescheduling necessary */
  #define TIF_SYSCALL_AUDIT     5       /* syscall auditing active */
  #define TIF_SYSCALL_TRACEPOINT        6       /* syscall tracepoint instrumentation */
  #define TIF_SECCOMP           7       /* seccomp syscall filtering active */
 +#define TIF_NOTIFY_SIGNAL     8       /* signal notifications exist */
  
  #define TIF_USING_IWMMXT      17
  #define TIF_MEMDIE            18      /* is terminating due to OOM killer */
  #define _TIF_SYSCALL_AUDIT    (1 << TIF_SYSCALL_AUDIT)
  #define _TIF_SYSCALL_TRACEPOINT       (1 << TIF_SYSCALL_TRACEPOINT)
  #define _TIF_SECCOMP          (1 << TIF_SECCOMP)
 +#define _TIF_NOTIFY_SIGNAL    (1 << TIF_NOTIFY_SIGNAL)
  #define _TIF_USING_IWMMXT     (1 << TIF_USING_IWMMXT)
  
  /* Checks for any syscall work in entry-common.S */
   * Change these and you break ASM code in entry-common.S
   */
  #define _TIF_WORK_MASK                (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
 -                               _TIF_NOTIFY_RESUME | _TIF_UPROBE)
 +                               _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
 +                               _TIF_NOTIFY_SIGNAL)
  
  #endif /* __KERNEL__ */
  #endif /* __ASM_ARM_THREAD_INFO_H */
diff --combined arch/arm/kernel/Makefile
index 09e67cb02b209cbf4945b214c5d29ccad32a5e4d,c38c8b019d24c6103a06ccaebd441929d3ac6c69..ae295a3bcfefddad015d56e79a4af37b80d66487
@@@ -17,10 -17,13 +17,13 @@@ CFLAGS_REMOVE_return_address.o = -p
  # Object file lists.
  
  obj-y         := elf.o entry-common.o irq.o opcodes.o \
 -                 process.o ptrace.o reboot.o \
 +                 process.o ptrace.o reboot.o io.o \
                   setup.o signal.o sigreturn_codes.o \
                   stacktrace.o sys_arm.o time.o traps.o
  
+ KASAN_SANITIZE_stacktrace.o := n
+ KASAN_SANITIZE_traps.o := n
  ifneq ($(CONFIG_ARM_UNWIND),y)
  obj-$(CONFIG_FRAME_POINTER)   += return_address.o
  endif
@@@ -83,11 -86,16 +86,12 @@@ AFLAGS_iwmmxt.o                    := -Wa,-mcpu=iwmmx
  obj-$(CONFIG_ARM_CPU_TOPOLOGY)  += topology.o
  obj-$(CONFIG_VDSO)            += vdso.o
  obj-$(CONFIG_EFI)             += efi.o
 -
 -ifneq ($(CONFIG_ARCH_EBSA110),y)
 -  obj-y               += io.o
 -endif
  obj-$(CONFIG_PARAVIRT)        += paravirt.o
  
  head-y                        := head$(MMUEXT).o
  obj-$(CONFIG_DEBUG_LL)        += debug.o
  obj-$(CONFIG_EARLY_PRINTK)    += early_printk.o
+ obj-$(CONFIG_ARM_PATCH_PHYS_VIRT)     += phys2virt.o
  
  # This is executed very early using a temporary stack when no memory allocator
  # nor global data is available. Everything has to be allocated on the stack.
index 77d16390a5245cbf88e259d652ff26983be56625,fee279e28a72e05bdb67ebc4e7a37a3b35ca3824..e0d7833a1827ea1d82adf9cfff56d00e91cf8c40
@@@ -50,10 -50,11 +50,11 @@@ __ret_fast_syscall
   UNWIND(.cantunwind   )
        disable_irq_notrace                     @ disable interrupts
        ldr     r2, [tsk, #TI_ADDR_LIMIT]
-       cmp     r2, #TASK_SIZE
+       ldr     r1, =TASK_SIZE
+       cmp     r2, r1
        blne    addr_limit_check_failed
        ldr     r1, [tsk, #TI_FLAGS]            @ re-check for syscall tracing
 -      tst     r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK
 +      movs    r1, r1, lsl #16
        bne     fast_work_pending
  
  
@@@ -87,10 -88,11 +88,11 @@@ __ret_fast_syscall
  #endif
        disable_irq_notrace                     @ disable interrupts
        ldr     r2, [tsk, #TI_ADDR_LIMIT]
-       cmp     r2, #TASK_SIZE
+       ldr     r1, =TASK_SIZE
+       cmp     r2, r1
        blne    addr_limit_check_failed
        ldr     r1, [tsk, #TI_FLAGS]            @ re-check for syscall tracing
 -      tst     r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK
 +      movs    r1, r1, lsl #16
        beq     no_work_pending
   UNWIND(.fnend                )
  ENDPROC(ret_fast_syscall)
@@@ -128,10 -130,11 +130,11 @@@ ret_slow_syscall
        disable_irq_notrace                     @ disable interrupts
  ENTRY(ret_to_user_from_irq)
        ldr     r2, [tsk, #TI_ADDR_LIMIT]
-       cmp     r2, #TASK_SIZE
+       ldr     r1, =TASK_SIZE
+       cmp     r2, r1
        blne    addr_limit_check_failed
        ldr     r1, [tsk, #TI_FLAGS]
 -      tst     r1, #_TIF_WORK_MASK
 +      movs    r1, r1, lsl #16
        bne     slow_work_pending
  no_work_pending:
        asm_trace_hardirqs_on save = 0
diff --combined arch/arm/mm/Makefile
index c4ce477c52611c35949e74c0a1f5aa4fc04c77eb,4536159bc8faae675fc6da4d4e716e330cd1f029..3510503bc5e688bb123503778c3e2118f1855817
@@@ -7,6 -7,7 +7,7 @@@ obj-y                            := extable.o fault.o init.o io
  obj-y                         += dma-mapping$(MMUEXT).o
  obj-$(CONFIG_MMU)             += fault-armv.o flush.o idmap.o ioremap.o \
                                   mmap.o pgd.o mmu.o pageattr.o
+ KASAN_SANITIZE_mmu.o          := n
  
  ifneq ($(CONFIG_MMU),y)
  obj-y                         += nommu.o
@@@ -16,9 -17,11 +17,10 @@@ endi
  obj-$(CONFIG_ARM_PTDUMP_CORE) += dump.o
  obj-$(CONFIG_ARM_PTDUMP_DEBUGFS)      += ptdump_debugfs.o
  obj-$(CONFIG_MODULES)         += proc-syms.o
+ KASAN_SANITIZE_physaddr.o     := n
  obj-$(CONFIG_DEBUG_VIRTUAL)   += physaddr.o
  
  obj-$(CONFIG_ALIGNMENT_TRAP)  += alignment.o
 -obj-$(CONFIG_HIGHMEM)         += highmem.o
  obj-$(CONFIG_HUGETLB_PAGE)    += hugetlbpage.o
  obj-$(CONFIG_ARM_PV_FIXUP)    += pv-fixup-asm.o
  
@@@ -110,3 -113,6 +112,6 @@@ obj-$(CONFIG_CACHE_L2X0_PMU)       += cache-l
  obj-$(CONFIG_CACHE_XSC3L2)    += cache-xsc3l2.o
  obj-$(CONFIG_CACHE_TAUROS2)   += cache-tauros2.o
  obj-$(CONFIG_CACHE_UNIPHIER)  += cache-uniphier.o
+ KASAN_SANITIZE_kasan_init.o   := n
+ obj-$(CONFIG_KASAN)           += kasan_init.o
diff --combined arch/arm/mm/init.c
index db623d7c30de3309241178d2318b7dcb55592db3,a391804c7ce3c09927e715109107407fae9fb3b1..828a2561b2295813cc304f18434ab8dae82ae74a
@@@ -223,7 -223,6 +223,6 @@@ void __init arm_memblock_init(const str
        if (mdesc->reserve)
                mdesc->reserve();
  
-       early_init_fdt_reserve_self();
        early_init_fdt_scan_reserved_mem();
  
        /* reserve memory for DMA contiguous allocations */
@@@ -267,6 -266,83 +266,6 @@@ static inline void poison_init_mem(voi
                *p++ = 0xe7fddef0;
  }
  
 -static inline void __init
 -free_memmap(unsigned long start_pfn, unsigned long end_pfn)
 -{
 -      struct page *start_pg, *end_pg;
 -      phys_addr_t pg, pgend;
 -
 -      /*
 -       * Convert start_pfn/end_pfn to a struct page pointer.
 -       */
 -      start_pg = pfn_to_page(start_pfn - 1) + 1;
 -      end_pg = pfn_to_page(end_pfn - 1) + 1;
 -
 -      /*
 -       * Convert to physical addresses, and
 -       * round start upwards and end downwards.
 -       */
 -      pg = PAGE_ALIGN(__pa(start_pg));
 -      pgend = __pa(end_pg) & PAGE_MASK;
 -
 -      /*
 -       * If there are free pages between these,
 -       * free the section of the memmap array.
 -       */
 -      if (pg < pgend)
 -              memblock_free_early(pg, pgend - pg);
 -}
 -
 -/*
 - * The mem_map array can get very big.  Free the unused area of the memory map.
 - */
 -static void __init free_unused_memmap(void)
 -{
 -      unsigned long start, end, prev_end = 0;
 -      int i;
 -
 -      /*
 -       * This relies on each bank being in address order.
 -       * The banks are sorted previously in bootmem_init().
 -       */
 -      for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) {
 -#ifdef CONFIG_SPARSEMEM
 -              /*
 -               * Take care not to free memmap entries that don't exist
 -               * due to SPARSEMEM sections which aren't present.
 -               */
 -              start = min(start,
 -                               ALIGN(prev_end, PAGES_PER_SECTION));
 -#else
 -              /*
 -               * Align down here since the VM subsystem insists that the
 -               * memmap entries are valid from the bank start aligned to
 -               * MAX_ORDER_NR_PAGES.
 -               */
 -              start = round_down(start, MAX_ORDER_NR_PAGES);
 -#endif
 -              /*
 -               * If we had a previous bank, and there is a space
 -               * between the current bank and the previous, free it.
 -               */
 -              if (prev_end && prev_end < start)
 -                      free_memmap(prev_end, start);
 -
 -              /*
 -               * Align up here since the VM subsystem insists that the
 -               * memmap entries are valid from the bank end aligned to
 -               * MAX_ORDER_NR_PAGES.
 -               */
 -              prev_end = ALIGN(end, MAX_ORDER_NR_PAGES);
 -      }
 -
 -#ifdef CONFIG_SPARSEMEM
 -      if (!IS_ALIGNED(prev_end, PAGES_PER_SECTION))
 -              free_memmap(prev_end,
 -                          ALIGN(prev_end, PAGES_PER_SECTION));
 -#endif
 -}
 -
  static void __init free_highpages(void)
  {
  #ifdef CONFIG_HIGHMEM
        /* set highmem page free */
        for_each_free_mem_range(i, NUMA_NO_NODE, MEMBLOCK_NONE,
                                &range_start, &range_end, NULL) {
 -              unsigned long start = PHYS_PFN(range_start);
 -              unsigned long end = PHYS_PFN(range_end);
 +              unsigned long start = PFN_UP(range_start);
 +              unsigned long end = PFN_DOWN(range_end);
  
                /* Ignore complete lowmem entries */
                if (end <= max_low)
@@@ -308,6 -384,7 +307,6 @@@ void __init mem_init(void
        set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
  
        /* this will put all unused low memory onto the freelists */
 -      free_unused_memmap();
        memblock_free_all();
  
  #ifdef CONFIG_SA1111
This page took 0.124197 seconds and 4 git commands to generate.