qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Dominik Dingel <dingel@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Cc: Halil Pasic <pasic@linux.vnet.ibm.com>,
	Richard Henderson <rth@twiddle.net>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] exec.c: Ensure right alignment also for file backed ram
Date: Thu, 24 Mar 2016 12:35:10 +0100	[thread overview]
Message-ID: <56F3D0EE.4050000@redhat.com> (raw)
In-Reply-To: <1458768723-89242-1-git-send-email-dingel@linux.vnet.ibm.com>



On 23/03/2016 22:32, Dominik Dingel wrote:
> -    page_size = qemu_fd_getpagesize(fd);
> -    block->mr->align = page_size;
> +    alignment = MAX(qemu_fd_getpagesize(fd), QEMU_VMALLOC_ALIGN);
> +    block->mr->align = alignment;
>  
> -    if (memory < page_size) {
> +    if (memory < alignment) {
>          error_setg(errp, "memory size 0x" RAM_ADDR_FMT " must be equal to "
> -                   "or larger than page size 0x%" PRIx64,
> -                   memory, page_size);
> +                   "or larger than needed alignment 0x%" PRIx64,
> +                   memory, alignment);
>          goto error;
>      }

Why is this part necessary?  On x86 you can have 1 megabyte of RAM,
but QEMU_VMALLOC_ALIGN is 2MB.

Paolo

> -    memory = ROUND_UP(memory, page_size);
> +    memory = ROUND_UP(memory, alignment);
>  

  reply	other threads:[~2016-03-24 11:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 21:32 [Qemu-devel] [PATCH] exec.c: Ensure right alignment also for file backed ram Dominik Dingel
2016-03-24 11:35 ` Paolo Bonzini [this message]
2016-03-29  9:29   ` Dominik Dingel
2016-03-29  9:51     ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2016-04-25 11:55 Dominik Dingel
2016-04-29  7:32 ` Fam Zheng
2016-04-29  8:26   ` Dominik Dingel
2016-05-03  0:57     ` Fam Zheng
2016-05-10 13:16 ` Paolo Bonzini

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=56F3D0EE.4050000@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=dingel@linux.vnet.ibm.com \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).