qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] QEMU issues on SPARC hosts due to more-than-page-alignment requirement for MAP_SHARED|MAP_FIXED...
@ 2017-06-15 18:17 Peter Maydell
  2017-06-15 19:13 ` Laszlo Ersek
  2017-06-16  9:16 ` John Paul Adrian Glaubitz
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Maydell @ 2017-06-15 18:17 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Paolo Bonzini, John Paul Adrian Glaubitz

It turns out that SPARC hosts impose a requirement that
if you mmap MAP_SHARED|MAP_FIXED then the address must be
aligned to SHMLBA alignment, which for SPARC is 16K and
larger than the 8K page size:
 http://lxr.linux.no/#linux+v4.10.1/arch/sparc/kernel/sys_sparc_64.c#L158

QEMU doesn't really cope with this. In particular, ivmshm
doesn't work:

$ ppc64-softmmu/qemu-system-ppc64 -display none -device
ivshmem,shm=/qtest-20273-1334572184,size=0x1
qemu-system-ppc64: System page size 0x2000 is not enabled in
page_size_mask (0x11000). Performance may be slow
qemu-system-ppc64: -device
ivshmem,shm=/qtest-20273-1334572184,size=0x1: ivshmem is deprecated,
please use ivshmem-plain or ivshmem-doorbell instead
Unexpected error in file_ram_alloc() at /home/pm215/qemu/exec.c:1599:
qemu-system-ppc64: -device
ivshmem,shm=/qtest-20273-1334572184,size=0x1: unable to map backing
store for guest RAM: Invalid argument
Aborted

(noticed because this is a make check failure).

exec.c calls qemu_fd_getpagesize() to figure out the alignment
here (on a file in /dev/shm/) and ends up in its default codepath
that returns getpagesize(), which is too small.

What's the best way to fix this? As far as I can tell
the restriction applies to any mapping, not just /dev/shm files.
QEMU's assumptions that pagesize is the alignment requirement
seem fairly widespread :-(

thanks
-- PMM

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

end of thread, other threads:[~2017-06-20  8:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-15 18:17 [Qemu-devel] QEMU issues on SPARC hosts due to more-than-page-alignment requirement for MAP_SHARED|MAP_FIXED Peter Maydell
2017-06-15 19:13 ` Laszlo Ersek
2017-06-16  9:18   ` Peter Maydell
2017-06-19 22:49     ` Richard Henderson
2017-06-20  8:03       ` Peter Maydell
2017-06-16  9:16 ` John Paul Adrian Glaubitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).