1. 13 Sep, 2019 3 commits
    • Michael Ellerman's avatar
      powerpc/kvm: Move kvm_tmp into .text, shrink to 64K · 0cb0837f
      Michael Ellerman authored
      In some configurations of KVM, guests binary patch themselves to
      avoid/reduce trapping into the hypervisor. For some instructions this
      requires replacing one instruction with a sequence of instructions.
      
      For those cases we need to write the sequence of instructions
      somewhere and then patch the location of the original instruction to
      branch to the sequence. That requires that the location of the
      sequence be within 32MB of the original instruction.
      
      The current solution for this is that we create a 1MB array in BSS,
      write sequences into there, and then free the remainder of the array.
      
      This has a few problems:
       - it confuses kmemleak.
       - it confuses lockdep.
       - it requires mapping kvm_tmp executable, which can cause adjacent
         areas to also be mapped executable if we're using 16M pages for the
         linear mapping.
       - the 32MB limit can be exceeded if the kernel is big enough,
         especially with STRICT_KERNEL_RWX enabled, which then prevents the
         patching from working at all.
      
      We can fix all those problems by making kvm_tmp just a region of
      regular .text. However currently it's 1MB in size, and we don't want
      to waste 1MB of text. In practice however I only see ~30KB of kvm_tmp
      being used even for an allyes_config. So shrink kvm_tmp to 64K, which
      ought to be enough for everyone, and move it into .text.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20190911115746.12433-1-mpe@ellerman.id.au
      0cb0837f
    • Michael Ellerman's avatar
      powerpc/powernv: Fix build with IOMMU_API=n · 79cb6879
      Michael Ellerman authored
      The builds breaks when IOMMU_API=n, eg. skiroot_defconfig:
      
        arch/powerpc/platforms/powernv/npu-dma.c:96:28: error: 'get_gpu_pci_dev_and_pe' defined but not used
        arch/powerpc/platforms/powernv/npu-dma.c:126:13: error: 'pnv_npu_set_window' defined but not used
      
      Fixes: b4d37a7b ("powerpc/powernv: Remove unused pnv_npu_try_dma_set_bypass() function")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      79cb6879
    • Michael Ellerman's avatar
      powerpc/eeh: Fix build with STACKTRACE=n · 1b7f3b6c
      Michael Ellerman authored
      The build breaks when STACKTRACE=n, eg. skiroot_defconfig:
      
        arch/powerpc/kernel/eeh_event.c:124:23: error: implicit declaration of function 'stack_trace_save'
      
      Fix it with some ifdefs for now.
      
      Fixes: 25baf3d8 ("powerpc/eeh: Defer printing stack trace")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      1b7f3b6c
  2. 11 Sep, 2019 9 commits
  3. 05 Sep, 2019 22 commits
  4. 30 Aug, 2019 6 commits