Re: [PATCH bpf-next] selftests/bpf: Add F_SETFL for fcntl

2024-04-04 Thread John Fastabend
Geliang Tang wrote: > Hi Jakub, > > On Wed, 2024-04-03 at 15:29 -0700, John Fastabend wrote: > > Jakub Sitnicki wrote: > > > Hi Geliang, > > > > > > On Wed, Apr 03, 2024 at 04:32 PM +08, Geliang Tang wrote: > > > > From: Geliang Tang > > > > > > > > Incorrect arguments are passed to fcntl()

Re: [PATCH v6 1/2] posix-timers: Prefer delivery of signals to the current thread

2024-04-04 Thread Dmitry Vyukov
On Thu, 4 Apr 2024 at 15:45, Oleg Nesterov wrote: > > Perhaps I am totally confused, but. > > On 04/04, Dmitry Vyukov wrote: > > > > On Wed, 3 Apr 2024 at 17:43, Thomas Gleixner wrote: > > > > > > > Why distribution_thread() can't simply exit if got_signal != 0 ? > > > > > > > > See

[PATCH net-next v3 5/5] testing: net-drv: add a driver test for stats reporting

2024-04-04 Thread Jakub Kicinski
Add a very simple test to make sure drivers report expected stats. Drivers which implement FEC or pause configuration should report relevant stats. Qstats must be reported, at least packet and byte counts, and they must match total device stats. Tested with netdevsim, bnxt, in-tree and installed.

[PATCH net-next v3 4/5] selftests: drivers: add scaffolding for Netlink tests in Python

2024-04-04 Thread Jakub Kicinski
Add drivers/net as a target for mixed-use tests. The setup is expected to work similarly to the forwarding tests. Since we only need one interface (unlike forwarding tests) read the target device name from NETIF. If not present we'll try to run the test against netdevsim. Reviewed-by: Petr

[PATCH net-next v3 3/5] netdevsim: report stats by default, like a real device

2024-04-04 Thread Jakub Kicinski
Real devices should implement qstats. Devices which support pause or FEC configuration should also report the relevant stats. nsim was missing FEC stats completely, some of the qstats and pause stats required toggling a debugfs knob. Note that the tests which used pause always initialize the

[PATCH net-next v3 2/5] selftests: nl_netdev: add a trivial Netlink netdev test

2024-04-04 Thread Jakub Kicinski
Add a trivial test using YNL. $ ./tools/testing/selftests/net/nl_netdev.py KTAP version 1 1..2 ok 1 nl_netdev.empty_check ok 2 nl_netdev.lo_check Instantiate the family once, it takes longer than the test itself. Reviewed-by: Petr Machata Signed-off-by: Jakub Kicinski --- v2: -

[PATCH net-next v3 1/5] selftests: net: add scaffolding for Netlink tests in Python

2024-04-04 Thread Jakub Kicinski
Add glue code for accessing the YNL library which lives under tools/net and YAML spec files from under Documentation/. Automatically figure out if tests are run in tree or not. Since we'll want to use this library both from net and drivers/net test targets make the library a target as well, and

[PATCH net-next v3 0/5] selftests: net: groundwork for YNL-based tests

2024-04-04 Thread Jakub Kicinski
Currently the options for writing networking tests are C, bash or some mix of the two. YAML/Netlink gives us the ability to easily interface with Netlink in higher level laguages. In particular, there is a Python library already available in tree, under tools/net. Add the scaffolding which allows

[PATCH 3/3] io_uring: Support IOSQE_CQE_SKIP_SUCCESS in io_uring zerocopy test

2024-04-04 Thread Oliver Crumrine
Add support for the IOSQE_CQE_SKIP_SUCCESS flag in the io_uring_zerocopy_tx test, using the "-a" option. Instead of incrementing when IORING_CQE_F_MORE is set, remember how many SQEs are sent and simply wait on notifs instead of regular completions. For non-zc stuff, there won't be notifs or

[PATCH 2/3] io_uring: Add io_uring_peek_cqe to mini_liburing

2024-04-04 Thread Oliver Crumrine
mini_liburing.h is used by the io_uring tests as a stand-in for liburing. The next patch in this series needs the io_uring_peek_cqe function, and I speculate that future tests will too, so add that here. Please scrutinize this code, I am somewhat new to io_uring, and whilst I have tested this and

[PATCH 1/3] io_uring: Add REQ_F_CQE_SKIP support for io_uring zerocopy

2024-04-04 Thread Oliver Crumrine
In his patch to enable zerocopy networking for io_uring, Pavel Begunkov specifically disabled REQ_F_CQE_SKIP, as (at least from my understanding) the userspace program wouldn't receive the IORING_CQE_F_MORE flag in the result value. To fix this, instead of keeping track of how many CQEs have been

[PATCH 0/3] Add REQ_F_CQE_SKIP support to io_uring zerocopy

2024-04-04 Thread Oliver Crumrine
This patchset allows for io_uring zerocopy to support REQ_F_CQE_SKIP, skipping the normal completion notification, but not the zerocopy buffer release notification. This patchset also includes a test to test these changes, and a patch to mini_liburing to enable io_uring_peek_cqe, which is needed

[PATCHSET 0/3] Add REQ_F_CQE_SKIP support to io_uring zerocopy

2024-04-04 Thread Oliver Crumrine
This patchset allows for io_uring zerocopy to support REQ_F_CQE_SKIP, skipping the normal completion notification, but not the zerocopy buffer release notification. This patchset also includes a test to test these changes, and a patch to mini_liburing to enable io_uring_peek_cqe, which is needed

Re: [PATCH net-next v2 6/7] selftests: drivers: add scaffolding for Netlink tests in Python

2024-04-04 Thread Jakub Kicinski
On Thu, 4 Apr 2024 12:42:24 +0200 Petr Machata wrote: > > +def __init__(self, nsimdev, port_index, ifname, ns=None): > > +# In case udev renamed the netdev to according to new schema, > > +# check if the name matches the port_index. > > +nsimnamere =

kselftest/next kselftest-cpufreq: 5 runs, 3 regressions (v6.9-rc2-14-g4389636db356)

2024-04-04 Thread kernelci.org bot
kselftest/next kselftest-cpufreq: 5 runs, 3 regressions (v6.9-rc2-14-g4389636db356) Regressions Summary --- platform | arch | lab | compiler | defconfig | regressions

kselftest/next kselftest-seccomp: 2 runs, 1 regressions (v6.9-rc2-14-g4389636db356)

2024-04-04 Thread kernelci.org bot
kselftest/next kselftest-seccomp: 2 runs, 1 regressions (v6.9-rc2-14-g4389636db356) Regressions Summary --- platform | arch | lab | compiler | defconfig | regressions

kselftest/next kselftest-livepatch: 1 runs, 1 regressions (v6.9-rc2-14-g4389636db356)

2024-04-04 Thread kernelci.org bot
kselftest/next kselftest-livepatch: 1 runs, 1 regressions (v6.9-rc2-14-g4389636db356) Regressions Summary --- platform| arch | lab | compiler | defconfig | regressions

kselftest/next kselftest-lib: 3 runs, 2 regressions (v6.9-rc2-14-g4389636db356)

2024-04-04 Thread kernelci.org bot
kselftest/next kselftest-lib: 3 runs, 2 regressions (v6.9-rc2-14-g4389636db356) Regressions Summary --- platform | arch | lab | compiler | defconfig | regressions

kselftest/next build: 5 builds: 0 failed, 5 passed, 1 warning (v6.9-rc2-14-g4389636db356)

2024-04-04 Thread kernelci.org bot
kselftest/next build: 5 builds: 0 failed, 5 passed, 1 warning (v6.9-rc2-14-g4389636db356) Full Build Summary: https://kernelci.org/build/kselftest/branch/next/kernel/v6.9-rc2-14-g4389636db356/ Tree: kselftest Branch: next Git Describe: v6.9-rc2-14-g4389636db356 Git Commit:

Re: [PATCH] selftests: iommu: add config needed for iommufd_fail_nth

2024-04-04 Thread Jason Gunthorpe
On Mon, Mar 25, 2024 at 02:11:41PM +0500, Muhammad Usama Anjum wrote: > On 3/25/24 2:00 PM, Muhammad Usama Anjum wrote: > > Add FAULT_INJECTION_DEBUG_FS and FAILSLAB configurations which are > > needed by iommufd_fail_nth test. > > > > Signed-off-by: Muhammad Usama Anjum > > --- > > While

kselftest/fixes kselftest-lkdtm: 1 runs, 1 regressions (linux_kselftest-fixes-6.9-rc2-2-g72d7cb5c190b)

2024-04-04 Thread kernelci.org bot
kselftest/fixes kselftest-lkdtm: 1 runs, 1 regressions (linux_kselftest-fixes-6.9-rc2-2-g72d7cb5c190b) Regressions Summary --- platform| arch | lab | compiler | defconfig | regressions

kselftest/fixes kselftest-livepatch: 1 runs, 1 regressions (linux_kselftest-fixes-6.9-rc2-2-g72d7cb5c190b)

2024-04-04 Thread kernelci.org bot
kselftest/fixes kselftest-livepatch: 1 runs, 1 regressions (linux_kselftest-fixes-6.9-rc2-2-g72d7cb5c190b) Regressions Summary --- platform| arch | lab | compiler | defconfig | regressions

kselftest/fixes build: 2 builds: 0 failed, 2 passed (linux_kselftest-fixes-6.9-rc2-2-g72d7cb5c190b)

2024-04-04 Thread kernelci.org bot
kselftest/fixes build: 2 builds: 0 failed, 2 passed (linux_kselftest-fixes-6.9-rc2-2-g72d7cb5c190b) Full Build Summary: https://kernelci.org/build/kselftest/branch/fixes/kernel/linux_kselftest-fixes-6.9-rc2-2-g72d7cb5c190b/ Tree: kselftest Branch: fixes Git Describe:

Re: [PATCH v3 09/29] mm: abstract shadow stack vma behind `vma_is_shadow_stack`

2024-04-04 Thread Deepak Gupta
On Thu, Apr 04, 2024 at 09:02:17PM +0200, David Hildenbrand wrote: On 04.04.24 01:34, Deepak Gupta wrote: } - } else if (!(vm_flags & VM_READ)) { + } else if (!(vm_flags & VM_READ) && !vma_is_shadow_stack(vm_flags)) { + /* reads allowed if its shadow stack vma

Re: [PATCH bpf-next v3] selftests/bpf: Move test_dev_cgroup to prog_tests

2024-04-04 Thread Yonghong Song
On 4/3/24 5:03 AM, Muhammad Usama Anjum wrote: On 4/3/24 7:36 AM, Yonghong Song wrote: On 4/2/24 8:16 AM, Muhammad Usama Anjum wrote: Yonghong Song, Thank you so much for replying. I was missing how to run pipeline manually. Thanks a ton. On 4/1/24 11:53 PM, Yonghong Song wrote: On 4/1/24

Re: [PATCH v3 08/29] mm: Define VM_SHADOW_STACK for RISC-V

2024-04-04 Thread Deepak Gupta
On Thu, Apr 4, 2024 at 12:15 PM David Hildenbrand wrote: > > On 04.04.24 21:04, Mark Brown wrote: > > On Thu, Apr 04, 2024 at 08:58:06PM +0200, David Hildenbrand wrote: > > > >> or even introduce some ARCH_HAS_SHADOW_STACK so we can remove these > >> arch-specific thingies here. > > > > It would

Re: [PATCH v3 08/29] mm: Define VM_SHADOW_STACK for RISC-V

2024-04-04 Thread David Hildenbrand
On 04.04.24 21:04, Mark Brown wrote: On Thu, Apr 04, 2024 at 08:58:06PM +0200, David Hildenbrand wrote: or even introduce some ARCH_HAS_SHADOW_STACK so we can remove these arch-specific thingies here. It would be convenient if you could pull the ARCH_HAS_USER_SHADOW_STACK patch out of my

Re: [PATCH v3 08/29] mm: Define VM_SHADOW_STACK for RISC-V

2024-04-04 Thread Mark Brown
On Thu, Apr 04, 2024 at 08:58:06PM +0200, David Hildenbrand wrote: > or even introduce some ARCH_HAS_SHADOW_STACK so we can remove these > arch-specific thingies here. It would be convenient if you could pull the ARCH_HAS_USER_SHADOW_STACK patch out of my clone3 series to do that:

Re: [PATCH v3 09/29] mm: abstract shadow stack vma behind `vma_is_shadow_stack`

2024-04-04 Thread David Hildenbrand
On 04.04.24 01:34, Deepak Gupta wrote: VM_SHADOW_STACK (alias to VM_HIGH_ARCH_5) to encode shadow stack VMA. This patch changes checks of VM_SHADOW_STACK flag in generic code to call to a function `vma_is_shadow_stack` which will return true if its a shadow stack vma and default stub (when

Re: [PATCH v3 08/29] mm: Define VM_SHADOW_STACK for RISC-V

2024-04-04 Thread David Hildenbrand
On 04.04.24 01:34, Deepak Gupta wrote: VM_SHADOW_STACK is defined by x86 as vm flag to mark a shadow stack vma. x86 uses VM_HIGH_ARCH_5 bit but that limits shadow stack vma to 64bit only. arm64 follows same path (see links) To keep things simple, RISC-V follows the same. This patch adds `ss`

Re: [PATCH 2/2] selftests/mm: fix additional build errors for selftests

2024-04-04 Thread David Hildenbrand
On 28.03.24 04:34, John Hubbard wrote: These build errors only occur if one fails to first run "make headers". However, that is a non-obvious and instrusive requirement, and so there was a discussion on how to get rid of it [1]. This uses that solution. These two files were created by taking a

Re: [PATCH 1/2] selftests: break the dependency upon local header files

2024-04-04 Thread David Hildenbrand
On 28.03.24 04:34, John Hubbard wrote: Use tools/include/uapi/ files instead. These are obtained by taking a snapshot: run "make headers" at the top level, then copy the desired header file into the appropriate subdir in tools/uapi/. This was discussed and solved in [1]. However, even before

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

2024-04-04 Thread Alexei Starovoitov
On Thu, Apr 4, 2024 at 10:56 AM Benjamin Tissoires wrote: > > On Thu, Apr 4, 2024 at 6:41 PM Alexei Starovoitov > wrote: > > > > On Thu, Apr 4, 2024 at 8:27 AM Benjamin Tissoires > > wrote: > > > > > > > > > > > > > > So we need something like: > > > > > > > > struct bpf_hrtimer { > > > >

Re: [PATCH v6 1/2] posix-timers: Prefer delivery of signals to the current thread

2024-04-04 Thread Thomas Gleixner
On Thu, Apr 04 2024 at 16:54, Oleg Nesterov wrote: > On 04/04, Thomas Gleixner wrote: >> >> IOW, we cannot test this reliably at all with the current approach. > > Agreed! > > So how about a REALLY SIMPLE test-case below? > > Lacks error checking, should be updated to match

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

2024-04-04 Thread Benjamin Tissoires
On Thu, Apr 4, 2024 at 6:41 PM Alexei Starovoitov wrote: > > On Thu, Apr 4, 2024 at 8:27 AM Benjamin Tissoires > wrote: > > > > > > > > > > So we need something like: > > > > > > struct bpf_hrtimer { > > > union { > > > struct hrtimer timer; > > > + struct work_struct work; > > > }; >

Re: [PATCH 0/2] selftests: add ksft_exit_fail_perror()

2024-04-04 Thread Shuah Khan
On 4/4/24 10:14, Muhammad Usama Anjum wrote: In this series, ksft_exit_fail_perror() is being added which is helper function on top of ksft_exit_fail_msg(). It prints errno and its string form always. After writing and porting several kselftests, I've found out that most of times

Re: [PATCH net-next v2 0/7] selftests: net: groundwork for YNL-based tests

2024-04-04 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Tue, 2 Apr 2024 19:34:19 -0700 you wrote: > Currently the options for writing networking tests are C, bash or > some mix of the two. YAML/Netlink gives us the ability to easily > interface with Netlink in higher

Re: [PATCH] kselftest: Add missing signature to the comments

2024-04-04 Thread Shuah Khan
On 4/4/24 09:55, Muhammad Usama Anjum wrote: The comment on top of the file is used by many developers to glance over all the available functions. Add the recently added ksft_perror() to it. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/kselftest.h | 1 + 1 file changed, 1

Re: [BUG] seltests/iommu: runaway ./iommufd consuming 99% CPU after a failed assert()

2024-04-04 Thread Shuah Khan
On 3/27/24 14:04, Mirsad Todorovac wrote: On 3/27/24 11:41, Joao Martins wrote: On 25/03/2024 13:52, Jason Gunthorpe wrote: On Mon, Mar 25, 2024 at 12:17:28PM +, Joao Martins wrote: However, I am not smart enough to figure out why ... Apparently, from the source, mmap() fails to

Re: [PATCH v2] selftests/harness: Prevent infinite loop due to Assert in FIXTURE_TEARDOWN

2024-04-04 Thread Shuah Khan
On 3/26/24 15:13, Shengyu Li wrote: This patch addresses an issue in the selftests/harness where an assertion within FIXTURE_TEARDOWN could trigger an infinite loop. The problem arises because the teardown procedure is meant to execute once, but the presence of failing assertions (ASSERT_EQ(0,

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

2024-04-04 Thread Alexei Starovoitov
On Thu, Apr 4, 2024 at 8:27 AM Benjamin Tissoires wrote: > > > > > > So we need something like: > > > > struct bpf_hrtimer { > > union { > > struct hrtimer timer; > > + struct work_struct work; > > }; > > struct bpf_map *map; > > struct bpf_prog *prog; > > void __rcu *callback_fn;

Re: [Bug Report] selftests: Clang: kselftests build errors in KernelCI

2024-04-04 Thread Shuah Khan
On 4/4/24 10:34, Nick Desaulniers wrote: Thanks for the report. We've been tracking getting this working for a while: https://github.com/ClangBuiltLinux/linux/issues/1698. Other fires have continued to take priority. On Thu, Apr 4, 2024 at 9:30 AM Muhammad Usama Anjum wrote: Hi, We have

Re: [Bug Report] selftests: Clang: kselftests build errors in KernelCI

2024-04-04 Thread Nick Desaulniers
Thanks for the report. We've been tracking getting this working for a while: https://github.com/ClangBuiltLinux/linux/issues/1698. Other fires have continued to take priority. On Thu, Apr 4, 2024 at 9:30 AM Muhammad Usama Anjum wrote: > > Hi, > > We have caught bugs in kselftest suites on

Re: [PATCH 0/2] tracing/selftests: Verbosity improvements to KTAP output

2024-04-04 Thread Shuah Khan
On 3/26/24 13:11, Shuah Khan wrote: On 3/26/24 10:08, Steven Rostedt wrote: Shuah, If Masami is OK with this, can you take this through your tree? Acked-by: Steven Rostedt (Google) -- Steve Yes. Will do once Masami gives me the okay Hi Masami, Are you okay with this patch? thanks,

Re: [PATCH v2] selftests/ftrace: Limit length in subsystem-enable tests

2024-04-04 Thread Shuah Khan
On 2/26/24 09:59, Steven Rostedt wrote: On Mon, 26 Feb 2024 15:09:38 +0900 Masami Hiramatsu (Google) wrote: On Mon, 26 Feb 2024 11:18:16 +0800 Yuanhe Shu wrote: While sched* events being traced and sched* events continuously happen, "[xx] event tracing - enable/disable with subsystem level

[PATCH 2/2] selftests: exec: Use new ksft_exit_fail_perror() helper

2024-04-04 Thread Muhammad Usama Anjum
Use ksft_exit_fail_perror() to print the value of errno and its string form. This is the first user of the ksft_exit_fail_perror() and proves the usefulness of this API. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/exec/recursion-depth.c | 10 +- 1 file changed, 5

[PATCH 1/2] selftests: add ksft_exit_fail_perror()

2024-04-04 Thread Muhammad Usama Anjum
Add a version of ksft_exit_fail_msg() which prints the errno and its string form with ease. There is no benefit of exit message without errno. Whenever some error occurs, instead of printing errno manually, this function would be very helpful. In the next TAP ports or new tests, this function will

[PATCH 0/2] selftests: add ksft_exit_fail_perror()

2024-04-04 Thread Muhammad Usama Anjum
In this series, ksft_exit_fail_perror() is being added which is helper function on top of ksft_exit_fail_msg(). It prints errno and its string form always. After writing and porting several kselftests, I've found out that most of times ksft_exit_fail_msg() isn't useful if errno value isn't

[PATCH] kselftest: Add missing signature to the comments

2024-04-04 Thread Muhammad Usama Anjum
The comment on top of the file is used by many developers to glance over all the available functions. Add the recently added ksft_perror() to it. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/kselftest.h | 1 + 1 file changed, 1 insertion(+) diff --git

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

2024-04-04 Thread Benjamin Tissoires
On Thu, Apr 4, 2024 at 4:44 AM Alexei Starovoitov wrote: > > On Wed, Apr 3, 2024 at 6:01 PM Alexei Starovoitov > wrote: > > > > On Wed, Apr 3, 2024 at 11:50 AM Alexei Starovoitov > > wrote: > > > > > > On Wed, Mar 27, 2024 at 10:02 AM Benjamin Tissoires > > > wrote: > > > > > >

Re: [PATCH v6 1/2] posix-timers: Prefer delivery of signals to the current thread

2024-04-04 Thread Oleg Nesterov
On 04/04, Thomas Gleixner wrote: > > On Thu, Apr 04 2024 at 15:43, Oleg Nesterov wrote: > > > And this will happen with > > or without the commit bcb7ee79029dca ("posix-timers: Prefer delivery of > > signals to the current thread"). Any thread can dequeue a shared signal, > > say, on return from

Re: [PATCH v6 1/2] posix-timers: Prefer delivery of signals to the current thread

2024-04-04 Thread Thomas Gleixner
On Thu, Apr 04 2024 at 15:43, Oleg Nesterov wrote: > On 04/04, Dmitry Vyukov wrote: >> they all should get a signal eventually. > > Well, yes and no. > > No, in a sense that the motivation was not to ensure that all threads > get a signal, the motivation was to ensure that cpu_timer_fire() paths >

Re: [PATCH v6 1/2] posix-timers: Prefer delivery of signals to the current thread

2024-04-04 Thread Oleg Nesterov
On 04/04, Thomas Gleixner wrote: > > IOW, we cannot test this reliably at all with the current approach. Agreed! So how about a REALLY SIMPLE test-case below? Lacks error checking, should be updated to match tools/testing/selftests. Without commit bcb7ee79029dca assert(sig_cnt > SIG_CNT)

Re: [PATCH 1/1] KVM: selftests: add kvmclock drift test

2024-04-04 Thread David Woodhouse
On Sat, 2024-01-06 at 00:33 -0800, Dongli Zhang wrote: > There is kvmclock drift issue during the vCPU hotplug. It has been fixed by > the commit c52ffadc65e2 ("KVM: x86: Don't unnecessarily force masterclock > update on vCPU hotplug"). > > This is to add the test to verify if the master clock is

Re: [PATCH net-next v2 5/7] netdevsim: report stats by default, like a real device

2024-04-04 Thread Jakub Kicinski
On Thu, 04 Apr 2024 15:40:33 +0200 Paolo Abeni wrote: > > + nsim_get_stats64(dev, ); > > + > > + stats->packets = rtstats.tx_packets - !!rtstats.tx_packets; > > + stats->bytes = rtstats.tx_bytes; > > It looks the stats will not be self-consistent with multiple queues > enabled. > > What

Re: [PATCH net-next v2 5/7] netdevsim: report stats by default, like a real device

2024-04-04 Thread Jakub Kicinski
On Thu, 4 Apr 2024 12:40:04 +0200 Petr Machata wrote: > > + stats->packets = rtstats.rx_packets - !!rtstats.rx_packets; > > This is just to make sure that per-queue stats are lower than the > overall rtstats I presume? Yes, to fake some "non-queue" stats.

[PATCH v2 2/2] cgroup/cpuset: Add test_cpuset_v1_hp.sh

2024-04-04 Thread Waiman Long
Add a simple test to verify that an empty v1 cpuset will force its tasks to be moved to an ancestor node. It is based on the test case documented in commit 76bb5ab8f6e3 ("cpuset: break kernfs active protection in cpuset_write_resmask()"). Signed-off-by: Waiman Long ---

[PATCH v2 1/2] cgroup/cpuset: Make cpuset hotplug processing synchronous

2024-04-04 Thread Waiman Long
Since commit 3a5a6d0c2b03("cpuset: don't nest cgroup_mutex inside get_online_cpus()"), cpuset hotplug was done asynchronously via a work function. This is to avoid recursive locking of cgroup_mutex. Since then, the cgroup locking scheme has changed quite a bit. A cpuset_mutex was introduced to

[PATCH v2 0/2] cgroup/cpuset: Make cpuset hotplug processing synchronous

2024-04-04 Thread Waiman Long
v2: - Found that rebuild_sched_domains() has external callers, revert its change and introduce rebuild_sched_domains_cpuslocked() instead. As discussed in the LKML thread [1], the asynchronous nature of cpuset hotplug handling code is causing problem with RCU testing. With recent changes

Re: [PATCH v6 1/2] posix-timers: Prefer delivery of signals to the current thread

2024-04-04 Thread Oleg Nesterov
Perhaps I am totally confused, but. On 04/04, Dmitry Vyukov wrote: > > On Wed, 3 Apr 2024 at 17:43, Thomas Gleixner wrote: > > > > > Why distribution_thread() can't simply exit if got_signal != 0 ? > > > > > > See https://lore.kernel.org/all/20230128195641.ga14...@redhat.com/ > > > > Indeed.

Re: [PATCH net-next v2 5/7] netdevsim: report stats by default, like a real device

2024-04-04 Thread Paolo Abeni
On Tue, 2024-04-02 at 19:34 -0700, Jakub Kicinski wrote: > Real devices should implement qstats. Devices which support > pause or FEC configuration should also report the relevant stats. > > nsim was missing FEC stats completely, some of the qstats > and pause stats required toggling a debugfs

Re: [PATCH v4 08/15] RISC-V: KVM: Implement SBI PMU Snapshot feature

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 12:36:41AM -0700, Atish Patra wrote: > On 4/1/24 15:36, Atish Patra wrote: > > On Sat, Mar 2, 2024 at 1:49 AM Andrew Jones wrote: > > > > > > On Wed, Feb 28, 2024 at 05:01:23PM -0800, Atish Patra wrote: ... > > > > + > > > >if (flags &

Re: [PATCH v5 11/22] RISC-V: KVM: No need to exit to the user space if perf event failed

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 01:04:40AM -0700, Atish Patra wrote: > Currently, we return a linux error code if creating a perf event failed > in kvm. That shouldn't be necessary as guest can continue to operate > without perf profiling or profiling with firmware counters. > > Return appropriate SBI

Re: [PATCH v4 07/15] RISC-V: KVM: No need to exit to the user space if perf event failed

2024-04-04 Thread Andrew Jones
On Mon, Apr 01, 2024 at 03:37:01PM -0700, Atish Patra wrote: > On Sat, Mar 2, 2024 at 12:16 AM Andrew Jones wrote: > > > > On Wed, Feb 28, 2024 at 05:01:22PM -0800, Atish Patra wrote: > > > Currently, we return a linux error code if creating a perf event failed > > > in kvm. That shouldn't be

Re: [PATCH v5 06/22] drivers/perf: riscv: Implement SBI PMU snapshot function

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 01:04:35AM -0700, Atish Patra wrote: ... > +static int pmu_sbi_snapshot_disable(void) > +{ > + struct sbiret ret; > + > + ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_SNAPSHOT_SET_SHMEM, -1, > + -1, 0, 0, 0, 0); The "Rename the

Re: [PATCH v5 09/22] RISC-V: KVM: Rename the SBI_STA_SHMEM_DISABLE to a generic name

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 01:04:38AM -0700, Atish Patra wrote: > SBI_STA_SHMEM_DISABLE is a macro to invoke disable shared memory > commands. As this can be invoked from other SBI extension context > as well, rename it to more generic name as SBI_SHMEM_DISABLE. > > Signed-off-by: Atish Patra > ---

Re: [PATCH v5 08/22] RISC-V: KVM: Fix the initial sample period value

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 01:04:37AM -0700, Atish Patra wrote: > The initial sample period value when counter value is not assigned > should be set to maximum value supported by the counter width. > Otherwise, it may result in spurious interrupts. > > Signed-off-by: Atish Patra > --- >

Re: [PATCH v5 07/22] drivers/perf: riscv: Fix counter mask iteration for RV32

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 01:04:36AM -0700, Atish Patra wrote: > For RV32, used_hw_ctrs can have more than 1 word if the firmware chooses > to interleave firmware/hardware counters indicies. Even though it's a > unlikely scenario, handle that case by iterating over all the words > instead of just

Re: [PATCH v5 06/22] drivers/perf: riscv: Implement SBI PMU snapshot function

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 01:04:35AM -0700, Atish Patra wrote: > SBI v2.0 SBI introduced PMU snapshot feature which adds the following > features. > > 1. Read counter values directly from the shared memory instead of > csr read. > 2. Start multiple counters with initial values with one SBI call. >

Re: [PATCH] selftests: x86: conform test to TAP format output

2024-04-04 Thread Muhammad Usama Anjum
Soft reminder On 3/25/24 12:07 PM, Muhammad Usama Anjum wrote: > Soft reminder > > On 3/7/24 11:37 PM, Muhammad Usama Anjum wrote: >> Conform the layout, informational and status messages to TAP. No >> functional change is intended other than the layout of output messages. >> >> Signed-off-by:

Re: [PATCH v6] selftests/dmabuf-heap: conform test to TAP format output

2024-04-04 Thread Muhammad Usama Anjum
Soft reminder On 3/27/24 4:53 PM, Muhammad Usama Anjum wrote: > Conform the layout, informational and status messages to TAP. No > functional change is intended other than the layout of output messages. > Improve the TAP messages as well. > > Reviewed-by: T.J. Mercier > Signed-off-by: Muhammad

Re: [PATCH] selftests: iommu: add config needed for iommufd_fail_nth

2024-04-04 Thread Muhammad Usama Anjum
On 3/28/24 1:13 AM, Muhammad Usama Anjum wrote: > On 3/27/24 11:20 PM, Jason Gunthorpe wrote: >> On Wed, Mar 27, 2024 at 06:09:37PM +, Joao Martins wrote: >>> On 27/03/2024 17:49, Muhammad Usama Anjum wrote: On 3/27/24 7:59 PM, Joao Martins wrote: > On 27/03/2024 11:49, Jason

Re: [PATCH net-next v2 6/7] selftests: drivers: add scaffolding for Netlink tests in Python

2024-04-04 Thread Petr Machata
Jakub Kicinski writes: > Add drivers/net as a target for mixed-use tests. > The setup is expected to work similarly to the forwarding tests. > Since we only need one interface (unlike forwarding tests) > read the target device name from NETIF. If not present we'll > try to run the test against

Re: [PATCH net-next v2 5/7] netdevsim: report stats by default, like a real device

2024-04-04 Thread Petr Machata
Jakub Kicinski writes: > Real devices should implement qstats. Devices which support > pause or FEC configuration should also report the relevant stats. > > nsim was missing FEC stats completely, some of the qstats > and pause stats required toggling a debugfs knob. > > Note that the tests

Re: [PATCH v5 05/22] RISC-V: Add SBI PMU snapshot definitions

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 01:04:34AM -0700, Atish Patra wrote: > SBI PMU Snapshot function optimizes the number of traps to > higher privilege mode by leveraging a shared memory between the S/VS-mode > and the M/HS mode. Add the definitions for that extension and new error > codes. > > Reviewed-by:

Re: [PATCH v5 04/22] drivers/perf: riscv: Use BIT macro for shifting operations

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 01:04:33AM -0700, Atish Patra wrote: > It is a good practice to use BIT() instead of (1UL << x). (1UL << x) isn't generally a problem. The problem is with (1 << x). > Replace the current usages with BIT(). > > Signed-off-by: Atish Patra > --- >

Re: [PATCH v5 03/22] drivers/perf: riscv: Read upper bits of a firmware counter

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 01:04:32AM -0700, Atish Patra wrote: > SBI v2.0 introduced a explicit function to read the upper 32 bits > for any firmware counter width that is longer than 32bits. > This is only applicable for RV32 where firmware counter can be > 64 bit. > > Reviewed-by: Andrew Jones >

Re: [PATCH v5 02/22] RISC-V: Add FIRMWARE_READ_HI definition

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 01:04:31AM -0700, Atish Patra wrote: > SBI v2.0 added another function to SBI PMU extension to read > the upper bits of a counter with width larger than XLEN. > > Add the definition for that function. > > Reviewed-by: Clément Léger > Acked-by: Conor Dooley >

Re: [PATCH v5 01/22] RISC-V: Fix the typo in Scountovf CSR name

2024-04-04 Thread Andrew Jones
On Wed, Apr 03, 2024 at 01:04:30AM -0700, Atish Patra wrote: > The counter overflow CSR name is "scountovf" not "sscountovf". > > Fix the csr name. > > Fixes: 4905ec2fb7e6 ("RISC-V: Add sscofpmf extension support") > Reviewed-by: Clément Léger > Reviewed-by: Conor Dooley > Reviewed-by: Anup

Re: [PATCH net-next v2 4/7] selftests: nl_netdev: add a trivial Netlink netdev test

2024-04-04 Thread Petr Machata
Jakub Kicinski writes: > Add a trivial test using YNL. > > $ ./tools/testing/selftests/net/nl_netdev.py > KTAP version 1 > 1..2 > ok 1 nl_netdev.empty_check > ok 2 nl_netdev.lo_check > > Instantiate the family once, it takes longer than the test itself. > > Signed-off-by: Jakub

Re: [PATCH net-next v2 3/7] selftests: net: add scaffolding for Netlink tests in Python

2024-04-04 Thread Petr Machata
Jakub Kicinski writes: > Add glue code for accessing the YNL library which lives under > tools/net and YAML spec files from under Documentation/. > Automatically figure out if tests are run in tree or not. > Since we'll want to use this library both from net and > drivers/net test targets make

Re: [PATCH net-next v2 2/7] tools: ynl: copy netlink error to NlError

2024-04-04 Thread Petr Machata
Jakub Kicinski writes: > Typing e.nl_msg.error when processing exception is a bit tedious > and counter-intuitive. Set a local .error member to the positive > value of the netlink level error. > > Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata

Re: [PATCH net-next v2 1/7] netlink: specs: define ethtool header flags

2024-04-04 Thread Petr Machata
Jakub Kicinski writes: > When interfacing with the ethtool commands it's handy to > be able to use the names of the flags. Example: > > ethnl.pause_get({"header": {"dev-index": cfg.ifindex, > "flags": {'stats'}}}) > > Note that not all commands accept all

Re: [PATCH v2 2/3] KVM: selftests: Extend @shape to allow creation of VM without in-kernel APIC

2024-04-04 Thread Manali Shukla
Hi Sean, On 4/1/2024 10:45 PM, Sean Christopherson wrote: > On Mon, Apr 01, 2024, Manali Shukla wrote: >> Currently, all the VMs are created with in-kernel APIC support in KVM >> selftests because KVM_CREATE_IRQCHIP ioctl is called by default from >> kvm_arch_vm_post_create(). >> >> Carve out

[PATCH 5/5] KVM: riscv: selftests: Add Zimop extension to get-reg-list test

2024-04-04 Thread Clément Léger
The KVM RISC-V allows Zimop extension for Guest/VM so add this extension to get-reg-list test. Signed-off-by: Clément Léger --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c

[PATCH 4/5] RISC-V: KVM: Allow Zimop extension for Guest/VM

2024-04-04 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zimop extension for Guest/VM. Signed-off-by: Clément Léger --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files changed, 3 insertions(+) diff --git

[PATCH 3/5] riscv: hwprobe: export Zimop ISA extension

2024-04-04 Thread Clément Léger
Export Zimop ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 4 arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 1 + 3 files changed, 6 insertions(+) diff --git

[PATCH 2/5] riscv: add ISA extension parsing for Zimop

2024-04-04 Thread Clément Léger
Add parsing for Zimop ISA extension which was ratified in commit 58220614a5f of the riscv-isa-manual. Signed-off-by: Clément Léger --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h

[PATCH 1/5] dt-bindings: riscv: add Zimop ISA extension description

2024-04-04 Thread Clément Léger
Add description for the Zimop (May-Be-Operations) ISA extension which was ratified in commit 58220614a5f of the riscv-isa-manual. Signed-off-by: Clément Léger --- Documentation/devicetree/bindings/riscv/extensions.yaml | 5 + 1 file changed, 5 insertions(+) diff --git

[PATCH 0/5] Add parsing for Zimop ISA extension

2024-04-04 Thread Clément Léger
The Zimop ISA extension was ratified recently. This series adds support for parsing it from riscv,isa, hwprobe export and kvm support for Guest/VM. Clément Léger (5): dt-bindings: riscv: add Zimop ISA extension description riscv: add ISA extension parsing for Zimop riscv: hwprobe: export

Re: [PATCH v6 1/2] posix-timers: Prefer delivery of signals to the current thread

2024-04-04 Thread Dmitry Vyukov
On Wed, 3 Apr 2024 at 17:43, Thomas Gleixner wrote: > > On Wed, Apr 03 2024 at 17:03, Oleg Nesterov wrote: > > On 04/03, Thomas Gleixner wrote: > >> The test if fragile as hell as there is absolutely no guarantee that the > >> signal target distribution is as expected. The expectation is based on