Thread (24 messages) 24 messages, 5 authors, 2022-01-14

Re: [PATCH 2/3] powerpc/ftrace: Simplify error checking when patching instructions

From: Christophe Leroy <hidden>
Date: 2020-04-23 16:14:38


Le 23/04/2020 à 17:09, Naveen N. Rao a écrit :
Introduce a macro PATCH_INSN() to simplify instruction patching, and to
make the error messages more uniform and useful:
- print an error message that includes the original return value
- print the function name and line numbers, so that the offending
   location is clear
- always return -EPERM, which ftrace_bug() expects for proper error
   handling

Also eliminate use of patch_branch() since most such uses already call
create_branch() for error checking before patching. Instead, use the
return value from create_branch() with PATCH_INSN().
I have the same comment here as for patch 3, this kind of macro hides 
the return action and can be dangerous.

What about implementing a macro that takes an explicit label as third 
argument and jump to that label in case of error ? On the same model as 
unsafe_put_user() ?

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