Re: [RFC PATCH v5 23/29] KVM: selftests: TDX: Add shared memory test

2024-03-15 Thread Chen, Zide
On 12/12/2023 12:47 PM, Sagi Shahar wrote: > > > -Original Message- > From: Sagi Shahar > Sent: Tuesday, December 12, 2023 12:47 PM > To: linux-kselftest@vger.kernel.org; Ackerley Tng ; > Afranji, Ryan ; Aktas, Erdem ; > Sagi Shahar ; Yamahata, Isaku > Cc: Sean Christopherson ; Pa

Re: [RFC PATCH v5 22/29] KVM: selftests: Add functions to allow mapping as shared

2024-03-15 Thread Chen, Zide
On 12/12/2023 12:47 PM, Sagi Shahar wrote: > > > -Original Message- > From: Sagi Shahar > Sent: Tuesday, December 12, 2023 12:47 PM > To: linux-kselftest@vger.kernel.org; Ackerley Tng ; > Afranji, Ryan ; Aktas, Erdem ; > Sagi Shahar ; Yamahata, Isaku > Cc: Sean Christopherson ; P

Re: [PATCH v3] kunit: tool: add ability to parse multiple files

2024-03-15 Thread Daniel Latypov
On Thu, Mar 7, 2024 at 2:29 PM Rae Moar wrote: > > Add ability to parse multiple files. Additionally add the > ability to parse all results in the KUnit debugfs repository. > > How to parse multiple files: > > ./tools/testing/kunit/kunit.py parse results.log results2.log > > How to parse all files

Re: [PATCH bpf-next 1/2] bpf: add btf_task_get_cgroup_id kfunc

2024-03-15 Thread Jose Fernandez
On 24/03/15 11:50AM, Stanislav Fomichev wrote: > On 03/15, Jose Fernandez wrote: > > This patch enhances the BPF helpers by adding a kfunc to retrieve the > > cgroup v2 ID of a specific task, addressing a previous limitation where > > only bpf_task_get_cgroup1 was available for cgroup v1. The new k

Re: [PATCH bpf-next 1/2] bpf: add btf_task_get_cgroup_id kfunc

2024-03-15 Thread Stanislav Fomichev
On 03/15, Jose Fernandez wrote: > This patch enhances the BPF helpers by adding a kfunc to retrieve the > cgroup v2 ID of a specific task, addressing a previous limitation where > only bpf_task_get_cgroup1 was available for cgroup v1. The new kfunc is > particularly useful for scenarios where obtai

[PATCH bpf-next 2/2] selftests/bpf: add selftest for btf_task_get_cgroup_id

2024-03-15 Thread Jose Fernandez
This patch adds a selftest for the `bpf_task_get_cgroup_id` kfunc. The test focuses on the use case of obtaining the cgroup ID of the previous task in a `sched_switch` tracepoint. The selftest involves creating a test cgroup, attaching a BPF program that utilizes the `bpf_task_get_cgroup_id` durin

[PATCH bpf-next 1/2] bpf: add btf_task_get_cgroup_id kfunc

2024-03-15 Thread Jose Fernandez
This patch enhances the BPF helpers by adding a kfunc to retrieve the cgroup v2 ID of a specific task, addressing a previous limitation where only bpf_task_get_cgroup1 was available for cgroup v1. The new kfunc is particularly useful for scenarios where obtaining the cgroup ID of a task other than

Re: [PATCH 4/4] selftests/resctrl: Adjust SNC support messages

2024-03-15 Thread James Morse
Hi Tony, On 08/03/2024 18:42, Tony Luck wrote: > On Fri, Mar 08, 2024 at 06:06:45PM +, James Morse wrote: >> Hi guys, >> >> On 07/03/2024 23:16, Tony Luck wrote: >>> On Thu, Mar 07, 2024 at 02:39:08PM -0800, Reinette Chatre wrote: Thank you for the example. I find that significantly easie

Re: [PATCH v4 2/7] HID: bpf: export hid_hw_output_report as a BPF kfunc

2024-03-15 Thread Randy Dunlap
On 3/15/24 07:44, Benjamin Tissoires wrote: > +/** > + * hid_bpf_hw_output_report - Send an output report to a HID device > + * > + * @ctx: the HID-BPF context previously allocated in > hid_bpf_allocate_context() > + * @buf: a %PTR_TO_MEM buffer > + * @buf__sz: the size of the data to transfer

Re: [PATCH v4 5/7] HID: bpf: allow to inject HID event from BPF

2024-03-15 Thread Randy Dunlap
On 3/15/24 07:44, Benjamin Tissoires wrote: > It can be interesting to inject events from BPF as if the event were > to come from the device. > For example, some multitouch devices do not all the time send a proximity > out event, and we might want to send it for the physical device. > > Compar

[PATCH v4 7/7] HID: bpf: allow to use bpf_timer_set_sleepable_cb() in tracing callbacks.

2024-03-15 Thread Benjamin Tissoires
Export the sleepable kfuncs we have on HID-BPF in tracing bpf programs, but with the condition of being used in a sleepable context. This allows to use the bpf_timer when used in a sleepable context through bpf_timer_set_sleepable_cb() and initiate work from a device event. Signed-off-by: Benjamin

[PATCH v4 6/7] selftests/hid: add tests for hid_bpf_input_report

2024-03-15 Thread Benjamin Tissoires
Usual way of testing, we call the function and ensures we receive the event Signed-off-by: Benjamin Tissoires --- no changes in v4 no changes in v3 no changes in v2 --- tools/testing/selftests/hid/hid_bpf.c | 49 +- tools/testing/selftests/hid/progs/hid.c

[PATCH v4 5/7] HID: bpf: allow to inject HID event from BPF

2024-03-15 Thread Benjamin Tissoires
It can be interesting to inject events from BPF as if the event were to come from the device. For example, some multitouch devices do not all the time send a proximity out event, and we might want to send it for the physical device. Compared to uhid, we can now inject events on any physical device

[PATCH v4 4/7] selftests/hid: Add test for hid_bpf_hw_output_report

2024-03-15 Thread Benjamin Tissoires
This time we need to ensure uhid receives it, thus the new mutex and condition. Signed-off-by: Benjamin Tissoires --- no changes in v4 no changes in v3 no changes in v2 --- tools/testing/selftests/hid/hid_bpf.c | 63 ++ tools/testing/selftests/hid/progs/hid.c

[PATCH v4 3/7] selftests/hid: add KASAN to the VM tests

2024-03-15 Thread Benjamin Tissoires
It's always a good idea to have KASAN in tests. Signed-off-by: Benjamin Tissoires --- no changes in v4 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.co

[PATCH v4 2/7] HID: bpf: export hid_hw_output_report as a BPF kfunc

2024-03-15 Thread Benjamin Tissoires
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 v4 no changes in v3 no

[PATCH v4 1/7] HID: bpf/dispatch: regroup kfuncs definitions

2024-03-15 Thread Benjamin Tissoires
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 v4 no changes in v3 no changes in v2 --- drivers/hid/bpf/hid_bpf_dispatch.c | 80 ++

[PATCH v4 0/7] Extend HID-BPF kfuncs (was: allow HID-BPF to do device IOs)

2024-03-15 Thread Benjamin Tissoires
New version of the sleepable bpf_timer code, without BPF changes, as they can now go through the HID tree independantly: https://lore.kernel.org/all/20240315-hid-bpf-sleepable-v4-0-5658f2540...@kernel.org/ For reference, the use cases I have in mind: --- Basically, I need to be able to defer a

[PATCH] KVM: selftests: fix max_guest_memory_test with more that 256 vCPUs

2024-03-15 Thread Maxim Levitsky
max_guest_memory_test uses ucalls to sync with the host, but it also resets the guest RIP back to its initial value in between tests stages. This makes the guest never reach the code which frees the ucall struct and since a fixed pool of 512 ucall structs is used, the test starts to fail when more

[PATCH bpf-next v4 6/6] selftests/bpf: add sleepable timer tests

2024-03-15 Thread Benjamin Tissoires
bpf_experimental.h and ../bpf_testmod/bpf_testmod_kfunc.h are both including vmlinux.h, which is not compatible with including time.h or bpf_tcp_helpers.h. So prevent vmlinux.h to be included, and override the few missing types. Signed-off-by: Benjamin Tissoires --- new in v4 --- tools/testin

[PATCH bpf-next v4 5/6] tools: sync include/uapi/linux/bpf.h

2024-03-15 Thread Benjamin Tissoires
cp include/uapi/linux/bpf.h tools/include/uapi/linux/bpf.h Signed-off-by: Benjamin Tissoires --- new in v4 --- tools/include/uapi/linux/bpf.h | 4 1 file changed, 4 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 3c42b9f1bada..b90def29d796

[PATCH bpf-next v4 4/6] bpf/helpers: mark the callback of bpf_timer_set_sleepable_cb() as sleepable

2024-03-15 Thread Benjamin Tissoires
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 --- changes in v4: - use a function parameter to forward the sleepable in

[PATCH bpf-next v4 3/6] bpf/helpers: introduce bpf_timer_set_sleepable_cb() kfunc

2024-03-15 Thread Benjamin Tissoires
In this patch, bpf_timer_set_sleepable_cb() is functionally equivalent to bpf_timer_set_callback(), to the exception that it enforces the timer to be started with BPF_F_TIMER_SLEEPABLE. But given that bpf_timer_set_callback() is a helper when bpf_timer_set_sleepable_cb() is a kfunc, we need to tea

[PATCH bpf-next v4 2/6] bpf/verifier: add bpf_timer as a kfunc capable type

2024-03-15 Thread Benjamin Tissoires
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/

[PATCH bpf-next v4 1/6] bpf/helpers: introduce sleepable bpf_timers

2024-03-15 Thread Benjamin Tissoires
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 no

[PATCH bpf-next v4 0/6] sleepable bpf_timer (was: allow HID-BPF to do device IOs)

2024-03-15 Thread Benjamin Tissoires
New version of the sleepable bpf_timer code, without the HID changes, as they can now go through the HID tree independantly. For reference, the use cases I have in mind: --- Basically, I need to be able to defer a HID-BPF program for the following reasons (from the aforementioned patch): 1. defe

Re: [PATCH][next] selftests/bpf: Remove second semicolon

2024-03-15 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann : On Fri, 15 Mar 2024 09:26:54 + you wrote: > There are statements with two semicolons. Remove the second one, it > is redundant. > > Signed-off-by: Colin Ian King > --- > tools/testing/selftests/bpf/benchs/bench

Re: [PATCH 10/14] parisc: Add support for suppressing warning backtraces

2024-03-15 Thread Helge Deller
On 3/12/24 18:03, Guenter Roeck wrote: Add name of functions triggering warning backtraces to the __bug_table object section to enable support for suppressing WARNING backtraces. To limit image size impact, the pointer to the function name is only added to the __bug_table section if both CONFIG_

[PATCH][next] KVM: selftests: Remove second semicolon

2024-03-15 Thread Colin Ian King
There is a statement with two semicolons. Remove the second one, it is redundant. Signed-off-by: Colin Ian King --- tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c b/too

[PATCH][next] selftests/bpf: Remove second semicolon

2024-03-15 Thread Colin Ian King
There are statements with two semicolons. Remove the second one, it is redundant. Signed-off-by: Colin Ian King --- tools/testing/selftests/bpf/benchs/bench_local_storage_create.c | 2 +- tools/testing/selftests/bpf/progs/iters.c | 2 +- 2 files changed, 2 insertions(+), 2

Re: [External] Re: [PATCH bpf-next v2 1/9] bpf: tracing: add support to record and check the accessed args

2024-03-15 Thread 梦龙董
On Thu, Mar 14, 2024 at 2:29 PM Jiri Olsa wrote: > > On Wed, Mar 13, 2024 at 05:25:35PM -0700, Alexei Starovoitov wrote: > > On Tue, Mar 12, 2024 at 6:53 PM 梦龙董 wrote: > > > > > > On Wed, Mar 13, 2024 at 12:42 AM Alexei Starovoitov > > > wrote: > > > > > > > > On Mon, Mar 11, 2024 at 7:42 PM 梦龙董

Re: [External] Re: [PATCH bpf-next v2 1/9] bpf: tracing: add support to record and check the accessed args

2024-03-15 Thread 梦龙董
On Thu, Mar 14, 2024 at 8:27 AM Alexei Starovoitov wrote: > > On Tue, Mar 12, 2024 at 6:53 PM 梦龙董 wrote: [..] > > What does "a hundred attachments max" means? Can't I > > trace thousands of kernel functions with a bpf program of > > tracing multi-link? > > I mean what time does it take to att

Re: [PATCH] KVM: selftests: Use TAP in the steal_time test

2024-03-15 Thread Thomas Huth
On 11/12/2023 10.39, Thomas Huth wrote: On 19/10/2023 15.13, Andrew Jones wrote: On Thu, Oct 19, 2023 at 11:59:00AM +0200, Thomas Huth wrote: For easier use of the tests in automation and for having some status information for the user while the test is running, let's provide some TAP output in