qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 1/3] hostmem-file: add "align" option


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v4 1/3] hostmem-file: add "align" option
Date: Wed, 13 Dec 2017 11:14:24 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Mon, Dec 11, 2017 at 03:28:04PM +0800, Haozhong Zhang wrote:
> When mmap(2) the backend files, QEMU uses the host page size
> (getpagesize(2)) by default as the alignment of mapping address.
> However, some backends may require alignments different than the page
> size. For example, mmap a device DAX (e.g., /dev/dax0.0) on Linux
> kernel 4.13 to an address, which is 4K-aligned but not 2M-aligned,
> fails with a kernel message like
> 
> [617494.969768] dax dax0.0: qemu-system-x86: dax_mmap: fail, unaligned vma 
> (0x7fa37c579000 - 0x7fa43c579000, 0x1fffff)
> 
> Because there is no common approach to get such alignment requirement,
> we add the 'align' option to 'memory-backend-file', so that users or
> management utils, which have enough knowledge about the backend, can
> specify a proper alignment via this option.
> 
> Signed-off-by: Haozhong Zhang <address@hidden>
> ---
>  backends/hostmem-file.c | 41 ++++++++++++++++++++++++++++++++++++++++-
>  docs/nvdimm.txt         | 16 ++++++++++++++++
>  exec.c                  |  8 +++++++-
>  include/exec/memory.h   |  3 +++
>  memory.c                |  2 ++
>  numa.c                  |  2 +-
>  qemu-options.hx         |  9 ++++++++-
>  7 files changed, 77 insertions(+), 4 deletions(-)

Reviewed-by: Stefan Hajnoczi <address@hidden>

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]