Re: [PATCH v4 4/5] powerpc/code-patching: introduce patch_instructions()
From: Hari Bathini <hbathini@linux.ibm.com>
Date: 2023-09-28 20:10:28
Also in:
bpf
From: Hari Bathini <hbathini@linux.ibm.com>
Date: 2023-09-28 20:10:28
Also in:
bpf
On 26/09/23 12:21 pm, Christophe Leroy wrote:
Le 26/09/2023 à 00:50, Song Liu a écrit :quoted
On Fri, Sep 8, 2023 at 6:28 AM Hari Bathini [off-list ref] wrote:quoted
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@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