Received: from eggs.gnu.org ([2001:4830:134:3::10]:46095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akpyQ-0005XF-Nm for qemu-devel@nongnu.org; Tue, 29 Mar 2016 05:30:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akpyL-0000S1-Vu for qemu-devel@nongnu.org; Tue, 29 Mar 2016 05:30:06 -0400 Received: from e06smtp06.uk.ibm.com ([195.75.94.102]:38939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akpyL-0000RS-Ke for qemu-devel@nongnu.org; Tue, 29 Mar 2016 05:30:01 -0400 Received: from localhost by e06smtp06.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 29 Mar 2016 10:29:58 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id D4B741B0806B for ; Tue, 29 Mar 2016 10:30:30 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u2T9TtmJ53608656 for ; Tue, 29 Mar 2016 09:29:56 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u2T8TvP8019274 for ; Tue, 29 Mar 2016 02:29:57 -0600 Date: Tue, 29 Mar 2016 11:29:53 +0200 From: Dominik Dingel Message-ID: <20160329112953.6198e0ac@BR9TG4T3.de.ibm.com> In-Reply-To: <56F3D0EE.4050000@redhat.com> References: <1458768723-89242-1-git-send-email-dingel@linux.vnet.ibm.com> <56F3D0EE.4050000@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] exec.c: Ensure right alignment also for file backed ram List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Halil Pasic , Peter Crosthwaite , qemu-devel@nongnu.org, Richard Henderson On Thu, 24 Mar 2016 12:35:10 +0100 Paolo Bonzini 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