Skip to content
  1. Nov 09, 2017
  2. Nov 06, 2017
  3. Nov 02, 2017
    • Russell King's avatar
      ARM: add debug ".edata_real" symbol · dad46753
      Russell King authored
      
      
      Add an additional symbol to the decompressor image, which will allow
      future debugging of non-bootable problems similar to the one encountered
      with the EFI stub.
      
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      dad46753
    • Luc Van Oostenryck's avatar
      ARM: 8716/1: pass endianness info to sparse · ff0c6eec
      Luc Van Oostenryck authored
      
      
      ARM depends on the macros '__ARMEL__' & '__ARMEB__' being defined
      or not to correctly select or define endian-specific macros,
      structures or pieces of code.
      
      These macros are predefined by the compiler but sparse knows
      nothing about them and thus may pre-process files differently
      from what gcc would.
      
      Fix this by passing '-D__ARMEL__' or '-D__ARMEB__' to sparse,
      depending on the endianness of the kernel, like defined by GCC.
      
      Note: In most case it won't change anything since most ARMs use
            little-endian (but an allyesconfig would use big-endian!).
      
      To: Russell King <linux@armlinux.org.uk>
      
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      ff0c6eec
  4. Oct 28, 2017
    • Ard Biesheuvel's avatar
      efi/libstub: arm: omit sorting of the UEFI memory map · 29f9007b
      Ard Biesheuvel authored
      
      
      ARM shares its EFI stub implementation with arm64, which has some
      special handling in the virtual remapping code to
      a) make sure that we can map everything even if the OS executes
         with 64k page size, and
      b) make sure that adjacent regions with the same attributes are not
         reordered or moved apart in memory.
      
      The latter is a workaround for a 'feature' that was shortly recommended
      by UEFI spec v2.5, but deprecated shortly after, due to the fact that
      it broke many OS installers, including non-Linux ones, and it was never
      widely implemented for ARM systems. Before implementing b), the arm64
      code simply rounded up all regions to 64 KB granularity, but given that
      that results in moving adjacent regions apart, it had to be refined when
      b) was implemented.
      
      The adjacency check requires a sort() pass, due to the fact that the
      UEFI spec does not mandate any ordering, and the inclusion of the
      lib/sort.c code into the ARM EFI stub is causing some trouble with
      the decompressor build due to the fact that its EXPORT_SYMBOL() call
      triggers the creation of ksymtab/kcrctab sections.
      
      So let's simply do away with the adjacency check for ARM, and simply put
      all UEFI runtime regions together if they have the same memory attributes.
      This is guaranteed to work, given that ARM only supports 4 KB pages,
      and allows us to remove the sort() call entirely.
      
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Tested-by: default avatarJeffy Chen <jeffy.chen@rock-chips.com>
      Tested-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      Tested-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      29f9007b
  5. Oct 24, 2017
    • Arnd Bergmann's avatar
      ARM: 8715/1: add a private asm/unaligned.h · 1cce91df
      Arnd Bergmann authored
      
      
      The asm-generic/unaligned.h header provides two different implementations
      for accessing unaligned variables: the access_ok.h version used when
      CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is set pretends that all pointers
      are in fact aligned, while the le_struct.h version convinces gcc that the
      alignment of a pointer is '1', to make it issue the correct load/store
      instructions depending on the architecture flags.
      
      On ARMv5 and older, we always use the second version, to let the compiler
      use byte accesses. On ARMv6 and newer, we currently use the access_ok.h
      version, so the compiler can use any instruction including stm/ldm and
      ldrd/strd that will cause an alignment trap. This trap can significantly
      impact performance when we have to do a lot of fixups and, worse, has
      led to crashes in the LZ4 decompressor code that does not have a trap
      handler.
      
      This adds an ARM specific version of asm/unaligned.h that uses the
      le_struct.h/be_struct.h implementation unconditionally. This should lead
      to essentially the same code on ARMv6+ as before, with the exception of
      using regular load/store instructions instead of the trapping instructions
      multi-register variants.
      
      The crash in the LZ4 decompressor code was probably introduced by the
      patch replacing the LZ4 implementation, commit 4e1a33b1 ("lib: update
      LZ4 compressor module"), so linux-4.11 and higher would be affected most.
      However, we probably want to have this backported to all older stable
      kernels as well, to help with the performance issues.
      
      There are two follow-ups that I think we should also work on, but not
      backport to stable kernels, first to change the asm-generic version of
      the header to remove the ARM special case, and second to review all
      other uses of CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to see if they
      might be affected by the same problem on ARM.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      1cce91df
  6. Oct 23, 2017
  7. Oct 14, 2017
  8. Oct 12, 2017
  9. Oct 03, 2017
    • Russell King's avatar
      ARM: add additional table to compressed kernel · c7725687
      Russell King authored
      
      
      Add an additional extendable table to the compressed kernel so that we
      can provide further information to boot loaders regarding the properties
      of the image contained within.
      
      This is necessary for correct behaviour of kexec.
      
      Tested-by: default avatarTony Lindgren <tony@atomide.com>
      Tested-by: default avatarKeerthy <j-keerthy@ti.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      c7725687
    • Russell King's avatar
      ARM: decompressor: fix BSS size calculation · 429f7a06
      Russell King authored
      
      
      Assuming size(1) gives the size of the BSS is a mistake - it reports
      the size of the .bss section in the ELF image, which may not be the
      same as the region we mark with the __bss_start..__bss_stop symbols.
      
      We use the size of the BSS in the decompressor to know whether the
      kernel will overwrite the appended dtb, by adding the BSS size to the
      size of the Image (stored at the end of the compressed data) and adding
      the desired address of the decompressed image.
      
      If the BSS size is smaller than it really is, the decompressor can
      incorrectly assume that the BSS clearance will not overwrite the DTB.
      
      Here is an illustration:
      
      $ arm-linux-size vmlinux
         text    data      bss      dec     hex filename
      8136972 3098076 10240348 21475396 147b044 vmlinux
      $ arm-linux-nm vmlinux | grep __bss_
      c0ac0e34 B __bss_start
      c1484f9c B __bss_stop
      $ stat -c %s arch/arm/boot/Image
      11243060
      
      In the above case, we are 12 bytes short.  This is caused by the BSS
      section being aligned by one of its input sections:
      
      Idx Name          Size      VMA       LMA       File off  Algn
       23 __bug_table   00005d3c  c0abb0f8  c0abb0f8  00acb0f8  2**2
                        CONTENTS, ALLOC, LOAD, DATA
       24 .bss          009c415c  c0ac0e40  c0ac0e40  00ad0e34  2**6
                        ALLOC
      
      Note that there's an additional 12 bytes difference between the file
      offset and LMA compared with the bug table - this occurs because one
      of the input sections for the .bss section requires a 64 byte
      alignment.
      
      Fix this by using 'nm' and perl to obtain the address of the __bss_start
      and __bss_stop symbols, using their difference for the size of the BSS.
      
      Tested-by: default avatarTony Lindgren <tony@atomide.com>
      Tested-by: default avatarKeerthy <j-keerthy@ti.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      429f7a06
    • Russell King's avatar
      pcmcia: sa1111: remove special sa1111 mmio accessors · de854b33
      Russell King authored
      
      
      Remove the special SA1111 MMIO accessors from the SA1111 PCMCIA driver
      as their definition will be removed shortly.  The SA1111 accessors are
      barrierless, so use the _relaxed variants.
      
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      de854b33
    • Russell King's avatar
      pcmcia: sa1111: use sa1111_get_irq() to obtain IRQ resources · 7170a312
      Russell King authored
      
      
      Use the newly provided sa1111_get_irq() to fetch the IRQ resources for
      the SA1111 PCMCIA driver.
      
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      7170a312
    • Russell King's avatar
      Merge branch 'fdpic' of http://git.linaro.org/people/nicolas.pitre/linux into devel-stable · 1bb07833
      Russell King authored
      This series provides the needed changes to suport the ELF_FDPIC binary
      format on ARM. Both MMU and non-MMU systems are supported. This format
      has many advantages over the BFLT format used on MMU-less systems, such
      as being real ELF that can be parsed by standard tools, can support
      shared dynamic libs, etc.
      1bb07833
  10. Sep 29, 2017
    • Russell King's avatar
      ARM: better diagnostics with missing/corrupt dtb · 99cf8f90
      Russell King authored
      
      
      With a kernel containing both DT and atag support, the diagnostics
      output when the dtb is missing or corrupt assume that we're trying
      to boot using atags and the machine ID, and only print the machine
      ID.  This is not useful for diagnosing a missing or corrupt dtb.
      
      Move the message into arch/arm/kernel/setup.c, and print the address
      of the dtb/atag list, and the first 16 bytes of memory of the dtb or
      atag list.
      
      This allows us to see whether the dtb was corrupted in some way,
      causing the fallback to the machine ID / atag list.
      
      Tested-by: default avatarKeerthy <j-keerthy@ti.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      99cf8f90
  11. Sep 28, 2017
  12. Sep 17, 2017