Received: from eggs.gnu.org ([2001:4830:134:3::10]:46618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNiSf-00032i-Dn for qemu-devel@nongnu.org; Tue, 17 Feb 2015 08:45:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNiSa-0006Nn-UF for qemu-devel@nongnu.org; Tue, 17 Feb 2015 08:45:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNiSa-0006MU-MO for qemu-devel@nongnu.org; Tue, 17 Feb 2015 08:45:08 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1HDj6Cg025852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 17 Feb 2015 08:45:07 -0500 Date: Tue, 17 Feb 2015 14:45:04 +0100 From: Igor Mammedov Message-ID: <20150217144504.5ce0b7a5@nial.brq.redhat.com> In-Reply-To: <1424167517-21866-2-git-send-email-mst@redhat.com> References: <1424167517-21866-1-git-send-email-mst@redhat.com> <1424167517-21866-2-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/4] exec: round up size on MR resize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: pbonzini@redhat.com, qemu-devel@nongnu.org On Tue, 17 Feb 2015 11:05:36 +0100 "Michael S. Tsirkin" wrote: > Block size must fundamentally be a multiple of target page size. > Aligning automatically removes need to worry about the alignment > from callers. > > Note: the only caller of qemu_ram_resize (acpi) already happens to have > size padded to a power of 2, but we would like to drop the padding in > ACPI core, and don't want to expose target page size knowledge to ACPI. > > Signed-off-by: Michael S. Tsirkin Reviewed-by: Igor Mammedov > --- > exec.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/exec.c b/exec.c > index 6b79ad1..2433406 100644 > --- a/exec.c > +++ b/exec.c > @@ -1298,6 +1298,8 @@ int qemu_ram_resize(ram_addr_t base, ram_addr_t newsize, Error **errp) > > assert(block); > > + newsize = TARGET_PAGE_ALIGN(newsize); > + > if (block->used_length == newsize) { > return 0; > }