[PATCH v2 16/16] objtool/powerpc: Add --mcount specific implementation

2022-08-28 Thread Sathvika Vasireddy
This patch enables objtool --mcount on powerpc, and adds implementation specific to powerpc. Signed-off-by: Sathvika Vasireddy --- arch/powerpc/Kconfig | 1 + tools/objtool/arch/powerpc/decode.c | 22 +++ tools/objtool/arch/powerpc/include/arch

[PATCH v2 15/16] objtool/powerpc: Enable objtool to be built on ppc

2022-08-28 Thread Sathvika Vasireddy
This patch adds [stub] implementations for required functions, inorder to enable objtool build on powerpc. Signed-off-by: Sathvika Vasireddy [Christophe Leroy: powerpc: Add missing asm/asm.h for objtool] Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 1 + a

[PATCH v2 14/16] objtool: Add arch specific function arch_ftrace_match()

2022-08-28 Thread Sathvika Vasireddy
Add architecture specific function to look for relocation records pointing to arch specific symbols. Suggested-by: Christophe Leroy Signed-off-by: Sathvika Vasireddy --- tools/objtool/arch/x86/decode.c | 8 tools/objtool/check.c| 2 +- tools/objtool/include/objtool

[PATCH v2 13/16] objtool: Use macros to define arch specific reloc types

2022-08-28 Thread Sathvika Vasireddy
Make relocation types architecture specific. Signed-off-by: Sathvika Vasireddy --- tools/objtool/arch/x86/include/arch/elf.h | 2 ++ tools/objtool/check.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/objtool/arch/x86/include/arch/elf.h b/tools/

[PATCH v2 12/16] objtool: Read special sections with alts only when specific options are selected

2022-08-28 Thread Sathvika Vasireddy
This patch reads special sections which have alternate instructions, only when stackval or orc or uaccess or noinstr options are passed to objtool. Signed-off-by: Sathvika Vasireddy --- tools/objtool/check.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/objtoo

[PATCH v2 11/16] objtool: Add --mnop as an option to --mcount

2022-08-28 Thread Sathvika Vasireddy
Architectures can select HAVE_NOP_MCOUNT if they choose to nop out mcount call sites. If that config option is selected, then --mnop is passed as an option to objtool, along with --mcount. Also, make sure that --mnop can be passed as an option to objtool only when --mcount is passed. Signed-off-b

[PATCH v2 10/16] objtool: Use target file class size instead of a compiled constant

2022-08-28 Thread Sathvika Vasireddy
From: Christophe Leroy In order to allow using objtool on cross-built kernels, determine size of long from elf data instead of using sizeof(long) at build time. For the time being this covers only mcount. Signed-off-by: Christophe Leroy --- tools/objtool/check.c | 16 +--

[PATCH v2 09/16] objtool: Use target file endianness instead of a compiled constant

2022-08-28 Thread Sathvika Vasireddy
From: Christophe Leroy Some architectures like powerpc support both endianness, it's therefore not possible to fix the endianness via arch/endianness.h because there is no easy way to get the target endianness at build time. Use the endianness recorded in the file objtool is working on. Signed-

[PATCH v2 08/16] objtool: Fix SEGFAULT

2022-08-28 Thread Sathvika Vasireddy
From: Christophe Leroy find_insn() will return NULL in case of failure. Check insn in order to avoid a kernel Oops for NULL pointer dereference. Signed-off-by: Christophe Leroy --- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/objtool/check.c b

[PATCH v2 07/16] powerpc: Skip objtool from running on VDSO files

2022-08-28 Thread Sathvika Vasireddy
Do not run objtool on VDSO files, by using OBJECT_FILES_NON_STANDARD Suggested-by: Christophe Leroy Signed-off-by: Sathvika Vasireddy --- arch/powerpc/kernel/vdso/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefil

[PATCH v2 06/16] powerpc: Fix objtool unannotated intra-function call warnings on PPC32

2022-08-28 Thread Sathvika Vasireddy
From: Christophe Leroy Fix several annotations in assembly files on PPC32. Signed-off-by: Christophe Leroy [Sathvika Vasireddy: Changed subject line from objtool/powerpc: Activate objtool on PPC32 to powerpc: Fix objtool unannotated intra-function call warnings on PPC32, and removed Kconfig c

[PATCH v2 05/16] powerpc: Skip objtool from running on drivers/crypto/vmx/aesp8-ppc.o

2022-08-28 Thread Sathvika Vasireddy
With objtool enabled, below warnings are seen when trying to build: drivers/crypto/vmx/aesp8-ppc.o: warning: objtool: aes_p8_set_encrypt_key+0x44: unannotated intra-function call drivers/crypto/vmx/aesp8-ppc.o: warning: objtool: .text+0x2448: unannotated intra-function call drivers/crypto/vmx/

[PATCH v2 04/16] powerpc: Curb objtool unannotated intra-function warnings

2022-08-28 Thread Sathvika Vasireddy
objtool throws the following unannotated intra-function call warnings: arch/powerpc/kernel/entry_64.o: warning: objtool: .text+0x4: unannotated intra-function call arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0xe64: unannotated intra-function call arch/powerpc/kvm/book3s_hv_r

[PATCH v2 03/16] powerpc: Fix objtool unannotated intra-function call warnings

2022-08-28 Thread Sathvika Vasireddy
objtool throws unannotated intra-function call warnings in the following assembly files: arch/powerpc/kernel/vector.o: warning: objtool: .text+0x53c: unannotated intra-function call arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0x60: unannotated intra-function call arch/power

[PATCH v2 01/16] powerpc: Replace unreachable() with it's builtin variant in __WARN_FLAGS()

2022-08-28 Thread Sathvika Vasireddy
objtool is throwing *unannotated intra-function call* warnings in .c files with a few instructions that are marked unreachable. The problem comes from the annotate_unreachable() macro that is called by unreachable(). This annotation is adding a call to a function with size 0, and objtool does not a

[PATCH v2 00/16] objtool: Enable and implement --mcount option on powerpc

2022-08-28 Thread Sathvika Vasireddy
This patchset enables and implements objtool --mcount option on powerpc. This applies atop powerpc/merge branch. Changelog: v2: * Change subject of patch 01/16 * As suggested by Christophe Leroy, add barrier_before_unreachable() before __builtin_unreachable() to work around a gcc problem. * Fix

[PATCH v2 02/16] powerpc: override __ALIGN() and __ALIGN_STR() macros

2022-08-28 Thread Sathvika Vasireddy
Powerpc instructions must be word-aligned. Currently, there is an alignment of 16 bytes (by default), and it is much more than what is required for powerpc (4 bytes). The default expansion of __ALIGN() macro is: #define __ALIGN .align 4,0x90 Since Powerpc Linux does not require a 16 byte al

Re: [PATCH 01/16] powerpc: Replace unreachable() with it's builtin variant in WARN_ON()

2022-08-28 Thread Sathvika Vasireddy
Hi Christophe, On 26/08/22 15:48, Christophe Leroy wrote: Le 08/08/2022 à 13:48, Sathvika Vasireddy a écrit : objtool is throwing *unannotated intra-function call* warnings with a few instructions that are marked unreachable. Replace unreachable() with __builtin_unreachable() to fix these warn

RE: [PATCH v2 00/10] crypto: Kconfig - simplify menus and help text

2022-08-28 Thread Elliott, Robert (Servers)
> -Original Message- > From: Christophe Leroy > Sent: Sunday, August 28, 2022 2:33 AM > To: Elliott, Robert (Servers) ; Nayna > ; Andrew Donnellan > Cc: linuxppc-dev@lists.ozlabs.org > Subject: Re: [PATCH v2 00/10] crypto: Kconfig - simplify menus and help > text > > Hi, > > Le 27/08/

[Bug 215622] WARNING: possible irq lock inversion dependency detected

2022-08-28 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=215622 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Status|NEW |RESOLVED Resol

Re: [PATCH v3] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage

2022-08-28 Thread Christophe Leroy
Le 28/08/2022 à 19:41, Pali Rohár a écrit : > On Sunday 28 August 2022 17:39:25 Christophe Leroy wrote: >> Le 28/08/2022 à 19:33, Christophe Leroy a écrit : >>> >>> >>> Le 28/08/2022 à 11:56, Pali Rohár a écrit : When CONFIG_TARGET_CPU is specified then pass its value to the compiler -m

Re: [PATCH v3] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage

2022-08-28 Thread Pali Rohár
On Sunday 28 August 2022 17:39:25 Christophe Leroy wrote: > Le 28/08/2022 à 19:33, Christophe Leroy a écrit : > > > > > > Le 28/08/2022 à 11:56, Pali Rohár a écrit : > >> When CONFIG_TARGET_CPU is specified then pass its value to the compiler > >> -mcpu option. This fixes following build error wh

Re: [PATCH v3] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage

2022-08-28 Thread Christophe Leroy
Le 28/08/2022 à 19:33, Christophe Leroy a écrit : > > > Le 28/08/2022 à 11:56, Pali Rohár a écrit : >> When CONFIG_TARGET_CPU is specified then pass its value to the compiler >> -mcpu option. This fixes following build error when building kernel with >> powerpc e500 SPE capable cross compilers:

Re: [PATCH v3] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage

2022-08-28 Thread Christophe Leroy
Le 28/08/2022 à 11:56, Pali Rohár a écrit : > When CONFIG_TARGET_CPU is specified then pass its value to the compiler > -mcpu option. This fixes following build error when building kernel with > powerpc e500 SPE capable cross compilers: > > BOOTAS arch/powerpc/boot/crt0.o >powerpc-linu

[PATCH v3] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage

2022-08-28 Thread Pali Rohár
When CONFIG_TARGET_CPU is specified then pass its value to the compiler -mcpu option. This fixes following build error when building kernel with powerpc e500 SPE capable cross compilers: BOOTAS arch/powerpc/boot/crt0.o powerpc-linux-gnuspe-gcc: error: unrecognized argument in option ‘-mcpu

Re: [PATCH v2] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage

2022-08-28 Thread Pali Rohár
On Sunday 28 August 2022 07:23:39 Christophe Leroy wrote: > Le 27/08/2022 à 21:00, Pali Rohár a écrit : > > On Saturday 27 August 2022 20:36:08 Pali Rohár wrote: > >> On Saturday 27 August 2022 18:32:42 Christophe Leroy wrote: > >>> Le 27/08/2022 à 19:36, Pali Rohár a écrit : > On Saturday 27

Re: [PATCH v2 00/10] crypto: Kconfig - simplify menus and help text

2022-08-28 Thread Christophe Leroy
Hi, Le 27/08/2022 à 22:06, Elliott, Robert (Servers) a écrit : > (adding Christophe, per > bba496656a73fc1 ("powerpc/32: Fix boot failure with GCC latent entropy > plugin") > > > Adding libmpc-devel gets all the architectures building except powerpc. > > (I also installed gcc-plugins-devel to

Re: [PATCH v2] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage

2022-08-28 Thread Christophe Leroy
Le 27/08/2022 à 21:00, Pali Rohár a écrit : > On Saturday 27 August 2022 20:36:08 Pali Rohár wrote: >> On Saturday 27 August 2022 18:32:42 Christophe Leroy wrote: >>> Le 27/08/2022 à 19:36, Pali Rohár a écrit : On Saturday 27 August 2022 17:31:10 Christophe Leroy wrote: > Le 27/08/2022 à