From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNita-0008GV-5J for qemu-devel@nongnu.org; Tue, 17 Feb 2015 09:13:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNitV-0004GL-VR for qemu-devel@nongnu.org; Tue, 17 Feb 2015 09:13:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNitV-0004Fw-P5 for qemu-devel@nongnu.org; Tue, 17 Feb 2015 09:12:57 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1HECuUc032087 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 17 Feb 2015 09:12:56 -0500 Message-ID: <54E34C60.8090306@redhat.com> Date: Tue, 17 Feb 2015 15:12:48 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1424167517-21866-1-git-send-email-mst@redhat.com> <1424167517-21866-2-git-send-email-mst@redhat.com> <20150217144504.5ce0b7a5@nial.brq.redhat.com> In-Reply-To: <20150217144504.5ce0b7a5@nial.brq.redhat.com> Content-Type: text/plain; charset=windows-1252 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: Igor Mammedov , "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org On 17/02/2015 14:45, Igor Mammedov wrote: > 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; >> } > Acked-by: Paolo Bonzini