[PATCH v3 3/4] powerpc: Remove asm/prom.h from asm/mpc52xx.h and asm/pci.h

2022-07-08 Thread Christophe Leroy
asm/pci.h and asm/mpc52xx.h don't need asm/prom.h Declare struct device_node locally to avoid including of.h Signed-off-by: Christophe Leroy --- v3: Add prom.h to prom.c --- arch/powerpc/include/asm/mpc52xx.h | 3 ++- arch/powerpc/include/asm/pci.h | 1 - arch/powerpc/kernel/prom.c

[PATCH v3 1/4] video: fbdev: offb: Include missing linux/platform_device.h

2022-07-08 Thread Christophe Leroy
A lot of drivers were getting platform and of headers indirectly via headers like asm/pci.h or asm/prom.h Most of them were fixed during 5.19 cycle but a newissue was introduced by commit 52b1b46c39ae ("of: Create platform devices for OF framebuffers") Include missing platform_device.h to allow c

[PATCH v3 4/4] powerpc: Finally remove unnecessary headers from asm/prom.h

2022-07-08 Thread Christophe Leroy
Remove all headers included from asm/prom.h which are not used by asm/prom.h itself. Declare struct device_node and struct property locally to avoid including of.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/prom.h | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-

[PATCH v3 2/4] scsi: cxlflash: Include missing linux/irqdomain.h

2022-07-08 Thread Christophe Leroy
powerpc's asm/prom.h brings some headers that it doesn't need itself. Once those headers are removed from asm/prom.h, the following errors occur: CC [M] drivers/scsi/cxlflash/ocxl_hw.o drivers/scsi/cxlflash/ocxl_hw.c: In function 'afu_map_irq': drivers/scsi/cxlflash/ocxl_hw.c:195:16: error: im

RE: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Tian, Kevin
> From: Alexey Kardashevskiy > Sent: Friday, July 8, 2022 2:35 PM > On 7/8/22 15:00, Alexey Kardashevskiy wrote: > > > > > > On 7/8/22 01:10, Jason Gunthorpe wrote: > >> On Thu, Jul 07, 2022 at 11:55:52PM +1000, Alexey Kardashevskiy wrote: > >>> Historically PPC64 managed to avoid using iommu_ops.

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Alexey Kardashevskiy
On 08/07/2022 17:32, Tian, Kevin wrote: From: Alexey Kardashevskiy Sent: Friday, July 8, 2022 2:35 PM On 7/8/22 15:00, Alexey Kardashevskiy wrote: On 7/8/22 01:10, Jason Gunthorpe wrote: On Thu, Jul 07, 2022 at 11:55:52PM +1000, Alexey Kardashevskiy wrote: Historically PPC64 managed to a

RE: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Tian, Kevin
> From: Alexey Kardashevskiy > Sent: Friday, July 8, 2022 5:46 PM > > >>> > >>> In general, is "domain" something from hardware or it is a software > >>> concept? Thanks, > >>> > > > > 'domain' is a software concept to represent the hardware I/O page > > table. A blocking domain means all DMAs fr

Re: [linux-next:master] BUILD REGRESSION 088b9c375534d905a4d337c78db3b3bfbb52c4a0

2022-07-08 Thread Dan Carpenter
@vger.kernel.org, io...@lists.linux-foundation.org, keyri...@vger.kernel.org, patc...@opensource.cirrus.com, k...@vger.kernel.org, da...@lists.linux.dev, linux...@kvack.org, accessrunner-gene...@lists.sourceforge.net, linux1394-de...@lists.sourceforge.net, linux-l...@vger.kernel.org, rds-de...@

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Jason Gunthorpe
On Fri, Jul 08, 2022 at 04:34:55PM +1000, Alexey Kardashevskiy wrote: > For now I'll add a comment in spapr_tce_iommu_attach_dev() that it is fine > to do nothing as tce_iommu_take_ownership() and > tce_iommu_take_ownership_ddw() take care of not having active DMA mappings. That will still cause

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Alexey Kardashevskiy
On 08/07/2022 21:55, Jason Gunthorpe wrote: On Fri, Jul 08, 2022 at 04:34:55PM +1000, Alexey Kardashevskiy wrote: For now I'll add a comment in spapr_tce_iommu_attach_dev() that it is fine to do nothing as tce_iommu_take_ownership() and tce_iommu_take_ownership_ddw() take care of not having

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Jason Gunthorpe
On Fri, Jul 08, 2022 at 11:10:07PM +1000, Alexey Kardashevskiy wrote: > > > On 08/07/2022 21:55, Jason Gunthorpe wrote: > > On Fri, Jul 08, 2022 at 04:34:55PM +1000, Alexey Kardashevskiy wrote: > > > > > For now I'll add a comment in spapr_tce_iommu_attach_dev() that it is fine > > > to do nothi

Re: [PATCH v3 3/4] powerpc: Remove asm/prom.h from asm/mpc52xx.h and asm/pci.h

2022-07-08 Thread kernel test robot
Hi Christophe, I love your patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on mkp-scsi/for-next linus/master v5.19-rc5 next-20220708] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Alexey Kardashevskiy
On 08/07/2022 23:19, Jason Gunthorpe wrote: On Fri, Jul 08, 2022 at 11:10:07PM +1000, Alexey Kardashevskiy wrote: On 08/07/2022 21:55, Jason Gunthorpe wrote: On Fri, Jul 08, 2022 at 04:34:55PM +1000, Alexey Kardashevskiy wrote: For now I'll add a comment in spapr_tce_iommu_attach_dev() t

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Jason Gunthorpe
On Fri, Jul 08, 2022 at 11:32:58PM +1000, Alexey Kardashevskiy wrote: > > For power the default domain should be NULL > > > > NULL means that the platform is using the group to provide its DMA > > ops. IIRC this patch was already setup correctly to do this? > > > > The transition from NULL to blo

Re: [RFC PATCH v3 00/12] objtool: Enable and implement --mcount option on powerpc

2022-07-08 Thread Christophe Leroy
Le 24/06/2022 à 20:32, Sathvika Vasireddy a écrit : > These patches are rebased on top of objtool/core > branch of the tip tree, and are tested on > ppc64le with ppc64le_defconfig. Seems like objtool/core has been merged in 5.19. I was able to apply your series on top of powerpc/merge branch. O

Re: [RFC PATCH v3 01/12] objtool: Fix SEGFAULT

2022-07-08 Thread Christophe Leroy
Le 24/06/2022 à 20:32, Sathvika Vasireddy a écrit : > From: Christophe Leroy This patch needs some description. Could be: 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 > ---

Re: [RFC PATCH v3 00/12] objtool: Enable and implement --mcount option on powerpc

2022-07-08 Thread Christophe Leroy
Le 08/07/2022 à 17:06, Christophe Leroy a écrit : Le 24/06/2022 à 20:32, Sathvika Vasireddy a écrit : These patches are rebased on top of objtool/core branch of the tip tree, and are tested on ppc64le with ppc64le_defconfig. Seems like objtool/core has been merged in 5.19. I was able to a

Re: [PATCH] powerpc: e500: Fix compilation with gcc e500 compiler

2022-07-08 Thread Pali Rohár
On Monday 04 July 2022 14:07:10 Arnd Bergmann wrote: > Another problem I see is that a kernel that is built for both E500 and E500MC > uses -mcpu=e500mc and may not actually work on the older ones either > (even with your patch). Such configuration is not supported, see arch/powerpc/platforms/Kcon

Re: [PATCH] powerpc: e500: Fix compilation with gcc e500 compiler

2022-07-08 Thread Pali Rohár
On Monday 04 July 2022 15:13:58 Pali Rohár wrote: > On Monday 04 July 2022 14:07:10 Arnd Bergmann wrote: > > On Mon, Jul 4, 2022 at 12:39 PM Pali Rohár wrote: > > > On Monday 04 July 2022 20:23:29 Michael Ellerman wrote: > > > > On 2 July 2022 7:44:05 pm AEST, "Pali Rohár" wrote: > > > > >On Tues

[PATCH v2 1/7] powerpc: Add missing asm/asm.h for objtool

2022-07-08 Thread Christophe Leroy
Since commit e2ef115813c3 ("objtool: Fix STACK_FRAME_NON_STANDARD reloc type"), powerpc needs asm/asm.h to enable objtool. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/asm.h | 7 +++ 1 file changed, 7 insertions(+) create mode 100644 arch/powerpc/include/asm/asm.h diff --gi

[PATCH v2 0/7] Implement inline static calls on PPC32 - v2

2022-07-08 Thread Christophe Leroy
This series applies on top of the series v3 "objtool: Enable and implement --mcount option on powerpc" [1] rebased on powerpc-next branch A few modifications are done to core parts to enable powerpc implementation: - R_X86_64_PC32 is abstracted to R_REL32 so that it can then be redefined as R_PPC_

[PATCH v2 2/7] objtool/powerpc: Activate objtool on PPC32

2022-07-08 Thread Christophe Leroy
Fix several annotations in assembly files and enable objtool on PPC32. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 2 +- arch/powerpc/kernel/cpu_setup_6xx.S | 26 -- arch/powerpc/kernel/cpu_setup_fsl_booke.S| 8 -- arch/po

[PATCH v2 6/7] static_call_inline: Provide trampoline address when updating sites

2022-07-08 Thread Christophe Leroy
In preparation of support of inline static calls on powerpc, provide trampoline address when updating sites, so that if the destination function is too far for a direct function call, the call site will be patched with a call to the trampoline. Signed-off-by: Christophe Leroy --- arch/x86/kernel

[PATCH v2 5/7] init: Call static_call_init() from start_kernel()

2022-07-08 Thread Christophe Leroy
Call static_call_init() just after jump_label_init(). x86 already called it from setup_arch(). This is not a problem as static_call_init() is guarded from double call. Signed-off-by: Christophe Leroy --- init/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/init/main.c b/init/main.c i

[PATCH v2 7/7] powerpc/static_call: Implement inline static calls

2022-07-08 Thread Christophe Leroy
Implement inline static calls: - Put a 'bl' to the destination function ('b' if tail call) - Put a 'nop' when the destination function is NULL ('blr' if tail call) - Put a 'li r3,0' when the destination is the RET0 function and not a tail call. If the destination is too far (over the 32Mb limit),

[PATCH v2 4/7] objtool/powerpc: Add necessary support for inline static calls

2022-07-08 Thread Christophe Leroy
In order to support inline static calls for powerpc, objtool needs the following additions: - R_REL32 macro - Support for JUMP instruction used for tail calls Add the support of decoding branch instruction 'b' which is the jump instruction used for tail calls. This is because a static call can be

[PATCH v2 3/7] objtool: Add architecture specific R_REL32 macro

2022-07-08 Thread Christophe Leroy
In order to allow other architectures than x86 to use 32 bits PC relative relocations (S+A-P), define a R_REL32 macro that each architecture will define, in the same way as already done for R_NONE, R_ABS32 and R_ABS64. For x86 that corresponds to R_X86_64_PC32. For powerpc it will be R_PPC_REL32/R

Re: [RFC PATCH v3 03/12] objtool: Use target file class size instead of a compiled constant

2022-07-08 Thread Christophe Leroy
Le 24/06/2022 à 20:32, Sathvika Vasireddy a écrit : > 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: Chr

Re: [PATCH] powerpc: e500: Fix compilation with gcc e500 compiler

2022-07-08 Thread Arnd Bergmann
On Fri, Jul 8, 2022 at 7:12 PM Pali Rohár wrote: > > On Monday 04 July 2022 14:07:10 Arnd Bergmann wrote: > > Another problem I see is that a kernel that is built for both E500 and > > E500MC > > uses -mcpu=e500mc and may not actually work on the older ones either > > (even with your patch). > >

Re: [PATCH] powerpc: e500: Fix compilation with gcc e500 compiler

2022-07-08 Thread Arnd Bergmann
On Fri, Jul 8, 2022 at 7:14 PM Pali Rohár wrote: > > -ifeq ($(HAS_BIARCH),y) > -ifeq ($(CROSS32_COMPILE),) > -ifdef CONFIG_PPC32 > -# These options will be overridden by any -mcpu option that the CPU > -# or platform code sets later on the command line, but they are needed > -# to set a sane 32-bi

Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-08 Thread Alexey Kardashevskiy
On 08/07/2022 21:55, Jason Gunthorpe wrote: On Fri, Jul 08, 2022 at 04:34:55PM +1000, Alexey Kardashevskiy wrote: For now I'll add a comment in spapr_tce_iommu_attach_dev() that it is fine to do nothing as tce_iommu_take_ownership() and tce_iommu_take_ownership_ddw() take care of not having

Re: [PATCH v2 0/7] Implement inline static calls on PPC32 - v2

2022-07-08 Thread Ard Biesheuvel
Hello Christophe, On Fri, 8 Jul 2022 at 19:32, Christophe Leroy wrote: > > This series applies on top of the series v3 "objtool: Enable and > implement --mcount option on powerpc" [1] rebased on powerpc-next branch > > A few modifications are done to core parts to enable powerpc > implementation: