improve use_mm / unuse_mm

2020-04-04 Thread Christoph Hellwig
Hi all, this series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API. ___ Virtualization mailing list Virtualization@lists.linux-foundation.or

[PATCH 6/6] kernel: set USER_DS in kthread_use_mm

2020-04-04 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/usb/gadget/function/f_fs.c | 4 drivers/vhost/vhost.c | 3 --- fs/io-wq.c | 8 ++-- fs/io_uring.c | 4 kernel/kthread.c | 6 ++ 5 files changed, 8 insertions(+

[PATCH 1/6] amdgpu: a NULL ->mm does not mean a thread is a kthread

2020-04-04 Thread Christoph Hellwig
Use the proper API instead. Fixes: 70539bd795002 ("drm/amd: Update MEC HQD loading code for KFD") Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_a

[PATCH 2/6] i915/gvt/kvm: a NULL ->mm does not mean a thread is a kthread

2020-04-04 Thread Christoph Hellwig
Use the proper API instead. Fixes: f440c8a572d7 ("drm/i915/gvt/kvmgt: read/write GPA via KVM API") Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gp

[PATCH 5/6] kernel: better document the use_mm/unuse_mm API contract

2020-04-04 Thread Christoph Hellwig
off-by: Christoph Hellwig --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 4 +-- drivers/gpu/drm/i915/gvt/kvmgt.c | 4 +-- drivers/usb/gadget/function/f_fs.c | 4 +-- drivers/usb/gadget/legacy/inode.c | 4 +-- drivers/vhost/vhost.c | 4 +-- fs/i

Re: [PATCH] vdpa-sim: depend on HAS_DMA

2020-04-06 Thread Christoph Hellwig
Pleae just drop the code - we should not add new drivers with custom DMA ops. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH RFC v2 02/24] scsi: allocate separate queue for reserved commands

2020-04-07 Thread Christoph Hellwig
On Tue, Apr 07, 2020 at 04:00:10PM +0200, Hannes Reinecke wrote: > My concern is this: > > struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost) > { > [ .. ] > starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id); > [ .. ] > > and we have typically: > >

Re: [PATCH 3/6] i915/gvt: remove unused xen bits

2020-04-13 Thread Christoph Hellwig
On Wed, Apr 08, 2020 at 09:44:37AM +0800, Zhenyu Wang wrote: > On 2020.04.04 11:40:58 +0200, Christoph Hellwig wrote: > > No Xen support anywhere here. Remove a dead declaration and an unused > > include. > > > > Signed-off-by: Christoph Hellwig > > --- > &g

Re: [PATCH 2/6] i915/gvt/kvm: a NULL ->mm does not mean a thread is a kthread

2020-04-13 Thread Christoph Hellwig
On Mon, Apr 06, 2020 at 11:08:46PM -0400, Yan Zhao wrote: > hi > we were removing this code. see > https://lore.kernel.org/kvm/20200313031109.7989-1-yan.y.z...@intel.com/ This didn't make 5.7-rc1. > The implementation of vfio_dma_rw() has been in vfio next tree. > https://github.com/awilliam/linu

Re: [PATCH 2/6] i915/gvt/kvm: a NULL ->mm does not mean a thread is a kthread

2020-04-14 Thread Christoph Hellwig
On Mon, Apr 13, 2020 at 08:04:10PM -0400, Yan Zhao wrote: > > I can't think of another way for a kernel thread to have a mm indeed. > for example, before calling to vfio_dma_rw(), a kernel thread has already > called use_mm(), then its current->mm is not null, and it has flag > PF_KTHREAD. > in thi

improve use_mm / unuse_mm v2

2020-04-15 Thread Christoph Hellwig
Hi all, this series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API. Changes since v1: - drop a few patches - fix a comment typo - cover the newly merged use_mm/unuse_mm caller in v

[PATCH 3/3] kernel: set USER_DS in kthread_use_mm

2020-04-15 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Acked-by: Michael S. Tsirkin [vhost] --- drivers/usb/gadget/function/f_fs.c | 4 drivers/vhost/vhost.c | 3 --- fs/io-wq.c | 8 ++-- fs/io_uring.c | 4 kernel/kthread.c | 6

[PATCH 2/3] kernel: better document the use_mm/unuse_mm API contract

2020-04-15 Thread Christoph Hellwig
off-by: Christoph Hellwig Acked-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 4 +-- drivers/gpu/drm/i915/gvt/kvmgt.c | 4 +-- drivers/usb/gadget/function/f_fs.c | 4 +-- drivers/usb/gadget/legacy/inode.c | 4 +-- drivers/vfio/vfio_iommu_t

[PATCH 1/3] kernel: move use_mm/unuse_mm to kthread.c

2020-04-15 Thread Christoph Hellwig
These helpers are only for use with kernel threads, and I will tie them more into the kthread infrastructure going forward. Also move the prototypes to kthread.h - mmu_context.h was a little weird to start with as it otherwise contains very low-level MM bits. Signed-off-by: Christoph Hellwig

Re: improve use_mm / unuse_mm v2

2020-04-16 Thread Christoph Hellwig
On Thu, Apr 16, 2020 at 08:17:44PM -0700, Matthew Wilcox wrote: > On Thu, Apr 16, 2020 at 07:31:55AM +0200, Christoph Hellwig wrote: > > this series improves the use_mm / unuse_mm interface by better > > documenting the assumptions, and my taking the set_fs manipulations >

Re: [PATCH v3] vhost: disable for OABI

2020-04-20 Thread Christoph Hellwig
On Thu, Apr 16, 2020 at 06:20:20PM -0400, Michael S. Tsirkin wrote: > vhost is currently broken on the some ARM configs. > > The reason is that that uses apcs-gnu which is the ancient OABI that is been > deprecated for a long time. > > Given that virtio support on such ancient systems is not need

Re: [PATCH 0/1] KVM support for VMD devices

2020-04-22 Thread Christoph Hellwig
On Wed, Apr 22, 2020 at 01:14:44PM -0400, Jon Derrick wrote: > The two patches (Linux & QEMU) add support for passthrough VMD devices > in QEMU/KVM. VMD device 28C0 already supports passthrough natively by > providing the Host Physical Address in a shadow register to the guest > for correct bridge

Re: [PATCH] virtio-blk: handle block_device_operations callbacks after hot unplug

2020-04-23 Thread Christoph Hellwig
On Thu, Apr 23, 2020 at 01:37:17PM +0100, Stefan Hajnoczi wrote: > A virtio_blk block device can still be referenced after hot unplug by > userspace processes that hold the file descriptor. In this case > virtblk_getgeo() can be invoked after virtblk_remove() was called. For > example, a program

Re: [PATCH 0/8] Convert the intel iommu driver to the dma-iommu api

2020-05-29 Thread Christoph Hellwig
On Thu, May 28, 2020 at 06:00:44PM -0600, Logan Gunthorpe wrote: > > This issue is most likely in the i915 driver and is most likely caused by > > the driver not respecting the return value of the dma_map_ops::map_sg > > function. You can see the driver ignoring the return value here: > > https:/

Re: [PATCH] xen: introduce xen_vring_use_dma

2020-07-01 Thread Christoph Hellwig
On Mon, Jun 29, 2020 at 04:46:09PM -0700, Stefano Stabellini wrote: > > I could imagine some future Xen hosts setting a flag somewhere in the > > platform capability saying "no xen specific flag, rely on > > "VIRTIO_F_ACCESS_PLATFORM". Then you set that accordingly in QEMU. > > How about that? > >

Re: [PATCH V6 4/5] iommu/dma-iommu: Use the dev->coherent_dma_mask

2020-07-10 Thread Christoph Hellwig
Btw, what is the current state of converting intel-iommu to the dma-iommu code? ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 01/10] block: introduce blk_is_valid_logical_block_size

2020-07-21 Thread Christoph Hellwig
> +/** > + * blk_check_logical_block_size - check if logical block size is supported > + * by the kernel > + * @size: the logical block size, in bytes > + * > + * Description: > + * This function checks if the block layers supports given block size > + **/ > +bool blk_is_valid_logical_block_size

Re: [PATCH 02/10] block: virtio-blk: check logical block size

2020-07-21 Thread Christoph Hellwig
On Tue, Jul 21, 2020 at 01:52:31PM +0300, Maxim Levitsky wrote: > Linux kernel only supports logical block sizes which are power of two, > at least 512 bytes and no more that PAGE_SIZE. > > Check this instead of crashing later on. > > Note that there is no need to check physical block size since

Re: [PATCH v9 01/84] signal: export kill_pid_info()

2020-07-21 Thread Christoph Hellwig
On Wed, Jul 22, 2020 at 12:07:59AM +0300, Adalbert Laz??r wrote: > From: Mathieu Tarral > > This function is used by VM introspection code to ungracefully shutdown > a guest at the request of the introspection tool. > > A security application will use this as the last resort to stop the > spread

Re: Is: virtio_gpu_object_shmem_init issues? Was:Re: upstream boot error: general protection fault in swiotlb_map

2020-08-24 Thread Christoph Hellwig
On Mon, Aug 24, 2020 at 11:06:51AM -0400, Konrad Rzeszutek Wilk wrote: > So it fails at > > 683 dev_WARN_ONCE(dev, 1, > > 684 "swiotlb addr %pad+%zu overflow (mask %llx, bus > limit %llx).\n", > 685

[PATCH 3/9] block: rename bd_invalidated

2020-09-01 Thread Christoph Hellwig
Replace bd_invalidate with a new BDEV_NEED_PART_SCAN flag in a bd_flags variable to better describe the condition. Signed-off-by: Christoph Hellwig --- block/genhd.c | 2 +- drivers/block/nbd.c | 8 fs/block_dev.c| 10 +- include/linux

[PATCH 1/9] Documentation/filesystems/locking.rst: remove an incorrect sentence

2020-09-01 Thread Christoph Hellwig
unlock_native_capacity is never called from check_disk_change(), and while revalidate_disk can be called from it, it can also be called from two other places at the moment. Signed-off-by: Christoph Hellwig --- Documentation/filesystems/locking.rst | 3 --- 1 file changed, 3 deletions(-) diff

[PATCH 4/9] block: add a new revalidate_disk_size helper

2020-09-01 Thread Christoph Hellwig
_size helper that just performs the update of the block device size from the gendisk one, and switch all drivers that do not implement ->revalidate_disk to use the new helper instead of revalidate_disk() Signed-off-by: Christoph Hellwig --- drivers/block/rbd.c | 2 +- drivers/block/r

[PATCH 7/9] sd: open code revalidate_disk

2020-09-01 Thread Christoph Hellwig
Instead of calling revalidate_disk just do the work directly by calling sd_revalidate_disk, and revalidate_disk_size where needed. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi

remove revalidate_disk()

2020-09-01 Thread Christoph Hellwig
Hi Jens, this series removes the revalidate_disk() function, which has been a really odd duck in the last years. The prime reason why most people use it is because it propagates a size change from the gendisk to the block_device structure. But it also calls into the rather ill defined ->revalida

[PATCH 5/9] block: use revalidate_disk_size in set_capacity_revalidate_and_notify

2020-09-01 Thread Christoph Hellwig
Only virtio_blk and xen-blkfront set the revalidate argument to true, and both do not implement the ->revalidate_disk method. So switch to the helper that just updates the size instead. Signed-off-by: Christoph Hellwig --- block/genhd.c | 7 +++ include/linux/genhd.h | 4 ++--

[PATCH 2/9] block: don't clear bd_invalidated in check_disk_size_change

2020-09-01 Thread Christoph Hellwig
bd_invalidated event. revalidate_disk() on the other hand is mostly used to propagate a size update from the gendisk to the block device, which is entirely unrelated. Signed-off-by: Christoph Hellwig --- fs/block_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs

[PATCH 6/9] nvme: opencode revalidate_disk in nvme_validate_ns

2020-09-01 Thread Christoph Hellwig
called from the open code when first opening the device. Which is of course totally pointless as we have a valid size since the initial scan, and will get an updated view through the asynchronous notifiation everytime the size changes. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.

[PATCH 9/9] block: remove revalidate_disk()

2020-09-01 Thread Christoph Hellwig
Remove the now unused helper. Signed-off-by: Christoph Hellwig --- drivers/md/md.h | 2 +- fs/block_dev.c| 19 --- include/linux/genhd.h | 1 - 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/md/md.h b/drivers/md/md.h index d9c4e6b7e9398d

[PATCH 8/9] nvdimm: simplify revalidate_disk handling

2020-09-01 Thread Christoph Hellwig
remove the revalidate_disk methods given that it can only be triggered from add_disk, which is right before the manual calls. Signed-off-by: Christoph Hellwig --- drivers/nvdimm/blk.c | 3 +-- drivers/nvdimm/btt.c | 3 +-- drivers/nvdimm/bus.c | 9 +++-- drivers/nvdimm/nd.h | 2 +- drivers

<    5   6   7   8   9   10