@@ -145,42 +145,6 @@ static u32 ppc64_stub_insns[] = {
145
145
PPC_INST_BCTR ,
146
146
};
147
147
148
- #ifdef CONFIG_DYNAMIC_FTRACE
149
- int module_trampoline_target (struct module * mod , unsigned long addr ,
150
- unsigned long * target )
151
- {
152
- struct ppc64_stub_entry * stub ;
153
- func_desc_t funcdata ;
154
- u32 magic ;
155
-
156
- if (!within_module_core (addr , mod )) {
157
- pr_err ("%s: stub %lx not in module %s\n" , __func__ , addr , mod -> name );
158
- return - EFAULT ;
159
- }
160
-
161
- stub = (struct ppc64_stub_entry * )addr ;
162
-
163
- if (probe_kernel_read (& magic , & stub -> magic , sizeof (magic ))) {
164
- pr_err ("%s: fault reading magic for stub %lx for %s\n" , __func__ , addr , mod -> name );
165
- return - EFAULT ;
166
- }
167
-
168
- if (magic != STUB_MAGIC ) {
169
- pr_err ("%s: bad magic for stub %lx for %s\n" , __func__ , addr , mod -> name );
170
- return - EFAULT ;
171
- }
172
-
173
- if (probe_kernel_read (& funcdata , & stub -> funcdata , sizeof (funcdata ))) {
174
- pr_err ("%s: fault reading funcdata for stub %lx for %s\n" , __func__ , addr , mod -> name );
175
- return - EFAULT ;
176
- }
177
-
178
- * target = stub_func_addr (funcdata );
179
-
180
- return 0 ;
181
- }
182
- #endif
183
-
184
148
/* Count how many different 24-bit relocations (different symbol,
185
149
different addend) */
186
150
static unsigned int count_relocs (const Elf64_Rela * rela , unsigned int num )
@@ -731,6 +695,39 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
731
695
}
732
696
733
697
#ifdef CONFIG_DYNAMIC_FTRACE
698
+ int module_trampoline_target (struct module * mod , unsigned long addr ,
699
+ unsigned long * target )
700
+ {
701
+ struct ppc64_stub_entry * stub ;
702
+ func_desc_t funcdata ;
703
+ u32 magic ;
704
+
705
+ if (!within_module_core (addr , mod )) {
706
+ pr_err ("%s: stub %lx not in module %s\n" , __func__ , addr , mod -> name );
707
+ return - EFAULT ;
708
+ }
709
+
710
+ stub = (struct ppc64_stub_entry * )addr ;
711
+
712
+ if (probe_kernel_read (& magic , & stub -> magic , sizeof (magic ))) {
713
+ pr_err ("%s: fault reading magic for stub %lx for %s\n" , __func__ , addr , mod -> name );
714
+ return - EFAULT ;
715
+ }
716
+
717
+ if (magic != STUB_MAGIC ) {
718
+ pr_err ("%s: bad magic for stub %lx for %s\n" , __func__ , addr , mod -> name );
719
+ return - EFAULT ;
720
+ }
721
+
722
+ if (probe_kernel_read (& funcdata , & stub -> funcdata , sizeof (funcdata ))) {
723
+ pr_err ("%s: fault reading funcdata for stub %lx for %s\n" , __func__ , addr , mod -> name );
724
+ return - EFAULT ;
725
+ }
726
+
727
+ * target = stub_func_addr (funcdata );
728
+
729
+ return 0 ;
730
+ }
734
731
735
732
#ifdef CONFIG_MPROFILE_KERNEL
736
733
0 commit comments