[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'alig
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment |
Date: |
Fri, 26 May 2017 07:05:52 +0000 |
Hi
On Fri, May 26, 2017 at 10:51 AM Haozhong Zhang <address@hidden>
wrote:
> On 05/26/17 06:39 +0000, Marc-André Lureau wrote:
> > Hi
> >
> > On Fri, May 26, 2017 at 6:34 AM Haozhong Zhang <address@hidden
> >
> > wrote:
> >
> > > file_ram_alloc() currently maps the backend file via mmap to a virtual
> > > address aligned to the value returned by qemu_fd_getpagesize(). When a
> > > DAX device (e.g. /dev/dax0.0) is used as the backend file, its kernel
> > > mmap implementation may require an alignment larger than what
> > > qemu_fd_get_pagesize() returns (e.g. 2MB vs. 4KB), and mmap may fail.
> > >
> >
> > How is the accepted value queried? Any chance to configure it
> > automatically?
>
> Take /dev/dax0.0 for example. The value can be read from
> /sys/class/dax/dax0.0/device/dax_region/align.
>
Should this work be left to management layer, or could qemu figure it out
by itself (using udev?)
> [..]
> > > +static void
> > > file_backend_class_init(ObjectClass *oc, void *data)
> > > {
> > > HostMemoryBackendClass *bc = MEMORY_BACKEND_CLASS(oc);
> > > @@ -116,6 +151,10 @@ file_backend_class_init(ObjectClass *oc, void
> *data)
> > > object_class_property_add_str(oc, "mem-path",
> > > get_mem_path, set_mem_path,
> > > &error_abort);
> > > + object_class_property_add(oc, "align", "int",
> > >
> >
> > It would make sense to make it "size" instead of "int"
> >
>
> will change in the next version
>
thanks
--
Marc-André Lureau
Re: [Qemu-devel] [RESEND PATCH 1/2] nvdimm: warn if the backend is not a DAX device, Dan Williams, 2017/05/25