From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNf2P-0001Oi-SO for qemu-devel@nongnu.org; Tue, 17 Feb 2015 05:05:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNf2C-0007Hj-1g for qemu-devel@nongnu.org; Tue, 17 Feb 2015 05:05:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNf2B-0007HZ-QS for qemu-devel@nongnu.org; Tue, 17 Feb 2015 05:05:39 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1HA5d9B032721 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 17 Feb 2015 05:05:39 -0500 Date: Tue, 17 Feb 2015 11:05:36 +0100 From: "Michael S. Tsirkin" Message-ID: <1424167517-21866-2-git-send-email-mst@redhat.com> References: <1424167517-21866-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424167517-21866-1-git-send-email-mst@redhat.com> Subject: [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: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, Igor Mammedov 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 --- 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; } -- MST