aboutsummaryrefslogtreecommitdiff
path: root/accel/kvm
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2021-01-18 14:38:06 +0800
committerThomas Huth <thuth@redhat.com>2021-01-20 10:46:54 +0100
commiteb8b1a797a86d72b0eddc6cfd5cc018849417e7a (patch)
tree6490fcdc96ca18a6adb088fb2ad6333543e549cc /accel/kvm
parentd2c4f3841d1cba17c99f76812ffcb75a6c402202 (diff)
accel/kvm: avoid using predefined PAGE_SIZE
As per POSIX specification of limits.h [1], OS libc may define PAGE_SIZE in limits.h. PAGE_SIZE is used in included kernel uapi headers. 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> Message-Id: <20210118063808.12471-8-jiaxun.yang@flygoat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'accel/kvm')
-rw-r--r--accel/kvm/kvm-all.c3
1 files changed, 3 insertions, 0 deletions
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
+#endif
#define PAGE_SIZE qemu_real_host_page_size
//#define DEBUG_KVM