1. 04 Dec, 2020 3 commits
    • Mathieu Desnoyers's avatar
      powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at · d85be8a4
      Mathieu Desnoyers authored
      The placeholder for instruction selection should use the second
      argument's operand, which is %1, not %0. This could generate incorrect
      assembly code if the memory addressing of operand %0 is a different
      form from that of operand %1.
      
      Also remove the %Un placeholder because having %Un placeholders
      for two operands which are based on the same local var (ptep) doesn't
      make much sense. By the way, it doesn't change the current behaviour
      because "<>" constraint is missing for the associated "=m".
      
      [chleroy: revised commit log iaw segher's comments and removed %U0]
      
      Fixes: 9bf2b5cd ("powerpc: Fixes for CONFIG_PTE_64BIT for SMP support")
      Cc: <stable@vger.kernel.org> # v2.6.28+
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Acked-by: default avatarSegher Boessenkool <segher@kernel.crashing.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/96354bd77977a6a933fe9020da57629007fdb920.1603358942.git.christophe.leroy@csgroup.eu
      d85be8a4
    • Christophe Leroy's avatar
      powerpc/xmon: Change printk() to pr_cont() · 7c6c86b3
      Christophe Leroy authored
      Since some time now, printk() adds carriage return, leading to
      unusable xmon output if there is no udbg backend available:
      
        [   54.288722] sysrq: Entering xmon
        [   54.292209] Vector: 0  at [cace3d2c]
        [   54.292274]     pc:
        [   54.292331] c0023650
        [   54.292468] : xmon+0x28/0x58
        [   54.292519]
        [   54.292574]     lr:
        [   54.292630] c0023724
        [   54.292749] : sysrq_handle_xmon+0xa4/0xfc
        [   54.292801]
        [   54.292867]     sp: cace3de8
        [   54.292931]    msr: 9032
        [   54.292999]   current = 0xc28d0000
        [   54.293072]     pid   = 377, comm = sh
        [   54.293157] Linux version 5.10.0-rc6-s3k-dev-01364-gedf13f0ccd76-dirty (root@po17688vm.idsi0.si.c-s.fr) (powerpc64-linux-gcc (GCC) 10.1.0, GNU ld (GNU Binutils) 2.34) #4211 PREEMPT Fri Dec 4 09:32:11 UTC 2020
        [   54.293287] enter ? for help
        [   54.293470] [cace3de8]
        [   54.293532] c0023724
        [   54.293654]  sysrq_handle_xmon+0xa4/0xfc
        [   54.293711]  (unreliable)
        ...
        [   54.296002]
        [   54.296159] --- Exception: c01 (System Call) at
        [   54.296217] 0fd4e784
        [   54.296303]
        [   54.296375] SP (7fca6ff0) is in userspace
        [   54.296431] mon>
        [   54.296484]  <no input ...>
      
      Use pr_cont() instead.
      
      Fixes: 4bcc595c ("printk: reinstate KERN_CONT for printing continuation lines")
      Cc: stable@vger.kernel.org # v4.9+
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      [mpe: Mention that it only happens when udbg is not available]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/c8a6ec704416ecd5ff2bd26213c9bc026bdd19de.1607077340.git.christophe.leroy@csgroup.eu
      7c6c86b3
    • Alexey Kardashevskiy's avatar
      powerpc/powernv/npu: Do not attempt NPU2 setup on POWER8NVL NPU · b1198a88
      Alexey Kardashevskiy authored
      We execute certain NPU2 setup code (such as mapping an LPID to a device
      in NPU2) unconditionally if an Nvlink bridge is detected. However this
      cannot succeed on POWER8NVL machines and errors appear in dmesg. This is
      harmless as skiboot returns an error and the only place we check it is
      vfio-pci but that code does not get called on P8+ either.
      
      This adds a check if pnv_npu2_xxx helpers are called on a machine with
      NPU2 which initializes pnv_phb::npu in pnv_npu2_init();
      pnv_phb::npu==NULL on POWER8/NVL (Naples).
      
      While at this, fix NULL derefencing in pnv_npu_peers_take_ownership/
      pnv_npu_peers_release_ownership which occurs when GPUs on mentioned P8s
      cause EEH which happens if "vfio-pci" disables devices using
      the D3 power state; the vfio-pci's disable_idle_d3 module parameter
      controls this and must be set on Naples. The EEH handling clears
      the entire pnv_ioda_pe struct in pnv_ioda_free_pe() hence
      the NULL derefencing. We cannot recover from that but at least we stop
      crashing.
      
      Tested on
      - POWER9 pvr=004e1201, Ubuntu 19.04 host, Ubuntu 18.04 vm,
        NVIDIA GV100 10de:1db1 driver 418.39
      - POWER8 pvr=004c0100, RHEL 7.6 host, Ubuntu 16.10 vm,
        NVIDIA P100 10de:15f9 driver 396.47
      
      Fixes: 1b785611 ("powerpc/powernv/npu: Add release_ownership hook")
      Cc: stable@vger.kernel.org # 5.0
      Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20201122073828.15446-1-aik@ozlabs.ru
      b1198a88
  2. 03 Dec, 2020 37 commits