Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-30 Thread Dan Williams
On Tue, May 30, 2017 at 5:17 AM, Paolo Bonzini wrote: > > > On 26/05/2017 16:24, Dan Williams wrote: >>> For DAX device only, QEMU can figure out the proper alignment by >>> itself. However, I'm not sure whether there are other non-DAX cases >>> requiring non-default alignment, so I think it's bet

Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-30 Thread Paolo Bonzini
On 26/05/2017 16:24, Dan Williams wrote: >> For DAX device only, QEMU can figure out the proper alignment by >> itself. However, I'm not sure whether there are other non-DAX cases >> requiring non-default alignment, so I think it's better to just add an >> interface (i.e. align attribute) in QEMU

Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-26 Thread Haozhong Zhang
On 05/26/17 15:55 -0300, Eduardo Habkost wrote: > On Fri, May 26, 2017 at 07:24:26AM -0700, Dan Williams wrote: > > On Fri, May 26, 2017 at 12:16 AM, Haozhong Zhang > > wrote: > > > On 05/26/17 07:05 +, Marc-André Lureau wrote: > > >> Hi > > >> > > >> On Fri, May 26, 2017 at 10:51 AM Haozhong

Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-26 Thread Dan Williams
On Fri, May 26, 2017 at 11:55 AM, Eduardo Habkost wrote: > On Fri, May 26, 2017 at 07:24:26AM -0700, Dan Williams wrote: >> On Fri, May 26, 2017 at 12:16 AM, Haozhong Zhang >> wrote: >> > On 05/26/17 07:05 +, Marc-André Lureau wrote: >> >> Hi >> >> >> >> On Fri, May 26, 2017 at 10:51 AM Haozh

Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-26 Thread Eduardo Habkost
On Fri, May 26, 2017 at 07:24:26AM -0700, Dan Williams wrote: > On Fri, May 26, 2017 at 12:16 AM, Haozhong Zhang > wrote: > > On 05/26/17 07:05 +, Marc-André Lureau wrote: > >> Hi > >> > >> On Fri, May 26, 2017 at 10:51 AM Haozhong Zhang > >> wrote: > >> > >> > On 05/26/17 06:39 +, Marc-A

Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-26 Thread Dan Williams
On Fri, May 26, 2017 at 12:16 AM, Haozhong Zhang wrote: > On 05/26/17 07:05 +, Marc-André Lureau wrote: >> Hi >> >> On Fri, May 26, 2017 at 10:51 AM Haozhong Zhang >> wrote: >> >> > On 05/26/17 06:39 +, Marc-André Lureau wrote: >> > > Hi >> > > >> > > On Fri, May 26, 2017 at 6:34 AM Haozh

Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-26 Thread Marc-André Lureau
Hi On Fri, May 26, 2017 at 10:51 AM Haozhong Zhang wrote: > On 05/26/17 06:39 +, Marc-André Lureau wrote: > > Hi > > > > On Fri, May 26, 2017 at 6:34 AM Haozhong Zhang > > > wrote: > > > > > file_ram_alloc() currently maps the backend file via mmap to a virtual > > > address aligned to the

Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-25 Thread Marc-André Lureau
Hi On Fri, May 26, 2017 at 6:34 AM Haozhong Zhang 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

[Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-25 Thread Haozhong Zhang
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() re