Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-28 Thread Pankaj Gupta
> > > > +int err; > > > > + > > > > +sg_init_one(, buf, sizeof(buf)); > > > > + > > > > +err = virtqueue_add_outbuf(vpmem->req_vq, , 1, buf, > > > > GFP_KERNEL); > > > > + > > > > +if (err) { > > > > +dev_err(>dev, "failed to send command to virtio

Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-27 Thread Stefan Hajnoczi
On Thu, Apr 26, 2018 at 11:44:59AM -0400, Pankaj Gupta wrote: > > > + int err; > > > + > > > + sg_init_one(, buf, sizeof(buf)); > > > + > > > + err = virtqueue_add_outbuf(vpmem->req_vq, , 1, buf, GFP_KERNEL); > > > + > > > + if (err) { > > > + dev_err(>dev, "failed to send command to

Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-26 Thread Jeff Moyer
Pankaj Gupta writes: >> Ideally, qemu (seabios?) would advertise a platform capabilities >> sub-table that doesn't fill in the flush bits. > > Could you please elaborate on this, how its related to disabling > MAP_SYNC? We are not doing entire nvdimm device emulation. My

Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-26 Thread Pankaj Gupta
> > Dan Williams writes: > > > [ adding Jeff directly since he has also been looking at > > infrastructure to track when MAP_SYNC should be disabled ] > > > > On Wed, Apr 25, 2018 at 7:21 AM, Dan Williams > > wrote: > >> On Wed, Apr 25, 2018

Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-26 Thread Pankaj Gupta
> > This patch adds virtio-pmem driver for KVM > > guest. > > > > Guest reads the persistent memory range > > information from Qemu over VIRTIO and registers > > it on nvdimm_bus. It also creates a nd_region > > object with the persistent memory range > > information so that existing

Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-26 Thread Jeff Moyer
Dan Williams writes: > [ adding Jeff directly since he has also been looking at > infrastructure to track when MAP_SYNC should be disabled ] > > On Wed, Apr 25, 2018 at 7:21 AM, Dan Williams > wrote: >> On Wed, Apr 25, 2018 at 4:24 AM, Pankaj

Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-26 Thread Stefan Hajnoczi
On Wed, Apr 25, 2018 at 04:54:13PM +0530, Pankaj Gupta wrote: > This patch adds virtio-pmem driver for KVM > guest. > > Guest reads the persistent memory range > information from Qemu over VIRTIO and registers > it on nvdimm_bus. It also creates a nd_region > object with the persistent

Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-25 Thread Pankaj Gupta
> > On Wed, Apr 25, 2018 at 04:54:13PM +0530, Pankaj Gupta wrote: > > diff --git a/include/uapi/linux/virtio_ids.h > > b/include/uapi/linux/virtio_ids.h > > index 6d5c3b2..5ebd049 100644 > > --- a/include/uapi/linux/virtio_ids.h > > +++ b/include/uapi/linux/virtio_ids.h > > @@ -43,5 +43,6 @@ > >

Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-25 Thread Michael S. Tsirkin
On Wed, Apr 25, 2018 at 04:54:13PM +0530, Pankaj Gupta wrote: > diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h > index 6d5c3b2..5ebd049 100644 > --- a/include/uapi/linux/virtio_ids.h > +++ b/include/uapi/linux/virtio_ids.h > @@ -43,5 +43,6 @@ > #define

Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-25 Thread Dan Williams
[ adding Jeff directly since he has also been looking at infrastructure to track when MAP_SYNC should be disabled ] On Wed, Apr 25, 2018 at 7:21 AM, Dan Williams wrote: > On Wed, Apr 25, 2018 at 4:24 AM, Pankaj Gupta wrote: >> This patch adds

Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-25 Thread Dan Williams
On Wed, Apr 25, 2018 at 4:24 AM, Pankaj Gupta wrote: > This patch adds virtio-pmem driver for KVM > guest. Minor nit, please expand your changelog line wrapping to 72 columns. > > Guest reads the persistent memory range > information from Qemu over VIRTIO and registers > it

[Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-25 Thread Pankaj Gupta
This patch adds virtio-pmem driver for KVM guest. Guest reads the persistent memory range information from Qemu over VIRTIO and registers it on nvdimm_bus. It also creates a nd_region object with the persistent memory range information so that existing 'nvdimm/pmem' driver can reserve this