Re: [PATCH v3 1/2] kunit: unregister the device on error

2024-04-18 Thread Markus Elfring
> kunit_init_device() should unregister the device on bus register error, > but mistakenly it tries to unregister the bus. Would the following description variant be more appropriate? kunit_init_device() should unregister the device on bus registration error. But it mistakenly tries to

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

2024-04-18 Thread Alexei Starovoitov
On Tue, Apr 16, 2024 at 04:08:24PM +0200, Benjamin Tissoires wrote: > 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

Re: [PATCH v3 2/2] kunit: avoid memory leak on device register error

2024-04-18 Thread David Gow
On Fri, 19 Apr 2024 at 05:02, Wander Lairson Costa wrote: > > If the device register fails, free the allocated memory before > returning. > > Signed-off-by: Wander Lairson Costa > Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") > --- Thanks. I'm not sure this is correct, though...

Re: [PATCH v3 1/2] kunit: unregister the device on error

2024-04-18 Thread David Gow
On Fri, 19 Apr 2024 at 05:02, Wander Lairson Costa wrote: > > kunit_init_device() should unregister the device on bus register error, > but mistakenly it tries to unregister the bus. > > Unregister the device instead of the bus. > > Signed-off-by: Wander Lairson Costa > Fixes: d03c720e03bd

[PATCH 0/1] selftest mm/mseal compile warning

2024-04-18 Thread jeffxu
From: Jeff Xu fix compile warning reported by test robot [1] Please apply on top of patch titled: "selftest mm/mseal: style change" (which already in mm-unstable) [1] https://lore.kernel.org/all/202404190226.ofjoewv8-...@intel.com/ Thanks! -Jeff Jeff Xu (1): selftest mm/mseal: fix compile

[PATCH 1/1] selftest mm/mseal: fix compile warning

2024-04-18 Thread jeffxu
From: Jeff Xu fix compile warning reported by test robot Signed-off-by: Jeff Xu Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202404190226.ofjoewv8-...@intel.com/ --- tools/testing/selftests/mm/mseal_test.c | 3 +-- tools/testing/selftests/mm/seal_elf.c | 3 +-- 2 files

Re: [PATCH v10 0/5] Introduce mseal

2024-04-18 Thread Jeff Xu
On Thu, Apr 18, 2024 at 1:19 PM Suren Baghdasaryan wrote: > > On Tue, Apr 16, 2024 at 12:40 PM Jeff Xu wrote: > > > > 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

[PATCH net-next v4 7/7] selftests: drv-net: add require_XYZ() helpers for validating env

2024-04-18 Thread Jakub Kicinski
Wrap typical checks like whether given command used by the test is available in helpers. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 29 ++- tools/testing/selftests/drivers/net/ping.py | 6 2 files changed, 34 insertions(+), 1

[PATCH net-next v4 6/7] selftests: drv-net: add a TCP ping test case (and useful helpers)

2024-04-18 Thread Jakub Kicinski
More complex tests often have to spawn a background process, like a server which will respond to requests or tcpdump. Add support for creating such processes using the with keyword: with bkg("my-daemon", ..): # my-daemon is alive in this block My initial thought was to add this support

[PATCH net-next v4 5/7] selftests: net: support matching cases by name prefix

2024-04-18 Thread Jakub Kicinski
While writing tests with a lot more cases I got tired of having to jump back and forth to add the name of the test to the ksft_run() list. Most unittest frameworks do some name matching, e.g. assume that functions with names starting with test_ are test cases. Support similar flow in ksft_run().

[PATCH net-next v4 4/7] selftests: drv-net: add a trivial ping test

2024-04-18 Thread Jakub Kicinski
Add a very simple test for testing with a remote system. Both IPv4 and IPv6 connectivity is optional, later change will add checks to skip tests based on available addresses. Using netdevsim: $ ./run_kselftest.sh -t drivers/net:ping.py TAP version 13 1..1 # timeout set to 45 # selftests:

[PATCH net-next v4 3/7] selftests: drv-net: construct environment for running tests which require an endpoint

2024-04-18 Thread Jakub Kicinski
Nothing surprising here, hopefully. Wrap the variables from the environment into a class or spawn a netdevsim based env and pass it to the tests. Signed-off-by: Jakub Kicinski --- .../testing/selftests/drivers/net/README.rst | 33 +++ .../selftests/drivers/net/lib/py/env.py | 98

[PATCH net-next v4 2/7] selftests: drv-net: factor out parsing of the env

2024-04-18 Thread Jakub Kicinski
The tests with a remote end will use a different class, for clarity, but will also need to parse the env. So factor parsing the env out to a function. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 43 +++ 1 file changed, 26 insertions(+), 17

[PATCH net-next v4 1/7] selftests: drv-net: define endpoint structures

2024-04-18 Thread Jakub Kicinski
Define the remote endpoint "model". To execute most meaningful device driver tests we need to be able to communicate with a remote system, and have it send traffic to the device under test. Various test environments will have different requirements. 0) "Local" netdevsim-based testing can simply

[PATCH net-next v4 0/7] selftests: drv-net: support testing with a remote system

2024-04-18 Thread Jakub Kicinski
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 with netdevsim - "local" testing with

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

2024-04-18 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Wed, 17 Apr 2024 16:11:38 -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

[PATCH v3 2/2] kunit: avoid memory leak on device register error

2024-04-18 Thread Wander Lairson Costa
If the device register fails, free the allocated memory before returning. Signed-off-by: Wander Lairson Costa Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") --- lib/kunit/device.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/kunit/device.c

[PATCH v3 1/2] kunit: unregister the device on error

2024-04-18 Thread Wander Lairson Costa
kunit_init_device() should unregister the device on bus register error, but mistakenly it tries to unregister the bus. Unregister the device instead of the bus. Signed-off-by: Wander Lairson Costa Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") --- lib/kunit/device.c | 2 +- 1

[PATCH v3 0/2] kunit: fix minor error path mistakes

2024-04-18 Thread Wander Lairson Costa
Hi, These two patches fix some minor error path mistakes in the device module. Changes --- v1->v2 * Add fixes tag * Add imperative statement in the commit description v2->v3 * Add a goto exit label kunit_device_register_internal Wander Lairson Costa (2): kunit: unregister the device on

Re: [PATCH v10 0/5] Introduce mseal

2024-04-18 Thread Suren Baghdasaryan
On Tue, Apr 16, 2024 at 12:40 PM Jeff Xu wrote: > > 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

Re: [PATCH v7 08/24] drivers/perf: riscv: Implement SBI PMU snapshot function

2024-04-18 Thread Samuel Holland
Hi Atish, On 2024-04-18 2:47 AM, Atish Patra wrote: > > On 4/16/24 21:02, Samuel Holland wrote: >> Hi Atish, >> >> On 2024-04-16 1:44 PM, Atish Patra wrote: >>> SBI v2.0 SBI introduced PMU snapshot feature which adds the following >>> features. >>> >>> 1. Read counter values directly from the

Re: [PATCH v4 7/9] riscv: vector: adjust minimum Vector requirement to ZVE32X

2024-04-18 Thread Conor Dooley
On Thu, Apr 18, 2024 at 11:41:29AM -0700, Eric Biggers wrote: > If the RISC-V kernel ever disables V, then it should also disable everything > that depends on V. > > This would be similar to how on x86, if the kernel decides to disable AVX to > mitigate the Gather Data Sampling vulnerability, it

Re: [PATCH net-next v3 8/8] selftests: drv-net: add a TCP ping test case (and useful helpers)

2024-04-18 Thread Jakub Kicinski
On Thu, 18 Apr 2024 10:44:39 -0400 Willem de Bruijn wrote: > > +def test_tcp(cfg) -> None: > > +port = random.randrange(1024 + (1 << 15)) > > +with bkg(f"nc -l {cfg.addr} {port}") as nc: > > +wait_port_listen(port) > > + > > +cmd(f"echo ping | nc {cfg.addr} {port}", > > +

[PATCH 03/10] KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for accurate KVM clock migration

2024-04-18 Thread David Woodhouse
From: Jack Allister In the common case (where kvm->arch.use_master_clock is true), the KVM clock is defined as a simple arithmetic function of the guest TSC, based on a reference point stored in kvm->arch.master_kernel_ns and kvm->arch.master_cycle_now. The existing KVM_[GS]ET_CLOCK

[PATCH 10/10] KVM: x86: Fix KVM clock precision in __get_kvmclock()

2024-04-18 Thread David Woodhouse
From: David Woodhouse When in 'master clock mode' (i.e. when host and guest TSCs are behaving sanely and in sync), the KVM clock is defined in terms of the guest TSC. When TSC scaling is used, calculating the KVM clock directly from *host* TSC cycles leads to a systemic drift from the values

[PATCH 09/10] KVM: x86: Kill KVM_REQ_GLOBAL_CLOCK_UPDATE

2024-04-18 Thread David Woodhouse
From: David Woodhouse This was introduced in commit 0061d53daf26 ("KVM: x86: limit difference between kvmclock updates") to reduce cross-vCPU differences which arose because the KVM clock was based on CLOCK_MONOTONIC and thus subject to NTP frequency corrections. However, commit 53fafdbb8b21

[PATCH 08/10] KVM: x86: Remove periodic global clock updates

2024-04-18 Thread David Woodhouse
From: David Woodhouse This effectively reverts commit 332967a3eac0 ("x86: kvm: introduce periodic global clock updates"). The periodic update was introduced to propagate NTP corrections to the guest KVM clock, when the KVM clock was based on CLOCK_MONOTONIC. However, commit 53fafdbb8b21 ("KVM:

[PATCH 05/10] KVM: x86: Explicitly disable TSC scaling without CONSTANT_TSC

2024-04-18 Thread David Woodhouse
From: David Woodhouse KVM does make an attempt to cope with non-constant TSC, and has notifiers to handle host TSC frequency changes. However, it *only* adjusts the KVM clock, and doesn't adjust TSC frequency scaling when the host changes. This is presumably because non-constant TSCs were fixed

[PATCH 01/10] KVM: x86/xen: Do not corrupt KVM clock in kvm_xen_shared_info_init()

2024-04-18 Thread David Woodhouse
From: David Woodhouse The KVM clock is an interesting thing. It is defined as "nanoseconds since the guest was created", but in practice it runs at two *different* rates — or three different rates, if you count implementation bugs. Definition A is that it runs synchronously with the

[RFC PATCH 0/10] Cleaning up the KVM clock mess

2024-04-18 Thread David Woodhouse
I lied, there aren't three different definitions of the KVM clock. The fourth is on i386, where it's still based on CLOCK_MONOTONIC (well, boot time which might as well be the same sine we offset it anyway). If we fix *that* to be based on CLOCK_MONOTONIC_RAW then we can rip out a whole bunch of

[PATCH 06/10] KVM: x86: Add KVM_VCPU_TSC_SCALE and fix the documentation on TSC migration

2024-04-18 Thread David Woodhouse
From: David Woodhouse The documentation on TSC migration using KVM_VCPU_TSC_OFFSET is woefully inadequate. It ignores TSC scaling, and ignores the fact that the host TSC may differ from one host to the next (and in fact because of the way the kernel calibrates it, it generally differs from one

[PATCH 02/10] KVM: x86: Improve accuracy of KVM clock when TSC scaling is in force

2024-04-18 Thread David Woodhouse
From: David Woodhouse The kvm_guest_time_update() function scales the host TSC frequency to the guest's using kvm_scale_tsc() and the v->arch.l1_tsc_scaling_ratio scaling ratio previously calculated for that vCPU. Then calcuates the scaling factors for the KVM clock itself based on that guest

[PATCH 04/10] KVM: selftests: Add KVM/PV clock selftest to prove timer correction

2024-04-18 Thread David Woodhouse
From: Jack Allister A VM's KVM/PV clock has an inherent relationship to its TSC (guest). When either the host system live-updates or the VM is live-migrated this pairing of the two clock sources should stay the same. In reality this is not the case without some correction taking place. Two new

[PATCH 07/10] KVM: x86: Avoid NTP frequency skew for KVM clock on 32-bit host

2024-04-18 Thread David Woodhouse
From: David Woodhouse Commit 53fafdbb8b21 ("KVM: x86: switch KVMCLOCK base to monotonic raw clock") did so only for 64-bit hosts, by capturing the boot offset from within the existing clocksource notifier update_pvclock_gtod(). That notifier was added in commit 16e8d74d2da9 ("KVM: x86: notifier

Re: [PATCH net-next v3 7/8] selftests: net: support matching cases by name prefix

2024-04-18 Thread Willem de Bruijn
Jakub Kicinski wrote: > On Thu, 18 Apr 2024 10:26:19 -0400 Willem de Bruijn wrote: > > > -def ksft_run(cases, args=()): > > > +def ksft_run(cases=None, globs=None, case_pfx=None, args=()): > > > +cases = cases or [] > > > + > > > +if globs and case_pfx: > > > +for key, value in

Re: [PATCH net-next v3 7/8] selftests: net: support matching cases by name prefix

2024-04-18 Thread Jakub Kicinski
On Thu, 18 Apr 2024 10:26:19 -0400 Willem de Bruijn wrote: > > -def ksft_run(cases, args=()): > > +def ksft_run(cases=None, globs=None, case_pfx=None, args=()): > > +cases = cases or [] > > + > > +if globs and case_pfx: > > +for key, value in globs.items(): > > +

Re: [PATCH v4 7/9] riscv: vector: adjust minimum Vector requirement to ZVE32X

2024-04-18 Thread Eric Biggers
On Thu, Apr 18, 2024 at 07:26:00PM +0100, Conor Dooley wrote: > That's great if it does require that the version of the vector extension > must be standard. Higher quality spec than most if it does. But > "supported" in the context of riscv_isa_extension_available() means that > the hardware

Re: [PATCH v4 7/9] riscv: vector: adjust minimum Vector requirement to ZVE32X

2024-04-18 Thread Conor Dooley
On Thu, Apr 18, 2024 at 07:26:00PM +0100, Conor Dooley wrote: > On Thu, Apr 18, 2024 at 10:39:46AM -0700, Eric Biggers wrote: > > On Thu, Apr 18, 2024 at 10:32:03AM -0700, Eric Biggers wrote: > > > On Thu, Apr 18, 2024 at 05:53:55PM +0100, Conor Dooley wrote: > > > > > If it would be useful to do

Re: [PATCH v4 7/9] riscv: vector: adjust minimum Vector requirement to ZVE32X

2024-04-18 Thread Conor Dooley
On Thu, Apr 18, 2024 at 10:39:46AM -0700, Eric Biggers wrote: > On Thu, Apr 18, 2024 at 10:32:03AM -0700, Eric Biggers wrote: > > On Thu, Apr 18, 2024 at 05:53:55PM +0100, Conor Dooley wrote: > > > > If it would be useful to do so, we should be able to enable some of the > > > > code > > > > with

Re: [ 2/2] kunit: avoid memory leak on device register error

2024-04-18 Thread Markus Elfring
>> Common error handling code can be used instead >> if an additional label would be applied for a corresponding jump target. >> >> How do you think about to increase the application of scope-based resource >> management here? > > I thought about that. But I think the code is simple enough (for

Re: [PATCH v4 7/9] riscv: vector: adjust minimum Vector requirement to ZVE32X

2024-04-18 Thread Eric Biggers
On Thu, Apr 18, 2024 at 10:32:03AM -0700, Eric Biggers wrote: > On Thu, Apr 18, 2024 at 05:53:55PM +0100, Conor Dooley wrote: > > > If it would be useful to do so, we should be able to enable some of the > > > code > > > with a smaller VLEN and/or EEW once it has been tested in those > > >

Re: [PATCH v4 7/9] riscv: vector: adjust minimum Vector requirement to ZVE32X

2024-04-18 Thread Eric Biggers
On Thu, Apr 18, 2024 at 05:53:55PM +0100, Conor Dooley wrote: > > If it would be useful to do so, we should be able to enable some of the code > > with a smaller VLEN and/or EEW once it has been tested in those > > configurations. > > Some of it should work, but some of it won't be able to work.

Re: [PATCH] selftests: mm: restore settings from only parent process

2024-04-18 Thread Muhammad Usama Anjum
On 4/18/24 5:52 PM, Joey Gouly wrote:> Hi again, > > On Thu, Mar 14, 2024 at 02:40:45PM +0500, Muhammad Usama Anjum wrote: >> The atexit() is called from parent process as well as forked processes. >> Hence the child restores the settings at exit while the parent is still >> executing. Fix this

Re: [PATCH 2/2] kunit: avoid memory leak on device register error

2024-04-18 Thread Wander Lairson Costa
On Thu, Apr 18, 2024 at 12:24 PM Markus Elfring wrote: > > > If the device register fails, free the allocated memory before > > returning. > > * I suggest to use the word “registration” (instead of “register”) > in the commit message. > > * Would you like to add the tag “Fixes” accordingly? > >

Re: selftests: resctrl: cat_test.c: In function 'noncont_cat_run_test': ../kselftest.h:74:9: error: impossible constraint in 'asm' 74 | __asm__ __volatile__ ("cpuid\n\t"

2024-04-18 Thread Reinette Chatre
On 4/18/2024 2:37 AM, Naresh Kamboju wrote: > The Linux next building selftests with gcc-13 found these build warnings > and errors. > > Reported-by: Linux Kernel Functional Testing > > Build log: > - > Path: > selftests/resctrl/resctrl_tests/ > > In file included from resctrl.h:24,

Re: [PATCH v4 7/9] riscv: vector: adjust minimum Vector requirement to ZVE32X

2024-04-18 Thread Conor Dooley
On Thu, Apr 18, 2024 at 08:52:56AM -0700, Eric Biggers wrote: > Hi Conor, > > On Thu, Apr 18, 2024 at 12:02:10PM +0100, Conor Dooley wrote: > > +CC Eric, Jerry > > > > On Fri, Apr 12, 2024 at 02:49:03PM +0800, Andy Chiu wrote: > > > Make has_vector take one argument. This argument represents the

Re: [PATCH v2 bpf-next 4/6] selftests/bpf: Add IPv4 and IPv6 sockaddr test cases

2024-04-18 Thread Jordan Rife
> The test_sock_addr.{c,sh} can be retired as long as all its tests are migrated > to sock_addr.c test_sock_addr.c has a few more test dimensions than prog_tests/sock_addr.c currently does, so it covers a few more scenarios. struct sock_addr_test { const char *descr; /* BPF prog

Re: [PATCH v2 0/2] kunit: fix minor error path mistakes

2024-04-18 Thread Maxime Ripard
On Thu, 18 Apr 2024 13:00:36 -0300, Wander Lairson Costa wrote: > Hi, > > These two patches fix some minor error path mistakes in the device > module. > > > [ ... ] Reviewed-by: Maxime Ripard Thanks! Maxime

[PATCH v2 2/2] kunit: avoid memory leak on device register error

2024-04-18 Thread Wander Lairson Costa
If the device register fails, free the allocated memory before returning. Signed-off-by: Wander Lairson Costa Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") --- lib/kunit/device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/kunit/device.c b/lib/kunit/device.c index

[PATCH v2 1/2] kunit: unregister the device on error

2024-04-18 Thread Wander Lairson Costa
kunit_init_device() should unregister the device on bus register error, but mistakenly it tries to unregister the bus. Unregister the device instead of the bus. Signed-off-by: Wander Lairson Costa Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") --- lib/kunit/device.c | 2 +- 1

[PATCH v2 0/2] kunit: fix minor error path mistakes

2024-04-18 Thread Wander Lairson Costa
Hi, These two patches fix some minor error path mistakes in the device module. Changes: v1->v2: * Add fixes tag. * Add an imperative statement in the first commit descripton. Wander Lairson Costa (2): kunit: unregister the device on error kunit: avoid memory leak on device

Re: [PATCH v4 7/9] riscv: vector: adjust minimum Vector requirement to ZVE32X

2024-04-18 Thread Eric Biggers
Hi Conor, On Thu, Apr 18, 2024 at 12:02:10PM +0100, Conor Dooley wrote: > +CC Eric, Jerry > > On Fri, Apr 12, 2024 at 02:49:03PM +0800, Andy Chiu wrote: > > Make has_vector take one argument. This argument represents the minimum > > Vector subextension that the following Vector actions assume. >

[PATCH] selftests: cpufreq: conform test to TAP

2024-04-18 Thread Muhammad Usama Anjum
This test outputs lots of information. Let's conform the core part of the test to TAP and leave the information printing messages for now. Include ktap_helpers.sh to print conformed logs. Use KSFT_* macros to return the correct exit code for the kselftest framework and CIs to understand the exit

Re: [PATCH 2/2] kunit: avoid memory leak on device register error

2024-04-18 Thread Markus Elfring
> If the device register fails, free the allocated memory before > returning. * I suggest to use the word “registration” (instead of “register”) in the commit message. * Would you like to add the tag “Fixes” accordingly? > +++ b/lib/kunit/device.c > @@ -131,6 +131,7 @@ static struct

Re: [PATCH 1/2] kunit: unregister the device on error

2024-04-18 Thread Wander Lairson Costa
On Thu, Apr 18, 2024 at 12:06 PM Markus Elfring wrote: > > > kunit_init_device() should unregister the device on bus register error. > > * Would another imperative wording be desirable also for this change > description? It makes sense, I will change the comment description. > > * Will the

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

2024-04-18 Thread Richard Gobert
Paolo Abeni wrote: > 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

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

2024-04-18 Thread Richard Gobert
Paolo Abeni wrote: > 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 >>>

Re: [PATCH 1/2] kunit: unregister the device on error

2024-04-18 Thread Markus Elfring
> kunit_init_device() should unregister the device on bus register error. * Would another imperative wording be desirable also for this change description? * Will the tag “Fixes” become relevant here? Regards, Markus

Re: [PATCH net-next v3 8/8] selftests: drv-net: add a TCP ping test case (and useful helpers)

2024-04-18 Thread Willem de Bruijn
Jakub Kicinski wrote: > More complex tests often have to spawn a background process, > like a server which will respond to requests or tcpdump. > > Add support for creating such processes using the with keyword: > > with bkg("my-daemon", ..): > # my-daemon is alive in this block > > My

Re: [PATCH net-next v3 7/8] selftests: net: support matching cases by name prefix

2024-04-18 Thread Willem de Bruijn
Jakub Kicinski wrote: > While writing tests with a lot more cases I got tired of having > to jump back and forth to add the name of the test to the ksft_run() > list. Most unittest frameworks do some name matching, e.g. assume > that functions with names starting with test_ are test cases. > >

Re: [PATCH v2 00/12] Add support for a few Zc* extensions as well as Zcmop

2024-04-18 Thread Anup Patel
Hi Palmer, On Thu, Apr 18, 2024 at 6:13 PM Clément Léger wrote: > > Add support for (yet again) more RVA23U64 missing extensions. Add > support for Zcmop, Zca, Zcf, Zcd and Zcb extensions isa string parsing, > hwprobe and kvm support. Zce, Zcmt and Zcmp extensions have been left > out since they

Re: [PATCH v2 12/12] KVM: riscv: selftests: Add Zcmop extension to get-reg-list test

2024-04-18 Thread Anup Patel
On Thu, Apr 18, 2024 at 6:14 PM Clément Léger wrote: > > The KVM RISC-V allows Zcmop extension for Guest/VM so add this > extension to get-reg-list test. > > Signed-off-by: Clément Léger LGTM. Reviewed-by: Anup Patel Acked-by: Anup Patel Thanks, Anup > --- >

Re: [PATCH v2 11/12] RISC-V: KVM: Allow Zcmop extension for Guest/VM

2024-04-18 Thread Anup Patel
On Thu, Apr 18, 2024 at 6:14 PM Clément Léger wrote: > > Extend the KVM ISA extension ONE_REG interface to allow KVM user space > to detect and enable Zcmop extension for Guest/VM. > > Signed-off-by: Clément Léger LGTM. Reviewed-by: Anup Patel Acked-by: Anup Patel Thanks, Anup > --- >

Re: [PATCH v2 07/12] KVM: riscv: selftests: Add some Zc* extensions to get-reg-list test

2024-04-18 Thread Anup Patel
On Thu, Apr 18, 2024 at 6:14 PM Clément Léger wrote: > > The KVM RISC-V allows Zca, Zcf, Zcd and Zcb extensions for Guest/VM so > add these extensions to get-reg-list test. > > Signed-off-by: Clément Léger LGTM. Reviewed-by: Anup Patel Acked-by: Anup Patel Thanks, Anup > --- >

Re: [PATCH v2 06/12] RISC-V: KVM: Allow Zca, Zcf, Zcd and Zcb extensions for Guest/VM

2024-04-18 Thread Anup Patel
On Thu, Apr 18, 2024 at 6:14 PM Clément Léger wrote: > > Extend the KVM ISA extension ONE_REG interface to allow KVM user space > to detect and enable Zca, Zcf, Zcd and Zcb extensions for Guest/VM. > > Signed-off-by: Clément Léger LGTM. Reviewed-by: Anup Patel Acked-by: Anup Patel Thanks,

[PATCH 2/2] kunit: avoid memory leak on device register error

2024-04-18 Thread Wander Lairson Costa
If the device register fails, free the allocated memory before returning. Signed-off-by: Wander Lairson Costa --- lib/kunit/device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/kunit/device.c b/lib/kunit/device.c index 25c81ed465fb..d8c09dcb3e79 100644 --- a/lib/kunit/device.c +++

[PATCH 1/2] kunit: unregister the device on error

2024-04-18 Thread Wander Lairson Costa
kunit_init_device() should unregister the device on bus register error. Signed-off-by: Wander Lairson Costa --- lib/kunit/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kunit/device.c b/lib/kunit/device.c index abc603730b8e..25c81ed465fb 100644 ---

[PATCH 0/2] kunit: fix minor error path mistakes

2024-04-18 Thread Wander Lairson Costa
Hi, These two patches fix some minor error path mistakes in the device module. Wander Lairson Costa (2): kunit: unregister the device on error kunit: avoid memory leak on device register error lib/kunit/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.44.0

Re: [PATCH] selftests: mm: restore settings from only parent process

2024-04-18 Thread Joey Gouly
Hi again, On Thu, Mar 14, 2024 at 02:40:45PM +0500, Muhammad Usama Anjum wrote: > The atexit() is called from parent process as well as forked processes. > Hence the child restores the settings at exit while the parent is still > executing. Fix this by checking pid of atexit() calling process and

[PATCH v2 12/12] KVM: riscv: selftests: Add Zcmop extension to get-reg-list test

2024-04-18 Thread Clément Léger
The KVM RISC-V allows Zcmop 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 v2 11/12] RISC-V: KVM: Allow Zcmop extension for Guest/VM

2024-04-18 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zcmop 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 v2 10/12] riscv: hwprobe: export Zcmop ISA extension

2024-04-18 Thread Clément Léger
Export Zcmop 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 v2 09/12] riscv: add ISA extension parsing for Zcmop

2024-04-18 Thread Clément Léger
Add parsing for Zcmop ISA extension which was ratified in commit b854a709c00 ("Zcmop is ratified/1.0") 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

[PATCH v2 08/12] dt-bindings: riscv: add Zcmop ISA extension description

2024-04-18 Thread Clément Léger
Add description for the Zcmop (Compressed May-Be-Operations) ISA extension which was ratified in commit c732a4f39a4 ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger --- .../devicetree/bindings/riscv/extensions.yaml| 12 1 file changed, 12

[PATCH v2 07/12] KVM: riscv: selftests: Add some Zc* extensions to get-reg-list test

2024-04-18 Thread Clément Léger
The KVM RISC-V allows Zca, Zcf, Zcd and Zcb extensions for Guest/VM so add these extensions to get-reg-list test. Signed-off-by: Clément Léger --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 16 1 file changed, 16 insertions(+) diff --git

[PATCH v2 06/12] RISC-V: KVM: Allow Zca, Zcf, Zcd and Zcb extensions for Guest/VM

2024-04-18 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zca, Zcf, Zcd and Zcb extensions for Guest/VM. Signed-off-by: Clément Léger --- arch/riscv/include/uapi/asm/kvm.h | 4 arch/riscv/kvm/vcpu_onereg.c | 8 2 files changed, 12

[PATCH v2 05/12] riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions

2024-04-18 Thread Clément Léger
Export Zca, Zcf, Zcd and Zcb ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 20 arch/riscv/include/uapi/asm/hwprobe.h | 4 arch/riscv/kernel/sys_hwprobe.c | 4 3 files changed, 28 insertions(+) diff

[PATCH v2 04/12] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-04-18 Thread Clément Léger
The Zc* standard extension for code reduction introduces new extensions. This patch adds support for Zca, Zcf, Zcd and Zcb. Zce, Zcmt and Zcmp are left out of this patch since they are targeting microcontrollers/ embedded CPUs instead of application processors. Signed-off-by: Clément Léger ---

[PATCH v2 02/12] riscv: dts: enable Zc* extensions when needed

2024-04-18 Thread Clément Léger
The Zc* spec states that: "The C extension is the superset of the following extensions: - Zca - Zcf if F is specified (RV32 only) - Zcd if D is specified As C defines the same instructions as Zca, Zcf and Zcd, the rule is that: - C always implies Zca - C+F implies Zcf (RV32 only)" Add

[PATCH v2 03/12] dt-bindings: riscv: add Zc* extension rules implied by C extension

2024-04-18 Thread Clément Léger
As stated by Zc* spec: "As C defines the same instructions as Zca, Zcf and Zcd, the rule is that: - C always implies Zca - C+F implies Zcf (RV32 only) - C+D implies Zcd" Add additionnal validation rules to enforce this in dts. Signed-off-by: Clément Léger ---

[PATCH v2 01/12] dt-bindings: riscv: add Zca, Zcf, Zcd and Zcb ISA extension description

2024-04-18 Thread Clément Léger
Add description for Zca, Zcf, Zcd and Zcb extensions which are part the Zc* standard extensions for code size reduction. Additional validation rules are added since Zcb depends on Zca, Zcf, depends on Zca and F, Zcd depends on Zca and D and finally, Zcf can not be present on rv64. Signed-off-by:

[PATCH v2 00/12] Add support for a few Zc* extensions as well as Zcmop

2024-04-18 Thread Clément Léger
Add support for (yet again) more RVA23U64 missing extensions. Add support for Zcmop, Zca, Zcf, Zcd and Zcb extensions isa string parsing, hwprobe and kvm support. Zce, Zcmt and Zcmp extensions have been left out since they target microcontrollers/embedded CPUs and are not needed by RVA23U64 This

selftests: arm64: check_buffer_fill.c:94:93: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'char *' [-Wformat=]

2024-04-18 Thread Naresh Kamboju
The Linux next building selftests with clang and gcc-13 found these build warnings. Reported-by: Linux Kernel Functional Testing Build log: - PATH: Reported build warnings noticed on following test files, selftests/arm64/mte/ * check_buffer_fill.c * mte_common_util.c

selftests: arm64: sve-ptrace.c:85:40: warning: data argument not used by format string [-Wformat-extra-args]

2024-04-18 Thread Naresh Kamboju
The Linux next building selftests with clang-17 and gcc-13 found these build warnings. Reported-by: Linux Kernel Functional Testing Build log: - PATH: selftests/arm64/fp The reported build warnings noticed on following test files. * sve-ptrace.c * za-ptrace.c * zt-ptrace.c

Re: tools/testing/selftests/clone3/clone3_set_tid.c appears to always pass?

2024-04-18 Thread Christian Brauner
On Wed, Apr 17, 2024 at 08:22:22AM -0700, Nathan Chancellor wrote: > Hi Christian, > > I am looking at tools/testing/selftests/clone3/clone3_set_tid.c as part > of a patch to clean up the uses of 'return ksft_exit_...();' throughout > the selftests (as they call exit() so they do not return) and

Re: [PATCH v4 7/9] riscv: vector: adjust minimum Vector requirement to ZVE32X

2024-04-18 Thread Conor Dooley
+CC Eric, Jerry On Fri, Apr 12, 2024 at 02:49:03PM +0800, Andy Chiu wrote: > Make has_vector take one argument. This argument represents the minimum > Vector subextension that the following Vector actions assume. > > Also, change riscv_v_first_use_handler(), and boot code that calls >

Re: [PATCH v4 3/9] riscv: cpufeature: call match_isa_ext() for single-letter extensions

2024-04-18 Thread Conor Dooley
On Fri, Apr 12, 2024 at 02:48:59PM +0800, Andy Chiu wrote: > Single-letter extensions may also imply multiple subextensions. For > example, Vector extension implies zve64d, and zve64d implies zve64f. > > Extension parsing for "riscv,isa-extensions" has the ability to resolve > the dependency by

Re: [PATCH v4 5/9] dt-bindings: riscv: add Zve32[xf] Zve64[xfd] ISA extension description

2024-04-18 Thread Conor Dooley
On Fri, Apr 12, 2024 at 02:49:01PM +0800, Andy Chiu wrote: > Add description for Zve32x Zve32f Zve64x Zve64f Zve64d ISA extensions. > > Signed-off-by: Andy Chiu Technically this should be before the patch using them in the kernel, but Acked-by: Conor Dooley Cheers, Conor. signature.asc

Re: [PATCH v4 4/9] riscv: cpufeature: add zve32[xf] and zve64[xfd] isa detection

2024-04-18 Thread Conor Dooley
On Fri, Apr 12, 2024 at 02:49:00PM +0800, Andy Chiu wrote: > Multiple Vector subextensions are added. Also, the patch takes care of > the dependencies of Vector subextensions by macro expansions. So, if > some "embedded" platform only reports "zve64f" on the ISA string, the > parser is able to

Re: [PATCH v4 2/9] riscv: smp: fail booting up smp if inconsistent vlen is detected

2024-04-18 Thread Conor Dooley
On Fri, Apr 12, 2024 at 02:48:58PM +0800, Andy Chiu wrote: > Currently we only support Vector for SMP platforms, that is, all SMP > cores have the same vlenb. If we happen to detect a mismatching vlen, it > is better to just fail bootting it up to prevent further race/scheduling > issues. > >

Re: [PATCH v4 1/9] riscv: vector: add a comment when calling riscv_setup_vsize()

2024-04-18 Thread Conor Dooley
On Fri, Apr 12, 2024 at 02:48:57PM +0800, Andy Chiu wrote: > The function would fail when it detects the calling hart's vlen doesn't > match the first one's. The boot hart is the first hart calling this > function during riscv_fill_hwcap, so it is impossible to fail here. Add > a comment about

selftests: resctrl: cat_test.c: In function 'noncont_cat_run_test': ../kselftest.h:74:9: error: impossible constraint in 'asm' 74 | __asm__ __volatile__ ("cpuid\n\t"

2024-04-18 Thread Naresh Kamboju
The Linux next building selftests with gcc-13 found these build warnings and errors. Reported-by: Linux Kernel Functional Testing Build log: - Path: selftests/resctrl/resctrl_tests/ In file included from resctrl.h:24, from cat_test.c:11: cat_test.c: In function

selftests: mm: seal_elf.c:140:45: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'char (*)[5]' [-Wformat=]

2024-04-18 Thread Naresh Kamboju
The Linux next building selftests with gcc-13 found these build warnings and errors. Reported-by: Linux Kernel Functional Testing Build log: - PATH: selftests/mm/seal_elf seal_elf.c: In function 'test_seal_elf': seal_elf.c:140:45: warning: format '%s' expects argument of type 'char *',

Re: [PATCH v4 02/27] ntsync: Introduce NTSYNC_IOC_WAIT_ALL.

2024-04-18 Thread Peter Zijlstra
On Wed, Apr 17, 2024 at 03:03:05PM -0500, Elizabeth Figura wrote: > Ach. I wrote this with the idea that the race isn't meaningful, but > looking at it again you're right—there is a harmful race here. > > I think it should be fixable by moving the atomic_read inside the lock, > though. Right,

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

2024-04-18 Thread Benjamin Tissoires
On Thu, Apr 18, 2024 at 5:25 AM Song Liu wrote: > > On Tue, Apr 16, 2024 at 7:11 AM Benjamin Tissoires wrote: > [...] > > > +SEC("?tc") > > +__log_level(2) > > +__failure > > +/* check that the first argument of bpf_wq_set_callback() > > + * is a correct bpf_wq pointer. > > + */ > >

[PATCH bpf-next v5 6/6] selftests/bpf: Use connect_to_addr in sk_assign

2024-04-18 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 v5 5/6] selftests/bpf: Use connect_to_addr in cls_redirect

2024-04-18 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 v5 4/6] selftests/bpf: Update arguments of connect_to_addr

2024-04-18 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 add a network_helper_opts argument as the fourth one. Then change its usages in sock_addr.c too. Signed-off-by: Geliang Tang ---

[PATCH bpf-next v5 3/6] selftests/bpf: Use start_server_addr in sk_assign

2024-04-18 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 v5 2/6] selftests/bpf: Use start_server_addr in cls_redirect

2024-04-18 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 |

  1   2   >