Skip to contentSkip to conversation

tools: add forwarding header for arch/riscv/include/asm/fence.h

PATCH In review Andreas Schwab 5 participants 11 messages Oct 7, 2024 – Nov 12, 2024 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: add forwarding header for arch/riscv/include/asm/fence.h

This is needed so that <asm/barrier.h> can find <asm/fence.h> on riscv.

Fixes 6d74d178fe6e ("tools: Add riscv barrier implementation")
---
 tools/include/asm/fence.h | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 tools/include/asm/fence.h
tools/include/asm/fence.h new file +3 -0
new file mode 100644
index 000000000000..917a173059a4
@@ -0,0 +1,3 @@
+#if defined(__riscv)
+#include "../../arch/riscv/include/asm/fence.h"
+#endif
Signature · 7 lines
2.46.2


-- 
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
maintainer Reviewed-by Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · On Mon, 07 Oct 2024 00:24:06 PDT (-0700), [email protected] wrote:

This is needed so that <asm/barrier.h> can find <asm/fence.h> on riscv.

Fixes 6d74d178fe6e ("tools: Add riscv barrier implementation")
---
 tools/include/asm/fence.h | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 tools/include/asm/fence.h
tools/include/asm/fence.h new file +0 -0
new file mode 100644
index 000000000000..917a173059a4

tools/include/asm/fence.h line 3

Quoted 3 lines
tools/include/asm/fence.h new file +3 -0
@@ -0,0 +1,3 @@
+#if defined(__riscv)
+#include "../../arch/riscv/include/asm/fence.h"
+#endif

Happy to pick this up via the RISC-V tree if you want. Thanks!

#2 lore raw
Quoted 1 line · Palmer Dabbelt

Happy to pick this up via the RISC-V tree if you want. Thanks!

Please make sure to pass it on soon, since it blocks building a full-featured kernel.

Thanks.

Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Reviewed-by on v1 1/1
#4 lore raw
In reply to Andreas Schwab

Hi Andreas,

Quoted 16 lines · Andreas Schwab

This is needed so that <asm/barrier.h> can find <asm/fence.h> on riscv.

Fixes 6d74d178fe6e ("tools: Add riscv barrier implementation")
---
 tools/include/asm/fence.h | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 tools/include/asm/fence.h
tools/include/asm/fence.h new file +0 -0
new file mode 100644
index 000000000000..917a173059a4

tools/include/asm/fence.h

Quoted 4 lines
tools/include/asm/fence.h new file +3 -1
@@ -0,0 +1,3 @@
+#if defined(__riscv)
+#include "../../arch/riscv/include/asm/fence.h"
+#endif
--

Thanks for this Fix.

Thanks
-Anand

Quoted 12 lines

2.46.2

--
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

reviewer Tested-by on v1 1/1
#5 lore raw
In reply to Andreas Schwab

Hi Andreas,

Quoted 15 lines · Andreas Schwab

This is needed so that <asm/barrier.h> can find <asm/fence.h> on riscv.

Fixes 6d74d178fe6e ("tools: Add riscv barrier implementation")
---
  tools/include/asm/fence.h | 3 +++
  1 file changed, 3 insertions(+)

create mode 100644 tools/include/asm/fence.h

tools/include/asm/fence.h new file +0 -0
new file mode 100644
index 000000000000..917a173059a4

tools/include/asm/fence.h line 3

Quoted 3 lines
tools/include/asm/fence.h new file +3 -0
@@ -0,0 +1,3 @@
+#if defined(__riscv)
+#include "../../arch/riscv/include/asm/fence.h"
+#endif

Thanks for the patch!

Alex

#6 lore raw
In reply to Andreas Schwab

Hi Andreas,

Quoted 15 lines · Andreas Schwab

This is needed so that <asm/barrier.h> can find <asm/fence.h> on riscv.

Fixes 6d74d178fe6e ("tools: Add riscv barrier implementation")
---
  tools/include/asm/fence.h | 3 +++
  1 file changed, 3 insertions(+)

create mode 100644 tools/include/asm/fence.h

tools/include/asm/fence.h new file +0 -0
new file mode 100644
index 000000000000..917a173059a4

tools/include/asm/fence.h line 3

Quoted 3 lines
tools/include/asm/fence.h new file +3 -0
@@ -0,0 +1,3 @@
+#if defined(__riscv)
+#include "../../arch/riscv/include/asm/fence.h"
+#endif

After a discussion with Bjorn, it appears that he had already solved this issue with the following patch: https://lore.kernel.org/linux-riscv/[email protected]/ which we find cleaner. I have just tested his, and it indeed fixes the build error.

Unless you have any objection, we'll try to make Bjorn's patch into 6.12-rc7 instead of yours.

Thanks,

Alex

#7 lore raw
Quoted 2 lines · Alexandre Ghiti

Unless you have any objection, we'll try to make Bjorn's patch into 6.12-rc7 instead of yours.

It still fails the same:

In file included from /home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/tools/include/asm/barrier.h:12,

                 from /home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/tools/include/linux/ring_buffer.h:4,
                 from libbpf.c:37:
/home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/tools/include/asm/../../arch/riscv/include/asm/barrier.h:13:10: fatal error: asm/fence.h: No such file or directory
   13 | #include <asm/fence.h>
      |          ^~~~~~~~~~~~~

compilation terminated.
make[5]: *** [/home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/tools/build/Makefile.build:106: /home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/linux-obj/tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf.o] Error 1 make[5]: *** Waiting for unfinished jobs....
make[4]: *** [Makefile:164: /home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/linux-obj/tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf-in.o] Error 2
make[3]: *** [Makefile:63: /home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/linux-obj/tools/bpf/resolve_btfids//libbpf/libbpf.a] Error 2
make[2]: *** [Makefile:76: bpf/resolve_btfids] Error 2
make[1]: *** [/home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/Makefile:1393: tools/bpf/resolve_btfids] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [../Makefile:224: __sub-make] Error 2

Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
#8 lore raw

Hi Andreas,

Quoted 12 lines · Andreas Schwab
Quoted 2 lines · Alexandre Ghiti

Unless you have any objection, we'll try to make Bjorn's patch into 6.12-rc7 instead of yours.

It still fails the same:

In file included from /home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/tools/include/asm/barrier.h:12,

                  from /home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/tools/include/linux/ring_buffer.h:4,
                  from libbpf.c:37:
/home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/tools/include/asm/../../arch/riscv/include/asm/barrier.h:13:10: fatal error: asm/fence.h: No such file or directory
    13 | #include <asm/fence.h>
       |          ^~~~~~~~~~~~~
Quoted 10 lines

compilation terminated.
make[5]: *** [/home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/tools/build/Makefile.build:106: /home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/linux-obj/tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf.o] Error 1 make[5]: *** Waiting for unfinished jobs....
make[4]: *** [Makefile:164: /home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/linux-obj/tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf-in.o] Error 2
make[3]: *** [Makefile:63: /home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/linux-obj/tools/bpf/resolve_btfids//libbpf/libbpf.a] Error 2
make[2]: *** [Makefile:76: bpf/resolve_btfids] Error 2
make[1]: *** [/home/abuild/rpmbuild/BUILD/kernel-default-6.12~rc7/linux-6.12-rc7/Makefile:1393: tools/bpf/resolve_btfids] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [../Makefile:224: __sub-make] Error 2

Indeed, Bjorn's patches did not make it into rc7...

#9 lore raw
Quoted 1 line · Alexandre Ghiti

Indeed, Bjorn's patches did not make it into rc7...

That needs to be fixed ASAP!

Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
#10 lore raw
Quoted 5 lines · Andreas Schwab
Quoted 1 line · Alexandre Ghiti

Indeed, Bjorn's patches did not make it into rc7...

That needs to be fixed ASAP!

Ok, if we want to unbreak the tools builds, two series are required for 6.12.

[1] which addresses the asm/fence.h path issue
[2] which addresses the same issue, but for non-cross builds

[2] can be pulled to RISC-V fixes, but [1] reside in the bpf-next tree (target 6.13). Details here: [3].

To reiterate what I asked Andrii, but for RISC-V fixes: Would it be possible to pull these patches [2] into the RISC-V tree, having a duplicate set in bpf-next? Or are we stuck with stable backporting, as Andrii suggests?

Björn

[1] https://lore.kernel.org/linux-riscv/[email protected]/
[2] https://lore.kernel.org/linux-riscv/[email protected]/
[3] https://lore.kernel.org/linux-riscv/CAEf4BzZbq9OwSGi4pdb5_q8YkErfFiQFKYXg3g1rjpdejafx+Q@mail.gmail.com/