8d355b56 | 28-Nov-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: fix kfunc inclusions with newer bpftool
bpftool now embeds the kfuncs definitions directly in the generated vmlinux.h
This is great, but because the selftests dir might be compiled w
selftests/hid: fix kfunc inclusions with newer bpftool
bpftool now embeds the kfuncs definitions directly in the generated vmlinux.h
This is great, but because the selftests dir might be compiled with HID_BPF disabled, we have no guarantees to be able to compile the sources with the generated kfuncs.
If we have the kfuncs, because we have the `__not_used` hack, the newly defined kfuncs do not match the ones from vmlinux.h and things go wrong.
Prevent vmlinux.h to define its kfuncs and also add the missing `__weak` symbols for our custom kfuncs definitions
Link: https://patch.msgid.link/20241128-fix-new-bpftool-v1-1-c9abdf94a719@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
fcdf830e | 01-Jul-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: ensure CKI can compile our new tests on old kernels
In the same way than commit ae7487d112cf ("selftests/hid: ensure we can compile the tests on kernels pre-6.3") we should expose str
selftests/hid: ensure CKI can compile our new tests on old kernels
In the same way than commit ae7487d112cf ("selftests/hid: ensure we can compile the tests on kernels pre-6.3") we should expose struct hid_bpf_ops when it's not available in vmlinux.h.
So unexpose an eventual struct hid_bpf_ops, include vmlinux.h, and re-export struct hid_bpf_ops.
Fixes: d7696738d66b ("selftests/hid: convert the hid_bpf selftests with struct_ops") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/r/202406270328.bscLN1IF-lkp@intel.com/ Link: https://patch.msgid.link/20240701-fix-cki-v2-1-20564e2e1393@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
d3e15189 | 26-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: add an infinite loop test for hid_bpf_try_input_report
We don't want this call to allow an infinite loop in HID-BPF, so let's have some tests.
Link: https://patch.msgid.link/20240626
selftests/hid: add an infinite loop test for hid_bpf_try_input_report
We don't want this call to allow an infinite loop in HID-BPF, so let's have some tests.
Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-13-cfd60fb6c79f@kernel.org Acked-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
62f2e1a0 | 26-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: add another test for injecting an event from an event hook
Similar to test_multiply_events_wq: we receive one event and inject a new one. But given that this time we are already in th
selftests/hid: add another test for injecting an event from an event hook
Similar to test_multiply_events_wq: we receive one event and inject a new one. But given that this time we are already in the event hook, we can use hid_bpf_try_input_report() directly as this function will not sleep.
Note that the injected event gets processed before the original one this way.
Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-12-cfd60fb6c79f@kernel.org Acked-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
fe8d561d | 26-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: add wq test for hid_bpf_input_report()
Now that bpf_wq is available, we can write a test with it. Having hid_bpf_input_report() waiting for the device means that we can directly call
selftests/hid: add wq test for hid_bpf_input_report()
Now that bpf_wq is available, we can write a test with it. Having hid_bpf_input_report() waiting for the device means that we can directly call it, and we get that event when the device is ready.
Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-10-cfd60fb6c79f@kernel.org Acked-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
3ac83fcd | 26-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: add tests for hid_hw_output_report HID-BPF hooks
We add 3 new tests: - first, we make sure we can prevent the output_report to happen - second, we make sure that we can detect that a
selftests/hid: add tests for hid_hw_output_report HID-BPF hooks
We add 3 new tests: - first, we make sure we can prevent the output_report to happen - second, we make sure that we can detect that a given hidraw client was actually doing the request, and for that client only, call ourself hid_bpf_hw_output_report(), returning a custom value - last, we ensure that we can not loop between hooks for hid_hw_output_report() and manual calls to hid_bpf_hw_output_report() from that same hook
Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-8-cfd60fb6c79f@kernel.org Acked-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
015a4a2a | 26-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: add tests for hid_hw_raw_request HID-BPF hooks
We add 3 new tests: - first, we make sure we can prevent the raw_request to happen - second, we make sure that we can detect that a give
selftests/hid: add tests for hid_hw_raw_request HID-BPF hooks
We add 3 new tests: - first, we make sure we can prevent the raw_request to happen - second, we make sure that we can detect that a given hidraw client was actually doing the request, and for that client only, call ourself hid_bpf_hw_request(), returning a custom value - last, we ensure that we can not loop between hooks for hid_hw_raw_request() and manual calls to hid_bpf_hw_request() from that hook
Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-6-cfd60fb6c79f@kernel.org Acked-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
2c0e8ced | 15-Mar-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: add tests for hid_bpf_input_report
Usual way of testing, we call the function and ensures we receive the event
Link: https://lore.kernel.org/r/20240315-b4-hid-bpf-new-funcs-v4-6-079c
selftests/hid: add tests for hid_bpf_input_report
Usual way of testing, we call the function and ensures we receive the event
Link: https://lore.kernel.org/r/20240315-b4-hid-bpf-new-funcs-v4-6-079c282469d3@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
80e189f2 | 03-Nov-2022 |
Benjamin Tissoires <benjamin.tissoires@redhat.com> |
selftests/hid: Add a test for BPF_F_INSERT_HEAD
Insert 3 programs to check that we are doing the correct thing: '2', '1', '3' are inserted, but '1' is supposed to be executed first.
Signed-off-by:
selftests/hid: Add a test for BPF_F_INSERT_HEAD
Insert 3 programs to check that we are doing the correct thing: '2', '1', '3' are inserted, but '1' is supposed to be executed first.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
show more ...
|