[Top][All Lists]

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

[PATCH 7/9] accel/kvm: avoid using predefined PAGE_SIZE

From: Jiaxun Yang
Subject: [PATCH 7/9] accel/kvm: avoid using predefined PAGE_SIZE
Date: Mon, 21 Dec 2020 08:53:16 +0800

As per POSIX specification of limits.h [1], OS libc may define
PAGE_SIZE in limits.h.

To prevent collosion of definition, we discard PAGE_SIZE from
defined by libc and take QEMU's variable.

[1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
 accel/kvm/kvm-all.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 389eaace72..3feb17d965 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -58,6 +58,9 @@
 /* KVM uses PAGE_SIZE in its definition of KVM_COALESCED_MMIO_MAX. We
  * need to use the real host PAGE_SIZE, as that's what KVM will use.
+#ifdef PAGE_SIZE
+#undef PAGE_SIZE
 #define PAGE_SIZE qemu_real_host_page_size
 //#define DEBUG_KVM

reply via email to

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