ailed my own CI now with
the enums being already defined:
https://gitlab.freedesktop.org/bentiss/hid/-/jobs/49754306
I'll probably squash the following patch in 1/3, would you mind giving
it a test?
---
>From 37feca6c0e84705ad65e621643206c287b63bb0a Mon Sep 17 00:00:00 2001
From: Benjamin
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.
Turns out that we were relying on the globally installed headers, not
the ones we freshly compiled.
Add a manual include in CFLAGS to sort this out.
Tested-by: Nick Desaulniers # Build
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid/Makefile | 2 ++
1 file changed, 2
"make headers" is a requirement before calling make on the selftests
dir, so we should not have to manually install those headers
Acked-by: Shuah Khan
Tested-by: Nick Desaulniers # Build
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid/Makefile | 8 ++--
1 file
ition of that symbol in case we don't find it in the
BTF and also add __attribute__((preserve_access_index)) to further
support CO-RE functionality for these tests.
Signed-off-by: Justin Stitt
Tested-by: Nick Desaulniers # Build
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests
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 sm
r.yfh.7.76.2311012033290.29...@cbobk.fhfr.pm/
Signed-off-by: Benjamin Tissoires
---
Benjamin Tissoires (12):
selftests/hid: vmtest.sh: update vm2c and container
selftests/hid: vmtest.sh: allow finer control on the build steps
selftests/hid: base: allow for multiple skip_if_
Looks like this is a leftover
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid/tests/test_tablet.py | 4
1 file changed, 4 deletions(-)
diff --git a/tools/testing/selftests/hid/tests/test_tablet.py
b/tools/testing/selftests/hid/tests/test_tablet.py
index 3039ee8d
vmtest.sh works great for a one shot test, but not so much for CI where
I want to build (with different configs) the bzImage in a separate
job than the one I am running it.
Add a "build_only" option to specify whether we need to boot the currently
built kernel in the vm.
Signed-off-by
Those transitions have nothing to do with `Pen`, so migrate them to
`PenState`.
The hidden agenda is to remove `Pen` and integrate it into `PenDigitizer`
so that we can tweak the events in each state to emulate firmware bugs.
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid
manually building the button test by hand and forgetting
about some cases, let's reuse the state machine and transitions we have.
This patch only adds the states and the valid transitions. The actual
tests will be replaced later.
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftest
We can easily subclass PenDigitizer for introducing firmware bugs when
subclassing Pen is harder.
Move move_to from Pen to PenDigitizer so we get that ability
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid/tests/test_tablet.py | 97
1 file changed
Avoids getting a null event when these usages are set
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid/tests/test_tablet.py | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/hid/tests/test_tablet.py
b/tools/testing
k user space, but we have serious doubts
if we are doing the right thing. And depending on the test, either
ask only for valid transitions, or tolerate weird ones.
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid/tests/test_tablet.py | 122 +++
1 file chang
Some tablets report 2 barrel switches. We better test those too.
Use the same transistions description from the primary button tests.
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid/tests/test_tablet.py | 67
1 file changed, 67 insertions(+)
diff
Peter that his
rev-by applied to the whole series.
[0]
https://lore.kernel.org/all/nycvar.yfh.7.76.2311012033290.29...@cbobk.fhfr.pm/
Signed-off-by: Benjamin Tissoires
---
Changes in v2:
- took Peter's review into account
- Added a few patches to make mypy and ruff happy given that
I ha
boot2container is now on an official project, so let's use that.
The container image is now the same I use for the CI, so let's keep
to it.
Reviewed-by: Peter Hutterer
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
tools/testing/selftests/hid/vmtest.sh | 4 ++--
1 file
: Peter Hutterer
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
tools/testing/selftests/hid/tests/base.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/testing/selftests/hid/tests/base.py
b/tools/testing/selftests/hid/tests/base.py
index 1305cfc9646e
-by: Peter Hutterer
Signed-off-by: Benjamin Tissoires
---
changes in v2:
- fixed typo
---
tools/testing/selftests/hid/vmtest.sh | 42 ---
1 file changed, 24 insertions(+), 18 deletions(-)
diff --git a/tools/testing/selftests/hid/vmtest.sh
b/tools/testing/sel
Those transitions have nothing to do with `Pen`, so migrate them to
`PenState`.
The hidden agenda is to remove `Pen` and integrate it into `PenDigitizer`
so that we can tweak the events in each state to emulate firmware bugs.
Reviewed-by: Peter Hutterer
Signed-off-by: Benjamin Tissoires
Looks like this is a leftover
Reviewed-by: Peter Hutterer
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
tools/testing/selftests/hid/tests/test_tablet.py | 4
1 file changed, 4 deletions(-)
diff --git a/tools/testing/selftests/hid/tests/test_tablet.py
b/tools/testing
We can easily subclass PenDigitizer for introducing firmware bugs when
subclassing Pen is harder.
Move move_to from Pen to PenDigitizer so we get that ability
Reviewed-by: Peter Hutterer
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
tools/testing/selftests/hid/tests
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
tools/testing/selftests/hid/tests/test_tablet.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/hid/tests/test_tablet.py
b/tools/testing/selftests/hid/tests/test_tablet.py
index 27260dc02cc4
This introduces a little bit more readability by not using the raw values
but a dedicated Enum
Signed-off-by: Benjamin Tissoires
---
new in v2
---
tools/testing/selftests/hid/tests/test_tablet.py | 36
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a
Avoids getting a null event when these usages are set
Reviewed-by: Peter Hutterer
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
tools/testing/selftests/hid/tests/test_tablet.py | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/testing
manually building the button test by hand and forgetting
about some cases, let's reuse the state machine and transitions we have.
This patch only adds the states and the valid transitions. The actual
tests will be replaced later.
Reviewed-by: Peter Hutterer
Signed-off-by: Benjamin Tiss
We get more descriptive in what we are doing, and also get more
information of what is actually being tested. Instead of having a non
exhaustive button changes that are semi-randomly done, we can describe
all the states we want to test.
Reviewed-by: Peter Hutterer
Signed-off-by: Benjamin
Some tablets report 2 barrel switches. We better test those too.
Use the same transistions description from the primary button tests.
Reviewed-by: Peter Hutterer
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
tools/testing/selftests/hid/tests/test_tablet.py | 67
k user space, but we have serious doubts
if we are doing the right thing. And depending on the test, either
ask only for valid transitions, or tolerate weird ones.
Reviewed-by: Peter Hutterer
Signed-off-by: Benjamin Tissoires
---
changes in v2:
- fixed type annotations for apply()
-
No code change, only typing information added/ignored
Signed-off-by: Benjamin Tissoires
---
new in v2
---
tools/testing/selftests/hid/tests/base.py| 4 ++--
tools/testing/selftests/hid/tests/test_tablet.py | 10 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git
rename ambiguous variables l, r, and m, and ignore the return values
of uhdev.get_evdev() and uhdev.get_slot()
Signed-off-by: Benjamin Tissoires
---
new in v2
---
tools/testing/selftests/hid/tests/test_mouse.py | 14 +++---
tools/testing/selftests/hid/tests
On Wed, 06 Dec 2023 11:45:51 +0100, Benjamin Tissoires wrote:
> the main trigger of this series was the XP-Pen issue[0].
> Basically, the tablets tests were good-ish but couldn't
> handle that tablet both in terms of emulation or in terms
> of detection of issues.
>
> So re
On Thu, Dec 7, 2023 at 9:53 AM Benjamin Tissoires wrote:
>
> On Wed, 06 Dec 2023 11:45:51 +0100, Benjamin Tissoires wrote:
> > the main trigger of this series was the XP-Pen issue[0].
> > Basically, the tablets tests were good-ish but couldn't
> > handle that tablet
An overlook from commit 74452d6329be ("selftests/hid: tablets: add
variants of states with buttons"), where I don't use the Enum...
Fixes: 74452d6329be ("selftests/hid: tablets: add variants of states with
buttons")
Signed-off-by: Benjamin Tissoires
---
Not sure wha
On Thu, 07 Dec 2023 13:22:39 +0100, Benjamin Tissoires wrote:
> An overlook from commit 74452d6329be ("selftests/hid: tablets: add
> variants of states with buttons"), where I don't use the Enum...
>
>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/hid/
Hi,
On Tue, Dec 12, 2023 at 9:11 AM Akihiko Odaki wrote:
>
> Hi,
>
> It is said eBPF is a safe way to extend kernels and that is very
> attarctive, but we need to use kfuncs to add new usage of eBPF and
> kfuncs are said as unstable as EXPORT_SYMBOL_GPL. So now I'd like to ask
> some questions:
>
On Tue, Dec 12, 2023 at 1:41 PM Akihiko Odaki wrote:
>
> On 2023/12/12 19:39, Benjamin Tissoires wrote:
> > Hi,
> >
> > On Tue, Dec 12, 2023 at 9:11 AM Akihiko Odaki
> > wrote:
> >>
> >> Hi,
>
> Hi,
>
> Thanks for reply.
>
> &
: Benjamin Tissoires
---
Over the break the test suite wasn't properly running on my runner,
and this small issue sneaked in.
---
tools/testing/selftests/hid/tests/test_wacom_generic.py | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/hid/
hes
Cheers,
Benjamin
>
>
> Jason
> ---
> Now instead of four in the eights place /
> you’ve got three, ‘Cause you added one /
> (That is to say, eight) to the two, /
> But you can’t take seven from three,/
> So you look at the sixty-fours
>
>
>
&g
On Wed, 17 Jan 2024 14:27:15 +0100, Benjamin Tissoires wrote:
> The device is exported with a fuzz of 4, meaning that the `+ t` here
> is removed by the fuzz algorithm, making those tests failing.
>
> Not sure why, but when I run this locally it was passing, but not
all machinery does not handle errors.
>
> Signed-off-by: Daniel Xu
> ---
> Documentation/bpf/kfuncs.rst | 8
> drivers/hid/bpf/hid_bpf_dispatch.c| 8
For the HID changes (they shouldn't conflict with our current branch):
Acked-by: Benjamin Tissoires
probably
not a guarantee I'm doing the things properly :)
Cheers,
Benjamin
Signed-off-by: Benjamin Tissoires
---
Benjamin Tissoires (9):
bpf: allow more maps in sleepable bpf programs
HID: bpf/dispatch: regroup kfuncs definitions
HID: bpf: export hid_hw_output_report as
therefore BPF_MAP_TYPE_STACK) allows
for a BPF program to prepare from an IRQ the list of HID commands to send
back to the device and then these commands can be retrieved from the
sleepable trace point.
Signed-off-by: Benjamin Tissoires
---
kernel/bpf/verifier.c | 3 +++
1 file changed, 3 insertions
No code change, just move down the hid_bpf_get_data() kfunc definition
so we have only one block of __bpf_kfunc_start/end_defs()
Signed-off-by: Benjamin Tissoires
---
drivers/hid/bpf/hid_bpf_dispatch.c | 80 ++
1 file changed, 38 insertions(+), 42 deletions
We currently only export hid_hw_raw_request() as a BPF kfunc.
However, some devices require an explicit write on the Output Report
instead of the use of the control channel.
So also export hid_hw_output_report to BPF
Signed-off-by: Benjamin Tissoires
---
Documentation/hid/hid-bpf.rst
This time we need to ensure uhid receives it, thus the new mutex and
condition.
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid/hid_bpf.c | 63 ++
tools/testing/selftests/hid/progs/hid.c| 24 +
.../testing/selftests/hid
device, not
just uhid virtual ones.
Signed-off-by: Benjamin Tissoires
---
Documentation/hid/hid-bpf.rst | 2 +-
drivers/hid/bpf/hid_bpf_dispatch.c | 29 +
drivers/hid/hid-core.c | 1 +
include/linux/hid_bpf.h| 2 ++
4 files changed, 33
Usual way of testing, we call the function and ensures we receive
the event
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid/hid_bpf.c | 49 +-
tools/testing/selftests/hid/progs/hid.c| 22 ++
.../testing/selftests/hid/progs
is no logic that would justify an actual
userspace wakeup. So a kernel workqueue is simpler to handle.
Signed-off-by: Benjamin Tissoires
---
Documentation/hid/hid-bpf.rst | 24 ++-
drivers/hid/bpf/entrypoints/entrypoints.bpf.c | 8 +
drivers/hid/bpf/entrypoints/entrypoints.ls
.
The use of the ring buffer is there to not have sleeps in userspace
because we have no guarantees of the timing of when those jobs will be
called.
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid/hid_bpf.c | 57 ++
tools/testing/selftests/hid/progs
- if there is an error, while re-injecting it, we try again 5 ms later
- ensure we can add another event in the queue or call other sleepable
kfuncs
- ensure we receive the correct events and exactly them
Signed-off-by: Benjamin Tissoires
---
tools/testing/selftests/hid/hid_bpf.c | 117
On Fri, Feb 9, 2024 at 4:42 PM Toke Høiland-Jørgensen wrote:
>
> Benjamin Tissoires writes:
>
> > [Putting this as a RFC because I'm pretty sure I'm not doing the things
> > correctly at the BPF level.]
> > [Also using bpf-next as the base tree as there will
On Fri, Feb 9, 2024 at 6:05 PM Toke Høiland-Jørgensen wrote:
>
> Benjamin Tissoires writes:
>
> > On Fri, Feb 9, 2024 at 4:42 PM Toke Høiland-Jørgensen
> > wrote:
> >>
> >> Benjamin Tissoires writes:
> >>
> >> > [Putting th
On Mon, Feb 12, 2024 at 6:46 PM Toke Høiland-Jørgensen wrote:
>
> Benjamin Tissoires writes:
>
> [...]
> >> IIUC, the bpf_timer callback is just a function (subprog) from the
> >> verifier PoV, so it is verified as whatever program type is creating the
> >&g
On Feb 12 2024, Alexei Starovoitov wrote:
> On Mon, Feb 12, 2024 at 10:21 AM Benjamin Tissoires
> wrote:
> >
> > On Mon, Feb 12, 2024 at 6:46 PM Toke Høiland-Jørgensen
> > wrote:
> > >
> > > Benjamin Tissoires writes:
> > >
[...]
> I a
On Feb 13 2024, Kumar Kartikeya Dwivedi wrote:
> On Tue, 13 Feb 2024 at 18:46, Benjamin Tissoires wrote:
> >
> > On Feb 12 2024, Alexei Starovoitov wrote:
> > > On Mon, Feb 12, 2024 at 10:21 AM Benjamin Tissoires
> > > wrote:
> > > >
> > > &g
Fastabend
To: Andrii Nakryiko
To: Martin KaFai Lau
To: Eduard Zingerman
To: Song Liu
To: Yonghong Song
To: KP Singh
To: Stanislav Fomichev
To: Hao Luo
To: Jiri Olsa
To: Jiri Kosina
To: Benjamin Tissoires
To: Jonathan Corbet
To: Shuah Khan
Cc:
Cc:
Cc:
Cc:
Cc:
Signed-off-by: Be
No code change, but it'll allow to have only one place to change
everything when we add in_sleepable in cur_state.
Signed-off-by: Benjamin Tissoires
---
changes in v2 (compared to the one attaches to v1 0/9):
- dropped the cur_state flag, so it can be put first
---
kernel/bpf/verifier.c
They are implemented as a kfunc, which means a little bit of tweaks in
the verifier.
Signed-off-by: Benjamin Tissoires
---
changes in v2 (compared to the one attaches to v1 0/9):
- make use of a kfunc
- add a (non-used) BPF_F_TIMER_SLEEPABLE
- the callback is *not* called, it makes the kernel
commands can be retrieved from the
sleepable trace point.
Signed-off-by: Benjamin Tissoires
---
changes in v2:
- dropped BPF_MAP_TYPE_PROG_ARRAY from the list
---
kernel/bpf/verifier.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index
No code change, just move down the hid_bpf_get_data() kfunc definition
so we have only one block of __bpf_kfunc_start/end_defs()
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
drivers/hid/bpf/hid_bpf_dispatch.c | 80 ++
1 file changed, 38
We currently only export hid_hw_raw_request() as a BPF kfunc.
However, some devices require an explicit write on the Output Report
instead of the use of the control channel.
So also export hid_hw_output_report to BPF
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
Documentation
This time we need to ensure uhid receives it, thus the new mutex and
condition.
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
tools/testing/selftests/hid/hid_bpf.c | 63 ++
tools/testing/selftests/hid/progs/hid.c| 24
device, not
just uhid virtual ones.
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
Documentation/hid/hid-bpf.rst | 2 +-
drivers/hid/bpf/hid_bpf_dispatch.c | 29 +
drivers/hid/hid-core.c | 1 +
include/linux/hid_bpf.h| 2 ++
4
Usual way of testing, we call the function and ensures we receive
the event
Signed-off-by: Benjamin Tissoires
---
no changes in v2
---
tools/testing/selftests/hid/hid_bpf.c | 49 +-
tools/testing/selftests/hid/progs/hid.c| 22
: Benjamin Tissoires
---
new in v2
---
drivers/hid/bpf/hid_bpf_dispatch.c | 15 ++-
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/bpf/hid_bpf_dispatch.c
b/drivers/hid/bpf/hid_bpf_dispatch.c
index e1a650f4a626..275f2057c48d 100644
--- a/drivers/hid/bpf
the ring buffer is there to not have sleeps in userspace
because we have no guarantees of the timing of when those jobs will be
called.
Signed-off-by: Benjamin Tissoires
---
new in v2
---
tools/testing/selftests/hid/hid_bpf.c | 83 +++
tools/testing/selftests/hid/progs
On Feb 14 2024, Benjamin Tissoires wrote:
> They are implemented as a kfunc, which means a little bit of tweaks in
> the verifier.
>
> Signed-off-by: Benjamin Tissoires
>
> ---
>
> changes in v2 (compared to the one attaches to v1 0/9):
> - make use of
On Feb 15 2024, Martin KaFai Lau wrote:
> On 2/14/24 9:18 AM, Benjamin Tissoires wrote:
> > +static void bpf_timer_work_cb(struct work_struct *work)
> > +{
> > + struct bpf_hrtimer *t = container_of(work, struct bpf_hrtimer, work);
> > + struct bpf_map *map = t-&g
On Feb 15 2024, Benjamin Tissoires wrote:
> On Feb 14 2024, Benjamin Tissoires wrote:
> > They are implemented as a kfunc, which means a little bit of tweaks in
> > the verifier.
> >
> > Signed-off-by: Benjamin Tissoires
> >
> > ---
> >
> > ch
On Feb 16 2024, Toke Høiland-Jørgensen wrote:
> Benjamin Tissoires writes:
>
> > On Feb 15 2024, Martin KaFai Lau wrote:
> >> On 2/14/24 9:18 AM, Benjamin Tissoires wrote:
> >> > +static void bpf_timer_work_cb(struct work_struct *work)
> >>
[replying to both of your messages here]
On Wed, Feb 21, 2024 at 3:59 AM Alexei Starovoitov
wrote:
>
> On Fri, Feb 16, 2024 at 10:50:10AM +0100, Benjamin Tissoires wrote:
> > static bool is_rbtree_lock_required_kfunc(u32 btf_id)
> > {
> > return is_bpf
nd
To: Andrii Nakryiko
To: Martin KaFai Lau
To: Eduard Zingerman
To: Song Liu
To: Yonghong Song
To: KP Singh
To: Stanislav Fomichev
To: Hao Luo
To: Jiri Olsa
To: Jiri Kosina
To: Benjamin Tissoires
To: Jonathan Corbet
To: Shuah Khan
Cc:
Cc:
Cc:
Cc:
Cc:
Signed-off-by: Benjamin Tis
commands can be retrieved from the
sleepable trace point.
Signed-off-by: Benjamin Tissoires
---
no changes in v3
changes in v2:
- dropped BPF_MAP_TYPE_PROG_ARRAY from the list
---
kernel/bpf/verifier.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf
No code change, but it'll allow to have only one place to change
everything when we add in_sleepable in cur_state.
Signed-off-by: Benjamin Tissoires
---
no changes in v3
changes in v2 (compared to the one attaches to v1 0/9):
- dropped the cur_state flag, so it can be put first
---
k
Currently we have a special case for BPF_FUNC_timer_set_callback,
let's introduce a helper we can extend for the kfunc that will come in
a later patch
Signed-off-by: Benjamin Tissoires
---
new in v3
---
kernel/bpf/verifier.c | 11 +++
1 file changed, 7 insertions(+), 4 dele
They are implemented as a workqueue, which means that there are no
guarantees of timing nor ordering.
Signed-off-by: Benjamin Tissoires
---
changes in v3:
- extracted the implementation in bpf_timer only, without
bpf_timer_set_sleepable_cb()
- rely on schedule_work() only, from
We need to extend the bpf_timer API, but the way forward relies on kfuncs.
So make bpf_timer known for kfuncs from the verifier PoV
Signed-off-by: Benjamin Tissoires
---
new in v3 (split from v2 02/10)
---
kernel/bpf/verifier.c | 36
1 file changed, 36
teach the verifier
about its attached callback.
Marking that callback as sleepable will be done in a separate patch
Signed-off-by: Benjamin Tissoires
---
new in v3 (split from v2 02/10)
---
kernel/bpf/helpers.c | 48 ++--
kernel/bpf/verifier.c | 31
Now that we have bpf_timer_set_sleepable_cb() available and working, we
can tag the attached callback as sleepable, and let the verifier check
in the correct context the calls and kfuncs.
Signed-off-by: Benjamin Tissoires
---
new in v3 (split from v2 02/10)
---
include/linux/bpf_verifier.h
This is still a WIP, but I think this can be dropped as we never
get to this instruction. So what should we do here?
Signed-off-by: Benjamin Tissoires
---
kernel/bpf/verifier.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
No code change, just move down the hid_bpf_get_data() kfunc definition
so we have only one block of __bpf_kfunc_start/end_defs()
Signed-off-by: Benjamin Tissoires
---
no changes in v3
no changes in v2
---
drivers/hid/bpf/hid_bpf_dispatch.c | 80 ++
1 file
We currently only export hid_hw_raw_request() as a BPF kfunc.
However, some devices require an explicit write on the Output Report
instead of the use of the control channel.
So also export hid_hw_output_report to BPF
Signed-off-by: Benjamin Tissoires
---
no changes in v3
no changes in v2
This time we need to ensure uhid receives it, thus the new mutex and
condition.
Signed-off-by: Benjamin Tissoires
---
no changes in v3
no changes in v2
---
tools/testing/selftests/hid/hid_bpf.c | 63 ++
tools/testing/selftests/hid/progs/hid.c| 24
device, not
just uhid virtual ones.
Signed-off-by: Benjamin Tissoires
---
no changes in v3
no changes in v2
---
Documentation/hid/hid-bpf.rst | 2 +-
drivers/hid/bpf/hid_bpf_dispatch.c | 29 +
drivers/hid/hid-core.c | 1 +
include/linux/hid_bpf.h
Usual way of testing, we call the function and ensures we receive
the event
Signed-off-by: Benjamin Tissoires
---
no changes in v3
no changes in v2
---
tools/testing/selftests/hid/hid_bpf.c | 49 +-
tools/testing/selftests/hid/progs/hid.c| 22
: Benjamin Tissoires
---
no changes in v3
new in v2
---
drivers/hid/bpf/hid_bpf_dispatch.c | 15 ++-
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/bpf/hid_bpf_dispatch.c
b/drivers/hid/bpf/hid_bpf_dispatch.c
index e1a650f4a626..275f2057c48d 100644
--- a/drivers
the ring buffer is there to not have sleeps in userspace
because we have no guarantees of the timing of when those jobs will be
called.
Signed-off-by: Benjamin Tissoires
---
changes in v3:
- amended for the new API changes in v3
new in v2
---
tools/testing/selftests/hid/hid_bpf.c
It's always a good idea to have KASAN in tests.
Signed-off-by: Benjamin Tissoires
---
new in v3
---
tools/testing/selftests/hid/config.common | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/hid/config.common
b/tools/testing/selftests/hid/config.common
On Feb 21 2024, Benjamin Tissoires wrote:
> They are implemented as a workqueue, which means that there are no
> guarantees of timing nor ordering.
>
> Signed-off-by: Benjamin Tissoires
>
> ---
>
> changes in v3:
> - extracted the implementation
Hi,
On Feb 23 2024, Eduard Zingerman wrote:
> On Wed, 2024-02-21 at 17:25 +0100, Benjamin Tissoires wrote:
> > [Partly a RFC/formal submission: there are still FIXMEs in the code]
> > [Also using bpf-next as the base tree for HID changes as there will
> > be conflicting chan
On Feb 22 2024, Eduard Zingerman wrote:
> On Wed, 2024-02-21 at 17:25 +0100, Benjamin Tissoires wrote:
>
> [...]
>
> > diff --git a/drivers/hid/bpf/hid_bpf_dispatch.c
> > b/drivers/hid/bpf/hid_bpf_dispatch.c
> > index e630caf644e8..52abb27426f4 10
On Feb 22 2024, Alexei Starovoitov wrote:
> On Wed, Feb 21, 2024 at 8:25 AM Benjamin Tissoires wrote:
> > @@ -18193,7 +18198,7 @@ static int resolve_pseudo_ldimm64(struct
> > bpf_verifier_env *env)
> >
On Feb 23 2024, Eduard Zingerman wrote:
> On Wed, 2024-02-21 at 17:25 +0100, Benjamin Tissoires wrote:
>
> [...]
>
> > @@ -1282,7 +1333,7 @@ BPF_CALL_3(bpf_timer_start, struct bpf_timer_kern *,
> > timer, u64, nsecs, u64, fla
> >
> > if (in_nmi()
On Feb 23 2024, Eduard Zingerman wrote:
> On Wed, 2024-02-21 at 17:25 +0100, Benjamin Tissoires wrote:
> > This is still a WIP, but I think this can be dropped as we never
> > get to this instruction. So what should we do here?
>
> As Alexei replied in a separate sub-thread y
On Tue, Feb 27, 2024 at 5:36 PM Eduard Zingerman wrote:
>
> On Tue, 2024-02-27 at 17:18 +0100, Benjamin Tissoires wrote:
> [...]
>
> > Hmm, I must still be missing a piece of the puzzle:
> > if I declare bpf_timer_set_sleepable_cb() to take a third "aux"
> >
On Wed, Feb 28, 2024 at 2:49 AM Alexei Starovoitov
wrote:
>
> On Tue, Feb 27, 2024 at 8:51 AM Benjamin Tissoires
> wrote:
> >
> > On Tue, Feb 27, 2024 at 5:36 PM Eduard Zingerman wrote:
> > >
> > > On Tue, 2024-02-27 at 17:18 +0100, Benjamin Tissoires
german
To: Song Liu
To: Yonghong Song
To: John Fastabend
To: KP Singh
To: Stanislav Fomichev
To: Hao Luo
To: Jiri Olsa
To: Mykola Lysenko
To: Shuah Khan
Cc: Benjamin Tissoires
Cc:
Cc:
Cc:
---
Changes in v4:
- dropped the HID changes, they can go independently from bpf-core
- addresse
They are implemented as a workqueue, which means that there are no
guarantees of timing nor ordering.
Signed-off-by: Benjamin Tissoires
---
changes in v4:
- dropped __bpf_timer_compute_key()
- use a spin_lock instead of a semaphore
- ensure bpf_timer_cancel_and_free is not complaining about
We need to extend the bpf_timer API, but the way forward relies on kfuncs.
So make bpf_timer known for kfuncs from the verifier PoV
Signed-off-by: Benjamin Tissoires
---
changes in v4:
- enforce KF_ARG_PTR_TO_TIMER to be of type PTR_TO_MAP_VALUE
new in v3 (split from v2 02/10)
---
kernel/bpf
1 - 100 of 346 matches
Mail list logo