[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] QEMU issues on SPARC hosts due to more-than-page-alignment
From: |
Peter Maydell |
Subject: |
[Qemu-devel] QEMU issues on SPARC hosts due to more-than-page-alignment requirement for MAP_SHARED|MAP_FIXED... |
Date: |
Thu, 15 Jun 2017 19:17:14 +0100 |
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