From: Naveen N. Rao <hidden> Date: 2021-03-05 11:10:56
'lis r2,N' is 'addis r2,0,N' and the instruction encoding in the macro
LIS_R2 is incorrect (it currently maps to 'addis 0,r2,N'). Fix the same.
Fixes: c71b7eff426fa7 ("powerpc: Add ABIv2 support to ppc_function_entry")
Reported-by: Jiri Olsa <redacted>
Signed-off-by: Naveen N. Rao <redacted>
---
arch/powerpc/include/asm/code-patching.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
'lis r2,N' is 'addis r2,0,N' and the instruction encoding in the macro
LIS_R2 is incorrect (it currently maps to 'addis 0,r2,N'). Fix the same.
Fixes: c71b7eff426fa7 ("powerpc: Add ABIv2 support to ppc_function_entry")
Reported-by: Jiri Olsa <redacted>
Signed-off-by: Naveen N. Rao <redacted>
---
arch/powerpc/include/asm/code-patching.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
That probably goes beyond the scope of this patch, but it would be more readable and less error
prone to use macros defined in ppc-opcode.h just like kernel/module_64.c does for instance:
#define LIS_R2 (PPC_INST_ADDIS | __PPC_RT(R2))
#define ADDIS_R2_R12 (PPC_INST_ADDIS | __PPC_RT(R2) | __PPC_RA(R12))
#define ADDI_R2_R2 (PPC_INST_ADDI | __PPC_RT(R2) | __PPC_RA(R2))
From: Jiri Olsa <hidden> Date: 2021-03-05 13:17:31
On Thu, Mar 04, 2021 at 07:34:11AM +0530, Naveen N. Rao wrote:
quoted hunk
'lis r2,N' is 'addis r2,0,N' and the instruction encoding in the macro
LIS_R2 is incorrect (it currently maps to 'addis 0,r2,N'). Fix the same.
Fixes: c71b7eff426fa7 ("powerpc: Add ABIv2 support to ppc_function_entry")
Reported-by: Jiri Olsa <redacted>
Signed-off-by: Naveen N. Rao <redacted>
---
arch/powerpc/include/asm/code-patching.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
I tested the new define value with uprobe issue we were dealing with
and now it matches the instruction, so it works for me
thanks a lot for the fix,
jirka
From: Naveen N. Rao <hidden> Date: 2021-03-08 10:41:18
On 2021/03/05 12:37PM, Christophe Leroy wrote:
Le 04/03/2021 à 03:04, Naveen N. Rao a écrit :
quoted
'lis r2,N' is 'addis r2,0,N' and the instruction encoding in the macro
LIS_R2 is incorrect (it currently maps to 'addis 0,r2,N'). Fix the same.
Fixes: c71b7eff426fa7 ("powerpc: Add ABIv2 support to ppc_function_entry")
Reported-by: Jiri Olsa <redacted>
Signed-off-by: Naveen N. Rao <redacted>
---
arch/powerpc/include/asm/code-patching.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
That probably goes beyond the scope of this patch, but it would be more
readable and less error prone to use macros defined in ppc-opcode.h just
like kernel/module_64.c does for instance:
#define LIS_R2 (PPC_INST_ADDIS | __PPC_RT(R2))
#define ADDIS_R2_R12 (PPC_INST_ADDIS | __PPC_RT(R2) | __PPC_RA(R12))
#define ADDI_R2_R2 (PPC_INST_ADDI | __PPC_RT(R2) | __PPC_RA(R2))
Good point. While that would have made it harder to spot the error, it
probably would have avoided the error in the first place.
Your change looks good to me.
Thanks,
Naveen