1. 17 7月, 2017 1 次提交
    • M
      powerpc/powernv: Fix boot on Power8 bare metal due to opal_configure_cores() · a70b487b
      Michael Ellerman 提交于
      In commit 1c0eaf0f ("powerpc/powernv: Tell OPAL about our MMU mode
      on POWER9"), we added additional flags to the OPAL call to configure
      CPUs at boot.
      
      These flags only work on Power9 firmwares, and worse can cause boot
      failures on Power8 machines, so we check for CPU_FTR_ARCH_300 (aka POWER9)
      before adding the extra flags.
      
      Unfortunately we forgot that opal_configure_cores() is called before
      the CPU feature checks are dynamically patched, meaning the check
      always returns true.
      
      We definitely need to do something to make the CPU feature checks less
      prone to bugs like this, but for now the minimal fix is to use
      early_cpu_has_feature().
      Reported-and-tested-by: NAbdul Haleem <abdhalee@linux.vnet.ibm.com>
      Fixes: 1c0eaf0f ("powerpc/powernv: Tell OPAL about our MMU mode on POWER9")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      a70b487b
  2. 11 7月, 2017 1 次提交
  3. 10 7月, 2017 1 次提交
  4. 07 7月, 2017 2 次提交
  5. 03 7月, 2017 1 次提交
    • B
      powerpc/pseries: Fix passing of pp0 in updatepp() and updateboltedpp() · e71ff982
      Balbir Singh 提交于
      Once upon a time there were only two PP (page protection) bits. In ISA
      2.03 an additional PP bit was added, but because of the layout of the
      HPTE it could not be made contiguous with the existing PP bits.
      
      The result is that we now have three PP bits, named pp0, pp1, pp2,
      where pp0 occupies bit 63 of dword 1 of the HPTE and pp1 and pp2
      occupy bits 1 and 0 respectively. Until recently Linux hasn't used
      pp0, however with the addition of _PAGE_KERNEL_RO we started using it.
      
      The problem arises in the LPAR code, where we need to translate the PP
      bits into the argument for the H_PROTECT hypercall. Currently the code
      only passes bits 0-2 of newpp, which covers pp1, pp2 and N (no
      execute), meaning pp0 is not passed to the hypervisor at all.
      
      We can't simply pass it through in bit 63, as that would collide with a
      different field in the flags argument, as defined in PAPR. Instead we
      have to shift it down to bit 8 (IBM bit 55).
      
      Fixes: e58e87ad ("powerpc/mm: Update _PAGE_KERNEL_RO")
      Cc: stable@vger.kernel.org # v4.7+
      Signed-off-by: NBalbir Singh <bsingharora@gmail.com>
      [mpe: Simplify the test, rework change log]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      e71ff982
  6. 02 7月, 2017 1 次提交
  7. 28 6月, 2017 6 次提交
  8. 27 6月, 2017 5 次提交
    • R
      powerpc/powernv/pci: Enable 64-bit devices to access >4GB DMA space · 8e3f1b1d
      Russell Currey 提交于
      On PHB3/POWER8 systems, devices can select between two different sections
      of address space, TVE#0 and TVE#1.  TVE#0 is intended for 32bit devices
      that aren't capable of addressing more than 4GB.  Selecting TVE#1 instead,
      with the capability of addressing over 4GB, is performed by setting bit 59
      of a PCI address.
      
      However, some devices aren't capable of addressing at least 59 bits, but
      still want more than 4GB of DMA space.  In order to enable this, reconfigure
      TVE#0 to be suitable for 64-bit devices by allocating memory past the
      initial 4GB that is inaccessible by 64-bit DMAs.
      
      This bypass mode is only enabled if a device requests 4GB or more of DMA
      address space, if the system has PHB3 (POWER8 systems), and if the device
      does not share a PE with any devices from different vendors.
      Signed-off-by: NRussell Currey <ruscur@russell.cc>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      8e3f1b1d
    • R
      powerpc/powernv/pci: Add helper to check if a PE has a single vendor · a0f98629
      Russell Currey 提交于
      Add a helper that determines if all the devices contained in a given PE
      are all from the same vendor or not.  This can be useful in determining
      if it's okay to make PE-wide changes that may be suitable for some
      devices but not for others.
      
      This is used later in the series.
      Signed-off-by: NRussell Currey <ruscur@russell.cc>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      a0f98629
    • R
      powerpc/powernv/pci: Add support for PHB4 diagnostics · a4b48ba9
      Russell Currey 提交于
      As with P7IOC and PHB3, add kernel-side support for decoding and printing
      diagnostic data for PHB4.
      Signed-off-by: NRussell Currey <ruscur@russell.cc>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      a4b48ba9
    • R
      powerpc/powernv/pci: Dynamically allocate PHB diag data · 5cb1f8fd
      Russell Currey 提交于
      Diagnostic data for PHBs currently works by allocated a fixed-sized buffer.
      This is simple, but either wastes memory (though only a few kilobytes) or
      in the case of PHB4 isn't enough to fit the whole data blob.
      
      For machines that don't describe the diagnostic data size in the device
      tree, use the hardcoded buffer size as before.  For those that do, only
      allocate exactly what's needed.
      
      In the special case of P7IOC (which has two types of diag data), the larger
      should be specified in the device tree.
      Signed-off-by: NRussell Currey <ruscur@russell.cc>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      5cb1f8fd
    • R
      powerpc/powernv/pci: Reduce spam when dumping PEST · 31bbd45a
      Russell Currey 提交于
      Dumping the PE State Tables (PEST) can be highly verbose if a number of PEs
      are affected, especially in the case where the whole PHB is frozen and 512
      lines get printed.  Check for duplicates when dumping the PEST to reduce
      useless output.
      
      For example:
      
          PE[0f8] A/B: 9700002600000000 80000080d00000f8
          PE[0f9] A/B: 8000000000000000 0000000000000000
          PE[..0fe] A/B: as above
          PE[0ff] A/B: 8440002b00000000 0000000000000000
      
      instead of:
      
          PE[0f8] A/B: 9700002600000000 80000080d00000f8
          PE[0f9] A/B: 8000000000000000 0000000000000000
          PE[0fa] A/B: 8000000000000000 0000000000000000
          PE[0fb] A/B: 8000000000000000 0000000000000000
          PE[0fc] A/B: 8000000000000000 0000000000000000
          PE[0fd] A/B: 8000000000000000 0000000000000000
          PE[0fe] A/B: 8000000000000000 0000000000000000
          PE[0ff] A/B: 8440002b00000000 0000000000000000
      
      and you can imagine how much worse it can get for 512 PEs.
      Signed-off-by: NRussell Currey <ruscur@russell.cc>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      31bbd45a
  9. 22 6月, 2017 1 次提交
  10. 19 6月, 2017 4 次提交
  11. 14 6月, 2017 1 次提交
  12. 12 6月, 2017 2 次提交
    • G
      powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type · 205a1ee1
      Greg Kroah-Hartman 提交于
      The dev_attrs field has long been "depreciated" and is finally being
      removed, so move the driver to use the "correct" dev_groups field
      instead for struct bus_type.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Bart Van Assche <bart.vanassche@sandisk.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Johan Hovold <johan@kernel.org>
      Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
      Cc: Krzysztof Kozlowski <krzk@kernel.org>
      Cc: <linuxppc-dev@lists.ozlabs.org>
      Acked-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      205a1ee1
    • G
      powerpc: vio: use dev_groups and not dev_attrs for bus_type · 451e3f1a
      Greg Kroah-Hartman 提交于
      The dev_attrs field has long been "depreciated" and is finally being
      removed, so move the driver to use the "correct" dev_groups field
      instead for struct bus_type.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Bart Van Assche <bart.vanassche@sandisk.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Johan Hovold <johan@kernel.org>
      Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
      Cc: Krzysztof Kozlowski <krzk@kernel.org>
      Cc: <linuxppc-dev@lists.ozlabs.org>
      Acked-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      451e3f1a
  13. 09 6月, 2017 2 次提交
    • G
      powerpc: ibmebus: use dev_groups and not dev_attrs for bus_type · 823a44ac
      Greg Kroah-Hartman 提交于
      The dev_attrs field has long been "depreciated" and is finally being
      removed, so move the driver to use the "correct" dev_groups field
      instead for struct bus_type.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Bart Van Assche <bart.vanassche@sandisk.com>
      Cc: Johan Hovold <johan@kernel.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Lars-Peter Clausen <lars@metafoo.de>
      Cc: <linuxppc-dev@lists.ozlabs.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      823a44ac
    • G
      powerpc: ps3: use dev_groups and not dev_attrs for bus_type · 892533e1
      Greg Kroah-Hartman 提交于
      The dev_attrs field has long been "depreciated" and is finally being
      removed, so move the driver to use the "correct" dev_groups field
      instead for struct bus_type.
      
      Seems-ok: Geoff Levand <geoff@infradead.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: <linuxppc-dev@lists.ozlabs.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      892533e1
  14. 08 6月, 2017 1 次提交
    • M
      powerpc/book3s64: Move PPC_DT_CPU_FTRs and enable it by default · c6ee9619
      Michael Ellerman 提交于
      The PPC_DT_CPU_FTRs is a bit misplaced in menuconfig, it shows up with
      other general kernel options. It's really more at home in the "Platform
      Support" section, so move it there.
      
      Also enable it by default, for Book3s 64. It does mostly nothing unless
      the device tree properties are found, and we will want it enabled
      eventually in distro kernels, so turn it on to start getting more
      testing.
      
      Fixes: 5a61ef74 ("powerpc/64s: Support new device tree binding for discovering CPU features")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      c6ee9619
  15. 07 6月, 2017 1 次提交
  16. 05 6月, 2017 1 次提交
  17. 01 6月, 2017 3 次提交
    • M
      powerpc/64: Reclaim CPU_FTR_SUBCORE · 0e5e7f5e
      Michael Ellerman 提交于
      We are running low on CPU feature bits, so we only want to use them when
      it's really necessary.
      
      CPU_FTR_SUBCORE is only used in one place, and only in C, so we don't
      need it in order to make asm patching work. It can only be set on
      "Power8" CPUs, which in practice means POWER8, POWER8E and POWER8NVL.
      There are no plans to implement it on future CPUs, but if there ever
      were we could retrofit it then.
      
      Although KVM uses subcores, it never looks at the CPU feature, it either
      looks at the ISA level or the threads_per_subcore value.
      
      So drop the CPU feature and do a PVR check instead. Drop the device tree
      "subcore" feature as we no longer support doing anything with it, and we
      will drop it from skiboot too.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      0e5e7f5e
    • M
      powerpc/hotplug-mem: Fix missing endian conversion of aa_index · dc421b20
      Michael Bringmann 提交于
      When adding or removing memory, the aa_index (affinity value) for the
      memblock must also be converted to match the endianness of the rest
      of the 'ibm,dynamic-memory' property.  Otherwise, subsequent retrieval
      of the attribute will likely lead to non-existent nodes, followed by
      using the default node in the code inappropriately.
      
      Fixes: 5f97b2a0 ("powerpc/pseries: Implement memory hotplug add in the kernel")
      Cc: stable@vger.kernel.org # v4.1+
      Signed-off-by: NMichael Bringmann <mwb@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      dc421b20
    • M
      powerpc/spufs: Fix coredump of SPU contexts · 99acc9be
      Michael Ellerman 提交于
      If a process dumps core while it has SPU contexts active then we have
      code to also dump information about the SPU contexts.
      
      Unfortunately it's been broken for 3 1/2 years, and we didn't notice. In
      commit 7b1f4020 ("spufs: get rid of dump_emit() wrappers") the nread
      variable was removed and rc used instead. That means when the loop exits
      successfully, rc has the number of bytes read, but it's then used as the
      return value for the function, which should return 0 on success.
      
      So fix it by setting rc = 0 before returning in the success case.
      
      Fixes: 7b1f4020 ("spufs: get rid of dump_emit() wrappers")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Acked-by: NJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      99acc9be
  18. 30 5月, 2017 5 次提交
  19. 26 5月, 2017 1 次提交