* powerpc: build failures in Linus' tree
@ 2020-08-02 10:48 Stephen Rothwell
2020-08-02 17:20 ` Willy Tarreau
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Rothwell @ 2020-08-02 10:48 UTC (permalink / raw)
To: Michael Ellerman, Linux-kernel Mailing List
Cc: PowerPC, Willy Tarreau, Linus Torvalds
[-- Attachment #1: Type: text/plain, Size: 819 bytes --]
Hi all,
We are getting build failures in some PowerPC configs for Linus' tree.
See e.g. http://kisskb.ellerman.id.au/kisskb/buildresult/14306515/
In file included from /kisskb/src/arch/powerpc/include/asm/paca.h:18,
from /kisskb/src/arch/powerpc/include/asm/percpu.h:13,
from /kisskb/src/include/linux/random.h:14,
from /kisskb/src/include/linux/net.h:18,
from /kisskb/src/net/ipv6/ip6_fib.c:20:
/kisskb/src/arch/powerpc/include/asm/mmu.h:139:22: error: unknown type name 'next_tlbcam_idx'
139 | DECLARE_PER_CPU(int, next_tlbcam_idx);
I assume this is caused by commit
1c9df907da83 ("random: fix circular include dependency on arm64 after addition of percpu.h")
But I can't see how, sorry.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: powerpc: build failures in Linus' tree
2020-08-02 10:48 powerpc: build failures in Linus' tree Stephen Rothwell
@ 2020-08-02 17:20 ` Willy Tarreau
2020-08-03 3:45 ` Willy Tarreau
0 siblings, 1 reply; 9+ messages in thread
From: Willy Tarreau @ 2020-08-02 17:20 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Michael Ellerman, Linux-kernel Mailing List, PowerPC, Linus Torvalds
On Sun, Aug 02, 2020 at 08:48:42PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> We are getting build failures in some PowerPC configs for Linus' tree.
> See e.g. http://kisskb.ellerman.id.au/kisskb/buildresult/14306515/
>
> In file included from /kisskb/src/arch/powerpc/include/asm/paca.h:18,
> from /kisskb/src/arch/powerpc/include/asm/percpu.h:13,
> from /kisskb/src/include/linux/random.h:14,
> from /kisskb/src/include/linux/net.h:18,
> from /kisskb/src/net/ipv6/ip6_fib.c:20:
> /kisskb/src/arch/powerpc/include/asm/mmu.h:139:22: error: unknown type name 'next_tlbcam_idx'
> 139 | DECLARE_PER_CPU(int, next_tlbcam_idx);
>
> I assume this is caused by commit
>
> 1c9df907da83 ("random: fix circular include dependency on arm64 after addition of percpu.h")
>
> But I can't see how, sorry.
So there, asm/mmu.h includes asm/percpu.h, which includes asm/paca.h, which
includes asm/mmu.h.
I suspect that we can remove asm/paca.h from asm/percpu.h as it *seems*
to be only used by the #define __my_cpu_offset but I don't know if anything
will break further, especially if this __my_cpu_offset is used anywhere
without this paca definition.
Willy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: powerpc: build failures in Linus' tree
2020-08-02 17:20 ` Willy Tarreau
@ 2020-08-03 3:45 ` Willy Tarreau
2020-08-03 4:10 ` Stephen Rothwell
2020-08-03 11:18 ` Michael Ellerman
0 siblings, 2 replies; 9+ messages in thread
From: Willy Tarreau @ 2020-08-03 3:45 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Linux-kernel Mailing List, PowerPC, Linus Torvalds
[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]
Hi again Stephen,
On Sun, Aug 02, 2020 at 07:20:19PM +0200, Willy Tarreau wrote:
> On Sun, Aug 02, 2020 at 08:48:42PM +1000, Stephen Rothwell wrote:
> > Hi all,
> >
> > We are getting build failures in some PowerPC configs for Linus' tree.
> > See e.g. http://kisskb.ellerman.id.au/kisskb/buildresult/14306515/
> >
> > In file included from /kisskb/src/arch/powerpc/include/asm/paca.h:18,
> > from /kisskb/src/arch/powerpc/include/asm/percpu.h:13,
> > from /kisskb/src/include/linux/random.h:14,
> > from /kisskb/src/include/linux/net.h:18,
> > from /kisskb/src/net/ipv6/ip6_fib.c:20:
> > /kisskb/src/arch/powerpc/include/asm/mmu.h:139:22: error: unknown type name 'next_tlbcam_idx'
> > 139 | DECLARE_PER_CPU(int, next_tlbcam_idx);
> >
> > I assume this is caused by commit
> >
> > 1c9df907da83 ("random: fix circular include dependency on arm64 after addition of percpu.h")
> >
> > But I can't see how, sorry.
>
> So there, asm/mmu.h includes asm/percpu.h, which includes asm/paca.h, which
> includes asm/mmu.h.
>
> I suspect that we can remove asm/paca.h from asm/percpu.h as it *seems*
> to be only used by the #define __my_cpu_offset but I don't know if anything
> will break further, especially if this __my_cpu_offset is used anywhere
> without this paca definition.
I tried this and it fixed 5.8 for me with your config above. I'm appending
a patch that does just this. I didn't test other configs as I don't know
which ones to test though. If it fixes the problem for you, maybe it can
be picked by the PPC maintainers.
Willy
[-- Attachment #2: 0001-powerpc-fix-circular-dependency-in-percpu.h.patch --]
[-- Type: text/plain, Size: 1623 bytes --]
From bcd64a7d0f3445c9a75d3b4dc4837d2ce61660c9 Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
Date: Mon, 3 Aug 2020 05:27:57 +0200
Subject: powerpc: fix circular dependency in percpu.h
After random.h started to include percpu.h (commit f227e3e), several
archs broke in circular dependencies around percpu.h.
In https://lore.kernel.org/lkml/20200802204842.36bca162@canb.auug.org.au/
Stephen Rothwell reported breakage for powerpc with CONFIG_PPC_FSL_BOOK3E.
It turns out that asm/percpu.h includes asm/paca.h, which itself
includes mmu.h, which includes percpu.h when CONFIG_PPC_FSL_BOOK3E=y.
Percpu seems to include asm/paca.h only for local_paca which is used in
the __my_cpu_offset macro. Removing this include solves the issue for
this config.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: f227e3e ("random32: update the net random state on interrupt and activity")
Link: https://lore.kernel.org/lkml/20200802204842.36bca162@canb.auug.org.au/
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
---
arch/powerpc/include/asm/percpu.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/powerpc/include/asm/percpu.h b/arch/powerpc/include/asm/percpu.h
index dce863a..cd3f6e5 100644
--- a/arch/powerpc/include/asm/percpu.h
+++ b/arch/powerpc/include/asm/percpu.h
@@ -10,8 +10,6 @@
#ifdef CONFIG_SMP
-#include <asm/paca.h>
-
#define __my_cpu_offset local_paca->data_offset
#endif /* CONFIG_SMP */
--
2.9.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: powerpc: build failures in Linus' tree
2020-08-03 3:45 ` Willy Tarreau
@ 2020-08-03 4:10 ` Stephen Rothwell
2020-08-03 5:33 ` Willy Tarreau
2020-08-03 11:18 ` Michael Ellerman
1 sibling, 1 reply; 9+ messages in thread
From: Stephen Rothwell @ 2020-08-03 4:10 UTC (permalink / raw)
To: Willy Tarreau
Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Linux-kernel Mailing List, PowerPC, Linus Torvalds
[-- Attachment #1: Type: text/plain, Size: 2040 bytes --]
Hi Willy,
On Mon, 3 Aug 2020 05:45:47 +0200 Willy Tarreau <w@1wt.eu> wrote:
>
> On Sun, Aug 02, 2020 at 07:20:19PM +0200, Willy Tarreau wrote:
> > On Sun, Aug 02, 2020 at 08:48:42PM +1000, Stephen Rothwell wrote:
> > >
> > > We are getting build failures in some PowerPC configs for Linus' tree.
> > > See e.g. http://kisskb.ellerman.id.au/kisskb/buildresult/14306515/
> > >
> > > In file included from /kisskb/src/arch/powerpc/include/asm/paca.h:18,
> > > from /kisskb/src/arch/powerpc/include/asm/percpu.h:13,
> > > from /kisskb/src/include/linux/random.h:14,
> > > from /kisskb/src/include/linux/net.h:18,
> > > from /kisskb/src/net/ipv6/ip6_fib.c:20:
> > > /kisskb/src/arch/powerpc/include/asm/mmu.h:139:22: error: unknown type name 'next_tlbcam_idx'
> > > 139 | DECLARE_PER_CPU(int, next_tlbcam_idx);
> > >
> > > I assume this is caused by commit
> > >
> > > 1c9df907da83 ("random: fix circular include dependency on arm64 after addition of percpu.h")
> > >
> > > But I can't see how, sorry.
> >
> > So there, asm/mmu.h includes asm/percpu.h, which includes asm/paca.h, which
> > includes asm/mmu.h.
> >
> > I suspect that we can remove asm/paca.h from asm/percpu.h as it *seems*
> > to be only used by the #define __my_cpu_offset but I don't know if anything
> > will break further, especially if this __my_cpu_offset is used anywhere
> > without this paca definition.
>
> I tried this and it fixed 5.8 for me with your config above. I'm appending
> a patch that does just this. I didn't test other configs as I don't know
> which ones to test though. If it fixes the problem for you, maybe it can
> be picked by the PPC maintainers.
Our mails have crossed. I just sent a more comprehensive patch. I
think your patch would require a lot of build testing and even then may
fail for some CONFIG combination that we didn't test or added in the
future (or someone just made up).
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: powerpc: build failures in Linus' tree
2020-08-03 4:10 ` Stephen Rothwell
@ 2020-08-03 5:33 ` Willy Tarreau
0 siblings, 0 replies; 9+ messages in thread
From: Willy Tarreau @ 2020-08-03 5:33 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Linux-kernel Mailing List, PowerPC, Linus Torvalds
On Mon, Aug 03, 2020 at 02:10:17PM +1000, Stephen Rothwell wrote:
> Our mails have crossed.
Ah indeed :-)
> I just sent a more comprehensive patch. I
> think your patch would require a lot of build testing and even then may
> fail for some CONFIG combination that we didn't test or added in the
> future (or someone just made up).
Your looks far more complete and very likely more future-proof, I
totally agree.
Thanks!
Willy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: powerpc: build failures in Linus' tree
2020-08-03 3:45 ` Willy Tarreau
2020-08-03 4:10 ` Stephen Rothwell
@ 2020-08-03 11:18 ` Michael Ellerman
2020-08-03 12:17 ` Willy Tarreau
2020-08-03 12:31 ` Stephen Rothwell
1 sibling, 2 replies; 9+ messages in thread
From: Michael Ellerman @ 2020-08-03 11:18 UTC (permalink / raw)
To: Willy Tarreau, Stephen Rothwell
Cc: Benjamin Herrenschmidt, Paul Mackerras,
Linux-kernel Mailing List, PowerPC, Linus Torvalds
Willy Tarreau <w@1wt.eu> writes:
> On Sun, Aug 02, 2020 at 07:20:19PM +0200, Willy Tarreau wrote:
>> On Sun, Aug 02, 2020 at 08:48:42PM +1000, Stephen Rothwell wrote:
>> > Hi all,
>> >
>> > We are getting build failures in some PowerPC configs for Linus' tree.
>> > See e.g. http://kisskb.ellerman.id.au/kisskb/buildresult/14306515/
>> >
>> > In file included from /kisskb/src/arch/powerpc/include/asm/paca.h:18,
>> > from /kisskb/src/arch/powerpc/include/asm/percpu.h:13,
>> > from /kisskb/src/include/linux/random.h:14,
>> > from /kisskb/src/include/linux/net.h:18,
>> > from /kisskb/src/net/ipv6/ip6_fib.c:20:
>> > /kisskb/src/arch/powerpc/include/asm/mmu.h:139:22: error: unknown type name 'next_tlbcam_idx'
>> > 139 | DECLARE_PER_CPU(int, next_tlbcam_idx);
>> >
>> > I assume this is caused by commit
>> >
>> > 1c9df907da83 ("random: fix circular include dependency on arm64 after addition of percpu.h")
>> >
>> > But I can't see how, sorry.
>>
>> So there, asm/mmu.h includes asm/percpu.h, which includes asm/paca.h, which
>> includes asm/mmu.h.
>>
>> I suspect that we can remove asm/paca.h from asm/percpu.h as it *seems*
>> to be only used by the #define __my_cpu_offset but I don't know if anything
>> will break further, especially if this __my_cpu_offset is used anywhere
>> without this paca definition.
>
> I tried this and it fixed 5.8 for me with your config above. I'm appending
> a patch that does just this. I didn't test other configs as I don't know
> which ones to test though. If it fixes the problem for you, maybe it can
> be picked by the PPC maintainers.
>
> Willy
> From bcd64a7d0f3445c9a75d3b4dc4837d2ce61660c9 Mon Sep 17 00:00:00 2001
> From: Willy Tarreau <w@1wt.eu>
> Date: Mon, 3 Aug 2020 05:27:57 +0200
> Subject: powerpc: fix circular dependency in percpu.h
>
> After random.h started to include percpu.h (commit f227e3e), several
> archs broke in circular dependencies around percpu.h.
>
> In https://lore.kernel.org/lkml/20200802204842.36bca162@canb.auug.org.au/
> Stephen Rothwell reported breakage for powerpc with CONFIG_PPC_FSL_BOOK3E.
>
> It turns out that asm/percpu.h includes asm/paca.h, which itself
> includes mmu.h, which includes percpu.h when CONFIG_PPC_FSL_BOOK3E=y.
>
> Percpu seems to include asm/paca.h only for local_paca which is used in
> the __my_cpu_offset macro. Removing this include solves the issue for
> this config.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Fixes: f227e3e ("random32: update the net random state on interrupt and activity")
> Link: https://lore.kernel.org/lkml/20200802204842.36bca162@canb.auug.org.au/
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Signed-off-by: Willy Tarreau <w@1wt.eu>
> ---
> arch/powerpc/include/asm/percpu.h | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/percpu.h b/arch/powerpc/include/asm/percpu.h
> index dce863a..cd3f6e5 100644
> --- a/arch/powerpc/include/asm/percpu.h
> +++ b/arch/powerpc/include/asm/percpu.h
> @@ -10,8 +10,6 @@
>
> #ifdef CONFIG_SMP
>
> -#include <asm/paca.h>
> -
> #define __my_cpu_offset local_paca->data_offset
>
> #endif /* CONFIG_SMP */
If we just move the include of asm/paca.h below asm-generic/percpu.h
then it avoids the bad circular dependency and we still have paca.h
included from percpu.h as before.
eg:
diff --git a/arch/powerpc/include/asm/percpu.h b/arch/powerpc/include/asm/percpu.h
index dce863a7635c..8e5b7d0b851c 100644
--- a/arch/powerpc/include/asm/percpu.h
+++ b/arch/powerpc/include/asm/percpu.h
@@ -10,8 +10,6 @@
#ifdef CONFIG_SMP
-#include <asm/paca.h>
-
#define __my_cpu_offset local_paca->data_offset
#endif /* CONFIG_SMP */
@@ -19,4 +17,6 @@
#include <asm-generic/percpu.h>
+#include <asm/paca.h>
+
#endif /* _ASM_POWERPC_PERCPU_H_ */
So I think I'm inclined to merge that as a minimal fix that's easy to
backport.
cheers
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: powerpc: build failures in Linus' tree
2020-08-03 11:18 ` Michael Ellerman
@ 2020-08-03 12:17 ` Willy Tarreau
2020-08-03 12:31 ` Stephen Rothwell
1 sibling, 0 replies; 9+ messages in thread
From: Willy Tarreau @ 2020-08-03 12:17 UTC (permalink / raw)
To: Michael Ellerman
Cc: Stephen Rothwell, Benjamin Herrenschmidt, Paul Mackerras,
Linux-kernel Mailing List, PowerPC, Linus Torvalds
On Mon, Aug 03, 2020 at 09:18:00PM +1000, Michael Ellerman wrote:
> If we just move the include of asm/paca.h below asm-generic/percpu.h
> then it avoids the bad circular dependency and we still have paca.h
> included from percpu.h as before.
>
> eg:
>
> diff --git a/arch/powerpc/include/asm/percpu.h b/arch/powerpc/include/asm/percpu.h
> index dce863a7635c..8e5b7d0b851c 100644
> --- a/arch/powerpc/include/asm/percpu.h
> +++ b/arch/powerpc/include/asm/percpu.h
> @@ -10,8 +10,6 @@
>
> #ifdef CONFIG_SMP
>
> -#include <asm/paca.h>
> -
> #define __my_cpu_offset local_paca->data_offset
>
> #endif /* CONFIG_SMP */
> @@ -19,4 +17,6 @@
>
> #include <asm-generic/percpu.h>
>
> +#include <asm/paca.h>
> +
> #endif /* _ASM_POWERPC_PERCPU_H_ */
>
>
> So I think I'm inclined to merge that as a minimal fix that's easy to
> backport.
This totally makes sense indeed!
Willy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: powerpc: build failures in Linus' tree
2020-08-03 11:18 ` Michael Ellerman
2020-08-03 12:17 ` Willy Tarreau
@ 2020-08-03 12:31 ` Stephen Rothwell
2020-08-04 0:49 ` Michael Ellerman
1 sibling, 1 reply; 9+ messages in thread
From: Stephen Rothwell @ 2020-08-03 12:31 UTC (permalink / raw)
To: Michael Ellerman
Cc: Willy Tarreau, Benjamin Herrenschmidt, Paul Mackerras,
Linux-kernel Mailing List, PowerPC, Linus Torvalds
[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]
Hi Michael,
On Mon, 03 Aug 2020 21:18:00 +1000 Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> If we just move the include of asm/paca.h below asm-generic/percpu.h
> then it avoids the bad circular dependency and we still have paca.h
> included from percpu.h as before.
>
> eg:
>
> diff --git a/arch/powerpc/include/asm/percpu.h b/arch/powerpc/include/asm/percpu.h
> index dce863a7635c..8e5b7d0b851c 100644
> --- a/arch/powerpc/include/asm/percpu.h
> +++ b/arch/powerpc/include/asm/percpu.h
> @@ -10,8 +10,6 @@
>
> #ifdef CONFIG_SMP
>
> -#include <asm/paca.h>
> -
> #define __my_cpu_offset local_paca->data_offset
>
> #endif /* CONFIG_SMP */
> @@ -19,4 +17,6 @@
>
> #include <asm-generic/percpu.h>
>
> +#include <asm/paca.h>
> +
> #endif /* _ASM_POWERPC_PERCPU_H_ */
>
>
> So I think I'm inclined to merge that as a minimal fix that's easy to
> backport.
>
> cheers
Looks ok, except does it matter that the include used to be only done
if __powerpc64__ and CONFIG_SMP are defined?
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: powerpc: build failures in Linus' tree
2020-08-03 12:31 ` Stephen Rothwell
@ 2020-08-04 0:49 ` Michael Ellerman
0 siblings, 0 replies; 9+ messages in thread
From: Michael Ellerman @ 2020-08-04 0:49 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Willy Tarreau, Benjamin Herrenschmidt, Paul Mackerras,
Linux-kernel Mailing List, PowerPC, Linus Torvalds
Stephen Rothwell <sfr@canb.auug.org.au> writes:
> On Mon, 03 Aug 2020 21:18:00 +1000 Michael Ellerman <mpe@ellerman.id.au> wrote:
>>
>> If we just move the include of asm/paca.h below asm-generic/percpu.h
>> then it avoids the bad circular dependency and we still have paca.h
>> included from percpu.h as before.
>>
>> eg:
>>
>> diff --git a/arch/powerpc/include/asm/percpu.h b/arch/powerpc/include/asm/percpu.h
>> index dce863a7635c..8e5b7d0b851c 100644
>> --- a/arch/powerpc/include/asm/percpu.h
>> +++ b/arch/powerpc/include/asm/percpu.h
>> @@ -10,8 +10,6 @@
>>
>> #ifdef CONFIG_SMP
>>
>> -#include <asm/paca.h>
>> -
>> #define __my_cpu_offset local_paca->data_offset
>>
>> #endif /* CONFIG_SMP */
>> @@ -19,4 +17,6 @@
>>
>> #include <asm-generic/percpu.h>
>>
>> +#include <asm/paca.h>
>> +
>> #endif /* _ASM_POWERPC_PERCPU_H_ */
>>
>>
>> So I think I'm inclined to merge that as a minimal fix that's easy to
>> backport.
>>
>> cheers
>
> Looks ok, except does it matter that the include used to be only done
> if __powerpc64__ and CONFIG_SMP are defined?
Basically all of paca.h is inside #ifdef CONFIG_PPC64.
SMP "shouldn't matter", but I tested a SMP=n build and it's clean, so I
think it's good. Of course there's really no guarantees with these
header tangles.
cheers
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-08-04 0:49 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-02 10:48 powerpc: build failures in Linus' tree Stephen Rothwell
2020-08-02 17:20 ` Willy Tarreau
2020-08-03 3:45 ` Willy Tarreau
2020-08-03 4:10 ` Stephen Rothwell
2020-08-03 5:33 ` Willy Tarreau
2020-08-03 11:18 ` Michael Ellerman
2020-08-03 12:17 ` Willy Tarreau
2020-08-03 12:31 ` Stephen Rothwell
2020-08-04 0:49 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).