mbox series

[v3,0/3] selftests/hid: assorted fixes

Message ID 20230825-wip-selftests-v3-0-639963c54109@kernel.org (mailing list archive)
Headers show
Series selftests/hid: assorted fixes | expand

Message

Benjamin Tissoires Oct. 5, 2023, 3:55 p.m. UTC
And this is the last(?) revision of this series which should now compile
with or without CONFIG_HID_BPF set.

I had to do changes because [1] was failing

Nick, I kept your Tested-by, even if I made small changes in 1/3. Feel
free to shout if you don't want me to keep it.

Eduard, You helped us a lot in the review of v1 but never sent your
Reviewed-by or Acked-by. Do you want me to add one?

Cheers,
Benjamin

[1] https://gitlab.freedesktop.org/bentiss/hid/-/jobs/49754306

For reference, the v2 cover letter:

| Hi, I am sending this series on behalf of myself and Benjamin Tissoires. There
| existed an initial n=3 patch series which was later expanded to n=4 and
| is now back to n=3 with some fixes added in and rebased against
| mainline.
|
| This patch series aims to ensure that the hid/bpf selftests can be built
| without errors.
|
| Here's Benjamin's initial cover letter for context:
| |  These fixes have been triggered by [0]:
| |  basically, if you do not recompile the kernel first, and are
| |  running on an old kernel, vmlinux.h doesn't have the required
| |  symbols and the compilation fails.
| |
| |  The tests will fail if you run them on that very same machine,
| |  of course, but the binary should compile.
| |
| |  And while I was sorting out why it was failing, I realized I
| |  could do a couple of improvements on the Makefile.
| |
| |  [0] https://lore.kernel.org/linux-input/56ba8125-2c6f-a9c9-d498-0ca1c153dcb2@redhat.com/T/#t

Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
---
Changes in v3:
- Also overwrite all of the enum symbols in patch 1/3
- Link to v2: https://lore.kernel.org/r/20230908-kselftest-09-08-v2-0-0def978a4c1b@google.com

Changes in v2:
- roll Justin's fix into patch 1/3
- add __attribute__((preserve_access_index)) (thanks Eduard)
- rebased onto mainline (2dde18cd1d8fac735875f2e4987f11817cc0bc2c)
- Link to v1: https://lore.kernel.org/r/20230825-wip-selftests-v1-0-c862769020a8@kernel.org

Link: https://github.com/ClangBuiltLinux/linux/issues/1698
Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/61

---
Benjamin Tissoires (3):
      selftests/hid: ensure we can compile the tests on kernels pre-6.3
      selftests/hid: do not manually call headers_install
      selftests/hid: force using our compiled libbpf headers

 tools/testing/selftests/hid/Makefile               | 10 ++-
 tools/testing/selftests/hid/progs/hid.c            |  3 -
 .../testing/selftests/hid/progs/hid_bpf_helpers.h  | 77 ++++++++++++++++++++++
 3 files changed, 81 insertions(+), 9 deletions(-)
---
base-commit: 29aa98d0fe013e2ab62aae4266231b7fb05d47a2
change-id: 20230825-wip-selftests-9a7502b56542

Best regards,

Comments

Justin Stitt Oct. 5, 2023, 6 p.m. UTC | #1
On Thu, Oct 5, 2023 at 8:55 AM Benjamin Tissoires <bentiss@kernel.org> wrote:
>
> And this is the last(?) revision of this series which should now compile
> with or without CONFIG_HID_BPF set.
>
> I had to do changes because [1] was failing
>
> Nick, I kept your Tested-by, even if I made small changes in 1/3. Feel
> free to shout if you don't want me to keep it.
>
> Eduard, You helped us a lot in the review of v1 but never sent your
> Reviewed-by or Acked-by. Do you want me to add one?
>
> Cheers,
> Benjamin
>
> [1] https://gitlab.freedesktop.org/bentiss/hid/-/jobs/49754306
>
> For reference, the v2 cover letter:
>
> | Hi, I am sending this series on behalf of myself and Benjamin Tissoires. There
> | existed an initial n=3 patch series which was later expanded to n=4 and
> | is now back to n=3 with some fixes added in and rebased against
> | mainline.
> |
> | This patch series aims to ensure that the hid/bpf selftests can be built
> | without errors.
> |
> | Here's Benjamin's initial cover letter for context:
> | |  These fixes have been triggered by [0]:
> | |  basically, if you do not recompile the kernel first, and are
> | |  running on an old kernel, vmlinux.h doesn't have the required
> | |  symbols and the compilation fails.
> | |
> | |  The tests will fail if you run them on that very same machine,
> | |  of course, but the binary should compile.
> | |
> | |  And while I was sorting out why it was failing, I realized I
> | |  could do a couple of improvements on the Makefile.
> | |
> | |  [0] https://lore.kernel.org/linux-input/56ba8125-2c6f-a9c9-d498-0ca1c153dcb2@redhat.com/T/#t
>
> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
> ---
> Changes in v3:
> - Also overwrite all of the enum symbols in patch 1/3
> - Link to v2: https://lore.kernel.org/r/20230908-kselftest-09-08-v2-0-0def978a4c1b@google.com
>
> Changes in v2:
> - roll Justin's fix into patch 1/3
> - add __attribute__((preserve_access_index)) (thanks Eduard)
> - rebased onto mainline (2dde18cd1d8fac735875f2e4987f11817cc0bc2c)
> - Link to v1: https://lore.kernel.org/r/20230825-wip-selftests-v1-0-c862769020a8@kernel.org
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1698
> Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/61
>
> ---
> Benjamin Tissoires (3):
>       selftests/hid: ensure we can compile the tests on kernels pre-6.3
>       selftests/hid: do not manually call headers_install
>       selftests/hid: force using our compiled libbpf headers
>
>  tools/testing/selftests/hid/Makefile               | 10 ++-
>  tools/testing/selftests/hid/progs/hid.c            |  3 -
>  .../testing/selftests/hid/progs/hid_bpf_helpers.h  | 77 ++++++++++++++++++++++
>  3 files changed, 81 insertions(+), 9 deletions(-)
> ---
> base-commit: 29aa98d0fe013e2ab62aae4266231b7fb05d47a2
> change-id: 20230825-wip-selftests-9a7502b56542
>
> Best regards,
> --
> Benjamin Tissoires <bentiss@kernel.org>
>

Tested entire series.

 I can now build the tests using this command:

$ make LLVM=1 -j128 ARCH=x86_64 mrproper headers && make LLVM=1 -j128
ARCH=x86_64 -C tools/testing/selftests TARGETS=hid


Tested-by:  Justin Stitt <justinstitt@google.com>
Eduard Zingerman Oct. 5, 2023, 6:14 p.m. UTC | #2
On Thu, 2023-10-05 at 17:55 +0200, Benjamin Tissoires wrote:
> > And this is the last(?) revision of this series which should now compile
> > with or without CONFIG_HID_BPF set.
> > 
> > I had to do changes because [1] was failing
> > 
> > Nick, I kept your Tested-by, even if I made small changes in 1/3. Feel
> > free to shout if you don't want me to keep it.
> > 
> > Eduard, You helped us a lot in the review of v1 but never sent your
> > Reviewed-by or Acked-by. Do you want me to add one?

Hi Benjamin,

I think there is no need, I just took part in the discussion and that's all.
Feel free to ping me if there is anything BPF related that needs clarification.

Thanks,
Eduard

> > 
> > Cheers,
> > Benjamin
> > 
> > [1] https://gitlab.freedesktop.org/bentiss/hid/-/jobs/49754306
> > 
> > For reference, the v2 cover letter:
> > 
> > > > Hi, I am sending this series on behalf of myself and Benjamin Tissoires. There
> > > > existed an initial n=3 patch series which was later expanded to n=4 and
> > > > is now back to n=3 with some fixes added in and rebased against
> > > > mainline.
> > > > 
> > > > This patch series aims to ensure that the hid/bpf selftests can be built
> > > > without errors.
> > > > 
> > > > Here's Benjamin's initial cover letter for context:
> > > > > >  These fixes have been triggered by [0]:
> > > > > >  basically, if you do not recompile the kernel first, and are
> > > > > >  running on an old kernel, vmlinux.h doesn't have the required
> > > > > >  symbols and the compilation fails.
> > > > > > 
> > > > > >  The tests will fail if you run them on that very same machine,
> > > > > >  of course, but the binary should compile.
> > > > > > 
> > > > > >  And while I was sorting out why it was failing, I realized I
> > > > > >  could do a couple of improvements on the Makefile.
> > > > > > 
> > > > > >  [0] https://lore.kernel.org/linux-input/56ba8125-2c6f-a9c9-d498-0ca1c153dcb2@redhat.com/T/#t
> > 
> > Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
> > ---
> > Changes in v3:
> > - Also overwrite all of the enum symbols in patch 1/3
> > - Link to v2: https://lore.kernel.org/r/20230908-kselftest-09-08-v2-0-0def978a4c1b@google.com
> > 
> > Changes in v2:
> > - roll Justin's fix into patch 1/3
> > - add __attribute__((preserve_access_index)) (thanks Eduard)
> > - rebased onto mainline (2dde18cd1d8fac735875f2e4987f11817cc0bc2c)
> > - Link to v1: https://lore.kernel.org/r/20230825-wip-selftests-v1-0-c862769020a8@kernel.org
> > 
> > Link: https://github.com/ClangBuiltLinux/linux/issues/1698
> > Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/61
> > 
> > ---
> > Benjamin Tissoires (3):
> >       selftests/hid: ensure we can compile the tests on kernels pre-6.3
> >       selftests/hid: do not manually call headers_install
> >       selftests/hid: force using our compiled libbpf headers
> > 
> >  tools/testing/selftests/hid/Makefile               | 10 ++-
> >  tools/testing/selftests/hid/progs/hid.c            |  3 -
> >  .../testing/selftests/hid/progs/hid_bpf_helpers.h  | 77 ++++++++++++++++++++++
> >  3 files changed, 81 insertions(+), 9 deletions(-)
> > ---
> > base-commit: 29aa98d0fe013e2ab62aae4266231b7fb05d47a2
> > change-id: 20230825-wip-selftests-9a7502b56542
> > 
> > Best regards,
Benjamin Tissoires Oct. 11, 2023, 1:45 p.m. UTC | #3
On Thu, 05 Oct 2023 17:55:31 +0200, Benjamin Tissoires wrote:
> And this is the last(?) revision of this series which should now compile
> with or without CONFIG_HID_BPF set.
> 
> I had to do changes because [1] was failing
> 
> Nick, I kept your Tested-by, even if I made small changes in 1/3. Feel
> free to shout if you don't want me to keep it.
> 
> [...]

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git (for-6.7/selftests), thanks!

[1/3] selftests/hid: ensure we can compile the tests on kernels pre-6.3
      https://git.kernel.org/hid/hid/c/ae7487d112cf
[2/3] selftests/hid: do not manually call headers_install
      https://git.kernel.org/hid/hid/c/89d024a7ba02
[3/3] selftests/hid: force using our compiled libbpf headers
      https://git.kernel.org/hid/hid/c/91939636cac4

Cheers,