[PATCH V2 1/9] fork: Make IO worker options flag based

2021-09-21 Thread Mike Christie
This patchset adds a couple new options to kernel_clone_args for IO thread like/related users. Instead of adding new fields to kernel_clone_args for each option, this moves us to a flags based approach by first converting io_thread. Signed-off-by: Mike Christie --- include/linux/sched/task.h |

[PATCH V2 2/9] fork: pass worker_flags to copy_thread

2021-09-21 Thread Mike Christie
We need to break up PF_IO_WORKER into the parts that are used for scheduling and signal handling and the part that tells copy_thread to treat it as a special type of thread during setup. This patch passes the worker_flags to copy_thread, so in the next patch we can add new worker flags that

[PATCH V2 4/9] fork: add option to not clone or dup files

2021-09-21 Thread Mike Christie
Each vhost device gets a thread that is used to perform IO and management operations. Instead of a thread that is accessing a device, the thread is part of the device, so when it calls the kernel_worker() function added in the next patch we can't dup or clone the parent's files/FDS because it

[PATCH V2 5/9] fork: add helper to clone a process

2021-09-21 Thread Mike Christie
The vhost layer has similar requirements as io_uring where its worker threads need to access the userspace thread's memory, want to inherit the parents's cgroups and namespaces, and be checked against the parent's RLIMITs. Right now, the vhost layer uses the kthread API which has kthread_use_mm

[PATCH V2 3/9] fork: move PF_IO_WORKER's kernel frame setup to new flag

2021-09-21 Thread Mike Christie
The vhost worker threads need the same frame setup as io_uring's worker threads, but handle signals differently and do not need the same scheduling behavior. This patch separate's the frame setup parts of PF_IO_WORKER into a kernel_clone_args flag, KERN_WORKER_USER. Signed-off-by: Mike Christie

[PATCH V2 7/9] fork: Add worker flag to ignore signals

2021-09-21 Thread Mike Christie
The kthread API creates threads that ignore all signals by default so modules like vhost that will move from that API to kernel_worker will not be expecting them. This patch adds a worker flag that tells kernel_worker to setup the task to ignore signals. Signed-off-by: Mike Christie ---

[PATCH V2 6/9] io_uring: switch to kernel_worker

2021-09-21 Thread Mike Christie
Convert io_uring and io-wq to use kernel_worker. Signed-off-by: Mike Christie --- fs/io-wq.c | 15 --- fs/io_uring.c | 11 +-- include/linux/sched/task.h | 1 - 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/fs/io-wq.c

[PATCH V2 9/9] vhost: use kernel_worker to check RLIMITs and inherit v2 cgroups

2021-09-21 Thread Mike Christie
For vhost workers we use the kthread API which inherit's its values from and checks against the kthreadd thread. This results in cgroups v2 not working and the wrong RLIMITs being checked. This patch has us use the kernel_copy_process function which will inherit its values/checks from the thread

[PATCH V2 8/9] vhost: move worker thread fields to new struct

2021-09-21 Thread Mike Christie
This is just a prep patch. It moves the worker related fields to a new vhost_worker struct and moves the code around to create some helpers that will be used in the next patches. Signed-off-by: Mike Christie Reviewed-by: Stefan Hajnoczi --- drivers/vhost/vhost.c | 98

[PATCH V2 0/9] Use copy_process/create_io_thread in vhost layer

2021-09-21 Thread Mike Christie
The following patches were made over Linus's tree but also apply over Jens's 5.16 io_uring branch and Michaels' vhost/next branch. This is version 2 of the patchset and should handle all the review comments posted in V1 here:

Re: [PATCH 1/1] virtio/s390: fix vritio-ccw device teardown

2021-09-21 Thread Cornelia Huck
On Tue, Sep 21 2021, Halil Pasic wrote: > On Mon, 20 Sep 2021 12:07:23 +0200 > Cornelia Huck wrote: > >> On Mon, Sep 20 2021, Vineeth Vijayan wrote: >> >> > On Mon, 2021-09-20 at 00:39 +0200, Halil Pasic wrote: >> >> On Fri, 17 Sep 2021 10:40:20 +0200 >> >> Cornelia Huck wrote: >> >> >>

Re: [PATCH RFC v1 03/11] iommu/virtio: Handle incoming page faults

2021-09-21 Thread Jean-Philippe Brucker
On Fri, Apr 23, 2021 at 03:21:39PM +0530, Vivek Gautam wrote: > Redirect the incoming page faults to the registered fault handler > that can take the fault information such as, pasid, page request > group-id, address and pasid flags. > > Signed-off-by: Vivek Gautam > --- >

Re: [PATCH RFC v1 05/11] iommu/virtio: Add SVA feature and related enable/disable callbacks

2021-09-21 Thread Jean-Philippe Brucker
On Fri, Apr 23, 2021 at 03:21:41PM +0530, Vivek Gautam wrote: > Add a feature flag to virtio iommu for Shared virtual addressing > (SVA). This feature would indicate the availablily path for handling > device page faults, and the provision for sending page response. In this case the feature

Re: [PATCH RFC v1 08/11] iommu/arm-smmu-v3: Implement shared context alloc and free ops

2021-09-21 Thread Jean-Philippe Brucker
On Fri, Apr 23, 2021 at 03:21:44PM +0530, Vivek Gautam wrote: > Implementing the alloc_shared_cd and free_shared_cd in cd-lib, and > start using them for arm-smmu-v3-sva implementation. > > Signed-off-by: Vivek Gautam > --- > .../arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c | 71 >

Re: [PATCH RFC v1 09/11] iommu/virtio: Implement sva bind/unbind calls

2021-09-21 Thread Jean-Philippe Brucker
On Fri, Apr 23, 2021 at 03:21:45PM +0530, Vivek Gautam wrote: > SVA bind and unbind implementations will allow to prepare translation > context with CPU page tables that can be programmed into host iommu > hardware to realize shared address space utilization between the CPU > and virtualized

Re: [PATCH RFC v1 01/11] uapi/virtio-iommu: Add page request grp-id and flags information

2021-09-21 Thread Jean-Philippe Brucker
Hi Vivek, Thanks a lot for your work on this On Fri, Apr 23, 2021 at 03:21:37PM +0530, Vivek Gautam wrote: > Add fault information for group-id and necessary flags for page > request faults that can be handled by page fault handler in > virtio-iommu driver. > > Signed-off-by: Vivek Gautam >

Re: [PATCH RFC v1 02/11] iommu/virtio: Maintain a list of endpoints served by viommu_dev

2021-09-21 Thread Jean-Philippe Brucker
On Fri, Apr 23, 2021 at 03:21:38PM +0530, Vivek Gautam wrote: > Keeping a record of list of endpoints that are served by the virtio-iommu > device would help in redirecting the requests of page faults to the > correct endpoint device to handle such requests. > > Signed-off-by: Vivek Gautam > ---

Re: [PATCH RFC v1 10/11] uapi/virtio-iommu: Add a new request type to send page response

2021-09-21 Thread Jean-Philippe Brucker
On Fri, Apr 23, 2021 at 03:21:46PM +0530, Vivek Gautam wrote: > Once the page faults are handled, the response has to be sent to > virtio-iommu backend, from where it can be sent to the host to > prepare the response to a generated io page fault by the device. > Add a new virt-queue request type

Re: [PATCH 1/1] virtio/s390: fix vritio-ccw device teardown

2021-09-21 Thread Halil Pasic
On Tue, 21 Sep 2021 15:31:03 +0200 Vineeth Vijayan wrote: > On Tue, 2021-09-21 at 05:25 +0200, Halil Pasic wrote: > > On Mon, 20 Sep 2021 12:07:23 +0200 > > Cornelia Huck wrote: > > > > > On Mon, Sep 20 2021, Vineeth Vijayan wrote: > > > > > > > On Mon, 2021-09-20 at 00:39 +0200, Halil