qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] include: set vm hva aligned with huge pagesize on loongarch


From: Mao Bibo
Subject: [PATCH] include: set vm hva aligned with huge pagesize on loongarch
Date: Tue, 28 Jun 2022 11:04:00 +0800

On loongarch system, page size is 16K rather than 4K like general platforms,
and huge pagesize is 32M. This patch sets hva for vm aligned with huge pagesize
on loongarch host system.

Signed-off-by: Mao Bibo <maobibo@loongson.cn>
---
 include/qemu/osdep.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index b1c161c035..4f9aa53e35 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -451,6 +451,9 @@ extern int madvise(char *, size_t, int);
 #  define QEMU_VMALLOC_ALIGN (256 * 4096)
 #elif defined(__linux__) && defined(__sparc__)
 #  define QEMU_VMALLOC_ALIGN MAX(qemu_real_host_page_size(), SHMLBA)
+#elif defined(__linux__) && defined(__loongarch__)
+#  define QEMU_VMALLOC_ALIGN (qemu_real_host_page_size() * \
+                              qemu_real_host_page_size() / sizeof(long))
 #else
 #  define QEMU_VMALLOC_ALIGN qemu_real_host_page_size()
 #endif
-- 
2.27.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]