All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Regression caused by d2f39ad "exec.c: Ensure right alignment also for file backed ram"
@ 2016-10-21  8:28 Haozhong Zhang
  2016-10-21  8:39 ` Haozhong Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Haozhong Zhang @ 2016-10-21  8:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Peter Crosthwaite, Richard Henderson,
	Dominik Dingel, Eduardo Habkost, Igor Mammedov, anthony.xu,
	chao.p.peng

Hi,

Commit d2f39ad "exec.c: Ensure right alignment also for file backed
ram" added an additional alignment requirement besides to the previous
page size for the size of the backend file. On x86, the alignment
requirement for the size of the backend file is changed from 4KB in
QEMU 2.6 to 2MB in QEMU 2.7.

This change immediately breaks the usage of "-object memory-backend-file,...,size=$SIZE"
on x86, where $SIZE is multiple of 4KB but not 2MB. It works on QEMU 2.6.
Could this be considered as a regression?

The commit message shows it's for s390. I'm wondering whether the same
regression happens on s390 and ARM. If not, could I fix the regression
on x86 by keeping using the original alignment only on x86, e.g.

modified   exec.c
@@ -1254,7 +1254,11 @@ static void *file_ram_alloc(RAMBlock *block,
     }
 
     block->page_size = qemu_fd_getpagesize(fd);
+#if defined(__x86_64__) || defined(__i386__)
+    block->mr->align = block->page_size;
+#else
     block->mr->align = MAX(block->page_size, QEMU_VMALLOC_ALIGN);
+#endif
 
     if (memory < block->page_size) {
         error_setg(errp, "memory size 0x" RAM_ADDR_FMT " must be equal to "


Thanks,
Haozhong

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-10-24 12:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-21  8:28 [Qemu-devel] Regression caused by d2f39ad "exec.c: Ensure right alignment also for file backed ram" Haozhong Zhang
2016-10-21  8:39 ` Haozhong Zhang
2016-10-21 12:44   ` Igor Mammedov
2016-10-21 14:12 ` Igor Mammedov
2016-10-24 11:44 ` Igor Mammedov
2016-10-24 12:06   ` Haozhong Zhang
2016-10-24 12:33   ` Dominik Dingel
2016-10-24 12:57     ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.