[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221025225219.i3pi7ewue6xqeig4@macbook-pro-4.dhcp.thefacebook.com>
Date: Tue, 25 Oct 2022 15:52:19 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Benjamin Tissoires <benjamin.tissoires@...hat.com>
Cc: Greg KH <gregkh@...uxfoundation.org>,
Jiri Kosina <jikos@...nel.org>,
Jonathan Corbet <corbet@....net>,
Shuah Khan <shuah@...nel.org>,
Tero Kristo <tero.kristo@...ux.intel.com>,
linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
bpf@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-doc@...r.kernel.org
Subject: Re: [PATCH hid v11 02/14] HID: initial BPF implementation
On Tue, Oct 25, 2022 at 11:34:46AM +0200, Benjamin Tissoires wrote:
> include/linux/hid.h | 5 +
> include/linux/hid_bpf.h | 102 +++
> include/uapi/linux/hid_bpf.h | 25 +
> tools/include/uapi/linux/hid.h | 62 ++
> tools/include/uapi/linux/hid_bpf.h | 25 +
...
> +++ b/include/linux/hid_bpf.h
> @@ -0,0 +1,102 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +
> +#ifndef __HID_BPF_H
> +#define __HID_BPF_H
> +
> +#include <linux/spinlock.h>
> +#include <uapi/linux/hid.h>
> +#include <uapi/linux/hid_bpf.h>
> +
> +struct hid_device;
> +
> +/*
> + * The following is the HID BPF API.
> + *
> + * It should be treated as UAPI, so extra care is required
> + * when making change to this file.
> + */
I thought at the maintainer summit we discussed that it shouldn't be
treated as uapi. There is no need to draw this line right now.
If the whole concept turns out to be useful and api is stable
then promote it.
> +++ b/include/uapi/linux/hid_bpf.h
> @@ -0,0 +1,25 @@
> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
> +
> +#ifndef _UAPI_HID_BPF_H
> +#define _UAPI_HID_BPF_H
> +
> +#include <linux/const.h>
> +#include <linux/hid.h>
> +
> +/**
> + * enum hid_bpf_attach_flags - flags used when attaching a HIF-BPF program
> + *
> + * @HID_BPF_FLAG_NONE: no specific flag is used, the kernel choses where to
> + * insert the program
> + * @HID_BPF_FLAG_INSERT_HEAD: insert the given program before any other program
> + * currently attached to the device. This doesn't
> + * guarantee that this program will always be first
> + * @HID_BPF_FLAG_MAX: sentinel value, not to be used by the callers
> + */
> +enum hid_bpf_attach_flags {
> + HID_BPF_FLAG_NONE = 0,
> + HID_BPF_FLAG_INSERT_HEAD = _BITUL(0),
> + HID_BPF_FLAG_MAX,
> +};
> +
> +#endif /* _UAPI_HID_BPF_H */
Not sure what is the purpose of this uapi file.
Since it's enum the progs can get it from vmlinux.h.
> diff --git a/tools/include/uapi/linux/hid.h b/tools/include/uapi/linux/hid.h
> new file mode 100644
> index 000000000000..3e63bea3b3e2
> --- /dev/null
> +++ b/tools/include/uapi/linux/hid.h
> @@ -0,0 +1,62 @@
> +/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
> +/*
> + * Copyright (c) 1999 Andreas Gal
> + * Copyright (c) 2000-2001 Vojtech Pavlik
> + * Copyright (c) 2006-2007 Jiri Kosina
> + */
> +#ifndef _UAPI__HID_H
> +#define _UAPI__HID_H
This is a copy of include/uapi/linux/hid.h ?
Probably should be a separate commit to make it obvious.
Powered by blists - more mailing lists