[PATCH 10/27] block: add a bdev_nonrot helper

2022-04-06 Thread Christoph Hellwig
Add a helper to check the nonrot flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig --- block/ioctl.c | 2 +- drivers/block/loop.c| 2 +- drivers/md/dm-table.c

[PATCH 11/27] block: add a bdev_write_cache helper

2022-04-06 Thread Christoph Hellwig
Add a helper to check the write cache flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig --- drivers/block/rnbd/rnbd-srv.c | 2 +- drivers/block/xen-blkback/xenbus.c | 2 +-

[PATCH 12/27] block: add a bdev_fua helper

2022-04-06 Thread Christoph Hellwig
Add a helper to check the FUA flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig --- drivers/block/rnbd/rnbd-srv.c | 3 +-- drivers/target/target_core_iblock.c | 3 +-- fs/iomap/direct-io.c

[PATCH 03/27] target: fix discard alignment on partitions

2022-04-06 Thread Christoph Hellwig
Use the proper bdev_discard_alignment helper that accounts for partition offsets. Fіxes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6") Signed-off-by: Christoph Hellwig --- drivers/target/target_core_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes

2022-04-06 Thread Christoph Hellwig
Use the bdev based limits helpers where they exist. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_main.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index

[PATCH 04/27] drbd: remove assign_p_sizes_qlim

2022-04-06 Thread Christoph Hellwig
Fold each branch into its only caller. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_main.c | 50 -- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index

[PATCH 14/27] block: add a bdev_max_zone_append_sectors helper

2022-04-06 Thread Christoph Hellwig
Add a helper to check the max supported sectors for zone append based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig --- drivers/nvme/target/zns.c | 3 +-- fs/zonefs/super.c | 3 +-- include/linux/blkdev.h|

[PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show

2022-04-06 Thread Christoph Hellwig
Replace the open coded offset calculation with the proper helper. This is an ABI change in that the -1 for a misaligned partition is properly propagated, which can be considered a bug fix and maches what is done on the whole device. Signed-off-by: Christoph Hellwig --- block/partitions/core.c |

[PATCH 09/27] mm: use bdev_is_zoned in claim_swapfile

2022-04-06 Thread Christoph Hellwig
Use the bdev based helper instead of poking into the queue. Signed-off-by: Christoph Hellwig --- mm/swapfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index 63c61f8b26118..4c7537162af5e 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@

[PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show

2022-04-06 Thread Christoph Hellwig
This does the same as the open coded variant except for an extra branch, and allows to remove queue_alignment_offset entirely. Signed-off-by: Christoph Hellwig --- block/genhd.c | 2 +- include/linux/blkdev.h | 8 2 files changed, 1 insertion(+), 9 deletions(-) diff --git

[PATCH 13/27] block: add a bdev_stable_writes helper

2022-04-06 Thread Christoph Hellwig
Add a helper to check the stable writes flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig --- drivers/md/dm-table.c | 4 +--- fs/super.c | 2 +- include/linux/blkdev.h | 6 ++ mm/swapfile.c

[PATCH 16/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset

2022-04-06 Thread Christoph Hellwig
The bdev version does the right thing for partitions, so use that. Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support") Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_main.c

[PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line

2022-04-06 Thread Christoph Hellwig
No need to inline these fairly larger helpers. Signed-off-by: Christoph Hellwig --- block/blk-settings.c | 23 +++ include/linux/blkdev.h | 21 + 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/block/blk-settings.c

[PATCH 19/27] block: remove queue_discard_alignment

2022-04-06 Thread Christoph Hellwig
Just use bdev_alignment_offset in disk_discard_alignment_show instead. That helpers is the same except for an always false branch that doesn't matter in this slow path. Signed-off-by: Christoph Hellwig --- block/genhd.c | 2 +- include/linux/blkdev.h | 8 2 files changed, 1

[PATCH 06/27] drbd: cleanup decide_on_discard_support

2022-04-06 Thread Christoph Hellwig
Sanitize the calling conventions and use a goto label to cleanup the code flow. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_nl.c | 68 +++- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/drivers/block/drbd/drbd_nl.c

[PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it

2022-04-06 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- fs/btrfs/zoned.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index b7b5fac1c7790..5b85004d85d6c 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -350,7 +350,6 @@ int

[PATCH 08/27] ntfs3: use bdev_logical_block_size instead of open coding it

2022-04-06 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- fs/ntfs3/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 278dcf5024102..cd30e81abbce0 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -920,7 +920,7 @@ static int

RE: [PATCH 3/5] iommu: Introduce the domain op enforce_cache_coherency()

2022-04-06 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, April 6, 2022 12:16 AM > > This new mechanism will replace using IOMMU_CAP_CACHE_COHERENCY > and > IOMMU_CACHE to control the no-snoop blocking behavior of the IOMMU. > > Currently only Intel and AMD IOMMUs are known to support this > feature. They

Re: [PATCH v3 0/4] Introduce akcipher service for virtio-crypto

2022-04-06 Thread Michael S. Tsirkin
On Tue, Apr 05, 2022 at 10:33:42AM +0200, Cornelia Huck wrote: > On Tue, Apr 05 2022, "Michael S. Tsirkin" wrote: > > > On Mon, Apr 04, 2022 at 05:39:24PM +0200, Cornelia Huck wrote: > >> On Mon, Mar 07 2022, "Michael S. Tsirkin" wrote: > >> > >> > On Mon, Mar 07, 2022 at 10:42:30AM +0800,

[PATCH 01/27] target: remove an incorrect unmap zeroes data deduction

2022-04-06 Thread Christoph Hellwig
For block devices the target code implements UNMAP as calls to blkdev_issue_discard, which does not guarantee zeroing just because Write Zeroes is supported. Note that this does not affect the file backed path which uses fallocate to punch holes. Fixes: 2237498f0b5c ("target/iblock: Convert

[PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue

2022-04-06 Thread Christoph Hellwig
The target code is a consumer of the block layer and should generally work on struct block_device. Signed-off-by: Christoph Hellwig --- drivers/target/target_core_device.c | 5 +++-- drivers/target/target_core_file.c| 7 --- drivers/target/target_core_iblock.c | 2 +-

use block_device based APIs in block layer consumers

2022-04-06 Thread Christoph Hellwig
Hi Jens, this series cleanups up the block layer API so that APIs consumed by file systems are (almost) only struct block_devic based, so that file systems don't have to poke into block layer internals like the request_queue. I also found a bunch of existing bugs related to partition offsets and

Re: [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show

2022-04-06 Thread Alan Robinson
Hi Christoph, On Wed, Apr 06, 2022 at 06:05:04AM +, Christoph Hellwig wrote: > From: Christoph Hellwig > Subject: [PATCH 15/27] block: use bdev_alignment_offset in > part_alignment_offset_show > > Replace the open coded offset calculation with the proper helper. > This is an ABI change in

[PATCH 23/27] block: add a bdev_max_discard_sectors helper

2022-04-06 Thread Christoph Hellwig
Add a helper to query the number of sectors support per each discard bio based on the block device and use this helper to stop various places from poking into the request_queue to see if discard is supported and if so how much. This mirrors what is done e.g. for write zeroes as well.

[PATCH 24/27] block: add a bdev_discard_granularity helper

2022-04-06 Thread Christoph Hellwig
Abstract away implementation details from file systems by providing a block_device based helper to retreive the discard granularity. Signed-off-by: Christoph Hellwig --- block/blk-lib.c | 5 ++--- drivers/block/drbd/drbd_nl.c| 9 +

[PATCH 25/27] block: remove QUEUE_FLAG_DISCARD

2022-04-06 Thread Christoph Hellwig
Just use a non-zero max_discard_sectors as an indicator for discard support, similar to what is done for write zeroes. The only places where needs special attention is the RAID5 driver, which must clear discard support for security reasons by default, even if the default stacking rules would

[PATCH 26/27] block: uncouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD

2022-04-06 Thread Christoph Hellwig
Secure erase is a very different operation from discard in that it is a data integrity operation vs hint. Fully split the limits and helper infrastructure to make the separation more clear. Signed-off-by: Christoph Hellwig --- block/blk-core.c| 2 +- block/blk-lib.c

[PATCH 21/27] block: move {bdev, queue_limit}_discard_alignment out of line

2022-04-06 Thread Christoph Hellwig
No need to inline these fairly larger helpers. Also fix the return value to be unsigned, just like the field in struct queue_limits. Signed-off-by: Christoph Hellwig --- block/blk-settings.c | 35 +++ include/linux/blkdev.h | 34

[PATCH 22/27] block: refactor discard bio size limiting

2022-04-06 Thread Christoph Hellwig
Move all the logic to limit the discard bio size into a common helper so that it is better documented. Signed-off-by: Christoph Hellwig --- block/blk-lib.c | 59 - block/blk.h | 14 2 files changed, 29 insertions(+), 44

[PATCH 27/27] direct-io: remove random prefetches

2022-04-06 Thread Christoph Hellwig
Randomly poking into block device internals for manual prefetches isn't exactly a very maintainable thing to do. And none of the performance criticil direct I/O implementations still use this library function anyway, so just drop it. Signed-off-by: Christoph Hellwig --- fs/direct-io.c | 32

[PATCH 20/27] block: use bdev_discard_alignment in part_discard_alignment_show

2022-04-06 Thread Christoph Hellwig
Use the bdev based alignment helper instead of open coding it. Signed-off-by: Christoph Hellwig --- block/partitions/core.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index 240b3fff521e4..70dec1c78521d 100644 ---

RE: [PATCH 0/5] Make the iommu driver no-snoop block feature consistent

2022-04-06 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, April 6, 2022 12:16 AM > > PCIe defines a 'no-snoop' bit in each the TLP which is usually implemented > by a platform as bypassing elements in the DMA coherent CPU cache > hierarchy. A driver can command a device to set this bit on some of its >

RE: [PATCH 2/5] vfio: Require that devices support DMA cache coherence

2022-04-06 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, April 6, 2022 3:29 AM > > On Tue, Apr 05, 2022 at 01:10:44PM -0600, Alex Williamson wrote: > > On Tue, 5 Apr 2022 13:16:01 -0300 > > Jason Gunthorpe wrote: > > > > > dev_is_dma_coherent() is the control to determine if IOMMU_CACHE can > be > > >

Re: [PATCH V2 0/5] rework on the IRQ hardening of virtio

2022-04-06 Thread Michael S. Tsirkin
On Wed, Apr 06, 2022 at 04:35:33PM +0800, Jason Wang wrote: > Hi All: > > This is a rework on the IRQ hardening for virtio which is done > previously by the following commits are reverted: > > 9e35276a5344 ("virtio_pci: harden MSI-X interrupts") > 080cd7c3ac87 ("virtio-pci: harden INTX

Re: [PATCH V2 4/5] virtio-pci: implement synchronize_vqs()

2022-04-06 Thread Michael S. Tsirkin
On Wed, Apr 06, 2022 at 04:35:37PM +0800, Jason Wang wrote: > This patch implements PCI version of synchronize_vqs(). > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Signed-off-by: Jason Wang Please add implementations at least for ccw and mmio. >

[PATCH V2 5/5] virtio: harden vring IRQ

2022-04-06 Thread Jason Wang
This is a rework on the previous IRQ hardening that is done for virtio-pci where several drawbacks were found and were reverted: 1) try to use IRQF_NO_AUTOEN which is not friendly to affinity managed IRQ that is used by some device such as virtio-blk 2) done only for PCI transport In this

[PATCH V2 2/5] virtio: use virtio_reset_device() when possible

2022-04-06 Thread Jason Wang
This allows us to do common extension without duplicating codes. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Signed-off-by: Jason Wang --- drivers/virtio/virtio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH V2 3/5] virtio: introduce config op to synchronize vring callbacks

2022-04-06 Thread Jason Wang
This patch introduce a new virtio config ops to vring callbacks. Transport specific method is required to call synchornize_irq() on the IRQs. For the transport that doesn't provide synchronize_vqs(), use synchornize_rcu() as a fallback. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E.

[PATCH V2 4/5] virtio-pci: implement synchronize_vqs()

2022-04-06 Thread Jason Wang
This patch implements PCI version of synchronize_vqs(). Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_common.c | 14 ++ drivers/virtio/virtio_pci_common.h | 2 ++

Re: [PATCH V2 1/5] virtio: use virtio_device_ready() in virtio_device_restore()

2022-04-06 Thread Michael S. Tsirkin
patch had wrong mime type. I managed to extra it but pls fix. > > > From: Stefano Garzarella > > It will allows us will allow us > to do extension on virtio_device_ready() without > duplicating codes. code > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc:

[PATCH V2 0/5] rework on the IRQ hardening of virtio

2022-04-06 Thread Jason Wang
Hi All: This is a rework on the IRQ hardening for virtio which is done previously by the following commits are reverted: 9e35276a5344 ("virtio_pci: harden MSI-X interrupts") 080cd7c3ac87 ("virtio-pci: harden INTX interrupts") The reason is that it depends on the IRQF_NO_AUTOEN which may

[PATCH V2 1/5] virtio: use virtio_device_ready() in virtio_device_restore()

2022-04-06 Thread Jason Wang
From: Stefano Garzarella It will allows us to do extension on virtio_device_ready() without duplicating codes. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Signed-off-by: Stefano Garzarella Signed-off-by: Jason Wang --- drivers/virtio/virtio.c | 5 +++--

Re: [PATCH RESEND V2 3/3] vdpa/mlx5: Use consistent RQT size

2022-04-06 Thread Jason Wang
在 2022/4/6 上午10:35, Jason Wang 写道: 在 2022/4/4 下午7:24, Michael S. Tsirkin 写道: On Mon, Apr 04, 2022 at 11:07:36AM +, Eli Cohen wrote: From: Michael S. Tsirkin Sent: Monday, April 4, 2022 1:35 PM To: Jason Wang Cc: Eli Cohen ; hdan...@sina.com; virtualization@lists.linux-foundation.org;

Re: [PATCH V2 3/5] virtio: introduce config op to synchronize vring callbacks

2022-04-06 Thread Michael S. Tsirkin
On Wed, Apr 06, 2022 at 04:35:36PM +0800, Jason Wang wrote: > This patch introduce introduces > a new new > virtio config ops to vring > callbacks. Transport specific method is required to call > synchornize_irq() on the IRQs. For the transport that doesn't provide > synchronize_vqs(), use

Re: [PATCH V2 2/5] virtio: use virtio_reset_device() when possible

2022-04-06 Thread Michael S. Tsirkin
On Wed, Apr 06, 2022 at 04:35:35PM +0800, Jason Wang wrote: > This allows us to do common extension without duplicating codes. codes -> code > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Signed-off-by: Jason Wang > --- > drivers/virtio/virtio.c |

Re: [PATCH V2 5/5] virtio: harden vring IRQ

2022-04-06 Thread Michael S. Tsirkin
On Wed, Apr 06, 2022 at 04:35:38PM +0800, Jason Wang wrote: > This is a rework on the previous IRQ hardening that is done for > virtio-pci where several drawbacks were found and were reverted: > > 1) try to use IRQF_NO_AUTOEN which is not friendly to affinity managed IRQ >that is used by some

Re: [PATCH 1/5] iommu: Replace uses of IOMMU_CAP_CACHE_COHERENCY with dev_is_dma_coherent()

2022-04-06 Thread Robin Murphy
On 2022-04-06 15:14, Jason Gunthorpe wrote: On Wed, Apr 06, 2022 at 03:51:50PM +0200, Christoph Hellwig wrote: On Wed, Apr 06, 2022 at 09:07:30AM -0300, Jason Gunthorpe wrote: Didn't see it I'll move dev_is_dma_coherent to device.h along with device_iommu_mapped() and others then No. It it

Re: [PATCH 1/5] iommu: Replace uses of IOMMU_CAP_CACHE_COHERENCY with dev_is_dma_coherent()

2022-04-06 Thread Christoph Hellwig
On Wed, Apr 06, 2022 at 09:07:30AM -0300, Jason Gunthorpe wrote: > Didn't see it > > I'll move dev_is_dma_coherent to device.h along with > device_iommu_mapped() and others then No. It it is internal for a reason. It also doesn't actually work outside of the dma core. E.g. for non-swiotlb ARM

Re: [PATCH 1/5] iommu: Replace uses of IOMMU_CAP_CACHE_COHERENCY with dev_is_dma_coherent()

2022-04-06 Thread Robin Murphy
On 2022-04-05 17:16, Jason Gunthorpe wrote: vdpa and usnic are trying to test if IOMMU_CACHE is supported. The correct way to do this is via dev_is_dma_coherent() Not necessarily... Disregarding the complete disaster of PCIe No Snoop on Arm-Based systems, there's the more interesting

Re: [PATCH 1/5] iommu: Replace uses of IOMMU_CAP_CACHE_COHERENCY with dev_is_dma_coherent()

2022-04-06 Thread Christoph Hellwig
On Wed, Apr 06, 2022 at 11:14:46AM -0300, Jason Gunthorpe wrote: > Really? It is the only condition that dma_info_to_prot() tests to > decide of IOMMU_CACHE is used or not, so you are saying that there is > a condition where a device can be attached to an iommu_domain and > dev_is_dma_coherent()

Re: [PATCH V2 4/5] virtio-pci: implement synchronize_vqs()

2022-04-06 Thread Michael S. Tsirkin
On Wed, Apr 06, 2022 at 03:04:32PM +0200, Cornelia Huck wrote: > On Wed, Apr 06 2022, "Michael S. Tsirkin" wrote: > > > On Wed, Apr 06, 2022 at 04:35:37PM +0800, Jason Wang wrote: > >> This patch implements PCI version of synchronize_vqs(). > >> > >> Cc: Thomas Gleixner > >> Cc: Peter Zijlstra

Re: [PATCH V2 4/5] virtio-pci: implement synchronize_vqs()

2022-04-06 Thread Cornelia Huck
On Wed, Apr 06 2022, "Michael S. Tsirkin" wrote: > On Wed, Apr 06, 2022 at 04:35:37PM +0800, Jason Wang wrote: >> This patch implements PCI version of synchronize_vqs(). >> >> Cc: Thomas Gleixner >> Cc: Peter Zijlstra >> Cc: "Paul E. McKenney" >> Cc: Marc Zyngier >> Signed-off-by: Jason

Re: [PATCH 1/5] iommu: Replace uses of IOMMU_CAP_CACHE_COHERENCY with dev_is_dma_coherent()

2022-04-06 Thread Christoph Hellwig
On Wed, Apr 06, 2022 at 12:18:23PM -0300, Jason Gunthorpe wrote: > > Oh, I didn't know about device_get_dma_attr().. Which is completely broken for any non-OF, non-ACPI plaform. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH 1/5] iommu: Replace uses of IOMMU_CAP_CACHE_COHERENCY with dev_is_dma_coherent()

2022-04-06 Thread Christoph Hellwig
On Wed, Apr 06, 2022 at 01:06:23PM -0300, Jason Gunthorpe wrote: > On Wed, Apr 06, 2022 at 05:50:56PM +0200, Christoph Hellwig wrote: > > On Wed, Apr 06, 2022 at 12:18:23PM -0300, Jason Gunthorpe wrote: > > > > Oh, I didn't know about device_get_dma_attr().. > > > > Which is completely broken for

[PATCH AUTOSEL 5.17 20/31] tools/virtio: compile with -pthread

2022-04-06 Thread Sasha Levin
From: "Michael S. Tsirkin" [ Upstream commit f03560a57c1f60db6ac23ffd9714e1c69e2f95c7 ] When using pthreads, one has to compile and link with -lpthread, otherwise e.g. glibc is not guaranteed to be reentrant. This replaces -lpthread. Reported-by: Matthew Wilcox Signed-off-by: Michael S.

[PATCH AUTOSEL 5.17 19/31] vhost_vdpa: don't setup irq offloading when irq_num < 0

2022-04-06 Thread Sasha Levin
From: Zhu Lingshan [ Upstream commit cce0ab2b2a39072d81f98017f7b076f3410ef740 ] When irq number is negative(e.g., -EINVAL), the virtqueue may be disabled or the virtqueues are sharing a device irq. In such case, we should not setup irq offloading for a virtqueue. Signed-off-by: Zhu Lingshan

[PATCH AUTOSEL 5.16 19/30] vhost_vdpa: don't setup irq offloading when irq_num < 0

2022-04-06 Thread Sasha Levin
From: Zhu Lingshan [ Upstream commit cce0ab2b2a39072d81f98017f7b076f3410ef740 ] When irq number is negative(e.g., -EINVAL), the virtqueue may be disabled or the virtqueues are sharing a device irq. In such case, we should not setup irq offloading for a virtqueue. Signed-off-by: Zhu Lingshan

[PATCH AUTOSEL 5.16 20/30] tools/virtio: compile with -pthread

2022-04-06 Thread Sasha Levin
From: "Michael S. Tsirkin" [ Upstream commit f03560a57c1f60db6ac23ffd9714e1c69e2f95c7 ] When using pthreads, one has to compile and link with -lpthread, otherwise e.g. glibc is not guaranteed to be reentrant. This replaces -lpthread. Reported-by: Matthew Wilcox Signed-off-by: Michael S.

[PATCH AUTOSEL 5.15 17/27] tools/virtio: compile with -pthread

2022-04-06 Thread Sasha Levin
From: "Michael S. Tsirkin" [ Upstream commit f03560a57c1f60db6ac23ffd9714e1c69e2f95c7 ] When using pthreads, one has to compile and link with -lpthread, otherwise e.g. glibc is not guaranteed to be reentrant. This replaces -lpthread. Reported-by: Matthew Wilcox Signed-off-by: Michael S.

[PATCH AUTOSEL 5.15 16/27] vhost_vdpa: don't setup irq offloading when irq_num < 0

2022-04-06 Thread Sasha Levin
From: Zhu Lingshan [ Upstream commit cce0ab2b2a39072d81f98017f7b076f3410ef740 ] When irq number is negative(e.g., -EINVAL), the virtqueue may be disabled or the virtqueues are sharing a device irq. In such case, we should not setup irq offloading for a virtqueue. Signed-off-by: Zhu Lingshan

[PATCH AUTOSEL 5.10 15/25] vhost_vdpa: don't setup irq offloading when irq_num < 0

2022-04-06 Thread Sasha Levin
From: Zhu Lingshan [ Upstream commit cce0ab2b2a39072d81f98017f7b076f3410ef740 ] When irq number is negative(e.g., -EINVAL), the virtqueue may be disabled or the virtqueues are sharing a device irq. In such case, we should not setup irq offloading for a virtqueue. Signed-off-by: Zhu Lingshan

[PATCH AUTOSEL 5.10 16/25] tools/virtio: compile with -pthread

2022-04-06 Thread Sasha Levin
From: "Michael S. Tsirkin" [ Upstream commit f03560a57c1f60db6ac23ffd9714e1c69e2f95c7 ] When using pthreads, one has to compile and link with -lpthread, otherwise e.g. glibc is not guaranteed to be reentrant. This replaces -lpthread. Reported-by: Matthew Wilcox Signed-off-by: Michael S.

Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction

2022-04-06 Thread Martin K. Petersen
Christoph, > For block devices the target code implements UNMAP as calls to > blkdev_issue_discard, which does not guarantee zeroing just because > Write Zeroes is supported. > > Note that this does not affect the file backed path which uses > fallocate to punch holes. Reviewed-by: Martin K.

Re: [Ocfs2-devel] [PATCH 12/27] block: add a bdev_fua helper

2022-04-06 Thread Martin K. Petersen
Christoph, > Add a helper to check the FUA flag based on the block_device instead > of having to poke into the block layer internal request_queue. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering ___

Re: [Ocfs2-devel] [PATCH 11/27] block: add a bdev_write_cache helper

2022-04-06 Thread Martin K. Petersen
Christoph, > Add a helper to check the write cache flag based on the block_device > instead of having to poke into the block layer internal request_queue. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering ___

Re: [dm-devel] [PATCH 03/27] target: fix discard alignment on partitions

2022-04-06 Thread Martin K. Petersen
Christoph, > Use the proper bdev_discard_alignment helper that accounts for partition > offsets. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering ___ Virtualization mailing list

Re: [Ocfs2-devel] [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show

2022-04-06 Thread Martin K. Petersen
Christoph, > Replace the open coded offset calculation with the proper helper. > This is an ABI change in that the -1 for a misaligned partition is > properly propagated, which can be considered a bug fix and maches what > is done on the whole device. Looks good. Reviewed-by: Martin K.

Re: [Ocfs2-devel] [PATCH 21/27] block: move {bdev, queue_limit}_discard_alignment out of line

2022-04-06 Thread Martin K. Petersen
Christoph, > No need to inline these fairly larger helpers. Also fix the return > value to be unsigned, just like the field in struct queue_limits. I believe the original reason for the signed int here was to be able to express -1 for sysfs. I am not sure why I didn't just use the misaligned

Re: [Ocfs2-devel] [PATCH 24/27] block: add a bdev_discard_granularity helper

2022-04-06 Thread Martin K. Petersen
Christoph, > Abstract away implementation details from file systems by providing a > block_device based helper to retreive the discard granularity. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering ___

Re: [Ocfs2-devel] [PATCH 23/27] block: add a bdev_max_discard_sectors helper

2022-04-06 Thread Martin K. Petersen
Christoph, > Add a helper to query the number of sectors support per each discard > bio based on the block device and use this helper to stop various > places from poking into the request_queue to see if discard is > supported and if so how much. This mirrors what is done e.g. for > write

Re: [Ocfs2-devel] [PATCH 26/27] block: uncouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD

2022-04-06 Thread Martin K. Petersen
Christoph, > Secure erase is a very different operation from discard in that it is > a data integrity operation vs hint. Fully split the limits and helper > infrastructure to make the separation more clear. Great! Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux

Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction

2022-04-06 Thread Martin K. Petersen
Christoph, > For block devices the target code implements UNMAP as calls to > blkdev_issue_discard, which does not guarantee zeroing just because > Write Zeroes is supported. > > Note that this does not affect the file backed path which uses > fallocate to punch holes. > > Fixes: 2237498f0b5c

Re: [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue

2022-04-06 Thread Martin K. Petersen
Christoph, > The target code is a consumer of the block layer and should generally > work on struct block_device. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering ___ Virtualization mailing list

Re: [dm-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper

2022-04-06 Thread Martin K. Petersen
Christoph, > Add a helper to check the max supported sectors for zone append based > on the block_device instead of having to poke into the block layer > internal request_queue. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering

Re: [Ocfs2-devel] [PATCH 13/27] block: add a bdev_stable_writes helper

2022-04-06 Thread Martin K. Petersen
Christoph, > Add a helper to check the stable writes flag based on the block_device > instead of having to poke into the block layer internal request_queue. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering ___

Re: [Ocfs2-devel] [PATCH 10/27] block: add a bdev_nonrot helper

2022-04-06 Thread Martin K. Petersen
Christoph, > Add a helper to check the nonrot flag based on the block_device > instead of having to poke into the block layer internal request_queue. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering ___

Re: [Ocfs2-devel] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show

2022-04-06 Thread Martin K. Petersen
Christoph, > This does the same as the open coded variant except for an extra > branch, and allows to remove queue_alignment_offset entirely. Also fine. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering ___

Re: [Ocfs2-devel] [PATCH 19/27] block: remove queue_discard_alignment

2022-04-06 Thread Martin K. Petersen
Christoph, > Just use bdev_alignment_offset in disk_discard_alignment_show instead. > That helpers is the same except for an always false branch that > doesn't matter in this slow path. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering

Re: [Ocfs2-devel] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line

2022-04-06 Thread Martin K. Petersen
Christoph, > No need to inline these fairly larger helpers. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [Ocfs2-devel] [PATCH 20/27] block: use bdev_discard_alignment in part_discard_alignment_show

2022-04-06 Thread Martin K. Petersen
Christoph, > Use the bdev based alignment helper instead of open coding it. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [Ocfs2-devel] [PATCH 22/27] block: refactor discard bio size limiting

2022-04-06 Thread Martin K. Petersen
Christoph, > Move all the logic to limit the discard bio size into a common helper > so that it is better documented. Looks OK. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering ___ Virtualization mailing list

Re: [Ocfs2-devel] [PATCH 25/27] block: remove QUEUE_FLAG_DISCARD

2022-04-06 Thread Martin K. Petersen
Christoph, > Just use a non-zero max_discard_sectors as an indicator for discard > support, similar to what is done for write zeroes. Very happy to finally see this flag removed! Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering