Re: [PATCH-cgroup 1/2] cgroup/cpuset: Account for boot time isolated CPUs

2024-08-27 Thread Michal Koutný
Hi. On Tue, Aug 20, 2024 at 03:55:35PM GMT, Waiman Long wrote: > The prstate_housekeeping_conflict() function does check the > HK_TYPE_DOMAIN housekeeping cpumask to make sure that CPUs outside of it > can only be used in isolated partition. > Given the fact that we are going to make housekeeping

[PATCH v3 0/3] RISC-V: mm: do not treat hint addr on mmap as the upper bound to search

2024-08-27 Thread Yangyu Chen
Previous patch series[1][2] changes a mmap behavior that treats the hint address as the upper bound of the mmap address range. The motivation of the previous patch series is that some user space software may assume 48-bit address space and use higher bits to encode some information, which may colli

[PATCH v3 2/3] RISC-V: mm: not use hint addr as upper bound

2024-08-27 Thread Yangyu Chen
This patch reverted the meaning of the addr parameter in the mmap syscall change from the previous commit b5b4287accd7 ("riscv: mm: Use hint address in mmap if available") from patch[1] which treats hint addr + size as the upper bound of the mmap return address. Result in ENOMEM error caused when h

[PATCH v3 1/3] riscv: selftests: Remove mmap hint address checks

2024-08-27 Thread Yangyu Chen
From: Charlie Jenkins The mmap behavior that restricts the addresses returned by mmap caused unexpected behavior, so get rid of the test cases that check that behavior. Signed-off-by: Charlie Jenkins Fixes: 73d05262a2ca ("selftests: riscv: Generalize mm selftests") Signed-off-by: Yangyu Chen -

[PATCH v3 3/3] Documentation: riscv: correct sv57 kernel behavior

2024-08-27 Thread Yangyu Chen
The original documentation treated the hint address on mmap as the upper bound, since we have already removed this behavior, this document should be updated. Most of the content is copied from the corresponding feature in x86_64 with some modifications to align with the current kernel's behavior on

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

2024-08-27 Thread Maciej Wieczor-Retman
On 2024-08-12 at 16:40:10 -0700, Reinette Chatre wrote: >Hi Maciej, > >On 7/12/24 2:04 AM, Maciej Wieczor-Retman wrote: >> 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 per

[PATCH v5 0/4] HID: hidraw: HIDIOCREVOKE introduction

2024-08-27 Thread bentiss
Signed-off-by: Benjamin Tissoires --- Changes in v5: - check for ENODEV when required in selftests - create new common header for the HID tests that can be reused in other HID selftests - Link to v4: https://lore.kernel.org/r/20240827-hidraw-revoke-v4-0-88c6795bf...@kernel.org Link

[PATCH v5 1/4] HID: hidraw: add HIDIOCREVOKE ioctl

2024-08-27 Thread bentiss
From: Peter Hutterer There is a need for userspace applications to open HID devices directly. Use-cases include configuration of gaming mice or direct access to joystick devices. The latter is currently handled by the uaccess tag in systemd, other devices include more custom/local configurations

[PATCH v5 2/4] selftests/hid: extract the utility part of hid_bpf.c into its own header

2024-08-27 Thread Benjamin Tissoires
When adding new tests programs, we need the same mechanics to create new virtual devices, and read from their matching hidraw node. Extract the common part into its own header so we can easily add new tests C-files. Signed-off-by: Benjamin Tissoires --- new in v5 --- tools/testing/selftests/h

[PATCH v5 3/4] selftests/hid: Add initial hidraw tests skeleton

2024-08-27 Thread Benjamin Tissoires
Largely inspired from hid_bpf.c for the fixture setup. Create a couple of tests for hidraw: - create a uhid device and check if the fixture is working properly - inject one uhid event and read it through hidraw These tests are not that useful for now, but will be once we start adding the ioctl an

[PATCH v5 4/4] selftests/hid: Add HIDIOCREVOKE tests

2024-08-27 Thread Benjamin Tissoires
Add 4 tests for the new revoke ioctl, for read/write/ioctl and poll. Signed-off-by: Benjamin Tissoires Reviewed-by: Peter Hutterer --- new in v4 Changes to v4: - fix a few error messages - also check for ENODEV errno when required - use ENODEV instead of its plain value --- tools/testing/sel

Re: [PATCH net 00/15] mptcp: more fixes for the in-kernel PM

2024-08-27 Thread Matthieu Baerts
Hi Jakub, On 27/08/2024 04:29, Jakub Kicinski wrote: > On Mon, 26 Aug 2024 17:58:59 +0200 Matthieu Baerts (NGI0) wrote: >> Matthieu Baerts (NGI0) (15): >> mptcp: pm: reuse ID 0 after delete and re-add >> mptcp: pm: fix RM_ADDR ID for the initial subflow >> selftests: mptcp: join:

Re: [PATCH net 0/4] mptcp: close subflow when receiving TCP+FIN and misc.

2024-08-27 Thread Matthieu Baerts
On 27/08/2024 05:33, Jakub Kicinski wrote: > On Mon, 26 Aug 2024 19:11:17 +0200 Matthieu Baerts (NGI0) wrote: >> Matthieu Baerts (NGI0) (4): >> mptcp: close subflow when receiving TCP+FIN >> selftests: mptcp: join: cannot rm sf if closed >> mptcp: sched: check both backup in retra

Re: [PATCH bpf-next v2 5/8] libbpf: Support opening bpf objects of either endianness

2024-08-27 Thread Tony Ambardar
On Mon, Aug 26, 2024 at 02:28:17PM -0700, Andrii Nakryiko wrote: > On Mon, Aug 26, 2024 at 3:53 AM Tony Ambardar wrote: > > > > On Fri, Aug 23, 2024 at 12:47:47PM -0700, Andrii Nakryiko wrote: > > > On Thu, Aug 22, 2024 at 2:25 AM Tony Ambardar > > > wrote: > > > > > > > > From: Tony Ambardar >

Re: [PATCH bpf-next v2 7/8] libbpf: Support creating light skeleton of either endianness

2024-08-27 Thread Tony Ambardar
On Mon, Aug 26, 2024 at 02:25:27PM -0700, Andrii Nakryiko wrote: > On Mon, Aug 26, 2024 at 3:58 AM Tony Ambardar wrote: > > > > On Fri, Aug 23, 2024 at 12:47:56PM -0700, Andrii Nakryiko wrote: > > > On Thu, Aug 22, 2024 at 2:25 AM Tony Ambardar > > > wrote: > > > > > > > > From: Tony Ambardar >

Re: [PATCH 3/4] kunit: Allow function redirection outside of the KUnit thread

2024-08-27 Thread Michal Wajdeczko
On 22.08.2024 08:14, David Gow wrote: > On Wed, 21 Aug 2024 at 22:43, Michal Wajdeczko > wrote: >> >> Currently, the 'static stub' API only allows function redirection >> for calls made from the kthread of the current test, which prevents >> the use of this functionalty when the tested code is

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-08-27 Thread Will Deacon
On Fri, Aug 23, 2024 at 07:40:52PM +0100, Catalin Marinas wrote: > On Fri, Aug 23, 2024 at 06:08:36PM +0100, Will Deacon wrote: > > On Fri, Aug 23, 2024 at 05:41:06PM +0100, Catalin Marinas wrote: > > > On Fri, Aug 23, 2024 at 03:45:32PM +0100, Will Deacon wrote: > > > > On Thu, Aug 22, 2024 at 04:

Re: [PATCH v5 1/2] selftests: Rename sigaltstack to generic signal

2024-08-27 Thread Shuah Khan
On 8/22/24 05:10, Dev Jain wrote: On 8/22/24 08:33, Shuah Khan wrote: On 8/21/24 00:15, Dev Jain wrote: Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Can you elaborate on the benefits if renaming the test? Also you have such a good information in the cover-let

Re: [PATCH v5 1/2] selftests: Rename sigaltstack to generic signal

2024-08-27 Thread Dev Jain
On 8/27/24 17:08, Shuah Khan wrote: On 8/22/24 05:10, Dev Jain wrote: On 8/22/24 08:33, Shuah Khan wrote: On 8/21/24 00:15, Dev Jain wrote: Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Can you elaborate on the benefits if renaming the test? Also you have s

Re: [PATCH v6 1/2] selftests: Rename sigaltstack to generic signal

2024-08-27 Thread Shuah Khan
On 8/22/24 06:14, Dev Jain wrote: Rename sigaltstack to generic signal directory, to allow adding more signal tests in the future. Sorry - I think I mentioned I don't like this test renamed. Why are you sending this rename still included in the patch series? thanks, -- Shuah

Re: [PATCH v6 1/2] selftests: Rename sigaltstack to generic signal

2024-08-27 Thread Dev Jain
On 8/27/24 17:14, Shuah Khan wrote: On 8/22/24 06:14, Dev Jain wrote: Rename sigaltstack to generic signal directory, to allow adding more signal tests in the future. Sorry - I think I mentioned I don't like this test renamed. Why are you sending this rename still included in the patch ser

[PATCH net-next v6 25/25] testing/selftest: add test tool and scripts for ovpn module

2024-08-27 Thread Antonio Quartulli
The ovpn-cli tool can be compiled and used as selftest for the ovpn kernel module. It implementes the netlink API and can thus be integrated in any script for more automated testing. Along with the tool, 2 scripts are added that perform basic functionality tests by means of network namespaces. T

Re: [RFC PATCH net-next 1/5] selftests: forwarding: Introduce deferred commands

2024-08-27 Thread Petr Machata
Przemek Kitszel writes: > On 8/26/24 17:20, Petr Machata wrote: >> Przemek Kitszel writes: >> >>> On 8/22/24 15:49, Petr Machata wrote: In commit 8510801a9dbd ("selftests: drv-net: add ability to schedule cleanup with defer()"), a defer helper was added to Python selftests. The

Re: [PATCH] selftests/arm64: Fix build warnings for abi

2024-08-27 Thread Will Deacon
On Tue, Aug 27, 2024 at 10:48:51AM +0530, Dev Jain wrote: > A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly > introduced ksft_exit_fail_perror(). Also, uint64_t corresponds to > unsigned 64-bit integer, so use %lx instead of %llx. What's wrong with using %llx for a uint64_t? I th

Re: [PATCH v1] selftests:tdx:Use min macro

2024-08-27 Thread kernel test robot
vm-project 617a15a9eac96088ae5e9134248d8236e34b91b1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240827/202408271330.hmq39dwo-...@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | R

Re: [PATCH v3] Documentation: KUnit: Update filename best practices

2024-08-27 Thread Shuah Khan
On 8/22/24 18:18, Kees Cook wrote: On Fri, Jul 26, 2024 at 03:14:36PM +0800, David Gow wrote: On Thu, 25 Jul 2024 at 04:14, Kees Cook wrote: Based on feedback from Linus[1] and follow-up discussions, change the suggested file naming for KUnit tests. Link: https://lore.kernel.org/lkml/CAHk-=

kselftest/next build: 7 builds: 2 failed, 5 passed, 1 warning (v6.11-rc1-16-g611fbeb44a777)

2024-08-27 Thread kernelci.org bot
kselftest/next build: 7 builds: 2 failed, 5 passed, 1 warning (v6.11-rc1-16-g611fbeb44a777) Full Build Summary: https://kernelci.org/build/kselftest/branch/next/kernel/v6.11-rc1-16-g611fbeb44a777/ Tree: kselftest Branch: next Git Describe: v6.11-rc1-16-g611fbeb44a777 Git Commit: 611fbeb44a777e5

Re: [PATCH] selftests/vDSO: support DT_GNU_HASH

2024-08-27 Thread Shuah Khan
On 8/26/24 00:07, Xi Ruoyao wrote: On Wed, 2024-08-14 at 20:26 -0700, Fangrui Song wrote: glibc added support for DT_GNU_HASH in 2006 and DT_HASH has been obsoleted for more than one decade in many Linux distributions. Many vDSOs support DT_GNU_HASH. This patch adds selftests support. Signed-o

Re: [PATCH] selftests/vDSO: support DT_GNU_HASH

2024-08-27 Thread Fangrui Song
On Tue, Aug 27, 2024 at 10:12 PM Shuah Khan wrote: > > On 8/26/24 00:07, Xi Ruoyao wrote: > > On Wed, 2024-08-14 at 20:26 -0700, Fangrui Song wrote: > >> glibc added support for DT_GNU_HASH in 2006 and DT_HASH has been > >> obsoleted for more than one decade in many Linux distributions. > >> > >>

[PATCH bpf-next v1 0/2] Enable vmtest for cross-compile arm64 on x86_64 host, and fix some related issues.

2024-08-27 Thread Lin Yikai
Enable vmtest for cross-compile arm64 on x86_64 host, and fix some related issues. I have verified the patch for x86_64 with the target arch of 'x86' or 'arm64'. v1: - patch 2: - [1/2] Update "vmtest.sh" for cross-compile arm64 on x86_64 host. - [2/2] Fix cross-compile issue for some files

[PATCH bpf-next v1 1/2] selftests/bpf: Update "vmtest.sh" for cross-compile arm64 on x86_64 host.

2024-08-27 Thread Lin Yikai
Identify "$CROSS_COMPILE" to enable vm_test for cross-compile situation. Additionally, use "-cpu cortex-a57" flag to accommodate the majority of QEMU CPU lists, avoiding using "-cpu host," which can cause qemu_system_aarch64 start failure on x86_64 host. Signed-off-by: Lin Yikai --- tools/test

[PATCH bpf-next v1 2/2] selftests/bpf: Fix cross-compile issue for some files and a static compile issue for "-lzstd"

2024-08-27 Thread Lin Yikai
1. Fix cross-compile issue for some files: [Issue] When cross-compiling bpf selftests for arm64 on x86_64 host, the following error occurs: progs/loop2.c:20:7: error: incomplete definition of type 'struct user_pt_regs' 20 | if (PT_REGS_RC(ctx) & 1) | ^~

Re: [PATCH v2 2/6] kunit: Add macro to conditionally expose declarations to tests

2024-08-27 Thread Lucas De Marchi
On Tue, Aug 27, 2024 at 12:20:11AM GMT, Michal Wajdeczko wrote: The DECLARE_IF_KUNIT macro will introduces identifiers only if CONFIG_KUNIT is enabled. Otherwise if CONFIG_KUNIT is not enabled no identifiers from the param list will be defined. Signed-off-by: Michal Wajdeczko Reviewed-by: Rae M

Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

2024-08-27 Thread Jason A. Donenfeld
On Tue, Aug 27, 2024 at 09:20:16PM +0800, Xi Ruoyao wrote: > Building test_vdso_getrandom currently leads to following issue: > > In file included from > /home/xry111/git-repos/linux/tools/include/linux/compiler_types.h:36, > from > /home/xry111/git-repos/linux/include/u

Re: [PATCH bpf-next v1 1/2] selftests/bpf: Update "vmtest.sh" for cross-compile arm64 on x86_64 host.

2024-08-27 Thread Pu Lehui
On 2024/8/27 21:39, Lin Yikai wrote: Identify "$CROSS_COMPILE" to enable vm_test for cross-compile situation. Additionally, use "-cpu cortex-a57" flag to accommodate the majority of QEMU CPU lists, avoiding using "-cpu host," which can cause qemu_system_aarch64 start failure on x86_64 host.

Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

2024-08-27 Thread LEROY Christophe
Le 27/08/2024 à 15:58, Jason A. Donenfeld a écrit : > On Tue, Aug 27, 2024 at 09:20:16PM +0800, Xi Ruoyao wrote: >> Building test_vdso_getrandom currently leads to following issue: >> >> In file included from >> /home/xry111/git-repos/linux/tools/include/linux/compiler_types.h:36, >>

Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

2024-08-27 Thread Jason A. Donenfeld
On Tue, Aug 27, 2024 at 02:07:59PM +, LEROY Christophe wrote: > Le 27/08/2024 à 15:58, Jason A. Donenfeld a écrit : > > On Tue, Aug 27, 2024 at 09:20:16PM +0800, Xi Ruoyao wrote: > >> Building test_vdso_getrandom currently leads to following issue: > >> > >> In file included from > >> /ho

Re: [RFC PATCH net-next 1/5] selftests: forwarding: Introduce deferred commands

2024-08-27 Thread Jakub Kicinski
On Tue, 27 Aug 2024 10:53:53 +0200 Petr Machata wrote: > >> I can do it, but it's gonna be more pain in setting up those > >> TEST_INCLUDES. People will forget. It will be a nuisance. > >> I'm thinking of just moving it to net/lib.sh, from forwarding. > > > > what about separate file, but include

Re: [PATCH v2 5/6] kunit: Add example with alternate function redirection method

2024-08-27 Thread Lucas De Marchi
On Tue, Aug 27, 2024 at 12:20:14AM GMT, Michal Wajdeczko wrote: Add example how to use KUNIT_FIXED_STUB_REDIRECT and compare its s/FIXED/GLOBAL/ usage with the KUNIT_STATIC_STUB_REDIRECT. Also show how the DECLARE_IF_KUNIT macro could be helpful in declaring test data in the non-test data str

Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

2024-08-27 Thread Xi Ruoyao
On Tue, 2024-08-27 at 16:15 +0200, Jason A. Donenfeld wrote: /* snip */ > gcc -std=gnu99 -D_GNU_SOURCE= -isystem > /home/zx2c4/Projects/random-linux/tools/testing/selftests/../../../tools/include > -isystem > /home/zx2c4/Projects/random-linux/tools/testing/selftests/../../../usr/include >    

Re: [PATCH v2 4/6] kunit: Allow function redirection outside of the KUnit thread

2024-08-27 Thread Lucas De Marchi
On Tue, Aug 27, 2024 at 12:20:13AM GMT, Michal Wajdeczko wrote: Currently, the 'static stub' API only allows function redirection for calls made from the kthread of the current test, which prevents the use of this functionality when the tested code is also used by other threads, outside of the KU

Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

2024-08-27 Thread Christophe Leroy
Le 27/08/2024 à 16:41, Xi Ruoyao a écrit : On Tue, 2024-08-27 at 16:15 +0200, Jason A. Donenfeld wrote: /* snip */ gcc -std=gnu99 -D_GNU_SOURCE= -isystem /home/zx2c4/Projects/random-linux/tools/testing/selftests/../../../tools/include -isystem /home/zx2c4/Projects/random-linux/tools/test

[PATCH nf-next v3 1/2] netfilter: Make IP_NF_IPTABLES_LEGACY selectable

2024-08-27 Thread Breno Leitao
This option makes IP_NF_IPTABLES_LEGACY user selectable, giving users the option to configure iptables without enabling any other config. Suggested-by: Florian Westphal Signed-off-by: Breno Leitao --- net/ipv4/netfilter/Kconfig | 19 +++ tools/testing/selftests/net/confi

[PATCH nf-next v3 2/2] netfilter: Make IP6_NF_IPTABLES_LEGACY selectable

2024-08-27 Thread Breno Leitao
This option makes IP6_NF_IPTABLES_LEGACY user selectable, giving users the option to configure iptables without enabling any other config. Signed-off-by: Breno Leitao --- net/ipv6/netfilter/Kconfig | 22 -- tools/testing/selftests/net/config | 5 + 2 files change

Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

2024-08-27 Thread Jason A. Donenfeld
On Tue, Aug 27, 2024 at 04:50:59PM +0200, Christophe Leroy wrote: > > > Le 27/08/2024 à 16:41, Xi Ruoyao a écrit : > > On Tue, 2024-08-27 at 16:15 +0200, Jason A. Donenfeld wrote: > > > > /* snip */ > > > >> gcc -std=gnu99 -D_GNU_SOURCE= -isystem > >> /home/zx2c4/Projects/random-linux/tools/te

Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

2024-08-27 Thread Xi Ruoyao
On Tue, 2024-08-27 at 17:00 +0200, Jason A. Donenfeld wrote: > The effect of this patch is to replace include/uapi with usr/include, so > it will break for you too. > > What I'm wondering is why yours and mine work like that, while Ruoyao's > breaks. He makes a good argument as to why this patch i

Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

2024-08-27 Thread Jason A. Donenfeld
On Tue, Aug 27, 2024 at 11:05:14PM +0800, Xi Ruoyao wrote: > On Tue, 2024-08-27 at 17:00 +0200, Jason A. Donenfeld wrote: > > The effect of this patch is to replace include/uapi with usr/include, so > > it will break for you too. > > > > What I'm wondering is why yours and mine work like that, whi

Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

2024-08-27 Thread Christophe Leroy
Le 27/08/2024 à 17:00, Jason A. Donenfeld a écrit : On Tue, Aug 27, 2024 at 04:50:59PM +0200, Christophe Leroy wrote: Le 27/08/2024 à 16:41, Xi Ruoyao a écrit : On Tue, 2024-08-27 at 16:15 +0200, Jason A. Donenfeld wrote: /* snip */ gcc -std=gnu99 -D_GNU_SOURCE= -isystem /home/zx2c4/Pr

Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

2024-08-27 Thread Xi Ruoyao
On Tue, 2024-08-27 at 17:10 +0200, Jason A. Donenfeld wrote: > On Tue, Aug 27, 2024 at 11:05:14PM +0800, Xi Ruoyao wrote: > > On Tue, 2024-08-27 at 17:00 +0200, Jason A. Donenfeld wrote: > > > The effect of this patch is to replace include/uapi with usr/include, so > > > it will break for you too.

Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom

2024-08-27 Thread Jason A. Donenfeld
On Tue, Aug 27, 2024 at 5:29 PM Xi Ruoyao wrote: > Or, I can add $(KHDR_INCLUDES) but also keep > -isystem $(top_srcdir)/include/uapi, so "make -C tools/testing/selftests > TARGETS=vDSO" will still (happens to) work on x86 and ppc (without > headers in kernel-tree/usr). Oh, the porquenolosdos sol

Re: [RFC PATCH net-next 1/5] selftests: forwarding: Introduce deferred commands

2024-08-27 Thread Petr Machata
Jakub Kicinski writes: > On Tue, 27 Aug 2024 10:53:53 +0200 Petr Machata wrote: >> >> I can do it, but it's gonna be more pain in setting up those >> >> TEST_INCLUDES. People will forget. It will be a nuisance. >> >> I'm thinking of just moving it to net/lib.sh, from forwarding. >> > >> > wha

Re: [PATCH v3 0/3] RISC-V: mm: do not treat hint addr on mmap as the upper bound to search

2024-08-27 Thread Palmer Dabbelt
On Tue, 27 Aug 2024 01:05:15 PDT (-0700), c...@cyyself.name wrote: Previous patch series[1][2] changes a mmap behavior that treats the hint address as the upper bound of the mmap address range. The motivation of the previous patch series is that some user space software may assume 48-bit address

Re: [PATCH v3 0/3] RISC-V: mm: do not treat hint addr on mmap as the upper bound to search

2024-08-27 Thread Charlie Jenkins
On Tue, Aug 27, 2024 at 09:33:11AM -0700, Palmer Dabbelt wrote: > On Tue, 27 Aug 2024 01:05:15 PDT (-0700), c...@cyyself.name wrote: > > Previous patch series[1][2] changes a mmap behavior that treats the hint > > address as the upper bound of the mmap address range. The motivation of the > > previ

[PATCH v2 00/19] iommufd: Add VIOMMU infrastructure (Part-1)

2024-08-27 Thread Nicolin Chen
This series introduces a new VIOMMU infrastructure and related ioctls. IOMMUFD has been using the HWPT infrastructure for all cases, including a nested IO page table support. Yet, there're limitations for an HWPT-based structure to support some advanced HW-accelerated features, such as CMDQV on NV

[PATCH v2 01/19] iommufd: Reorder struct forward declarations

2024-08-27 Thread Nicolin Chen
Reorder struct forward declarations to alphabetic order to simplify maintenance, as upcoming patches will add more to the list. No functional change intended. Signed-off-by: Nicolin Chen --- include/linux/iommufd.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/incl

[PATCH v2 02/19] iommufd/viommu: Add IOMMUFD_OBJ_VIOMMU and IOMMU_VIOMMU_ALLOC ioctl

2024-08-27 Thread Nicolin Chen
Add a new IOMMUFD_OBJ_VIOMMU with an iommufd_viommu structure to represent a vIOMMU instance in the user space, backed by a physical IOMMU for its HW accelerated virtualization feature, such as nested translation support for a multi-viommu-instance VM, NVIDIA CMDQ-Virtualization extension for ARM S

[PATCH v2 05/19] iommufd/selftest: Add IOMMU_VIOMMU_ALLOC test coverage

2024-08-27 Thread Nicolin Chen
Use IOMMU_VIOMMU_TYPE_DEFAULT to cover the new IOMMU_VIOMMU_ALLOC ioctl. Signed-off-by: Nicolin Chen --- tools/testing/selftests/iommu/iommufd.c | 35 +++ tools/testing/selftests/iommu/iommufd_utils.h | 28 +++ 2 files changed, 63 insertions(+) diff --git a/too

[PATCH v2 03/19] iommu: Pass in a viommu pointer to domain_alloc_user op

2024-08-27 Thread Nicolin Chen
With a viommu object wrapping a potentially shareable S2 domain, a nested domain should be allocated by associating to a viommu instead. Driver can store this viommu pointer somewhere, so as to later use it calling viommu helpers for virtual device ID lookup and viommu invalidation. For drivers wi

[PATCH v2 07/19] iommufd/selftest: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID test coverage

2024-08-27 Thread Nicolin Chen
A core-managed VIOMMU maintains an xarray to store a list of virtual ids to mock_devs. Add test cases to cover the new IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctls. Signed-off-by: Nicolin Chen --- tools/testing/selftests/iommu/iommufd.c | 27 +++- tools/testing/selftests/iommu/iommufd_ut

[PATCH v2 08/19] iommufd/viommu: Add cache_invalidate for IOMMU_VIOMMU_TYPE_DEFAULT

2024-08-27 Thread Nicolin Chen
Add a default_viommu_ops with a new op for cache invaldiation, similar to the cache_invalidate_user op in structure iommu_domain_ops, but wider. An IOMMU driver that allocated a nested domain with a core-managed viommu is able to use the same viommu pointer for this cache invalidation API. ARM SMM

[PATCH v2 09/19] iommufd: Allow hwpt_id to carry viommu_id for IOMMU_HWPT_INVALIDATE

2024-08-27 Thread Nicolin Chen
With a VIOMMU object, use space can flush any IOMMU related cache that can be directed using the viommu. It is similar to IOMMU_HWPT_INVALIDATE uAPI, but can cover a wider range than IOTLB, such as device cache or desciprtor cache. Allow hwpt_id of the iommu_hwpt_invalidate structure to carry a vi

[PATCH v2 10/19] iommufd/viommu: Add vdev_id helpers for IOMMU drivers

2024-08-27 Thread Nicolin Chen
Driver can call the iommufd_viommu_find_device() to find a device pointer using its per-viommu virtual ID. The returned device must be protected by the pair of iommufd_viommu_lock/unlock_vdev_id() function. Put these three functions into a new viommu_api file, to build it with the IOMMUFD_DRIVER c

[PATCH v2 06/19] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2024-08-27 Thread Nicolin Chen
Introduce a pair of new ioctls to set/unset a per-viommu virtual device id that should be linked to a physical device id via an idev pointer. Continue the support IOMMU_VIOMMU_TYPE_DEFAULT for a core-managed viommu. Provide a lookup function for drivers to load device pointer by a virtual device i

[PATCH v2 04/19] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-08-27 Thread Nicolin Chen
Now a VIOMMU can wrap a shareable nested parent HWPT. So, it can act like a nested parent HWPT to allocate a nested HWPT. Support that in the IOMMU_HWPT_ALLOC ioctl handler, and update its kdoc. Also, associate a viommu to an allocating nested HWPT. Signed-off-by: Nicolin Chen --- drivers/iomm

[PATCH v2 11/19] iommu: Add iommu_copy_struct_from_full_user_array helper

2024-08-27 Thread Nicolin Chen
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 efficient if the array is big. Add a new iommu_copy_struct_from_full_user_array to copy the entire user array at once. Update the existing iommu_copy_struct_

[PATCH v2 12/19] iommufd/selftest: Add mock_viommu_invalidate_user op

2024-08-27 Thread Nicolin Chen
Similar to the coverage of cache_invalidate_user for iotlb invalidation, add a device cache and an invalidation op to test IOMMU_VIOMMU_INVALIDATE ioctl. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/iommufd_test.h | 25 + drivers/iommu/iommufd/selftest.c | 76 +++

[PATCH v2 13/19] iommufd/selftest: Add IOMMU_TEST_OP_DEV_CHECK_CACHE test command

2024-08-27 Thread Nicolin Chen
Similar to IOMMU_TEST_OP_MD_CHECK_IOTLB verifying a mock_domain's iotlb, IOMMU_TEST_OP_DEV_CHECK_CACHE will be used to verify a mock_dev's cache. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/iommufd_test.h | 5 drivers/iommu/iommufd/selftest.c | 24 ++

[PATCH v2 14/19] iommufd/selftest: Add VIOMMU coverage for IOMMU_HWPT_INVALIDATE ioctl

2024-08-27 Thread Nicolin Chen
Add a viommu_cache test function to cover VIOMMU invalidations using the updated IOMMU_VIOMMU_INVALIDATE ioctl, with similar postive and negative cases to the existing iotlb ones. Signed-off-by: Nicolin Chen --- tools/testing/selftests/iommu/iommufd.c | 190 ++ tools/testin

[PATCH v2 15/19] iommufd/viommu: Add iommufd_viommu_to_parent_domain helper

2024-08-27 Thread Nicolin Chen
Allow an IOMMU driver to convert a core-managed viommu to a nested parent domain for the info that the domain holds. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/viommu_api.c | 14 ++ include/linux/iommufd.h| 8 2 files changed, 22 insertions(+) diff -

[PATCH v2 17/19] iommu/arm-smmu-v3: Add arm_smmu_viommu_cache_invalidate

2024-08-27 Thread Nicolin Chen
Add an arm_smmu_viommu_cache_invalidate() function for user space to issue cache invalidation commands via viommu. The viommu invalidation takes the same native format of a 128-bit command, as the hwpt invalidation. Thus, reuse the same driver data structure, but make it wider to accept CMDQ_OP_AT

[PATCH v2 19/19] iommu/arm-smmu-v3: Update comments about ATS and bypass

2024-08-27 Thread Nicolin Chen
From: Jason Gunthorpe The SMMUv3 spec has a note that BYPASS and ATS don't work together under the STE EATS field definition. However there is another section "13.6.4 Full ATS skipping stage 1" that explains under certain conditions BYPASS and ATS do work together if the STE is using S1DSS to sel

[PATCH v2 16/19] iommu/arm-smmu-v3: Add arm_smmu_cache_invalidate_user

2024-08-27 Thread Nicolin Chen
Add arm_smmu_cache_invalidate_user() function for user space to invalidate IOTLB entries that are still cached by the hardware. Add struct iommu_hwpt_arm_smmuv3_invalidate defining an invalidation entry that is simply the native format of a 128-bit TLBI command. Scan commands against the permitted

[PATCH v2 18/19] iommu/arm-smmu-v3: Allow ATS for IOMMU_DOMAIN_NESTED

2024-08-27 Thread Nicolin Chen
From: Jason Gunthorpe Now, ATC invalidation can be done with the VIOMMU invalidation op. A guest owned IOMMU_DOMAIN_NESTED can do an ATS too. Allow it to pass in the EATS field via the vSTE words. Signed-off-by: Jason Gunthorpe Signed-off-by: Nicolin Chen --- drivers/iommu/arm/arm-smmu-v3/arm

[PATCH v1 00/10] iommufd: Add VIOMMU infrastructure (Part-2 VIRQ)

2024-08-27 Thread Nicolin Chen
As the part-2 of the VIOMMU infrastructure, this series introduces a VIRQ object after repurposing the existing FAULT object, which provides a nice notification pathway to the user space already. So, the first thing to do is reworking the FAULT object. Mimicing the HWPT structures, add a common EV

[PATCH v1 01/10] iommufd: Rename IOMMUFD_OBJ_FAULT to IOMMUFD_OBJ_EVENT_IOPF

2024-08-27 Thread Nicolin Chen
A fault object was designed exclusively for hwpt's IO page faults. But the implementation of the object could actually be used for other purposes too such as hardware IRQ and event. Define a common event structure. Embed it into another iommufd_event_iopf, similar to hwpt_paging holding a common h

[PATCH v1 02/10] iommufd: Rename fault.c to event.c

2024-08-27 Thread Nicolin Chen
Rename the file, aligning with the new event object. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/Makefile | 2 +- drivers/iommu/iommufd/{fault.c => event.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename drivers/iommu/iommufd/{fault.c => event.c} (100%) diff -

[PATCH v1 03/10] iommufd: Add IOMMUFD_OBJ_EVENT_VIRQ and IOMMUFD_CMD_VIRQ_ALLOC

2024-08-27 Thread Nicolin Chen
Allow a VIOMMU object to allocate VIRQ events. Each VIOMMU is allowed to have multiple VIRQ events but they must not have a duplicated type. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/event.c | 136 drivers/iommu/iommufd/iommufd_private.h | 54 +

[PATCH v1 05/10] iommufd/viommu: Add iommufd_vdev_id_to_dev helper

2024-08-27 Thread Nicolin Chen
This helps drivers to get the dev pointer held by the vdev_id structure. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/viommu_api.c | 14 ++ include/linux/iommufd.h| 7 +++ 2 files changed, 21 insertions(+) diff --git a/drivers/iommu/iommufd/viommu_api.c b/

[PATCH v1 07/10] iommufd/selftest: Implement mock_viommu_set/unset_vdev_id

2024-08-27 Thread Nicolin Chen
So that the driver can take the control of vdev_id's lifecycle. This will be used by the VIRQ feature in the following patches. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/selftest.c | 36 1 file changed, 36 insertions(+) diff --git a/drivers/iommu/iom

[PATCH v1 04/10] iommufd/viommu: Allow drivers to control vdev_id lifecycle

2024-08-27 Thread Nicolin Chen
The iommufd core provides a lookup helper for an IOMMU driver to find a device pointer by device's per-viommu virtual ID. Yet a driver may need an inverted lookup to find a device's per-viommu virtual ID by a device pointer, e.g. when reporting virtual IRQs/events back to the user space. In this ca

[PATCH v1 06/10] iommufd/viommu: Add iommufd_viommu_report_irq helper

2024-08-27 Thread Nicolin Chen
This allows IOMMU drivers to report to user space hypervisors IRQs/events that belong to a viommu. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/viommu_api.c | 40 ++ include/linux/iommufd.h| 8 ++ 2 files changed, 48 insertions(+) diff --git

[PATCH v1 08/10] iommufd/selftest: Add IOMMU_TEST_OP_TRIGGER_VIRQ for VIRQ coverage

2024-08-27 Thread Nicolin Chen
The handler will get vdev_id structure from the given mdev and convert it to its per-viommu virtual device ID to mimic a real IOMMU driver. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/iommufd_test.h | 10 ++ drivers/iommu/iommufd/selftest.c | 30

[PATCH v1 09/10] iommufd/selftest: Add EVENT_VIRQ test coverage

2024-08-27 Thread Nicolin Chen
Trigger an IRQ giving an idev ID, to test the loopback whether receiving or not the vdev_id that was set to the idev by the line above. Signed-off-by: Nicolin Chen --- tools/testing/selftests/iommu/iommufd.c | 11 tools/testing/selftests/iommu/iommufd_utils.h | 64 +++

[PATCH v1 10/10] iommu/arm-smmu-v3: Report virtual IRQ for device in user space

2024-08-27 Thread Nicolin Chen
Aside from the IOPF framework, iommufd provides an additional pathway to report a hardware event or IRQ, via the VIRQ of VIOMMU infrastructure. Implement the set/unset_vdev_id viommu ops, to take control of vdev_id's lifecycle. Lock it properly so the threaded IRQ handler can read out the viommu p

Re: [PATCH v3 0/3] RISC-V: mm: do not treat hint addr on mmap as the upper bound to search

2024-08-27 Thread Yangyu Chen
> On Aug 28, 2024, at 00:33, Palmer Dabbelt wrote: > > On Tue, 27 Aug 2024 01:05:15 PDT (-0700), c...@cyyself.name wrote: >> Previous patch series[1][2] changes a mmap behavior that treats the hint >> address as the upper bound of the mmap address range. The motivation of the >> previous patch

Re: [PATCH v3 0/3] RISC-V: mm: do not treat hint addr on mmap as the upper bound to search

2024-08-27 Thread Yangyu Chen
> On Aug 28, 2024, at 00:40, Charlie Jenkins wrote: > > On Tue, Aug 27, 2024 at 09:33:11AM -0700, Palmer Dabbelt wrote: >> On Tue, 27 Aug 2024 01:05:15 PDT (-0700), c...@cyyself.name wrote: >>> Previous patch series[1][2] changes a mmap behavior that treats the hint >>> address as the upper bo

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-27 Thread Eric Biggers
On Thu, Aug 22, 2024 at 09:13:13AM +0200, Christophe Leroy wrote: > With the current implementation, __cvdso_getrandom_data() calls > memset(), which is unexpected in the VDSO. > > Rewrite opaque data initialisation to avoid memset(). > > Signed-off-by: Christophe Leroy > --- > lib/vdso/getrand

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-27 Thread Jason A. Donenfeld
On Tue, Aug 27, 2024 at 11:08:19AM -0700, Eric Biggers wrote: > On Thu, Aug 22, 2024 at 09:13:13AM +0200, Christophe Leroy wrote: > > With the current implementation, __cvdso_getrandom_data() calls > > memset(), which is unexpected in the VDSO. > > > > Rewrite opaque data initialisation to avoid m

Re: [PATCH v2 3/6] kunit: Add macro to conditionally expose expressions to tests

2024-08-27 Thread Rae Moar
On Mon, Aug 26, 2024 at 3:20 PM Michal Wajdeczko wrote: > > The ONLY_IF_KUNIT macro will add expression statement only if the > CONFIG_KUNIT is enabled. Otherwise if CONFIG_KUNIT is not enabled > it will evaluate always to 0. > > Signed-off-by: Michal Wajdeczko Hello! Thanks for the second vers

[PATCH net-next RFC] selftests/net: integrate packetdrill with ksft

2024-08-27 Thread Willem de Bruijn
From: Willem de Bruijn Lay the groundwork to import into kselftests the over 150 packetdrill TCP/IP conformance tests on github.com/google/packetdrill. Florian recently added support for packetdrill tests in nf_conntrack, in commit a8a388c2aae49 ("selftests: netfilter: add packetdrill based conn

Re: [PATCH v3 0/3] RISC-V: mm: do not treat hint addr on mmap as the upper bound to search

2024-08-27 Thread Charlie Jenkins
On Wed, Aug 28, 2024 at 02:04:29AM +0800, Yangyu Chen wrote: > > > > On Aug 28, 2024, at 00:40, Charlie Jenkins wrote: > > > > On Tue, Aug 27, 2024 at 09:33:11AM -0700, Palmer Dabbelt wrote: > >> On Tue, 27 Aug 2024 01:05:15 PDT (-0700), c...@cyyself.name wrote: > >>> Previous patch series[1][2

Re: [PATCH v2 3/6] kunit: Add macro to conditionally expose expressions to tests

2024-08-27 Thread Michal Wajdeczko
On 27.08.2024 21:04, Rae Moar wrote: > On Mon, Aug 26, 2024 at 3:20 PM Michal Wajdeczko > wrote: >> >> The ONLY_IF_KUNIT macro will add expression statement only if the >> CONFIG_KUNIT is enabled. Otherwise if CONFIG_KUNIT is not enabled >> it will evaluate always to 0. >> >> Signed-off-by: Mic

Re: [PATCH v2 2/6] kunit: Add macro to conditionally expose declarations to tests

2024-08-27 Thread Michal Wajdeczko
On 27.08.2024 15:45, Lucas De Marchi wrote: > On Tue, Aug 27, 2024 at 12:20:11AM GMT, Michal Wajdeczko wrote: >> The DECLARE_IF_KUNIT macro will introduces identifiers only if >> CONFIG_KUNIT is enabled. Otherwise if CONFIG_KUNIT is not enabled >> no identifiers from the param list will be defin

Re: [PATCH net-next] selftests: forwarding: no_forwarding: Down ports on cleanup

2024-08-27 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Fri, 23 Aug 2024 18:25:37 +0200 you wrote: > This test neglects to put ports down on cleanup. Fix it. > > Fixes: 476a4f05d9b8 ("selftests: forwarding: add a no_forwarding.sh test") > Signed-off-by: Petr Machata > ---

Re: [PATCH net-next] selftests: forwarding: local_termination: Down ports on cleanup

2024-08-27 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Mon, 26 Aug 2024 19:15:11 +0200 you wrote: > This test neglects to put ports down on cleanup. Fix it. > > Fixes: 90b9566aa5cd ("selftests: forwarding: add a test for > local_termination.sh") > Signed-off-by: Petr Mach

Re: [PATCH v2 4/6] kunit: Allow function redirection outside of the KUnit thread

2024-08-27 Thread Michal Wajdeczko
On 27.08.2024 16:46, Lucas De Marchi wrote: > On Tue, Aug 27, 2024 at 12:20:13AM GMT, Michal Wajdeczko wrote: >> Currently, the 'static stub' API only allows function redirection >> for calls made from the kthread of the current test, which prevents >> the use of this functionality when the test

[PATCH 1/1 V3] selftests: net: improve missing modules error message

2024-08-27 Thread David Hunter
The error message describing the required modules is inaccurate. Currently, only "SKIP: Need act_mirred module" is printed when any of the modules are missing. As a result, users might only include that module; however, three modules are required. Fix the error message to show any/all modules nee

Re: [PATCH 1/1 V3] selftests: net: improve missing modules error message

2024-08-27 Thread Jakub Kicinski
On Tue, 27 Aug 2024 16:56:29 -0400 David Hunter wrote: > The error message describing the required modules is inaccurate. > Currently, only "SKIP: Need act_mirred module" is printed when any of > the modules are missing. As a result, users might only include that > module; however, three modules a

Re: [PATCH net-next v4 0/8] net/selftests: TCP-AO selftests updates

2024-08-27 Thread Jakub Kicinski
On Fri, 23 Aug 2024 23:04:50 +0100 Dmitry Safonov via B4 Relay wrote: > First 3 patches are more-or-less cleanups/preparations. > > Patches 4/5 are fixes for netns file descriptors leaks/open. > > Patch 6 was sent to me/contributed off-list by Mohammad, who wants 32-bit > kernels to run TCP-AO. >

Re: [PATCH net-next v4 0/8] net/selftests: TCP-AO selftests updates

2024-08-27 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Fri, 23 Aug 2024 23:04:50 +0100 you wrote: > First 3 patches are more-or-less cleanups/preparations. > > Patches 4/5 are fixes for netns file descriptors leaks/open. > > Patch 6 was sent to me/contributed off-li

  1   2   >