Re: [PATCH] gpio: aggregator: Add interrupt support

2021-10-04 Thread Geert Uytterhoeven
Hi Viresh, On Tue, Oct 5, 2021 at 7:50 AM Viresh Kumar wrote: > On 04-10-21, 14:44, Geert Uytterhoeven wrote: > > Currently the GPIO Aggregator does not support interrupts. This means > > that kernel drivers going from a GPIO to an IRQ using gpiod_to_irq(), > > and userspace applications using l

Re: [PATCH] gpio: aggregator: Add interrupt support

2021-10-04 Thread Viresh Kumar
On 04-10-21, 14:44, Geert Uytterhoeven wrote: > Currently the GPIO Aggregator does not support interrupts. This means > that kernel drivers going from a GPIO to an IRQ using gpiod_to_irq(), > and userspace applications using line events do not work. > > Add interrupt support by providing a gpio_c

Re: [PATCH v2 4/6] virtio: Initialize authorized attribute for confidential guest

2021-10-04 Thread Dan Williams
On Sat, Oct 2, 2021 at 7:20 AM Andi Kleen wrote: > > > On 10/2/2021 4:14 AM, Greg Kroah-Hartman wrote: > > On Sat, Oct 02, 2021 at 07:04:28AM -0400, Michael S. Tsirkin wrote: > >> On Fri, Oct 01, 2021 at 08:49:28AM -0700, Andi Kleen wrote: > Do you have a list of specific drivers and kerne

Re: [PATCH V3 6/9] io_uring: switch to kernel_worker

2021-10-04 Thread Jens Axboe
On 10/4/21 1:21 PM, Mike Christie wrote: > Convert io_uring and io-wq to use kernel_worker. Looks good to me: Reviewed-by: Jens Axboe -- Jens Axboe ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundati

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

2021-10-04 Thread Jens Axboe
On 10/4/21 1:21 PM, Mike Christie wrote: > diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h > index e165cc67fd3c..ba0499b6627c 100644 > --- a/include/linux/sched/task.h > +++ b/include/linux/sched/task.h > @@ -87,7 +87,11 @@ extern void exit_files(struct task_struct *); > exter

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

2021-10-04 Thread Jens Axboe
On 10/4/21 1:21 PM, Mike Christie wrote: > 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 sign

Re: [virtio-dev] Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Michael S. Tsirkin
On Mon, Oct 04, 2021 at 05:45:06PM +0200, Cornelia Huck wrote: > On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > > > On Mon, Oct 04, 2021 at 04:27:23PM +0200, Cornelia Huck wrote: > >> On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > >> > >> > On Mon, Oct 04, 2021 at 02:01:14PM +0200, Corn

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

2021-10-04 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 Acked-by: Chr

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

2021-10-04 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 th

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

2021-10-04 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 Acked-by: Michael S. Tsirkin --- drivers/vhost/vhost.c |

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

2021-10-04 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 for

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

2021-10-04 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 A

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

2021-10-04 Thread Mike Christie
Convert io_uring and io-wq to use kernel_worker. Signed-off-by: Mike Christie Reviewed-by: Christian Brauner --- fs/io-wq.c | 15 --- fs/io_uring.c | 11 +-- include/linux/sched/task.h | 1 - 3 files changed, 13 insertions(+), 14 deletions(-) d

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

2021-10-04 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 would

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

2021-10-04 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 functio

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

2021-10-04 Thread Mike Christie
The following patches were made over Linus's tree but also apply over Jens's for-next io_uring branch and Michaels' vhost/next branch. This is V3 of the patchset. It should handle all the review comments posted in V1 and V2. If I missed a comment, please let me know. This patchset allows the vhos

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

2021-10-04 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 Suggested-by: Christian Brauner Ac

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Michael S. Tsirkin
On Mon, Oct 04, 2021 at 05:50:44PM +0200, Cornelia Huck wrote: > On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > > > On Mon, Oct 04, 2021 at 04:33:21PM +0200, Cornelia Huck wrote: > >> On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > >> > >> > On Mon, Oct 04, 2021 at 02:19:55PM +0200, Corn

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Cornelia Huck
On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > On Mon, Oct 04, 2021 at 04:33:21PM +0200, Cornelia Huck wrote: >> On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: >> >> > On Mon, Oct 04, 2021 at 02:19:55PM +0200, Cornelia Huck wrote: >> >> >> >> [cc:qemu-devel] >> >> >> >> On Sat, Oct 02 2

Re: [virtio-dev] Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Cornelia Huck
On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > On Mon, Oct 04, 2021 at 04:27:23PM +0200, Cornelia Huck wrote: >> On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: >> >> > On Mon, Oct 04, 2021 at 02:01:14PM +0200, Cornelia Huck wrote: >> >> On Sun, Oct 03 2021, "Michael S. Tsirkin" wrote: >>

Re: [PATCH v5] virtio-blk: Add validation for block size in config space

2021-10-04 Thread Michael S. Tsirkin
On Mon, Oct 04, 2021 at 11:27:29AM -0400, Michael S. Tsirkin wrote: > On Mon, Aug 09, 2021 at 06:16:09PM +0800, Xie Yongji wrote: > > An untrusted device might presents an invalid block size > > in configuration space. This tries to add validation for it > > in the validate callback and clear the V

Re: [PATCH v5] virtio-blk: Add validation for block size in config space

2021-10-04 Thread Michael S. Tsirkin
On Mon, Aug 09, 2021 at 06:16:09PM +0800, Xie Yongji wrote: > An untrusted device might presents an invalid block size > in configuration space. This tries to add validation for it > in the validate callback and clear the VIRTIO_BLK_F_BLK_SIZE > feature bit if the value is out of the supported rang

Re: [PATCH] gpio: aggregator: Add interrupt support

2021-10-04 Thread Geert Uytterhoeven
Hi Andy, On Mon, Oct 4, 2021 at 3:21 PM Andy Shevchenko wrote: > On Mon, Oct 4, 2021 at 3:45 PM Geert Uytterhoeven > wrote: > > Currently the GPIO Aggregator does not support interrupts. This means > > that kernel drivers going from a GPIO to an IRQ using gpiod_to_irq(), > > and userspace appli

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Michael S. Tsirkin
On Mon, Oct 04, 2021 at 04:33:21PM +0200, Cornelia Huck wrote: > On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > > > On Mon, Oct 04, 2021 at 02:19:55PM +0200, Cornelia Huck wrote: > >> > >> [cc:qemu-devel] > >> > >> On Sat, Oct 02 2021, "Michael S. Tsirkin" wrote: > >> > >> > On Fri, Oct 0

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Michael S. Tsirkin
On Mon, Oct 04, 2021 at 04:27:23PM +0200, Cornelia Huck wrote: > On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > > > On Mon, Oct 04, 2021 at 02:01:14PM +0200, Cornelia Huck wrote: > >> On Sun, Oct 03 2021, "Michael S. Tsirkin" wrote: > >> > @@ -160,6 +163,33 @@ \subsection{Legacy Interface: A

Re: [PATCH 0/5] iommu: Some IOVA code reorganisation

2021-10-04 Thread Robin Murphy
On 2021-10-04 12:44, Will Deacon wrote: On Fri, Sep 24, 2021 at 06:01:52PM +0800, John Garry wrote: The IOVA domain structure is a bit overloaded, holding: - IOVA tree management - FQ control - IOVA rcache memories Indeed only a couple of IOVA users use the rcache, and only dma-iommu.c uses the

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Cornelia Huck
On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > On Mon, Oct 04, 2021 at 02:19:55PM +0200, Cornelia Huck wrote: >> >> [cc:qemu-devel] >> >> On Sat, Oct 02 2021, "Michael S. Tsirkin" wrote: >> >> > On Fri, Oct 01, 2021 at 09:21:25AM +0200, Halil Pasic wrote: >> >> On Thu, 30 Sep 2021 07:12:2

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Cornelia Huck
On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > On Mon, Oct 04, 2021 at 02:01:14PM +0200, Cornelia Huck wrote: >> On Sun, Oct 03 2021, "Michael S. Tsirkin" wrote: >> > @@ -160,6 +163,33 @@ \subsection{Legacy Interface: A Note on Feature >> > Specification text within these sections generally

Re: [PATCH] gpio: aggregator: Add interrupt support

2021-10-04 Thread Andy Shevchenko
On Mon, Oct 4, 2021 at 3:45 PM Geert Uytterhoeven wrote: > > Currently the GPIO Aggregator does not support interrupts. This means > that kernel drivers going from a GPIO to an IRQ using gpiod_to_irq(), > and userspace applications using line events do not work. > > Add interrupt support by provi

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

2021-10-04 Thread Michael S. Tsirkin
On Tue, Sep 21, 2021 at 04:52:18PM -0500, Mike Christie wrote: > 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_p

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

2021-10-04 Thread Michael S. Tsirkin
On Tue, Sep 21, 2021 at 04:52:17PM -0500, Mike Christie wrote: > 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: S

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Michael S. Tsirkin
On Mon, Oct 04, 2021 at 02:19:55PM +0200, Cornelia Huck wrote: > > [cc:qemu-devel] > > On Sat, Oct 02 2021, "Michael S. Tsirkin" wrote: > > > On Fri, Oct 01, 2021 at 09:21:25AM +0200, Halil Pasic wrote: > >> On Thu, 30 Sep 2021 07:12:21 -0400 > >> "Michael S. Tsirkin" wrote: > >> > >> > On Th

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Michael S. Tsirkin
On Mon, Oct 04, 2021 at 02:01:14PM +0200, Cornelia Huck wrote: > On Sun, Oct 03 2021, "Michael S. Tsirkin" wrote: > > > Sent too early. So here's what I propose. Could you pls take a look > > and if you like this, post a ccw section? > > We have not talked about the mmio transport so far, but I

[PATCH] gpio: aggregator: Add interrupt support

2021-10-04 Thread Geert Uytterhoeven
Currently the GPIO Aggregator does not support interrupts. This means that kernel drivers going from a GPIO to an IRQ using gpiod_to_irq(), and userspace applications using line events do not work. Add interrupt support by providing a gpio_chip.to_irq() callback, which just calls into the parent

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Cornelia Huck
[cc:qemu-devel] On Sat, Oct 02 2021, "Michael S. Tsirkin" wrote: > On Fri, Oct 01, 2021 at 09:21:25AM +0200, Halil Pasic wrote: >> On Thu, 30 Sep 2021 07:12:21 -0400 >> "Michael S. Tsirkin" wrote: >> >> > On Thu, Sep 30, 2021 at 03:20:49AM +0200, Halil Pasic wrote: >> > > This patch fixes a

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Cornelia Huck
On Sun, Oct 03 2021, "Michael S. Tsirkin" wrote: > Sent too early. So here's what I propose. Could you pls take a look > and if you like this, post a ccw section? We have not talked about the mmio transport so far, but I guess it should be fine as legacy and standard are separated. > There's al

Re: [PATCH 0/5] iommu: Some IOVA code reorganisation

2021-10-04 Thread Will Deacon
On Fri, Sep 24, 2021 at 06:01:52PM +0800, John Garry wrote: > The IOVA domain structure is a bit overloaded, holding: > - IOVA tree management > - FQ control > - IOVA rcache memories > > Indeed only a couple of IOVA users use the rcache, and only dma-iommu.c > uses the FQ feature. > > This series

Re: [PATCH 5/5] iommu/iova: Avoid double-negatives in magazine helpers

2021-10-04 Thread Will Deacon
On Fri, Sep 24, 2021 at 06:01:57PM +0800, John Garry wrote: > A similar crash to the following could be observed if initial CPU rcache > magazine allocations fail in init_iova_rcaches(): > > Unable to handle kernel NULL pointer dereference at virtual address > > Mem abort info: >

Re: [PATCH 1/5] iova: Move fast alloc size roundup into alloc_iova_fast()

2021-10-04 Thread Will Deacon
On Fri, Sep 24, 2021 at 06:01:53PM +0800, John Garry wrote: > It really is a property of the IOVA rcache code that we need to alloc a > power-of-2 size, so relocate the functionality to resize into > alloc_iova_fast(), rather than the callsites. > > Signed-off-by: John Garry > --- > drivers/iomm

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Cornelia Huck
On Mon, Oct 04 2021, Halil Pasic wrote: > On Mon, 04 Oct 2021 09:01:42 +0200 > Cornelia Huck wrote: > >> On Sat, Oct 02 2021, "Michael S. Tsirkin" wrote: >> >> > On Fri, Oct 01, 2021 at 05:18:46PM +0200, Cornelia Huck wrote: >> >> I'd say we need a hack here so that we assume little-endian c

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Halil Pasic
On Mon, 04 Oct 2021 09:01:42 +0200 Cornelia Huck wrote: > On Sat, Oct 02 2021, "Michael S. Tsirkin" wrote: > > > On Fri, Oct 01, 2021 at 05:18:46PM +0200, Cornelia Huck wrote: > >> I'd say we need a hack here so that we assume little-endian config space > >> if VERSION_1 has been offered; if

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Michael S. Tsirkin
On Mon, Oct 04, 2021 at 04:23:23AM +0200, Halil Pasic wrote: > On Sat, 2 Oct 2021 14:13:37 -0400 > "Michael S. Tsirkin" wrote: > > > > Anyone else have an idea? This is a nasty regression; we could revert the > > > patch, which would remove the symptoms and give us some time, but that > > > doesn

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Cornelia Huck
On Sat, Oct 02 2021, "Michael S. Tsirkin" wrote: > On Fri, Oct 01, 2021 at 05:18:46PM +0200, Cornelia Huck wrote: >> I'd say we need a hack here so that we assume little-endian config space >> if VERSION_1 has been offered; if your patch here works, I assume QEMU >> does what we expect (assmuming