1. 04 Apr, 2017 1 commit
    • Ard Biesheuvel's avatar
      arm64: relocation testing module · 214fad55
      Ard Biesheuvel authored
      This module tests the module loader's ELF relocation processing
      routines. When loaded, it logs output like below.
          Relocation test:
          R_AARCH64_ABS64                 0xffff880000cccccc pass
          R_AARCH64_ABS32                 0x00000000f800cccc pass
          R_AARCH64_ABS16                 0x000000000000f8cc pass
          R_AARCH64_MOVW_SABS_Gn          0xffff880000cccccc pass
          R_AARCH64_MOVW_UABS_Gn          0xffff880000cccccc pass
          R_AARCH64_ADR_PREL_LO21         0xffffff9cf4d1a400 pass
          R_AARCH64_PREL64                0xffffff9cf4d1a400 pass
          R_AARCH64_PREL32                0xffffff9cf4d1a400 pass
          R_AARCH64_PREL16                0xffffff9cf4d1a400 pass
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
  2. 07 Feb, 2017 2 commits
  3. 03 Feb, 2017 1 commit
    • Ard Biesheuvel's avatar
      efi: arm64: Add vmlinux debug link to the Image binary · 757b435a
      Ard Biesheuvel authored
      When building with debugging symbols, take the absolute path to the
      vmlinux binary and add it to the special PE/COFF debug table entry.
      This allows a debug EFI build to find the vmlinux binary, which is
      very helpful in debugging, given that the offset where the Image is
      first loaded by EFI is highly unpredictable.
      On implementations of UEFI that choose to implement it, this
      information is exposed via the EFI debug support table, which is a UEFI
      configuration table that is accessible both by the firmware at boot time
      and by the OS at runtime, and lists all PE/COFF images loaded by the
      The format of the NB10 Codeview entry is based on the definition used
      by EDK2, which is our primary reference when it comes to the use of
      PE/COFF in the context of UEFI firmware.
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      [will: use realpath instead of shell invocation, as discussed on list]
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
  4. 07 Nov, 2016 2 commits
  5. 26 Aug, 2016 1 commit
  6. 31 May, 2016 1 commit
    • Mark Rutland's avatar
      arm64: enable CONFIG_SET_MODULE_RONX by default · 604c8e67
      Mark Rutland authored
      The SET_MODULE_RONX protections are effectively the same as the
      DEBUG_RODATA protections we enabled by default back in commit
      57efac2f ("arm64: enable CONFIG_DEBUG_RODATA by default"). It
      seems unusual to have one but not the other.
      As evidenced by the help text, the rationale appears to be that
      SET_MODULE_RONX interacts poorly with tracing and patching, but both of
      these make use of the insn framework, which takes SET_MODULE_RONX into
      account. Any remaining issues are bugs which should be fixed regardless
      of the default state of the option.
      This patch enables DEBUG_SET_MODULE_RONX by default, and replaces the
      help text with a new wording derived from the DEBUG_RODATA help text,
      which better describes the functionality. Previously, the DEBUG_RODATA
      entry was inconsistently indented with spaces, which are replaced with
      tabs as with the other Kconfig entries.
      Additionally, the wording of recommended defaults is made consistent for
      all options. These are placed in a new paragraph, unquoted, as a full
      sentence (with a period/full stop) as this appears to be the most common
      form per $(git grep 'in doubt').
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Laura Abbott <labbott@fedoraproject.org>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
  7. 14 Apr, 2016 1 commit
    • Ard Biesheuvel's avatar
      arm64: simplify kernel segment mapping granularity · 97740051
      Ard Biesheuvel authored
      The mapping of the kernel consist of four segments, each of which is mapped
      with different permission attributes and/or lifetimes. To optimize the TLB
      and translation table footprint, we define various opaque constants in the
      linker script that resolve to different aligment values depending on the
      page size and whether CONFIG_DEBUG_ALIGN_RODATA is set.
      Considering that
      - a 4 KB granule kernel benefits from a 64 KB segment alignment (due to
        the fact that it allows the use of the contiguous bit),
      - the minimum alignment of the .data segment is THREAD_SIZE already, not
        PAGE_SIZE (i.e., we already have padding between _data and the start of
        the .data payload in many cases),
      - 2 MB is a suitable alignment value on all granule sizes, either for
        mapping directly (level 2 on 4 KB), or via the contiguous bit (level 3 on
        16 KB and 64 KB),
      - anything beyond 2 MB exceeds the minimum alignment mandated by the boot
        protocol, and can only be mapped efficiently if the physical alignment
        happens to be the same,
      we can simplify this by standardizing on 64 KB (or 2 MB) explicitly, i.e.,
      regardless of granule size, all segments are aligned either to 64 KB, or to
      2 MB if CONFIG_DEBUG_ALIGN_RODATA=y. This also means we can drop the Kconfig
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
  8. 03 Mar, 2016 1 commit
    • Ard Biesheuvel's avatar
      arm64: enable CONFIG_DEBUG_RODATA by default · 57efac2f
      Ard Biesheuvel authored
      In spite of its name, CONFIG_DEBUG_RODATA is an important hardening feature
      for production kernels, and distros all enable it by default in their
      kernel configs. However, since enabling it used to result in more granular,
      and thus less efficient kernel mappings, it is not enabled by default for
      performance reasons.
      However, since commit 2f39b5f9 ("arm64: mm: Mark .rodata as RO"), the
      various kernel segments (.text, .rodata, .init and .data) are already
      mapped individually, and the only effect of setting CONFIG_DEBUG_RODATA is
      that the existing .text and .rodata mappings are updated late in the boot
      sequence to have their read-only attributes set, which means that any
      performance concerns related to enabling CONFIG_DEBUG_RODATA are no longer
      So from now on, make CONFIG_DEBUG_RODATA default to 'y'
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
  9. 09 Jan, 2016 1 commit
  10. 10 Nov, 2015 1 commit
  11. 19 Oct, 2015 1 commit
  12. 03 Apr, 2015 2 commits
  13. 22 Jan, 2015 1 commit
  14. 26 Nov, 2014 1 commit
  15. 08 Sep, 2014 1 commit
  16. 10 Jul, 2014 1 commit
    • Mark Rutland's avatar
      arm64: Enable TEXT_OFFSET fuzzing · da57a369
      Mark Rutland authored
      The arm64 Image header contains a text_offset field which bootloaders
      are supposed to read to determine the offset (from a 2MB aligned "start
      of memory" per booting.txt) at which to load the kernel. The offset is
      not well respected by bootloaders at present, and due to the lack of
      variation there is little incentive to support it. This is unfortunate
      for the sake of future kernels where we may wish to vary the text offset
      (even zeroing it).
      This patch adds options to arm64 to enable fuzz-testing of text_offset.
      CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET forces the text offset to a random
      16-byte aligned value value in the range [0..2MB) upon a build of the
      kernel. It is recommended that distribution kernels enable randomization
      to test bootloaders such that any compliance issues can be fixed early.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarTom Rini <trini@ti.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
  17. 24 Apr, 2014 1 commit
  18. 07 Apr, 2014 1 commit
  19. 02 Oct, 2013 1 commit
  20. 19 Mar, 2013 1 commit
  21. 11 Feb, 2013 1 commit
  22. 22 Jan, 2013 1 commit
    • Catalin Marinas's avatar
      arm64: Add simple earlyprintk support · 2475ff9d
      Catalin Marinas authored
      This patch adds support for "earlyprintk=" parameter on the kernel
      command line. The format is:
      where <name> is the name of the (UART) device, e.g. "pl011", <addr> is
      the I/O address. The <options> aren't currently used.
      The mapping of the earlyprintk device is done very early during kernel
      boot and there are restrictions on which functions it can call. A
      special early_io_map() function is added which creates the mapping from
      the pre-defined EARLY_IOBASE to the device I/O address passed via the
      kernel parameter. The pgd entry corresponding to EARLY_IOBASE is
      pre-populated in head.S during kernel boot.
      Only PL011 is currently supported and it is assumed that the interface
      is already initialised by the boot loader before the kernel is started.
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
  23. 17 Sep, 2012 1 commit