1. 28 May, 2020 38 commits
  2. 26 May, 2020 2 commits
    • Cédric Le Goater's avatar
      powerpc/xive: Clear the page tables for the ESB IO mapping · a101950f
      Cédric Le Goater authored
      Commit 1ca3dec2 ("powerpc/xive: Prevent page fault issues in the
      machine crash handler") fixed an issue in the FW assisted dump of
      machines using hash MMU and the XIVE interrupt mode under the POWER
      hypervisor. It forced the mapping of the ESB page of interrupts being
      mapped in the Linux IRQ number space to make sure the 'crash kexec'
      sequence worked during such an event. But it didn't handle the
      un-mapping.
      
      This mapping is now blocking the removal of a passthrough IO adapter
      under the POWER hypervisor because it expects the guest OS to have
      cleared all page table entries related to the adapter. If some are
      still present, the RTAS call which isolates the PCI slot returns error
      9001 "valid outstanding translations".
      
      Remove these mapping in the IRQ data cleanup routine.
      
      Under KVM, this cleanup is not required because the ESB pages for the
      adapter interrupts are un-mapped from the guest by the hypervisor in
      the KVM XIVE native device. This is now redundant but it's harmless.
      
      Fixes: 1ca3dec2 ("powerpc/xive: Prevent page fault issues in the machine crash handler")
      Cc: stable@vger.kernel.org # v5.5+
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20200429075122.1216388-2-clg@kaod.org
      a101950f
    • Michael Ellerman's avatar
      powerpc: Add ppc_inst_as_u64() · 16ef9767
      Michael Ellerman authored
      The code patching code wants to get the value of a struct ppc_inst as
      a u64 when the instruction is prefixed, so we can pass the u64 down to
      __put_user_asm() and write it with a single store.
      
      The optprobes code wants to load a struct ppc_inst as an immediate
      into a register so it is useful to have it as a u64 to use the
      existing helper function.
      
      Currently this is a bit awkward because the value differs based on the
      CPU endianness, so add a helper to do the conversion.
      
      This fixes the usage in arch_prepare_optimized_kprobe() which was
      previously incorrect on big endian.
      
      Fixes: 650b55b7 ("powerpc: Add prefixed instructions to instruction data type")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Tested-by: default avatarJordan Niethe <jniethe5@gmail.com>
      Link: https://lore.kernel.org/r/20200526072630.2487363-1-mpe@ellerman.id.au
      16ef9767