[PATCH] selftests: Add information about TAP conformance in tests

2024-06-10 Thread Muhammad Usama Anjum
Although "TAP" word is being used already in documentation, but it hasn't been defined in informative way for developers that how to write TAP conformant tests and what are the benefits. Write a short brief about it. Signed-off-by: Muhammad Usama Anjum --- Documentation/dev-tools/kselftest.rst |

Re: [PATCH v2 1/4] capabilities: Add user namespace capabilities

2024-06-10 Thread Jonathan Calmels
On Sun, Jun 09, 2024 at 08:50:24PM GMT, Serge E. Hallyn wrote: > On Sun, Jun 09, 2024 at 03:43:34AM -0700, Jonathan Calmels wrote: > > Attackers often rely on user namespaces to get elevated (yet confined) > > privileges in order to target specific subsystems (e.g. [1]). Distributions > > I'd modi

Re: [PATCH net-next v2 9/9] selftests: openvswitch: add emit_sample test

2024-06-10 Thread Adrián Moreno
On Wed, Jun 05, 2024 at 08:43:14PM GMT, Simon Horman wrote: > On Mon, Jun 03, 2024 at 08:56:43PM +0200, Adrian Moreno wrote: > > Add a test to verify sampling packets via psample works. > > > > In order to do that, create a subcommand in ovs-dpctl.py to listen to > > on the psample multicast group

Re: [PATCH v2 2/4] capabilities: Add securebit to restrict userns caps

2024-06-10 Thread Jonathan Calmels
On Sun, Jun 09, 2024 at 09:33:01PM GMT, Serge E. Hallyn wrote: > On Sun, Jun 09, 2024 at 03:43:35AM -0700, Jonathan Calmels wrote: > > This patch adds a new capability security bit designed to constrain a > > task’s userns capability set to its bounding set. The reason for this is > > twofold: > >

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-10 Thread Jason Gunthorpe
On Mon, Jun 10, 2024 at 02:07:01AM +0100, Pavel Begunkov wrote: > On 6/10/24 01:37, David Wei wrote: > > On 2024-06-07 17:52, Jason Gunthorpe wrote: > > > IMHO it seems to compose poorly if you can only use the io_uring > > > lifecycle model with io_uring registered memory, and not with DMABUF > >

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-10 Thread Christian König
Am 10.06.24 um 14:16 schrieb Jason Gunthorpe: On Mon, Jun 10, 2024 at 02:07:01AM +0100, Pavel Begunkov wrote: On 6/10/24 01:37, David Wei wrote: On 2024-06-07 17:52, Jason Gunthorpe wrote: IMHO it seems to compose poorly if you can only use the io_uring lifecycle model with io_uring registered

Re: [PATCH v2 1/4] capabilities: Add user namespace capabilities

2024-06-10 Thread Serge E. Hallyn
On Mon, Jun 10, 2024 at 01:47:13AM -0700, Jonathan Calmels wrote: > On Sun, Jun 09, 2024 at 08:50:24PM GMT, Serge E. Hallyn wrote: > > On Sun, Jun 09, 2024 at 03:43:34AM -0700, Jonathan Calmels wrote: > > > Attackers often rely on user namespaces to get elevated (yet confined) > > > privileges in o

Re: [PATCH v2 1/4] capabilities: Add user namespace capabilities

2024-06-10 Thread Serge E. Hallyn
On Sun, Jun 09, 2024 at 03:43:34AM -0700, Jonathan Calmels wrote: > Attackers often rely on user namespaces to get elevated (yet confined) > privileges in order to target specific subsystems (e.g. [1]). Distributions > have been pretty adamant that they need a way to configure these, most of > them

Re: [PATCH bpf-next v4 06/12] bpf: selftests: Fix bpf_session_cookie() kfunc prototype

2024-06-10 Thread Jiri Olsa
On Sat, Jun 08, 2024 at 03:16:02PM -0600, Daniel Xu wrote: > The prototype defined in bpf_kfuncs.h was not in line with how the > actual kfunc was defined. This causes compilation errors when kfunc > prototypes are generated from BTF. > > Fix by aligning with actual kfunc definition. > > Signed-o

Re: [PATCH v2 2/4] capabilities: Add securebit to restrict userns caps

2024-06-10 Thread Serge E. Hallyn
On Mon, Jun 10, 2024 at 02:46:06AM -0700, Jonathan Calmels wrote: > On Sun, Jun 09, 2024 at 09:33:01PM GMT, Serge E. Hallyn wrote: > > On Sun, Jun 09, 2024 at 03:43:35AM -0700, Jonathan Calmels wrote: > > > This patch adds a new capability security bit designed to constrain a > > > task’s userns ca

Re: [PATCH bpf-next v4 03/12] bpf: selftests: Fix fentry test kfunc prototypes

2024-06-10 Thread Jiri Olsa
On Sat, Jun 08, 2024 at 03:15:59PM -0600, Daniel Xu wrote: > The prototypes in progs/get_func_ip_test.c were not in line with how the > actual kfuncs are defined in net/bpf/test_run.c. This causes compilation > errors when kfunc prototypes are generated from BTF. > > Fix by aligning with actual kf

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

2024-06-10 Thread Ilpo Järvinen
On Fri, 7 Jun 2024, Reinette Chatre wrote: > On 6/7/24 5:53 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 resctrl

[PATCH v7 00/16] selftests/resctrl: resctrl_val() related cleanups & improvements

2024-06-10 Thread Ilpo Järvinen
Hi all, This series does a number of cleanups into resctrl_val() and generalizes it by removing test name specific handling from the function. v7: - Truly use "bound to", not bounded to. - Fix separator to use 3 dashes v6: - Adjust closing/rollback of the IMC perf - Move the comment in measure_v

[PATCH v7 01/16] selftests/resctrl: Fix closing IMC fds on error and open-code R+W instead of loops

2024-06-10 Thread Ilpo Järvinen
The imc perf fd close() calls are missing from all error paths. In addition, get_mem_bw_imc() handles fds in a for loop but close() is based on two fixed indexes READ and WRITE. Open code inner for loops to READ+WRITE entries for clarity and add a function to close() IMC fds properly in all cases.

[PATCH v7 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-06-10 Thread Ilpo Järvinen
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 resctrl FS derived memory bandwidth, however, is calculated inside measure_vals() and only takes delta b

[PATCH v7 03/16] selftests/resctrl: Make "bandwidth" consistent in comments & prints

2024-06-10 Thread Ilpo Järvinen
Resctrl selftests refer to "bandwidth" currently in two other forms in the code ("B/W" and "band width"). Use "bandwidth" consistently everywhere. While at it, fix also one "over flow" -> "overflow" on a line that is touched by the change. Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvin

[PATCH v7 04/16] selftests/resctrl: Consolidate get_domain_id() into resctrl_val()

2024-06-10 Thread Ilpo Järvinen
Both initialize_mem_bw_resctrl() and initialize_llc_occu_resctrl() that are called from resctrl_val() need to determine domain ID to construct resctrl fs related paths. Both functions do it by taking CPU ID which neither needs for any other purpose than determining the domain ID. Consolidate deter

[PATCH v7 06/16] selftests/resctrl: Cleanup bm_pid and ppid usage & limit scope

2024-06-10 Thread Ilpo Järvinen
'bm_pid' and 'ppid' are global variables. As they are used by different processes and in signal handler, they cannot be entirely converted into local variables. The scope of those variables can still be reduced into resctrl_val.c only. As PARENT_EXIT() macro is using 'ppid', make it a function in

[PATCH v7 07/16] selftests/resctrl: Rename measure_vals() to measure_mem_bw_vals() & document

2024-06-10 Thread Ilpo Järvinen
measure_vals() is awfully generic name so rename it to measure_mem_bw() to describe better what it does and document the function parameters. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v5: - Typo fix to commit message - Consistent caps in kerneldoc ---

[PATCH v7 08/16] selftests/resctrl: Simplify mem bandwidth file code for MBA & MBM tests

2024-06-10 Thread Ilpo Järvinen
initialize_mem_bw_resctrl() and set_mbm_path() contain complicated set of conditions, each yielding different file to be opened to measure memory bandwidth through resctrl FS. In practice, only two of them are used. For MBA test, ctrlgrp is always provided, and for MBM test both ctrlgrp and mongrp

[PATCH v7 05/16] selftests/resctrl: Use correct type for pids

2024-06-10 Thread Ilpo Järvinen
A few functions receive PIDs through int arguments. PIDs variables should be of type pid_t, not int. Convert pid arguments from int to pid_t. Before printing PID, match the type to %d by casting to int which is enough for Linux (standard would allow using a longer integer type but generalizing fo

[PATCH v7 09/16] selftests/resctrl: Add ->measure() callback to resctrl_val_param

2024-06-10 Thread Ilpo Järvinen
The measurement done in resctrl_val() varies depending on test type. The decision for how to measure is decided based on the string compare to test name which is quite inflexible. Add ->measure() callback into the struct resctrl_val_param to allow each test to provide necessary code as a function

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-10 Thread David Ahern
On 6/10/24 6:16 AM, Jason Gunthorpe wrote: > On Mon, Jun 10, 2024 at 02:07:01AM +0100, Pavel Begunkov wrote: >> On 6/10/24 01:37, David Wei wrote: >>> On 2024-06-07 17:52, Jason Gunthorpe wrote: IMHO it seems to compose poorly if you can only use the io_uring lifecycle model with io_uring

[PATCH v7 11/16] selftests/resctrl: Simplify bandwidth report type handling

2024-06-10 Thread Ilpo Järvinen
bw_report is only needed for selecting the correct value from the values IMC measured. It is a member in the resctrl_val_param struct and is always set to "reads". The value is then checked in resctrl_val() using validate_bw_report_request() that besides validating the input, assumes it can mutate

[PATCH v7 12/16] selftests/resctrl: Make some strings passed to resctrlfs functions const

2024-06-10 Thread Ilpo Järvinen
Control group, monitor group and resctrl_val are not mutated and should not be mutated within resctrlfs.c functions. Mark this by using const char * for the arguments. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/resctrl.h

[PATCH v7 13/16] selftests/resctrl: Convert ctrlgrp & mongrp to pointers

2024-06-10 Thread Ilpo Järvinen
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_val_param to plain const char pointers and adjust the strlen() based checks to check NULL instead. Sign

[PATCH v7 14/16] selftests/resctrl: Remove mongrp from MBA test

2024-06-10 Thread Ilpo Järvinen
Nothing during MBA test uses mongrp even if it has been defined ever since the introduction of the MBA test in the commit 01fee6b4d1f9 ("selftests/resctrl: Add MBA test"). Remove the mongrp from MBA test. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- tool

[PATCH v7 10/16] selftests/resctrl: Add ->init() callback into resctrl_val_param

2024-06-10 Thread Ilpo Järvinen
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 resctrl_val(). Create ->init() hook into the struct resctrl_val_param to cleanly do per test initializa

[PATCH v7 15/16] selftests/resctrl: Remove mongrp from CMT test

2024-06-10 Thread Ilpo Järvinen
The CMT selftest instantiates a monitor group to read LLC occupancy. Since the test also creates a control group, it is unnecessary to create another one for monitoring because control groups already provide monitoring too. Remove the unnecessary monitor group from the CMT selftest. Suggested-by:

[PATCH v7 16/16] selftests/resctrl: Remove test name comparing from write_bm_pid_to_resctrl()

2024-06-10 Thread Ilpo Järvinen
write_bm_pid_to_resctrl() uses resctrl_val to check test name which is not a good interface generic resctrl FS functions should provide. Tests define mongrp when needed. Remove the test name check in write_bm_pid_to_resctrl() to only rely on the mongrp parameter being non-NULL. Remove write_bm_pi

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-10 Thread Mina Almasry
On Mon, Jun 10, 2024 at 5:38 AM Christian König wrote: > > Am 10.06.24 um 14:16 schrieb Jason Gunthorpe: > > On Mon, Jun 10, 2024 at 02:07:01AM +0100, Pavel Begunkov wrote: > >> On 6/10/24 01:37, David Wei wrote: > >>> On 2024-06-07 17:52, Jason Gunthorpe wrote: > IMHO it seems to compose poo

[PATCH v2] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-10 Thread Babu Moger
The selftest noncont_cat_run_test fails on AMD with the warnings. Reason is, AMD supports non contiguous CBM masks but does not report it via CPUID. Update noncont_cat_run_test to check for the vendor when verifying CPUID. Fixes: ae638551ab64 ("selftests/resctrl: Add non-contiguous CBMs CAT test"

Re: [PATCH v2] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-10 Thread Ilpo Järvinen
On Mon, 10 Jun 2024, Babu Moger wrote: > The selftest noncont_cat_run_test fails on AMD with the warnings. Reason noncont_cat_run_test() (In general, use () when refering to a function, same thing in the shortlog). "the warnings" sounds like I should know about what warning it fails with but t

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-10 Thread Daniel Vetter
On Mon, Jun 10, 2024 at 02:38:18PM +0200, Christian König wrote: > Am 10.06.24 um 14:16 schrieb Jason Gunthorpe: > > On Mon, Jun 10, 2024 at 02:07:01AM +0100, Pavel Begunkov wrote: > > > On 6/10/24 01:37, David Wei wrote: > > > > On 2024-06-07 17:52, Jason Gunthorpe wrote: > > > > > IMHO it seems t

Re: [PATCH 02/13] dt-bindings: thead: add a vlen register length property

2024-06-10 Thread Conor Dooley
On Sun, Jun 09, 2024 at 09:45:07PM -0700, Charlie Jenkins wrote: > Add a property analogous to the vlenb CSR so that software can detect > the vector length of each CPU prior to it being brought online. > Currently software has to assume that the vector length read from the > boot CPU applies to al

Re: [PATCH 02/13] dt-bindings: thead: add a vlen register length property

2024-06-10 Thread Charlie Jenkins
On Mon, Jun 10, 2024 at 05:29:23PM +0100, Conor Dooley wrote: > On Sun, Jun 09, 2024 at 09:45:07PM -0700, Charlie Jenkins wrote: > > Add a property analogous to the vlenb CSR so that software can detect > > the vector length of each CPU prior to it being brought online. > > Currently software has t

Re: [PATCH 10/13] riscv: hwprobe: Add thead vendor extension probing

2024-06-10 Thread Evan Green
On Sun, Jun 9, 2024 at 9:45 PM Charlie Jenkins wrote: > > Add a new hwprobe key "RISCV_HWPROBE_KEY_VENDOR_EXT_THEAD_0" which > allows userspace to probe for the new RISCV_ISA_VENDOR_EXT_XTHEADVECTOR > vendor extension. > > This new key will allow userspace code to probe for which thead vendor > ex

Re: [PATCH v2] selftests: seccomp: fix format-zero-length warnings

2024-06-10 Thread Kees Cook
On Fri, Jun 07, 2024 at 02:58:47PM -0600, Shuah Khan wrote: > On 6/7/24 06:41, Amer Al Shanawany wrote: > > fix the following errors by removing empty print statements: > > seccomp_benchmark.c:197:24: warning: zero-length gnu_printf format > > string [-Wformat-zero-length] > >197 | ks

Re: [PATCH v5 00/28] NT synchronization primitive driver

2024-06-10 Thread Elizabeth Figura
On Sunday, May 19, 2024 3:24:26 PM CDT Elizabeth Figura wrote: > This patch series implements a new char misc driver, /dev/ntsync, which is > used to implement Windows NT synchronization primitives. > > NT synchronization primitives are unique in that the wait functions both are > vectored, operat

Re: [PATCH 10/13] riscv: hwprobe: Add thead vendor extension probing

2024-06-10 Thread Charlie Jenkins
On Mon, Jun 10, 2024 at 09:50:16AM -0700, Evan Green wrote: > On Sun, Jun 9, 2024 at 9:45 PM Charlie Jenkins wrote: > > > > Add a new hwprobe key "RISCV_HWPROBE_KEY_VENDOR_EXT_THEAD_0" which > > allows userspace to probe for the new RISCV_ISA_VENDOR_EXT_XTHEADVECTOR > > vendor extension. > > > > T

Re: [PATCH 03/13] riscv: dts: allwinner: Add xtheadvector to the D1/D1s devicetree

2024-06-10 Thread Jessica Clarke
On 10 Jun 2024, at 05:45, Charlie Jenkins wrote: > > The D1/D1s SoCs support xtheadvector so it can be included in the > devicetree. Also include vlenb for the cpu. > > Signed-off-by: Charlie Jenkins > --- > arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi | 3 ++- > 1 file changed, 2 insertions(+)

Re: [PATCH 03/13] riscv: dts: allwinner: Add xtheadvector to the D1/D1s devicetree

2024-06-10 Thread Charlie Jenkins
On Mon, Jun 10, 2024 at 06:49:30PM +0100, Jessica Clarke wrote: > On 10 Jun 2024, at 05:45, Charlie Jenkins wrote: > > > > The D1/D1s SoCs support xtheadvector so it can be included in the > > devicetree. Also include vlenb for the cpu. > > > > Signed-off-by: Charlie Jenkins > > --- > > arch/ri

Re: [PATCH v2] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-10 Thread Moger, Babu
Hi On 6/10/24 11:20, Ilpo Järvinen wrote: > On Mon, 10 Jun 2024, Babu Moger wrote: > >> The selftest noncont_cat_run_test fails on AMD with the warnings. Reason > > noncont_cat_run_test() I want to mention the test here. not function. How about this? "The selftest non-contiguous CBM test fails

Re: [PATCH 05/13] riscv: vector: Use vlenb from DT for thead

2024-06-10 Thread Jessica Clarke
On 10 Jun 2024, at 05:45, Charlie Jenkins wrote: > > If thead,vlenb is provided in the device tree, prefer that over reading > the vlenb csr. > > Signed-off-by: Charlie Jenkins > --- > arch/riscv/include/asm/cpufeature.h | 2 ++ > arch/riscv/kernel/cpufeature.c | 48 +++

Re: [PATCH 05/13] riscv: vector: Use vlenb from DT for thead

2024-06-10 Thread Charlie Jenkins
On Mon, Jun 10, 2024 at 06:51:56PM +0100, Jessica Clarke wrote: > On 10 Jun 2024, at 05:45, Charlie Jenkins wrote: > > > > If thead,vlenb is provided in the device tree, prefer that over reading > > the vlenb csr. > > > > Signed-off-by: Charlie Jenkins > > --- > > arch/riscv/include/asm/cpufeat

Re: [PATCH HID v3 03/16] HID: bpf: implement HID-BPF through bpf_struct_ops

2024-06-10 Thread Alexei Starovoitov
On Sat, Jun 8, 2024 at 2:01 AM Benjamin Tissoires wrote: > > + > +static int hid_bpf_ops_init_member(const struct btf_type *t, > +const struct btf_member *member, > +void *kdata, const void *udata) > +{ > + u32 moff = __btf_memb

Re: [PATCH HID v3 15/16] HID: bpf: rework hid_bpf_ops_btf_struct_access

2024-06-10 Thread Alexei Starovoitov
On Sat, Jun 8, 2024 at 2:01 AM Benjamin Tissoires wrote: > > The idea is to provide a list of stucts and their editable fields. > > Currently no functional changes are introduced here, we will add some > more writeable fields in the next patch. > > Signed-off-by: Benjamin Tissoires > > --- > > ch

Re: [PATCH 1/2] kunit: test: Add vm_mmap() allocation resource manager

2024-06-10 Thread Kees Cook
On Mon, May 20, 2024 at 10:29:06AM +0100, Mark Rutland wrote: > On Sun, May 19, 2024 at 12:12:52PM -0700, Kees Cook wrote: > > +/* Create and attach a new mm if it doesn't already exist. */ > > +static int kunit_attach_mm(void) > > +{ > > + struct vm_area_struct *vma; > > + struct mm_struct *mm

Re: [PATCH 2/2] usercopy: Convert test_user_copy to KUnit test

2024-06-10 Thread Kees Cook
On Wed, May 29, 2024 at 01:17:35PM +0100, Ivan Orlov wrote: > On 5/19/24 20:12, Kees Cook wrote: > > #define test(condition, msg, ...) \ > > ({ > > \ > > int cond = (condition);

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-10 Thread Pavel Begunkov
On 6/10/24 16:16, David Ahern wrote: On 6/10/24 6:16 AM, Jason Gunthorpe wrote: On Mon, Jun 10, 2024 at 02:07:01AM +0100, Pavel Begunkov wrote: On 6/10/24 01:37, David Wei wrote: On 2024-06-07 17:52, Jason Gunthorpe wrote: IMHO it seems to compose poorly if you can only use the io_uring lifec

Re: [PATCH 1/2] kunit: test: Add vm_mmap() allocation resource manager

2024-06-10 Thread Kees Cook
On Sat, Jun 08, 2024 at 04:44:16PM +0800, David Gow wrote: > On Mon, 20 May 2024 at 03:12, Kees Cook wrote: > > > > For tests that need to allocate using vm_mmap() (e.g. usercopy and > > execve), provide the interface to have the allocation tracked by KUnit > > itself. This requires bringing up a

Re: [PATCH 02/13] dt-bindings: thead: add a vlen register length property

2024-06-10 Thread Conor Dooley
On Mon, Jun 10, 2024 at 09:38:06AM -0700, Charlie Jenkins wrote: > On Mon, Jun 10, 2024 at 05:29:23PM +0100, Conor Dooley wrote: > > On Sun, Jun 09, 2024 at 09:45:07PM -0700, Charlie Jenkins wrote: > > > Add a property analogous to the vlenb CSR so that software can detect > > > the vector length o

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-10 Thread Pavel Begunkov
On 6/10/24 16:41, Mina Almasry wrote: On Mon, Jun 10, 2024 at 5:38 AM Christian König wrote: Am 10.06.24 um 14:16 schrieb Jason Gunthorpe: On Mon, Jun 10, 2024 at 02:07:01AM +0100, Pavel Begunkov wrote: On 6/10/24 01:37, David Wei wrote: On 2024-06-07 17:52, Jason Gunthorpe wrote: IMHO it

Re: [PATCH v1 0/3] Userspace controls soft-offline HugeTLB pages

2024-06-10 Thread Jane Chu
On 6/7/2024 3:22 PM, Jiaqi Yan wrote: On Tue, Jun 4, 2024 at 12:19 AM Miaohe Lin wrote: On 2024/6/1 5:34, Jiaqi Yan wrote: Correctable memory errors are very common on servers with large amount of memory, and are corrected by ECC, but with two pain points to users: 1. Correction usually happe

Re: [PATCH 2/2] usercopy: Convert test_user_copy to KUnit test

2024-06-10 Thread Kees Cook
On Sat, Jun 08, 2024 at 04:44:10PM +0800, David Gow wrote: > On Mon, 20 May 2024 at 03:12, Kees Cook wrote: > > > > Convert the runtime tests of hardened usercopy to standard KUnit tests. > > > > Co-developed-by: Vitor Massaru Iha > > Signed-off-by: Vitor Massaru Iha > > Link: https://lore.kerne

[PATCH] selftests: filesystems: add return value checks

2024-06-10 Thread Abhinav Jain
Add ksft_exit_fail_msg() return value checks for fchdir() & chroot() to address the selftests statmount test compile warnings statmount_test.c:127:2: warning: ignoring return value of ‘fchdir’, declared with attribute warn_unused_result [-Wunused-result] 127 | fchdir(orig_root); | ^~

Re: [PATCH v2 0/4] Introduce user namespace capabilities

2024-06-10 Thread Josef Bacik
On Sun, Jun 09, 2024 at 03:43:33AM -0700, Jonathan Calmels wrote: > This patch series introduces a new user namespace capability set, as > well as some plumbing around it (i.e. sysctl, secbit, lsm support). > > First patch goes over the motivations for this as well as prior art. > > In summary, w

Re: [PATCH v2] KVM: selftest: Add a common check to identify AMD cpu in perf event filter test

2024-06-10 Thread Sean Christopherson
On Wed, Jun 05, 2024, Manali Shukla wrote: > PMU event filter test fails on zen4 architecture because of the > unavailability of family and model check for zen4 in use_amd_pmu(). > use_amd_pmu() is added to detect architectures that supports event No, use_amd_pmu() already exists. > select 0xc2 u

Re: [PATCH v2] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-10 Thread Reinette Chatre
Hi Babu, On 6/10/24 10:51 AM, Moger, Babu wrote: Hi On 6/10/24 11:20, Ilpo Järvinen wrote: On Mon, 10 Jun 2024, Babu Moger wrote: The selftest noncont_cat_run_test fails on AMD with the warnings. Reason noncont_cat_run_test() I want to mention the test here. not function. How about this?

Re: [PATCH v2] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-10 Thread Reinette Chatre
Hi Babu, (please do not send new version of patch in response to previous version) On 6/10/24 9:00 AM, Babu Moger wrote: The selftest noncont_cat_run_test fails on AMD with the warnings. Reason is, AMD supports non contiguous CBM masks but does not report it via CPUID. Update noncont_cat_run_t

[PATCH v2 2/2] usercopy: Convert test_user_copy to KUnit test

2024-06-10 Thread Kees Cook
Convert the runtime tests of hardened usercopy to standard KUnit tests. Co-developed-by: Vitor Massaru Iha Signed-off-by: Vitor Massaru Iha Link: https://lore.kernel.org/r/20200721174654.72132-1-vi...@massaru.org Tested-by: Ivan Orlov Signed-off-by: Kees Cook --- MAINTAINERS

[PATCH v2 0/2] usercopy: Convert test_user_copy to KUnit test

2024-06-10 Thread Kees Cook
Hi, This builds on the proposal[1] from Mark and lets me convert the existing usercopy selftest to KUnit. Besides adding this basic test to the KUnit collection, it also opens the door for execve testing (which depends on having a functional current->mm), and should provide the basic infrastructur

[PATCH v2 1/2] kunit: test: Add vm_mmap() allocation resource manager

2024-06-10 Thread Kees Cook
For tests that need to allocate using vm_mmap() (e.g. usercopy and execve), provide the interface to have the allocation tracked by KUnit itself. This requires bringing up a placeholder userspace mm. This combines my earlier attempt at this with Mark Rutland's version[1]. Link: https://lore.kern

Re: [PATCH v7 00/16] selftests/resctrl: resctrl_val() related cleanups & improvements

2024-06-10 Thread Reinette Chatre
Hi Shuah, Could you please consider this series for inclusion? Thank you very much. Reinette On 6/10/24 8:14 AM, Ilpo Järvinen wrote: Hi all, This series does a number of cleanups into resctrl_val() and generalizes it by removing test name specific handling from the function. v7: - Truly us

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-10 Thread Jason Gunthorpe
On Mon, Jun 10, 2024 at 08:20:08PM +0100, Pavel Begunkov wrote: > On 6/10/24 16:16, David Ahern wrote: > > > There is no reason you shouldn't be able to use your fast io_uring > > > completion and lifecycle flow with DMABUF backed memory. Those are not > > > widly different things and there is goo

Re: [PATCH v1 0/3] Userspace controls soft-offline HugeTLB pages

2024-06-10 Thread Jiaqi Yan
Thanks for your feedback, Jane! On Mon, Jun 10, 2024 at 12:41 PM Jane Chu wrote: > > On 6/7/2024 3:22 PM, Jiaqi Yan wrote: > > > On Tue, Jun 4, 2024 at 12:19 AM Miaohe Lin wrote: > >> On 2024/6/1 5:34, Jiaqi Yan wrote: > >>> Correctable memory errors are very common on servers with large > >>> a

[PATCH v2 00/13] riscv: Add support for xtheadvector

2024-06-10 Thread Charlie Jenkins
xtheadvector is a custom extension that is based upon riscv vector version 0.7.1 [1]. All of the vector routines have been modified to support this alternative vector version based upon whether xtheadvector was determined to be supported at boot. vlenb is not supported on the existing xtheadvector

[PATCH v2 02/13] dt-bindings: cpus: add a thead vlen register length property

2024-06-10 Thread Charlie Jenkins
Add a property analogous to the vlenb CSR so that software can detect the vector length of each CPU prior to it being brought online. Currently software has to assume that the vector length read from the boot CPU applies to all possible CPUs. On T-Head CPUs implementing pre-ratification vector, rea

[PATCH v2 03/13] riscv: dts: allwinner: Add xtheadvector to the D1/D1s devicetree

2024-06-10 Thread Charlie Jenkins
The D1/D1s SoCs support xtheadvector so it can be included in the devicetree. Also include vlenb for the cpu. Signed-off-by: Charlie Jenkins --- arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/riscv/boot/dts/allwinner/sun20

[PATCH v2 01/13] dt-bindings: riscv: Add xtheadvector ISA extension description

2024-06-10 Thread Charlie Jenkins
The xtheadvector ISA extension is described on the T-Head extension spec Github page [1] at commit 95358cb2cca9. Link: https://github.com/T-head-Semi/thead-extension-spec/blob/95358cb2cca9489361c61d335e03d3134b14133f/xtheadvector.adoc [1] Signed-off-by: Charlie Jenkins Reviewed-by: Conor Doole

[PATCH v2 04/13] riscv: Add thead and xtheadvector as a vendor extension

2024-06-10 Thread Charlie Jenkins
Add support to the kernel for THead vendor extensions with the target of the new extension xtheadvector. Signed-off-by: Charlie Jenkins --- arch/riscv/Kconfig.vendor| 13 + arch/riscv/include/asm/vendor_extensions/thead.h | 16 arch/riscv/kern

[PATCH v2 05/13] riscv: vector: Use vlenb from DT for thead

2024-06-10 Thread Charlie Jenkins
If thead,vlenb is provided in the device tree, prefer that over reading the vlenb csr. Signed-off-by: Charlie Jenkins --- arch/riscv/Kconfig.vendor | 13 ++ arch/riscv/include/asm/cpufeature.h | 2 ++ arch/riscv/kernel/cpufeature.c | 48 +++

[PATCH v2 06/13] RISC-V: define the elements of the VCSR vector CSR

2024-06-10 Thread Charlie Jenkins
From: Heiko Stuebner The VCSR CSR contains two elements VXRM[2:1] and VXSAT[0]. Define constants for those to access the elements in a readable way. Acked-by: Guo Ren Reviewed-by: Conor Dooley Signed-off-by: Heiko Stuebner Signed-off-by: Charlie Jenkins --- arch/riscv/include/asm/csr.h | 5

[PATCH v2 07/13] riscv: csr: Add CSR encodings for VCSR_VXRM/VCSR_VXSAT

2024-06-10 Thread Charlie Jenkins
The VXRM vector csr for xtheadvector has an encoding of 0xa and VXSAT has an encoding of 0x9. Co-developed-by: Heiko Stuebner Signed-off-by: Charlie Jenkins --- arch/riscv/include/asm/csr.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/a

[PATCH v2 09/13] riscv: vector: Support xtheadvector save/restore

2024-06-10 Thread Charlie Jenkins
Use alternatives to add support for xtheadvector vector save/restore routines. Signed-off-by: Charlie Jenkins --- arch/riscv/include/asm/csr.h | 6 + arch/riscv/include/asm/switch_to.h | 2 +- arch/riscv/include/asm/vector.h| 249 ++--- arch/

[PATCH v2 10/13] riscv: hwprobe: Add thead vendor extension probing

2024-06-10 Thread Charlie Jenkins
Add a new hwprobe key "RISCV_HWPROBE_KEY_VENDOR_EXT_THEAD_0" which allows userspace to probe for the new RISCV_ISA_VENDOR_EXT_XTHEADVECTOR vendor extension. This new key will allow userspace code to probe for which thead vendor extensions are supported. This API is modeled to be consistent with RI

[PATCH v2 11/13] riscv: hwprobe: Document thead vendor extensions and xtheadvector extension

2024-06-10 Thread Charlie Jenkins
Document support for thead vendor extensions using the key RISCV_HWPROBE_KEY_VENDOR_EXT_THEAD_0 and xtheadvector extension using the key RISCV_HWPROBE_VENDOR_EXT_XTHEADVECTOR. Signed-off-by: Charlie Jenkins Reviewed-by: Evan Green --- Documentation/arch/riscv/hwprobe.rst | 10 ++ 1 file

[PATCH v2 12/13] selftests: riscv: Fix vector tests

2024-06-10 Thread Charlie Jenkins
Overhaul the riscv vector tests to use kselftest_harness to help the test cases correctly report the results and decouple the individual test cases from each other. With this refactoring, only run the test cases is vector is reported and properly report the test case as skipped otherwise. The v_ini

[PATCH v2 13/13] selftests: riscv: Support xtheadvector in vector tests

2024-06-10 Thread Charlie Jenkins
Extend existing vector tests to be compatible with the xtheadvector instructions. Signed-off-by: Charlie Jenkins --- .../selftests/riscv/vector/v_exec_initval_nolibc.c | 23 -- tools/testing/selftests/riscv/vector/v_helpers.c | 17 +++- tools/testing/selftests/riscv/vector/v_helpers.h |

Re: [PATCH v2] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-10 Thread Moger, Babu
Hi Reinette, On 6/10/2024 4:32 PM, Reinette Chatre wrote: Hi Babu, (please do not send new version of patch in response to previous version) Yes. I saw your comments on other thread. I will take care of it. On 6/10/24 9:00 AM, Babu Moger wrote: The selftest noncont_cat_run_test fails on A

[PATCH bpf-next 0/5] use network helpers, part 7

2024-06-10 Thread Geliang Tang
From: Geliang Tang Drop type, noconnect and must_fail from network_helper_opts. And use start_server_str in mptcp and test_tcp_check_syncookie_user. Patches 1-3 address Martin's comments in the previous series. Geliang Tang (5): selftests/bpf: Drop type from network_helper_opts selftests/bp

[PATCH bpf-next 1/5] selftests/bpf: Drop type from network_helper_opts

2024-06-10 Thread Geliang Tang
From: Geliang Tang The opts.{type, noconnect, must_fail} is at least a bit non intuitive or unnecessary. The only use case now is in test_bpf_ip_check_defrag_ok which ends up bypassing most (or at least some) of the connect_to_fd_opts() logic. It's much better that test should have its own connec

[PATCH bpf-next 2/5] selftests/bpf: Drop noconnect from network_helper_opts

2024-06-10 Thread Geliang Tang
From: Geliang Tang This patch adds another new parameter "noconnect" for __connect_to_fd_opts, then opts->noconnect can be replaced by "noconnect" parameter in it. In test_bpf_ip_check_defrag_ok(), true is passed to it. And the strcut member "noconnect" of network_helper_opts can be dropped now.

[PATCH bpf-next 3/5] selftests/bpf: Drop must_fail from network_helper_opts

2024-06-10 Thread Geliang Tang
From: Geliang Tang This patch adds another new parameter "must_fail" for __connect_to_fd_opts, then opts->must_fail can be replaced by "must_fail" parameter in it. In run_test() of cgroup_v1v2, true is passed to it, while false is passed in other places. And the strcut member "must_fail" of netwo

[PATCH bpf-next 4/5] selftests/bpf: Use start_server_str in mptcp

2024-06-10 Thread Geliang Tang
From: Geliang Tang Since start_server_str() is added now, it can be used in mptcp.c in start_mptcp_server() instead of using helpers make_sockaddr() and start_server_addr() to simplify the code. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/mptcp.c | 7 +-- 1 file

[PATCH bpf-next 5/5] selftests/bpf: Use start_server_str in test_tcp_check_syncookie_user

2024-06-10 Thread Geliang Tang
From: Geliang Tang Since start_server_str() is added now, it can be used in script test_tcp_check_syncookie_user.c instead of start_server_addr() to simplify the code. Signed-off-by: Geliang Tang --- .../bpf/test_tcp_check_syncookie_user.c | 29 ++- 1 file changed, 3 inse

Re: [PATCH bpf-next] selftests/bpf: Enable INET_XFRM_TUNNEL in config

2024-06-10 Thread Geliang Tang
On Wed, May 29, 2024 at 02:01:06AM +0200, Ilya Leoshkevich wrote: > On Fri, 2024-05-24 at 18:27 +0200, Daniel Borkmann wrote: > > On 5/16/24 3:41 AM, Geliang Tang wrote: > > > From: Geliang Tang > > > > > > The kconfigs CONFIG_INET_XFRM_TUNNEL and CONFIG_INET6_XFRM_TUNNEL > > > are > > > needed b

Re: [PATCH v1 1/1] mm/memfd: add documentation for MFD_NOEXEC_SEAL MFD_EXEC

2024-06-10 Thread Randy Dunlap
Hi-- On 6/7/24 1:35 PM, jef...@chromium.org wrote: > From: Jeff Xu > > Add documentation for memfd_create flags: FMD_NOEXEC_SEAL s/FMD/MFD/ > and MFD_EXEC > > Signed-off-by: Jeff Xu > --- > Documentation/userspace-api/index.rst | 1 + > Documentation/userspace-api/mfd_noexec.rst | 86

Re: [PATCH bpf-next v3 01/11] bpf, lsm: Annotate lsm hook return value range

2024-06-10 Thread Xu Kuohai
On 6/10/2024 2:17 AM, Paul Moore wrote: On Sun, Jun 9, 2024 at 1:39 PM Casey Schaufler wrote: On 6/8/2024 6:54 AM, Alexei Starovoitov wrote: On Sat, Jun 8, 2024 at 1:04 AM Xu Kuohai wrote: On 6/7/2024 5:53 AM, Paul Moore wrote: On Thu, Apr 11, 2024 at 8:24 AM Xu Kuohai wrote: From: Xu Kuo

[PATCH bpf-next v2 0/2] Enable INET_XFRM_TUNNEL in config

2024-06-10 Thread Geliang Tang
From: Geliang Tang v2: - resend patch 1. - another fix for test_tunnel. Geliang Tang (2): selftests/bpf: Enable INET_XFRM_TUNNEL in config selftests/bpf: Close netns in error paths in test_tunnel tools/testing/selftests/bpf/config| 4 +++ .../selftests/bpf/prog_tests/test_tu

[PATCH bpf-next v2 1/2] selftests/bpf: Enable INET_XFRM_TUNNEL in config

2024-06-10 Thread Geliang Tang
From: Geliang Tang The kconfigs CONFIG_INET_XFRM_TUNNEL and CONFIG_INET6_XFRM_TUNNEL are needed by test_tunnel tests. This patch enables them together with the dependent kconfigs CONFIG_INET_IPCOMP and CONFIG_INET6_IPCOMP. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/config | 4

[PATCH bpf-next v2 2/2] selftests/bpf: Close netns in error paths in test_tunnel

2024-06-10 Thread Geliang Tang
From: Geliang Tang netns created by open_netns() should be closed in error paths in test_vxlan_tunnel(), test_ip6vxlan_tunnel() and test_ipip_tunnel(). Signed-off-by: Geliang Tang --- .../selftests/bpf/prog_tests/test_tunnel.c| 27 +-- 1 file changed, 19 insertions(+), 8 de

Re: [PATCH net 0/4] mptcp: various fixes

2024-06-10 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net.git (main) by Jakub Kicinski : On Fri, 07 Jun 2024 17:01:47 +0200 you wrote: > The different patches here are some unrelated fixes for MPTCP: > > - Patch 1 ensures 'snd_una' is initialised on connect in case of MPTCP > fallback to TCP followed by re

Re: [PATCH v1 1/1] mm/memfd: add documentation for MFD_NOEXEC_SEAL MFD_EXEC

2024-06-10 Thread Jeff Xu
Hi On Mon, Jun 10, 2024 at 7:20 PM Randy Dunlap wrote: > > Hi-- > > On 6/7/24 1:35 PM, jef...@chromium.org wrote: > > From: Jeff Xu > > > > Add documentation for memfd_create flags: FMD_NOEXEC_SEAL > > s/FMD/MFD/ > > > and MFD_EXEC > > > > Signed-off-by: Jeff Xu > > --- > > Documentation/users

[PATCH v2 0/1] mm/memfd: add documentation for MFD_NOEXEC_SEAL

2024-06-10 Thread jeffxu
From: Jeff Xu When MFD_NOEXEC_SEAL was introduced, there was one big mistake: it didn't have proper documentation. This led to a lot of confusion, especially about whether or not memfd created with the MFD_NOEXEC_SEAL flag is sealable. Before MFD_NOEXEC_SEAL, memfd had to explicitly set MFD_ALLOW

[PATCH v2 1/1] mm/memfd: add documentation for MFD_NOEXEC_SEAL MFD_EXEC

2024-06-10 Thread jeffxu
From: Jeff Xu Add documentation for memfd_create flags: MFD_NOEXEC_SEAL and MFD_EXEC Cc: sta...@vger.kernel.org Signed-off-by: Jeff Xu --- Documentation/userspace-api/index.rst | 1 + Documentation/userspace-api/mfd_noexec.rst | 86 ++ 2 files changed, 87 insertions(

Re: [PATCH 0/5] cleanups, fixes, and progress towards avoiding "make headers"

2024-06-10 Thread Jeff Xu
Hi On Fri, Jun 7, 2024 at 7:10 PM John Hubbard wrote: > > Eventually, once the build succeeds on a sufficiently old distro, the > idea is to delete $(KHDR_INCLUDES) from the selftests/mm build, and then > after that, from selftests/lib.mk and all of the other selftest builds. > > For now, this s

Re: [PATCH 1/5] selftests/mm: mseal, self_elf: fix missing __NR_mseal

2024-06-10 Thread Jeff Xu
Hi On Fri, Jun 7, 2024 at 7:10 PM John Hubbard wrote: > > The selftests/mm build isn't exactly "broken", according to the current > documentation, which still claims that one must run "make headers", > before building the kselftests. However, according to the new plan to > get rid of that require

Re: [PATCH 4/5] selftests/mm: mseal, self_elf: factor out test macros and other duplicated items

2024-06-10 Thread Jeff Xu
On Fri, Jun 7, 2024 at 7:10 PM John Hubbard wrote: > > Clean up and move some copy-pasted items into mseal_helpers.h. > > 1. The test macros can be made safer and simpler, by observing that they > are invariably called when about to return. This means that the macros > do not need an intrusive lab

Re: [PATCH 5/5] selftests/mm: mseal, self_elf: rename TEST_END_CHECK to REPORT_TEST_PASS

2024-06-10 Thread Jeff Xu
Hi On Fri, Jun 7, 2024 at 7:10 PM John Hubbard wrote: > > Now that the test macros are factored out into their final location, and > simplified, it's time to rename TEST_END_CHECK to something that > represents its new functionality: REPORT_TEST_PASS. > > Cc: Jeff Xu > Signed-off-by: John Hubbar

  1   2   >