1. Mar 12, 2021
  2. Mar 10, 2021
  3. Mar 09, 2021
    • Thomas Bogendoerfer's avatar
      MIPS: kernel: Reserve exception base early to prevent corruption · bd67b711
      Thomas Bogendoerfer authored
      BMIPS is one of the few platforms that do change the exception base.
      After commit 2dcb3964 ("memblock: do not start bottom-up allocations
      with kernel_end") we started seeing BMIPS boards fail to boot with the
      built-in FDT being corrupted.
      
      Before the cited commit, early allocations would be in the [kernel_end,
      RAM_END] range, but after commit they would be within [RAM_START +
      PAGE_SIZE, RAM_END].
      
      The custom exception base handler that is installed by
      bmips_ebase_setup() done for BMIPS5000 CPUs ends-up trampling on the
      memory region allocated by unflatten_and_copy_device_tree() thus
      corrupting the FDT used by the kernel.
      
      To fix this, we need to perform an early reservation of the custom
      exception space. Additional we reserve the first 4k (1k for R3k) for
      either normal exception vector space (legacy CPUs) or special vectors
      like cache exceptions.
      
      Huge thanks to Serge for analysing and proposing a solution to this
      issue.
      
      Fixes: 2dcb3964
      
       ("memblock: do not start bottom-up allocations with kernel_end")
      Reported-by: default avatarKamal Dasu <kdasu.kdev@gmail.com>
      Debugged-by: default avatarSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Acked-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Tested-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarSerge Semin <fancer.lancer@gmail.com>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      bd67b711
    • Bjørn Mork's avatar
      MIPS: vmlinux.lds.S: align raw appended dtb to 8 bytes · 6654111c
      Bjørn Mork authored
      The devicetree specification requires 8-byte alignment in
      memory. This is now enforced by libfdt since commit 79edff12
      ("scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9")
      which included the upstream commit 5e735860c478 ("libfdt: Check for
      8-byte address alignment in fdt_ro_probe_()").
      
      This broke the MIPS raw appended DTBs which would be appended to
      the image immediately following the initramfs section.  This ends
      with a 32bit size, resulting in a 4-byte alignment of the DTB.
      
      Fix by padding with zeroes to 8-bytes when MIPS_RAW_APPENDED_DTB
      is defined.
      
      Fixes: 79edff12
      
       ("scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9")
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      6654111c
  4. Mar 08, 2021
  5. Mar 06, 2021