Loading arch/powerpc/include/asm/code-patching.h +7 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,13 @@ int instr_is_branch_to_addr(const unsigned int *instr, unsigned long addr); unsigned long branch_target(const unsigned int *instr); unsigned int translate_branch(const unsigned int *dest, const unsigned int *src); #ifdef CONFIG_PPC_BOOK3E_64 void __patch_exception(int exc, unsigned long addr); #define patch_exception(exc, name) do { \ extern unsigned int name; \ __patch_exception((exc), (unsigned long)&name); \ } while (0) #endif static inline unsigned long ppc_function_entry(void *func) { Loading arch/powerpc/lib/code-patching.c +15 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,21 @@ unsigned int translate_branch(const unsigned int *dest, const unsigned int *src) return 0; } #ifdef CONFIG_PPC_BOOK3E_64 void __patch_exception(int exc, unsigned long addr) { extern unsigned int interrupt_base_book3e; unsigned int *ibase = &interrupt_base_book3e; /* Our exceptions vectors start with a NOP and -then- a branch * to deal with single stepping from userspace which stops on * the second instruction. Thus we need to patch the second * instruction of the exception, not the first one */ patch_branch(ibase + (exc / 4) + 1, addr, 0); } #endif #ifdef CONFIG_CODE_PATCHING_SELFTEST Loading arch/powerpc/mm/tlb_nohash.c +0 −19 Original line number Diff line number Diff line Loading @@ -518,25 +518,6 @@ static void setup_page_sizes(void) } } static void __patch_exception(int exc, unsigned long addr) { extern unsigned int interrupt_base_book3e; unsigned int *ibase = &interrupt_base_book3e; /* Our exceptions vectors start with a NOP and -then- a branch * to deal with single stepping from userspace which stops on * the second instruction. Thus we need to patch the second * instruction of the exception, not the first one */ patch_branch(ibase + (exc / 4) + 1, addr, 0); } #define patch_exception(exc, name) do { \ extern unsigned int name; \ __patch_exception((exc), (unsigned long)&name); \ } while (0) static void setup_mmu_htw(void) { /* Check if HW tablewalk is present, and if yes, enable it by: Loading Loading
arch/powerpc/include/asm/code-patching.h +7 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,13 @@ int instr_is_branch_to_addr(const unsigned int *instr, unsigned long addr); unsigned long branch_target(const unsigned int *instr); unsigned int translate_branch(const unsigned int *dest, const unsigned int *src); #ifdef CONFIG_PPC_BOOK3E_64 void __patch_exception(int exc, unsigned long addr); #define patch_exception(exc, name) do { \ extern unsigned int name; \ __patch_exception((exc), (unsigned long)&name); \ } while (0) #endif static inline unsigned long ppc_function_entry(void *func) { Loading
arch/powerpc/lib/code-patching.c +15 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,21 @@ unsigned int translate_branch(const unsigned int *dest, const unsigned int *src) return 0; } #ifdef CONFIG_PPC_BOOK3E_64 void __patch_exception(int exc, unsigned long addr) { extern unsigned int interrupt_base_book3e; unsigned int *ibase = &interrupt_base_book3e; /* Our exceptions vectors start with a NOP and -then- a branch * to deal with single stepping from userspace which stops on * the second instruction. Thus we need to patch the second * instruction of the exception, not the first one */ patch_branch(ibase + (exc / 4) + 1, addr, 0); } #endif #ifdef CONFIG_CODE_PATCHING_SELFTEST Loading
arch/powerpc/mm/tlb_nohash.c +0 −19 Original line number Diff line number Diff line Loading @@ -518,25 +518,6 @@ static void setup_page_sizes(void) } } static void __patch_exception(int exc, unsigned long addr) { extern unsigned int interrupt_base_book3e; unsigned int *ibase = &interrupt_base_book3e; /* Our exceptions vectors start with a NOP and -then- a branch * to deal with single stepping from userspace which stops on * the second instruction. Thus we need to patch the second * instruction of the exception, not the first one */ patch_branch(ibase + (exc / 4) + 1, addr, 0); } #define patch_exception(exc, name) do { \ extern unsigned int name; \ __patch_exception((exc), (unsigned long)&name); \ } while (0) static void setup_mmu_htw(void) { /* Check if HW tablewalk is present, and if yes, enable it by: Loading