[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] exec.c: Ensure right alignment also for file ba
From: |
Dominik Dingel |
Subject: |
Re: [Qemu-devel] [PATCH] exec.c: Ensure right alignment also for file backed ram |
Date: |
Tue, 29 Mar 2016 11:29:53 +0200 |
On Thu, 24 Mar 2016 12:35:10 +0100
Paolo Bonzini <address@hidden> wrote:
>
>
> 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.
You are right, I changed this to keep the change consistent and thought
the use case of x86 guests with 1 MB RAM might be a little bit obscure.
Will change this, and keep the page_size check here, and resend a new version
in the next days.
Thanks
Dominik