Re: [kvm-devel] [RFC/PATCH 14/15] guest: detect when running on kvm

2008-03-20 Thread Christoph Hellwig
On Thu, Mar 20, 2008 at 05:25:26PM +0100, Carsten Otte wrote: > @@ -143,6 +143,10 @@ static noinline __init void detect_machi > /* Running on a P/390 ? */ > if (cpuinfo->cpu_id.machine == 0x7490) > machine_flags |= 4; > + > + /* Running under KVM ? */ > + if (cpuin

Re: [kvm-devel] [RFC/PATCH 14/15] guest: detect when running on kvm

2008-03-20 Thread Christoph Hellwig
On Thu, Mar 20, 2008 at 09:37:19PM +0100, Carsten Otte wrote: > Christoph Hellwig wrote: >> On Thu, Mar 20, 2008 at 05:25:26PM +0100, Carsten Otte wrote: >>> @@ -143,6 +143,10 @@ static noinline __init void detect_machi >>> /* Running on a P/390 ? */ >>

Re: [dm-devel] [PATCH] block: silently error unsupported empty barriers too

2009-08-06 Thread Christoph Hellwig
On Thu, Aug 06, 2009 at 12:45:50PM +0100, Alasdair G Kergon wrote: > On Thu, Aug 06, 2009 at 12:14:17PM +0100, Mark McLoughlin wrote: > > We should error all barriers, even empty barriers, on devices like > > virtio_blk which don't support them. > > Have you considered whether or not virtio_blk a

Re: [patch 00/26] Xen-paravirt_ops: Xen guest implementation for paravirt_ops interface

2007-03-16 Thread Christoph Hellwig
On Fri, Mar 16, 2007 at 10:26:55AM -0700, Jeremy Fitzhardinge wrote: > +#ifdef CONFIG_HIGHPTE > + .kmap_atomic_pte = native_kmap_atomic_pte, > +#else > + .kmap_atomic_pte = paravirt_nop, > +#endif This is ifdefing is quite ugly. Shouldn't native_kmap_atomic_pte just be a noop in the !CONF

Re: [patch 27/32] xen: Add the Xen virtual network device driver.

2007-04-29 Thread Christoph Hellwig
On Sun, Apr 29, 2007 at 10:29:02AM -0700, Jeremy Fitzhardinge wrote: > +#include not needed. > +#include > +#include > +#include > +#ifdef CONFIG_XEN_BALLOON > +#include > +#endif > +#include Please don't try to put such a fucked up include hierachy in. Just move everything under include/x

Re: [patch 26/32] xen: Add Xen virtual block device driver.

2007-04-29 Thread Christoph Hellwig
> source "drivers/s390/block/Kconfig" > +source "drivers/block/xen/Kconfig" Please don't add a new subdirectory for a tiny new driver that really should be only a single .c file. > +config XEN_BLKDEV_FRONTEND > + tristate "Block device frontend driver" > + depends on XEN > + default

Re: [patch 25/29] xen: Add the Xen virtual network device driver.

2007-05-05 Thread Christoph Hellwig
On Fri, May 04, 2007 at 04:21:16PM -0700, Jeremy Fitzhardinge wrote: > +/* > + * Mutually-exclusive module options to select receive data path: > + * rx_copy : Packets are copied by network backend into local memory > + * rx_flip : Page containing packet data is transferred to our ownership > + *

Re: [patch 7/9] lguest: the net driver

2007-05-09 Thread Christoph Hellwig
On Thu, May 10, 2007 at 01:14:55AM +1000, Rusty Russell wrote: > > > + info->peer = (void *)ioremap(info->peer_phys, info->mapsize); > > > > check for NULL > > Erk, good catch! Also the cast is bogus. ioremap already returns void already. Even more importantly the lack of the __iomem annotatio

Re: [PATCH 0/5] lguest feedback tidyups

2007-05-10 Thread Christoph Hellwig
On Fri, May 11, 2007 at 11:17:26AM +1000, Rusty Russell wrote: > - But the cost was high: lots of __force casts 8( That sounds like something is very fishy. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linu

Re: [PATCH 2/5] lguest guest feedback tidyups

2007-05-10 Thread Christoph Hellwig
On Fri, May 11, 2007 at 11:21:30AM +1000, Rusty Russell wrote: > 1) send-dma and bind-dma hypercall wrappers for drivers to use, > 2) formalization of the convention that devices can use the irq >corresponding to their index on the lguest_bus. > 3) ___force to shut up sparse: guests *can* use i

Re: [PATCH 2/5] lguest guest feedback tidyups

2007-05-11 Thread Christoph Hellwig
On Fri, May 11, 2007 at 05:31:06PM +1000, Rusty Russell wrote: > Well, without ioremap, the memory wouldn't normally be mapped. Is > there something better to use? Either use accessors or use your own lguest-specific remapping function that doesn't return __iomem function > > So instead of

Re: [kvm-devel] [PATCH RFC 2/3] Virtio draft III: example net driver

2007-06-25 Thread Christoph Hellwig
On Mon, Jun 25, 2007 at 10:26:37AM -0500, Brian King wrote: > 1. The add_inbuf interface passes an sg list. This causes problems for >ibmveth since its rx buffers cannot be scatterlists. > 2. The user of this API does not have access to the sk_buf. This causes >issues for ibmveth since it n

Re: [PATCH vhost v8 01/12] virtio_ring: split: separate dma codes

2023-05-12 Thread Christoph Hellwig
As said before, please don't try to do weird runtime checks based on the scatterlist. What you have works for now, but there are plans to repalce the page + offset tuple in the scatterlist with just a phys_addr_t. And with that your "clever" scheme will break instantly. __

Re: [PATCH v5 5/6] mm/gup: remove vmas parameter from pin_user_pages()

2023-05-15 Thread Christoph Hellwig
ameter from GUP altogether. > > Acked-by: David Hildenbrand > Acked-by: Dennis Dalessandro (for > qib) > Signed-off-by: Lorenzo Stoakes Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@li

Re: [PATCH v2 1/2] virtio: abstract virtqueue related methods

2023-05-17 Thread Christoph Hellwig
On Wed, May 17, 2023 at 10:54:23AM +0800, zhenwei pi wrote: > All the vring based virtqueue methods could be abstratct in theory, > MST suggested that add/get bufs and kick functions are quite perfmance > sensitive, so export these functions from virtio_ring.ko, drivers > still call them in a fast

Re: [PATCH v2 1/2] virtio: abstract virtqueue related methods

2023-05-17 Thread Christoph Hellwig
On Wed, May 17, 2023 at 03:43:03PM +0800, zhenwei pi wrote: > I have a plan to introduce 'Virtio Over Fabrics'(TCP&RDMA) as Virtio > transport, as mentioned in cover letter of this series: > 3 weeks ago, I posted a proposal 'Virtio Over Fabrics': > https://lists.oasis-open.org/archives/virtio-comme

Re: [PATCH vhost v9 01/12] virtio_ring: put mapping error check in vring_map_one_sg

2023-05-22 Thread Christoph Hellwig
On Wed, May 17, 2023 at 10:22:38AM +0800, Xuan Zhuo wrote: > -static dma_addr_t vring_map_one_sg(const struct vring_virtqueue *vq, > -struct scatterlist *sg, > -enum dma_data_direction direction) > +static int vring_map_one_sg(const st

Re: [PATCH vhost v9 04/12] virtio_ring: virtqueue_add() support premapped

2023-05-22 Thread Christoph Hellwig
On Wed, May 17, 2023 at 10:22:41AM +0800, Xuan Zhuo wrote: > virtuque_add() adds parameter premapped. Well, I can see that. But why? ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/lis

Re: [PATCH vhost v10 00/10] virtio core prepares for AF_XDP

2023-06-07 Thread Christoph Hellwig
On Mon, Jun 05, 2023 at 09:58:21AM +0800, Xuan Zhuo wrote: > On Fri, 2 Jun 2023 23:29:02 -0700, Jakub Kicinski wrote: > > On Fri, 2 Jun 2023 17:21:56 +0800 Xuan Zhuo wrote: > > > Thanks for the help from Christoph. > > > > That said you haven't CCed him on the series, isn't the general rule to >

Re: [PATCH] virtio_pmem: do flush synchronously

2023-06-21 Thread Christoph Hellwig
I think the proper minimal fix is to pass in a REQ_WRITE in addition to REQ_PREFLUSH. We can than have a discussion on the merits of this weird async pmem flush scheme separately. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH v2] virtio_pmem: add the missing REQ_OP_WRITE for flush bio

2023-06-21 Thread Christoph Hellwig
Please avoid the overly long line. With that fixe this looks good to me. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v3] virtio_pmem: add the missing REQ_OP_WRITE for flush bio

2023-06-26 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] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-07-12 Thread Christoph Hellwig
On Wed, Jul 12, 2023 at 10:28:00AM +0200, Stefano Garzarella wrote: > The problem is that the SCSI stack does not send this command, so we > should do it in the driver. In fact we do it for > VIRTIO_SCSI_EVT_RESET_RESCAN (hotplug), but not for > VIRTIO_SCSI_EVT_RESET_REMOVED (hotunplug). No, you s

Re: [PATCH vhost v11 03/10] virtio_ring: introduce virtqueue_set_premapped()

2023-07-13 Thread Christoph Hellwig
On Mon, Jul 10, 2023 at 11:42:30AM +0800, Xuan Zhuo wrote: > This helper allows the driver change the dma mode to premapped mode. > Under the premapped mode, the virtio core do not do dma mapping > internally. > > This just work when the use_dma_api is true. If the use_dma_api is false, > the dma

Re: [PATCH vhost v11 05/10] virtio_ring: introduce virtqueue_dma_dev()

2023-07-13 Thread Christoph Hellwig
On Mon, Jul 10, 2023 at 11:42:32AM +0800, Xuan Zhuo wrote: > Added virtqueue_dma_dev() to get DMA device for virtio. Then the > caller can do dma operation in advance. The purpose is to keep memory > mapped across multiple add/get buf operations. This is just poking holes into the abstraction.. _

Re: [PATCH vhost v11 03/10] virtio_ring: introduce virtqueue_set_premapped()

2023-07-19 Thread Christoph Hellwig
On Thu, Jul 13, 2023 at 10:47:23AM -0400, Michael S. Tsirkin wrote: > There are a gazillion virtio drivers and most of them just use the > virtio API, without bothering with these micro-optimizations. virtio > already tracks addresses so mapping/unmapping them for DMA is easier > done in the core.

Re: [PATCH vhost v11 10/10] virtio_net: merge dma operation for one page

2023-07-19 Thread Christoph Hellwig
Hi Jason, can you please resend your reply with proper quoting? I had to give up after multiple pages of scrolling without finding anything that you added to the full quote. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org http

Re: [PATCH vhost v11 05/10] virtio_ring: introduce virtqueue_dma_dev()

2023-07-19 Thread Christoph Hellwig
On Thu, Jul 13, 2023 at 10:51:59AM -0400, Michael S. Tsirkin wrote: > On Thu, Jul 13, 2023 at 04:15:16AM -0700, Christoph Hellwig wrote: > > On Mon, Jul 10, 2023 at 11:42:32AM +0800, Xuan Zhuo wrote: > > > Added virtqueue_dma_dev() to get DMA device for virtio. Then the >

Re: [PATCH vhost v11 05/10] virtio_ring: introduce virtqueue_dma_dev()

2023-07-19 Thread Christoph Hellwig
On Thu, Jul 20, 2023 at 02:45:14PM +0800, Xuan Zhuo wrote: > virtqueue_dma_dev() return the device that working with the DMA APIs. > Then that can be used like other devices. So what is the problem. > > I always think the code path without the DMA APIs is the trouble for you. Because we now ha

Re: [PATCH vhost v11 10/10] virtio_net: merge dma operation for one page

2023-07-20 Thread Christoph Hellwig
On Thu, Jul 20, 2023 at 03:41:56PM +0800, Jason Wang wrote: > > Did you actually check that it works though? > > Looks like with swiotlb you need to synch to trigger a copy > > before unmap, and I don't see where it's done in the current > > patch. > > And this is needed for XDP_REDIRECT as well.

Re: [PATCH vhost v11 05/10] virtio_ring: introduce virtqueue_dma_dev()

2023-07-24 Thread Christoph Hellwig
On Thu, Jul 20, 2023 at 01:21:07PM -0400, Michael S. Tsirkin wrote: > Well I think we can add wrappers like virtio_dma_sync and so on. > There are NOP for non-dma so passing the dma device is harmless. Yes, please. ___ Virtualization mailing list Virtual

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-01 Thread Christoph Hellwig
On Tue, Sep 26, 2023 at 07:41:44AM -0400, Michael S. Tsirkin wrote: > > Except, there's no reasonable way for virtio to know what is done with > the device then. You are not using just 2 symbols at all, instead you > are using the rich vq API which was explicitly designed for the driver > running

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-05 Thread Christoph Hellwig
On Mon, Oct 02, 2023 at 12:13:20PM -0300, Jason Gunthorpe wrote: > ??? This patch series is an implementation of changes that OASIS > approved. I think you are fundamentally missing my point. This is not about who publish a spec, but how we struture Linux code. And the problem is that we trea vf

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-06 Thread Christoph Hellwig
On Thu, Oct 05, 2023 at 08:10:04AM -0300, Jason Gunthorpe wrote: > > But for all the augmented vfio use cases it doesn't, for them the > > augmented vfio functionality is an integral part of the core driver. > > That is true for nvme, virtio and I'd argue mlx5 as well. > > I don't agree with this.

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-10 Thread Christoph Hellwig
On Tue, Oct 10, 2023 at 06:43:32PM +0300, Yishai Hadas wrote: > > I suggest 3 but call it on the VF. commands will switch to PF > > internally as needed. For example, intel might be interested in exposing > > admin commands through a memory BAR of VF itself. > > > The driver who owns the VF is VFI

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-10 Thread Christoph Hellwig
On Tue, Oct 10, 2023 at 12:59:37PM -0300, Jason Gunthorpe wrote: > On Tue, Oct 10, 2023 at 11:14:56AM -0400, Michael S. Tsirkin wrote: > > > I suggest 3 but call it on the VF. commands will switch to PF > > internally as needed. For example, intel might be interested in exposing > > admin commands

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-10 Thread Christoph Hellwig
On Tue, Oct 10, 2023 at 10:10:31AM -0300, Jason Gunthorpe wrote: > We've talked around ideas like allowing the VF config space to do some > of the work. For simple devices we could get away with 1 VF config > space register. (VF config space is owned by the hypervisor, not the > guest) Which assum

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-10 Thread Christoph Hellwig
On Wed, Oct 11, 2023 at 02:43:37AM -0400, Michael S. Tsirkin wrote: > > Btw, what is that intel thing everyone is talking about? And why > > would the virtio core support vendor specific behavior like that? > > It's not a thing it's Zhu Lingshan :) intel is just one of the vendors > that implemen

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-11 Thread Christoph Hellwig
On Wed, Oct 11, 2023 at 10:57:09AM -0300, Jason Gunthorpe wrote: > > Independent of my above points on the doubts on VF-controlled live > > migration for PCe device I absolutely agree with your that the Linux > > abstraction and user interface should be VF based. Which further > > reinforeces my p

Re: [PATCH RFC 01/17] iommu: Remove struct iommu_ops *iommu from arch_setup_dma_ops()

2023-11-05 Thread Christoph Hellwig
eed to check it and remove the iommu parameter everywhere. Yes, that's much better than exposing the iommu ops to a place that should not care about them: Acked-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-fou

Re: [PATCH v5 12/16] PCI: Add pci_iomap_host_shared(), pci_iomap_host_shared_range()

2021-10-11 Thread Christoph Hellwig
Just as last time: This does not make any sense. ioremap is shared by definition. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

2021-10-11 Thread Christoph Hellwig
On Tue, Oct 05, 2021 at 06:42:43AM -0400, Michael S. Tsirkin wrote: > Stefan also pointed out this duplicates the logic from > > if (blksize < 512 || blksize > PAGE_SIZE || !is_power_of_2(blksize)) > return -EINVAL; > > > and a bunch of other places. > > > Would it be

Re: [PATCH v5 12/16] PCI: Add pci_iomap_host_shared(), pci_iomap_host_shared_range()

2021-10-11 Thread Christoph Hellwig
On Mon, Oct 11, 2021 at 03:09:09PM -0400, Michael S. Tsirkin wrote: > The reason we have trouble is that it's not clear what does the API mean > outside the realm of TDX. > If we really, truly want an API that says "ioremap and it's a hardened > driver" then I guess ioremap_hardened_driver is what

Re: [PATCH V4 0/8] Use copy_process/create_io_thread in vhost layer

2021-10-11 Thread Christoph Hellwig
The whole series looks good to me: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH 02/11] dax: remove CONFIG_DAX_DRIVER

2021-10-17 Thread Christoph Hellwig
CONFIG_DAX_DRIVER only selects CONFIG_DAX now, so remove it. Signed-off-by: Christoph Hellwig --- drivers/dax/Kconfig| 4 drivers/nvdimm/Kconfig | 2 +- drivers/s390/block/Kconfig | 2 +- fs/fuse/Kconfig| 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff

futher decouple DAX from block devices

2021-10-17 Thread Christoph Hellwig
Hi Dan, this series cleans up and simplifies the association between DAX and block devices in preparation of allowing to mount file systems directly on DAX devices without a detour through block devices. Diffstat: drivers/dax/Kconfig |4 drivers/dax/bus.c|2 driver

[PATCH 01/11] dm: make the DAX support dependend on CONFIG_FS_DAX

2021-10-17 Thread Christoph Hellwig
The device mapper DAX support is all hanging off a block device and thus can't be used with device dax. Make it depend on CONFIG_FS_DAX instead of CONFIG_DAX_DRIVER. This also means that bdev_dax_pgoff only needs to be built under CONFIG_FS_DAX now. Signed-off-by: Christoph He

[PATCH 04/11] dax: remove the pgmap sanity checks in generic_fsdax_supported

2021-10-17 Thread Christoph Hellwig
Drivers that register a dax_dev should make sure it works, no need to double check from the file system. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 49 + 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/drivers/dax/super.c

[PATCH 05/11] dax: move the partition alignment check into fs_dax_get_by_bdev

2021-10-17 Thread Christoph Hellwig
fs_dax_get_by_bdev is the primary interface to find a dax device for a block device, so move the partition alignment check there instead of wiring it up through ->dax_supported. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 23 ++- 1 file changed, 6 inserti

[PATCH 03/11] dax: simplify the dax_device <-> gendisk association

2021-10-17 Thread Christoph Hellwig
Replace the dax_host_hash with an xarray indexed by the pointer value of the gendisk, and require explicitl calls from the block drivers that want to associate their gendisk with a dax_device. Signed-off-by: Christoph Hellwig --- drivers/dax/bus.c| 2 +- drivers/dax/super.c

[PATCH 08/11] dm-linear: add a linear_dax_pgoff helper

2021-10-17 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig --- drivers/md/dm-linear.c

[PATCH 07/11] dax: remove dax_capable

2021-10-17 Thread Christoph Hellwig
Just open code the block size and dax_dev == NULL checks in the callers. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 36 drivers/md/dm-table.c| 22 +++--- drivers/md/dm.c | 21

[PATCH 06/11] xfs: factor out a xfs_setup_dax helper

2021-10-17 Thread Christoph Hellwig
Factor out another DAX setup helper to simplify future changes. Also move the experimental warning after the checks to not clutter the log too much if the setup failed. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_super.c | 47 +++--- 1 file changed

[PATCH 09/11] dm-log-writes: add a log_writes_dax_pgoff helper

2021-10-17 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig --- drivers/md/dm-log-writes.c

[PATCH 10/11] dm-stripe: add a stripe_dax_pgoff helper

2021-10-17 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig --- drivers/md/dm-stripe.c

[PATCH 11/11] dax: move bdev_dax_pgoff to fs/dax.c

2021-10-17 Thread Christoph Hellwig
No functional changet, but this will allow for a tighter integration with the iomap code, including possible passing the partition offset in the iomap in the future. For now it mostly avoids growing more callers outside of fs/dax.c. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 14

Re: [PATCH 06/11] xfs: factor out a xfs_setup_dax helper

2021-10-19 Thread Christoph Hellwig
On Mon, Oct 18, 2021 at 09:43:51AM -0700, Darrick J. Wong wrote: > > --- a/fs/xfs/xfs_super.c > > +++ b/fs/xfs/xfs_super.c > > @@ -339,6 +339,32 @@ xfs_buftarg_is_dax( > > bdev_nr_sectors(bt->bt_bdev)); > > } > > > > +static int > > +xfs_setup_dax( > > /me wonders if this sh

Re: [PATCH] virtio_blk: corrent types for status handling

2021-10-25 Thread Christoph Hellwig
On Mon, Oct 25, 2021 at 11:24:57AM +0300, Max Gurtovoy wrote: > Maybe we can compare the returned status to BLK_STS_OK. But I see we don't > do it also in NVMe subsystem so I guess we can assume BLK_STS_OK == 0 > forever. Jes, BLK_STS_OK == 0 is an intentional allowed short cut. It is not just

Re: futher decouple DAX from block devices

2021-11-04 Thread Christoph Hellwig
On Wed, Nov 03, 2021 at 12:59:31PM -0500, Eric Sandeen wrote: > Christoph, can I ask what the end game looks like, here? If dax is completely > decoupled from block devices, are there user-visible changes? Yes. > If I want to > run fs-dax on a pmem device - what do I point mkfs at, if not a block

Re: futher decouple DAX from block devices

2021-11-04 Thread Christoph Hellwig
On Thu, Nov 04, 2021 at 10:34:17AM -0700, Darrick J. Wong wrote: > /me wonders, are block devices going away? Will mkfs.xfs have to learn > how to talk to certain chardevs? I guess jffs2 and others already do > that kind of thing... but I suppose I can wait for the real draft to > show up to ramb

decouple DAX from block devices

2021-11-09 Thread Christoph Hellwig
Hi Dan, this series decouples the DAX from the block layer so that the block_device is not needed at all for the DAX I/O path. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/vi

[PATCH 02/29] dm: make the DAX support dependend on CONFIG_FS_DAX

2021-11-09 Thread Christoph Hellwig
The device mapper DAX support is all hanging off a block device and thus can't be used with device dax. Make it depend on CONFIG_FS_DAX instead of CONFIG_DAX_DRIVER. This also means that bdev_dax_pgoff only needs to be built under CONFIG_FS_DAX now. Signed-off-by: Christoph He

[PATCH 05/29] dax: remove the pgmap sanity checks in generic_fsdax_supported

2021-11-09 Thread Christoph Hellwig
Drivers that register a dax_dev should make sure it works, no need to double check from the file system. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 49 + 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/drivers/dax/super.c

[PATCH 03/29] dax: remove CONFIG_DAX_DRIVER

2021-11-09 Thread Christoph Hellwig
CONFIG_DAX_DRIVER only selects CONFIG_DAX now, so remove it. Signed-off-by: Christoph Hellwig --- drivers/dax/Kconfig| 4 drivers/nvdimm/Kconfig | 2 +- drivers/s390/block/Kconfig | 2 +- fs/fuse/Kconfig| 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff

[PATCH 01/29] nvdimm/pmem: move dax_attribute_group from dax to pmem

2021-11-09 Thread Christoph Hellwig
dax_attribute_group is only used by the pmem driver, and can avoid the completely pointless lookup by the disk name if moved there. This leaves just a single caller of dax_get_by_host, so move dax_get_by_host into the same ifdef block as that caller. Signed-off-by: Christoph Hellwig Reviewed-by

[PATCH 06/29] dax: move the partition alignment check into fs_dax_get_by_bdev

2021-11-09 Thread Christoph Hellwig
fs_dax_get_by_bdev is the primary interface to find a dax device for a block device, so move the partition alignment check there instead of wiring it up through ->dax_supported. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 23 ++- 1 file changed, 6 inserti

[PATCH 07/29] xfs: factor out a xfs_setup_dax_always helper

2021-11-09 Thread Christoph Hellwig
Factor out another DAX setup helper to simplify future changes. Also move the experimental warning after the checks to not clutter the log too much if the setup failed. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_super.c | 47 +++--- 1 file changed

[PATCH 04/29] dax: simplify the dax_device <-> gendisk association

2021-11-09 Thread Christoph Hellwig
Replace the dax_host_hash with an xarray indexed by the pointer value of the gendisk, and require explicitly calls from the block drivers that want to associate their gendisk with a dax_device. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/dax/bus.c| 6

[PATCH 09/29] dm-linear: add a linear_dax_pgoff helper

2021-11-09 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/

[PATCH 13/29] fsdax: use a saner calling convention for copy_cow_page_dax

2021-11-09 Thread Christoph Hellwig
Just pass the vm_fault and iomap_iter structures, and figure out the rest locally. Note that this requires moving dax_iomap_sector up in the file. Signed-off-by: Christoph Hellwig --- fs/dax.c | 29 + 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a

[PATCH 08/29] dax: remove dax_capable

2021-11-09 Thread Christoph Hellwig
Just open code the block size and dax_dev == NULL checks in the callers. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/dax/super.c | 36 drivers/md/dm-table.c| 22 +++--- drivers/md/dm.c

[PATCH 10/29] dm-log-writes: add a log_writes_dax_pgoff helper

2021-11-09 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/

[PATCH 12/29] fsdax: remove a pointless __force cast in copy_cow_page_dax

2021-11-09 Thread Christoph Hellwig
Despite its name copy_user_page expected kernel addresses, which is what we already have. Signed-off-by: Christoph Hellwig --- fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index 4e3e5a283a916..73bd1439d8089 100644 --- a/fs/dax.c +++ b/fs/dax.c

[PATCH 16/29] fsdax: simplify the offset check in dax_iomap_zero

2021-11-09 Thread Christoph Hellwig
The file relative offset must have the same alignment as the storage offset, so use that and get rid of the call to iomap_sector. Signed-off-by: Christoph Hellwig --- fs/dax.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 5364549d67a48

[PATCH 11/29] dm-stripe: add a stripe_dax_pgoff helper

2021-11-09 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/

[PATCH 18/29] fsdax: decouple zeroing from the iomap buffered I/O code

2021-11-09 Thread Christoph Hellwig
for reflink support as well. Signed-off-by: Christoph Hellwig --- fs/dax.c | 77 ++ fs/ext2/inode.c| 6 ++-- fs/ext4/inode.c| 4 +-- fs/iomap/buffered-io.c | 35 +++ fs/xfs/xfs_iomap.c | 6 include

[PATCH 14/29] fsdax: simplify the pgoff calculation

2021-11-09 Thread Christoph Hellwig
Replace the two steps of dax_iomap_sector and bdev_dax_pgoff with a single dax_iomap_pgoff helper that avoids lots of cumbersome sector conversions. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 14 -- fs/dax.c| 35

[PATCH 15/29] xfs: add xfs_zero_range and xfs_truncate_page helpers

2021-11-09 Thread Christoph Hellwig
From: Shiyang Ruan Add helpers to prepare for using different DAX operations. Signed-off-by: Shiyang Ruan [hch: split from a larger patch + slight cleanups] Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_bmap_util.c | 7 +++ fs/xfs/xfs_file.c | 3 +-- fs/xfs/xfs_iomap.c | 25

[PATCH 21/29] xfs: move dax device handling into xfs_{alloc, free}_buftarg

2021-11-09 Thread Christoph Hellwig
Hide the DAX device lookup from the xfs_super.c code. Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_buf.c | 8 fs/xfs/xfs_buf.h | 4 ++-- fs/xfs/xfs_super.c | 26 +- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs

[PATCH 20/29] ext4: cleanup the dax handling in ext4_fill_super

2021-11-09 Thread Christoph Hellwig
Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig --- fs/ext4/super.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index eb4df43abd76e

[PATCH 22/29] iomap: add a IOMAP_DAX flag

2021-11-09 Thread Christoph Hellwig
Add a flag so that the file system can easily detect DAX operations. Signed-off-by: Christoph Hellwig --- fs/dax.c | 7 --- include/linux/iomap.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 5b52b878124ac..0bd6cdcbacfc4 100644

[PATCH 19/29] ext2: cleanup the dax handling in ext2_fill_super

2021-11-09 Thread Christoph Hellwig
Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig --- fs/ext2/super.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/ext2/super.c b/fs/ext2/super.c index

[PATCH 24/29] xfs: use xfs_direct_write_iomap_ops for DAX zeroing

2021-11-09 Thread Christoph Hellwig
While the buffered write iomap ops do work due to the fact that zeroing never allocates blocks, the DAX zeroing should use the direct ops just like actual DAX I/O. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_iomap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs

[PATCH 17/29] fsdax: factor out a dax_memzero helper

2021-11-09 Thread Christoph Hellwig
Factor out a helper for the "manual" zeroing of a DAX range to clean up dax_iomap_zero a lot. Signed-off-by: Christoph Hellwig --- fs/dax.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index d7a

[PATCH 25/29] dax: return the partition offset from fs_dax_get_by_bdev

2021-11-09 Thread Christoph Hellwig
Prepare from removing the block_device from the DAX I/O path by returning the partition offset from fs_dax_get_by_bdev so that the file systems have it at hand for use during I/O. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 9 ++--- drivers/md/dm.c | 4 ++-- fs/erofs

[PATCH 23/29] xfs: use IOMAP_DAX to check for DAX mappings

2021-11-09 Thread Christoph Hellwig
Use the explicit DAX flag instead of checking the inode flag in the iomap code. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_iomap.c | 7 --- fs/xfs/xfs_iomap.h | 3 ++- fs/xfs/xfs_pnfs.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs

[PATCH 28/29] iomap: build the block based code conditionally

2021-11-09 Thread Christoph Hellwig
Only build the block based iomap code if CONFIG_BLOCK is set. Currently that is always the case, but it will change soon. Signed-off-by: Christoph Hellwig --- fs/Kconfig| 4 ++-- fs/iomap/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/Kconfig b/fs

[PATCH 29/29] fsdax: don't require CONFIG_BLOCK

2021-11-09 Thread Christoph Hellwig
The file system DAX code now does not require the block code. So allow building a kernel with fuse DAX but not block layer. Signed-off-by: Christoph Hellwig --- fs/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/Kconfig b/fs/Kconfig index 6d608330a096e

[PATCH 26/29] fsdax: shift partition offset handling into the file systems

2021-11-09 Thread Christoph Hellwig
Remove the last user of ->bdev in dax.c by requiring the file system to pass in an address that already includes the DAX offset. As part of the only set ->bdev or ->daxdev when actually required in the ->iomap_begin methods. Signed-off-by: Christoph Hellwig --- fs/dax.c

[PATCH 27/29] dax: fix up some of the block device related ifdefs

2021-11-09 Thread Christoph Hellwig
The DAX device <-> block device association is only enabled if CONFIG_BLOCK is enabled. Update dax.h to account for that and use the right conditions for the fs_put_dax stub as well. Signed-off-by: Christoph Hellwig --- include/linux/dax.h | 41 -

Re: [PATCH 02/29] dm: make the DAX support dependend on CONFIG_FS_DAX

2021-11-18 Thread Christoph Hellwig
On Wed, Nov 17, 2021 at 09:23:44AM -0800, Dan Williams wrote: > Applied, fixed the spelling of 'dependent' in the subject and picked > up Mike's Ack from the previous send: > > https://lore.kernel.org/r/yyasbvuorceds...@redhat.com > > Christoph, any particular reason you did not pick up the tags

Re: [PATCH 01/29] nvdimm/pmem: move dax_attribute_group from dax to pmem

2021-11-18 Thread Christoph Hellwig
On Wed, Nov 17, 2021 at 09:44:25AM -0800, Dan Williams wrote: > On Tue, Nov 9, 2021 at 12:33 AM Christoph Hellwig wrote: > > > > dax_attribute_group is only used by the pmem driver, and can avoid the > > completely pointless lookup by the disk name if moved there. This >

Re: [PATCH 02/29] dm: make the DAX support dependend on CONFIG_FS_DAX

2021-11-22 Thread Christoph Hellwig
On Mon, Nov 22, 2021 at 06:54:09PM -0800, Dan Williams wrote: > On Thu, Nov 18, 2021 at 10:55 PM Christoph Hellwig wrote: > > > > On Wed, Nov 17, 2021 at 09:23:44AM -0800, Dan Williams wrote: > > > Applied, fixed the spelling of 'dependent' in the subject and p

Re: [PATCH 04/29] dax: simplify the dax_device <-> gendisk association

2021-11-22 Thread Christoph Hellwig
On Mon, Nov 22, 2021 at 07:33:06PM -0800, Dan Williams wrote: > Is it time to add a "DAX" symbol namespace? What would be the benefit? ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/lis

Re: [PATCH 06/29] dax: move the partition alignment check into fs_dax_get_by_bdev

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 02:25:55PM -0800, Darrick J. Wong wrote: > > + if ((get_start_sect(bdev) * SECTOR_SIZE) % PAGE_SIZE || > > + (bdev_nr_sectors(bdev) * SECTOR_SIZE) % PAGE_SIZE) { > > Do we have to be careful about 64-bit division here, or do we not > support DAX on 32-bit? I can't

Re: [PATCH 08/29] dax: remove dax_capable

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 02:31:23PM -0800, Darrick J. Wong wrote: > > - struct super_block *sb = mp->m_super; > > - > > - if (!xfs_buftarg_is_dax(sb, mp->m_ddev_targp) && > > - (!mp->m_rtdev_targp || !xfs_buftarg_is_dax(sb, mp->m_rtdev_targp))) { > > + if (!mp->m_ddev_targp->bt_daxde

Re: [PATCH 14/29] fsdax: simplify the pgoff calculation

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 02:36:42PM -0800, Darrick J. Wong wrote: > > - phys_addr_t phys_off = (start_sect + sector) * 512; > > - > > - if (pgoff) > > - *pgoff = PHYS_PFN(phys_off); > > - if (phys_off % PAGE_SIZE || size % PAGE_SIZE) > > AFAICT, we're relying on fs_dax_get_by_bdev t

Re: [PATCH 17/29] fsdax: factor out a dax_memzero helper

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 01:22:13PM -0800, Dan Williams wrote: > On Tue, Nov 9, 2021 at 12:34 AM Christoph Hellwig wrote: > > > > Factor out a helper for the "manual" zeroing of a DAX range to clean > > up dax_iomap_zero a lot. > > > >

Re: [PATCH 18/29] fsdax: decouple zeroing from the iomap buffered I/O code

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 01:46:35PM -0800, Dan Williams wrote: > > + const struct iomap_ops *ops) > > +{ > > + unsigned int blocksize = i_blocksize(inode); > > + unsigned int off = pos & (blocksize - 1); > > + > > + /* Block boundary? Nothing to do */ > > + if (

Re: [PATCH 18/29] fsdax: decouple zeroing from the iomap buffered I/O code

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 02:53:15PM -0800, Darrick J. Wong wrote: > > -s64 dax_iomap_zero(loff_t pos, u64 length, struct iomap *iomap) > > +static loff_t dax_zero_iter(struct iomap_iter *iter, bool *did_zero) > > Shouldn't this return value remain s64 to match iomap_iter.processed? I'll switch it

  1   2   3   4   5   6   7   8   9   10   >