[PATCH v4 4/5] powerpc/32: Convert patch_instruction() to patch_uint()

Hari Bathini hbathini at linux.ibm.com
Tue Aug 20 17:00:06 AEST 2024



On 15/05/24 8:14 am, Benjamin Gray wrote:
> These changes are for patch_instruction() uses on data. Unlike ppc64
> these should not be incorrect as-is, but using the patch_uint() alias
> better reflects what kind of data being patched and allows for
> benchmarking the effect of different patch_* implementations (e.g.,
> skipping instruction flushing when patching data).
> 
> Signed-off-by: Benjamin Gray <bgray at linux.ibm.com>

Tested-by: Hari Bathini <hbathini at linux.ibm.com>

> ---
>   arch/powerpc/kernel/static_call.c     | 2 +-
>   arch/powerpc/platforms/powermac/smp.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/static_call.c b/arch/powerpc/kernel/static_call.c
> index 863a7aa24650..1502b7e439ca 100644
> --- a/arch/powerpc/kernel/static_call.c
> +++ b/arch/powerpc/kernel/static_call.c
> @@ -17,7 +17,7 @@ void arch_static_call_transform(void *site, void *tramp, void *func, bool tail)
>   	mutex_lock(&text_mutex);
>   
>   	if (func && !is_short) {
> -		err = patch_instruction(tramp + PPC_SCT_DATA, ppc_inst(target));
> +		err = patch_ulong(tramp + PPC_SCT_DATA, target);
>   		if (err)
>   			goto out;
>   	}
> diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
> index 15644be31990..d21b681f52fb 100644
> --- a/arch/powerpc/platforms/powermac/smp.c
> +++ b/arch/powerpc/platforms/powermac/smp.c
> @@ -827,7 +827,7 @@ static int smp_core99_kick_cpu(int nr)
>   	mdelay(1);
>   
>   	/* Restore our exception vector */
> -	patch_instruction(vector, ppc_inst(save_vector));
> +	patch_uint(vector, save_vector);
>   
>   	local_irq_restore(flags);
>   	if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu done", 0x347);


More information about the Linuxppc-dev mailing list