[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 7/9] accel/kvm: avoid using predefined PAGE_SIZE
From: |
Jiaxun Yang |
Subject: |
[PATCH v2 7/9] accel/kvm: avoid using predefined PAGE_SIZE |
Date: |
Mon, 18 Jan 2021 14:38:06 +0800 |
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>
---
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
+#endif
#define PAGE_SIZE qemu_real_host_page_size
//#define DEBUG_KVM
--
2.30.0
- [PATCH v2 2/9] libvhost-user: Include poll.h instead of sys/poll.h, (continued)
- [PATCH v2 2/9] libvhost-user: Include poll.h instead of sys/poll.h, Jiaxun Yang, 2021/01/18
- [PATCH v2 3/9] osdep.h: Remove <sys/signal.h> include, Jiaxun Yang, 2021/01/18
- [PATCH v2 4/9] hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE, Jiaxun Yang, 2021/01/18
- [PATCH v2 5/9] elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE, Jiaxun Yang, 2021/01/18
- [PATCH v2 6/9] tests: Rename PAGE_SIZE definitions, Jiaxun Yang, 2021/01/18
- [PATCH v2 7/9] accel/kvm: avoid using predefined PAGE_SIZE,
Jiaxun Yang <=
- [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, Jiaxun Yang, 2021/01/18
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, Daniel P . Berrangé, 2021/01/18
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, Thomas Huth, 2021/01/19
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, Daniel P . Berrangé, 2021/01/19
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, John Snow, 2021/01/26
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, Daniel P . Berrangé, 2021/01/27
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, John Snow, 2021/01/27
[PATCH v2 9/9] gitlab-ci: Add alpine to pipeline, Jiaxun Yang, 2021/01/18