1. 23 Oct, 2023 2 commits
    • Hari Bathini's avatar
      powerpc/code-patching: introduce patch_instructions() · 465cabc9
      Hari Bathini authored
      patch_instruction() entails setting up pte, patching the instruction,
      clearing the pte and flushing the tlb. If multiple instructions need
      to be patched, every instruction would have to go through the above
      drill unnecessarily. Instead, introduce patch_instructions() function
      that sets up the pte, clears the pte and flushes the tlb only once
      per page range of instructions to be patched. Duplicate most of the
      patch_instruction() code instead of merging with it, to avoid the
      performance degradation observed on ppc32, for patch_instruction(),
      with the code path merged. Also, setup poking_init() always as BPF
      expects poking_init() to be setup even when STRICT_KERNEL_RWX is off.
      Signed-off-by: default avatarHari Bathini <hbathini@linux.ibm.com>
      Acked-by: default avatarSong Liu <song@kernel.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://msgid.link/20231020141358.643575-2-hbathini@linux.ibm.com
      465cabc9
    • Michael Ellerman's avatar
      powerpc/32s: Implement local_flush_tlb_page_psize() · aad26d3b
      Michael Ellerman authored
      There's a single call to local_flush_tlb_page_psize() in the code
      patching code. That call is never executed on 32-bit Book3S,
      because it's guarded by mm_patch_enabled() which is essentially a
      radix_enabled() check, which is always false on 32s.
      
      However depending on how the optimiser sees things it may still trip
      over the BUILD_BUG() in the 32s stub of local_flush_tlb_page_psize().
      
      To avoid that, implement it in terms of flush_range() so that if it ever
      becomes called it should function, even if not optimally.
      
      Note that flush_range() deals with page aligning the address and so on,
      and that 32s doesn't support huge pages so there should be no issue with
      non-standard page sizes needing to be flushed.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://msgid.link/20231023092319.1507325-1-mpe@ellerman.id.au
      aad26d3b
  2. 20 Oct, 2023 16 commits
  3. 19 Oct, 2023 22 commits