Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-16 Thread Peter Zijlstra
On Tue, Apr 16, 2024 at 04:18:24PM -0500, Elizabeth Figura wrote: > Is the concern about poor performance when ntsync is in use, or is nesting a > lot of spinlocks like that something that could cause problems for unrelated > tasks? I'm not familiar enough with the scheduler to know if this can

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-16 Thread Peter Zijlstra
On Tue, Apr 16, 2024 at 04:18:19PM -0500, Elizabeth Figura wrote: > Let me know if that's good enough or if I should try to render it into plain > text somehow. Plain text is much preferred. I'm more of a text editor kinda guy -- being a programmer and all that. > >

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-16 Thread Peter Zijlstra
On Tue, Apr 16, 2024 at 04:18:17PM -0500, Elizabeth Figura wrote: > Over different lists. I don't know if there's a better way to name things to > make that clearer. D'oh, reading hard. I'll stare more.

Re: [PATCH 1/4] selftests/arm: Add mm test

2024-04-16 Thread Dev Jain
On 4/10/24 09:45, Dev Jain wrote: On 4/7/24 02:53, Muhammad Usama Anjum wrote: On 4/5/24 1:44 PM, Dev Jain wrote: This patch tests the 4GB VA restriction for 32-bit processes; it is required to test the compat layer, whether the kernel knows that it is running a 32-bit process or not.

Re: [PATCH 02/19] riscv: cpufeature: Fix thead vector hwcap removal

2024-04-16 Thread Charlie Jenkins
On Tue, Apr 16, 2024 at 08:36:33AM +0100, Conor Dooley wrote: > On Mon, Apr 15, 2024 at 08:34:05PM -0700, Charlie Jenkins wrote: > > On Sat, Apr 13, 2024 at 12:40:26AM +0100, Conor Dooley wrote: > > > On Fri, Apr 12, 2024 at 02:31:42PM -0700, Charlie Jenkins wrote: > > > > On Fri, Apr 12, 2024 at

Re: [PATCH net-next v2 0/6] selftests: drv-net: support testing with a remote system

2024-04-16 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Mon, 15 Apr 2024 17:45:50 -0700 you wrote: > Hi! > > Implement support for tests which require access to a remote system / > endpoint which can generate traffic. > This series concludes the "groundwork" for

Re: [PATCH] selftests: Mark ksft_exit_fail_perror() as __noreturn

2024-04-16 Thread Shuah Khan
On 4/15/24 09:41, Nathan Chancellor wrote: On Sun, Apr 14, 2024 at 11:26:53AM +0500, Muhammad Usama Anjum wrote: Let the compilers (clang) know that this function would just call exit() and would never return. It is needed to avoid false positive static analysis errors. All similar functions

Re: [PATCH net-next v2 0/6] selftests: drv-net: support testing with a remote system

2024-04-16 Thread Jakub Kicinski
On Tue, 16 Apr 2024 11:07:08 -0400 Willem de Bruijn wrote: > Thanks for humoring the naming suggestions. Exciting to have this infra. I wrote a couple more tests today and as you predicted already needed wait_port_listen()... I also discovered a few sharp edges with the way the commands are

[PATCH V3] KVM: selftests: Add a new option to rseq_test

2024-04-16 Thread Zide Chen
Currently, the migration worker delays 1-10 us, assuming that one KVM_RUN iteration only takes a few microseconds. But if the CPU low power wakeup latency is large enough, for example, hundreds or even thousands of microseconds deep C-state exit latencies on x86 server CPUs, it may happen that

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-16 Thread Elizabeth Figura
On Tuesday, 16 April 2024 16:18:24 CDT Elizabeth Figura wrote: > On Tuesday, 16 April 2024 03:14:21 CDT Peter Zijlstra wrote: > > I don't support GE has it in his builds? Last time I tried, building > > Wine was a bit of a pain. > > It doesn't seem so. I tried to build a GE-compatible ntsync

[PATCH 1/1] selftest mm/mseal: style change

2024-04-16 Thread jeffxu
From: Jeff Xu remove "assert" from testcase. remove "return 0" Signed-off-by: Jeff Xu Suggested-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/mseal_test.c | 124 +--- tools/testing/selftests/mm/seal_elf.c | 3 - 2 files changed, 91 insertions(+), 36

[PATCH 0/1] selftest mm/mseal: style change

2024-04-16 Thread jeffxu
From: Jeff Xu This patch is a follow up to the comments [1] on test code during mseal discussion. This is style only change to the selftest code, not to test code logic. Please apply on top of mseal v10 patch [2] [1]

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-16 Thread Elizabeth Figura
On Tuesday, 16 April 2024 03:14:21 CDT Peter Zijlstra wrote: > On Mon, Apr 15, 2024 at 08:08:10PM -0500, Elizabeth Figura wrote: > > This patch series implements a new char misc driver, /dev/ntsync, which is > > used to implement Windows NT synchronization primitives. > > This patch series does

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-16 Thread Elizabeth Figura
On Tuesday, 16 April 2024 11:05:53 CDT Peter Zijlstra wrote: > On Mon, Apr 15, 2024 at 08:08:10PM -0500, Elizabeth Figura wrote: > > The intended semantics of the patches are broadly intended to match those > > of the corresponding Windows functions. For those not already familiar > > with the

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-16 Thread Elizabeth Figura
On Tuesday, 16 April 2024 11:19:17 CDT Peter Zijlstra wrote: > On Tue, Apr 16, 2024 at 05:53:45PM +0200, Peter Zijlstra wrote: > > On Tue, Apr 16, 2024 at 05:50:14PM +0200, Peter Zijlstra wrote: > > > On Tue, Apr 16, 2024 at 10:14:21AM +0200, Peter Zijlstra wrote: > > > > > Some aspects of the

Re: [PATCH V2] KVM: selftests: Take large C-state exit latency into consideration

2024-04-16 Thread Chen, Zide
On 4/15/2024 4:23 PM, Sean Christopherson wrote: > On Fri, Apr 12, 2024, Zide Chen wrote: >> 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

Re: [PATCH v10 0/5] Introduce mseal

2024-04-16 Thread Jeff Xu
On Tue, Apr 16, 2024 at 8:13 AM Liam R. Howlett wrote: > > * jef...@chromium.org [240415 12:35]: > > From: Jeff Xu > > > > This is V10 version, it rebases v9 patch to 6.9.rc3. > > We also applied and tested mseal() in chrome and chromebook. > > > >

Re: [PATCH v4 0/6] pids controller events rework

2024-04-16 Thread Tejun Heo
On Tue, Apr 16, 2024 at 04:20:08PM +0200, Michal Koutný wrote: > This makes pids.events:max affine to pids.max limit. > > How are the new events supposed to be useful? > > - pids.events.local:max > - tells that cgroup's limit is hit (too tight?) > - pids.events:* > - "only" directs top-down

Re: [PATCH v4 4/6] cgroup/pids: Add pids.events.local

2024-04-16 Thread Tejun Heo
On Tue, Apr 16, 2024 at 04:20:12PM +0200, Michal Koutný wrote: > struct cgroup_subsys pids_cgrp_subsys = { > .css_alloc = pids_css_alloc, > .css_free = pids_css_free, > @@ -416,5 +469,6 @@ struct cgroup_subsys pids_cgrp_subsys = { > .cancel_fork= pids_cancel_fork,

Re: [PATCH v4 2/6] cgroup/pids: Separate semantics of pids.events related to pids.max

2024-04-16 Thread Tejun Heo
Hello, On Tue, Apr 16, 2024 at 04:20:10PM +0200, Michal Koutný wrote: > diff --git a/Documentation/admin-guide/cgroup-v2.rst > b/Documentation/admin-guide/cgroup-v2.rst > index 17e6e9565156..108b03dfb26a 100644 > --- a/Documentation/admin-guide/cgroup-v2.rst > +++

Re: [PATCH v4 1/6] cgroup/pids: Remove superfluous zeroing

2024-04-16 Thread Tejun Heo
On Tue, Apr 16, 2024 at 04:20:09PM +0200, Michal Koutný wrote: > Atomic counters are in kzalloc'd struct. They are zeroed already and > atomic64_t does not need special initialization > (cf kernel/trace/trace_clock.c:trace_counter). > > Signed-off-by: Michal Koutný Applied to cgroup/for-6.10.

Re: [RFC PATCH v5 09/29] KVM: selftests: TDX: Add report_fatal_error test

2024-04-16 Thread Sean Christopherson
On Mon, Apr 15, 2024, Yan Zhao wrote: > On Mon, Apr 15, 2024 at 08:05:49AM +, Ackerley Tng wrote: > > >> The Intel GHCI Spec says in R12, bit 63 is set if the GPA is valid. As a > > > But above "__LINE__" is obviously not a valid GPA. > > > > > > Do you think it's better to check "data_gpa" is

[PATCH v7 00/24] RISC-V SBI v2.0 PMU improvements and Perf sampling in KVM guest

2024-04-16 Thread Atish Patra
This series implements SBI PMU improvements done in SBI v2.0[1] i.e. PMU snapshot and fw_read_hi() functions. SBI v2.0 introduced PMU snapshot feature which allows the SBI implementation to provide counter information (i.e. values/overflow status) via a shared memory between the SBI

Re: [PATCH v2] selftests: exec: make binaries position independent

2024-04-16 Thread Kees Cook
On Tue, Apr 16, 2024 at 08:28:29PM +0500, Muhammad Usama Anjum wrote: > The -static overrides the -pie and binaries aren't position independent > anymore. Use -static-pie instead which would produce a static and > position independent binary. This has been caught by clang's warnings: > > clang:

Re: [PATCH v10 2/5] mseal: add mseal syscall

2024-04-16 Thread Theo de Raadt
Liam R. Howlett wrote: > No per-vma change is checked prior to entering a per-vma modification > loop today. This means that mseal() differs in behaviour in "up-front > failure" vs "partial change failure" that exists in every other > function. I discussed this with Liam and Jeff a while ago

[PATCH] selftests: mm: fix unused and uninitialized variable warning

2024-04-16 Thread Muhammad Usama Anjum
Fix the warnings by initializing and marking the variable as unused. I've caught the warnings by using clang. split_huge_page_test.c:303:6: warning: variable 'dummy' set but not used [-Wunused-but-set-variable] 303 | int dummy; | ^ split_huge_page_test.c:343:3:

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-16 Thread Peter Zijlstra
On Tue, Apr 16, 2024 at 05:53:45PM +0200, Peter Zijlstra wrote: > On Tue, Apr 16, 2024 at 05:50:14PM +0200, Peter Zijlstra wrote: > > On Tue, Apr 16, 2024 at 10:14:21AM +0200, Peter Zijlstra wrote: > > > > > > Some aspects of the implementation may deserve particular comment: > > > > > > > > *

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-16 Thread Peter Zijlstra
On Mon, Apr 15, 2024 at 08:08:10PM -0500, Elizabeth Figura wrote: > The intended semantics of the patches are broadly intended to match those of > the > corresponding Windows functions. For those not already familiar with the > Windows > functions (or their undocumented behaviour), patch 27/27

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-16 Thread Peter Zijlstra
On Tue, Apr 16, 2024 at 05:50:14PM +0200, Peter Zijlstra wrote: > On Tue, Apr 16, 2024 at 10:14:21AM +0200, Peter Zijlstra wrote: > > > > Some aspects of the implementation may deserve particular comment: > > > > > > * In the interest of performance, each object is governed only by a single > >

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-16 Thread Peter Zijlstra
On Tue, Apr 16, 2024 at 10:14:21AM +0200, Peter Zijlstra wrote: > > Some aspects of the implementation may deserve particular comment: > > > > * In the interest of performance, each object is governed only by a single > > spinlock. However, NTSYNC_IOC_WAIT_ALL requires that the state of

[PATCH v2] selftests: exec: make binaries position independent

2024-04-16 Thread Muhammad Usama Anjum
The -static overrides the -pie and binaries aren't position independent anymore. Use -static-pie instead which would produce a static and position independent binary. This has been caught by clang's warnings: clang: warning: argument unused during compilation: '-pie'

Re: [PATCH] selftests: exec: make binaries position independent

2024-04-16 Thread Muhammad Usama Anjum
On 4/16/24 8:23 PM, Muhammad Usama Anjum wrote: > The -static overrides the -pie and binaries aren't position independent > anymore. Use -static-pie instead which would produce a static and > position independent binary. This has been caught by clang's warnings: > > clang: warning: argument

Re: [PATCH net] selftests: kselftest_harness: fix Clang warning about zero-length format

2024-04-16 Thread Muhammad Usama Anjum
On 4/16/24 8:10 PM, Jakub Kicinski wrote: > Apparently it's more legal to pass the format as NULL, than > it is to use an empty string. Clang complains about empty > formats: > > ./../kselftest_harness.h:1207:30: warning: format string is empty > [-Wformat-zero-length] > 1207 |

Re: [PATCH 07/10] riscv: add ISA extension parsing for Zcmop

2024-04-16 Thread Clément Léger
On 16/04/2024 16:54, Conor Dooley wrote: > On Mon, Apr 15, 2024 at 11:10:24AM +0200, Clément Léger wrote: >> >> >> On 11/04/2024 13:53, Conor Dooley wrote: >>> On Thu, Apr 11, 2024 at 11:08:21AM +0200, Clément Léger wrote: >> If we consider to have potentially broken isa string (ie

[PATCH] selftests: exec: make binaries position independent

2024-04-16 Thread Muhammad Usama Anjum
The -static overrides the -pie and binaries aren't position independent anymore. Use -static-pie instead which would produce a static and position independent binary. This has been caught by clang's warnings: clang: warning: argument unused during compilation: '-pie'

Re: [PATCH net] selftests: kselftest_harness: fix Clang warning about zero-length format

2024-04-16 Thread Sean Christopherson
On Tue, Apr 16, 2024, Jakub Kicinski wrote: > Apparently it's more legal to pass the format as NULL, than > it is to use an empty string. Clang complains about empty > formats: > > ./../kselftest_harness.h:1207:30: warning: format string is empty > [-Wformat-zero-length] > 1207 |

Re: [PATCH v10 2/5] mseal: add mseal syscall

2024-04-16 Thread Jann Horn
On Tue, Apr 16, 2024 at 4:59 PM Liam R. Howlett wrote: > * jef...@chromium.org [240415 12:35]: > > From: Jeff Xu > > > > The new mseal() is an syscall on 64 bit CPU, and with > > following signature: > > > > int mseal(void addr, size_t len, unsigned long flags) > > addr/len: memory range. > >

Re: [PATCH v10 0/5] Introduce mseal

2024-04-16 Thread Liam R. Howlett
* jef...@chromium.org [240415 12:35]: > From: Jeff Xu > > This is V10 version, it rebases v9 patch to 6.9.rc3. > We also applied and tested mseal() in chrome and chromebook. > > -- ... > MM perf benchmarks > == >

[PATCH net] selftests: kselftest_harness: fix Clang warning about zero-length format

2024-04-16 Thread Jakub Kicinski
Apparently it's more legal to pass the format as NULL, than it is to use an empty string. Clang complains about empty formats: ./../kselftest_harness.h:1207:30: warning: format string is empty [-Wformat-zero-length] 1207 |diagnostic ? "%s" : "", diagnostic); |

Re: [PATCH net-next v2 0/6] selftests: drv-net: support testing with a remote system

2024-04-16 Thread Willem de Bruijn
Jakub Kicinski wrote: > Hi! > > Implement support for tests which require access to a remote system / > endpoint which can generate traffic. > This series concludes the "groundwork" for upstream driver tests. > > I wanted to support the three models which came up in discussions: > - SW testing

Re: [PATCH v10 2/5] mseal: add mseal syscall

2024-04-16 Thread Liam R. Howlett
* jef...@chromium.org [240415 12:35]: > From: Jeff Xu > > The new mseal() is an syscall on 64 bit CPU, and with > following signature: > > int mseal(void addr, size_t len, unsigned long flags) > addr/len: memory range. > flags: reserved. > > mseal() blocks following operations for the given

Re: [PATCH 07/10] riscv: add ISA extension parsing for Zcmop

2024-04-16 Thread Conor Dooley
On Mon, Apr 15, 2024 at 11:10:24AM +0200, Clément Léger wrote: > > > On 11/04/2024 13:53, Conor Dooley wrote: > > On Thu, Apr 11, 2024 at 11:08:21AM +0200, Clément Léger wrote: > If we consider to have potentially broken isa string (ie extensions > dependencies not correctly handled),

Re: [PATCH v4 10/14] digest cache: Prefetch digest lists if requested

2024-04-16 Thread Jarkko Sakkinen
On Tue Apr 16, 2024 at 1:34 PM EEST, Roberto Sassu wrote: > On 4/15/2024 9:42 PM, Jarkko Sakkinen wrote: > > On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > >> From: Roberto Sassu > >> > >> A desirable goal when doing integrity measurements is that they are done > >> always in the

Re: [PATCH v4 03/14] digest_cache: Add securityfs interface

2024-04-16 Thread Jarkko Sakkinen
On Tue Apr 16, 2024 at 1:15 PM EEST, Roberto Sassu wrote: > On 4/15/2024 9:32 PM, Jarkko Sakkinen wrote: > > On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > >> From: Roberto Sassu > >> > >> Add the digest_cache_path file in securityfs, to let root change/read the > >> default path

Re: [PATCH v4 02/14] security: Introduce the digest_cache LSM

2024-04-16 Thread Jarkko Sakkinen
On Tue Apr 16, 2024 at 10:09 AM EEST, Roberto Sassu wrote: > On Mon, 2024-04-15 at 22:31 +0300, Jarkko Sakkinen wrote: > > On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > > > From: Roberto Sassu > > > > > > Introduce the digest_cache LSM, to collect digests from various sources > > >

Re: [PATCH net 0/4] selftests/net/tcp_ao: A bunch of fixes for TCP-AO selftests

2024-04-16 Thread Jakub Kicinski
On Sat, 13 Apr 2024 02:42:51 +0100 Dmitry Safonov via B4 Relay wrote: > Started as addressing the flakiness issues in rst_ipv*, that affect > netdev dashboard. Thank you! :)

Re: [PATCH v4 01/14] lib: Add TLV parser

2024-04-16 Thread Jarkko Sakkinen
On Tue Apr 16, 2024 at 12:07 AM EEST, Randy Dunlap wrote: > > > On 4/15/24 12:19 PM, Jarkko Sakkinen wrote: > > On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > >> From: Roberto Sassu > >> > >> Add a parser of a generic TLV format: > > > > What is TLV? > > type-length-value > > i.e.,

[PATCH v4 1/6] cgroup/pids: Remove superfluous zeroing

2024-04-16 Thread Michal Koutný
Atomic counters are in kzalloc'd struct. They are zeroed already and atomic64_t does not need special initialization (cf kernel/trace/trace_clock.c:trace_counter). Signed-off-by: Michal Koutný --- kernel/cgroup/pids.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/cgroup/pids.c

[PATCH v4 6/6] selftests: cgroup: Add basic tests for pids controller

2024-04-16 Thread Michal Koutný
This commit adds (and wires in) new test program for checking basic pids controller functionality -- restricting tasks in a cgroup and correct event counting. Signed-off-by: Michal Koutný --- tools/testing/selftests/cgroup/.gitignore | 1 + tools/testing/selftests/cgroup/Makefile| 2 +

[PATCH v4 5/6] selftests: cgroup: Lexicographic order in Makefile

2024-04-16 Thread Michal Koutný
This will reduce number of conflicts when modifying the lists. Signed-off-by: Michal Koutný --- tools/testing/selftests/cgroup/.gitignore | 10 +- tools/testing/selftests/cgroup/Makefile | 23 --- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git

[PATCH v4 2/6] cgroup/pids: Separate semantics of pids.events related to pids.max

2024-04-16 Thread Michal Koutný
Currently, when pids.max limit is breached in the hierarchy, the event is counted and reported in the cgroup where the forking task resides. This decouples the limit and the notification caused by the limit making it hard to detect when the actual limit was effected. Redefine the pids.events:max

[PATCH v4 3/6] cgroup/pids: Make event counters hierarchical

2024-04-16 Thread Michal Koutný
The pids.events file should honor the hierarchy, so make the events propagate from their origin up to the root on the unified hierarchy. The legacy behavior remains non-hierarchical. Signed-off-by: Michal Koutný --- Documentation/admin-guide/cgroup-v2.rst | 2 +- kernel/cgroup/pids.c

[PATCH v4 0/6] pids controller events rework

2024-04-16 Thread Michal Koutný
This makes pids.events:max affine to pids.max limit. How are the new events supposed to be useful? - pids.events.local:max - tells that cgroup's limit is hit (too tight?) - pids.events:* - "only" directs top-down search to cgroups of interest Changes from v3

[PATCH v4 4/6] cgroup/pids: Add pids.events.local

2024-04-16 Thread Michal Koutný
Hierarchical counting of events is not practical for watching when a particular pids.max is being hit. Therefore introduce .local flavor of events file (akin to memory controller) that collects only events relevant to given cgroup. The file is only added to the default hierarchy. Signed-off-by:

Re: [PATCH v4 10/12] selftests: kselftest_harness: let PASS / FAIL provide diagnostic

2024-04-16 Thread Muhammad Usama Anjum
On 2/29/24 5:59 AM, Jakub Kicinski wrote: > Switch to printing KTAP line for PASS / FAIL with ksft_test_result_code(), > this gives us the ability to report diagnostic messages. > > Reviewed-by: Kees Cook > Signed-off-by: Jakub Kicinski > --- > tools/testing/selftests/kselftest_harness.h | 9

[PATCH bpf-next 18/18] selftests/bpf: wq: add bpf_wq_start() checks

2024-04-16 Thread Benjamin Tissoires
Allows to test if allocation/free works Signed-off-by: Benjamin Tissoires --- tools/testing/selftests/bpf/bpf_experimental.h | 1 + tools/testing/selftests/bpf/prog_tests/wq.c| 22 ++ tools/testing/selftests/bpf/progs/wq.c | 22 +++--- 3 files

[PATCH bpf-next 17/18] bpf: add bpf_wq_start

2024-04-16 Thread Benjamin Tissoires
again, copy/paste from bpf_timer_start(). Signed-off-by: Benjamin Tissoires --- kernel/bpf/helpers.c | 24 1 file changed, 24 insertions(+) diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index e5c8adc44619..ed5309a37eda 100644 --- a/kernel/bpf/helpers.c +++

[PATCH bpf-next 16/18] selftests/bpf: add checks for bpf_wq_set_callback()

2024-04-16 Thread Benjamin Tissoires
We assign the callback and set everything up. The actual tests of these callbacks will be done when bpf_wq_start() is available. Signed-off-by: Benjamin Tissoires --- tools/testing/selftests/bpf/bpf_experimental.h | 5 + .../selftests/bpf/bpf_testmod/bpf_testmod.c| 5 +

[PATCH bpf-next 15/18] bpf: wq: add bpf_wq_set_callback_impl

2024-04-16 Thread Benjamin Tissoires
In the verifier, we need to teach it that the mentioned callback is is an async call. We look at the provided flags and set the callback to be sleepable if BPF_F_WQ_SLEEPABLE is set. Signed-off-by: Benjamin Tissoires --- kernel/bpf/helpers.c | 22 + kernel/bpf/verifier.c | 68

[PATCH bpf-next 14/18] bpf/verifier: add is_sleepable argument to push_callback_call

2024-04-16 Thread Benjamin Tissoires
To support sleepable async callbacks, we need to tell push_callback_call() whether the cb is sleepable or not. Doing so while checking for the kfunc arguments (when we call push_callback_call()) is simpler than adding a check for a function while inside push_callback_call(). When a callback is

[PATCH bpf-next 13/18] selftests/bpf: wq: add bpf_wq_init() checks

2024-04-16 Thread Benjamin Tissoires
Allows to test if allocation/free works Signed-off-by: Benjamin Tissoires --- tools/testing/selftests/bpf/bpf_experimental.h | 1 + tools/testing/selftests/bpf/prog_tests/wq.c | 8 +++ tools/testing/selftests/bpf/progs/wq.c | 10 +++

[PATCH bpf-next 12/18] tools: sync include/uapi/linux/bpf.h

2024-04-16 Thread Benjamin Tissoires
cp include/uapi/linux/bpf.h tools/include/uapi/linux/bpf.h Signed-off-by: Benjamin Tissoires --- tools/include/uapi/linux/bpf.h | 9 + 1 file changed, 9 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index e4ae83550fb3..519f6019d158 100644

[PATCH bpf-next 11/18] bpf: wq: add bpf_wq_init

2024-04-16 Thread Benjamin Tissoires
We need to teach the verifier about the second argument which is declared as void * but which is of type KF_ARG_PTR_TO_MAP. We could have dropped this extra case if we declared the second argument as struct bpf_map *, but that means users will have to do extra casting to have their program

[PATCH bpf-next 10/18] selftests/bpf: add bpf_wq tests

2024-04-16 Thread Benjamin Tissoires
We simply try in all supported map types if we can store/load a bpf_wq. Signed-off-by: Benjamin Tissoires --- tools/testing/selftests/bpf/prog_tests/wq.c | 11 +++ tools/testing/selftests/bpf/progs/wq.c | 135 2 files changed, 146 insertions(+) diff --git

[PATCH bpf-next 09/18] bpf: allow struct bpf_wq to be embedded in arraymaps and hashmaps

2024-04-16 Thread Benjamin Tissoires
Currently bpf_wq_cancel_and_free() is just a placeholder as there is no memory allocation for bpf_wq just yet. Again, duplication of the bpf_timer approach Signed-off-by: Benjamin Tissoires --- include/linux/bpf.h | 2 ++ kernel/bpf/arraymap.c | 18 ++--- kernel/bpf/hashtab.c |

[PATCH bpf-next 08/18] bpf: add support for KF_ARG_PTR_TO_WORKQUEUE

2024-04-16 Thread Benjamin Tissoires
Introduce support for KF_ARG_PTR_TO_WORKQUEUE. The kfuncs will use bpf_wq as argument and that will be recognized as workqueue argument by verifier. bpf_wq_kern casting can happen inside kfunc, but using bpf_wq in argument makes life easier for users who work with non-kern type in BPF progs.

[PATCH bpf-next 07/18] tools: sync include/uapi/linux/bpf.h

2024-04-16 Thread Benjamin Tissoires
cp include/uapi/linux/bpf.h tools/include/uapi/linux/bpf.h Signed-off-by: Benjamin Tissoires --- 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 cee0a7915c08..e4ae83550fb3 100644 ---

[PATCH bpf-next 06/18] bpf: add support for bpf_wq user type

2024-04-16 Thread Benjamin Tissoires
Mostly a copy/paste from the bpf_timer API, without the initialization and free, as they will be done in a separate patch. Signed-off-by: Benjamin Tissoires --- include/linux/bpf.h | 11 ++- include/uapi/linux/bpf.h | 4 kernel/bpf/btf.c | 17 +

[PATCH bpf-next 05/18] bpf: replace bpf_timer_cancel_and_free with a generic helper

2024-04-16 Thread Benjamin Tissoires
Same reason than most bpf_timer* functions, we need almost the same for workqueues. So extract the generic part out of it so bpf_wq_cancel_and_free can reuse it. Signed-off-by: Benjamin Tissoires --- kernel/bpf/helpers.c | 42 +- 1 file changed, 25

[PATCH bpf-next 04/18] bpf: replace bpf_timer_set_callback with a generic helper

2024-04-16 Thread Benjamin Tissoires
In the same way we have a generic __bpf_async_init(), we also need to share code between timer and workqueue for the set_callback call. We just add an unused flags parameter, as it will be used for workqueues. Signed-off-by: Benjamin Tissoires --- kernel/bpf/helpers.c | 29

[PATCH bpf-next 03/18] bpf: replace bpf_timer_init with a generic helper

2024-04-16 Thread Benjamin Tissoires
No code change except for the new flags argument being stored in the local data struct. Signed-off-by: Benjamin Tissoires --- kernel/bpf/helpers.c | 91 1 file changed, 63 insertions(+), 28 deletions(-) diff --git a/kernel/bpf/helpers.c

[PATCH bpf-next 02/18] bpf: make timer data struct more generic

2024-04-16 Thread Benjamin Tissoires
To be able to add workqueues and reuse most of the timer code, we need to make bpf_hrtimer more generic. There is no code change except that the new struct gets a new u64 flags attribute. We are still below 2 cache lines, so this shouldn't impact the current running codes. The ordering is also

[PATCH bpf-next 01/18] bpf: trampoline: export __bpf_prog_enter/exit_recur

2024-04-16 Thread Benjamin Tissoires
When dealing with workqueues, we need to also use __bpf_prog_enter/exit_recur(). bpf_trampoline_enter/exit() is not suitable because we are dealing with async callbacks that are set sleepable or not by the verifier, depending on how they are configured, so we need to rewrite our own test "if

[PATCH bpf-next 00/18] Introduce bpf_wq

2024-04-16 Thread Benjamin Tissoires
This is a followup of sleepable bpf_timer[0]. When discussing sleepable bpf_timer, it was thought that we should give a try to bpf_wq, as the 2 APIs are similar but distinct enough to justify a new one. So here it is. I tried to keep as much as possible common code in kernel/bpf/helpers.c but I

[PATCH v5 2/5] power: supply: core: Add POWER_SUPPLY_TECHNOLOGY_CAPACITOR

2024-04-16 Thread Mike Looijmans
Another technology to store energy is a (super)capacitor. Signed-off-by: Mike Looijmans --- (no changes since v1) Documentation/ABI/testing/sysfs-class-power | 2 +- drivers/power/supply/power_supply_core.c| 2 ++

Re: [PATCH net 0/4] selftests/net/tcp_ao: A bunch of fixes for TCP-AO selftests

2024-04-16 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net.git (main) by Paolo Abeni : On Sat, 13 Apr 2024 02:42:51 +0100 you wrote: > Started as addressing the flakiness issues in rst_ipv*, that affect > netdev dashboard. > > Signed-off-by: Dmitry Safonov <0x7f454...@gmail.com> > --- > Dmitry Safonov (4): >

Re: [PATCH v4 13/14] selftests/digest_cache: Add selftests for digest_cache LSM

2024-04-16 Thread Roberto Sassu
On 4/15/2024 9:47 PM, Jarkko Sakkinen wrote: On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: From: Roberto Sassu Add tests to verify the correctness of the digest_cache LSM, in all_test.c. Add the kernel module digest_cache_kern.ko, to let all_test call the API of the digest_cache

Re: [PATCH v4 11/14] digest_cache: Reset digest cache on file/directory change

2024-04-16 Thread Roberto Sassu
On 4/15/2024 9:44 PM, Jarkko Sakkinen wrote: On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: From: Roberto Sassu Register six new LSM hooks, path_truncate, file_release, inode_unlink, inode_rename, inode_post_setxattr and inode_post_removexattr, to monitor digest lists/directory

Re: [PATCH v4 10/14] digest cache: Prefetch digest lists if requested

2024-04-16 Thread Roberto Sassu
On 4/15/2024 9:42 PM, Jarkko Sakkinen wrote: On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: From: Roberto Sassu A desirable goal when doing integrity measurements is that they are done always in the same order across boots, so that the resulting PCR value becomes predictable and

Re: [PATCH v4 09/14] digest_cache: Add support for directories

2024-04-16 Thread Roberto Sassu
On 4/15/2024 9:39 PM, Jarkko Sakkinen wrote: On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: From: Roberto Sassu In the environments where xattrs are not available (e.g. in the initial ram disk), the digest_cache LSM cannot precisely determine which digest list in a directory

Re: [PATCH v4 04/14] digest_cache: Add hash tables and operations

2024-04-16 Thread Roberto Sassu
On 4/15/2024 9:36 PM, Jarkko Sakkinen wrote: On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: From: Roberto Sassu Add a linked list of hash tables to the digest cache, one per algorithm, containing the digests extracted from digest lists. The number of hash table slots is determined

Re: [PATCH net-next 00/10] selftests: Assortment of fixes

2024-04-16 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Paolo Abeni : On Fri, 12 Apr 2024 19:03:03 +0200 you wrote: > This is a loose follow-up to the Kernel CI patchset posted recently. It > contains various fixes that were supposed to be part of said patchset, but > didn't fit due to

Re: [PATCH v4 03/14] digest_cache: Add securityfs interface

2024-04-16 Thread Roberto Sassu
On 4/15/2024 9:32 PM, Jarkko Sakkinen wrote: On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: From: Roberto Sassu Add the digest_cache_path file in securityfs, to let root change/read the default path (file or directory) from where digest lists are looked up. An RW semaphore

[PATCH bpf-next v4 14/14] selftests/bpf: Use make_sockaddr in ip_check_defrag

2024-04-16 Thread Geliang Tang
From: Geliang Tang This patch uses public helper make_sockaddr() exported in network_helpers.h instead of open-coding in test_bpf_ip_check_defrag_ok() in prog_tests/ip_check_defrag.c. This can avoid duplicate code. Signed-off-by: Geliang Tang --- .../selftests/bpf/prog_tests/ip_check_defrag.c

[PATCH bpf-next v4 12/14] selftests/bpf: Use make_sockaddr in test_sock_addr

2024-04-16 Thread Geliang Tang
From: Geliang Tang This patch uses public helper make_sockaddr() exported in network_helpers.h instead of the local defined function mk_sockaddr() in test_sock_addr.c. This can avoid duplicate code. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/test_sock_addr.c | 62

[PATCH bpf-next v4 13/14] selftests/bpf: Use make_sockaddr in test_sock

2024-04-16 Thread Geliang Tang
From: Geliang Tang This patch uses public helper make_sockaddr() exported in network_helpers.h instead of open-coding in bind_sock() in test_sock.c. This can avoid duplicate code. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/Makefile| 1 +

[PATCH bpf-next v4 11/14] selftests/bpf: Use connect_to_addr in test_sock_addr

2024-04-16 Thread Geliang Tang
From: Geliang Tang This patch uses public helper connect_to_addr() exported in network_helpers.h instead of the local defined function connect_to_server() in test_sock_addr.c. This can avoid duplicate code. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/test_sock_addr.c | 36

[PATCH bpf-next v4 10/14] selftests/bpf: Use start_server_addr in test_sock_addr

2024-04-16 Thread Geliang Tang
From: Geliang Tang Include network_helpers.h in test_sock_addr.c, use the newly added public helper start_server_addr() instead of the local defined function start_server(). This can avoid duplicate code. In order to use functions defined in network_helpers.c, Makefile needs to be updated and

[PATCH bpf-next v4 09/14] selftests/bpf: Use log_err in network_helpers

2024-04-16 Thread Geliang Tang
From: Geliang Tang The helpers ASSERT_OK/GE/OK_PTR should avoid using in public functions. This patch uses log_err() to replace them in network_helpers.c, then uses ASSERT_OK_PTR() to check the return values of all open_netns(). Signed-off-by: Geliang Tang ---

[PATCH bpf-next v4 08/14] selftests/bpf: Use make_sockaddr in sk_assign

2024-04-16 Thread Geliang Tang
From: Geliang Tang This patch uses public helper make_sockaddr() exported in network_helpers.h instead of open-coding it prepare_addr() in prog_tests/sk_assign.c. This can avoid duplicate code. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/sk_assign.c | 13

[PATCH bpf-next v4 07/14] selftests/bpf: Use get_socket_local_port in sk_assign

2024-04-16 Thread Geliang Tang
From: Geliang Tang This patch uses public helper get_socket_local_port() exported in network_helpers.h instead of the local defined function get_port() in prog_tests/sk_assign.c. This can avoid duplicate code. Signed-off-by: Geliang Tang --- .../selftests/bpf/prog_tests/sk_assign.c | 25

[PATCH bpf-next v4 06/14] selftests/bpf: Use connect_to_addr in sk_assign

2024-04-16 Thread Geliang Tang
From: Geliang Tang This patch uses public helper connect_to_addr() exported in network_helpers.h instead of the local defined function connect_to_server() in prog_tests/sk_assign.c. This can avoid duplicate code. The code that sets SO_SNDTIMEO timeout as timeo_sec (3s) can be dropped, since

[PATCH bpf-next v4 05/14] selftests/bpf: Use start_server_addr in sk_assign

2024-04-16 Thread Geliang Tang
From: Geliang Tang Include network_helpers.h in prog_tests/sk_assign.c, use the newly added public helper start_server_addr() instead of the local defined function start_server(). This can avoid duplicate code. The code that sets SO_RCVTIMEO timeout as timeo_sec (3s) can be dropped, since

[PATCH bpf-next v4 04/14] selftests/bpf: Use connect_to_addr in cls_redirect

2024-04-16 Thread Geliang Tang
From: Geliang Tang This patch uses public helper connect_to_addr() exported in network_helpers.h instead of the local defined function connect_to_server() in prog_tests/cls_redirect.c. This can avoid duplicate code. Signed-off-by: Geliang Tang --- .../selftests/bpf/prog_tests/cls_redirect.c

[PATCH bpf-next v4 03/14] selftests/bpf: Use start_server_addr in cls_redirect

2024-04-16 Thread Geliang Tang
From: Geliang Tang Include network_helpers.h in prog_tests/cls_redirect.c, use the newly added public helper start_server_addr() instead of the local defined function start_server(). This can avoid duplicate code. Signed-off-by: Geliang Tang --- .../selftests/bpf/prog_tests/cls_redirect.c |

[PATCH bpf-next v4 02/14] selftests/bpf: Add start_server_addr* helpers

2024-04-16 Thread Geliang Tang
From: Geliang Tang In order to pair up with connect_to_addr(), this patch adds a new helper start_server_addr(), and another one start_server_addr_opts(), which is a wrapper of __start_server(), only added a network_helper_opts arg at the end. They all accept an argument 'addr' of 'struct

[PATCH bpf-next v4 00/14] use network helpers, part 1

2024-04-16 Thread Geliang Tang
From: Geliang Tang v4: - add more patches using make_sockaddr and get_socket_local_port helpers. v3: - address comments of Martin and Eduard in v2. (thanks) - move "int type" to the first argument of start_server_addr and connect_to_addr. - add start_server_addr_opts. - using

[PATCH bpf-next v4 01/14] selftests/bpf: Update arguments of connect_to_addr

2024-04-16 Thread Geliang Tang
From: Geliang Tang Move the third argument "int type" of connect_to_addr() to the first one which is closer to how the socket syscall is doing it. And change its usages in sock_addr.c too. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/network_helpers.c | 2 +-

Re: [PATCH net-next v7 2/3] net: gro: move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment

2024-04-16 Thread Paolo Abeni
On Tue, 2024-04-16 at 11:21 +0200, Paolo Abeni wrote: > On Fri, 2024-04-12 at 17:55 +0200, Richard Gobert wrote: > > {inet,ipv6}_gro_receive functions perform flush checks (ttl, flags, > > iph->id, ...) against all packets in a loop. These flush checks are used > > currently in all tcp flows and

Re: [PATCH net-next v7 1/3] net: gro: add {inner_}network_offset to napi_gro_cb

2024-04-16 Thread Paolo Abeni
On Fri, 2024-04-12 at 17:55 +0200, Richard Gobert wrote: > This patch adds network_offset and inner_network_offset to napi_gro_cb, and > makes sure both are set correctly. In the common path there's only one > write (skb_gro_reset_offset). > > Signed-off-by: Richard Gobert Does not apply

  1   2   >