backends/hostmem: Fix support of memory-backend-memfd in qemu_maxrampagesize()
authorThomas Huth <thuth@redhat.com>
Wed, 10 Aug 2022 12:57:18 +0000 (14:57 +0200)
committerThomas Huth <thuth@redhat.com>
Fri, 26 Aug 2022 11:33:51 +0000 (13:33 +0200)
commit8be934b70e923104da883b990dee18f02552d40e
treed3e8f12200e84791b5ed2955b077d459a9aacaae
parentd324c21ba0b84b3033baa097e44a7fbbec815fad
backends/hostmem: Fix support of memory-backend-memfd in qemu_maxrampagesize()

It is currently not possible yet to use "memory-backend-memfd" on s390x
with hugepages enabled. This problem is caused by qemu_maxrampagesize()
not taking memory-backend-memfd objects into account yet, so the code
in s390_memory_init() fails to enable the huge page support there via
s390_set_max_pagesize(). Fix it by generalizing the code, so that it
looks at qemu_ram_pagesize(memdev->mr.ram_block) instead of re-trying
to get the information from the filesystem.

Suggested-by: David Hildenbrand <david@redhat.com>
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2116496
Message-Id: <20220810125720.3849835-2-thuth@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
backends/hostmem.c