[PATCH v2] virtio: console: Fix atomicity violation in fill_readbuf()

2024-10-29 Thread Qiu-ji Chen
The atomicity violation issue is due to the invalidation of the function port_has_data()'s check caused by concurrency. Imagine a scenario where a port that contains data passes the validity check but is simultaneously assigned a value with no data. This could result in an empty port passing th

Re: [PATCH v5 12/13] Documentation: userspace-api: iommufd: Update vIOMMU

2024-10-29 Thread Nicolin Chen
On Fri, Oct 25, 2024 at 04:49:52PM -0700, Nicolin Chen wrote: > With the introduction of the new object and its infrastructure, update the > doc to reflect that and add a new graph. > > Reviewed-by: Jason Gunthorpe > Reviewed-by: Kevin Tian > Signed-off-by: Nicolin Chen > --- > Documentation/u

Re: [PATCH v7 1/3] modules: Support extended MODVERSIONS info

2024-10-29 Thread Michael Ellerman
Matthew Maurer writes: >> Sorry I realise it's version 7, but although the above looks correct it's >> kind of dense. >> >> I think the below would also work and is (I think) easier to follow, and >> is more obviously similar to the existing code. I'm sure your version is >> faster, but I don't th

Re: [PATCH v3 2/3] rust: macros: add macro to easily run KUnit tests

2024-10-29 Thread Boqun Feng
On Tue, Oct 29, 2024 at 10:11:38PM -0700, Boqun Feng wrote: [...] > > + > > +let new_body: TokenStream = vec![body.stream(), > > kunit_macros.parse().unwrap()] > > +.into_iter() > > +.collect(); > > + > > +// Remove the `#[test]` macros. > > +let new_body = new_body.to_

Re: [PATCH v3 2/3] rust: macros: add macro to easily run KUnit tests

2024-10-29 Thread Boqun Feng
On Wed, Oct 30, 2024 at 12:57:14PM +0800, David Gow wrote: > From: José Expósito > Add a new procedural macro (`#[kunit_tests(kunit_test_suit_name)]`) to > run KUnit tests using a user-space like syntax. > > The macro, that should be used on modules, transforms every `#[test]` > in a `kunit_case!

Re: [PATCH v2 2/3] rust: macros: add macro to easily run KUnit tests

2024-10-29 Thread David Gow
On Tue, 29 Oct 2024 at 20:28, Boqun Feng wrote: > > Hi David, > > On Tue, Oct 29, 2024 at 05:24:18PM +0800, David Gow wrote: > > From: José Expósito > > > > Add a new procedural macro (`#[kunit_tests(kunit_test_suit_name)]`) to > > run KUnit tests using a user-space like syntax. > > > > The macro

[PATCH v3 3/3] rust: kunit: allow to know if we are in a test

2024-10-29 Thread David Gow
From: José Expósito In some cases, we need to call test-only code from outside the test case, for example, to mock a function or a module. In order to check whether we are in a test or not, we need to test if `CONFIG_KUNIT` is set. Unfortunately, we cannot rely only on this condition because: -

Re: [PATCH v2 1/3] rust: kunit: add KUnit case and suite macros

2024-10-29 Thread David Gow
On Tue, 29 Oct 2024 at 20:08, Alice Ryhl wrote: > > On Tue, Oct 29, 2024 at 10:24 AM David Gow wrote: > > > > From: José Expósito > > > > Add a couple of Rust const functions and macros to allow to develop > > KUnit tests without relying on generated C code: > > > > - The `kunit_unsafe_test_sui

[PATCH v3 2/3] rust: macros: add macro to easily run KUnit tests

2024-10-29 Thread David Gow
From: José Expósito Add a new procedural macro (`#[kunit_tests(kunit_test_suit_name)]`) to run KUnit tests using a user-space like syntax. The macro, that should be used on modules, transforms every `#[test]` in a `kunit_case!` and adds a `kunit_unsafe_test_suite!` registering all of them. The

[PATCH v3 1/3] rust: kunit: add KUnit case and suite macros

2024-10-29 Thread David Gow
From: José Expósito Add a couple of Rust const functions and macros to allow to develop KUnit tests without relying on generated C code: - The `kunit_unsafe_test_suite!` Rust macro is similar to the `kunit_test_suite` C macro. It requires a NULL-terminated array of test cases (see below).

[PATCH v3 0/3] rust: kunit: Support KUnit tests with a user-space like syntax

2024-10-29 Thread David Gow
This series was originally written by José Expósito, and has been modified and updated by Matt Gilbride and myself. The original version can be found here: https://github.com/Rust-for-Linux/linux/pull/950 Add support for writing KUnit tests in Rust. While Rust doctests are already converted to KUn

Re: [PATCH v5 06/13] iommu: Add iommu_copy_struct_from_full_user_array helper

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 08:24:52AM +, Tian, Kevin wrote: > > From: Nicolin Chen > > Sent: Saturday, October 26, 2024 7:51 AM > > > > From: Jason Gunthorpe > > > > The iommu_copy_struct_from_user_array helper can be used to copy a > > single > > entry from a user array which might not be effic

Re: [PATCH v5 03/13] iommufd: Add iommufd_verify_unfinalized_object

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 03:55:58PM -0300, Jason Gunthorpe wrote: > On Tue, Oct 29, 2024 at 09:18:05AM -0700, Nicolin Chen wrote: > > I think we'd need the same change in iommufd_object_abort() too. > > Makes sense I found xa_cmpxchg() does xas_result to its returning value, which turns XA_ZERO_EN

Re: [PATCH v3 rcu 3/3] rcu: Finer-grained grace-period-end checks in rcu_dump_cpu_stacks()

2024-10-29 Thread 王正睿
On Tue, 2024-10-29 at 09:29 -0700, Paul E. McKenney wrote: > External email : Please do not click links or open attachments until you have > verified the sender or the content. > > > On Tue, Oct 29, 2024 at 02:20:51AM +, Cheng-Jui Wang (王正睿) wrote: > > On Mon, 2024-10-28 at 17:22 -0700, Paul

[PATCH v3] selftests: clone3: Use the capget and capset syscall directly

2024-10-29 Thread zhouyuhang
From: zhouyuhang The libcap commit aca076443591 ("Make cap_t operations thread safe.") added a __u8 mutex at the beginning of the struct _cap_struct, it changes the offset of the members in the structure that breaks the assumption made in the "struct libcap" definition in clone3_cap_checkpoint_re

Re: [PATCH net-next v5 03/12] selftests: ncdevmem: Unify error handling

2024-10-29 Thread Stanislav Fomichev
On 10/29, Jakub Kicinski wrote: > On Wed, 23 Oct 2024 08:43:53 -0700 Stanislav Fomichev wrote: > > ret = inet_pton(server_sin.sin_family, server_ip, &server_sin.sin_addr); > > - if (socket < 0) > > - error(79, 0, "%s: [FAIL, create socket]\n", TEST_PREFIX); > > + if (ret < 0) > >

[PATCH v2 2/2] kselftest/arm64: Poll less often while waiting for fp-stress children

2024-10-29 Thread Mark Brown
While fp-stress is waiting for children to start it doesn't send any signals to them so there is no need for it to have as short an epoll() timeout as it does when the children are all running. We do still want to have some timeout so that we can log diagnostics about missing children but this can

RE: [PATCH v5 04/13] iommufd/hw_pagetable: Enforce invalidation op on vIOMMU-based hwpt_nested

2024-10-29 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, October 30, 2024 12:05 AM > > On Tue, Oct 29, 2024 at 08:22:43AM +, Tian, Kevin wrote: > > > From: Nicolin Chen > > > Sent: Saturday, October 26, 2024 7:51 AM > > > > > > @@ -302,7 +302,9 @@ iommufd_viommu_alloc_hwpt_nested(struct > > > iommufd_viom

Re: [PATCH] selftest/hid: increase timeout to 10 min

2024-10-29 Thread Shuah Khan
On 10/29/24 03:07, Yun Lu wrote: If running hid testcases with command "./run_kselftest.sh -c hid", NIT - When inestead of "If" the following tests will take longer than the kselftest framework timeout (now 200 seconds) to run and thus got terminated with TIMEOUT error: hid-multitouch.sh -

[PATCH v3] selftests/net: Fix ./ns-XXXXXX not cleanup

2024-10-29 Thread Li Zhijian
``` readonly STATS="$(mktemp -p /tmp ns-XX)" readonly BASE=`basename $STATS` ``` It could be a mistake to write to $BASE rather than $STATS, where $STATS is used to save the NSTAT_HISTORY and it will be cleaned up before exit. Although since we've been creating the wrong file this whole time a

[PATCH v3] selftests/net: Add missing gitignore file

2024-10-29 Thread Li Zhijian
Compiled binary files should be added to .gitignore 'git status' complains: Untracked files: (use "git add ..." to include in what will be committed) net/netfilter/conntrack_reverse_clash Cc: Pablo Neira Ayuso Cc: Jozsef Kadlecsik Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub

Re: [PATCH for-next 7/7] selftests/net: Fix ./ns-XXXXXX not cleanup

2024-10-29 Thread Zhijian Li (Fujitsu)
On 30/10/2024 07:43, Jakub Kicinski wrote: > On Fri, 25 Oct 2024 09:40:10 +0800 Li Zhijian wrote: >> ``` >> readonly STATS="$(mktemp -p /tmp ns-XX)" >> readonly BASE=`basename $STATS` >> ``` >> It could be a mistake to write to $BASE rather than $STATS, where $STATS >> is used to save the NST

Re: [PATCH] remoteproc: qcom: pas: Make remoteproc name human friendly

2024-10-29 Thread Chris Lew
On 10/21/2024 9:21 PM, Bjorn Andersson wrote: The remoteproc "name" property is supposed to present the "human readable" name of the remoteproc, while using the device name is readable, it's not "friendly". Instead, use the "sysmon_name" as the identifier for the remoteproc instance. It match

[PATCH v2 0/2] kselftest/arm64: fp-stress signal delivery interval improvements

2024-10-29 Thread Mark Brown
message and log output. - Link to v1: https://lore.kernel.org/r/20241029-arm64-fp-stress-interval-v1-0-db540abf6...@kernel.org --- Mark Brown (2): kselftest/arm64: Increase frequency of signal delivery in fp-stress kselftest/arm64: Poll less often while waiting for fp-stress children

Re: [PATCH net-next v5 03/12] selftests: ncdevmem: Unify error handling

2024-10-29 Thread Jakub Kicinski
On Wed, 23 Oct 2024 08:43:53 -0700 Stanislav Fomichev wrote: > ret = inet_pton(server_sin.sin_family, server_ip, &server_sin.sin_addr); > - if (socket < 0) > - error(79, 0, "%s: [FAIL, create socket]\n", TEST_PREFIX); > + if (ret < 0) > + error(1, pton, "%s: [F

Re: [PATCH v5 01/13] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 12:30:00PM -0700, Nicolin Chen wrote: > > iommufd_device_unbind() can't fail, and if the object can't be > > destroyed because it has an elevated long term refcount it WARN's: > > > > > > ret = iommufd_object_remove(ictx, obj, obj->id, REMOVE_WAIT_SHORTTERM); > > > >

[PATCH v2 1/2] kselftest/arm64: Increase frequency of signal delivery in fp-stress

2024-10-29 Thread Mark Brown
Currently we only deliver signals to the processes being tested about once a second, meaning that the signal code paths are subject to relatively little stress. Increase this frequency substantially to 25ms intervals, along with some minor refactoring to make this more readily tuneable and maintain

Re: [PATCH] scripts: Remove export_report.pl

2024-10-29 Thread Sami Tolvanen
Hi Matt, On Tue, Oct 29, 2024 at 2:12 PM Matthew Maurer wrote: > > This script has been broken for 5 years with no user complaints. > > It first had its .mod.c parser broken in commit a3d0cb04f7df ("modpost: > use __section in the output to *.mod.c"). Later, it had its object file > enumeration b

Re: [PATCH for-next 7/7] selftests/net: Fix ./ns-XXXXXX not cleanup

2024-10-29 Thread Jakub Kicinski
On Fri, 25 Oct 2024 09:40:10 +0800 Li Zhijian wrote: > ``` > readonly STATS="$(mktemp -p /tmp ns-XX)" > readonly BASE=`basename $STATS` > ``` > It could be a mistake to write to $BASE rather than $STATS, where $STATS > is used to save the NSTAT_HISTORY and it will be cleaned up before exit. Ag

Re: [PATCH for-next 7/7] selftests/net: Fix ./ns-XXXXXX not cleanup

2024-10-29 Thread Jakub Kicinski
On Tue, 29 Oct 2024 16:43:06 -0700 Jakub Kicinski wrote: > Similarly to patch 6 I meant patch 4, not patch 6

Re: [PATCH for-next 4/7] selftests/net: Add missing gitignore file

2024-10-29 Thread Jakub Kicinski
On Fri, 25 Oct 2024 09:40:07 +0800 Li Zhijian wrote: > diff --git a/tools/testing/selftests/net/netfilter/.gitignore > b/tools/testing/selftests/net/netfilter/.gitignore > index 0a64d6d0e29a..eef8d5784e94 100644 > --- a/tools/testing/selftests/net/netfilter/.gitignore > +++ b/tools/testing/selftes

[PATCH net-next v1 0/7] devmem TCP fixes

2024-10-29 Thread Mina Almasry
A few unrelated devmem TCP fixes bundled in a series for some convenience (if that's ok). Patch 1-2: fix naming and provide page_pool_alloc_netmem for fragged netmem. Patch 3-4: fix issues with dma-buf dma addresses being potentially passed to dma_sync_for_* helpers. Patch 5-6: fix syzbot SO_DEV

[PATCH] scripts: Remove export_report.pl

2024-10-29 Thread Matthew Maurer
ymbol reports the number of modules using it\n"); - -print "\nNOTE: Got $modversion_warnings CONFIG_MODVERSIONS warnings\n\n" -if $modversion_warnings; - -print "~"x80 , "\n"; -for my $thismod (sort keys %MODULE) { - my $list = $MODULE{$thismod}; - my %depends; - $thismod =~ s/\.mod\.c/.ko/; - print "\t\t\t$thismod\n"; - foreach my $symbol (@{$list}) { - my ($module, $value, undef, $gpl) = @{$SYMBOL{$symbol}}; - push (@{$depends{"$module"}}, "$symbol $value"); - } - print_depends_on(\%depends); -} --- base-commit: 6fb2fa9805c501d9ade047fc511961f3273cdcb5 change-id: 20241029-remove-export-report-pl-7365c6ca3bee Best regards, -- Matthew Maurer

Re: [PATCH v2 3/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-29 Thread Frederic Weisbecker
Le Tue, Oct 29, 2024 at 02:52:31PM +0100, Sebastian Andrzej Siewior a écrit : > On 2024-10-28 15:01:55 [+0100], Frederic Weisbecker wrote: > > > diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h > > > index 457151f9f263d..9637af78087f3 100644 > > > --- a/include/linux/interrupt.h >

[PATCH net-next v1 1/7] net: page_pool: rename page_pool_alloc_netmem to *_netmems

2024-10-29 Thread Mina Almasry
page_pool_alloc_netmem (without an s) was the mirror of page_pool_alloc_pages (with an s), which was confusing. Rename to page_pool_alloc_netmems so it's the mirror of page_pool_alloc_pages. Signed-off-by: Mina Almasry --- include/net/page_pool/types.h | 2 +- net/core/page_pool.c | 8

Re: [PATCH v5 05/13] iommufd: Allow hwpt_id to carry viommu_id for IOMMU_HWPT_INVALIDATE

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 04:09:41PM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:50:34PM -0700, Nicolin Chen wrote: > > @@ -497,17 +497,35 @@ int iommufd_hwpt_invalidate(struct iommufd_ucmd *ucmd) > > goto out; > > } > > > > - hwpt = iommufd_get_hwpt_nested(ucmd, cm

[PATCH net-next v1 2/7] net: page_pool: create page_pool_alloc_netmem

2024-10-29 Thread Mina Almasry
Create page_pool_alloc_netmem to be the mirror of page_pool_alloc. This enables drivers that want currently use page_pool_alloc to transition to netmem by converting the call sites to page_pool_alloc_netmem. Signed-off-by: Mina Almasry --- include/net/page_pool/helpers.h | 25 --

[PATCH net-next v1 7/7] ncdevmem: add test for too many token_count

2024-10-29 Thread Mina Almasry
Add test for fixed issue: user passing a token with a very large token_count. Expect an error in this case. Signed-off-by: Mina Almasry --- tools/testing/selftests/net/ncdevmem.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tools/testing/selftests/net/ncdevmem.c b/tools/test

[PATCH net-next v1 6/7] net: fix SO_DEVMEM_DONTNEED looping too long

2024-10-29 Thread Mina Almasry
Check we're going to free a reasonable number of frags in token_count before starting the loop, to prevent looping too long. Also minor code cleanups: - Flip checks to reduce indentation. - Use sizeof(*tokens) everywhere for consistentcy. Cc: Yi Lai Signed-off-by: Mina Almasry --- net/core/s

[PATCH net-next v1 5/7] netmem: add netmem_prefetch

2024-10-29 Thread Mina Almasry
prefect(page) is a common thing to be called from drivers. Add netmem_prefetch that can be called on generic netmem. Skips the prefetch for net_iovs. Signed-off-by: Mina Almasry --- include/net/netmem.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/net/netmem.h b/include/net

[PATCH net-next v1 4/7] page_pool: disable sync for cpu for dmabuf memory provider

2024-10-29 Thread Mina Almasry
dmabuf dma-addresses should not be dma_sync'd for CPU/device. Typically its the driver responsibility to dma_sync for CPU, but the driver should not dma_sync for CPU if the netmem is actually coming from a dmabuf memory provider. The page_pool already exposes a helper for dma_sync_for_cpu: page_po

[PATCH net-next v1 3/7] page_pool: Set `dma_sync` to false for devmem memory provider

2024-10-29 Thread Mina Almasry
From: Samiullah Khawaja Move the `dma_map` and `dma_sync` checks to `page_pool_init` to make them generic. Set dma_sync to false for devmem memory provider because the dma_sync APIs should not be used for dma_buf backed devmem memory provider. Cc: Jason Gunthorpe Signed-off-by: Samiullah Khawaj

[PATCH net-next v1 0/7] devmem TCP fixes

2024-10-29 Thread Mina Almasry
A few unrelated devmem TCP fixes bundled in a series for some convenience (if that's ok). Patch 1-2: fix naming and provide page_pool_alloc_netmem for fragged netmem. Patch 3-4: fix issues with dma-buf dma addresses being potentially passed to dma_sync_for_* helpers. Patch 5-6: fix syzbot SO_DEV

Re: [PATCH v5 03/13] iommufd: Add iommufd_verify_unfinalized_object

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 09:18:05AM -0700, Nicolin Chen wrote: > On Tue, Oct 29, 2024 at 11:49:07AM -0300, Jason Gunthorpe wrote: > > On Fri, Oct 25, 2024 at 04:49:43PM -0700, Nicolin Chen wrote: > > > To support driver-allocated vIOMMU objects, it's suggested to call the > > > allocator helper in I

Re: [PATCH v5 01/13] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 03:48:01PM -0300, Jason Gunthorpe wrote: > On Tue, Oct 29, 2024 at 10:29:56AM -0700, Nicolin Chen wrote: > > On Tue, Oct 29, 2024 at 12:58:24PM -0300, Jason Gunthorpe wrote: > > > On Fri, Oct 25, 2024 at 04:50:30PM -0700, Nicolin Chen wrote: > > > > diff --git a/drivers/iomm

Re: [PATCH v5 03/13] iommufd: Add iommufd_verify_unfinalized_object

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 03:55:58PM -0300, Jason Gunthorpe wrote: > On Tue, Oct 29, 2024 at 09:18:05AM -0700, Nicolin Chen wrote: > > On Tue, Oct 29, 2024 at 11:49:07AM -0300, Jason Gunthorpe wrote: > > > On Fri, Oct 25, 2024 at 04:49:43PM -0700, Nicolin Chen wrote: > > > > To support driver-allocat

Re: [PATCH v5 01/13] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 10:29:56AM -0700, Nicolin Chen wrote: > On Tue, Oct 29, 2024 at 12:58:24PM -0300, Jason Gunthorpe wrote: > > On Fri, Oct 25, 2024 at 04:50:30PM -0700, Nicolin Chen wrote: > > > diff --git a/drivers/iommu/iommufd/device.c > > > b/drivers/iommu/iommufd/device.c > > > index 5f

Re: [PATCH v5 05/13] iommufd: Allow hwpt_id to carry viommu_id for IOMMU_HWPT_INVALIDATE

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:50:34PM -0700, Nicolin Chen wrote: > @@ -497,17 +497,35 @@ int iommufd_hwpt_invalidate(struct iommufd_ucmd *ucmd) > goto out; > } > > - hwpt = iommufd_get_hwpt_nested(ucmd, cmd->hwpt_id); > - if (IS_ERR(hwpt)) { > - rc = PTR_ERR(h

Re: [PATCH v2] selftests: tc-testing: Fix typo error

2024-10-29 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Tue, 22 Oct 2024 18:30:52 + you wrote: > Correct the typo errors in json files > > - "diffferent" is corrected to "different". > - "muliple" and "miltiple" is corrected to "multiple". > > Reviewed-by: Simon H

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 09:07:38AM -0700, Nicolin Chen wrote: > On Tue, Oct 29, 2024 at 12:27:46PM -0300, Jason Gunthorpe wrote: > > On Mon, Oct 28, 2024 at 07:52:10AM -0700, Nicolin Chen wrote: > > > On Mon, Oct 28, 2024 at 10:03:09AM -0300, Jason Gunthorpe wrote: > > > In iommufd_hwpt_paging_allo

Re: [PATCH v5 09/13] iommufd/selftest: Add refcount to mock_iommu_device

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 09:02:58AM -0700, Nicolin Chen wrote: > On Tue, Oct 29, 2024 at 12:34:38PM -0300, Jason Gunthorpe wrote: > > On Fri, Oct 25, 2024 at 04:49:49PM -0700, Nicolin Chen wrote: > > > For an iommu_dev that can unplug (so far only this selftest does so), the > > > viommu->iommu_dev

Re: [PATCH 1/2] kselftest/arm64: Increase frequency of signal delivery in fp-stress

2024-10-29 Thread Mark Brown
On Tue, Oct 29, 2024 at 03:43:37PM +, Mark Rutland wrote: > On those emulated platforms (FVP?), does this change trigger the faukure > more often? Yes. > I gave this a quick test, and with this change, running fp-stress on a > defconfig kernel running on 1 CPU triggers the "Bad SVCR: 0" spla

Re: [PATCH v5 01/13] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 12:58:24PM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:50:30PM -0700, Nicolin Chen wrote: > > diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c > > index 5fd3dd420290..e50113305a9c 100644 > > --- a/drivers/iommu/iommufd/device.c > >

Re: [PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs

2024-10-29 Thread Mathieu Poirier
I have applied all 3 patches in this set. Thanks, Mathieu On Mon, Oct 21, 2024 at 03:45:55PM -0500, Andrew Davis wrote: > While it should be safe to use normal memset() on these memories as they > are mapped as Normal Non-Cached, using the memset_io() provides stronger > guarantees on access alig

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 11:54:36AM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:49:44PM -0700, Nicolin Chen wrote: > > +void iommufd_viommu_destroy(struct iommufd_object *obj) > > +{ > > + struct iommufd_viommu *viommu = > > + container_of(obj, struct iommufd_viommu, obj);

Re: [PATCH v3 rcu 3/3] rcu: Finer-grained grace-period-end checks in rcu_dump_cpu_stacks()

2024-10-29 Thread Paul E. McKenney
On Tue, Oct 29, 2024 at 02:20:51AM +, Cheng-Jui Wang (王正睿) wrote: > On Mon, 2024-10-28 at 17:22 -0700, Paul E. McKenney wrote: > > The result is that the current leaf rcu_node structure's ->lock is > > acquired only if a stack backtrace might be needed from the current CPU, > > and is held acro

Re: [PATCH v3] selftests: add new kallsyms selftests

2024-10-29 Thread Sami Tolvanen
Hi Luis, On Mon, Oct 21, 2024 at 12:33 PM Luis Chamberlain wrote: > > diff --git a/lib/tests/module/gen_test_kallsyms.sh > b/lib/tests/module/gen_test_kallsyms.sh > new file mode 100755 > index ..e85f10dc11bd > --- /dev/null > +++ b/lib/tests/module/gen_test_kallsyms.sh > @@ -0,0 +1,

Re: [PATCH v5 03/13] iommufd: Add iommufd_verify_unfinalized_object

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 11:49:07AM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:49:43PM -0700, Nicolin Chen wrote: > > To support driver-allocated vIOMMU objects, it's suggested to call the > > allocator helper in IOMMU dirvers. However, there is no guarantee that > > drivers will all

Re: [PATCH] rpmsg_ns: Work around TI non-standard message

2024-10-29 Thread Romain Naour
Hello Richard, All, Le 15/10/2024 à 20:00, Richard Weinberger a écrit : > Am Dienstag, 15. Oktober 2024, 19:56:08 CEST schrieb Mathieu Poirier: In my opinion the real fix here is to get TI to use the standard message announcement structure. The ->desc field doesn't seem to be that usefu

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 12:27:46PM -0300, Jason Gunthorpe wrote: > On Mon, Oct 28, 2024 at 07:52:10AM -0700, Nicolin Chen wrote: > > On Mon, Oct 28, 2024 at 10:03:09AM -0300, Jason Gunthorpe wrote: > > In iommufd_hwpt_paging_alloc(), we reject IOMMU_HWPT_FAULT_ID_VALID: > > const u32 valid_flag

Re: [PATCH v5 04/13] iommufd/hw_pagetable: Enforce invalidation op on vIOMMU-based hwpt_nested

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 08:22:43AM +, Tian, Kevin wrote: > > From: Nicolin Chen > > Sent: Saturday, October 26, 2024 7:51 AM > > > > @@ -302,7 +302,9 @@ iommufd_viommu_alloc_hwpt_nested(struct > > iommufd_viommu *viommu, u32 flags, > > } > > hwpt->domain->owner = viommu->iommu_dev->op

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 12:59:35PM -0300, Jason Gunthorpe wrote: > On Tue, Oct 29, 2024 at 08:46:40AM -0700, Nicolin Chen wrote: > > On Tue, Oct 29, 2024 at 12:36:24PM -0300, Jason Gunthorpe wrote: > > > On Tue, Oct 29, 2024 at 11:54:36AM -0300, Jason Gunthorpe wrote: > > > > On Fri, Oct 25, 2024 a

Re: [PATCH v5 09/13] iommufd/selftest: Add refcount to mock_iommu_device

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 12:34:38PM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:49:49PM -0700, Nicolin Chen wrote: > > For an iommu_dev that can unplug (so far only this selftest does so), the > > viommu->iommu_dev pointer has no guarantee of its life cycle after it is > > copied from

Re: [PATCH v5 04/13] iommufd/hw_pagetable: Enforce invalidation op on vIOMMU-based hwpt_nested

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:50:33PM -0700, Nicolin Chen wrote: > A vIOMMU-based hwpt_nested requires a cache invalidation op too, either > using the one in iommu_domain_ops or the one in viommu_ops. Enforce that > upon the allocated hwpt_nested. > > Signed-off-by: Nicolin Chen > --- > drivers/iom

Re: [PATCH v5 05/13] iommufd: Add alloc_domain_nested op to iommufd_viommu_ops

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:45PM -0700, Nicolin Chen wrote: > Allow IOMMU driver to use a vIOMMU object that holds a nesting parent > hwpt/domain to allocate a nested domain. > > Suggested-by: Jason Gunthorpe > Reviewed-by: Kevin Tian > Signed-off-by: Nicolin Chen > --- > include/linux/iommu

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 08:46:40AM -0700, Nicolin Chen wrote: > On Tue, Oct 29, 2024 at 12:36:24PM -0300, Jason Gunthorpe wrote: > > On Tue, Oct 29, 2024 at 11:54:36AM -0300, Jason Gunthorpe wrote: > > > On Fri, Oct 25, 2024 at 04:49:44PM -0700, Nicolin Chen wrote: > > > > +void iommufd_viommu_dest

Re: [PATCH v5 02/13] iommufd/selftest: Add IOMMU_VDEVICE_ALLOC test coverage

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:50:31PM -0700, Nicolin Chen wrote: > Add a vdevice_alloc op to the viommu mock_viommu_ops for the coverage of > IOMMU_VIOMMU_TYPE_SELFTEST allocations. Then, add a vdevice_alloc TEST_F > to cover the IOMMU_VDEVICE_ALLOC ioctl. > > Signed-off-by: Nicolin Chen > --- > to

Re: [PATCH v5 01/13] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:50:30PM -0700, Nicolin Chen wrote: > +/** > + * struct iommu_vdevice_alloc - ioctl(IOMMU_VDEVICE_ALLOC) > + * @size: sizeof(struct iommu_vdevice_alloc) > + * @viommu_id: vIOMMU ID to associate with the virtual device > + * @dev_id: The pyhsical device to allocate a virtua

Re: [PATCH 1/2] kselftest/arm64: Increase frequency of signal delivery in fp-stress

2024-10-29 Thread Mark Rutland
Hi Mark, On Tue, Oct 29, 2024 at 12:10:39AM +, Mark Brown wrote: > Currently we only deliver signals to the processes being tested about > once a second, meaning that the signal code paths are subject to > relatively little stress. Increase this frequency substantially to > 25ms intervals, alo

Re: [PATCH v2] kunit: Introduce autorun option

2024-10-29 Thread Rae Moar
On Mon, Oct 28, 2024 at 5:54 PM Stanislav Kinsburskii wrote: > > The new option controls tests run on boot or module load. With the new > debugfs "run" dentry allowing to run tests on demand, an ability to disable > automatic tests run becomes a useful option in case of intrusive tests. > > The op

Re: [PATCH v5 10/13] iommufd/selftest: Add IOMMU_VIOMMU_TYPE_SELFTEST

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:50PM -0700, Nicolin Chen wrote: > Implement the viommu alloc/free functions to increase/reduce refcount of > its dependent mock iommu device. User space can verify this loop via the > IOMMU_VIOMMU_TYPE_SELFTEST. > > Signed-off-by: Nicolin Chen > --- > drivers/iommu/

Re: [PATCH 2/2] kselftest/arm64: Lower poll interval while waiting for fp-stress children

2024-10-29 Thread Mark Rutland
Nit: the title says we lower the poll interval, while we actually raise it. Maybe that'd be clearer as: kselftest/arm64: Raise poll timeout while waiting for fp-stress children ... or: kselftest/arm64: Poll less frequently while waiting for fp-stress children That aside, this l

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 12:36:24PM -0300, Jason Gunthorpe wrote: > On Tue, Oct 29, 2024 at 11:54:36AM -0300, Jason Gunthorpe wrote: > > On Fri, Oct 25, 2024 at 04:49:44PM -0700, Nicolin Chen wrote: > > > +void iommufd_viommu_destroy(struct iommufd_object *obj) > > > +{ > > > + struct iommufd_viommu

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 11:54:36AM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:49:44PM -0700, Nicolin Chen wrote: > > +void iommufd_viommu_destroy(struct iommufd_object *obj) > > +{ > > + struct iommufd_viommu *viommu = > > + container_of(obj, struct iommufd_viommu, obj);

Re: [PATCH v5 09/13] iommufd/selftest: Add refcount to mock_iommu_device

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:49PM -0700, Nicolin Chen wrote: > For an iommu_dev that can unplug (so far only this selftest does so), the > viommu->iommu_dev pointer has no guarantee of its life cycle after it is > copied from the idev->dev->iommu->iommu_dev. > > Track the user count of the iommu_

[PATCH] selftests/lam: Test get_user() LAM pointer handling

2024-10-29 Thread Maciej Wieczor-Retman
Recent change in how get_user() handles pointers [1] has a specific case for LAM. It assigns a different bitmask that's later used to check whether a pointer comes from userland in get_user(). While currently commented out (until LASS [2] is merged into the kernel) it's worth making changes to the

Re: [PATCH v5 08/13] iommufd/selftest: Prepare for mock_viommu_alloc_domain_nested()

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:48PM -0700, Nicolin Chen wrote: > A nested domain now can be allocated for a parent domain for a vIOMMU > object. Rework the existing allocators to prepare for the latter case. > > Signed-off-by: Nicolin Chen > --- > drivers/iommu/iommufd/selftest.c | 89 +++

Re: [PATCH v5 07/13] iommufd/selftest: Add container_of helpers

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:47PM -0700, Nicolin Chen wrote: > Use these inline helpers to shorten those container_of lines. > > Note that one of them goes back and forth between iommu_domain and > mock_iommu_domain, which isn't necessary. So drop its container_of. > > Signed-off-by: Nicolin Che

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-29 Thread Jason Gunthorpe
On Mon, Oct 28, 2024 at 07:52:10AM -0700, Nicolin Chen wrote: > On Mon, Oct 28, 2024 at 10:03:09AM -0300, Jason Gunthorpe wrote: > > On Mon, Oct 28, 2024 at 11:24:10AM +0800, Zhangfei Gao wrote: > > > > > > +/** > > > > + * iommufd_viommu_alloc_hwpt_nested() - Get a hwpt_nested for a vIOMMU > > >

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:44PM -0700, Nicolin Chen wrote: > +void iommufd_viommu_destroy(struct iommufd_object *obj) > +{ > + struct iommufd_viommu *viommu = > + container_of(obj, struct iommufd_viommu, obj); > + > + if (viommu->ops && viommu->ops->free) > + viom

[PATCH v4 0/2] vsock/test: fix wrong setsockopt() parameters

2024-10-29 Thread Konstantin Shkolnyy
Parameters were created using wrong C types, which caused them to be of wrong size on some architectures, causing problems. The problem with SO_RCVLOWAT was found on s390 (big endian), while x86-64 didn't show it. After the fix, all tests pass on s390. Then Stefano Garzarella pointed out that SO_V

[PATCH v4 2/2] vsock/test: fix parameter types in SO_VM_SOCKETS_* calls

2024-10-29 Thread Konstantin Shkolnyy
Change parameters of SO_VM_SOCKETS_* to uint64_t so that they are always 64-bit, because the corresponding kernel code requires them to be at least that large, no matter what architecture. Fixes: 5c338112e48a ("test/vsock: rework message bounds test") Fixes: 685a21c314a8 ("test/vsock: add big mess

[PATCH v4 1/2] vsock/test: fix failures due to wrong SO_RCVLOWAT parameter

2024-10-29 Thread Konstantin Shkolnyy
This happens on 64-bit big-endian machines. SO_RCVLOWAT requires an int parameter. However, instead of int, the test uses unsigned long in one place and size_t in another. Both are 8 bytes long on 64-bit machines. The kernel, having received the 8 bytes, doesn't test for the exact size of the param

Re: [PATCH v5 03/13] iommufd: Add iommufd_verify_unfinalized_object

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:43PM -0700, Nicolin Chen wrote: > To support driver-allocated vIOMMU objects, it's suggested to call the > allocator helper in IOMMU dirvers. However, there is no guarantee that > drivers will all use it and allocate objects properly. > > Add a helper for iommufd core

Re: [PATCH v5 02/13] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:42PM -0700, Nicolin Chen wrote: > Add a new IOMMUFD_OBJ_VIOMMU with an iommufd_viommu structure to represent > a slice of physical IOMMU device passed to or shared with a user space VM. > This slice, now a vIOMMU object, is a group of virtualization resources of > a ph

Re: [PATCH v2 3/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-29 Thread Sebastian Andrzej Siewior
On 2024-10-28 15:01:55 [+0100], Frederic Weisbecker wrote: > > diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h > > index 457151f9f263d..9637af78087f3 100644 > > --- a/include/linux/interrupt.h > > +++ b/include/linux/interrupt.h > > @@ -616,6 +616,50 @@ extern void __raise_softir

[PATCH v5 0/2] selftests/resctrl: SNC kernel support discovery

2024-10-29 Thread Maciej Wieczor-Retman
Changes v5: - Tests are skipped if snc_unreliable was set. - Moved resctrlfs.c changes from patch 2/2 to 1/2. - Removed CAT changes since it's not impacted by SNC in the selftest. - Updated various comments. - Fixed a bunch of minor issues pointed out in the review. Changes v4: - Printing SNC warn

[PATCH v5 2/2] selftests/resctrl: Adjust SNC support messages

2024-10-29 Thread Maciej Wieczor-Retman
Resctrl selftest prints a message on test failure that Sub-Numa Clustering (SNC) could be enabled and points the user to check their BIOS settings. No actual check is performed before printing that message so it is not very accurate in pinpointing a problem. Figuring out if SNC is enabled is only

[PATCH v5 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

2024-10-29 Thread Maciej Wieczor-Retman
Sub-NUMA Cluster divides CPUs sharing an L3 cache into separate NUMA nodes. Systems may support splitting into either two, three or four nodes. When SNC mode is enabled the effective amount of L3 cache available for allocation is divided by the number of nodes per L3. Detect which SNC mode is act

Re: [PATCH] kselftest/arm64: Use ksft_perror() to log MTE failures

2024-10-29 Thread Lorenzo Stoakes
On Tue, Oct 29, 2024 at 12:34:21PM +, Mark Brown wrote: > The logging in the allocation helpers variously uses ksft_print_msg() with > very intermittent logging of errno and perror() (which won't produce KTAP > conformant output) when logging the result of API calls that set errno. > Standardis

[PATCH] kselftest/arm64: Use ksft_perror() to log MTE failures

2024-10-29 Thread Mark Brown
The logging in the allocation helpers variously uses ksft_print_msg() with very intermittent logging of errno and perror() (which won't produce KTAP conformant output) when logging the result of API calls that set errno. Standardise on using the ksft_perror() helper in these cases so that more info

Re: [PATCH v2 2/3] rust: macros: add macro to easily run KUnit tests

2024-10-29 Thread Boqun Feng
Hi David, On Tue, Oct 29, 2024 at 05:24:18PM +0800, David Gow wrote: > From: José Expósito > > Add a new procedural macro (`#[kunit_tests(kunit_test_suit_name)]`) to > run KUnit tests using a user-space like syntax. > > The macro, that should be used on modules, transforms every `#[test]` > in

[PATCH net-next v11 23/23] testing/selftests: add test tool and scripts for ovpn module

2024-10-29 Thread Antonio Quartulli
The ovpn-cli tool can be compiled and used as selftest for the ovpn kernel module. [NOTE: it depends on libmedtls for decoding base64-encoded keys] ovpn-cli implements the netlink and RTNL APIs and can thus be integrated in any script for more automated testing. Along with the tool, 4 scripts ar

RE: [PATCH v5 11/13] Documentation: userspace-api: iommufd: Update vDEVICE

2024-10-29 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Saturday, October 26, 2024 7:51 AM > > With the introduction of the new object and its infrastructure, update the > doc and the vIOMMU graph to reflect that. > > Reviewed-by: Jason Gunthorpe > Signed-off-by: Nicolin Chen Reviewed-by: Kevin Tian

[PATCH net-next v11 20/23] ovpn: kill key and notify userspace in case of IV exhaustion

2024-10-29 Thread Antonio Quartulli
IV wrap-around is cryptographically dangerous for a number of ciphers, therefore kill the key and inform userspace (via netlink) should the IV space go exhausted. Userspace has two ways of deciding when the key has to be renewed before exhausting the IV space: 1) time based approach: after X se

Re: [PATCH v2 1/3] rust: kunit: add KUnit case and suite macros

2024-10-29 Thread Alice Ryhl
On Tue, Oct 29, 2024 at 10:24 AM David Gow wrote: > > From: José Expósito > > Add a couple of Rust const functions and macros to allow to develop > KUnit tests without relying on generated C code: > > - The `kunit_unsafe_test_suite!` Rust macro is similar to the >`kunit_test_suite` C macro.

[PATCH net-next v11 07/23] ovpn: introduce the ovpn_socket object

2024-10-29 Thread Antonio Quartulli
This specific structure is used in the ovpn kernel module to wrap and carry around a standard kernel socket. ovpn takes ownership of passed sockets and therefore an ovpn specific objects is attached to them for status tracking purposes. Initially only UDP support is introduced. TCP will come in a

[PATCH net-next v11 12/23] ovpn: implement TCP transport

2024-10-29 Thread Antonio Quartulli
With this change ovpn is allowed to communicate to peers also via TCP. Parsing of incoming messages is implemented through the strparser API. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 4 + drivers/net/

[PATCH net-next v11 04/23] ovpn: add basic interface creation/destruction/management routines

2024-10-29 Thread Antonio Quartulli
Add basic infrastructure for handling ovpn interfaces. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 115 -- drivers/net/ovpn/main.h | 7 +++ drivers/net/ovpn/ovpnstruct.h | 8 +++ drivers/net/ovpn/packet.h | 40 ++

[PATCH net-next v11 22/23] ovpn: add basic ethtool support

2024-10-29 Thread Antonio Quartulli
Implement support for basic ethtool functionality. Note that ovpn is a virtual device driver, therefore various ethtool APIs are just not meaningful and thus not implemented. Signed-off-by: Antonio Quartulli Reviewed-by: Andrew Lunn --- drivers/net/ovpn/main.c | 15 +++ 1 file chan

  1   2   >