All of lore.kernel.org
 help / color / mirror / Atom feed
From: Haozhong Zhang <haozhong.zhang@intel.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	Richard Henderson <rth@twiddle.net>,
	Xiao Guangrong <guangrong.xiao@gmail.com>,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment
Date: Wed, 31 May 2017 14:24:07 +0800	[thread overview]
Message-ID: <20170531062407.ejyylcimoxkfhhrn@hz-desktop> (raw)
In-Reply-To: <20170530091624.GE11362@stefanha-x1.localdomain>

On 05/30/17 10:16 +0100, Stefan Hajnoczi wrote:
> On Fri, May 26, 2017 at 10:24:38AM +0800, 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 may require an alignment larger than what
> > qemu_fd_get_pagesize() returns (e.g. 2MB vs. 4KB), and mmap may fail.
> > 
> > This commit adds an attribute 'align' to hostmem-file, so that users
> > can specify a proper alignment that satisfies the kernel requirement.
> > 
> > If 'align' is not specified or is 0, the value returned by
> > qemu_fd_get_pagesize() will be used as before.
> 
> How are users supposed to determine alignment requirements?

As discussed in another thread [1,2], the alignment of device-dax can
be got from /sys/dev/char/$major:$minor/device/align, and I'll let
QEMU read the value from it instead of user input.

[1] https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg06235.html
[2] https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg06189.html

Haozhong

  reply	other threads:[~2017-05-31  6:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26  2:24 [Qemu-devel] [PATCH 1/2] nvdimm: warn if the backend is not a DAX device Haozhong Zhang
2017-05-26  2:24 ` [Qemu-devel] [PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment Haozhong Zhang
2017-05-30  9:16   ` Stefan Hajnoczi
2017-05-31  6:24     ` Haozhong Zhang [this message]
2017-05-30  9:15 ` [Qemu-devel] [PATCH 1/2] nvdimm: warn if the backend is not a DAX device Stefan Hajnoczi
2017-05-31  6:12   ` Haozhong Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170531062407.ejyylcimoxkfhhrn@hz-desktop \
    --to=haozhong.zhang@intel.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=ehabkost@redhat.com \
    --cc=guangrong.xiao@gmail.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.