Thread (24 messages) flat view 24 messages, 7 authors, 2017-09-20

Re: [PATCH 3/5] powerpc64: Add .opd based function descriptor dereference

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-09-20 01:51:56
Also in: lkml

Sergey Senozhatsky [off-list ref] writes:
On (09/19/17 20:22), Michael Ellerman wrote:
quoted
quoted
On 2017/09/16 12:53PM, Sergey Senozhatsky wrote:
quoted
We are moving towards separate kernel and module function descriptor
dereference callbacks. This patch enables it for powerpc64.

For pointers that belong to the kernel
-  Added __start_opd and __end_opd pointers, to track the kernel
   .opd section address range;

-  Added dereference_kernel_function_descriptor(). Now we
   will dereference only function pointers that are within
   [__start_opd, __end_opd];

For pointers that belong to a module
-  Added dereference_module_function_descriptor() to handle module
   function descriptor dereference. Now we will dereference only
   pointers that are within [module->opd.start, module->opd.end].
Would it be simpler to just use kernel_text_address() and dereference 
everything else? See commit 83e840c770f2c5 ("powerpc64/elfv1: Only 
dereference function descriptor for non-text symbols") for a related 
patch.
Yeah that would be a lot simpler and probably work perfectly well.
unlike ppc_function_entry(), printk() can get called on any symbol,
not just function pointers.

for example,

cat /proc/kallsyms | grep shrinker_rwsem
ffffffff81a4b1e0 d shrinker_rwsem
Yep, good point. So your patch is probably good then. Maybe someone
other than me can find time to test it ;)

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help