[PATCH v9 2/7] powerpc/code-patching: Handle RWX patching initialisation error

Benjamin Gray bgray at linux.ibm.com
Thu Nov 3 09:37:40 AEDT 2022


On Wed, 2022-11-02 at 09:36 +0000, Christophe Leroy wrote:
> Le 25/10/2022 à 06:44, Benjamin Gray a écrit :
> > Detect and abort __do_patch_instruction() when there is no
> > text_poke_area,
> > which implies there is no patching address. This allows
> > patch_instruction()
> > to fail gracefully and let the caller decide what to do, as opposed
> > to
> > the current behaviour of kernel panicking when the null pointer is
> > dereferenced.
> 
> Is there any reason at all to have no text_poke_area ?
> 
> If that's the boot CPU, then it means we are really early in the boot
> process and will use raw_patch_instruction() directly. Or it means we
> don't have enough memory for the boot CPU, in which case you are
> going 
> to have so many problems that it is not worth any effort.
> 
> If it is not the boot CPU, isn't there a way to not add a CPU for
> which 
> the allocation has failed ? If text_area_cpu_up() returns an error, 
> isn't the CPU deactivated ?

Right, I hadn't seen that the CPU isn't onlined if the startup fails.
That would make the check redundant then.


More information about the Linuxppc-dev mailing list