Re: [PATCH v4 5/5] backends/hostmem: Report error when memory size is unaligned

2024-06-05 Thread Mario Casquero
This patch has been successfully tested. Try to allocate some 2M hugepages in the host, then boot up a VM with the memory size unaligned and backed by a file, QEMU prompts the following message: qemu-system-x86_64: backend 'memory-backend-file' memory size must be multiple of 2 MiB Tested-by: Mari

[PATCH v4 5/5] backends/hostmem: Report error when memory size is unaligned

2024-06-05 Thread Michal Privoznik
If memory-backend-{file,ram} has a size that's not aligned to underlying page size it is not only wasteful, but also may lead to hard to debug behaviour. For instance, in case memory-backend-file and hugepages, madvise() and mbind() fail. Rightfully so, page is the smallest unit they can work with.