Re: [PATCH net] selftests: net: lib: kill PIDs before del netns

2024-08-13 Thread Hangbin Liu
s pids "${ns}" 2> /dev/null | xargs -r kill || true > ip netns delete "${ns}" &> /dev/null || true > if ! busywait $BUSYWAIT_TIMEOUT ip netns list \| grep -vq > "^$ns$" &> /dev/null; then >

Re: [PATCH net v2] selftest: af_unix: Fix kselftest compilation warnings

2024-08-13 Thread Jakub Kicinski
On Tue, 13 Aug 2024 00:41:22 +0530 Abhinav Jain wrote: > Change the parameter expected_buf from (const void *) to (const char *) > in the function __recvpair() as per the feedback in v1. > Add Fixes tag as per feedback in v1. > > This change fixes the below warnings during test compilation: > > `

Re: [PATCH bpf-next] selftests/bpf: Avoid subtraction after htons() in ipip tests

2024-08-13 Thread Martin KaFai Lau
On 8/8/24 2:24 AM, Toke Høiland-Jørgensen wrote: Asbjørn Sloth Tønnesen writes: On little-endian systems, doing subtraction after htons() leads to interesting results: Given: MAGIC_BYTES = 123 = 0x007B aka. in big endian: 0x7B00 = 31488 sizeof(struct iphdr) = 20 Before this patch: __bp

Re: [PATCH bpf-next v4 2/2] selftests/bpf: Add mptcp subflow subtest

2024-08-13 Thread Martin KaFai Lau
On 8/5/24 2:52 AM, Matthieu Baerts (NGI0) wrote: +static int endpoint_init(char *flags) +{ + SYS(fail, "ip -net %s link add veth1 type veth peer name veth2", NS_TEST); + SYS(fail, "ip -net %s addr add %s/24 dev veth1", NS_TEST, ADDR_1); + SYS(fail, "ip -net %s link set dev veth

Re: [PATCH 0/6] Extend pmu_counters_test to AMD CPUs

2024-08-13 Thread Sean Christopherson
On Tue, Aug 13, 2024, Colton Lewis wrote: > Sean Christopherson writes: > > > On Tue, Aug 13, 2024, Colton Lewis wrote: > > > (I was positive I had sent this already, but I couldn't find it on the > > > mailing list to reply to and ask for reviews.) > > > You did[*], it's sitting in my todo fold

Re: [PATCH] selftests/ftrace: Add required dependency for kprobe tests

2024-08-13 Thread Google
Hi Shuah, Can you pick this? I confirmed this can be applied on v6.11-rc3. On Thu, 13 Jun 2024 07:12:10 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > kprobe_args_{char,string}.tc are using available_filter_functions file > which is provided by function trace

[PATCH v3 3/3] selftests/tracing: Add hist poll() support test

2024-08-13 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a testcase for poll() on hist file. This introduces a helper binary to the ftracetest, because there is no good way to reliably execute poll() on hist file. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Update poll command to support both o

[PATCH v3 2/3] tracing/hist: Support POLLPRI event for poll on histogram

2024-08-13 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since POLLIN will not be flashed until read the hist file, user needs to repeat read() and poll() on hist for monitoring the event continuously. But the read() is somewhat redundant only for monitoring events. This add POLLPRI poll event on hist, this event return

[PATCH v3 1/3] tracing/hist: Add poll(POLLIN) support on hist file

2024-08-13 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add poll syscall support on the `hist` file. The Waiter will be waken up when the histogram is updated with POLLIN. Currently, there is no way to wait for a specific event in userspace. So user needs to peek the `trace` periodicaly, or wait on `trace_pipe`. But th

[PATCH v3 0/3] tracing: Support poll on event hist file

2024-08-13 Thread Masami Hiramatsu (Google)
Hi, Here is the v3 patch to support polling on event 'hist' file. The previous version is here; https://lore.kernel.org/all/171998475175.54594.7244942110355338359.stgit@devnote2/ This version is rebased on the v6.11-rc3. Background -- There has been interest in allowing user programs to

Re: [PATCH v3 7/7] Docs/admin-guide/mm/workingset_report: document sysfs and memcg interfaces

2024-08-13 Thread Randy Dunlap
Hi, On 8/13/24 9:56 AM, Yuanchu Xie wrote: > Add workingset reporting documentation for better discoverability of > its sysfs and memcg interfaces. Also document the required kernel > config to enable workingset reporting. > > Change-Id: Ib9dfc9004473baa6ef26ca7277d220b6199517de > Signed-off-by:

Re: [PATCH net-next v2] net: netconsole: selftests: Create a new netconsole selftest

2024-08-13 Thread Jakub Kicinski
On Tue, 13 Aug 2024 11:38:16 -0700 Breno Leitao wrote: > Adds a selftest that creates two virtual interfaces, assigns one to a > new namespace, and assigns IP addresses to both. > > It listens on the destination interface using socat and configures a > dynamic target on netconsole, pointing to the

Re: [PATCH] selftests: mm: Fix build errors on armhf

2024-08-13 Thread Jeff Xu
Hi Muhammad On Fri, Aug 9, 2024 at 1:25 AM Muhammad Usama Anjum wrote: > > The __NR_mmap isn't found on armhf. The mmap() is commonly available > system call and its wrapper is presnet on all architectures. So it > should be used directly. It solves problem for armhf and doesn't create > problem

[PATCH net-next v19 13/13] netdev: add dmabuf introspection

2024-08-13 Thread Mina Almasry
Add dmabuf information to page_pool stats: $ ./cli.py --spec ../netlink/specs/netdev.yaml --dump page-pool-get ... {'dmabuf': 10, 'id': 456, 'ifindex': 3, 'inflight': 1023, 'inflight-mem': 4190208}, {'dmabuf': 10, 'id': 455, 'ifindex': 3, 'inflight': 1023, 'inflight-mem': 4190208

[PATCH net-next v19 12/13] selftests: add ncdevmem, netcat for devmem TCP

2024-08-13 Thread Mina Almasry
ncdevmem is a devmem TCP netcat. It works similarly to netcat, but it sends and receives data using the devmem TCP APIs. It uses udmabuf as the dmabuf provider. It is compatible with a regular netcat running on a peer, or a ncdevmem running on a peer. In addition to normal netcat support, ncdevmem

[PATCH net-next v19 11/13] net: add devmem TCP documentation

2024-08-13 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry Reviewed-by: Bagas Sanjaya Reviewed-by: Donald Hunter --- v16: - Add documentation on unbinding the NIC from dmabuf (Donald). - Add note that any dmabuf should work (Donald). v9: https://lore.kernel

[PATCH net-next v19 10/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-08-13 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewe

[PATCH net-next v19 09/13] tcp: RX path for devmem TCP

2024-08-13 Thread Mina Almasry
In tcp_recvmsg_locked(), detect if the skb being received by the user is a devmem skb. In this case - if the user provided the MSG_SOCK_DEVMEM flag - pass it to tcp_recvmsg_devmem() for custom handling. tcp_recvmsg_devmem() copies any data in the skb header to the linear buffer, and returns a cmsg

[PATCH net-next v19 08/13] net: add support for skbs with unreadable frags

2024-08-13 Thread Mina Almasry
For device memory TCP, we expect the skb headers to be available in host memory for access, and we expect the skb frags to be in device memory and unaccessible to the host. We expect there to be no mixing and matching of device memory frags (unaccessible) with host memory frags (accessible) in the

[PATCH net-next v19 07/13] net: support non paged skb frags

2024-08-13 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevant callers to handle this case. Signed-off-by: Mina Almasry Reviewed-by: Eric Dumazet --- v10: - Fixed newly generated kdoc warnings found by patchwork. While we're at it, fix the Return section

[PATCH net-next v19 06/13] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Mina Almasry
Implement a memory provider that allocates dmabuf devmem in the form of net_iov. The provider receives a reference to the struct netdev_dmabuf_binding via the pool->mp_priv pointer. The driver needs to set this pointer for the provider in the net_iov. The provider obtains a reference on the netde

[PATCH net-next v19 05/13] page_pool: devmem support

2024-08-13 Thread Mina Almasry
Convert netmem to be a union of struct page and struct netmem. Overload the LSB of struct netmem* to indicate that it's a net_iov, otherwise it's a page. Currently these entries in struct page are rented by the page_pool and used exclusively by the net stack: struct { unsigned long pp_mag

[PATCH net-next v19 04/13] netdev: netdevice devmem allocator

2024-08-13 Thread Mina Almasry
Implement netdev devmem allocator. The allocator takes a given struct netdev_dmabuf_binding as input and allocates net_iov from that binding. The allocation simply delegates to the binding's genpool for the allocation logic and wraps the returned memory region in a net_iov struct. Signed-off-by:

[PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-13 Thread Mina Almasry
Add a netdev_dmabuf_binding struct which represents the dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to rx queues on the netdevice. On the binding, the dma_buf_attach & dma_buf_map_attachment will occur. The entries in the sg_table from mapping will be inserted into a genpool

[PATCH net-next v19 02/13] net: netdev netlink api to bind dma-buf to a net device

2024-08-13 Thread Mina Almasry
API takes the dma-buf fd as input, and binds it to the netdevice. The user can specify the rx queues to bind the dma-buf to. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry Reviewed-by: Donald Hunter Reviewed-by: Jakub Kicinski --- v16: - Use subset-of: queue queue-id instead of

[PATCH net-next v19 01/13] netdev: add netdev_rx_queue_restart()

2024-08-13 Thread Mina Almasry
Add netdev_rx_queue_restart(), which resets an rx queue using the queue API recently merged[1]. The queue API was merged to enable the core net stack to reset individual rx queues to actuate changes in the rx queue's configuration. In later patches in this series, we will use netdev_rx_queue_resta

[PATCH net-next v19 00/13] Device Memory TCP

2024-08-13 Thread Mina Almasry
v19: https://patchwork.kernel.org/project/netdevbpf/list/?series=876852&state=* v18 got a thorough review (thanks!), and this iteration addresses the feedback. Major changes: - Prevent deactivating mp bound queues. - Prevent installing xdp on mp bound netdevs, or installing mps on xdp inst

Re: [PATCH 0/6] Extend pmu_counters_test to AMD CPUs

2024-08-13 Thread Colton Lewis
Sean Christopherson writes: On Tue, Aug 13, 2024, Colton Lewis wrote: (I was positive I had sent this already, but I couldn't find it on the mailing list to reply to and ask for reviews.) You did[*], it's sitting in my todo folder. Two things. 1. Err on the side of caution when potential

Re: [PATCH 1/1 V2] Kselftest: msg_oob.c: Fix Compiler Warning For Incorrect Specifier

2024-08-13 Thread Kuniyuki Iwashima
From: David Hunter Date: Tue, 13 Aug 2024 15:19:32 -0400 > Apologies for not looking ahead of time. I definitely need to remember > to check ahead of time. I understand that the other person was first; I > just wanted to get some practice sending patches. This is all still new > to me. I understa

Re: [PATCH v2 1/1] selftests: net: af_unix: convert param to const char* in __recvpair() to fix warning

2024-08-13 Thread Kuniyuki Iwashima
From: Mirsad Todorovac Date: Tue, 13 Aug 2024 18:20:06 +0200 > GCC 13.2.0 reported warning about (void *) being used as a param where (char > *) > is expected: [...] > As Simon suggested, all calls to __recvpair() have char * as expected_buf > param, so > it is safe to change param type from (co

[PATCH 1/1 V2] Kselftest: msg_oob.c: Fix Compiler Warning For Incorrect Specifier

2024-08-13 Thread David Hunter
Change declaration to 'char *'. A specifier involved with a macro is causing a misleading warning to occur: ''' In file included from msg_oob.c:14: msg_oob.c: In function ‘__recvpair’: ../../kselftest_harness.h:106:40: warning: format ‘%s’ expects argument of type ‘char *’, but argument 6

Re: [PATCH RFT v8 4/9] fork: Add shadow stack support to clone3()

2024-08-13 Thread Mark Brown
On Tue, Aug 13, 2024 at 05:25:47PM +0100, Catalin Marinas wrote: > However, the x86 would be slightly inconsistent here between clone() and > clone3(). I guess it depends how you look at it. The classic clone() > syscall, if one doesn't pass CLONE_VM but does set new stack, there's no > new shadow

[PATCH net-next v2] net: netconsole: selftests: Create a new netconsole selftest

2024-08-13 Thread Breno Leitao
Adds a selftest that creates two virtual interfaces, assigns one to a new namespace, and assigns IP addresses to both. It listens on the destination interface using socat and configures a dynamic target on netconsole, pointing to the destination IP address. The test then checks if the message was

Re: [PATCH v3 0/7] mm: workingset reporting

2024-08-13 Thread Andrew Morton
On Tue, 13 Aug 2024 09:56:11 -0700 Yuanchu Xie wrote: > This patch series provides workingset reporting of user pages in > lruvecs, of which coldness can be tracked by accessed bits and fd > references. Very little reviewer interest. I wonder why. Will Google be the only organization which fin

Re: [PATCH v3 7/7] Docs/admin-guide/mm/workingset_report: document sysfs and memcg interfaces

2024-08-13 Thread Waiman Long
On 8/13/24 12:56, Yuanchu Xie wrote: Add workingset reporting documentation for better discoverability of its sysfs and memcg interfaces. Also document the required kernel config to enable workingset reporting. Change-Id: Ib9dfc9004473baa6ef26ca7277d220b6199517de Signed-off-by: Yuanchu Xie --

Re: [bpf-next 0/3] samples/bpf: Remove obsolete tracing-related tests

2024-08-13 Thread Daniel T. Lee
On Tue, Aug 13, 2024 at 6:17 AM Andrii Nakryiko wrote: > > On Sun, Aug 11, 2024 at 5:45 PM Daniel T. Lee wrote: > > > > The BPF tracing infrastructure has undergone significant evolution, > > leading to the introduction of more robust and efficient APIs. > > However, some of the existing tests in

Re: [PATCH 0/6] Extend pmu_counters_test to AMD CPUs

2024-08-13 Thread Sean Christopherson
On Tue, Aug 13, 2024, Colton Lewis wrote: > (I was positive I had sent this already, but I couldn't find it on the > mailing list to reply to and ask for reviews.) You did[*], it's sitting in my todo folder. Two things. 1. Err on the side of caution when potentially resending, and tag everything

[PATCH v3 7/7] Docs/admin-guide/mm/workingset_report: document sysfs and memcg interfaces

2024-08-13 Thread Yuanchu Xie
Add workingset reporting documentation for better discoverability of its sysfs and memcg interfaces. Also document the required kernel config to enable workingset reporting. Change-Id: Ib9dfc9004473baa6ef26ca7277d220b6199517de Signed-off-by: Yuanchu Xie --- Documentation/admin-guide/mm/index.rst

[PATCH v3 6/7] selftest: test system-wide workingset reporting

2024-08-13 Thread Yuanchu Xie
A basic test that verifies the working set size of a simple memory accessor. It should work with or without the aging thread. When running tests with run_vmtests.sh, file workingset report testing requires an environment variable WORKINGSET_REPORT_TEST_FILE_PATH to store a temporary file, which is

[PATCH v3 5/7] mm: add kernel aging thread for workingset reporting

2024-08-13 Thread Yuanchu Xie
For reliable and timely aging on memcgs, one has to read the page age histograms on time. A kernel thread makes it easier by aging memcgs with valid refresh_interval when they can be refreshed, and also reduces the latency of any userspace consumers of the page age histogram. The kerne aging threa

[PATCH v3 4/7] mm: extend working set reporting to memcgs

2024-08-13 Thread Yuanchu Xie
Break down the system-wide working set reporting into per-memcg reports, which aggregages its children hierarchically. The per-node working set reporting histograms and refresh/report threshold files are presented as memcg files, showing a report containing all the nodes. The per-node page age int

[PATCH v3 3/7] mm: report workingset during memory pressure driven scanning

2024-08-13 Thread Yuanchu Xie
When a node reaches its low watermarks and wakes up kswapd, notify all userspace programs waiting on the workingset page age histogram of the memory pressure, so a userspace agent can read the workingset report in time and make policy decisions, such as logging, oom-killing, or migration. Sysfs in

[PATCH v3 2/7] mm: use refresh interval to rate-limit workingset report aggregation

2024-08-13 Thread Yuanchu Xie
The refresh interval is a rate limiting factor to workingset page age histogram reads. When a workingset report is generated, a timestamp is noted, and the same report will be read until it expires beyond the refresh interval, at which point a new report is generated. Sysfs interface /sys/devices/

[PATCH v3 1/7] mm: aggregate working set information into histograms

2024-08-13 Thread Yuanchu Xie
Hierarchically aggregate all memcgs' MGLRU generations and their page counts into working set page age histograms. The histograms break down the system's working set per-node, per-anon/file. The sysfs interfaces are as follows: /sys/devices/system/node/nodeX/workingset_report/page_age A pe

[PATCH v3 0/7] mm: workingset reporting

2024-08-13 Thread Yuanchu Xie
Changes from PATCH v2 -> v3: - Fixed typos in commit messages and documentation (Lance Yang, Randy Dunlap) - Split out the force_scan patch to be reviewed separately - Added benchmarks from Ghait Ouled Amar Ben Cheikh - Fixed reported compile error without CONFIG_MEMCG Changes from PATCH v1 -> v

[PATCH 6/6] KVM: x86: selftests: Test PerfMonV2

2024-08-13 Thread Colton Lewis
Test PerfMonV2, which defines global registers to enable multiple performance counters with a single MSR write, in its own function. If the feature is available, ensure the global control register has the ability to start and stop the performance counters and the global status register correctly f

[PATCH 5/6] KVM: x86: selftests: Test core events

2024-08-13 Thread Colton Lewis
Test events on core counters by iterating through every combination of events in amd_pmu_zen_events with every core counter. For each combination, calculate the appropriate register addresses for the event selection/control register and the counter register. The base addresses and layout schemes c

[PATCH 4/6] KVM: x86: selftests: Test read/write core counters

2024-08-13 Thread Colton Lewis
Run a basic test to ensure we can write an arbitrary value to the core counters and read it back. Signed-off-by: Colton Lewis --- .../selftests/kvm/x86_64/pmu_counters_test.c | 41 +++ 1 file changed, 41 insertions(+) diff --git a/tools/testing/selftests/kvm/x86_64/pmu_counters

[PATCH 3/6] KVM: x86: selftests: Set up AMD VM in pmu_counters_test

2024-08-13 Thread Colton Lewis
Branch in main() depending on if the CPU is Intel or AMD. They are subject to vastly different requirements because the AMD PMU lacks many properties defined by the Intel PMU including the entire CPUID 0xa function where Intel stores all the PMU properties. AMD lacks this as well as any consistent

[PATCH 2/6] KVM: x86: selftests: Define AMD PMU CPUID leaves

2024-08-13 Thread Colton Lewis
This defined the CPUID calls to determine what extensions and properties are available. AMD reference manual names listed below. * PerfCtrExtCore (six core counters instead of four) * PerfCtrExtNB (four counters for northbridge events) * PerfCtrExtL2I (four counters for L2 cache events) * PerfMonV

[PATCH 1/6] KVM: x86: selftests: Fix typos in macro variable use

2024-08-13 Thread Colton Lewis
Without the leading underscore, these variables are referencing a variable in the calling scope. It only worked before by accident because all calling scopes had a variable with the right name. Signed-off-by: Colton Lewis --- tools/testing/selftests/kvm/x86_64/pmu_counters_test.c | 6 +++--- 1 f

[PATCH 0/6] Extend pmu_counters_test to AMD CPUs

2024-08-13 Thread Colton Lewis
(I was positive I had sent this already, but I couldn't find it on the mailing list to reply to and ask for reviews.) Extend pmu_counters_test to AMD CPUs. As the AMD PMU is quite different from Intel with different events and feature sets, this series introduces a new code path to test it, speci

Re: [PATCH v3 4/5] KVM: selftests: Add an interface to read the data of named vcpu stat

2024-08-13 Thread Sean Christopherson
On Tue, May 28, 2024, Manali Shukla wrote: > From: Manali Shukla > > The interface is used to read the data values of a specified vcpu stat > from the currenly available binary stats interface. > > Signed-off-by: Manali Shukla > --- > .../kvm/include/kvm_arch_vcpu_states.h| 49

Re: [PATCH v2] selftests: fix relative rpath usage

2024-08-13 Thread Eugene Syromiatnikov
On Mon, Aug 12, 2024 at 05:03:45PM -0600, Shuah Khan wrote: > On 8/12/24 10:56, Eugene Syromiatnikov wrote: > >The relative RPATH ("./") supplied to linker options in CFLAGS is resolved > >relative to current working directory and not the executable directory, > >which will lead in incorrect resolu

[PATCH v2 1/1] selftests: net: af_unix: convert param to const char* in __recvpair() to fix warning

2024-08-13 Thread Mirsad Todorovac
GCC 13.2.0 reported warning about (void *) being used as a param where (char *) is expected: In file included from msg_oob.c:14: msg_oob.c: In function ‘__recvpair’: ../../kselftest_harness.h:106:40: warning: format ‘%s’ expects argument of type ‘char *’, \

Re: [PATCH RFT v8 4/9] fork: Add shadow stack support to clone3()

2024-08-13 Thread Catalin Marinas
On Sat, Aug 10, 2024 at 12:06:12AM +0100, Mark Brown wrote: > On Fri, Aug 09, 2024 at 07:19:26PM +0100, Catalin Marinas wrote: > > On Thu, Aug 08, 2024 at 09:15:25AM +0100, Mark Brown wrote: > > > + /* This should really be an atomic cmpxchg. It is not. */ > > > + if (access_remote_vm(mm, addr, &v

Re: [PATCH v3 0/5] Add support for the Idle HLT intercept feature

2024-08-13 Thread Sean Christopherson
On Tue, Jun 04, 2024, Manali Shukla wrote: > On 5/28/2024 3:52 PM, Paolo Bonzini wrote: > > Does this have an effect on the number of vmexits for KVM, unless AVIC > > is enabled? Ah, I suspect it will (as Manali's trace shows), because KVM will pend a V_INTR (V_IRQ in KVM's world) in order to dete

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

2024-08-13 Thread Sean Christopherson
On Tue, Aug 13, 2024, Sean Christopherson wrote: > On Fri, May 31, 2024, Chao Gao wrote: > > On Thu, May 30, 2024 at 06:49:56PM +0530, Manali Shukla wrote: > > >>> + /* Check the extension for binary stats */ > > >>> + TEST_REQUIRE(this_cpu_has(X86_FEATURE_IDLE_HLT)); > > >> > > >> IIU

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

2024-08-13 Thread Conor Dooley
On Mon, Aug 12, 2024 at 05:45:30PM -0700, Charlie Jenkins wrote: > On Fri, Aug 09, 2024 at 11:31:15PM +0100, Conor Dooley wrote: > > On Tue, Aug 06, 2024 at 05:31:36PM -0700, Charlie Jenkins wrote: > > > xtheadvector is a custom extension that is based upon riscv vector > > > version 0.7.1 [1]. All

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

2024-08-13 Thread Sean Christopherson
On Fri, May 31, 2024, Chao Gao wrote: > On Thu, May 30, 2024 at 06:49:56PM +0530, Manali Shukla wrote: > >>> + /* Check the extension for binary stats */ > >>> + TEST_REQUIRE(this_cpu_has(X86_FEATURE_IDLE_HLT)); > >> > >> IIUC, this test assumes that the IDLE_HLT feature is enabled for guests if

Re: [PATCH v1 1/1] selftests: net: af_unix: cast void* to char* in call to macro TH_LOG()

2024-08-13 Thread Mirsad Todorovac
Hi, Simon, On 8/12/24 17:17, Simon Horman wrote: > On Mon, Aug 12, 2024 at 02:22:58AM +0200, Mirsad Todorovac wrote: >> GCC 13.2.0 reported warning about (void *) beeing used as a param where >> (char *) is expected: > > nit: being Ouch! No patch is small enough that one should take its correct

Re: [RFC 2/5] selftests: KVM: Decouple SEV ioctls from asserts

2024-08-13 Thread Pratik R. Sampat
On 8/13/2024 10:27 AM, Sean Christopherson wrote: > On Tue, Aug 13, 2024, Pratik R. Sampat wrote: >> On 8/9/2024 10:40 AM, Sean Christopherson wrote: >>> On Wed, Jul 10, 2024, Pratik R. Sampat wrote: @@ -98,7 +100,7 @@ static inline void sev_register_encrypted_memory(struct kvm_vm *vm

Re: [RFC 2/5] selftests: KVM: Decouple SEV ioctls from asserts

2024-08-13 Thread Sean Christopherson
On Tue, Aug 13, 2024, Pratik R. Sampat wrote: > On 8/9/2024 10:40 AM, Sean Christopherson wrote: > > On Wed, Jul 10, 2024, Pratik R. Sampat wrote: > >> @@ -98,7 +100,7 @@ static inline void sev_register_encrypted_memory(struct > >> kvm_vm *vm, > >>vm_ioctl(vm, KVM_MEMORY_ENCRYPT_REG_REGION, &r

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Jakub Kicinski
On Tue, 13 Aug 2024 16:11:15 +0100 Pavel Begunkov wrote: > On 8/13/24 15:39, Jakub Kicinski wrote: > > On Tue, 13 Aug 2024 03:31:13 +0100 Pavel Begunkov wrote: > >> I'm getting lost, so repeating myself a bit. What I think > >> would be a good approach is if we get an error back from > >> the dri

Re: [RFC 3/5] selftests: KVM: SEV IOCTL test

2024-08-13 Thread Pratik R. Sampat
On 8/9/2024 10:45 AM, Sean Christopherson wrote: > On Thu, Jul 11, 2024, Pratik Rajesh Sampat wrote: +static void sev_guest_status_assert(struct kvm_vm *vm, uint32_t type) +{ + struct kvm_sev_guest_status status; + bool cond; + int ret; + + ret = __vm_sev_i

Re: [RFC 4/5] selftests: KVM: SNP IOCTL test

2024-08-13 Thread Pratik R. Sampat
On 8/9/2024 10:48 AM, Sean Christopherson wrote: > On Wed, Jul 10, 2024, Pratik R. Sampat wrote: >> Introduce testing of SNP ioctl calls. This patch includes both positive >> and negative tests of various parameters such as flags, page types and >> policies. >> >> Signed-off-by: Pratik R. Sampat

Re: [RFC 2/5] selftests: KVM: Decouple SEV ioctls from asserts

2024-08-13 Thread Pratik R. Sampat
Hi Sean, Thanks for your review. On 8/9/2024 10:40 AM, Sean Christopherson wrote: > On Wed, Jul 10, 2024, Pratik R. Sampat wrote: >> This commit separates the SEV, SEV-ES, SEV-SNP ioctl calls from its > > Don't start with "This commit". Please read > Documentation/process/maintainer-kvm-x86.rs

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Pavel Begunkov
On 8/13/24 15:39, Jakub Kicinski wrote: On Tue, 13 Aug 2024 03:31:13 +0100 Pavel Begunkov wrote: I'm getting lost, so repeating myself a bit. What I think would be a good approach is if we get an error back from the driver if it doesn't support netiov / providers. netdev_rx_queue_restart() {

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Jakub Kicinski
On Tue, 13 Aug 2024 03:31:13 +0100 Pavel Begunkov wrote: > I'm getting lost, so repeating myself a bit. What I think > would be a good approach is if we get an error back from > the driver if it doesn't support netiov / providers. > > netdev_rx_queue_restart() { > ... > err = dev->queu

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Jakub Kicinski
On Tue, 13 Aug 2024 04:39:47 -0400 Mina Almasry wrote: > On Mon, Aug 12, 2024 at 8:15 PM Jakub Kicinski wrote: > > BTW, Mina, the core should probably also check that XDP isn't installed > > before / while the netmem is bound to a queue. > > Sorry if noob question, but what is the proper check

Re: [PATCH net] selftests: net: lib: kill PIDs before del netns

2024-08-13 Thread Florian Westphal
Matthieu Baerts (NGI0) wrote: > When deleting netns, it is possible to still have some tasks running, > e.g. background tasks like tcpdump running in the background, not > stopped because the test has been interrupted. > > Before deleting the netns, it is then safer to kill all attached PIDs, > i

[PATCH net] selftests: net: lib: kill PIDs before del netns

2024-08-13 Thread Matthieu Baerts (NGI0)
tns list \| grep -vq "^$ns$" &> /dev/null; then echo "Warn: Failed to remove namespace $ns" --- base-commit: 58a63729c957621f1990c3494c702711188ca347 change-id: 20240813-upstream-net-20240813-selftests-net-lib-kill-f7964a3a58fe Best regards, -- Matthieu Baerts (NGI0)

Re: [PATCH] kselftest/arm64: signal: fix/refactor SVE vector length enumeration

2024-08-13 Thread Andre Przywara
On Tue, 13 Aug 2024 12:00:06 +0100 Mark Brown wrote: Hi broonie, > On Mon, Aug 12, 2024 at 03:09:24PM +0100, Andre Przywara wrote: > > > + /* Did we find the lowest supported VL? */ > > + if (use_sme && vq < sve_vq_from_vl(vl)) > > + break; > > We don't

[PATCH bpf-next v4 4/4] selftests/bpf: convert test_skb_cgroup_id_user to test_progs

2024-08-13 Thread eBPF Foundation
test_skb_cgroup_id_user allows testing skb cgroup id retrieval at different levels, but is not integrated in test_progs, so it is not run automatically in CI. The test overlaps a bit with cgroup_skb_sk_lookup_kern, which is integrated in test_progs and test extensively skb cgroup helpers, but there

[PATCH bpf-next v4 1/4] selftests/bpf: convert get_current_cgroup_id_user to test_progs

2024-08-13 Thread eBPF Foundation
get_current_cgroup_id_user allows testing for bpf_get_current_cgroup_id() bpf API but is not integrated into test_progs, and so is not tested automatically in CI. Convert it to the test_progs framework to allow running it automatically. The most notable differences with the old test are the follow

[PATCH bpf-next v4 0/4] selftests/bpf: convert three other cgroup tests to test_progs

2024-08-13 Thread eBPF Foundation
Hello, this series brings a new set of test converted to the test_progs framework. Since the tests are quite small, I chose to group three tests conversion in the same series, but feel free to let me know if I should keep one series per test. The series focuses on cgroup testing and converts the fo

[PATCH bpf-next v4 3/4] selftests/bpf: add proper section name to bpf prog and rename it

2024-08-13 Thread eBPF Foundation
test_skb_cgroup_id_kern.c is currently involved in a manual test. In its current form, it can not be used with the auto-generated skeleton APIs, because the section name is not valid to allow libbpf to deduce the program type. Update section name to allow skeleton APIs usage. Also rename the progr

[PATCH bpf-next v4 2/4] selftests/bpf: convert test_cgroup_storage to test_progs

2024-08-13 Thread eBPF Foundation
test_cgroup_storage is currently a standalone program which is not run when executing test_progs. Convert it to the test_progs framework so it can be automatically executed in CI. The conversion led to the following changes: - converted the raw bpf program in the userspace test file into a dedicat

[PATCH v5 4/4] selftests: ALSA: Cover userspace-driven timers with test

2024-08-13 Thread Ivan Orlov
Add a test for the new functionality of userspace-driven timers and the tool which allows us to count timer ticks in a certain time period. The test: 1. Creates a userspace-driven timer with ioctl to /dev/snd/timer 2. Starts the `global-timer` application to count the ticks of the timer from step

[PATCH v5 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-08-13 Thread Ivan Orlov
Implement two ioctl calls in order to support virtual userspace-driven ALSA timers. The first ioctl is SNDRV_TIMER_IOCTL_CREATE, which gets the snd_timer_uinfo struct as a parameter and puts a file descriptor of a virtual timer into the `fd` field of the snd_timer_unfo structure. It also updates t

[PATCH v5 2/4] Docs/sound: Add documentation for userspace-driven ALSA timers

2024-08-13 Thread Ivan Orlov
Add the documentation which describes the new userspace-driven timers API introduced in this patch series. The documentation contains: - Description of userspace-driven ALSA timers, what they are for - Description of the timers API - Example of how the timers can be created and triggered - How the

[PATCH v5 1/4] ALSA: aloop: Allow using global timers

2024-08-13 Thread Ivan Orlov
Allow using global timers as a timer source when card id is equal to -1 in the timer_source parameter. Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes V2 -> V3: - No changes V3 -> V4: - No changes V4 -> V5: - No changes sound/drivers/aloop.c | 2 ++ 1 file changed, 2 insertions(+) diff --

[PATCH v5 0/4] Introduce userspace-driven ALSA timers

2024-08-13 Thread Ivan Orlov
There are multiple possible timer sources which could be useful for the sound stream synchronization: hrtimers, hardware clocks (e.g. PTP), timer wheels (jiffies). Currently, using one of them to synchronize the audio stream of snd-aloop module would require writing a kernel-space driver which expo

Re: [PATCH v5 00/10] selftests: kvm: s390: Add s390x ucontrol selftests

2024-08-13 Thread Janosch Frank
On 8/7/24 5:45 PM, Christoph Schlameuss wrote: This patch series adds a selftest suite to validate the s390x architecture specific ucontrol KVM interface. When creating a VM on s390x it is possible to create it as userspace controlled VM or in short ucontrol VM. These VMs delegates the managemen

Re: [PATCH] kselftest/arm64: signal: fix/refactor SVE vector length enumeration

2024-08-13 Thread Mark Brown
On Mon, Aug 12, 2024 at 03:09:24PM +0100, Andre Przywara wrote: > + /* Did we find the lowest supported VL? */ > + if (use_sme && vq < sve_vq_from_vl(vl)) > + break; We don't need the use_sme check here, SVE is just architecturally guaranteed to never t

Re: [PATCH v5 07/10] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-13 Thread Christoph Schlameuss
On Tue, Aug 13, 2024 at 09:21:12AM +0200, Janosch Frank wrote: > On 8/7/24 5:45 PM, Christoph Schlameuss wrote: > > Add a test case verifying basic running and interaction of ucontrol VMs. > > Fill the segment and page tables for allocated memory and map memory on > > first access. > > > > * uc_ma

[RFC PATCH 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs

2024-08-13 Thread Ilpo Järvinen
Building resctrl selftest fails on ARM because it uses __cpuid_count() that fails the build with error: CC resctrl_tests In file included from resctrl.h:24, from cat_test.c:11: In function 'arch_supports_noncont_cat', inlined from 'noncont_cat_run_test' at cat_test.c:3

[PATCH 2/3] selftests/resctrl: Always initialize ecx to avoid build warnings

2024-08-13 Thread Ilpo Järvinen
To avoid warnings when __cpuid_count() is an empty stub, always initialize ecx because it is used in the return statement. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/cat_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/resct

[PATCH 1/3] selftests/resctrl: Generalize non-contiguous CAT check

2024-08-13 Thread Ilpo Järvinen
arch_supports_noncont_cat() checks if vendor is ARCH_AMD and if that is not true, ARCH_INTEL is assumed which might not be true either because get_vendor() can also return zero if neither AMD nor Intel is detected. Generalize the vendor check using switch/case logic and return false for unknown ve

[PATCH 0/3] selftests: Fix cpuid / vendor checking build issues

2024-08-13 Thread Ilpo Järvinen
First, generalize resctrl selftest non-contiguous CAT check to not assume non-AMD vendor implies Intel. Second, improve kselftest common parts and resctrl selftest such that the use of __cpuid_count() does not lead into a build failure (happens at least on ARM). The last patch might still require

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Mina Almasry
On Tue, Aug 13, 2024 at 4:39 AM Mina Almasry wrote: > > On Mon, Aug 12, 2024 at 8:15 PM Jakub Kicinski wrote: > > BTW, Mina, the core should probably also check that XDP isn't installed > > before / while the netmem is bound to a queue. > > Sorry if noob question, but what is the proper check for

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Mina Almasry
On Mon, Aug 12, 2024 at 8:15 PM Jakub Kicinski wrote: > BTW, Mina, the core should probably also check that XDP isn't installed > before / while the netmem is bound to a queue. Sorry if noob question, but what is the proper check for this? I tried adding this to net_devmem_bind_dmabuf_to_queue():

Re: [PATCH] selftests: resctrl: ignore builds for unsupported architectures

2024-08-13 Thread Shuah Khan
On 8/13/24 01:39, Ilpo Järvinen wrote: On Mon, 12 Aug 2024, Reinette Chatre wrote: On 8/12/24 3:49 PM, Shuah Khan wrote: On 8/9/24 02:45, Ilpo Järvinen wrote: Adding Maciej. On Fri, 9 Aug 2024, Muhammad Usama Anjum wrote: On 8/9/24 12:23 PM, Ilpo Järvinen wrote: On Fri, 9 Aug 2024, Muhammad

Re: [PATCH] selftests: resctrl: ignore builds for unsupported architectures

2024-08-13 Thread Shuah Khan
On 8/12/24 18:05, Reinette Chatre wrote: Hi Shuah, On 8/12/24 3:49 PM, Shuah Khan wrote: On 8/9/24 02:45, Ilpo Järvinen wrote: Adding Maciej. On Fri, 9 Aug 2024, Muhammad Usama Anjum wrote: On 8/9/24 12:23 PM, Ilpo Järvinen wrote: On Fri, 9 Aug 2024, Muhammad Usama Anjum wrote: This test

Re: [PATCH v2] selftest/powerpc/benchmark: remove requirement libc-dev

2024-08-13 Thread Michael Ellerman
Madhavan Srinivasan writes: > Currently exec-target.c file is linked as static and this > post a requirement to install libc dev package to build. I think specifically the problem is that the test requires a static libc, which is packaged separately in some distros from the regular libc headers,

Re: [PATCH] selftests: resctrl: ignore builds for unsupported architectures

2024-08-13 Thread Ilpo Järvinen
On Mon, 12 Aug 2024, Reinette Chatre wrote: > On 8/12/24 3:49 PM, Shuah Khan wrote: > > On 8/9/24 02:45, Ilpo Järvinen wrote: > > > Adding Maciej. > > > > > > On Fri, 9 Aug 2024, Muhammad Usama Anjum wrote: > > > > On 8/9/24 12:23 PM, Ilpo Järvinen wrote: > > > > > On Fri, 9 Aug 2024, Muhammad Usa

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-13 Thread Dev Jain
On 8/13/24 10:30, Dev Jain wrote: On 8/12/24 17:38, Dev Jain wrote: On 8/12/24 13:01, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:45, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:04, Huang, Ying wrote: Hi, Dev, Dev Jain writes: As already being done in __migrate_folio(

Re: [PATCH v5 07/10] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-13 Thread Janosch Frank
On 8/7/24 5:45 PM, Christoph Schlameuss wrote: Add a test case verifying basic running and interaction of ucontrol VMs. Fill the segment and page tables for allocated memory and map memory on first access. * uc_map_unmap Store and load data to mapped and unmapped memory and use pic segment

Re: [PATCH v4 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-08-13 Thread Ivan Orlov
On 8/13/24 07:02, Takashi Iwai wrote: On Sun, 11 Aug 2024 22:23:36 +0200, Ivan Orlov wrote: +static int snd_utimer_ioctl_create(struct file *file, + struct snd_timer_uinfo __user *_utimer_info) +{ + struct snd_utimer *utimer; + struct snd_timer_uinfo