1. 25 Mar, 2021 3 commits
    • Russell King's avatar
      ARM: footbridge: fix PCI interrupt mapping · 30e3b4f2
      Russell King authored
      Since commit 30fdfb92 ("PCI: Add a call to pci_assign_irq() in
      pci_device_probe()"), the PCI code will call the IRQ mapping function
      whenever a PCI driver is probed. If these are marked as __init, this
      causes an oops if a PCI driver is loaded or bound after the kernel has
      initialised.
      
      Fixes: 30fdfb92 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      30e3b4f2
    • Vladimir Murzin's avatar
      ARM: 9069/1: NOMMU: Fix conversion for_each_membock() to for_each_mem_range() · 45c2f70c
      Vladimir Murzin authored
      for_each_mem_range() uses a loop variable, yet looking into code it is
      not just iteration counter but more complex entity which encodes
      information about memblock. Thus condition i == 0 looks fragile.
      Indeed, it broke boot of R-class platforms since it never took i == 0
      path (due to i was set to 1). Fix that with restoring original flag
      check.
      
      Fixes: b10d6bca ("arch, drivers: replace for_each_membock() with for_each_mem_range()")
      Signed-off-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
      Acked-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      45c2f70c
    • Ard Biesheuvel's avatar
      ARM: 9063/1: mm: reduce maximum number of CPUs if DEBUG_KMAP_LOCAL is enabled · d624833f
      Ard Biesheuvel authored
      The debugging code for kmap_local() doubles the number of per-CPU fixmap
      slots allocated for kmap_local(), in order to use half of them as guard
      regions. This causes the fixmap region to grow downwards beyond the start
      of its reserved window if the supported number of CPUs is large, and collide
      with the newly added virtual DT mapping right below it, which is obviously
      not good.
      
      One manifestation of this is EFI boot on a kernel built with NR_CPUS=32
      and CONFIG_DEBUG_KMAP_LOCAL=y, which may pass the FDT in highmem, resulting
      in block entries below the fixmap region that the fixmap code misidentifies
      as fixmap table entries, and subsequently tries to dereference using a
      phys-to-virt translation that is only valid for lowmem. This results in a
      cryptic splat such as the one below.
      
        ftrace: allocating 45548 entries in 89 pages
        8<--- cut here ---
        Unable to handle kernel paging request at virtual address fc6006f0
        pgd = (ptrval)
        [fc6006f0] *pgd=80000040207003, *pmd=00000000
        Internal error: Oops: a06 [#1] SMP ARM
        Modules linked in:
        CPU: 0 PID: 0 Comm: swapper Not tainted 5.11.0+ #382
        Hardware name: Generic DT based system
        PC is at cpu_ca15_set_pte_ext+0x24/0x30
        LR is at __set_fixmap+0xe4/0x118
        pc : [<c041ac9c>]    lr : [<c04189d8>]    psr: 400000d3
        sp : c1601ed8  ip : 00400000  fp : 00800000
        r10: 0000071f  r9 : 00421000  r8 : 00c00000
        r7 : 00c00000  r6 : 0000071f  r5 : ffade000  r4 : 4040171f
        r3 : 00c00000  r2 : 4040171f  r1 : c041ac78  r0 : fc6006f0
        Flags: nZcv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment none
        Control: 30c5387d  Table: 40203000  DAC: 00000001
        Process swapper (pid: 0, stack limit = 0x(ptrval))
      
      So let's limit CONFIG_NR_CPUS to 16 when CONFIG_DEBUG_KMAP_LOCAL=y. Also,
      fix the BUILD_BUG_ON() check that was supposed to catch this, by checking
      whether the region grows below the start address rather than above the end
      address.
      
      Fixes: 2a15ba82 ("ARM: highmem: Switch to generic kmap atomic")
      Reported-by: default avatarPeter Robinson <pbrobinson@gmail.com>
      Tested-by: default avatarPeter Robinson <pbrobinson@gmail.com>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      d624833f
  2. 06 Mar, 2021 4 commits
  3. 05 Mar, 2021 33 commits