BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v1 0/2] selftests/bpf: Add support for MIPS systems
@ 2024-07-21  7:50 Tony Ambardar
  2024-07-21  7:50 ` [PATCH bpf-next v1 1/2] selftests/bpf: Add missing system defines for mips Tony Ambardar
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Tony Ambardar @ 2024-07-21  7:50 UTC (permalink / raw)
  To: bpf
  Cc: Tony Ambardar, linux-kselftest, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
	Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Mykola Lysenko,
	Shuah Khan

Hello,

This series includes two fixes to support builds targeting MIPS systems.
The patches have been tested both with the kernel-patches/bpf CI and
locally using mips64el-gcc/musl-libc and QEMU with an OpenWrt rootfs.

Patch 1 adds support for MIPS system includes when compiling BPF.
Patch 2 fixes a MIPS GOT issue when linking uprobe_multi.

Feedback and suggestions for improvement are welcome!

Thanks,
Tony

Tony Ambardar (2):
  selftests/bpf: Add missing system defines for mips
  selftests/bpf: Fix error linking uprobe_multi on mips

 tools/testing/selftests/bpf/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH bpf-next v1 1/2] selftests/bpf: Add missing system defines for mips
  2024-07-21  7:50 [PATCH bpf-next v1 0/2] selftests/bpf: Add support for MIPS systems Tony Ambardar
@ 2024-07-21  7:50 ` Tony Ambardar
  2024-07-21  7:50 ` [PATCH bpf-next v1 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Tony Ambardar @ 2024-07-21  7:50 UTC (permalink / raw)
  To: bpf
  Cc: Tony Ambardar, linux-kselftest, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
	Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Mykola Lysenko,
	Shuah Khan

Update get_sys_includes in Makefile with missing MIPS-related definitions
to fix many, many compilation errors building selftests/bpf. The following
added defines drive conditional logic in system headers for word-size and
endianness selection:

  MIPSEL, MIPSEB
  _MIPS_SZPTR
  _MIPS_SZLONG
  _MIPS_SIM, _ABIO32, _ABIN32, _ABI64

Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
---
 tools/testing/selftests/bpf/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 05b234248b38..a9c447c63fee 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -396,7 +396,8 @@ define get_sys_includes
 $(shell $(1) $(2) -v -E - </dev/null 2>&1 \
 	| sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \
 $(shell $(1) $(2) -dM -E - </dev/null | grep '__riscv_xlen ' | awk '{printf("-D__riscv_xlen=%d -D__BITS_PER_LONG=%d", $$3, $$3)}') \
-$(shell $(1) $(2) -dM -E - </dev/null | grep '__loongarch_grlen ' | awk '{printf("-D__BITS_PER_LONG=%d", $$3)}')
+$(shell $(1) $(2) -dM -E - </dev/null | grep '__loongarch_grlen ' | awk '{printf("-D__BITS_PER_LONG=%d", $$3)}') \
+$(shell $(1) $(2) -dM -E - </dev/null | grep -E 'MIPS(EL|EB)|_MIPS_SZ(PTR|LONG) |_MIPS_SIM |_ABI(O32|N32|64) ' | awk '{printf("-D%s=%s ", $$2, $$3)}')
 endef
 
 # Determine target endianness.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH bpf-next v1 2/2] selftests/bpf: Fix error linking uprobe_multi on mips
  2024-07-21  7:50 [PATCH bpf-next v1 0/2] selftests/bpf: Add support for MIPS systems Tony Ambardar
  2024-07-21  7:50 ` [PATCH bpf-next v1 1/2] selftests/bpf: Add missing system defines for mips Tony Ambardar
@ 2024-07-21  7:50 ` Tony Ambardar
  2024-07-22 21:22   ` Andrii Nakryiko
  2024-07-21  8:35 ` [PATCH bpf-next v1 0/2] selftests/bpf: Add support for MIPS systems bot+bpf-ci
  2024-07-23  0:13 ` [PATCH bpf-next v2 " Tony Ambardar
  3 siblings, 1 reply; 13+ messages in thread
From: Tony Ambardar @ 2024-07-21  7:50 UTC (permalink / raw)
  To: bpf
  Cc: Tony Ambardar, linux-kselftest, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
	Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Mykola Lysenko,
	Shuah Khan

Linking uprobe_multi.c on mips64el fails due to relocation overflows, when
the GOT entries required exceeds the default maximum. Add a specific CFLAGS
(-mxgot) for uprobe_multi.c on MIPS that allows using a larger GOT and
avoids errors such as:

  /tmp/ccBTNQzv.o: in function `bench':
  uprobe_multi.c:49:(.text+0x1d7720): relocation truncated to fit: R_MIPS_GOT_DISP against `uprobe_multi_func_08188'
  uprobe_multi.c:49:(.text+0x1d7730): relocation truncated to fit: R_MIPS_GOT_DISP against `uprobe_multi_func_08189'
  ...
  collect2: error: ld returned 1 exit status

Fixes: 519dfeaf5119 ("selftests/bpf: Add uprobe_multi test program")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
---
 tools/testing/selftests/bpf/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index a9c447c63fee..0b4bfbc0ef68 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -784,9 +784,12 @@ $(OUTPUT)/veristat: $(OUTPUT)/veristat.o
 	$(call msg,BINARY,,$@)
 	$(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@
 
+# Linking uprobe_multi can fail due to relocation overflows on mips.
+uprobe_multi.c-CFLAGS := $(if $(filter mips, $(ARCH)),-mxgot)
+
 $(OUTPUT)/uprobe_multi: uprobe_multi.c
 	$(call msg,BINARY,,$@)
-	$(Q)$(CC) $(CFLAGS) -O0 $(LDFLAGS) $^ $(LDLIBS) -o $@
+	$(Q)$(CC) $(CFLAGS) $($<-CFLAGS) -O0 $(LDFLAGS) $^ $(LDLIBS) -o $@
 
 EXTRA_CLEAN := $(SCRATCH_DIR) $(HOST_SCRATCH_DIR)			\
 	prog_tests/tests.h map_tests/tests.h verifier/tests.h		\
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH bpf-next v1 0/2] selftests/bpf: Add support for MIPS systems
  2024-07-21  7:50 [PATCH bpf-next v1 0/2] selftests/bpf: Add support for MIPS systems Tony Ambardar
  2024-07-21  7:50 ` [PATCH bpf-next v1 1/2] selftests/bpf: Add missing system defines for mips Tony Ambardar
  2024-07-21  7:50 ` [PATCH bpf-next v1 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
@ 2024-07-21  8:35 ` bot+bpf-ci
  2024-07-23  0:13 ` [PATCH bpf-next v2 " Tony Ambardar
  3 siblings, 0 replies; 13+ messages in thread
From: bot+bpf-ci @ 2024-07-21  8:35 UTC (permalink / raw)
  Cc: bpf, kernel-ci

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

Dear patch submitter,

CI has tested the following submission:
Status:     SUCCESS
Name:       [bpf-next,v1,0/2] selftests/bpf: Add support for MIPS systems
Patchwork:  https://patchwork.kernel.org/project/netdevbpf/list/?series=872744&state=*
Matrix:     https://github.com/kernel-patches/bpf/actions/runs/10026705403

No further action is necessary on your part.


Please note: this email is coming from an unmonitored mailbox. If you have
questions or feedback, please reach out to the Meta Kernel CI team at
kernel-ci@meta.com.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH bpf-next v1 2/2] selftests/bpf: Fix error linking uprobe_multi on mips
  2024-07-21  7:50 ` [PATCH bpf-next v1 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
@ 2024-07-22 21:22   ` Andrii Nakryiko
  2024-07-23  0:04     ` Tony Ambardar
  0 siblings, 1 reply; 13+ messages in thread
From: Andrii Nakryiko @ 2024-07-22 21:22 UTC (permalink / raw)
  To: Tony Ambardar
  Cc: bpf, linux-kselftest, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
	Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
	Hao Luo, Jiri Olsa, Mykola Lysenko, Shuah Khan

On Sun, Jul 21, 2024 at 12:51 AM Tony Ambardar <tony.ambardar@gmail.com> wrote:
>
> Linking uprobe_multi.c on mips64el fails due to relocation overflows, when
> the GOT entries required exceeds the default maximum. Add a specific CFLAGS
> (-mxgot) for uprobe_multi.c on MIPS that allows using a larger GOT and
> avoids errors such as:
>
>   /tmp/ccBTNQzv.o: in function `bench':
>   uprobe_multi.c:49:(.text+0x1d7720): relocation truncated to fit: R_MIPS_GOT_DISP against `uprobe_multi_func_08188'
>   uprobe_multi.c:49:(.text+0x1d7730): relocation truncated to fit: R_MIPS_GOT_DISP against `uprobe_multi_func_08189'
>   ...
>   collect2: error: ld returned 1 exit status
>
> Fixes: 519dfeaf5119 ("selftests/bpf: Add uprobe_multi test program")
> Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
> ---
>  tools/testing/selftests/bpf/Makefile | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index a9c447c63fee..0b4bfbc0ef68 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -784,9 +784,12 @@ $(OUTPUT)/veristat: $(OUTPUT)/veristat.o
>         $(call msg,BINARY,,$@)
>         $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@
>
> +# Linking uprobe_multi can fail due to relocation overflows on mips.
> +uprobe_multi.c-CFLAGS := $(if $(filter mips, $(ARCH)),-mxgot)
> +
>  $(OUTPUT)/uprobe_multi: uprobe_multi.c
>         $(call msg,BINARY,,$@)
> -       $(Q)$(CC) $(CFLAGS) -O0 $(LDFLAGS) $^ $(LDLIBS) -o $@
> +       $(Q)$(CC) $(CFLAGS) $($<-CFLAGS) -O0 $(LDFLAGS) $^ $(LDLIBS) -o $@

this $($<-CFLAGS) approach is fragile, non-obvious and will break. But
there is also no need for this, see:

$(OUTPUT)/bench: LDLIBS += -lm

make allows to override envvars on a per-target basis, so all you
should need is:


$(OUTPUT)/uprobe_multi: CFLAGS += $(if $(filter mips, $(ARCH)),-mxgot)
$(OUTPUT)/uprobe_multi: uprobe_multi.c
   ... the rest is the same with no change whatsoever ...

>
>  EXTRA_CLEAN := $(SCRATCH_DIR) $(HOST_SCRATCH_DIR)                      \
>         prog_tests/tests.h map_tests/tests.h verifier/tests.h           \
> --
> 2.34.1
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH bpf-next v1 2/2] selftests/bpf: Fix error linking uprobe_multi on mips
  2024-07-22 21:22   ` Andrii Nakryiko
@ 2024-07-23  0:04     ` Tony Ambardar
  0 siblings, 0 replies; 13+ messages in thread
From: Tony Ambardar @ 2024-07-23  0:04 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: bpf, linux-kselftest, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
	Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
	Hao Luo, Jiri Olsa, Mykola Lysenko, Shuah Khan

On Mon, Jul 22, 2024 at 02:22:53PM -0700, Andrii Nakryiko wrote:
> On Sun, Jul 21, 2024 at 12:51 AM Tony Ambardar <tony.ambardar@gmail.com> wrote:

[...]

> > --- a/tools/testing/selftests/bpf/Makefile
> > +++ b/tools/testing/selftests/bpf/Makefile
> > @@ -784,9 +784,12 @@ $(OUTPUT)/veristat: $(OUTPUT)/veristat.o
> >         $(call msg,BINARY,,$@)
> >         $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@
> >
> > +# Linking uprobe_multi can fail due to relocation overflows on mips.
> > +uprobe_multi.c-CFLAGS := $(if $(filter mips, $(ARCH)),-mxgot)
> > +
> >  $(OUTPUT)/uprobe_multi: uprobe_multi.c
> >         $(call msg,BINARY,,$@)
> > -       $(Q)$(CC) $(CFLAGS) -O0 $(LDFLAGS) $^ $(LDLIBS) -o $@
> > +       $(Q)$(CC) $(CFLAGS) $($<-CFLAGS) -O0 $(LDFLAGS) $^ $(LDLIBS) -o $@
> 
> this $($<-CFLAGS) approach is fragile, non-obvious and will break. But
> there is also no need for this, see:
> 
> $(OUTPUT)/bench: LDLIBS += -lm
> 
> make allows to override envvars on a per-target basis, so all you
> should need is:
> 
> 
> $(OUTPUT)/uprobe_multi: CFLAGS += $(if $(filter mips, $(ARCH)),-mxgot)
> $(OUTPUT)/uprobe_multi: uprobe_multi.c
>    ... the rest is the same with no change whatsoever ...
> 

Great suggestion, thanks for pointing that out! I'll update and send v2.

> >
> >  EXTRA_CLEAN := $(SCRATCH_DIR) $(HOST_SCRATCH_DIR)                      \
> >         prog_tests/tests.h map_tests/tests.h verifier/tests.h           \
> > --
> > 2.34.1
> >

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH bpf-next v2 0/2] selftests/bpf: Add support for MIPS systems
  2024-07-21  7:50 [PATCH bpf-next v1 0/2] selftests/bpf: Add support for MIPS systems Tony Ambardar
                   ` (2 preceding siblings ...)
  2024-07-21  8:35 ` [PATCH bpf-next v1 0/2] selftests/bpf: Add support for MIPS systems bot+bpf-ci
@ 2024-07-23  0:13 ` Tony Ambardar
  2024-07-23  0:13   ` [PATCH bpf-next v2 1/2] selftests/bpf: Add missing system defines for mips Tony Ambardar
  2024-07-23  0:13   ` [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
  3 siblings, 2 replies; 13+ messages in thread
From: Tony Ambardar @ 2024-07-23  0:13 UTC (permalink / raw)
  To: bpf
  Cc: Tony Ambardar, linux-kselftest, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
	Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Mykola Lysenko,
	Shuah Khan

From: Tony Ambardar <tony.ambardar@gmail.com>

Hello,

This series includes two fixes to support builds targeting MIPS systems.
The patches have been tested both with the kernel-patches/bpf CI and
locally using mips64el-gcc/musl-libc and QEMU with an OpenWrt rootfs.

Patch 1 adds support for MIPS system includes when compiling BPF.
Patch 2 fixes a MIPS GOT issue when linking uprobe_multi.

Feedback and suggestions for improvement are welcome!

Thanks,
Tony

v1->v2:
 - improve CFLAGS handling per Andrii's suggestion

Tony Ambardar (2):
  selftests/bpf: Add missing system defines for mips
  selftests/bpf: Fix error linking uprobe_multi on mips

 tools/testing/selftests/bpf/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH bpf-next v2 1/2] selftests/bpf: Add missing system defines for mips
  2024-07-23  0:13 ` [PATCH bpf-next v2 " Tony Ambardar
@ 2024-07-23  0:13   ` Tony Ambardar
  2024-07-23 20:20     ` patchwork-bot+netdevbpf
  2024-07-23  0:13   ` [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
  1 sibling, 1 reply; 13+ messages in thread
From: Tony Ambardar @ 2024-07-23  0:13 UTC (permalink / raw)
  To: bpf
  Cc: Tony Ambardar, linux-kselftest, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
	Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Mykola Lysenko,
	Shuah Khan

From: Tony Ambardar <tony.ambardar@gmail.com>

Update get_sys_includes in Makefile with missing MIPS-related definitions
to fix many, many compilation errors building selftests/bpf. The following
added defines drive conditional logic in system headers for word-size and
endianness selection:

  MIPSEL, MIPSEB
  _MIPS_SZPTR
  _MIPS_SZLONG
  _MIPS_SIM, _ABIO32, _ABIN32, _ABI64

Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
---
 tools/testing/selftests/bpf/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 3b638069446d..11fdf126cb7c 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -396,7 +396,8 @@ define get_sys_includes
 $(shell $(1) $(2) -v -E - </dev/null 2>&1 \
 	| sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \
 $(shell $(1) $(2) -dM -E - </dev/null | grep '__riscv_xlen ' | awk '{printf("-D__riscv_xlen=%d -D__BITS_PER_LONG=%d", $$3, $$3)}') \
-$(shell $(1) $(2) -dM -E - </dev/null | grep '__loongarch_grlen ' | awk '{printf("-D__BITS_PER_LONG=%d", $$3)}')
+$(shell $(1) $(2) -dM -E - </dev/null | grep '__loongarch_grlen ' | awk '{printf("-D__BITS_PER_LONG=%d", $$3)}') \
+$(shell $(1) $(2) -dM -E - </dev/null | grep -E 'MIPS(EL|EB)|_MIPS_SZ(PTR|LONG) |_MIPS_SIM |_ABI(O32|N32|64) ' | awk '{printf("-D%s=%s ", $$2, $$3)}')
 endef
 
 # Determine target endianness.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips
  2024-07-23  0:13 ` [PATCH bpf-next v2 " Tony Ambardar
  2024-07-23  0:13   ` [PATCH bpf-next v2 1/2] selftests/bpf: Add missing system defines for mips Tony Ambardar
@ 2024-07-23  0:13   ` Tony Ambardar
  2024-07-23  0:34     ` bot+bpf-ci
                       ` (2 more replies)
  1 sibling, 3 replies; 13+ messages in thread
From: Tony Ambardar @ 2024-07-23  0:13 UTC (permalink / raw)
  To: bpf
  Cc: Tony Ambardar, linux-kselftest, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
	Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Mykola Lysenko,
	Shuah Khan

From: Tony Ambardar <tony.ambardar@gmail.com>

Linking uprobe_multi.c on mips64el fails due to relocation overflows, when
the GOT entries required exceeds the default maximum. Add a specific CFLAGS
(-mxgot) for uprobe_multi.c on MIPS that allows using a larger GOT and
avoids errors such as:

  /tmp/ccBTNQzv.o: in function `bench':
  uprobe_multi.c:49:(.text+0x1d7720): relocation truncated to fit: R_MIPS_GOT_DISP against `uprobe_multi_func_08188'
  uprobe_multi.c:49:(.text+0x1d7730): relocation truncated to fit: R_MIPS_GOT_DISP against `uprobe_multi_func_08189'
  ...
  collect2: error: ld returned 1 exit status

Fixes: 519dfeaf5119 ("selftests/bpf: Add uprobe_multi test program")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
---
 tools/testing/selftests/bpf/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 11fdf126cb7c..60a07605a162 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -785,6 +785,8 @@ $(OUTPUT)/veristat: $(OUTPUT)/veristat.o
 	$(call msg,BINARY,,$@)
 	$(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@
 
+# Linking uprobe_multi can fail due to relocation overflows on mips.
+$(OUTPUT)/uprobe_multi: CFLAGS += $(if $(filter mips, $(ARCH)),-mxgot)
 $(OUTPUT)/uprobe_multi: uprobe_multi.c
 	$(call msg,BINARY,,$@)
 	$(Q)$(CC) $(CFLAGS) -O0 $(LDFLAGS) $^ $(LDLIBS) -o $@
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips
  2024-07-23  0:13   ` [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
@ 2024-07-23  0:34     ` bot+bpf-ci
  2024-07-23  1:39     ` bot+bpf-ci
  2024-07-23  2:32     ` bot+bpf-ci
  2 siblings, 0 replies; 13+ messages in thread
From: bot+bpf-ci @ 2024-07-23  0:34 UTC (permalink / raw)
  Cc: bpf, kernel-ci

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

Dear patch submitter,

CI has tested the following submission:
Status:     SUCCESS
Name:       [bpf-next,v2,2/2] selftests/bpf: Fix error linking uprobe_multi on mips
Patchwork:  https://patchwork.kernel.org/project/netdevbpf/list/?series=873092&state=*
Matrix:     https://github.com/kernel-patches/bpf/actions/runs/10050383298

No further action is necessary on your part.


Please note: this email is coming from an unmonitored mailbox. If you have
questions or feedback, please reach out to the Meta Kernel CI team at
kernel-ci@meta.com.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips
  2024-07-23  0:13   ` [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
  2024-07-23  0:34     ` bot+bpf-ci
@ 2024-07-23  1:39     ` bot+bpf-ci
  2024-07-23  2:32     ` bot+bpf-ci
  2 siblings, 0 replies; 13+ messages in thread
From: bot+bpf-ci @ 2024-07-23  1:39 UTC (permalink / raw)
  Cc: bpf, kernel-ci

[-- Attachment #1: Type: text/plain, Size: 3154 bytes --]

Dear patch submitter,

CI has tested the following submission:
Status:     FAILURE
Name:       [bpf-next,v2,2/2] selftests/bpf: Fix error linking uprobe_multi on mips
Patchwork:  https://patchwork.kernel.org/project/netdevbpf/list/?series=873092&state=*
Matrix:     https://github.com/kernel-patches/bpf/actions/runs/10050686380

Failed jobs:
test_progs_no_alu32-aarch64-gcc: https://github.com/kernel-patches/bpf/actions/runs/10050686380/job/27779204312
test_progs_no_alu32-s390x-gcc: https://github.com/kernel-patches/bpf/actions/runs/10050686380/job/27779282003
test_progs_no_alu32-x86_64-gcc: https://github.com/kernel-patches/bpf/actions/runs/10050686380/job/27779242545
test_progs_no_alu32-x86_64-llvm-17: https://github.com/kernel-patches/bpf/actions/runs/10050686380/job/27779265515
test_progs_no_alu32-x86_64-llvm-18: https://github.com/kernel-patches/bpf/actions/runs/10050686380/job/27779280320

First test_progs failure (test_progs_no_alu32-aarch64-gcc):
#134 libbpf_get_fd_by_id_opts
libbpf: prog 'check_access': BPF program load failed: Invalid argument
libbpf: prog 'check_access': -- BEGIN PROG LOAD LOG --
0: R1=ctx() R10=fp0
; int BPF_PROG(check_access, struct bpf_map *map, fmode_t fmode) @ test_libbpf_get_fd_by_id_opts.c:27
0: (b7) r0 = 0                        ; R0_w=0
1: (79) r2 = *(u64 *)(r1 +0)
func 'bpf_lsm_bpf_map' arg0 has btf_id 2072 type STRUCT 'bpf_map'
2: R1=ctx() R2_w=trusted_ptr_bpf_map()
; if (map != (struct bpf_map *)&data_input) @ test_libbpf_get_fd_by_id_opts.c:29
2: (18) r3 = 0xffff0000c4890c00       ; R3_w=map_ptr(map=data_input,ks=4,vs=4)
4: (5d) if r2 != r3 goto pc+4         ; R2_w=trusted_ptr_bpf_map() R3_w=map_ptr(map=data_input,ks=4,vs=4)
; int BPF_PROG(check_access, struct bpf_map *map, fmode_t fmode) @ test_libbpf_get_fd_by_id_opts.c:27
5: (79) r0 = *(u64 *)(r1 +8)          ; R0_w=scalar() R1=ctx()
; if (fmode & FMODE_WRITE) @ test_libbpf_get_fd_by_id_opts.c:32
6: (67) r0 <<= 62                     ; R0_w=scalar(smax=0x4000000000000000,umax=0xc000000000000000,smin32=0,smax32=umax32=0,var_off=(0x0; 0xc000000000000000))
7: (c7) r0 s>>= 63                    ; R0_w=scalar(smin=smin32=-1,smax=smax32=0)
;  @ test_libbpf_get_fd_by_id_opts.c:0
8: (57) r0 &= -13                     ; R0_w=scalar(smax=0x7ffffffffffffff3,umax=0xfffffffffffffff3,smax32=0x7ffffff3,umax32=0xfffffff3,var_off=(0x0; 0xfffffffffffffff3))
; int BPF_PROG(check_access, struct bpf_map *map, fmode_t fmode) @ test_libbpf_get_fd_by_id_opts.c:27
9: (95) exit
At program exit the register R0 has smax=9223372036854775795 should have been in [-4095, 0]
processed 9 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
-- END PROG LOAD LOG --
libbpf: prog 'check_access': failed to load: -22
libbpf: failed to load object 'test_libbpf_get_fd_by_id_opts'
libbpf: failed to load BPF skeleton 'test_libbpf_get_fd_by_id_opts': -22
test_libbpf_get_fd_by_id_opts:FAIL:test_libbpf_get_fd_by_id_opts__open_and_load unexpected error: -22


Please note: this email is coming from an unmonitored mailbox. If you have
questions or feedback, please reach out to the Meta Kernel CI team at
kernel-ci@meta.com.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips
  2024-07-23  0:13   ` [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
  2024-07-23  0:34     ` bot+bpf-ci
  2024-07-23  1:39     ` bot+bpf-ci
@ 2024-07-23  2:32     ` bot+bpf-ci
  2 siblings, 0 replies; 13+ messages in thread
From: bot+bpf-ci @ 2024-07-23  2:32 UTC (permalink / raw)
  Cc: bpf, kernel-ci

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

Dear patch submitter,

CI has tested the following submission:
Status:     SUCCESS
Name:       [bpf-next,v2,2/2] selftests/bpf: Fix error linking uprobe_multi on mips
Patchwork:  https://patchwork.kernel.org/project/netdevbpf/list/?series=873092&state=*
Matrix:     https://github.com/kernel-patches/bpf/actions/runs/10051521603

No further action is necessary on your part.


Please note: this email is coming from an unmonitored mailbox. If you have
questions or feedback, please reach out to the Meta Kernel CI team at
kernel-ci@meta.com.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH bpf-next v2 1/2] selftests/bpf: Add missing system defines for mips
  2024-07-23  0:13   ` [PATCH bpf-next v2 1/2] selftests/bpf: Add missing system defines for mips Tony Ambardar
@ 2024-07-23 20:20     ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 13+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-07-23 20:20 UTC (permalink / raw)
  To: Tony Ambardar
  Cc: bpf, linux-kselftest, ast, daniel, andrii, martin.lau, eddyz87,
	song, yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa,
	mykolal, shuah

Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Mon, 22 Jul 2024 17:13:28 -0700 you wrote:
> From: Tony Ambardar <tony.ambardar@gmail.com>
> 
> Update get_sys_includes in Makefile with missing MIPS-related definitions
> to fix many, many compilation errors building selftests/bpf. The following
> added defines drive conditional logic in system headers for word-size and
> endianness selection:
> 
> [...]

Here is the summary with links:
  - [bpf-next,v2,1/2] selftests/bpf: Add missing system defines for mips
    https://git.kernel.org/bpf/bpf-next/c/84b4e873b10a
  - [bpf-next,v2,2/2] selftests/bpf: Fix error linking uprobe_multi on mips
    https://git.kernel.org/bpf/bpf-next/c/64d50da31564

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-07-23 20:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-21  7:50 [PATCH bpf-next v1 0/2] selftests/bpf: Add support for MIPS systems Tony Ambardar
2024-07-21  7:50 ` [PATCH bpf-next v1 1/2] selftests/bpf: Add missing system defines for mips Tony Ambardar
2024-07-21  7:50 ` [PATCH bpf-next v1 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
2024-07-22 21:22   ` Andrii Nakryiko
2024-07-23  0:04     ` Tony Ambardar
2024-07-21  8:35 ` [PATCH bpf-next v1 0/2] selftests/bpf: Add support for MIPS systems bot+bpf-ci
2024-07-23  0:13 ` [PATCH bpf-next v2 " Tony Ambardar
2024-07-23  0:13   ` [PATCH bpf-next v2 1/2] selftests/bpf: Add missing system defines for mips Tony Ambardar
2024-07-23 20:20     ` patchwork-bot+netdevbpf
2024-07-23  0:13   ` [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
2024-07-23  0:34     ` bot+bpf-ci
2024-07-23  1:39     ` bot+bpf-ci
2024-07-23  2:32     ` bot+bpf-ci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox