Patch series for 4.19 to compile powerpc with Clang

2019-01-10 Thread Nathan Chancellor
Hi Greg and Sasha, Attached is an mbox with a series of patches to allow building the powerpc kernel with Clang. We have been running continuous integration that builds and boots the kernel in QEMU for almost two months now with no regressions. This is on top of 4.19.14, there should be no

Patch series for 4.14 to compile powerpc with Clang

2019-01-10 Thread Nathan Chancellor
Hi Greg and Sasha, Attached is an mbox with a series of patches to allow building the powerpc kernel with Clang. We have been running continuous integration that builds and boots the kernel in QEMU for almost two months now with no regressions. This is on top of 4.14.92, there should be no

[PATCH] powerpc/xmon: Fix opcode being uninitialized in print_insn_powerpc

2019-02-25 Thread Nathan Chancellor
ation changes)") Link: https://github.com/ClangBuiltLinux/linux/issues/390 Signed-off-by: Nathan Chancellor --- arch/powerpc/xmon/ppc-dis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/xmon/ppc-dis.c b/arch/powerpc/xmon/ppc-dis.c index 9deea5ee13f6..27f1e6415

Re: [PATCH] scsi: ibmvscsi: Don't use rc uninitialized in ibmvscsi_do_work

2019-06-02 Thread Nathan Chancellor
Hi Michael, On Sun, Jun 02, 2019 at 08:15:38PM +1000, Michael Ellerman wrote: > Hi Nathan, > > It's always preferable IMHO to keep any initialisation as localised as > possible, so that the compiler can continue to warn about uninitialised > usages elsewhere. In this case that would mean doing

[PATCH] scsi: ibmvscsi: Don't use rc uninitialized in ibmvscsi_do_work

2019-05-31 Thread Nathan Chancellor
inux/linux/issues/502 Signed-off-by: Nathan Chancellor --- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 727c31dc11a0..6714d8043e62 100644 --- a/drivers/scsi/ibmvscsi/

[PATCH] PCI: rpaphp: Avoid a sometimes-uninitialized warning

2019-06-03 Thread Nathan Chancellor
ug/drc-info: Add code to search ibm,drc-info property") Signed-off-by: Nathan Chancellor --- drivers/pci/hotplug/rpaphp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c index bcd5d35

[PATCH v2] PCI: rpaphp: Avoid a sometimes-uninitialized warning

2019-06-03 Thread Nathan Chancellor
which will fix this warning. Link: https://github.com/ClangBuiltLinux/linux/issues/504 Fixes: 2fcf3ae508c2 ("hotplug/drc-info: Add code to search ibm,drc-info property") Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- v1 -> v2: * Eliminate fndit altogether by sh

[PATCH v3] scsi: ibmvscsi: Don't use rc uninitialized in ibmvscsi_do_work

2019-06-03 Thread Nathan Chancellor
;scsi: ibmvscsi: redo driver work thread to use enum action states") Link: https://github.com/ClangBuiltLinux/linux/issues/502 Suggested-by: Michael Ellerman Suggested-by: Tyrel Datwyler Signed-off-by: Nathan Chancellor --- v1 -> v2: * Initialize rc in the case statements, rather th

[PATCH v2] scsi: ibmvscsi: Don't use rc uninitialized in ibmvscsi_do_work

2019-06-03 Thread Nathan Chancellor
github.com/ClangBuiltLinux/linux/issues/502 Suggested-by: Michael Ellerman Signed-off-by: Nathan Chancellor --- v1 -> v2: * Initialize rc in the case statements, rather than at the top of the function, as suggested by Michael. drivers/scsi/ibmvscsi/ibmvscsi.c | 6 +++--- 1 file changed,

Re: [PATCH] PCI: rpaphp: Avoid a sometimes-uninitialized warning

2019-06-03 Thread Nathan Chancellor
Hi Nick, On Mon, Jun 03, 2019 at 02:07:50PM -0700, Nick Desaulniers wrote: > On Mon, Jun 3, 2019 at 10:44 AM Nathan Chancellor > wrote: > > Looking at the loop in a vacuum as clang would, fndit could be > > uninitialized if entries was ever zero or the if statement was >

Re: [PATCH v2 4/6] mm/memory_hotplug: Rename walk_memory_range() and pass start+size instead of pfns

2019-06-20 Thread Nathan Chancellor
On Thu, Jun 20, 2019 at 12:35:18PM +0200, David Hildenbrand wrote: > walk_memory_range() was once used to iterate over sections. Now, it > iterates over memory blocks. Rename the function, fixup the > documentation. Also, pass start+size instead of PFNs, which is what most > callers already have

Re: [PATCH v2] PCI: rpaphp: Avoid a sometimes-uninitialized warning

2019-06-27 Thread Nathan Chancellor
On Mon, Jun 03, 2019 at 03:11:58PM -0700, Nathan Chancellor wrote: > When building with -Wsometimes-uninitialized, clang warns: > > drivers/pci/hotplug/rpaphp_core.c:243:14: warning: variable 'fndit' is > used uninitialized whenever 'for' loop exits because its condition is > fal

Re: [PATCH v2] powerpc: slightly improve cache helpers

2019-07-09 Thread Nathan Chancellor
On Tue, Jul 09, 2019 at 07:04:43AM +0200, Christophe Leroy wrote: > > > Le 08/07/2019 à 21:14, Nathan Chancellor a écrit : > > On Mon, Jul 08, 2019 at 11:19:30AM +1000, Michael Ellerman wrote: > > > On Fri, 2019-05-10 at 09:24:48 UTC, Christophe Leroy wrote: > >

Re: [PATCH v2] powerpc: slightly improve cache helpers

2019-07-08 Thread Nathan Chancellor
On Mon, Jul 08, 2019 at 11:19:30AM +1000, Michael Ellerman wrote: > On Fri, 2019-05-10 at 09:24:48 UTC, Christophe Leroy wrote: > > Cache instructions (dcbz, dcbi, dcbf and dcbst) take two registers > > that are summed to obtain the target address. Using 'Z' constraint > > and '%y0' argument gives

Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-08-12 Thread Nathan Chancellor
On Mon, Aug 12, 2019 at 07:37:51AM +0200, Christophe Leroy wrote: > > > Le 12/08/2019 à 04:32, Nathan Chancellor a écrit : > > Commit aea447141c7e ("powerpc: Disable -Wbuiltin-requires-header when > > setjmp is used") disabled -Wbuiltin-requires-header because of

[PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-08-11 Thread Nathan Chancellor
ect/commit/3be25e79477db2d31ac46493d97eca8c20592b07 Signed-off-by: Nathan Chancellor --- It may be worth using -fno-builtin-setjmp and -fno-builtin-longjmp instead as it makes it clear to clang that we are not using the builtin longjmp and setjmp functions, which I think is why these warnings are appearing (at least

[PATCH] powerpc: Don't add -mabi= flags when building with Clang

2019-08-18 Thread Nathan Chancellor
8abecde8ad ("powerpc: Don't use gcc specific options on clang"). pseries_defconfig successfully builds after this patch and powernv_defconfig and ppc44x_defconfig don't regress. Link: https://github.com/ClangBuiltLinux/linux/issues/240 Signed-off-by: Nathan Chancellor --- arch/powerpc/

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.3-4 tag

2019-08-10 Thread Nathan Chancellor
On Sat, Aug 10, 2019 at 10:21:01AM -0700, Linus Torvalds wrote: > On Sat, Aug 10, 2019 at 3:11 AM Michael Ellerman wrote: > > > > Just one fix, a revert of a commit that was meant to be a minor improvement > > to > > some inline asm, but ended up having no real benefit with GCC and broke > >

Re: [PATCH] powerpc: Don't add -mabi= flags when building with Clang

2019-08-19 Thread Nathan Chancellor
On Mon, Aug 19, 2019 at 04:19:31AM -0500, Segher Boessenkool wrote: > On Sun, Aug 18, 2019 at 12:13:21PM -0700, Nathan Chancellor wrote: > > When building pseries_defconfig, building vdso32 errors out: > > > > error: unknown target ABI 'elfv1' > > > > C

[PATCH v2] powerpc: Don't add -mabi= flags when building with Clang

2019-08-20 Thread Nathan Chancellor
/issues/240 Reviewed-by: Daniel Axtens Signed-off-by: Nathan Chancellor --- v1 -> v2: * Improve commit message wording and explanation. * Add Daniel's reviewed-by. arch/powerpc/Makefile | 4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Make

Re: [PATCH] powerpc: Don't add -mabi= flags when building with Clang

2019-08-20 Thread Nathan Chancellor
On Tue, Aug 20, 2019 at 07:40:33AM -0500, Segher Boessenkool wrote: > On Mon, Aug 19, 2019 at 08:15:38PM -0700, Nathan Chancellor wrote: > > On Mon, Aug 19, 2019 at 04:19:31AM -0500, Segher Boessenkool wrote: > > > On Sun, Aug 18, 2019 at 12:13:21PM -0700, Nathan Chancellor w

Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-08-26 Thread Nathan Chancellor
On Sun, Aug 11, 2019 at 07:32:15PM -0700, Nathan Chancellor wrote: > Commit aea447141c7e ("powerpc: Disable -Wbuiltin-requires-header when > setjmp is used") disabled -Wbuiltin-requires-header because of a warning > about the setjmp and longjmp declarations. > > r3673

Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-09-02 Thread Nathan Chancellor
On Thu, Aug 29, 2019 at 09:59:48AM +, David Laight wrote: > From: Nathan Chancellor > > Sent: 28 August 2019 19:45 > ... > > However, I think that -fno-builtin-* would be appropriate here because > > we are providing our own setjmp implementation, meaning clang should

Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-09-03 Thread Nathan Chancellor
On Tue, Sep 03, 2019 at 02:31:28PM -0500, Segher Boessenkool wrote: > On Mon, Sep 02, 2019 at 10:55:53PM -0700, Nathan Chancellor wrote: > > On Thu, Aug 29, 2019 at 09:59:48AM +, David Laight wrote: > > > From: Nathan Chancellor > > > > Sent: 28 August 2019 19:4

Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-08-28 Thread Nathan Chancellor
On Wed, Aug 28, 2019 at 11:43:53PM +1000, Michael Ellerman wrote: > Nathan Chancellor writes: > > > Commit aea447141c7e ("powerpc: Disable -Wbuiltin-requires-header when > > setjmp is used") disabled -Wbuiltin-requires-header because of a warning > > about t

Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-08-28 Thread Nathan Chancellor
On Wed, Aug 28, 2019 at 11:01:14AM -0700, Nick Desaulniers wrote: > On Wed, Aug 28, 2019 at 10:53 AM Nathan Chancellor > wrote: > > > > On Wed, Aug 28, 2019 at 11:43:53PM +1000, Michael Ellerman wrote: > > > Nathan Chancellor writes: > > > > > > >

Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-09-04 Thread Nathan Chancellor
On Wed, Sep 04, 2019 at 08:01:35AM -0500, Segher Boessenkool wrote: > On Wed, Sep 04, 2019 at 08:16:45AM +, David Laight wrote: > > From: Nathan Chancellor [mailto:natechancel...@gmail.com] > > > Fair enough so I guess we are back to just outright disabling the > >

[PATCH v3 1/3] powerpc: Don't add -mabi= flags when building with Clang

2019-09-11 Thread Nathan Chancellor
/issues/240 Reviewed-by: Daniel Axtens Signed-off-by: Nathan Chancellor --- v1 -> v2: * Improve commit message v2 -> v3: * Rebase and merge into a single series. arch/powerpc/Makefile | 4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/Makefile b/arch/powerpc/M

[PATCH v3 2/3] powerpc: Avoid clang warnings around setjmp and longjmp

2019-09-11 Thread Nathan Chancellor
ect/commit/3be25e79477db2d31ac46493d97eca8c20592b07 Suggested-by: Segher Boessenkool Signed-off-by: Nathan Chancellor --- v1 -> v3: * Use -ffreestanding instead of outright disabling the warning because it is legitimate. I skipped v2 because the first patch in the series already had a v2.

[PATCH v3 0/3] LLVM/Clang fixes for pseries_defconfig

2019-09-11 Thread Nathan Chancellor
Hi all, This series includes a set of fixes for LLVM/Clang when building pseries_defconfig. These have been floating around as standalone patches so I decided to gather them up as a series so it was easier to review/apply them. The versioning is a bit wonky because of this reason, I have included

[PATCH v3 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-09-11 Thread Nathan Chancellor
ee to make transformations like this. Link: https://github.com/ClangBuiltLinux/linux/issues/647 Link: https://github.com/llvm/llvm-project/commit/5c9f3cfec78f9e9ae013de9a0d092a68e3e79e002 Signed-off-by: Nathan Chancellor --- New patch in the series so no previous version. arch/powerpc/kernel/Makefile | 2

Re: [PATCH v3 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-09-11 Thread Nathan Chancellor
On Wed, Sep 11, 2019 at 02:01:59PM -0700, Nick Desaulniers wrote: > On Wed, Sep 11, 2019 at 11:21 AM Nathan Chancellor > wrote: > > > > r370454 gives LLVM the ability to convert certain loops into a reference > > to bcmp as an optimization; this breaks prom_init_check.sh

Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-09-10 Thread Nathan Chancellor
On Wed, Sep 11, 2019 at 04:30:38AM +1000, Michael Ellerman wrote: > Nathan Chancellor writes: > > On Wed, Sep 04, 2019 at 08:01:35AM -0500, Segher Boessenkool wrote: > >> On Wed, Sep 04, 2019 at 08:16:45AM +, David Laight wrote: > >> > From: Nathan Chancellor [m

Re: [PATCH] powerpc: workaround clang codegen bug in dcbz

2019-07-29 Thread Nathan Chancellor
kml/20190721075846.GA97701@archlinux-threadripper/ > Debugged-by: Nathan Chancellor > Reported-by: Nathan Chancellor > Reported-by: kbuild test robot > Suggested-by: Nathan Chancellor > Signed-off-by: Nick Desaulniers > --- > Alternatively, we could just revert 6c5875843b8

Re: [PATCH] powerpc: workaround clang codegen bug in dcbz

2019-07-29 Thread Nathan Chancellor
On Mon, Jul 29, 2019 at 01:45:35PM -0700, Nick Desaulniers wrote: > On Mon, Jul 29, 2019 at 1:32 PM Nathan Chancellor > wrote: > > > > On Mon, Jul 29, 2019 at 01:25:41PM -0700, Nick Desaulniers wrote: > > > But I'm not sure how the inlined code generated would be affec

Re: [PATCH] powerpc: fix inline asm constraints for dcbz

2019-08-09 Thread Nathan Chancellor
: slightly improve cache helpers") > Debugged-by: Nathan Chancellor > Reported-by: Nathan Chancellor > Reported-by: kbuild test robot > Suggested-by: Arnd Bergmann > Suggested-by: Nathan Chancellor > Signed-off-by: Nick Desaulniers I applied this patch as well as a re

Re: [PATCH v2] powerpc: slightly improve cache helpers

2019-07-21 Thread Nathan Chancellor
On Fri, Jul 19, 2019 at 09:04:55AM -0700, Nathan Chancellor wrote: > On Fri, Jul 19, 2019 at 10:23:03AM -0500, Segher Boessenkool wrote: > > On Thu, Jul 18, 2019 at 08:24:56PM -0700, Nathan Chancellor wrote: > > > On Mon, Jul 08, 2019 at 11:49:52PM -0700, Nathan Chancellor wro

Re: [PATCH v2] powerpc: slightly improve cache helpers

2019-07-18 Thread Nathan Chancellor
On Mon, Jul 08, 2019 at 11:49:52PM -0700, Nathan Chancellor wrote: > On Tue, Jul 09, 2019 at 07:04:43AM +0200, Christophe Leroy wrote: > > Is that a Clang bug ? > > No idea, it happens with clang-8 and clang-9 though (pretty sure there > were fixes for PowerPC in clang-8 s

Re: [PATCH v2] powerpc: slightly improve cache helpers

2019-07-19 Thread Nathan Chancellor
On Fri, Jul 19, 2019 at 10:23:03AM -0500, Segher Boessenkool wrote: > On Thu, Jul 18, 2019 at 08:24:56PM -0700, Nathan Chancellor wrote: > > On Mon, Jul 08, 2019 at 11:49:52PM -0700, Nathan Chancellor wrote: > > > On Tue, Jul 09, 2019 at 07:04:43AM +0200, Chri

Re: [PATCH v2] powerpc: slightly improve cache helpers

2019-07-21 Thread Nathan Chancellor
Hi Segher, On Sun, Jul 21, 2019 at 01:01:50PM -0500, Segher Boessenkool wrote: > On Sun, Jul 21, 2019 at 12:58:46AM -0700, Nathan Chancellor wrote: > > I have attached the disassembly of arch/powerpc/kernel/mem.o with > > clear_page (working) and broken_clear_page (broken), alon

Re: [PATCH v2] PCI: rpaphp: Avoid a sometimes-uninitialized warning

2019-07-21 Thread Nathan Chancellor
On Mon, Jun 03, 2019 at 03:11:58PM -0700, Nathan Chancellor wrote: > When building with -Wsometimes-uninitialized, clang warns: > > drivers/pci/hotplug/rpaphp_core.c:243:14: warning: variable 'fndit' is > used uninitialized whenever 'for' loop exits because its condition is > fal

Re: [PATCH] powerpc/pmac/smp: avoid unused-variable warnings

2019-09-20 Thread Nathan Chancellor
sed-variable] > > They are only used when CONFIG_PPC64 is not defined. Move > them into a section which does the same macro check. > > Reported-by: Nathan Chancellor > Signed-off-by: Ilie Halip Reviewed-by: Nathan Chancellor

Re: [linux-next][P9]Build error at drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h:69 error: field mirror has incomplete type

2019-07-09 Thread Nathan Chancellor
On Tue, Jul 09, 2019 at 09:56:37PM +0530, Abdul Haleem wrote: > Greeting's > > linux-next failed to build on Power 9 Box with below error > > In file included from drivers/gpu/drm/amd/amdgpu/amdgpu.h:72:0, > from drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c:39: >

[PATCH] powerpc/44x: Adjust indentation in ibm4xx_denali_fixup_memsize

2019-12-09 Thread Nathan Chancellor
github.com/ClangBuiltLinux/linux/issues/780 Signed-off-by: Nathan Chancellor --- arch/powerpc/boot/4xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/boot/4xx.c b/arch/powerpc/boot/4xx.c index 1699e9531552..00c4d843a023 100644 --- a/arch/powerpc/boot/4xx.c

Re: [PATCH v4 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-10-21 Thread Nathan Chancellor
On Fri, Oct 18, 2019 at 03:02:10PM -0500, Segher Boessenkool wrote: > On Fri, Oct 18, 2019 at 12:00:22PM -0700, Nathan Chancellor wrote: > > Just as an FYI, there was some more discussion around the availablity > > and use of bcmp in this LLVM bug which spawned > > comm

Re: [PATCH v4 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-10-18 Thread Nathan Chancellor
On Mon, Oct 14, 2019 at 02:11:41PM -0500, Segher Boessenkool wrote: > On Mon, Oct 14, 2019 at 08:56:12AM -0700, Nick Desaulniers wrote: > > On Mon, Oct 14, 2019 at 2:35 AM Segher Boessenkool > > wrote: > > > > > > On Sun, Oct 13, 2019 at 07:51:01PM -0700, Nathan

[PATCH v5 0/3] LLVM/Clang fixes for a few defconfigs

2019-11-18 Thread Nathan Chancellor
Hi all, This series includes a set of fixes for LLVM/Clang when building a few defconfigs (powernv, ppc44x, and pseries are the ones that our CI configuration tests [1]). The first patch fixes pseries_defconfig, which has never worked in mainline. The second and third patches fixes issues with

[PATCH v5 1/3] powerpc: Don't add -mabi= flags when building with Clang

2019-11-18 Thread Nathan Chancellor
ed-by: Daniel Axtens Signed-off-by: Nathan Chancellor --- v1 -> v2: * Improve commit message v2 -> v3: * Rebase and merge into a single series. v3 -> v4: * Rebase on v5.4-rc3. * Update links to point to llvmorg-9.0.0 instead of llvmorg-9.0.0-rc2. v4 -> v5: * Rebase on next-2019

[PATCH v5 2/3] powerpc: Avoid clang warnings around setjmp and longjmp

2019-11-18 Thread Nathan Chancellor
ect/commit/3be25e79477db2d31ac46493d97eca8c20592b07 Link: https://godbolt.org/z/B2oQnl Suggested-by: Segher Boessenkool Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- v1 -> v3 (I skipped v2 because the first patch in the series already had a v2): * Use -ffreesta

[PATCH v5 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-11-18 Thread Nathan Chancellor
ee to make transformations like this. Link: https://github.com/ClangBuiltLinux/linux/issues/647 Link: https://github.com/llvm/llvm-project/commit/76cdcf25b883751d83402baea6316772aa73865c Reviewed-by: Nick Desaulneris Signed-off-by: Nathan Chancellor --- v1 -> v3: * New patch in the series v3 -> v4:

Re: [PATCH v2] dma-mapping: treat dev->bus_dma_mask as a DMA limit

2019-11-23 Thread Nathan Chancellor
On Thu, Nov 21, 2019 at 10:26:44AM +0100, Nicolas Saenz Julienne wrote: > Using a mask to represent bus DMA constraints has a set of limitations. > The biggest one being it can only hold a power of two (minus one). The > DMA mapping code is already aware of this and treats dev->bus_dma_mask > as a

Re: [PATCH v5 0/3] LLVM/Clang fixes for a few defconfigs

2019-11-27 Thread Nathan Chancellor
On Thu, Nov 28, 2019 at 03:59:07PM +1100, Michael Ellerman wrote: > Nick Desaulniers writes: > > Hi Michael, > > Do you have feedback for Nathan? Rebasing these patches is becoming a > > nuisance for our CI, and we would like to keep building PPC w/ Clang. > > Sorry just lost in the flood of

Re: [PATCH v4 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-10-29 Thread Nathan Chancellor
On Tue, Oct 22, 2019 at 03:57:09AM -0500, Segher Boessenkool wrote: > On Mon, Oct 21, 2019 at 10:15:29PM -0700, Nathan Chancellor wrote: > > On Fri, Oct 18, 2019 at 03:02:10PM -0500, Segher Boessenkool wrote: > > > I think the proper solution is for the kernel to *do*

[PATCH v4 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-10-13 Thread Nathan Chancellor
ee to make transformations like this. Link: https://github.com/ClangBuiltLinux/linux/issues/647 Link: https://github.com/llvm/llvm-project/commit/76cdcf25b883751d83402baea6316772aa73865c Reviewed-by: Nick Desaulneris Signed-off-by: Nathan Chancellor --- v1 -> v3: * New patch in the series v3 -> v4:

[PATCH v4 2/3] powerpc: Avoid clang warnings around setjmp and longjmp

2019-10-13 Thread Nathan Chancellor
ect/commit/3be25e79477db2d31ac46493d97eca8c20592b07 Link: https://godbolt.org/z/B2oQnl Suggested-by: Segher Boessenkool Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- v1 -> v3 (I skipped v2 because the first patch in the series already had a v2): * Use -ffreesta

[PATCH v4 0/3] LLVM/Clang fixes for pseries_defconfig

2019-10-13 Thread Nathan Chancellor
Hi all, This series includes a set of fixes for LLVM/Clang when building pseries_defconfig. These have been floating around as standalone patches so I decided to gather them up as a series so it was easier to review/apply them. This has been broken for a bit now, it would be nice to get these

[PATCH v4 1/3] powerpc: Don't add -mabi= flags when building with Clang

2019-10-13 Thread Nathan Chancellor
ed-by: Daniel Axtens Signed-off-by: Nathan Chancellor --- v1 -> v2: * Improve commit message v2 -> v3: * Rebase and merge into a single series. v3 -> v4: * Rebase on v5.4-rc3. * Update links to point to llvmorg-9.0.0 instead of llvmorg-9.0.0-rc2. arch/powerpc/Makefile | 4

Re: [PATCH] powerpc/vdso32: mark __kernel_datapage_offset as STV_PROTECTED

2020-02-06 Thread Nathan Chancellor
On Wed, Feb 05, 2020 at 07:25:59AM +0100, Christophe Leroy wrote: > > > Le 05/02/2020 à 01:50, Fangrui Song a écrit : > > A PC-relative relocation (R_PPC_REL16_LO in this case) referencing a > > preemptible symbol in a -shared link is not allowed. GNU ld's powerpc > > port is permissive and

Re: [PATCH] powerpc/32: Fix missing NULL pmd check in virt_to_kpte()

2020-03-12 Thread Nathan Chancellor
> static inline pte_t *virt_to_kpte(unsigned long vaddr) > { > - return pte_offset_kernel(pmd_ptr_k(vaddr), vaddr); > + pmd_t *pmd = pmd_ptr_k(vaddr); > + > + return pmd_none(*pmd) ? NULL : pte_offset_kernel(pmd, vaddr); > } > #endif > > -- > 2.25.0 > With QEMU 4.2.0, I can confirm this fixes the panic: Tested-by: Nathan Chancellor

Re: [PATCH] target/ppc: Fix mtmsr(d) L=1 variant that loses interrupts

2020-04-14 Thread Nathan Chancellor
on of the requirement that these exceptions cause > interrupts when MSR[EE]=1 (e.g., when mtmsr executes to completion as > TCG is doing here), rather it specifies how a pipelined processor can > have multiple instructions in flight where one may influence how another > behaves. &

Re: Boot flakiness with QEMU 3.1.0 and Clang built kernels

2020-04-13 Thread Nathan Chancellor
On Tue, Apr 14, 2020 at 12:05:53PM +1000, David Gibson wrote: > On Sat, Apr 11, 2020 at 11:57:23PM +1000, Nicholas Piggin wrote: > > Nicholas Piggin's on April 11, 2020 7:32 pm: > > > Nathan Chancellor's on April 11, 2020 10:53 am: > > >> The tt.config values are needed to reproduce but I did not

[PATCH] lib/mpi: Fix building for powerpc with clang

2020-04-13 Thread Nathan Chancellor
for x86 and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit x86"). Reported-by: kbuild test robot Link: https://github.com/ClangBuiltLinux/linux/issues/991 Signed-off-by: Nathan Chancellor ---

[PATCH] powerpc/wii: Fix declaration made after definition

2020-04-13 Thread Nathan Chancellor
but define_machine actually defines mach_##name, hence the warning. To fix this, move define_machine after the is_machine usage. Fixes: 5a7ee3198dfa ("powerpc: wii: platform support") Reported-by: kbuild test robot Link: https://github.com/ClangBuiltLinux/linux/issues/989 Signed-off-

-Wincompatible-pointer-types in arch/powerpc/platforms/embedded6xx/mvme5100.c

2020-04-13 Thread Nathan Chancellor
Hi all, 0day reported a build error in arch/powerpc/platforms/embedded6xx/mvme5100.c when building with clang [1]. This is not a clang specific issue since it also happens with gcc: $ curl -LSs https://lore.kernel.org/lkml/202004131704.6mh1jcq3%25...@intel.com/2-a.bin | gzip -d > .config $

Re: Boot flakiness with QEMU 3.1.0 and Clang built kernels

2020-04-11 Thread Nathan Chancellor
you can run it and verify it fixes > your boot hang would be good. Yes, with this patch applied on top of 5.0.0-rc2 and using the pseries-3.1 and powernv8 machines, I do not see any hangs with a clang built kernel at b032227c62939b5481bcd45442b36dfa263f4a7c across 100 boots. If you happen to se

Re: -Wincompatible-pointer-types in arch/powerpc/platforms/embedded6xx/mvme5100.c

2020-04-14 Thread Nathan Chancellor
Hi Michael, On Tue, Apr 14, 2020 at 05:33:45PM +1000, Michael Ellerman wrote: > Hi Nathan, > > Thanks for the report. > > Nathan Chancellor writes: > > Hi all, > > > > 0day reported a build error in arch/powerpc/platforms/embedded6xx/mvme5100.

Boot flakiness with QEMU 3.1.0 and Clang built kernels

2020-04-10 Thread Nathan Chancellor
Hi all, Recently, our CI started running into several hangs when running the spinlock torture tests during a boot with QEMU 3.1.0 on powernv_defconfig and pseries_defconfig when compiled with Clang. I initially bisected Linux and came down to commit 3282a3da25bd ("powerpc/64: Implement soft

Re: Boot flakiness with QEMU 3.1.0 and Clang built kernels

2020-04-10 Thread Nathan Chancellor
Hi Nicholas, On Sat, Apr 11, 2020 at 10:29:45AM +1000, Nicholas Piggin wrote: > Nathan Chancellor's on April 11, 2020 6:59 am: > > Hi all, > > > > Recently, our CI started running into several hangs when running the > > spinlock torture tests during a boot with QEMU 3.1.0 on > >

Re: [PATCH v1] powerpc: Make setjmp/longjump signature standard

2020-03-27 Thread Nathan Chancellor
On Fri, Mar 27, 2020 at 06:45:21PM +0100, Christophe Leroy wrote: > Subject line, change longjump to longjmp > > Le 27/03/2020 à 11:07, Clement Courbet a écrit : > > Declaring setjmp()/longjmp() as taking longs makes the signature > > non-standard, and makes clang complain. In the past, this has

Re: [PATCH v1] powerpc: Make setjmp/longjump signature standard

2020-03-27 Thread Nathan Chancellor
the > appropriate branches. The tags should be: Cc: sta...@vger.kernel.org # v4.14+ Fixes: c9029ef9c957 ("powerpc: Avoid clang warnings around setjmp and longjmp") that way it explicitly gets picked up for stable, rather than Sasha's AUTOSEL process, which could miss it. With the xmon/Makefile -ffreestanding removed and the tags updated, consider this: Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Cheers, Nathan

Re: [PATCH v2] powerpc: Make setjmp/longjmp signature standard

2020-03-30 Thread Nathan Chancellor
> https://lore.kernel.org/patchwork/patch/1216174 > > Signed-off-by: Clement Courbet > Reviewed-by: Nathan Chancellor > Tested-by: Nathan Chancellor > > --- > > v2: > Use and array type as suggested by Segher Boessenkool > Cc: sta...@vger.kernel.org # v4.14

Re: [PATCH] lib/mpi: Fix building for powerpc with clang

2020-04-24 Thread Nathan Chancellor
On Fri, Apr 24, 2020 at 01:23:37PM +1000, Michael Ellerman wrote: > Nathan Chancellor writes: > > On Tue, Apr 14, 2020 at 11:57:31PM +1000, Herbert Xu wrote: > >> On Mon, Apr 13, 2020 at 12:50:42PM -0700, Nathan Chancellor wrote: > >> > 0day reports over and

Re: [PATCH] lib/mpi: Fix building for powerpc with clang

2020-04-23 Thread Nathan Chancellor
On Tue, Apr 14, 2020 at 11:57:31PM +1000, Herbert Xu wrote: > On Mon, Apr 13, 2020 at 12:50:42PM -0700, Nathan Chancellor wrote: > > 0day reports over and over on an powerpc randconfig with clang: > > > > lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a &

Re: [PATCH] powerpc/wii: Fix declaration made after definition

2020-05-18 Thread Nathan Chancellor
On Mon, Apr 13, 2020 at 12:06:45PM -0700, Nathan Chancellor wrote: > A 0day randconfig uncovered an error with clang, trimmed for brevity: > > arch/powerpc/platforms/embedded6xx/wii.c:195:7: error: attribute > declaration must precede definition [-Werror,-Wignore

[PATCH] input: i8042: Remove special PowerPC handling

2020-05-18 Thread Nathan Chancellor
ast 12 years, there is not anyone actually trying to use this driver so we can just remove this special walnut code and use the generic header so it builds for all configurations. Fixes: 917f0af9e5a9 ("powerpc: Remove arch/ppc and include/asm-ppc") Reported-by: kbuild test robot Signe

[PATCH] powerpc/maple: Fix declaration made after definition

2020-03-23 Thread Nathan Chancellor
bolt.org/z/kDoYSA Link: https://github.com/ClangBuiltLinux/linux/issues/662 Reported-by: Nick Desaulniers Suggested-by: Ilie Halip Signed-off-by: Nathan Chancellor --- arch/powerpc/platforms/maple/setup.c | 34 ++-- 1 file changed, 17 insertions(+), 17 deletions(-) diff --

Re: Fwd: [CRON] Broken: ClangBuiltLinux/continuous-integration#1432 (master - 0aceafc)

2020-05-19 Thread Nathan Chancellor
On Tue, May 19, 2020 at 05:56:32PM -0700, 'Nick Desaulniers' via Clang Built Linux wrote: > Looks like our CI is still red from this: > > https://travis-ci.com/github/ClangBuiltLinux/continuous-integration/builds/166854584 > > Filing a bug to follow up on: >

Re: Fwd: [CRON] Broken: ClangBuiltLinux/continuous-integration#1432 (master - 0aceafc)

2020-05-21 Thread Nathan Chancellor
On Thu, May 21, 2020 at 03:23:11PM -0700, Nick Desaulniers wrote: > On Thu, May 21, 2020 at 6:00 AM Michael Ellerman wrote: > > > > Nathan Chancellor writes: > > > On Tue, May 19, 2020 at 05:56:32PM -0700, 'Nick Desaulniers' via Clang > > > Built Linux wrote:

Re: [PATCH 0/2] link vdso with linker

2020-09-01 Thread Nathan Chancellor
On Tue, Sep 01, 2020 at 03:25:21PM -0700, Nick Desaulniers wrote: > Kees Cook is working on series that adds --orphan-section=warn to arm, > arm64, and x86. I noticed that ppc vdso were still using cc-ldoption > for these which I removed. It seems this results in that flag being > silently

Re: [PATCH v4 13/13] mm/debug_vm_pgtable: Avoid none pte in pte_clear_test

2020-09-10 Thread Nathan Chancellor
On Wed, Sep 02, 2020 at 05:12:22PM +0530, Aneesh Kumar K.V wrote: > pte_clear_tests operate on an existing pte entry. Make sure that > is not a none pte entry. > > Signed-off-by: Aneesh Kumar K.V > --- > mm/debug_vm_pgtable.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > >

Re: [GIT PULL] fallthrough pseudo-keyword macro conversions for 5.9-rc3

2020-08-24 Thread Nathan Chancellor
On Sun, Aug 23, 2020 at 10:48:41PM -0500, Gustavo A. R. Silva wrote: > Hi Linus, > > Not sure what the problem was with my pull-request for -rc2. So, I'm giving > this a second try because I think it is worth it. > > I have build-tested this patch on 10 different architectures: x86_64, i386, >

[PATCH v2] powerpc/wii: Fix declaration made after definition

2020-05-26 Thread Nathan Chancellor
esaulniers Signed-off-by: Nathan Chancellor --- v1 -> v2: * s/is_machine/machine_is/ (Nick) * Add Nick's reviewed-by tag. arch/powerpc/platforms/embedded6xx/wii.c | 25 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/platforms/embedde

Re: [PATCH] media: omap3isp: Shuffle cacheflush.h and include mm.h

2020-05-27 Thread Nathan Chancellor
Hi Geert, On Wed, May 27, 2020 at 09:02:51AM +0200, Geert Uytterhoeven wrote: > Hi Nathan, > > CC Laurent > > On Wed, May 27, 2020 at 6:37 AM Nathan Chancellor > wrote: > > After mm.h was removed from the asm-generic version of cacheflush.h, > > s390 allye

[PATCH] media: omap3isp: Shuffle cacheflush.h and include mm.h

2020-05-26 Thread Nathan Chancellor
in this file and shuffle cacheflush.h below it. Fixes: 19c0054597a0 ("asm-generic: don't include in cacheflush.h") Signed-off-by: Nathan Chancellor --- I am aware the fixes tag is kind of irrelevant because that SHA will change in the next linux-next revision and this will probably

Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-26 Thread Nathan Chancellor
On Mon, Oct 26, 2020 at 12:36:52PM -0700, Guenter Roeck wrote: > On Wed, Oct 21, 2020 at 07:36:07PM -0700, Joe Perches wrote: > > Use a more generic form for __section that requires quotes to avoid > > complications with clang and gcc differences. > > > > Remove the quote operator # from

Re: [PATCH v2 15/16] powerpc/powernv/sriov: Make single PE mode a per-BAR setting

2020-08-01 Thread Nathan Chancellor
On Wed, Jul 22, 2020 at 04:57:14PM +1000, Oliver O'Halloran wrote: > Using single PE BARs to map an SR-IOV BAR is really a choice about what > strategy to use when mapping a BAR. It doesn't make much sense for this to > be a global setting since a device might have one large BAR which needs to >

Re: [PATCH v2 15/16] powerpc/powernv/sriov: Make single PE mode a per-BAR setting

2020-08-02 Thread Nathan Chancellor
On Sun, Aug 02, 2020 at 11:12:23PM +1000, Michael Ellerman wrote: > Nathan Chancellor writes: > > On Wed, Jul 22, 2020 at 04:57:14PM +1000, Oliver O'Halloran wrote: > >> Using single PE BARs to map an SR-IOV BAR is really a choice about what > >> strategy to use whe

Re: [PATCH v5 01/13] powerpc: Remove Xilinx PPC405/PPC440 support

2020-06-15 Thread Nathan Chancellor
On Thu, May 21, 2020 at 04:55:52PM +, Christophe Leroy wrote: > From: Michal Simek > > The latest Xilinx design tools called ISE and EDK has been released in > October 2013. New tool doesn't support any PPC405/PPC440 new designs. > These platforms are no longer supported and tested. > >

Re: [PATCH v5 01/13] powerpc: Remove Xilinx PPC405/PPC440 support

2020-06-16 Thread Nathan Chancellor
Hi Michal, On Tue, Jun 16, 2020 at 04:45:20PM +0200, Michal Simek wrote: > > > On 16. 06. 20 2:27, Nathan Chancellor wrote: > > On Thu, May 21, 2020 at 04:55:52PM +, Christophe Leroy wrote: > >> From: Michal Simek > >> > >> The latest Xilin

[PATCH] powerpc/boot: Use address-of operator on section symbols

2020-06-23 Thread Nathan Chancellor
sembly with either clang/ld.lld or gcc/ld (tested with diff + objdump -Dr). Link: https://github.com/ClangBuiltLinux/linux/issues/212 Reported-by: Joel Stanley Signed-off-by: Nathan Chancellor --- arch/powerpc/boot/main.c | 4 ++-- arch/powerpc/boot/ps3.c | 2 +- 2 files changed, 3 insertions(+), 3 del

Re: [PATCH v5 01/13] powerpc: Remove Xilinx PPC405/PPC440 support

2020-06-17 Thread Nathan Chancellor
On Thu, Jun 18, 2020 at 10:48:21AM +1000, Michael Ellerman wrote: > Nick Desaulniers writes: > > On Wed, Jun 17, 2020 at 3:20 AM Michael Ellerman > > wrote: > >> Michael Ellerman writes: > >> > Michal Simek writes: > >> > >> > >> >> Or if bamboo requires uImage to be built by default you can

Re: [PATCH] powerpc/boot: Use address-of operator on section symbols

2020-07-18 Thread Nathan Chancellor
On Sat, Jul 18, 2020 at 09:50:50AM +0200, Geert Uytterhoeven wrote: > Hi Nathan, > > On Wed, Jun 24, 2020 at 6:02 AM Nathan Chancellor > wrote: > > arch/powerpc/boot/main.c:107:18: warning: array comparison always > > evaluates to a constant [-Wtautological-compare] >

Re: [PATCH 3/3] ibmvfc: use correlation token to tag commands

2020-12-21 Thread Nathan Chancellor
On Tue, Nov 17, 2020 at 12:50:31PM -0600, Tyrel Datwyler wrote: > The vfcFrame correlation field is 64bit handle that is intended to trace > I/O operations through both the client stack and VIOS stack when the > underlying physical FC adapter supports tagging. > > Tag vfcFrames with the

Re: Error: invalid switch -me200

2020-11-13 Thread Nathan Chancellor
On Fri, Nov 13, 2020 at 11:42:03AM -0800, Nick Desaulniers wrote: > + MPE, PPC > > On Fri, Nov 13, 2020 at 11:08 AM Nathan Chancellor > wrote: > > > > On Fri, Nov 13, 2020 at 09:28:03AM -0800, Fāng-ruì Sòng wrote: > > > On Thu, Nov 12, 2020 at 7:22 PM kernel test

[PATCH 1/2] kbuild: Hoist '--orphan-handling' into Kconfig

2020-11-13 Thread Nathan Chancellor
all of the sections are specified and size asserted. A special thanks to Kees Cook for the help text on this config. Link: https://github.com/ClangBuiltLinux/linux/issues/1187 Signed-off-by: Nathan Chancellor --- Makefile | 6 ++ arch/Kconfig | 9

[PATCH 2/2] kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1

2020-11-13 Thread Nathan Chancellor
-by: kernelci.org bot Reported-by: Mark Brown Link: https://github.com/ClangBuiltLinux/linux/issues/1187 Link: https://github.com/ClangBuiltLinux/linux/issues/1193 Signed-off-by: Nathan Chancellor --- MAINTAINERS| 1 + init/Kconfig | 6 +- scripts/lld-version.sh | 20

Re: [PATCH 2/3] Revert "lib: Revert use of fallthrough pseudo-keyword in lib/"

2020-11-16 Thread Nathan Chancellor
or lib/. > > Link: https://github.com/ClangBuiltLinux/linux/issues/236 > Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor > --- > lib/asn1_decoder.c | 4 ++-- > lib/assoc_array.c | 2 +- > lib/bootconfig.c

Re: [PATCH 1/2] kbuild: Hoist '--orphan-handling' into Kconfig

2020-11-16 Thread Nathan Chancellor
On Mon, Nov 16, 2020 at 05:41:58PM -0800, Nick Desaulniers wrote: > On Fri, Nov 13, 2020 at 11:56 AM Nathan Chancellor > wrote: > > > > Currently, '--orphan-handling=warn' is spread out across four different > > architectures in their respective Makefiles, which make

Re: [PATCH 1/3] powerpc: boot: include compiler_attributes.h

2020-11-16 Thread Nathan Chancellor
com/ClangBuiltLinux/linux/issues/236 > Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor > --- > We could just `#include "include/linux/compiler_types.h"` in the few .c > sources used from lib/ (there are proper header guards in > comp

Re: [PATCH 3/3] powerpc: fix -Wimplicit-fallthrough

2020-11-16 Thread Nathan Chancellor
se cases. > > Link: https://github.com/ClangBuiltLinux/linux/issues/236 > Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor > --- > arch/powerpc/kernel/prom_init.c | 1 + > arch/powerpc/kernel/uprobes.c | 1 + > arch/powerpc/per

  1   2   3   >