Re: [PATCH v2 01/13] selftests/resctrl: Convert get_mem_bw_imc() fd close to for loop

2024-03-22 Thread Ilpo Järvinen
On Tue, 19 Mar 2024, Reinette Chatre wrote: > On 3/11/2024 6:52 AM, Ilpo Järvinen wrote: > > The open() side handles fds in a for loop but close() is based on two > > fixed indexes READ and WRITE. > > > > Match the close() side with the open() side by using for loop for > > consistency. > > I fin

Re: [PATCH v2 01/13] selftests/resctrl: Convert get_mem_bw_imc() fd close to for loop

2024-03-22 Thread Ilpo Järvinen
On Fri, 22 Mar 2024, Ilpo Järvinen wrote: > On Tue, 19 Mar 2024, Reinette Chatre wrote: > > On 3/11/2024 6:52 AM, Ilpo Järvinen wrote: > > > The open() side handles fds in a for loop but close() is based on two > > > fixed indexes READ and WRITE. > > > > > > Match the close() side with the open()

[PATCH] selftests/mm: Parse VMA range in one go

2024-03-22 Thread Dev Jain
Use sscanf() to directly parse the VMA range. No functional change is intended. Signed-off-by: Dev Jain --- tools/testing/selftests/mm/mlock2-tests.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/tools/testing/selftests/mm/mlock2-tests.c b/tools/testing/sel

Re: [PATCH v2 02/13] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-03-22 Thread Ilpo Järvinen
On Tue, 19 Mar 2024, Reinette Chatre wrote: > On 3/11/2024 6:52 AM, Ilpo Järvinen wrote: > > For MBM/MBA tests, measure_vals() calls get_mem_bw_imc() that performs > > the measurement over a duration of sleep(1) call. The memory bandwidth > > numbers from IMC are derived over this duration. The res

Re: [PATCH v2 08/13] selftests/resctrl: Add ->init() callback into resctrl_val_param

2024-03-22 Thread Ilpo Järvinen
On Tue, 19 Mar 2024, Reinette Chatre wrote: > On 3/11/2024 6:52 AM, Ilpo Järvinen wrote: > > The struct resctrl_val_param is there to customize behavior inside > > resctrl_val() which is currently not used to full extent and there are > > number of strcmp()s for test name in resctrl_val done by res

Re: [PATCH v2 11/13] selftests/resctrl: Convert ctrlgrp & mongrp to pointers

2024-03-22 Thread Ilpo Järvinen
On Wed, 20 Mar 2024, Reinette Chatre wrote: > On 3/11/2024 6:52 AM, Ilpo Järvinen wrote: > > The struct resctrl_val_param has control and monitor groups as char > > arrays but they are not supposed to be mutated within resctrl_val(). > > > > Convert the ctrlgrp and mongrp char array within resctrl

[PATCH bpf] selftests/bpf: verifier_arena: fix mmap address for arm64

2024-03-22 Thread Puranjay Mohan
The arena_list selftest uses (1ull << 32) in the mmap address computation for arm64. Use the same in the verifier_arena selftest. This makes the selftest pass for arm64 on the CI[1]. [1] https://github.com/kernel-patches/bpf/pull/6622 Signed-off-by: Puranjay Mohan --- tools/testing/selftests/b

Re: [PATCH v3 1/3] riscv: mm: Use hint address in mmap if available

2024-03-22 Thread Palmer Dabbelt
On Thu, 01 Feb 2024 18:28:06 PST (-0800), Charlie Jenkins wrote: On Wed, Jan 31, 2024 at 11:59:43PM +0800, Yangyu Chen wrote: On Wed, 2024-01-31 at 22:41 +0800, Yangyu Chen wrote: > On Tue, 2024-01-30 at 17:07 -0800, Charlie Jenkins wrote: > > On riscv it is guaranteed that the address returned

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

2024-03-22 Thread Benjamin Tissoires
New version of the sleepable bpf_timer code, without the HID changes, as they can now go through the HID tree indepandantly. 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

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

2024-03-22 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 --- no changes in v5 changes in v4: - dropped __bpf_timer_compute_key() - use a spin_lock instead of a semaphore - ensure bpf_timer_cancel_and_free is not com

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

2024-03-22 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 v5: - also check for the reg offset changes in v4: - enforce KF_ARG_PTR_TO_TIMER to be of type PTR_TO_MAP_VALUE

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

2024-03-22 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 v5 4/6] bpf/helpers: mark the callback of bpf_timer_set_sleepable_cb() as sleepable

2024-03-22 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 --- no changes in v5 changes in v4: - use a function parameter to forwar

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

2024-03-22 Thread Benjamin Tissoires
cp include/uapi/linux/bpf.h tools/include/uapi/linux/bpf.h Signed-off-by: Benjamin Tissoires --- no changes in v5 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 3c42b9f1

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

2024-03-22 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 keep sleepable tests in a separate bpf source file. The first correct test is run twice for convenience: - first through RUN_TESTS - then

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

2024-03-22 Thread Benjamin Tissoires
On Fri, Mar 15, 2024 at 5:06 PM Randy Dunlap wrote: > > > > 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:

Re: [PATCH v1 5/5] selftests: KVM: SVM: Add Idle HLT intercept test

2024-03-22 Thread Manali Shukla
On 3/14/2024 8:36 PM, Sean Christopherson wrote: > On Thu, Mar 14, 2024, Manali Shukla wrote: +#define VINTR_VECTOR 0x30 +#define NUM_ITERATIONS 10 >>> >>> What's the runtime? If it's less than a second, then whatever, but if it's >>> at >>> all longer than that, then I'd prefer

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

2024-03-22 Thread bentiss
From: 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 keep sleepable tests in a separate bpf source file. The first correct test is run twice for convenience: - firs

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

2024-03-22 Thread Kumar Kartikeya Dwivedi
On Fri, 22 Mar 2024 at 15:57, Benjamin Tissoires wrote: > > 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 v5: > - also check for the reg offset > >

[PATCH] selftests/rseq: take large C-state exit latency into consideration

2024-03-22 Thread Zide Chen
Currently, the migration worker delays 1-10 us, assuming that one KVM_RUN iteration only takes a few microseconds. But if C-state exit latencies are large enough, for example, hundreds or even thousands of microseconds on server CPUs, it may happen that it's not able to bring the target CPU out of

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

2024-03-22 Thread Kumar Kartikeya Dwivedi
On Fri, 22 Mar 2024 at 15:57, Benjamin Tissoires wrote: > > 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

Re: [RFC PATCH net-next v6 02/15] net: page_pool: create hooks for custom page providers

2024-03-22 Thread Mina Almasry
Hi Christoph, Sorry for the late reply, I've been out for a few days. On Mon, Mar 18, 2024 at 4:22 PM Christoph Hellwig wrote: > > On Sun, Mar 17, 2024 at 07:49:43PM -0700, David Wei wrote: > > I'm working on a similar proposal for zero copy Rx but to host memory > > and depend on this memory pr

Re: [PATCH v2 02/13] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-03-22 Thread Reinette Chatre
Hi Ilpo, On 3/22/2024 5:11 AM, Ilpo Järvinen wrote: > On Tue, 19 Mar 2024, Reinette Chatre wrote: >> On 3/11/2024 6:52 AM, Ilpo Järvinen wrote: >>> -static int get_mem_bw_imc(int cpu_no, char *bw_report, float *bw_imc) >>> +static int perf_open_imc_mem_bw(int cpu_no) >>> { >>> - float reads,

Re: [PATCH v2 11/13] selftests/resctrl: Convert ctrlgrp & mongrp to pointers

2024-03-22 Thread Reinette Chatre
Hi Ilpo, On 3/22/2024 5:30 AM, Ilpo Järvinen wrote: > On Wed, 20 Mar 2024, Reinette Chatre wrote: >> On 3/11/2024 6:52 AM, Ilpo Järvinen wrote: >>> The struct resctrl_val_param has control and monitor groups as char >>> arrays but they are not supposed to be mutated within resctrl_val(). >>> >>> C

Re: [RFC PATCH net-next v6 02/15] net: page_pool: create hooks for custom page providers

2024-03-22 Thread Mina Almasry
On Sun, Mar 17, 2024 at 7:03 PM Christoph Hellwig wrote: > > On Mon, Mar 04, 2024 at 06:01:37PM -0800, Mina Almasry wrote: > > From: Jakub Kicinski > > > > The page providers which try to reuse the same pages will > > need to hold onto the ref, even if page gets released from > > the pool - as in

Re: [PATCH] selftests/mm: Confirm VA exhaustion without reliance on correctness of mmap()

2024-03-22 Thread Andrew Morton
On Fri, 22 Mar 2024 10:42:47 +0530 Dev Jain wrote: > > On 3/22/24 03:21, Andrew Morton wrote: > > On Thu, 21 Mar 2024 16:05:22 +0530 Dev Jain wrote: > > > >> Currently, VA exhaustion is being checked by passing a hint to mmap() and > >> expecting it to fail. This patch makes a stricter test by

Re: [PATCH] selftests: livepatch: Test atomic replace against multiple modules

2024-03-22 Thread Marcos Paulo de Souza
On Thu, 2024-03-21 at 10:08 -0400, Joe Lawrence wrote: > On 3/12/24 08:12, Marcos Paulo de Souza wrote: > > This new test checks if a livepatch with replace attribute set > > replaces > > all previously applied livepatches. > > > > Signed-off-by: Marcos Paulo de Souza > > --- > >  tools/testing/s

Re: [RFC PATCH v5 08/29] KVM: selftests: TDX: Add TDX lifecycle test

2024-03-22 Thread Chen, Zide
On 12/12/2023 12:46 PM, Sagi Shahar wrote: > From: Erdem Aktas > > Adding a test to verify TDX lifecycle by creating a TD and running a > dummy TDG.VP.VMCALL inside it. > > Signed-off-by: Erdem Aktas > Signed-off-by: Ryan Afranji > Signed-off-by: Sagi Shahar > Co-developed-by: Ackerley Tn

Re: [RFC PATCH net-next v6 02/15] net: page_pool: create hooks for custom page providers

2024-03-22 Thread Jakub Kicinski
On Fri, 22 Mar 2024 10:40:26 -0700 Mina Almasry wrote: > Other designs for this hugepage use case are possible, I'm just > describing Jakub's idea for it as a potential use-case for these > hooks. I made it ops because I had 4 different implementations with different recycling algorithms. I think

Re: [PATCH bpf] selftests/bpf: verifier_arena: fix mmap address for arm64

2024-03-22 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov : On Fri, 22 Mar 2024 13:35:52 + you wrote: > The arena_list selftest uses (1ull << 32) in the mmap address > computation for arm64. Use the same in the verifier_arena selftest. > > This makes the selftest pass for a

Re: [PATCH] kunit: bail out early in __kunit_test_suites_init() if there are no suites to test

2024-03-22 Thread David Gow
On Thu, 21 Mar 2024 at 22:32, Scott Mayhew wrote: > > Commit c72a870926c2 added a mutex to prevent kunit tests from running > concurrently. Unfortunately that mutex gets locked during module load > regardless of whether the module actually has any kunit tests. This > causes a problem for kunit t