Re: [RFC PATCH 00/39] 1G page support for guest_memfd

2024-09-10 Thread Michal Hocko
Cc Oscar for awareness On Tue 10-09-24 23:43:31, Ackerley Tng wrote: > Hello, > > This patchset is our exploration of how to support 1G pages in guest_memfd, > and > how the pages will be used in Confidential VMs. > > The patchset covers: > > + How to get 1G pages > + Allowing mmap() of guest_

[PATCH v2] dt-bindings: remoteproc: qcom,sa8775p-pas: Document QCS8300 remoteproc

2024-09-10 Thread Jingyi Wang
: 100cc857359b5d731407d1038f7e76cd0e871d94 change-id: 20240910-qcs8300_remoteproc_binding-025db5585561 Best regards, -- Jingyi Wang

[PATCH] selftests: kselftest: Use strerror() on nolibc

2024-09-10 Thread zhangjiao2
From: zhang jiao Nolibc gained an implementation of strerror() recently. Use it and drop the ifndef. Signed-off-by: zhang jiao --- tools/testing/selftests/kselftest.h | 8 1 file changed, 8 deletions(-) diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kself

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

2024-09-10 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Friday, September 6, 2024 2:22 AM > > On Thu, Sep 05, 2024 at 11:00:49AM -0700, Nicolin Chen wrote: > > On Thu, Sep 05, 2024 at 01:20:39PM -0300, Jason Gunthorpe wrote: > > > On Tue, Aug 27, 2024 at 09:59:54AM -0700, Nicolin Chen wrote: > > > > > > > +static int ar

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

2024-09-10 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Friday, September 6, 2024 4:15 AM > > On Thu, Sep 05, 2024 at 02:43:26PM -0300, Jason Gunthorpe wrote: > > On Thu, Sep 05, 2024 at 10:37:45AM -0700, Nicolin Chen wrote: > > > That being said, if we have a clear picture that in the long term > > > we would extend it to

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

2024-09-10 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Wednesday, August 28, 2024 1:00 AM > [...] > On a multi-IOMMU system, the VIOMMU object can be instanced to the > number > of vIOMMUs in a guest VM, while holding the same parent HWPT to share > the Is there restriction that multiple vIOMMU objects can be only create

Re: [PATCH bpf-next] bpf: ringbuf: Support consuming BPF_MAP_TYPE_RINGBUF from prog

2024-09-10 Thread Daniel Xu
[cc Jesper] On Tue, Sep 10, 2024, at 8:31 PM, Daniel Xu wrote: > On Tue, Sep 10, 2024 at 05:39:55PM GMT, Andrii Nakryiko wrote: >> On Tue, Sep 10, 2024 at 4:44 PM Daniel Xu wrote: >> > >> > On Tue, Sep 10, 2024 at 03:21:04PM GMT, Andrii Nakryiko wrote: >> > > On Tue, Sep 10, 2024 at 3:16 PM Danie

Re: [RESEND PATCH v1 0/7]vhost: Add support of kthread API

2024-09-10 Thread Jason Wang
On Tue, Sep 10, 2024 at 4:43 PM Michael S. Tsirkin wrote: > > On Tue, Sep 10, 2024 at 04:37:52PM +0800, Jason Wang wrote: > > On Tue, Sep 10, 2024 at 3:42 PM Michael S. Tsirkin wrote: > > > > > > On Mon, Sep 09, 2024 at 10:00:38AM +0800, Cindy Lu wrote: > > > > In commit 6e890c5d5021 ("vhost: use

Re: [PATCH v3 0/2] Properly initialize speed/duplex and remove vDPA config updates

2024-09-10 Thread Jason Wang
On Tue, Sep 10, 2024 at 2:29 PM Michael S. Tsirkin wrote: > > On Wed, Sep 04, 2024 at 10:11:13AM -0500, Carlos Bilbao wrote: > > From: Carlos Bilbao > > > > Initialize speed and duplex for virtio_net_config to UNKNOWN (mlx5_vdpa > > vDPA devices currently do not support VIRTIO_NET_F_SPEED_DUPLEX)

Re: [PATCH bpf-next] bpf: ringbuf: Support consuming BPF_MAP_TYPE_RINGBUF from prog

2024-09-10 Thread Daniel Xu
On Tue, Sep 10, 2024 at 05:39:55PM GMT, Andrii Nakryiko wrote: > On Tue, Sep 10, 2024 at 4:44 PM Daniel Xu wrote: > > > > On Tue, Sep 10, 2024 at 03:21:04PM GMT, Andrii Nakryiko wrote: > > > On Tue, Sep 10, 2024 at 3:16 PM Daniel Xu wrote: > > > > > > > > > > > > > > > > On Tue, Sep 10, 2024, at

[PATCH v4 1/1] module: abort module loading when sysfs setup suffer errors

2024-09-10 Thread Chunhui Li
When insmod a kernel module, if fails in add_notes_attrs or add_sysfs_attrs such as memory allocation fail, mod_sysfs_setup will still return success, but we can't access user interface on android device. Patch for make mod_sysfs_setup can check the error of add_notes_attrs and add_sysfs_attrs Fi

[PATCH v4 0/1] fix sysfs patch build warning and add fixes

2024-09-10 Thread Chunhui Li
Hi Maintainer, V4: -Fix build warning when CONFIG_KALLSYMS is not enabled; -Add Fixes tag; I can't find add_sect_attrs and add_notes_attrs commit in linux.next git log, and Petr Pavlu show /sys/module patch link when review, so I label Fixes as below, If incorrect please notify me. Fixes: db939

Re: [PATCH bpf-next] bpf: ringbuf: Support consuming BPF_MAP_TYPE_RINGBUF from prog

2024-09-10 Thread Andrii Nakryiko
On Tue, Sep 10, 2024 at 4:44 PM Daniel Xu wrote: > > On Tue, Sep 10, 2024 at 03:21:04PM GMT, Andrii Nakryiko wrote: > > On Tue, Sep 10, 2024 at 3:16 PM Daniel Xu wrote: > > > > > > > > > > > > On Tue, Sep 10, 2024, at 2:07 PM, Daniel Xu wrote: > > > > On Tue, Sep 10, 2024 at 01:41:41PM GMT, Andri

Re: [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding

2024-09-10 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Fri, 6 Sep 2024 17:07:43 -0400 you wrote: > Padding is not included in UDP and TCP checksums. Therefore, reduce the > length of the checksummed data to include only the data in the IP > payload. This fixes spurious rep

[RFC PATCH 39/39] KVM: guest_memfd: Dynamically split/reconstruct HugeTLB page

2024-09-10 Thread Ackerley Tng
From: Vishal Annapurve The faultability of a page is used to determine whether to split or reconstruct a page. If there is any page in a folio that is faultable, split the folio. If all pages in a folio are not faultable, reconstruct the folio. On truncation, always reconstruct and free regardl

[RFC PATCH 38/39] KVM: selftests: Update private_mem_conversions_test for mmap()able guest_memfd

2024-09-10 Thread Ackerley Tng
Signed-off-by: Ackerley Tng --- .../kvm/x86_64/private_mem_conversions_test.c | 146 +++--- .../x86_64/private_mem_conversions_test.sh| 3 + 2 files changed, 124 insertions(+), 25 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/private_mem_conversions_test.c b/too

[RFC PATCH 37/39] KVM: selftests: Add helper to perform madvise by memslots

2024-09-10 Thread Ackerley Tng
A contiguous GPA range may not be contiguous in HVA. This helper performs madvise, given a GPA range, by madvising in blocks according to memslot configuration. Signed-off-by: Ackerley Tng --- tools/include/linux/kernel.h | 4 +-- .../testing/selftests/kvm/include/kvm_util.h

[RFC PATCH 36/39] KVM: selftests: Refactor vm_mem_add to be more flexible

2024-09-10 Thread Ackerley Tng
enum vm_mem_backing_src_type is encoding too many different possibilities on different axes of (1) whether to mmap from an fd, (2) granularity of mapping for THP, (3) size of hugetlb mapping, and has yet to be extended to support guest_memfd. When guest_memfd supports mmap() and we also want to su

[RFC PATCH 35/39] KVM: selftests: Test that pinned pages block KVM from setting memory attributes to PRIVATE

2024-09-10 Thread Ackerley Tng
CONFIG_GUP_TEST provides userspace with an ioctl to invoke pin_user_pages(), and this test uses the ioctl to pin pages, to check that memory attributes cannot be set to private if shared pages are pinned. Signed-off-by: Ackerley Tng --- tools/testing/selftests/kvm/Makefile | 1 + .../

[RFC PATCH 33/39] KVM: selftests: Test guest_memfd memory sharing between guest and host

2024-09-10 Thread Ackerley Tng
Minimal test for guest_memfd to test that when memory is marked shared in a VM, the host can read and write to it via an mmap()ed address, and the guest can also read and write to it. Signed-off-by: Ackerley Tng --- tools/testing/selftests/kvm/Makefile | 1 + .../selftests/kvm/guest_

[RFC PATCH 34/39] KVM: selftests: Add notes in private_mem_kvm_exits_test for mmap-able guest_memfd

2024-09-10 Thread Ackerley Tng
Note in comments why madvise() is not needed before setting memory to private. Signed-off-by: Ackerley Tng --- .../selftests/kvm/x86_64/private_mem_kvm_exits_test.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/private_mem_kvm_

[RFC PATCH 32/39] KVM: selftests: Test using guest_memfd memory from userspace

2024-09-10 Thread Ackerley Tng
Test using guest_memfd from userspace, since guest_memfd now has mmap() support. Tests: 1. mmap() should now always return a valid address 2. Test that madvise() doesn't give any issues when pages are not faulted in. 3. Test that pages should not be faultable before association with a memsl

[RFC PATCH 31/39] KVM: selftests: Allow vm_set_memory_attributes to be used without asserting return value of 0

2024-09-10 Thread Ackerley Tng
No functional change intended. Signed-off-by: Ackerley Tng --- tools/testing/selftests/kvm/include/kvm_util.h | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h inde

[RFC PATCH 29/39] KVM: Handle conversions in the SET_MEMORY_ATTRIBUTES ioctl

2024-09-10 Thread Ackerley Tng
The key steps for a private to shared conversion are: 1. Unmap from guest page tables 2. Set pages associated with requested range in memslot to be faultable 3. Update kvm->mem_attr_array The key steps for a shared to private conversion are: 1. Check and disallow set_memory_attributes if any

[RFC PATCH 30/39] KVM: guest_memfd: Handle folio preparation for guest_memfd mmap

2024-09-10 Thread Ackerley Tng
Since guest_memfd now supports mmap(), folios have to be prepared before they are faulted into userspace. When memory attributes are switched between shared and private, the up-to-date flags will be cleared. Use the folio's up-to-date flag to indicate being ready for the guest usage and can be us

[RFC PATCH 28/39] KVM: guest_memfd: Use vm_type to determine default faultability

2024-09-10 Thread Ackerley Tng
Memory of a KVM_X86_SW_PROTECTED_VM defaults to faultable to align with the default in kvm->mem_attr_array. For this RFC, determine default faultability when associating a range with a memslot. Another option is to determine default faultability at guest_memfd creation time. guest_memfd is create

[RFC PATCH 26/39] KVM: guest_memfd: Track faultability within a struct kvm_gmem_private

2024-09-10 Thread Ackerley Tng
The faultability xarray is stored on the inode since faultability is a property of the guest_memfd's memory contents. In this RFC, presence of an entry in the xarray indicates faultable, but this could be flipped so that presence indicates unfaultable. For flexibility, a special value "FAULT" is u

[RFC PATCH 27/39] KVM: guest_memfd: Allow mmapping guest_memfd files

2024-09-10 Thread Ackerley Tng
guest_memfd files can always be mmap()ed to userspace, but faultability is controlled by an attribute on the inode. Co-developed-by: Fuad Tabba Signed-off-by: Fuad Tabba Co-developed-by: Ackerley Tng Signed-off-by: Ackerley Tng --- virt/kvm/guest_memfd.c | 46

[RFC PATCH 25/39] KVM: guest_memfd: Split HugeTLB pages for guest_memfd use

2024-09-10 Thread Ackerley Tng
From: Vishal Annapurve In this patch, newly allocated HugeTLB pages are split to 4K regular pages before providing them to the requester (fallocate() or KVM). The pages are then reconstructed/merged to HugeTLB pages before the HugeTLB pages are returned to HugeTLB. This is an intermediate step

[RFC PATCH 24/39] mm: hugetlb: Add functions to add/move/remove from hugetlb lists

2024-09-10 Thread Ackerley Tng
These functions are introduced in hugetlb.c so the private hugetlb_lock can be accessed. hugetlb_lock is reused for this PoC, but a separate lock should be used in a future revision to avoid interference due to hash collisions with HugeTLB's usage of this lock. Co-developed-by: Ackerley Tng Sign

[RFC PATCH 23/39] mm: hugetlb: Expose HugeTLB functions for promoting/demoting pages

2024-09-10 Thread Ackerley Tng
These functions will be used by guest_memfd to split/reconstruct HugeTLB pages. Co-developed-by: Ackerley Tng Signed-off-by: Ackerley Tng Co-developed-by: Vishal Annapurve Signed-off-by: Vishal Annapurve --- include/linux/hugetlb.h | 15 +++ mm/hugetlb.c| 8 ++--

[RFC PATCH 22/39] mm: hugetlb: Expose vmemmap optimization functions

2024-09-10 Thread Ackerley Tng
These functions will need to be used by guest_memfd when splitting/reconstructing HugeTLB pages. Co-developed-by: Ackerley Tng Signed-off-by: Ackerley Tng Co-developed-by: Vishal Annapurve Signed-off-by: Vishal Annapurve --- include/linux/hugetlb.h | 14 ++ mm/hugetlb_vmemmap.h

[RFC PATCH 21/39] KVM: selftests: Test that guest_memfd usage is reported via hugetlb

2024-09-10 Thread Ackerley Tng
Using HugeTLB as the huge page allocator for guest_memfd allows reuse of HugeTLB's reporting mechanism. Signed-off-by: Ackerley Tng --- tools/testing/selftests/kvm/Makefile | 1 + .../kvm/guest_memfd_hugetlb_reporting_test.c | 222 ++ 2 files changed, 223 insertions(+

[RFC PATCH 20/39] KVM: selftests: Add private_mem_conversions_test.sh

2024-09-10 Thread Ackerley Tng
Add private_mem_conversions_test.sh to automate testing of different combinations of private_mem_conversions_test. Signed-off-by: Ackerley Tng --- .../x86_64/private_mem_conversions_test.sh| 88 +++ 1 file changed, 88 insertions(+) create mode 100755 tools/testing/selftest

[RFC PATCH 19/39] KVM: selftests: Update test for various private memory backing source types

2024-09-10 Thread Ackerley Tng
Update private_mem_conversions_test for various private memory backing source types. Signed-off-by: Ackerley Tng --- .../kvm/x86_64/private_mem_conversions_test.c | 28 ++- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/private_m

[RFC PATCH 18/39] KVM: selftests: Support various types of backing sources for private memory

2024-09-10 Thread Ackerley Tng
Adds support for various type of backing sources for private memory (in the sense of confidential computing), similar to the backing sources available for shared memory. Signed-off-by: Ackerley Tng --- .../testing/selftests/kvm/include/test_util.h | 16 tools/testing/selftests/kvm/lib/test

[RFC PATCH 17/39] KVM: selftests: Add basic selftests for hugetlb-backed guest_memfd

2024-09-10 Thread Ackerley Tng
Add tests for 2MB and 1GB page sizes, and update the invalid flags test for the new KVM_GUEST_MEMFD_HUGETLB flag. Signed-off-by: Ackerley Tng --- .../testing/selftests/kvm/guest_memfd_test.c | 45 ++- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/tools/testing

[RFC PATCH 16/39] KVM: guest_memfd: Add page alignment check for hugetlb guest_memfd

2024-09-10 Thread Ackerley Tng
When a hugetlb guest_memfd is requested, the requested size should be aligned to the size of the hugetlb page requested. Signed-off-by: Ackerley Tng --- virt/kvm/guest_memfd.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/gu

[RFC PATCH 15/39] KVM: guest_memfd: hugetlb: allocate and truncate from hugetlb

2024-09-10 Thread Ackerley Tng
If HugeTLB is requested at guest_memfd creation time, HugeTLB pages will be used to back guest_memfd. Signed-off-by: Ackerley Tng --- virt/kvm/guest_memfd.c | 252 ++--- 1 file changed, 239 insertions(+), 13 deletions(-) diff --git a/virt/kvm/guest_memfd.c b/

[RFC PATCH 14/39] KVM: guest_memfd: hugetlb: initialization and cleanup

2024-09-10 Thread Ackerley Tng
First stage of hugetlb support: add initialization and cleanup routines. After guest_mem was massaged to use guest_mem inodes instead of anonymous inodes in an earlier patch, the .evict_inode handler can now be overridden to do hugetlb metadata cleanup. Signed-off-by: Ackerley Tng --- include/u

[RFC PATCH 13/39] KVM: guest_memfd: Make guest mem use guest mem inodes instead of anonymous inodes

2024-09-10 Thread Ackerley Tng
Using guest mem inodes allows us to store metadata for the backing memory on the inode. Metadata will be added in a later patch to support HugeTLB pages. Metadata about backing memory should not be stored on the file, since the file represents a guest_memfd's binding with a struct kvm, and metadat

[RFC PATCH 12/39] mm: hugetlb: Move and expose hugetlb_zero_partial_page()

2024-09-10 Thread Ackerley Tng
This will used by guest_memfd in a later patch. Signed-off-by: Ackerley Tng --- fs/hugetlbfs/inode.c| 33 + include/linux/hugetlb.h | 3 +++ mm/hugetlb.c| 21 + 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/f

[RFC PATCH 11/39] mm: hugetlb: Expose hugetlb_acct_memory()

2024-09-10 Thread Ackerley Tng
This will used by guest_memfd in a later patch. Signed-off-by: Ackerley Tng --- include/linux/hugetlb.h | 2 ++ mm/hugetlb.c| 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 9ef1adbd3207..4d47bf94c211 1006

[RFC PATCH 10/39] mm: hugetlb: Add option to create new subpool without using surplus

2024-09-10 Thread Ackerley Tng
__hugetlb_acct_memory() today does more than just memory accounting. when there's insufficient HugeTLB pages, __hugetlb_acct_memory() will attempt to get surplus pages. This change adds a flag to disable getting surplus pages if there are insufficient HugeTLB pages. Signed-off-by: Ackerley Tng -

[RFC PATCH 09/39] mm: hugetlb: Expose hugetlb_subpool_{get,put}_pages()

2024-09-10 Thread Ackerley Tng
This will allow hugetlb subpools to be used by guest_memfd. Signed-off-by: Ackerley Tng --- include/linux/hugetlb.h | 3 +++ mm/hugetlb.c| 6 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index e4a05a421623..90

[RFC PATCH 08/39] mm: truncate: Expose preparation steps for truncate_inode_pages_final

2024-09-10 Thread Ackerley Tng
This will allow preparation steps to be shared Signed-off-by: Ackerley Tng --- include/linux/mm.h | 1 + mm/truncate.c | 26 -- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index c4b238a20b76..ffb4788295b4

[RFC PATCH 07/39] mm: hugetlb: Refactor out hugetlb_alloc_folio

2024-09-10 Thread Ackerley Tng
hugetlb_alloc_folio() allocates a hugetlb folio without handling reservations in the vma and subpool, since some of that reservation concepts are hugetlbfs specific. Signed-off-by: Ackerley Tng --- include/linux/hugetlb.h | 12 mm/hugetlb.c| 144

[RFC PATCH 06/39] mm: hugetlb: Refactor dequeue_hugetlb_folio_vma() to use mpol

2024-09-10 Thread Ackerley Tng
Reduce dependence on vma since the use of huge_node() assumes that the mempolicy is stored in a specific place in the inode, accessed via the vma. Signed-off-by: Ackerley Tng --- mm/hugetlb.c | 55 ++-- 1 file changed, 23 insertions(+), 32 deletion

[RFC PATCH 05/39] mm: hugetlb: Refactor alloc_buddy_hugetlb_folio_with_mpol() to interpret mempolicy instead of vma

2024-09-10 Thread Ackerley Tng
Reducing dependence on vma avoids the hugetlb-specific assumption of where the mempolicy is stored. This will open up other ways of using hugetlb. Signed-off-by: Ackerley Tng --- mm/hugetlb.c | 37 +++-- 1 file changed, 23 insertions(+), 14 deletions(-) diff --gi

Re: [PATCH bpf-next] bpf: ringbuf: Support consuming BPF_MAP_TYPE_RINGBUF from prog

2024-09-10 Thread Daniel Xu
On Tue, Sep 10, 2024 at 03:21:04PM GMT, Andrii Nakryiko wrote: > On Tue, Sep 10, 2024 at 3:16 PM Daniel Xu wrote: > > > > > > > > On Tue, Sep 10, 2024, at 2:07 PM, Daniel Xu wrote: > > > On Tue, Sep 10, 2024 at 01:41:41PM GMT, Andrii Nakryiko wrote: > > >> On Tue, Sep 10, 2024 at 11:36 AM Alexei S

[RFC PATCH 04/39] mm: mempolicy: Refactor out policy_node_nodemask()

2024-09-10 Thread Ackerley Tng
This was refactored out of huge_node(). huge_node()'s interpretation of vma for order assumes the hugetlb-specific storage of the hstate information in the inode. policy_node_nodemask() does not assume that, and can be used more generically. This refactoring also enforces that nid default to the

[RFC PATCH 03/39] mm: hugetlb: Remove unnecessary check for avoid_reserve

2024-09-10 Thread Ackerley Tng
If avoid_reserve is true, gbl_chg is not used anyway, so there is no point in setting gbl_chg. Signed-off-by: Ackerley Tng --- mm/hugetlb.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 597102ed224b..5cf7fb117e9d 100644 --- a/mm/hugetlb.c +++ b/

[RFC PATCH 01/39] mm: hugetlb: Simplify logic in dequeue_hugetlb_folio_vma()

2024-09-10 Thread Ackerley Tng
Replace arguments avoid_reserve and chg in dequeue_hugetlb_folio_vma() so dequeue_hugetlb_folio_vma() is more understandable. The new argument, use_hstate_resv, indicates whether the folio to be dequeued should be taken from reservations in hstate. If use_hstate_resv is true, the folio to be dequ

[RFC PATCH 02/39] mm: hugetlb: Refactor vma_has_reserves() to should_use_hstate_resv()

2024-09-10 Thread Ackerley Tng
With the addition of the chg parameter, vma_has_reserves() no longer just determines whether the vma has reserves. The comment in the vma->vm_flags & VM_NORESERVE block indicates that this function actually computes whether or not the reserved count should be decremented. This refactoring also ta

[RFC PATCH 00/39] 1G page support for guest_memfd

2024-09-10 Thread Ackerley Tng
Hello, This patchset is our exploration of how to support 1G pages in guest_memfd, and how the pages will be used in Confidential VMs. The patchset covers: + How to get 1G pages + Allowing mmap() of guest_memfd to userspace so that both private and shared memory can use the same physical pages

Re: [PATCH bpf-next] bpf: ringbuf: Support consuming BPF_MAP_TYPE_RINGBUF from prog

2024-09-10 Thread Andrii Nakryiko
On Tue, Sep 10, 2024 at 3:16 PM Daniel Xu wrote: > > > > On Tue, Sep 10, 2024, at 2:07 PM, Daniel Xu wrote: > > On Tue, Sep 10, 2024 at 01:41:41PM GMT, Andrii Nakryiko wrote: > >> On Tue, Sep 10, 2024 at 11:36 AM Alexei Starovoitov > [...] > > > >> > >> Also, Daniel, can you please make sure that

Re: [PATCH bpf-next] bpf: ringbuf: Support consuming BPF_MAP_TYPE_RINGBUF from prog

2024-09-10 Thread Andrii Nakryiko
On Tue, Sep 10, 2024 at 2:07 PM Daniel Xu wrote: > > On Tue, Sep 10, 2024 at 01:41:41PM GMT, Andrii Nakryiko wrote: > > On Tue, Sep 10, 2024 at 11:36 AM Alexei Starovoitov > > wrote: > > > > > > On Mon, Sep 9, 2024 at 5:55 PM Daniel Xu wrote: > > > > > > > > Right now there exists prog produce /

Re: [PATCH bpf-next] bpf: ringbuf: Support consuming BPF_MAP_TYPE_RINGBUF from prog

2024-09-10 Thread Daniel Xu
On Tue, Sep 10, 2024, at 2:07 PM, Daniel Xu wrote: > On Tue, Sep 10, 2024 at 01:41:41PM GMT, Andrii Nakryiko wrote: >> On Tue, Sep 10, 2024 at 11:36 AM Alexei Starovoitov [...] > >> >> Also, Daniel, can you please make sure that dynptr we return for each >> sample is read-only? We shouldn't let

Re: [PATCH v2 13/19] gendwarfksyms: Add symtypes output

2024-09-10 Thread Sami Tolvanen
Hi Petr, On Tue, Sep 10, 2024 at 7:58 AM Petr Pavlu wrote: > > On 8/15/24 19:39, Sami Tolvanen wrote: > > @@ -122,6 +135,16 @@ int main(int argc, const char **argv) > > > > check(symbol_read_exports(stdin)); > > > > + if (symtypes_file) { > > + symfile = fopen(symtypes_file,

Re: [PATCH v2 01/19] tools: Add gendwarfksyms

2024-09-10 Thread Sami Tolvanen
On Tue, Sep 10, 2024 at 2:44 AM Masahiro Yamada wrote: > > On Fri, Sep 6, 2024 at 5:53 AM Sami Tolvanen wrote: > > > > Thanks for the patch! I think this would otherwise work, but I also > > need jhash (or a similar hash function), and I can't combine the > > tools/include version with this, beca

Re: [PATCH bpf-next] bpf: ringbuf: Support consuming BPF_MAP_TYPE_RINGBUF from prog

2024-09-10 Thread Daniel Xu
On Tue, Sep 10, 2024 at 01:41:41PM GMT, Andrii Nakryiko wrote: > On Tue, Sep 10, 2024 at 11:36 AM Alexei Starovoitov > wrote: > > > > On Mon, Sep 9, 2024 at 5:55 PM Daniel Xu wrote: > > > > > > Right now there exists prog produce / userspace consume and userspace > > > produce / prog consume supp

Re: [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding

2024-09-10 Thread Willem de Bruijn
Sean Anderson wrote: > On 9/10/24 13:42, Willem de Bruijn wrote: > > Sean Anderson wrote: > >> On 9/9/24 21:01, Willem de Bruijn wrote: > >> > Jakub Kicinski wrote: > >> >> On Mon, 09 Sep 2024 13:26:42 -0400 Willem de Bruijn wrote: > >> >> > > This seems to be a bug in the driver. > >> >> > > > >>

Re: [PATCH v2 0/2] Exposing nice CPU usage to userspace

2024-09-10 Thread Tejun Heo
Hello, Michal. On Mon, Sep 02, 2024 at 05:45:39PM +0200, Michal Koutný wrote: > - It makes (some) sense only on leave cgroups (where variously nice'd > tasks are competing against each other). Not so much on inner node > cgroups (where it's a mere sum but sibling cgroups could have different >

Re: [PATCH bpf-next] bpf: ringbuf: Support consuming BPF_MAP_TYPE_RINGBUF from prog

2024-09-10 Thread Daniel Xu
On Tue, Sep 10, 2024 at 11:36:36AM GMT, Alexei Starovoitov wrote: > On Mon, Sep 9, 2024 at 5:55 PM Daniel Xu wrote: > > > > Right now there exists prog produce / userspace consume and userspace > > produce / prog consume support. But it is also useful to have prog > > produce / prog consume. > > >

Re: [PATCH bpf-next] bpf: ringbuf: Support consuming BPF_MAP_TYPE_RINGBUF from prog

2024-09-10 Thread Andrii Nakryiko
On Tue, Sep 10, 2024 at 11:36 AM Alexei Starovoitov wrote: > > On Mon, Sep 9, 2024 at 5:55 PM Daniel Xu wrote: > > > > Right now there exists prog produce / userspace consume and userspace > > produce / prog consume support. But it is also useful to have prog > > produce / prog consume. > > > > F

Re: [PATCH v1 0/5] virtio-mem: s390x support

2024-09-10 Thread Michael S. Tsirkin
On Tue, Sep 10, 2024 at 09:15:34PM +0200, David Hildenbrand wrote: > Let's finally add s390x support for virtio-mem; my last RFC was sent > 4 years ago, and a lot changed in the meantime. > > This is based on mm/stable. > > I sent out the QEMU part earlier today [1], that contains some more detai

Re: [PATCH v1 3/5] virtio-mem: s390x support

2024-09-10 Thread Michael S. Tsirkin
On Tue, Sep 10, 2024 at 09:15:37PM +0200, David Hildenbrand wrote: > Now that s390x code is prepared for memory devices that reside above the > maximum storage increment exposed through SCLP, everything is in place > to unlock virtio-mem support. > > As virtio-mem in Linux currently supports logic

[PATCH v1 5/5] s390/sparsemem: reduce section size to 128 MiB

2024-09-10 Thread David Hildenbrand
Ever since commit 421c175c4d609 ("[S390] Add support for memory hot-add.") we've been using a section size of 256 MiB on s390x and 32 MiB on s390. Before that, we were using a section size of 32 MiB on both architectures. Likely the reason was that we'd expect a storage increment size of 256 MiB u

[PATCH v1 4/5] lib/Kconfig.debug: default STRICT_DEVMEM to "y" on s390x

2024-09-10 Thread David Hildenbrand
virtio-mem currently depends on !DEVMEM | STRICT_DEVMEM. Let's default STRICT_DEVMEM to "y" just like we do for arm64 and x86. There could be ways in the future to filter access to virtio-mem device memory even without STRICT_DEVMEM, but for now let's just keep it simple. Signed-off-by: David Hil

[PATCH v1 3/5] virtio-mem: s390x support

2024-09-10 Thread David Hildenbrand
Now that s390x code is prepared for memory devices that reside above the maximum storage increment exposed through SCLP, everything is in place to unlock virtio-mem support. As virtio-mem in Linux currently supports logically onlining/offlining memory in pageblock granularity, we have an effective

[PATCH v1 2/5] s390/physmem_info: query diag500(STORAGE_LIMIT) to support QEMU/KVM memory devices

2024-09-10 Thread David Hildenbrand
To support memory devices under QEMU/KVM, such as virtio-mem, we have to prepare our kernel virtual address space accordingly and have to know the highest possible physical memory address we might see later: the storage limit. The good old SCLP interface is not suitable for this use case. In parti

[PATCH v1 1/5] s390/kdump: implement is_kdump_kernel()

2024-09-10 Thread David Hildenbrand
s390x currently always results in is_kdump_kernel() == false, because it sets "elfcorehdr_addr = ELFCORE_ADDR_MAX;" early during setup_arch to deactivate the elfcorehdr= kernel parameter. Let's follow the powerpc example and implement our own logic. This is required for virtio-mem to reliably ide

[PATCH v1 0/5] virtio-mem: s390x support

2024-09-10 Thread David Hildenbrand
Let's finally add s390x support for virtio-mem; my last RFC was sent 4 years ago, and a lot changed in the meantime. This is based on mm/stable. I sent out the QEMU part earlier today [1], that contains some more details and a usage example on s390x (last patch). There is not too much in here: T

[PATCH net 3/3] selftests: mptcp: include net_helper.sh file

2024-09-10 Thread Matthieu Baerts (NGI0)
Similar to the previous commit, the net_helper.sh file from the parent directory is used by the MPTCP selftests and it needs to be present when running the tests. This file then needs to be listed in the Makefile to be included when exporting or installing the tests, e.g. with: make -C tools/te

[PATCH net 2/3] selftests: mptcp: include lib.sh file

2024-09-10 Thread Matthieu Baerts (NGI0)
The lib.sh file from the parent directory is used by the MPTCP selftests and it needs to be present when running the tests. This file then needs to be listed in the Makefile to be included when exporting or installing the tests, e.g. with: make -C tools/testing/selftests \ TARGETS=net

[PATCH net 1/3] selftests: mptcp: join: restrict fullmesh endp on 1st sf

2024-09-10 Thread Matthieu Baerts (NGI0)
A new endpoint using the IP of the initial subflow has been recently added to increase the code coverage. But it breaks the test when using old kernels not having commit 86e39e04482b ("mptcp: keep track of local endpoint still available for each msk"), e.g. on v5.15. Similar to commit d4c81bbb8600

[PATCH net 0/3] selftests: mptcp: misc. small fixes

2024-09-10 Thread Matthieu Baerts (NGI0)
++ tools/testing/selftests/net/mptcp/mptcp_join.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) --- base-commit: 48aa361c5db0b380c2b75c24984c0d3e7c1e8c09 change-id: 20240910-net-selftests-mptcp-fix-install-2b82ae5a99c8 Best regards, -- Matthieu Baerts (NGI0)

Re: [PATCH bpf-next] bpf: ringbuf: Support consuming BPF_MAP_TYPE_RINGBUF from prog

2024-09-10 Thread Alexei Starovoitov
On Mon, Sep 9, 2024 at 5:55 PM Daniel Xu wrote: > > Right now there exists prog produce / userspace consume and userspace > produce / prog consume support. But it is also useful to have prog > produce / prog consume. > > For example, we want to track the latency overhead of cpumap in > production.

[PATCH bpf-next v2] selftests/bpf: convert test_xdp_features.sh to test_progs

2024-09-10 Thread eBPF Foundation
test_xdp_features.sh is a shell script allowing to test that xdp features advertised by an interface are indeed delivered. The test works by starting two instance of the same program, both attaching specific xdp programs to each side of a veth link, and then make those programs manage packets and c

Re: [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding

2024-09-10 Thread Sean Anderson
On 9/10/24 13:42, Willem de Bruijn wrote: > Sean Anderson wrote: >> On 9/9/24 21:01, Willem de Bruijn wrote: >> > Jakub Kicinski wrote: >> >> On Mon, 09 Sep 2024 13:26:42 -0400 Willem de Bruijn wrote: >> >> > > This seems to be a bug in the driver. >> >> > > >> >> > > A call to skb_put_padto(skb,

Re: [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding

2024-09-10 Thread Willem de Bruijn
Sean Anderson wrote: > On 9/9/24 21:01, Willem de Bruijn wrote: > > Jakub Kicinski wrote: > >> On Mon, 09 Sep 2024 13:26:42 -0400 Willem de Bruijn wrote: > >> > > This seems to be a bug in the driver. > >> > > > >> > > A call to skb_put_padto(skb, ETH_ZLEN) should be added. > >> > > >> > In whi

Re: [PATCH v2] remoteproc: k3-dsp: Fix an error handling path in k3_dsp_rproc_probe()

2024-09-10 Thread Christophe JAILLET
Le 10/09/2024 à 17:29, Mathieu Poirier a écrit : +static void k3_dsp_free_channel(void *data) +{ + struct k3_dsp_rproc *kproc = data; How did the struct rproc from devm_add_action_or_reset() got turned into a struct k3_dsp_rproc? Well, Linux is a wonderful system, that is able to make

Re: [PATCH v2] rcu/kvfree: Add kvfree_rcu_barrier() API

2024-09-10 Thread Paul E. McKenney
On Tue, Aug 20, 2024 at 05:59:35PM +0200, Uladzislau Rezki (Sony) wrote: > Add a kvfree_rcu_barrier() function. It waits until all > in-flight pointers are freed over RCU machinery. It does > not wait any GP completion and it is within its right to > return immediately if there are no outstanding p

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

2024-09-10 Thread Liam R. Howlett
* Jeff Xu [240910 10:15]: > Hi Muhammad > > On Mon, Aug 19, 2024 at 3:05 AM Muhammad Usama Anjum > wrote: > > > > On 8/14/24 3:29 AM, Jeff Xu wrote: > > > Hi Muhammad > > > > > > On Fri, Aug 9, 2024 at 1:25 AM Muhammad Usama Anjum > > > wrote: > > >> > > >> The __NR_mmap isn't found on armhf. T

Re: [PATCH v2] remoteproc: k3-dsp: Fix an error handling path in k3_dsp_rproc_probe()

2024-09-10 Thread Mathieu Poirier
On Sat, Sep 07, 2024 at 08:33:36AM +0200, Christophe JAILLET wrote: > If an error occurs after the k3_dsp_rproc_request_mbox() call, > mbox_free_channel() must be called, as already done in the remove function. > > Instead of adding an error handling path in the probe and changing all > error hand

Re: [PATCH] mailbox, remoteproc: omap2+: fix compile testing

2024-09-10 Thread Andrew Davis
On 9/9/24 3:38 PM, Arnd Bergmann wrote: From: Arnd Bergmann Selecting CONFIG_OMAP2PLUS_MBOX while compile testing causes a build failure: WARNING: unmet direct dependencies detected for OMAP2PLUS_MBOX Depends on [n]: MAILBOX [=y] && (ARCH_OMAP2PLUS || ARCH_K3) Selected by [m]: - TI_K3

Re: [PATCH] mailbox, remoteproc: omap2+: fix compile testing

2024-09-10 Thread Mathieu Poirier
On Mon, Sep 09, 2024 at 08:38:09PM +, Arnd Bergmann wrote: > From: Arnd Bergmann > > Selecting CONFIG_OMAP2PLUS_MBOX while compile testing > causes a build failure: > > WARNING: unmet direct dependencies detected for OMAP2PLUS_MBOX > Depends on [n]: MAILBOX [=y] && (ARCH_OMAP2PLUS || ARCH_

Re: [PATCH v2 13/19] gendwarfksyms: Add symtypes output

2024-09-10 Thread Petr Pavlu
On 8/15/24 19:39, Sami Tolvanen wrote: > Add support for producing genksyms-style symtypes files. Process > die_map to find the longest expansions for each type, and use symtypes > references in type definitions. The basic file format is similar to > genksyms, with two notable exceptions: > > 1.

Re: [PATCH bpf-next/net v5 3/3] selftests/bpf: Add mptcp subflow subtest

2024-09-10 Thread Matthieu Baerts
Hello, On 10/09/2024 16:13, Matthieu Baerts (NGI0) wrote: > From: Geliang Tang > > This patch adds a subtest named test_subflow in test_mptcp to load and > verify the newly added MPTCP subflow BPF program. To goal is to make > sure it is possible to set different socket options per subflows, whi

[PATCH HID v2 11/11] selftests/hid: add test to disable hid-input

2024-09-10 Thread Benjamin Tissoires
Add a test for the newly enabled feature to control the connect_mask of hid-generic. Signed-off-by: Benjamin Tissoires --- changes in v2: - amended for the new API --- tools/testing/selftests/hid/hid_bpf.c | 60 +- tools/testing/selftests/hid/progs/hid.c

[PATCH HID v2 10/11] HID: add quirk to prevent hid-input to be used

2024-09-10 Thread Benjamin Tissoires
This is useful when you want to handle the device entirely from BPF without exposing the automatic input nodes. This is useful in case we want to have a third party program that directly talks to the hidraw node and we don't want regular input events to be emitted. This third party program can loa

[PATCH HID v2 09/11] selftests/hid: add test for assigning a given device to hid-generic

2024-09-10 Thread Benjamin Tissoires
We use a well known VID/PID on a driver that doesn't need to talk to the device, ensures we created the device against the target driver, then load our program and ensure we have unbound to this driver and use hid-generic instead. Signed-off-by: Benjamin Tissoires --- changes in v2: - amended f

[PATCH HID v2 08/11] HID: add per device quirk to force bind to hid-generic

2024-09-10 Thread Benjamin Tissoires
We already have the possibility to force not binding to hid-generic and rely on a dedicated driver, but we couldn't do the other way around. This is useful for BPF programs where we are fixing the report descriptor and the events, but want to avoid a specialized driver to come after BPF which woul

[PATCH HID v2 07/11] selftests/hid: allow to parametrize bus/vid/pid/rdesc on the test device

2024-09-10 Thread Benjamin Tissoires
This will be useful to introduce variants in tests to test the interactions between HID-BPF and some kernel modules. Signed-off-by: Benjamin Tissoires --- no changes in v2 --- tools/testing/selftests/hid/hid_bpf.c| 2 +- tools/testing/selftests/hid/hid_common.h | 46 --

[PATCH HID v2 06/11] selftests/hid: cleanup C tests by adding a common struct uhid_device

2024-09-10 Thread Benjamin Tissoires
Allows to have an abstract class uhid_device which handles all of the uhid part without having to mess up with individual fds. struct attach_prog_args is now never used in hid_bpf.c, so drop it as well Signed-off-by: Benjamin Tissoires --- no changes in v2 --- tools/testing/selftests/hid/hid_

[PATCH HID v2 05/11] selftests/hid: add dependency on hid_common.h

2024-09-10 Thread Benjamin Tissoires
Allows to recompile the C tests when that file changes Signed-off-by: Benjamin Tissoires --- no changes in v2 --- tools/testing/selftests/hid/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/hid/Makefile b/tools/testing/selftests/hid/Makefil

[PATCH HID v2 04/11] HID: bpf: allow write access to quirks field in struct hid_device

2024-09-10 Thread Benjamin Tissoires
This allows to give more control from BPF during report descriptor fixup. We already reset the quirks before calling ->probe(), so now we reset it once before calling hid_bpf_rdesc_fixup(). Signed-off-by: Benjamin Tissoires --- new in v2 --- drivers/hid/bpf/hid_bpf_struct_ops.c | 1 + drivers

[PATCH HID v2 03/11] HID: core: remove one more kmemdup on .probe()

2024-09-10 Thread Benjamin Tissoires
That last kmemdup while opening the report descriptor was required to have a common kfree() on it. Move that kmemdup in the only special case it's required (if there is a .report_fixup()), and add a more elaborated check before freeing hdev->rdesc, to avoid a double free. Signed-off-by: Benjamin

[PATCH HID v2 02/11] HID: core: save one kmemdup during .probe()

2024-09-10 Thread Benjamin Tissoires
Turns out the first kmemdup is only required for the .report_fixup() driver callback. There is no need to do two kmemdup() in a raw in case .report_fixup() is not present. Signed-off-by: Benjamin Tissoires --- new in v2 --- drivers/hid/hid-core.c | 18 +++--- 1 file changed, 11 ins

[PATCH HID v2 01/11] HID: bpf: move HID-BPF report descriptor fixup earlier

2024-09-10 Thread Benjamin Tissoires
Currently, hid_bpf_rdesc_fixup() is called once the match between the HID device and the driver is done. This can be problematic in case the driver selected by the kernel would change the report descriptor after the fact. To give a chance for hid_bpf_rdesc_fixup() to provide hints on to how to sel

  1   2   >