From 1cc51e4b535409e634e73267c57972449491232d Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Sun, 18 Feb 2018 19:02:19 -0500 Subject: [PATCH] exec: round up size on MR resize 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 Backports commit 129ddaf31be583fb7c97812e07e028661005ce42 from qemu --- qemu/exec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu/exec.c b/qemu/exec.c index ebc88487..c772b73c 100644 --- a/qemu/exec.c +++ b/qemu/exec.c @@ -1033,6 +1033,8 @@ int qemu_ram_resize(struct uc_struct *uc, ram_addr_t base, ram_addr_t newsize, E assert(block); + newsize = TARGET_PAGE_ALIGN(newsize); + if (block->used_length == newsize) { return 0; }