Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Nicolin Chen
On Mon, Dec 11, 2023 at 05:57:38PM -0400, Jason Gunthorpe wrote: > On Mon, Dec 11, 2023 at 01:27:49PM -0800, Nicolin Chen wrote: > > On Fri, Dec 08, 2023 at 09:47:26PM -0400, Jason Gunthorpe wrote: > > > What is in a Nested domain: > > > ARM: A CD table pointer > > > Nesting domains are crea

Re: [PATCH] Revert "selftests: error out if kernel header files are not yet built"

2023-12-11 Thread Muhammad Usama Anjum
On 12/12/23 12:00 AM, John Hubbard wrote: > On 12/11/23 03:00, Muhammad Usama Anjum wrote: >> On 12/9/23 7:01 AM, John Hubbard wrote: >>> This reverts commit 9fc96c7c19df ("selftests: error out if kernel header >>> files are not yet built"). >> I don't think whole of this commit needs to be reverte

Re: [net-next v1 00/16] Device Memory TCP

2023-12-11 Thread Christoph Hellwig
Please don't spread scatterlists further. They are a bad data structure that mix input data (page, offset, len) and output data (phys_addr, dma_offset, dma_len), and do in a horrible way for iommmu mappings that can coalesce. Jason and coworkers have been looking into the long overdue API to bett

Re: [PATCH v7 3/3] iommu/vt-d: Add iotlb flush for nested domain

2023-12-11 Thread Yi Liu
On 2023/12/7 02:56, Jason Gunthorpe wrote: On Fri, Nov 17, 2023 at 05:18:16AM -0800, Yi Liu wrote: +static int intel_nested_cache_invalidate_user(struct iommu_domain *domain, + struct iommu_user_data_array *array, +

Re: [PATCH v7 3/3] iommu/vt-d: Add iotlb flush for nested domain

2023-12-11 Thread Yi Liu
On 2023/11/20 16:32, Tian, Kevin wrote: From: Liu, Yi L Sent: Friday, November 17, 2023 9:18 PM + + if (inv_info.__reserved || (inv_info.flags & ~IOMMU_VTD_INV_FLAGS_LEAF) || + !IS_ALIGNED(inv_info.addr, VTD_PAGE_SIZE)) { + ret = -EINVAL; +

Re: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl

2023-12-11 Thread Yi Liu
On 2023/12/12 11:39, Alex Williamson wrote: On Tue, 12 Dec 2023 02:43:20 + "Duan, Zhenzhong" wrote: -Original Message- From: Alex Williamson Sent: Tuesday, December 12, 2023 2:04 AM Subject: Re: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl On Sun, 26 No

Re: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl

2023-12-11 Thread Yi Liu
On 2023/12/12 10:16, Tian, Kevin wrote: From: Alex Williamson Sent: Tuesday, December 12, 2023 2:04 AM On Sun, 26 Nov 2023 22:39:09 -0800 Yi Liu wrote: This reports the PASID capability data to userspace via VFIO_DEVICE_FEATURE, hence userspace could probe PASID capability by it. This is a

Re: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl

2023-12-11 Thread Alex Williamson
On Tue, 12 Dec 2023 02:43:20 + "Duan, Zhenzhong" wrote: > >-Original Message- > >From: Alex Williamson > >Sent: Tuesday, December 12, 2023 2:04 AM > >Subject: Re: [PATCH 3/3] vfio: Report PASID capability via > >VFIO_DEVICE_FEATURE ioctl > > > >On Sun, 26 Nov 2023 22:39:09 -0800 > >Y

Re: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl

2023-12-11 Thread Yi Liu
On 2023/12/12 10:20, Tian, Kevin wrote: From: Liu, Yi L Sent: Monday, December 11, 2023 4:08 PM On 2023/12/7 16:47, Tian, Kevin wrote: From: Liu, Yi L Sent: Monday, November 27, 2023 2:39 PM +static int vfio_pci_core_feature_pasid(struct vfio_device *device, u32 flags, +

Re: [PATCH 2/3] vfio: Add VFIO_DEVICE_PASID_[AT|DE]TACH_IOMMUFD_PT

2023-12-11 Thread Yi Liu
On 2023/12/12 01:05, Alex Williamson wrote: On Sun, 26 Nov 2023 22:39:08 -0800 Yi Liu wrote: This adds ioctls for the userspace to attach a given pasid of a vfio device to/from an IOAS/HWPT. Signed-off-by: Yi Liu --- drivers/vfio/device_cdev.c | 45 +++ drivers

RE: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl

2023-12-11 Thread Duan, Zhenzhong
>-Original Message- >From: Alex Williamson >Sent: Tuesday, December 12, 2023 2:04 AM >Subject: Re: [PATCH 3/3] vfio: Report PASID capability via >VFIO_DEVICE_FEATURE ioctl > >On Sun, 26 Nov 2023 22:39:09 -0800 >Yi Liu wrote: > >> This reports the PASID capability data to userspace via

RE: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl

2023-12-11 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Monday, December 11, 2023 4:08 PM > > On 2023/12/7 16:47, Tian, Kevin wrote: > >> From: Liu, Yi L > >> Sent: Monday, November 27, 2023 2:39 PM > >> > >> +static int vfio_pci_core_feature_pasid(struct vfio_device *device, u32 > flags, > >> +

RE: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl

2023-12-11 Thread Tian, Kevin
> From: Alex Williamson > Sent: Tuesday, December 12, 2023 2:04 AM > > On Sun, 26 Nov 2023 22:39:09 -0800 > Yi Liu wrote: > > > This reports the PASID capability data to userspace via > VFIO_DEVICE_FEATURE, > > hence userspace could probe PASID capability by it. This is a bit different > > with

Re: [PATCH v3 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch

2023-12-11 Thread Marcos Paulo de Souza
On Mon, 2023-12-11 at 14:56 -0700, Shuah Khan wrote: > On 12/7/23 12:19, mpdeso...@suse.com wrote: > > On Thu, 2023-12-07 at 10:20 -0500, Joe Lawrence wrote: > > > On 12/6/23 10:05, Miroslav Benes wrote: > > > > On Fri, 1 Dec 2023, Joe Lawrence wrote: > > > > > > > > > On Tue, Oct 31, 2023 at 06:1

Re: [PATCH bpf-next v5 9/9] bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state()

2023-12-11 Thread Eyal Birger
On Mon, Dec 11, 2023 at 3:49 PM Daniel Xu wrote: > > On Mon, Dec 11, 2023 at 03:13:07PM -0800, Eyal Birger wrote: > > On Mon, Dec 11, 2023 at 2:31 PM Daniel Xu wrote: > > > > > > On Mon, Dec 11, 2023 at 01:39:25PM -0800, Eyal Birger wrote: > > > > Hi Daniel, > > > > > > > > Tiny nits below in cas

Re: [PATCH bpf-next v5 9/9] bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state()

2023-12-11 Thread Daniel Xu
On Mon, Dec 11, 2023 at 03:13:07PM -0800, Eyal Birger wrote: > On Mon, Dec 11, 2023 at 2:31 PM Daniel Xu wrote: > > > > On Mon, Dec 11, 2023 at 01:39:25PM -0800, Eyal Birger wrote: > > > Hi Daniel, > > > > > > Tiny nits below in case you respin this for other reasons: > > > > > > On Mon, Dec 11, 2

Re: [PATCH bpf-next v5 9/9] bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state()

2023-12-11 Thread Eyal Birger
On Mon, Dec 11, 2023 at 2:31 PM Daniel Xu wrote: > > On Mon, Dec 11, 2023 at 01:39:25PM -0800, Eyal Birger wrote: > > Hi Daniel, > > > > Tiny nits below in case you respin this for other reasons: > > > > On Mon, Dec 11, 2023 at 12:20 PM Daniel Xu wrote: > > > > > > This commit extends test_tunnel

Re: [PATCH bpf-next v5 9/9] bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state()

2023-12-11 Thread Daniel Xu
On Mon, Dec 11, 2023 at 01:39:25PM -0800, Eyal Birger wrote: > Hi Daniel, > > Tiny nits below in case you respin this for other reasons: > > On Mon, Dec 11, 2023 at 12:20 PM Daniel Xu wrote: > > > > This commit extends test_tunnel selftest to test the new XDP xfrm state > > lookup kfunc. > > > >

Re: [PATCH v3 4/6] kunit: add is_init test attribute

2023-12-11 Thread Rae Moar
On Sat, Dec 9, 2023 at 2:57 AM David Gow wrote: > > On Tue, 5 Dec 2023 at 06:19, Rae Moar wrote: > > > > Add is_init test attribute of type bool. Add to_string, get, and filter > > methods to lib/kunit/attributes.c. > > > > Mark each of the tests in the init section with the is_init=true attribut

Re: [PATCH v3 6/6] Documentation: Add debugfs docs with run after boot

2023-12-11 Thread Rae Moar
On Sat, Dec 9, 2023 at 2:58 AM David Gow wrote: > > On Tue, 5 Dec 2023 at 06:19, Rae Moar wrote: > > > > Expand the documentation on the KUnit debugfs filesystem on the > > run_manual.rst page. > > > > Add section describing how to access results using debugfs. > > > > Add section describing how

Re: [PATCH v3 1/6] kunit: move KUNIT_TABLE out of INIT_DATA

2023-12-11 Thread Rae Moar
On Sat, Dec 9, 2023 at 2:48 AM David Gow wrote: > > On Tue, 5 Dec 2023 at 06:19, Rae Moar wrote: > > > > Alter the linker section of KUNIT_TABLE to move it out of INIT_DATA and > > into DATA_DATA. > > > > Data for KUnit tests does not need to be in the init section. > > > > In order to run tests

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Jason Gunthorpe
On Mon, Dec 11, 2023 at 01:27:49PM -0800, Nicolin Chen wrote: > On Fri, Dec 08, 2023 at 09:47:26PM -0400, Jason Gunthorpe wrote: > > What is in a Nested domain: > > ARM: A CD table pointer > > Nesting domains are created for every unique CD table top pointer. > > I think we basically implem

Re: [PATCH v3 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch

2023-12-11 Thread Shuah Khan
On 12/7/23 12:19, mpdeso...@suse.com wrote: On Thu, 2023-12-07 at 10:20 -0500, Joe Lawrence wrote: On 12/6/23 10:05, Miroslav Benes wrote: On Fri, 1 Dec 2023, Joe Lawrence wrote: On Tue, Oct 31, 2023 at 06:10:52PM -0300, Marcos Paulo de Souza wrote: The modules are being moved from lib/livep

Re: [PATCH v3 3/3] selftests: livepatch: Test livepatching a heavily called syscall

2023-12-11 Thread Shuah Khan
On 12/6/23 07:39, Miroslav Benes wrote: Hi, On Tue, 5 Dec 2023, Shuah Khan wrote: On 12/5/23 05:52, mpdeso...@suse.com wrote: On Fri, 2023-12-01 at 16:38 +, Shuah Khan wrote: 0003-selftests-livepatch-Test-livepatching-a-heavily-call.patch has style problems, please review. NOTE: If an

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Jason Gunthorpe
On Mon, Dec 11, 2023 at 12:11:25PM -0800, Nicolin Chen wrote: > On Mon, Dec 11, 2023 at 09:20:41AM -0400, Jason Gunthorpe wrote: > > On Mon, Dec 11, 2023 at 08:35:09PM +0800, Yi Liu wrote: > > > > So.. In short.. Invalidation is a PITA. The idea is the same but > > > > annoying little details inter

Re: [PATCH bpf-next v5 9/9] bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state()

2023-12-11 Thread Eyal Birger
Hi Daniel, Tiny nits below in case you respin this for other reasons: On Mon, Dec 11, 2023 at 12:20 PM Daniel Xu wrote: > > This commit extends test_tunnel selftest to test the new XDP xfrm state > lookup kfunc. > > Co-developed-by: Antony Antony > Signed-off-by: Antony Antony > Signed-off-by:

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Nicolin Chen
On Fri, Dec 08, 2023 at 09:47:26PM -0400, Jason Gunthorpe wrote: > What is in a Nested domain: > ARM: A CD table pointer > Nesting domains are created for every unique CD table top pointer. I think we basically implemented in a way of syncing STE, i,e, vSTE.Config must be "S1 Translate" bes

Re: [net-next v1 08/16] memory-provider: dmabuf devmem memory provider

2023-12-11 Thread Pavel Begunkov
On 12/11/23 02:30, Mina Almasry wrote: On Sat, Dec 9, 2023 at 7:05 PM Pavel Begunkov wrote: On 12/8/23 23:25, Mina Almasry wrote: On Fri, Dec 8, 2023 at 2:56 PM Pavel Begunkov wrote: On 12/8/23 00:52, Mina Almasry wrote: ... + if (pool->p.queue) + binding = READ_ONCE(pool

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread John Hubbard
On 12/11/23 12:21, Mark Brown wrote: On Mon, Dec 11, 2023 at 10:46:23AM -0800, John Hubbard wrote: Or (4) Hack in little ifdef snippets, into the selftests, like we used to do. Peter Zijlstra seems to be asking for this, if I understand his (much) earlier comments about this. I can't help but

Re: [PATCH] kselftest/arm64: Log SVCR when the SME tests barf

2023-12-11 Thread Will Deacon
On Tue, 05 Dec 2023 14:24:44 +, Mark Brown wrote: > On failure we log the actual and expected value of the register we detect > a mismatch in. For SME one obvious potential source of corruption would be > if we had corrupted SVCR since changes in streaming mode will reset the > register values,

Re: [PATCH] kselftest/arm64: Improve output for skipped TPIDR2 ABI test

2023-12-11 Thread Will Deacon
On Fri, 24 Nov 2023 15:22:21 +, Mark Brown wrote: > When TPIDR2 is not supported the tpidr2 ABI test prints the same message > for each skipped test: > > ok 1 skipped, TPIDR2 not supported > > which isn't ideal for test automation software since it tracks kselftest > results based on the st

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread Mark Brown
On Mon, Dec 11, 2023 at 10:46:23AM -0800, John Hubbard wrote: > Or (4) Hack in little ifdef snippets, into the selftests, like we used > to do. Peter Zijlstra seems to be asking for this, if I understand his > (much) earlier comments about this. I can't help but think that if we're having to manu

[PATCH bpf-next v5 9/9] bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state()

2023-12-11 Thread Daniel Xu
This commit extends test_tunnel selftest to test the new XDP xfrm state lookup kfunc. Co-developed-by: Antony Antony Signed-off-by: Antony Antony Signed-off-by: Daniel Xu --- .../selftests/bpf/prog_tests/test_tunnel.c| 20 ++-- .../selftests/bpf/progs/test_tunnel_kern.c| 51 +++

[PATCH bpf-next v5 8/9] bpf: selftests: Move xfrm tunnel test to test_progs

2023-12-11 Thread Daniel Xu
test_progs is better than a shell script b/c C is a bit easier to maintain than shell. Also it's easier to use new infra like memory mapped global variables from C via bpf skeleton. Co-developed-by: Antony Antony Signed-off-by: Antony Antony Signed-off-by: Daniel Xu --- .../selftests/bpf/prog_

[PATCH bpf-next v5 7/9] bpf: selftests: test_tunnel: Use vmlinux.h declarations

2023-12-11 Thread Daniel Xu
vmlinux.h declarations are more ergnomic, especially when working with kfuncs. The uapi headers are often incomplete for kfunc definitions. This commit also switches bitfield accesses to use CO-RE helpers. Switching to vmlinux.h definitions makes the verifier very unhappy with raw bitfield accesse

[PATCH bpf-next v5 6/9] bpf: selftests: test_tunnel: Setup fresh topology for each subtest

2023-12-11 Thread Daniel Xu
This helps with determinism b/c individual setup/teardown prevents leaking state between different subtests. Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/prog_tests/test_tunnel.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/pr

[PATCH bpf-next v5 5/9] bpf: selftests: Add verifier tests for CO-RE bitfield writes

2023-12-11 Thread Daniel Xu
Add some tests that exercise BPF_CORE_WRITE_BITFIELD() macro. Since some non-trivial bit fiddling is going on, make sure various edge cases (such as adjacent bitfields and bitfields at the edge of structs) are exercised. Acked-by: Andrii Nakryiko Signed-off-by: Daniel Xu --- .../selftests/bpf/p

[PATCH bpf-next v5 4/9] bpf: selftests: test_loader: Support __btf_path() annotation

2023-12-11 Thread Daniel Xu
This commit adds support for per-prog btf_custom_path. This is necessary for testing CO-RE relocations on non-vmlinux types using test_loader infrastructure. Acked-by: Andrii Nakryiko Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/progs/bpf_misc.h | 1 + tools/testing/selftests/bpf/te

[PATCH bpf-next v5 0/9] Add bpf_xdp_get_xfrm_state() kfunc

2023-12-11 Thread Daniel Xu
This patchset adds two kfunc helpers, bpf_xdp_get_xfrm_state() and bpf_xdp_xfrm_state_release() that wrap xfrm_state_lookup() and xfrm_state_put(). The intent is to support software RSS (via XDP) for the ongoing/upcoming ipsec pcpu work [0]. Recent experiments performed on (hopefully) reproducible

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread John Hubbard
On 12/11/23 12:01, Mark Brown wrote: On Mon, Dec 11, 2023 at 07:00:32PM +0100, David Hildenbrand wrote: On 11.12.23 18:32, Mark Brown wrote: On Mon, Dec 11, 2023 at 05:53:59PM +0100, David Hildenbrand wrote: https://lkml.kernel.org/r/20231209020144.244759-1-jhubb...@nvidia.com I mean, I g

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Nicolin Chen
On Mon, Dec 11, 2023 at 09:20:41AM -0400, Jason Gunthorpe wrote: > On Mon, Dec 11, 2023 at 08:35:09PM +0800, Yi Liu wrote: > > > So.. In short.. Invalidation is a PITA. The idea is the same but > > > annoying little details interfere with actually having a compltely > > > common API here. IMHO the

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread Mark Brown
On Mon, Dec 11, 2023 at 07:00:32PM +0100, David Hildenbrand wrote: > On 11.12.23 18:32, Mark Brown wrote: > > On Mon, Dec 11, 2023 at 05:53:59PM +0100, David Hildenbrand wrote: > > > https://lkml.kernel.org/r/20231209020144.244759-1-jhubb...@nvidia.com > > I mean, I guess people who don't want to

Re: [PATCH] Revert "selftests: error out if kernel header files are not yet built"

2023-12-11 Thread John Hubbard
On 12/11/23 03:00, Muhammad Usama Anjum wrote: On 12/9/23 7:01 AM, John Hubbard wrote: This reverts commit 9fc96c7c19df ("selftests: error out if kernel header files are not yet built"). I don't think whole of this commit needs to be reverted. Lets leave the warning message as it is and just re

Re: [PATCH v3 18/25] arm64/ptrace: add support for FEAT_POE

2023-12-11 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:35:03PM +, Joey Gouly wrote: > Add a regset for POE containing POR_EL0. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon Reviewed-by: Catalin Marinas

Re: [PATCH v3 17/25] arm64: enable POE and PIE to coexist

2023-12-11 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:35:02PM +, Joey Gouly wrote: > Set the EL0/userspace indirection encodings to be the overlay enabled > variants of the permissions. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > --- > arch/arm64/include/asm/pgtable-prot.h | 8 >

Re: [PATCH v3 16/25] arm64: enable PKEY support for CPUs with S1POE

2023-12-11 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:35:01PM +, Joey Gouly wrote: > Now that PKEYs support has been implemented, enable it for CPUs that > support S1POE. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon Acked-by: Catalin Marinas

Re: [PATCH v3 15/25] arm64: add POE signal support

2023-12-11 Thread Catalin Marinas
+ Szabolcs for libc ack (and keeping the full patch quoted below) You should cc Szabolcs when reposting, we need his ack on the UAPI changes. On Fri, Nov 24, 2023 at 04:35:00PM +, Joey Gouly wrote: > Add PKEY support to signals, by saving and restoring POR_EL0 from the > stackframe. > > Sig

Re: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl

2023-12-11 Thread Alex Williamson
On Mon, 11 Dec 2023 14:10:28 -0400 Jason Gunthorpe wrote: > On Mon, Dec 11, 2023 at 11:03:45AM -0700, Alex Williamson wrote: > > On Sun, 26 Nov 2023 22:39:09 -0800 > > Yi Liu wrote: > > >the PF). Creating a virtual PASID capability in vfio-pci config space > > > needs > > >to find a ho

Re: [PATCH v3 14/25] arm64: implement PKEYS support

2023-12-11 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:59PM +, Joey Gouly wrote: > @@ -211,11 +212,24 @@ init_new_context(struct task_struct *tsk, struct > mm_struct *mm) > { > atomic64_set(&mm->context.id, 0); > refcount_set(&mm->context.pinned, 0); > + > + // pkey 0 is the default, so always reserve

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread John Hubbard
On 12/11/23 08:32, David Hildenbrand wrote: ... That's an open question: do we want to be able to build selftests against any host headers, and not the in-tree headers that have to be manually installed and dirty the git tree? One obvious drawbacks is that we'll have to deal with all that usin

Re: [PATCH v3 13/25] arm64: stop using generic mm_hooks.h

2023-12-11 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:58PM +, Joey Gouly wrote: > These functions will be extended to support pkeys. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon Nit: can you squash it into patch 14 introducing those functions? Less patches to carry.

Re: [PATCH v3 12/25] arm64: handle PKEY/POE faults

2023-12-11 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:57PM +, Joey Gouly wrote: > @@ -497,6 +498,23 @@ static void do_bad_area(unsigned long far, unsigned long > esr, > #define VM_FAULT_BADMAP ((__force vm_fault_t)0x01) > #define VM_FAULT_BADACCESS ((__force vm_fault_t)0x02) > > +static boo

Re: [net-next v1 09/16] page_pool: device memory support

2023-12-11 Thread Mina Almasry
On Mon, Dec 11, 2023 at 3:51 AM Yunsheng Lin wrote: > > On 2023/12/11 12:04, Mina Almasry wrote: > > On Sun, Dec 10, 2023 at 6:26 PM Mina Almasry wrote: > >> > >> On Sun, Dec 10, 2023 at 6:04 PM Yunsheng Lin > >> wrote: > >>> > >>> On 2023/12/9 0:05, Mina Almasry wrote: > On Fri, Dec 8, 20

Re: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl

2023-12-11 Thread Jason Gunthorpe
On Mon, Dec 11, 2023 at 11:03:45AM -0700, Alex Williamson wrote: > On Sun, 26 Nov 2023 22:39:09 -0800 > Yi Liu wrote: > > > This reports the PASID capability data to userspace via VFIO_DEVICE_FEATURE, > > hence userspace could probe PASID capability by it. This is a bit different > > with other c

Re: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl

2023-12-11 Thread Alex Williamson
On Sun, 26 Nov 2023 22:39:09 -0800 Yi Liu wrote: > This reports the PASID capability data to userspace via VFIO_DEVICE_FEATURE, > hence userspace could probe PASID capability by it. This is a bit different > with other capabilities which are reported to userspace when the user reads > the device'

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread David Hildenbrand
On 11.12.23 18:32, Mark Brown wrote: On Mon, Dec 11, 2023 at 05:53:59PM +0100, David Hildenbrand wrote: (3) avoids dirtying the tree as a "make headers_install" would, but it also means that each test that makes use of new uapi has to update the relevant headers (what people working on QEMU are

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Jason Gunthorpe
On Tue, Dec 12, 2023 at 12:35:26AM +0700, Suthikulpanit, Suravee wrote: > > > On 12/9/2023 8:47 AM, Jason Gunthorpe wrote: > > On Fri, Nov 17, 2023 at 05:07:11AM -0800, Yi Liu wrote: > > > > > Take Intel VT-d as an example, the stage-1 translation table is I/O page > > > table. As the below diag

Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH

2023-12-11 Thread Song Liu
On Sun, Dec 10, 2023 at 9:04 PM Akihiko Odaki wrote: > [...] > > > > I don't think we can provide stability guarantees before seeing something > > being used in the field. How do we know it will be useful forever? If a > > couple years later, there is only one person using it somewhere in the > >

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Suthikulpanit, Suravee
On 12/9/2023 8:47 AM, Jason Gunthorpe wrote: On Fri, Nov 17, 2023 at 05:07:11AM -0800, Yi Liu wrote: Take Intel VT-d as an example, the stage-1 translation table is I/O page table. As the below diagram shows, guest I/O page table pointer in GPA (guest physical address) is passed to host and

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread Mark Brown
On Mon, Dec 11, 2023 at 05:53:59PM +0100, David Hildenbrand wrote: > > > (3) avoids dirtying the tree as a "make headers_install" would, but it > > > also > > > means that each test that makes use of new uapi has to update the relevant > > > headers (what people working on QEMU are used to). > >

Re: [PATCH 2/3] vfio: Add VFIO_DEVICE_PASID_[AT|DE]TACH_IOMMUFD_PT

2023-12-11 Thread Alex Williamson
On Sun, 26 Nov 2023 22:39:08 -0800 Yi Liu wrote: > This adds ioctls for the userspace to attach a given pasid of a vfio > device to/from an IOAS/HWPT. > > Signed-off-by: Yi Liu > --- > drivers/vfio/device_cdev.c | 45 +++ > drivers/vfio/vfio.h| 4 +++ > dri

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread David Hildenbrand
Further, the tests are closely related to the given kernel version, they are not some completely separate tests. Note that there's a general desire for the tests to *run* with older kernels and use whatever feature test mechanisms exist to skip tests that won't run. That's often needed anyway f

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread Suren Baghdasaryan
On Mon, Dec 11, 2023 at 8:34 AM Mark Brown wrote: > > On Mon, Dec 11, 2023 at 08:29:06AM -0800, Suren Baghdasaryan wrote: > > > Just to rule out this possibility, linux-next was broken on Friday > > (see > > https://lore.kernel.org/all/cajucfpfieqro4qkfzbucmgzy-n_ucqgr5neyvnwxqyh+ru4...@mail.gmai

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread Mark Brown
On Mon, Dec 11, 2023 at 05:32:16PM +0100, David Hildenbrand wrote: > On 11.12.23 17:15, Suren Baghdasaryan wrote: > > Ok, I was updating my headers and that's why I could not reproduce it. > > David, should the test be modified to handle old linux headers > > (disable the new tests #ifndef _UFFDIO

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread Mark Brown
On Mon, Dec 11, 2023 at 08:29:06AM -0800, Suren Baghdasaryan wrote: > Just to rule out this possibility, linux-next was broken on Friday > (see > https://lore.kernel.org/all/cajucfpfieqro4qkfzbucmgzy-n_ucqgr5neyvnwxqyh+ru4...@mail.gmail.com/). > I just checked and it's fixed now. Could you confir

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread David Hildenbrand
On 11.12.23 17:15, Suren Baghdasaryan wrote: On Mon, Dec 11, 2023 at 4:24 AM Mark Brown wrote: On Mon, Dec 11, 2023 at 01:03:27PM +0100, David Hildenbrand wrote: On 11.12.23 12:15, Mark Brown wrote: This is linux-next. I pasted the commands used to build and sent links to a full build log

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread Suren Baghdasaryan
On Mon, Dec 11, 2023 at 8:25 AM Mark Brown wrote: > > On Mon, Dec 11, 2023 at 08:15:11AM -0800, Suren Baghdasaryan wrote: > > On Mon, Dec 11, 2023 at 4:24 AM Mark Brown wrote: > > > > Oh, it's obviously the new headers not being installed. The builds > > > where I'm seeing the problem (my own an

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread Mark Brown
On Mon, Dec 11, 2023 at 08:15:11AM -0800, Suren Baghdasaryan wrote: > On Mon, Dec 11, 2023 at 4:24 AM Mark Brown wrote: > > Oh, it's obviously the new headers not being installed. The builds > > where I'm seeing the problem (my own and KernelCI's) are all fresh > > containers so there shouldn't

[PATCH v7 11/11] Documentation: arm64: Document the PMU event counting threshold feature

2023-12-11 Thread James Clark
Add documentation for the new Perf event open parameters and the threshold_max capability file. Reviewed-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Acked-by: Namhyung Kim Signed-off-by: James Clark --- Documentation/arch/arm64/perf.rst | 72 +++ 1 file cha

[PATCH v7 10/11] arm64: perf: Add support for event counting threshold

2023-12-11 Thread James Clark
FEAT_PMUv3_TH (Armv8.8) permits a PMU counter to increment only on events whose count meets a specified threshold condition. For example if PMEVTYPERn.TC (Threshold Control) is set to 0b101 (Greater than or equal, count), and the threshold is set to 2, then the PMU counter will now only increment b

[PATCH v7 09/11] arm: pmu: Move error message and -EOPNOTSUPP to individual PMUs

2023-12-11 Thread James Clark
-EPERM or -EINVAL always get converted to -EOPNOTSUPP, so replace them. This will allow __hw_perf_event_init() to return a different code or not print that particular message for a different error in the next commit. Signed-off-by: James Clark --- arch/arm/kernel/perf_event_v7.c | 6 -- dri

[PATCH v7 08/11] KVM: selftests: aarch64: Update tools copy of arm_pmuv3.h

2023-12-11 Thread James Clark
Now that ARMV8_PMU_PMCR_N is made with GENMASK, update usages to treat it as a pre-shifted mask. Signed-off-by: James Clark --- tools/include/perf/arm_pmuv3.h| 43 +++ .../kvm/aarch64/vpmu_counter_access.c | 5 +-- 2 files changed, 28 insertions(+), 20 de

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread Suren Baghdasaryan
On Mon, Dec 11, 2023 at 4:24 AM Mark Brown wrote: > > On Mon, Dec 11, 2023 at 01:03:27PM +0100, David Hildenbrand wrote: > > On 11.12.23 12:15, Mark Brown wrote: > > > > This is linux-next. I pasted the commands used to build and sent links > > > to a full build log in the original report. > > >

[PATCH v7 07/11] perf/arm_dmc620: Remove duplicate format attribute #defines

2023-12-11 Thread James Clark
These were copied from the SPE driver, but now they're in the arm_pmu.h header so delete them and use the header instead. Signed-off-by: James Clark --- drivers/perf/arm_dmc620_pmu.c | 22 +- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/perf/arm_dmc62

[PATCH v7 06/11] arm: pmu: Share user ABI format mechanism with SPE

2023-12-11 Thread James Clark
This mechanism makes it much easier to define and read new attributes so move it to the arm_pmu.h header so that it can be shared. At the same time update the existing format attributes to use it. GENMASK has to be changed to GENMASK_ULL because the config fields are 64 bits even on arm32 where th

[PATCH v7 05/11] arm64: perf: Include threshold control fields in PMEVTYPER mask

2023-12-11 Thread James Clark
FEAT_PMUv3_TH (Armv8.8) adds two new fields to PMEVTYPER, so include them in the mask. These aren't writable on 32 bit kernels as they are in the high part of the register, so only include them for arm64. It would be difficult to do this statically in the asm header files for each platform without

[PATCH v7 04/11] arm: perf: Convert remaining fields to use GENMASK

2023-12-11 Thread James Clark
Convert the remaining fields to use either GENMASK or be built from other fields. These all already started at bit 0 so don't need a code change for the lack of _SHIFT. Signed-off-by: James Clark --- drivers/perf/arm_pmuv3.c | 2 +- include/linux/perf/arm_pmuv3.h | 18 +-

[PATCH v7 03/11] arm: perf: Use GENMASK for PMMIR fields

2023-12-11 Thread James Clark
This is so that FIELD_GET and FIELD_PREP can be used and that the fields are in a consistent format to arm64/tools/sysreg Signed-off-by: James Clark --- drivers/perf/arm_pmuv3.c | 8 +++- include/linux/perf/arm_pmuv3.h | 9 +++-- 2 files changed, 6 insertions(+), 11 deletions(-) d

[PATCH v7 02/11] arm: perf/kvm: Use GENMASK for ARMV8_PMU_PMCR_N

2023-12-11 Thread James Clark
This is so that FIELD_GET and FIELD_PREP can be used and that the fields are in a consistent format to arm64/tools/sysreg Signed-off-by: James Clark --- arch/arm64/kvm/pmu-emul.c | 8 +++- arch/arm64/kvm/sys_regs.c | 4 ++-- drivers/perf/arm_pmuv3.c | 4 ++-- include/linux/pe

[PATCH v7 01/11] arm: perf: Remove inlines from arm_pmuv3.c

2023-12-11 Thread James Clark
These are all static and in one compilation unit so the inline has no effect on the binary. Except if FTRACE is enabled, then 3 functions which were already not inlined now get the nops added which allows them to be traced. Signed-off-by: James Clark --- drivers/perf/arm_pmuv3.c | 46 +++

[PATCH v7 00/11] arm64: perf: Add support for event counting threshold

2023-12-11 Thread James Clark
Changes since v6: * Remove inlines from arm_pmuv3.c * Use format attribute mechanism from SPE * Re-arrange attributes so that threshold comes last and can potentially be extended * Emit an error if the max threshold is exceeded rather than clamping * Convert all register fields to GE

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Jason Gunthorpe
On Mon, Dec 11, 2023 at 10:34:09PM +0700, Suthikulpanit, Suravee wrote: > Currently, the AMD IOMMU driver allocates a DomainId per IOMMU group. > One issue with this is when we have nested translation where we could end up > with multiple devices (RIDs) sharing same PASID and the same hDomainID.

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Suthikulpanit, Suravee
On 12/11/2023 8:05 PM, Jason Gunthorpe wrote: On Mon, Dec 11, 2023 at 08:36:46PM +0800, Yi Liu wrote: On 2023/12/11 10:29, Tian, Kevin wrote: From: Jason Gunthorpe Sent: Saturday, December 9, 2023 9:47 AM What is in a Nested domain: Intel: A single IO page table refereed to by a PASID e

Re: [PATCH v6 2/6] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-12-11 Thread Jason Gunthorpe
On Mon, Dec 11, 2023 at 03:53:40PM +0800, Yi Liu wrote: > > > From that thread Jason mentioned to make the invalidation format > > > part of domain allocation. If that is the direction to go then there > > > won't be multiple invalidation formats per hwpt. The user should > > > create multiple hw

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Jason Gunthorpe
On Mon, Dec 11, 2023 at 08:35:09PM +0800, Yi Liu wrote: > > What iommufd object should receive the IOTLB invalidation command list: > > Intel: The Nesting domain. The command list has to be broken up per > > (vDomain-ID,PASID) and that batch delivered to the single > > nesting domai

[PATCH RESEND v3] KVM: selftests: Initialise dynamically allocated configuration names

2023-12-11 Thread Mark Brown
When we dynamically generate a name for a configuration in get-reg-list we use strcat() to append to a buffer allocated using malloc() but we never initialise that buffer. Since malloc() offers no guarantees regarding the contents of the memory it returns this can lead to us corrupting, and likely

Re: [PATCH v6 6/6] iommufd/selftest: Add coverage for IOMMU_HWPT_INVALIDATE ioctl

2023-12-11 Thread Jason Gunthorpe
On Mon, Dec 11, 2023 at 07:28:42PM +0800, Yi Liu wrote: > On 2023/12/7 02:19, Jason Gunthorpe wrote: > > On Fri, Nov 17, 2023 at 05:07:17AM -0800, Yi Liu wrote: > > > From: Nicolin Chen > > > > > > Add test cases for the IOMMU_HWPT_INVALIDATE ioctl and verify it by using > > > the new IOMMU_TEST_

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Jason Gunthorpe
On Mon, Dec 11, 2023 at 08:36:46PM +0800, Yi Liu wrote: > On 2023/12/11 10:29, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Saturday, December 9, 2023 9:47 AM > > > > > > What is in a Nested domain: > > > Intel: A single IO page table refereed to by a PASID entry > > > Ea

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Yi Liu
On 2023/12/11 10:29, Tian, Kevin wrote: From: Jason Gunthorpe Sent: Saturday, December 9, 2023 9:47 AM What is in a Nested domain: Intel: A single IO page table refereed to by a PASID entry Each vDomain-ID,PASID allocates a unique nesting domain AMD: A GCR3 table pointer Nes

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-11 Thread Yi Liu
On 2023/12/9 09:47, Jason Gunthorpe wrote: On Fri, Nov 17, 2023 at 05:07:11AM -0800, Yi Liu wrote: Take Intel VT-d as an example, the stage-1 translation table is I/O page table. As the below diagram shows, guest I/O page table pointer in GPA (guest physical address) is passed to host and be us

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-11 Thread Mark Brown
On Mon, Dec 11, 2023 at 01:03:27PM +0100, David Hildenbrand wrote: > On 11.12.23 12:15, Mark Brown wrote: > > This is linux-next. I pasted the commands used to build and sent links > > to a full build log in the original report. > Probably also related to "make headers-install": > https://lkml.

[PATCH v3 29/29] selftests/resctrl: Get domain id from cache id

2023-12-11 Thread Ilpo Järvinen
Domain id is acquired differently depending on CPU. AMD tests use id from L3 cache, whereas CPUs from other vendors base the id on topology package id. In order to support L2 CAT test, this has to be generalized. The driver side code seems to get the domain ids from cache ids so the approach used

[PATCH v3 28/29] selftests/resctrl: Rename resource ID to domain ID

2023-12-11 Thread Ilpo Järvinen
Kernel-side calls the instances of a resource domains. Change the resource_id naming in the selftest code to domain_id to match the kernel side better. Suggested-by: Maciej Wieczór-Retman Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/resctrl.h | 2 +- tools/testing/self

[PATCH v3 27/29] selftests/resctrl: Add helper to convert L2/3 to integer

2023-12-11 Thread Ilpo Järvinen
"L2"/"L3" conversion to integer is embedded into get_cache_size() which prevents reuse. Create a helper for the cache string to integer conversion to make it reusable. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/resctrlfs.c | 28 +++-- 1 file changed, 20 ins

[PATCH v3 26/29] selftests/resctrl: Pass write_schemata() resource instead of test name

2023-12-11 Thread Ilpo Järvinen
write_schemata() takes the test name as an argument and determines the relevant resource based on the test name. Such mapping from name to resource does not really belong to resctrlfs.c that should provide only generic, test-independent functions. Pass the resource stored in the test information s

[PATCH v3 25/29] selftests/resctrl: Introduce generalized test framework

2023-12-11 Thread Ilpo Järvinen
Each test currently has a "run test" function in per test file and another resctrl_tests.c. The functions in resctrl_tests.c are almost identical. Generalize the one in resctrl_tests.c such that it can be shared between all of the tests. It makes adding new tests easier and removes the per test if

[PATCH v3 24/29] selftests/resctrl: Create struct for input parameters

2023-12-11 Thread Ilpo Järvinen
resctrl_tests reads a set of parameters and passes them individually for each tests which causes variations in the call signature between the tests. Add struct input_params to hold all input parameters. It can be easily passed to every test without varying the call signature. Signed-off-by: Ilpo

[PATCH v3 22/29] selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test

2023-12-11 Thread Ilpo Järvinen
CAT test spawns two processes into two different control groups with exclusive schemata. Both the processes alloc a buffer from memory matching their allocated LLC block size and flush the entire buffer out of caches. Since the processes are reading through the buffer only once during the measureme

[PATCH v3 23/29] selftests/resctrl: Restore the CPU affinity after CAT test

2023-12-11 Thread Ilpo Järvinen
CAT test does not reset the CPU affinity after the benchmark. This is relatively harmless as is because CAT test is the last benchmark to run, however, more tests may be added later. Store the CPU affinity the first time taskset_benchmark() is run and add taskset_restore() which the test can call

[PATCH v3 21/29] selftests/resctrl: Read in less obvious order to defeat prefetch optimizations

2023-12-11 Thread Ilpo Järvinen
When reading memory in order, HW prefetching optimizations will interfere with measuring how caches and memory are being accessed. This adds noise into the results. Change the fill_buf reading loop to not use an obvious in-order access using multiply by a prime and modulo. Using a prime multiplie

  1   2   >