[PATCH v4 4/5] powerpc/code-patching: introduce patch_instructions()

Hari Bathini hbathini at linux.ibm.com
Fri Sep 29 06:09:31 AEST 2023



On 26/09/23 12:21 pm, Christophe Leroy wrote:
> 
> 
> Le 26/09/2023 à 00:50, Song Liu a écrit :
>> On Fri, Sep 8, 2023 at 6:28 AM Hari Bathini <hbathini at linux.ibm.com> wrote:
>>>
>>> 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 function patch_instructions()
>>> that sets up the pte, clears the pte and flushes the tlb only once per
>>> page range of instructions to be patched. This adds a slight overhead
>>> to patch_instruction() call while improving the patching time for
>>> scenarios where more than one instruction needs to be patched.
>>>
>>> Signed-off-by: Hari Bathini <hbathini at linux.ibm.com>
>>
>> I didn't see this one when I reviewed 1/5. Please ignore that comment.
> 
> If I remember correctry, patch 1 introduces a huge performance
> degradation, which gets then improved with this patch.
> 
> As I said before, I'd expect patch 4 to go first then get
> bpf_arch_text_copy() be implemented with patch_instructions() directly.
> 

Thanks for the reviews, Christophe & Song.
Posted v5 based on your inputs.

- Hari


More information about the Linuxppc-dev mailing list