Skip to content
  1. Jul 12, 2019
  2. Jul 11, 2019
    • Oliver O'Halloran's avatar
      powerpc/eeh: Handle hugepages in ioremap space · 33439620
      Oliver O'Halloran authored
      
      
      In commit 4a7b06c157a2 ("powerpc/eeh: Handle hugepages in ioremap
      space") support for using hugepages in the vmalloc and ioremap areas was
      enabled for radix. Unfortunately this broke EEH MMIO error checking.
      
      Detection works by inserting a hook which checks the results of the
      ioreadXX() set of functions.  When a read returns a 0xFFs response we
      need to check for an error which we do by mapping the (virtual) MMIO
      address back to a physical address, then mapping physical address to a
      PCI device via an interval tree.
      
      When translating virt -> phys we currently assume the ioremap space is
      only populated by PAGE_SIZE mappings. If a hugepage mapping is found we
      emit a WARN_ON(), but otherwise handles the check as though a normal
      page was found. In pathalogical cases such as copying a buffer
      containing a lot of 0xFFs from BAR memory this can result in the system
      not booting because it's too busy printing WARN_ON()s.
      
      There's no real reason to assume huge pages can't be present and we're
      prefectly capable of handling them, so do that.
      
      Fixes: 4a7b06c157a2 ("powerpc/eeh: Handle hugepages in ioremap space")
      Reported-by: default avatarSachin Sant <sachinp@linux.vnet.ibm.com>
      Signed-off-by: default avatarOliver O'Halloran <oohall@gmail.com>
      Tested-by: default avatarSachin Sant <sachinp@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20190710150517.27114-1-oohall@gmail.com
      33439620
  3. Jul 10, 2019
    • Alastair D'Silva's avatar
      ocxl: Update for AFU descriptor template version 1.1 · 73a2b047
      Alastair D'Silva authored
      
      
      The OpenCAPI discovery and configuration specification has been
      updated and introduces version 1.1 of the AFU descriptor template,
      with new fields to better define the memory layout of an OpenCAPI
      adapter.
      
      The ocxl driver doesn't do much yet to support LPC memory but as we
      start seeing (non-LPC) AFU images using the new template, this patch
      updates the config space parsing code to avoid spitting a warning.
      
      Signed-off-by: default avatarAlastair D'Silva <alastair@d-silva.org>
      Signed-off-by: default avatarFrederic Barrat <fbarrat@linux.ibm.com>
      Reviewed-by: default avatarChristophe Lombard <clombard@linux.vnet.ibm.com>
      Acked-by: default avatarAndrew Donnellan <ajd@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20190605111545.19762-1-fbarrat@linux.ibm.com
      73a2b047
    • Masahiro Yamada's avatar
      powerpc/boot: pass CONFIG options in a simpler and more robust way · 4ba7f80f
      Masahiro Yamada authored
      
      
      Commit 5e9dcb61 ("powerpc/boot: Expose Kconfig symbols to wrapper")
      was wrong, but commit e41b93a6 ("powerpc/boot: Fix build failures
      with -j 1") was also wrong.
      
      The correct dependency is:
      
        $(obj)/serial.o: $(obj)/autoconf.h
      
      However, I do not see the reason why we need to copy autoconf.h to
      arch/power/boot/. Nor do I see consistency in the way of passing
      CONFIG options.
      
      decompress.c references CONFIG_KERNEL_GZIP and CONFIG_KERNEL_XZ, which
      are passed via the command line.
      
      serial.c includes autoconf.h to reference a couple of CONFIG options,
      but this is fragile because we often forget to include "autoconf.h"
      from source files.
      
      In fact, it is already broken.
      
      ppc_asm.h references CONFIG_PPC_8xx, but utils.S is not given any way
      to access CONFIG options. So, CONFIG_PPC_8xx is never defined here.
      
      Pass $(LINUXINCLUDE) to make sure CONFIG options are accessible from
      all .c and .S files in arch/powerpc/boot/.
      
      I also removed the -traditional flag to make include/linux/kconfig.h
      work. This flag makes the preprocessor imitate the behavior of the
      pre-standard C compiler, but I do not understand why it is necessary.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20190705100144.28785-2-yamada.masahiro@socionext.com
      4ba7f80f
    • Masahiro Yamada's avatar
      powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h · 9e005b76
      Masahiro Yamada authored
      
      
      The next commit will make the way of passing CONFIG options more robust.
      Unfortunately, it would uncover another hidden issue; without this
      commit, skiroot_defconfig would be broken like this:
      
      |   WRAP    arch/powerpc/boot/zImage.pseries
      | arch/powerpc/boot/wrapper.a(decompress.o): In function `bcj_powerpc.isra.10':
      | decompress.c:(.text+0x720): undefined reference to `get_unaligned_be32'
      | decompress.c:(.text+0x7a8): undefined reference to `put_unaligned_be32'
      | make[1]: *** [arch/powerpc/boot/Makefile;383: arch/powerpc/boot/zImage.pseries] Error 1
      | make: *** [arch/powerpc/Makefile;295: zImage] Error 2
      
      skiroot_defconfig is the only defconfig that enables CONFIG_KERNEL_XZ
      for ppc, which has never been correctly built before.
      
      I figured out the root cause in lib/decompress_unxz.c:
      
      | #ifdef CONFIG_PPC
      | #      define XZ_DEC_POWERPC
      | #endif
      
      CONFIG_PPC is undefined here in the ppc bootwrapper because autoconf.h
      is not included except by arch/powerpc/boot/serial.c
      
      XZ_DEC_POWERPC is not defined, therefore, bcj_powerpc() is not compiled
      for the bootwrapper.
      
      With the next commit passing CONFIG_PPC correctly, we would realize that
      {get,put}_unaligned_be32 was missing.
      
      Unlike the other decompressors, the ppc bootwrapper duplicates all the
      necessary helpers in arch/powerpc/boot/.
      
      The other architectures define __KERNEL__ and pull in helpers for
      building the decompressors.
      
      If ppc bootwrapper had defined __KERNEL__, lib/xz/xz_private.h would
      have included <asm/unaligned.h>:
      
      | #ifdef __KERNEL__
      | #       include <linux/xz.h>
      | #       include <linux/kernel.h>
      | #       include <asm/unaligned.h>
      
      However, doing so would cause tons of definition conflicts since the
      bootwrapper has duplicated everything.
      
      I just added copies of {get,put}_unaligned_be32, following the
      bootwrapper coding convention.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20190705100144.28785-1-yamada.masahiro@socionext.com
      9e005b76
    • Michael Ellerman's avatar
      powerpc/irq: Don't WARN continuously in arch_local_irq_restore() · 0fc12c02
      Michael Ellerman authored
      
      
      When CONFIG_PPC_IRQ_SOFT_MASK_DEBUG is enabled (uncommon), we have a
      series of WARN_ON's in arch_local_irq_restore().
      
      These are "should never happen" conditions, but if they do happen they
      can flood the console and render the system unusable. So switch them
      to WARN_ON_ONCE().
      
      Fixes: e2b36d59 ("powerpc/64: Don't trace code that runs with the soft irq mask unreconciled")
      Fixes: 9b81c021 ("powerpc/64s: make PACA_IRQ_HARD_DIS track MSR[EE] closely")
      Fixes: 7c0482e3 ("powerpc/irq: Fix another case of lazy IRQ state getting out of sync")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20190708061046.7075-1-mpe@ellerman.id.au
      0fc12c02
  4. Jul 05, 2019
  5. Jul 04, 2019