Re: [PATCH 1/8] fork: add helper to clone a process

2021-09-17 Thread Christoph Hellwig
On Fri, Sep 17, 2021 at 09:44:40AM +0200, Christian Brauner wrote: > > generally want a printf-like varargs caling conventions. I'd also > > much prefer to hide as much as possible in the actual helper. That is > > build a helper that gets the name, a flag to ignore the singals etc > > instead

Re: [PATCH 1/8] fork: add helper to clone a process

2021-09-17 Thread Christoph Hellwig
On Thu, Sep 16, 2021 at 04:20:44PM -0500, Mike Christie wrote: > 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.

Re: [PATCH 1/1] virtio-blk: avoid preallocating big SGL for data

2021-09-01 Thread Christoph Hellwig
On Tue, Aug 31, 2021 at 02:35:00AM +0300, Max Gurtovoy wrote: > No need to pre-allocate a big buffer for the IO SGL anymore. If a device > has lots of deep queues, preallocation for the sg list can consume > substantial amounts of memory. For HW virtio-blk device, nr_hw_queues > can be 64 or 128

Re: [PATCH v2 1/1] virtio-blk: add num_io_queues module parameter

2021-08-31 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 1/1] virtio-blk: add num_io_queues module parameter

2021-08-30 Thread Christoph Hellwig
On Mon, Aug 30, 2021 at 03:00:23PM +0300, Max Gurtovoy wrote: > +static int virtblk_queue_count_set(const char *val, > + const struct kernel_param *kp) > +{ > + unsigned int n; > + int ret; > + > + ret = kstrtouint(val, 10, ); > + if (ret != 0 || n > nr_cpu_ids) > +

Re: [PATCH v4 11/15] pci: Add pci_iomap_shared{,_range}

2021-08-24 Thread Christoph Hellwig
On Mon, Aug 23, 2021 at 05:30:54PM -0700, Kuppuswamy, Sathyanarayanan wrote: > > > On 8/23/21 4:56 PM, Michael S. Tsirkin wrote: > > > Add a new variant of pci_iomap for mapping all PCI resources > > > of a devices as shared memory with a hypervisor in a confidential > > > guest. > > > > > >

Re: add a bvec_virt helper

2021-08-16 Thread Christoph Hellwig
ping. On Wed, Aug 04, 2021 at 11:56:19AM +0200, Christoph Hellwig wrote: > Hi Jens, > > this series adds a bvec_virt helper to return the virtual address of the > data in bvec to replace the open coded calculation, and as a reminder > that generall bio/bvec data can be in hig

Re: [PATCH v4 12/15] pci: Mark MSI data shared

2021-08-13 Thread Christoph Hellwig
On Wed, Aug 04, 2021 at 05:52:15PM -0700, Kuppuswamy Sathyanarayanan wrote: > > - return ioremap(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE); > + return ioremap_shared(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE); Please add a comment here. I also find the amount of ioremap_* variants

Re: [PATCH v4 11/15] pci: Add pci_iomap_shared{,_range}

2021-08-13 Thread Christoph Hellwig
On Wed, Aug 04, 2021 at 05:52:14PM -0700, Kuppuswamy Sathyanarayanan wrote: > +extern void __iomem *pci_iomap_shared(struct pci_dev *dev, int bar, > + unsigned long max); > +extern void __iomem *pci_iomap_shared_range(struct pci_dev *dev, int bar, > +

Re: [PATCH v4 10/15] asm/io.h: Add ioremap_shared fallback

2021-08-13 Thread Christoph Hellwig
_shared is just a horrible name for these. Please find a more specific name, and document them instead of just adding to the macro forrest. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

[PATCH 15/15] nvme: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index dfd9dec0c1f6..02ce94b2906b 100644 --- a/drivers/nvme/host

[PATCH 14/15] dcssblk: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/s390/block/dcssblk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 29180bdf0977..5be3d1c39a78 100644 --- a/drivers/s390

[PATCH 13/15] dasd: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/s390/block/dasd_diag.c | 2 +- drivers/s390/block/dasd_eckd.c | 14 +++--- drivers/s390/block/dasd_fba.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/s390/block

[PATCH 12/15] ps3vram: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/block/ps3vram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c index 7fbf469651c4..c7b19e128b03 100644 --- a/drivers/block/ps3vram.c +++ b

[PATCH 11/15] ubd: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- arch/um/drivers/ubd_kern.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index e497185dd393..cd9dc0556e91 100644 --- a/arch/um/drivers

[PATCH 10/15] sd: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index b8d55af763f9..5b5b8266e142 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c

[PATCH 09/15] bcache: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Note that the existing code is fine despite ignoring bv_offset as the bio is known to contain exactly one page from the page allocator per bio_vec. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/btree.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 08/15] virtio_blk: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/block/virtio_blk.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 4b49df2dfd23..767b4f72a54d 100644 --- a/drivers/block

[PATCH 07/15] rbd: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/block/rbd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 6d596c2c2cd6..e65c9d706f6f 100644 --- a/drivers/block/rbd.c +++ b/drivers/block

[PATCH 06/15] squashfs: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- fs/squashfs/block.c| 7 +++ fs/squashfs/lz4_wrapper.c | 2 +- fs/squashfs/lzo_wrapper.c | 2 +- fs/squashfs/xz_wrapper.c | 2 +- fs/squashfs/zlib_wrapper.c | 2 +- fs/squashfs/zstd_wrapper.c | 2 +- 6

[PATCH 05/15] dm-integrity: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/md/dm-integrity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 20f2510db1f6..a9ea361769a7 100644 --- a/drivers/md/dm

[PATCH 04/15] dm-ebs: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/md/dm-ebs-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-ebs-target.c b/drivers/md/dm-ebs-target.c index 71475a2410be..0c509dae0ff8 100644 --- a/drivers/md/dm-ebs

[PATCH 03/15] dm: make EBS depend on !HIGHMEM

2021-08-04 Thread Christoph Hellwig
__ebs_rw_bvec use page_address on the submitted bios data, and thus can't deal with highmem. Disable the target on highmem configs. Signed-off-by: Christoph Hellwig --- drivers/md/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/Kconfig b/drivers/md

[PATCH 02/15] block: use bvec_virt in bio_integrity_{process,free}

2021-08-04 Thread Christoph Hellwig
Use the bvec_virt helper to clean up the bio integrity processing a little bit. Signed-off-by: Christoph Hellwig --- block/bio-integrity.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 8f54d49dc500..6b47cddbbca1

[PATCH 01/15] bvec: add a bvec_virt helper

2021-08-04 Thread Christoph Hellwig
Add a helper to get the virtual address for a bvec. This avoids that all callers need to know about the page + offset representation. Signed-off-by: Christoph Hellwig --- include/linux/bvec.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/bvec.h b/include/linux

add a bvec_virt helper

2021-08-04 Thread Christoph Hellwig
Hi Jens, this series adds a bvec_virt helper to return the virtual address of the data in bvec to replace the open coded calculation, and as a reminder that generall bio/bvec data can be in high memory unless it is caller controller or in an architecture specific driver where highmem is

Re: [PATCH V2 5/6] virtio: add one field into virtio_device for recording if device uses managed irq

2021-07-07 Thread Christoph Hellwig
On Wed, Jul 07, 2021 at 05:42:54PM +0800, Ming Lei wrote: > The problem is that how blk-mq looks at that flag, since the device > representing the controller which allocates irq vectors isn't visible > to blk-mq. In blk_mq_pci_map_queues and similar helpers.

Re: [PATCH V2 5/6] virtio: add one field into virtio_device for recording if device uses managed irq

2021-07-05 Thread Christoph Hellwig
On Fri, Jul 02, 2021 at 11:05:54PM +0800, Ming Lei wrote: > blk-mq needs to know if the device uses managed irq, so add one field > to virtio_device for recording if device uses managed irq. > > If the driver use managed irq, this flag has to be set so it can be > passed to blk-mq. I don't think

Re: [PATCH 0/3] virtio_blk: blk-mq io_poll support

2021-06-16 Thread Christoph Hellwig
On Thu, Jun 03, 2021 at 04:30:25PM +0100, Stefan Hajnoczi wrote: > Christoph and Jens: Any more thoughts on this irq toggling approach? I think it would eventually come back and byte us and would much prefer explicit poll queues. ___ Virtualization

Re: [PATCH 09/30] mtd_blkdevs: use blk_mq_alloc_disk

2021-06-15 Thread Christoph Hellwig
On Tue, Jun 15, 2021 at 05:47:44PM +0200, Marek Szyprowski wrote: > Hi, > > On 02.06.2021 08:53, Christoph Hellwig wrote: > > Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue > > allocation. > > > > Signed-off-by: Christoph Hellwig >

Re: [PATCH v4 00/16] Introduce SCMI VirtIO transport

2021-06-14 Thread Christoph Hellwig
On Fri, Jun 11, 2021 at 05:59:21PM +0100, Cristian Marussi wrote: > Hi all, > > I'm posting this V4 series starting from the work done up to V3 by > OpenSynergy. Who is 'OpenSynergy'? > The main aim of this rework is to simplify where possible the SCMI VirtIO > support added in V3 by adding

Re: [PATCH 20/30] nullb: use blk_mq_alloc_disk

2021-06-07 Thread Christoph Hellwig
On Thu, Jun 03, 2021 at 12:10:09AM +, Chaitanya Kulkarni wrote: > > diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c > > index d8e098f1e5b5..74fb2ec63219 100644 > > --- a/drivers/block/null_blk/main.c > > +++ b/drivers/block/null_blk/main.c > > @@ -1851,13 +1851,12 @@

Re: simplify gendisk and request_queue allocation for blk-mq based drivers

2021-06-05 Thread Christoph Hellwig
On Fri, Jun 04, 2021 at 11:58:34AM -0400, Konrad Rzeszutek Wilk wrote: > On Wed, Jun 02, 2021 at 09:53:15AM +0300, Christoph Hellwig wrote: > > Hi all, > > Hi! > > You wouldn't have a nice git repo to pull so one can test it easily? git://git.infradead.org/users/hch/block

[PATCH 29/30] ataflop: use blk_mq_alloc_disk and blk_cleanup_disk

2021-06-02 Thread Christoph Hellwig
Use blk_mq_alloc_disk and blk_cleanup_disk to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/ataflop.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c

[PATCH 30/30] z2ram: use blk_mq_alloc_disk and blk_cleanup_disk

2021-06-02 Thread Christoph Hellwig
Use blk_mq_alloc_disk and blk_cleanup_disk to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/z2ram.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c index

[PATCH 28/30] amiflop: use blk_mq_alloc_disk and blk_cleanup_disk

2021-06-02 Thread Christoph Hellwig
Use blk_mq_alloc_disk and blk_cleanup_disk to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/amiflop.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c

[PATCH 27/30] scm_blk: use blk_mq_alloc_disk and blk_cleanup_disk

2021-06-02 Thread Christoph Hellwig
Use blk_mq_alloc_disk and blk_cleanup_disk to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/s390/block/scm_blk.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/s390/block/scm_blk.c b/drivers

[PATCH 26/30] ubi: use blk_mq_alloc_disk and blk_cleanup_disk

2021-06-02 Thread Christoph Hellwig
Use blk_mq_alloc_disk and blk_cleanup_disk to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/mtd/ubi/block.c | 68 ++--- 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/drivers/mtd/ubi/block.c b

[PATCH 24/30] sx8: use blk_mq_alloc_disk and blk_cleanup_disk

2021-06-02 Thread Christoph Hellwig
Use blk_mq_alloc_disk and blk_cleanup_disk to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/sx8.c | 23 +++ 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c index

[PATCH 23/30] rnbd: use blk_mq_alloc_disk and blk_cleanup_disk

2021-06-02 Thread Christoph Hellwig
Use blk_mq_alloc_disk and blk_cleanup_disk to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/rnbd/rnbd-clt.c | 35 --- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/drivers/block/rnbd/rnbd

[PATCH 22/30] rbd: use blk_mq_alloc_disk and blk_cleanup_disk

2021-06-02 Thread Christoph Hellwig
Use blk_mq_alloc_disk and blk_cleanup_disk to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/rbd.c | 52 - 1 file changed, 18 insertions(+), 34 deletions(-) diff --git a/drivers/block/rbd.c b

[PATCH 21/30] pd: use blk_mq_alloc_disk and blk_cleanup_disk

2021-06-02 Thread Christoph Hellwig
Use blk_mq_alloc_disk and blk_cleanup_disk to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/paride/pd.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/block/paride/pd.c b

[PATCH 18/30] loop: use blk_mq_alloc_disk and blk_cleanup_disk

2021-06-02 Thread Christoph Hellwig
Use blk_mq_alloc_disk and blk_cleanup_disk to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index

[PATCH 13/30] sunvdc: use blk_mq_alloc_disk

2021-06-02 Thread Christoph Hellwig
Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/sunvdc.c | 47 -- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/drivers/block/sunvdc.c b/drivers/block

[PATCH 12/30] swim: use blk_mq_alloc_disk

2021-06-02 Thread Christoph Hellwig
Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/swim.c | 34 ++ 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/drivers/block/swim.c b/drivers/block/swim.c

[PATCH 11/30] swim3: use blk_mq_alloc_disk

2021-06-02 Thread Christoph Hellwig
Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/swim3.c | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c

[PATCH 10/30] ps3disk: use blk_mq_alloc_disk

2021-06-02 Thread Christoph Hellwig
Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/ps3disk.c | 36 ++-- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/drivers/block/ps3disk.c b/drivers/block

[PATCH 09/30] mtd_blkdevs: use blk_mq_alloc_disk

2021-06-02 Thread Christoph Hellwig
Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/mtd/mtd_blkdevs.c | 48 ++- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers

[PATCH 06/30] pf: use blk_mq_alloc_disk

2021-06-02 Thread Christoph Hellwig
Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/paride/pf.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index

[PATCH 04/30] virtio-blk: use blk_mq_alloc_disk

2021-06-02 Thread Christoph Hellwig
Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/virtio_blk.c | 26 +++--- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block

[PATCH 05/30] pcd: use blk_mq_alloc_disk

2021-06-02 Thread Christoph Hellwig
Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/paride/pcd.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c

[PATCH 03/30] blk-mq: add the blk_mq_alloc_disk APIs

2021-06-02 Thread Christoph Hellwig
Add a new API to allocate a gendisk including the request_queue for use with blk-mq based drivers. This is to avoid boilerplate code in drivers. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 19 +++ include/linux/blk-mq.h | 12 2 files changed, 31

simplify gendisk and request_queue allocation for blk-mq based drivers

2021-06-02 Thread Christoph Hellwig
Hi all, this series is the scond part of cleaning up lifetimes and allocation of the gendisk and request_queue structure. It adds a new interface to allocate the disk and queue together for blk based drivers, and uses that in all drivers that do not have any caveats in their gendisk and

[PATCH 02/30] blk-mq: improve the blk_mq_init_allocated_queue interface

2021-06-02 Thread Christoph Hellwig
Don't return the passed in request_queue but a normal error code, and drop the elevator_init argument in favor of just calling elevator_init_mq directly from dm-rq. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 36 ++-- block/blk.h

[PATCH 01/30] blk-mq: factor out a blk_mq_alloc_sq_tag_set helper

2021-06-02 Thread Christoph Hellwig
Factour out a helper to initialize a simple single hw queue tag_set from blk_mq_init_sq_queue. This will allow to phase out blk_mq_init_sq_queue in favor of a more symmetric and general API. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 32

Re: [PATCH 3/3] virtio_blk: implement blk_mq_ops->poll()

2021-05-24 Thread Christoph Hellwig
On Thu, May 20, 2021 at 03:13:05PM +0100, Stefan Hajnoczi wrote: > Possible drawbacks of this approach: > > - Hardware virtio_blk implementations may find virtqueue_disable_cb() > expensive since it requires DMA. If such devices become popular then > the virtio_blk driver could use a similar

Re: [PATCH 1/1] virtio: disable partitions scanning for no partitions block

2021-05-24 Thread Christoph Hellwig
On Mon, May 24, 2021 at 03:29:22PM +0100, Stefan Hajnoczi wrote: > GENHD_FL_NO_PART_SCAN is not used much in other drivers. This makes me > wonder if the same use case is addressed through other means with SCSI, > NVMe, etc devices. Maybe Christoph or Jens can weigh in on whether > adding a bit to

Re: [PATCH] drm/ttm: use dma_alloc_pages for the page pool

2021-05-11 Thread Christoph Hellwig
On Tue, May 11, 2021 at 09:35:20AM +0200, Christian König wrote: > We certainly going to need the drm_need_swiotlb() for userptr support > (unless we add some approach for drivers to opt out of swiotlb). swiotlb use is driven by three things: 1) addressing limitations of the device 2)

[PATCH] drm/ttm: use dma_alloc_pages for the page pool

2021-05-11 Thread Christoph Hellwig
violation where the TTM pool assumes what kind of virtual address dma_alloc_attrs can return. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 +- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 1 - drivers/gpu/drm/amd

RFC: use dma_alloc_noncoherent in ttm_pool_alloc_page

2021-05-11 Thread Christoph Hellwig
Hi all, the memory allocation for the TTM pool is a big mess with two allocation methods that both have issues, a layering violation and odd guessing of pools in the callers. This patch switches to the dma_alloc_noncoherent API instead fixing all of the above issues. Warning: i don't have any

Re: [RFC PATCH V2 0/7] Do not read from descripto ring

2021-05-06 Thread Christoph Hellwig
On Thu, May 06, 2021 at 04:12:17AM -0400, Michael S. Tsirkin wrote: > Let's try for just a bit, won't make this window anyway: > > I have an old idea. Add a way to find out that unmap is a nop > (or more exactly does not use the address/length). > Then in that case even with DMA API we do not

Re: [PATCH] Provide detailed specification of virtio-blk lifetime metrics

2021-05-04 Thread Christoph Hellwig
ds, but it is intended to provide an open and more > clear description of the meaning associated with those fields. > > Signed-off-by: Enrico Granata Still not a fan of the encoding, but at least it is properly documented now: Acked-by: Christoph Hellwig

Re: [RFC PATCH 0/7] Untrusted device support for virtio

2021-04-22 Thread Christoph Hellwig
On Wed, Apr 21, 2021 at 11:21:10AM +0800, Jason Wang wrote: > The behaivor for non DMA API is kept for minimizing the performance > impact. NAK. Everyone should be using the DMA API in a modern world. So treating the DMA API path worse than the broken legacy path does not make any sense

Re: [PATCH v2] virtio_blk: Add support for lifetime feature

2021-04-20 Thread Christoph Hellwig
Just to despit my 2 cents again: I think the way this is specified in the virtio spec is actively harmful and we should not suport it in Linux. If others override me we at least need to require a detailed documentation of these fields as the virto spec does not provide it. Please also do not

Re: [PATCH] virtio_blk: Add support for lifetime feature

2021-04-15 Thread Christoph Hellwig
On Wed, Apr 14, 2021 at 09:44:35AM +0100, Stefan Hajnoczi wrote: > On Mon, Apr 12, 2021 at 10:42:17AM +0100, Christoph Hellwig wrote: > > A note to the virtio committee: eMMC is the worst of all the currently > > active storage standards by a large margin. It defines very str

Re: [PATCH] virtio_blk: Add support for lifetime feature

2021-04-15 Thread Christoph Hellwig
On Mon, Apr 12, 2021 at 08:00:24AM -0400, Michael S. Tsirkin wrote: > On Mon, Apr 12, 2021 at 10:42:17AM +0100, Christoph Hellwig wrote: > > A note to the virtio committee: eMMC is the worst of all the currently > > active storage standards by a large margin. It defines very str

Re: [PATCH] virtio_blk: Add support for lifetime feature

2021-04-12 Thread Christoph Hellwig
A note to the virtio committee: eMMC is the worst of all the currently active storage standards by a large margin. It defines very strange ad-hoc interfaces that expose very specific internals and often provides very poor abstractions. It would be great it you could reach out to the wider

[PATCH 14/20] iommu: remove DOMAIN_ATTR_PAGING

2021-04-01 Thread Christoph Hellwig
DOMAIN_ATTR_PAGING is never used. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/iommu.c | 5 - include/linux/iommu.h | 1 - 2 files changed, 6 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index b212bf0261820b

[PATCH 20/20] iommu: remove iommu_domain_{get,set}_attr

2021-04-01 Thread Christoph Hellwig
Remove the now unused iommu attr infrastructure. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon --- drivers/iommu/iommu.c | 26 -- include/linux/iommu.h | 36 2 files changed, 62 deletions(-) diff --git a/drivers/iommu

[PATCH 08/20] iommu/fsl_pamu: merge pamu_set_liodn and map_liodn

2021-04-01 Thread Christoph Hellwig
Merge the two fuctions that configure the ppaace into a single coherent function. I somehow doubt we need the two pamu_config_ppaace calls, but keep the existing behavior just to be on the safe side. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 65

[PATCH 09/20] iommu/fsl_pamu: merge handle_attach_device into fsl_pamu_attach_device

2021-04-01 Thread Christoph Hellwig
No good reason to split this functionality over two functions. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 59 +++-- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/drivers/iommu

[PATCH 05/20] iommu/fsl_pamu: remove support for multiple windows

2021-04-01 Thread Christoph Hellwig
The only domains allocated forces use of a single window. Remove all the code related to multiple window support, as well as the need for qman_portal to force a single window. Remove the now unused DOMAIN_ATTR_WINDOWS iommu_attr. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked

[PATCH 11/20] iommu/fsl_pamu: remove the snoop_id field

2021-04-01 Thread Christoph Hellwig
The snoop_id is always set to ~(u32)0. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 5 ++--- drivers/iommu/fsl_pamu_domain.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c

[PATCH 07/20] iommu/fsl_pamu: replace DOMAIN_ATTR_FSL_PAMU_STASH with a direct call

2021-04-01 Thread Christoph Hellwig
Add a fsl_pamu_configure_l1_stash API that qman_portal can call directly instead of indirecting through the iommu attr API. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- arch/powerpc/include/asm/fsl_pamu_stash.h | 12 +++- drivers/iommu/fsl_pamu_domain.c

[PATCH 04/20] iommu/fsl_pamu: merge iommu_alloc_dma_domain into fsl_pamu_domain_alloc

2021-04-01 Thread Christoph Hellwig
Keep the functionality to allocate the domain together. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 34 ++--- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/iommu

[PATCH 16/20] iommu: remove DOMAIN_ATTR_NESTING

2021-04-01 Thread Christoph Hellwig
Use an explicit enable_nesting method instead. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 43 - drivers/iommu/arm/arm-smmu/arm-smmu.c | 30 +++--- drivers/iommu/intel/iommu.c

[PATCH 18/20] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-04-01 Thread Christoph Hellwig
flushing a new IOMMU_CMD_LINE_STRICT is used to turn the value into a tristate to represent the default if not overriden by an explicit parameter. Signed-off-by: Robin Murphy . [ported on top of the other iommu_attr changes and added a few small missing bits] Signed-off-by: Christoph Hellwig

[PATCH 13/20] iommu/fsl_pamu: hardcode the window address and size in pamu_config_ppaace

2021-04-01 Thread Christoph Hellwig
The win_addr and win_size parameters are always set to 0 and 1 << 36 respectively, so just hard code them. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu.c| 23 --- drivers/iommu/fsl_pamu.h| 3 +-- drivers/iommu/fsl_pamu_domain.

cleanup unused or almost unused IOMMU APIs and the FSL PAMU driver v3

2021-04-01 Thread Christoph Hellwig
Hi all, there are a bunch of IOMMU APIs that are entirely unused, or only used as a private communication channel between the FSL PAMU driver and it's only consumer, the qbman portal driver. So this series drops a huge chunk of entirely unused FSL PAMU functionality, then drops all kinds of

[PATCH 12/20] iommu/fsl_pamu: remove the rpn and snoop_id arguments to pamu_config_ppaac

2021-04-01 Thread Christoph Hellwig
These are always wired to fixed values, so don't bother passing them as arguments. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu.c| 14 +++--- drivers/iommu/fsl_pamu.h| 3 +-- drivers/iommu/fsl_pamu_domain.c | 6 +++--- 3 files changed, 7 insertions

[PATCH 17/20] iommu: remove iommu_set_cmd_line_dma_api and iommu_cmd_line_dma_api

2021-04-01 Thread Christoph Hellwig
Don't obsfucate the trivial bit flag check. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon --- drivers/iommu/iommu.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 58d1d11a8d5c10

[PATCH 10/20] iommu/fsl_pamu: enable the liodn when attaching a device

2021-04-01 Thread Christoph Hellwig
Instead of a separate call to enable all devices from the list, just enable the liodn once the device is attached to the iommu domain. This also remove the DOMAIN_ATTR_FSL_PAMU_ENABLE iommu_attr. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu

[PATCH 03/20] iommu/fsl_pamu: remove support for setting DOMAIN_ATTR_GEOMETRY

2021-04-01 Thread Christoph Hellwig
The default geometry is the same as the one set by qman_port given that FSL_PAMU depends on having 64-bit physical and thus DMA addresses. Remove the support to update the geometry and remove the now pointless geom_size field. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li

[PATCH 19/20] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-04-01 Thread Christoph Hellwig
Use an explicit set_pgtable_quirks method instead that just passes the actual quirk bitmask instead. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 5 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 64

[PATCH 06/20] iommu/fsl_pamu: remove ->domain_window_enable

2021-04-01 Thread Christoph Hellwig
use the iommu_domain_geometry structure instead. Remove the now unused ->domain_window_enable iommu method. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 182 +++- drivers/iommu/fsl_pamu_domain.h | 15 --- drivers/io

[PATCH 02/20] iommu/fsl_pamu: remove fsl_pamu_get_domain_attr

2021-04-01 Thread Christoph Hellwig
None of the values returned by this function are ever queried. Also remove the DOMAIN_ATTR_FSL_PAMUV1 enum value that is not otherwise used. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 30

[PATCH 01/20] iommu: remove the unused domain_window_disable method

2021-04-01 Thread Christoph Hellwig
domain_window_disable is wired up by fsl_pamu, but never actually called. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 48 - include/linux/iommu.h | 2 -- 2 files changed, 50 deletions

[PATCH 15/20] iommu: remove DOMAIN_ATTR_GEOMETRY

2021-04-01 Thread Christoph Hellwig
The geometry information can be trivially queried from the iommu_domain struture. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/iommu.c | 20 +++- drivers/vfio/vfio_iommu_type1.c | 26 -- drivers

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-04-01 Thread Christoph Hellwig
For now I'll just pass the iommu_domain to iommu_get_dma_strict, so that we can check for it. We can do additional cleanups on top of that later. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH 11/18] iommu/fsl_pamu: remove the snoop_id field

2021-04-01 Thread Christoph Hellwig
On Tue, Mar 30, 2021 at 01:58:17PM +0100, Will Deacon wrote: > pamu_config_ppaace() takes quite a few useless parameters at this stage, > but anyway: I'll see it it makes sense to throw in another patch at the end to cut it down a bit more. > Acked-by: Will Deacon > > Do you know if this

Re: [PATCH 08/18] iommu/fsl_pamu: merge pamu_set_liodn and map_liodn

2021-04-01 Thread Christoph Hellwig
On Tue, Mar 30, 2021 at 01:46:51PM +0100, Will Deacon wrote: > > + ret = pamu_config_ppaace(liodn, geom->aperture_start, > > +geom->aperture_end - 1, ~(u32)0, > > +0, dma_domain->snoop_id, dma_domain->stash_id, > > +

Re: [PATCH 06/18] iommu/fsl_pamu: remove ->domain_window_enable

2021-04-01 Thread Christoph Hellwig
On Tue, Mar 30, 2021 at 01:40:09PM +0100, Will Deacon wrote: > > + ret = pamu_config_ppaace(liodn, geom->aperture_start, > > +geom->aperture_end - 1, ~(u32)0, > > You're passing 'geom->aperture_end - 1' as the size here, but the old code > seemed to _add_ 1: > > >

Re: [PATCH 05/18] iommu/fsl_pamu: remove support for multiple windows

2021-04-01 Thread Christoph Hellwig
On Tue, Mar 30, 2021 at 01:22:34PM +0100, Will Deacon wrote: > > * win_arr contains information of the configured > > * windows for a domain. This is allocated only > > * when the number of windows for the domain are > > * set. > > */ > > The last part of this comment is

Re: [PATCH v5 01/11] file: Export __receive_fd() to modules

2021-03-25 Thread Christoph Hellwig
On Mon, Mar 15, 2021 at 05:46:43PM +0800, Yongji Xie wrote: > On Mon, Mar 15, 2021 at 5:08 PM Christoph Hellwig wrote: > > > > On Mon, Mar 15, 2021 at 01:37:11PM +0800, Xie Yongji wrote: > > > Export __receive_fd() so that some modules can use > > > it to pass

Re: [PATCH 15/17] iommu: remove DOMAIN_ATTR_NESTING

2021-03-25 Thread Christoph Hellwig
On Thu, Mar 25, 2021 at 06:12:37AM +, Tian, Kevin wrote: > Agree. The vSVA series is still undergoing a refactor according to Jason's > comment thus won't be ready in short term. It's better to let this one > go in first. Would be great to get a few more reviews while we're at it :)

[PATCH 18/18] iommu: remove iommu_domain_{get,set}_attr

2021-03-16 Thread Christoph Hellwig
Remove the now unused iommu attr infrastructure. Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 26 -- include/linux/iommu.h | 36 2 files changed, 62 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu

[PATCH 17/18] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-03-16 Thread Christoph Hellwig
Use an explicit set_pgtable_quirks method instead that just passes the actual quirk bitmask instead. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 5 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 64 + drivers/iommu/arm

[PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-16 Thread Christoph Hellwig
flushing a new IOMMU_CMD_LINE_STRICT is used to turn the value into a tristate to represent the default if not overriden by an explicit parameter. Signed-off-by: Robin Murphy . [ported on top of the other iommu_attr changes and added a few small missing bits] Signed-off-by: Christoph Hellwig

[PATCH 15/18] iommu: remove iommu_set_cmd_line_dma_api and iommu_cmd_line_dma_api

2021-03-16 Thread Christoph Hellwig
Don't obsfucate the trivial bit flag check. Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 58d1d11a8d5c10..052cef11ae30df 100644

[PATCH 14/18] iommu: remove DOMAIN_ATTR_NESTING

2021-03-16 Thread Christoph Hellwig
Use an explicit enable_nesting method instead. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 43 - drivers/iommu/arm/arm-smmu/arm-smmu.c | 30 +++--- drivers/iommu/intel/iommu.c | 31

<    1   2   3   4   5   6   7   8   9   10   >