Skip to content

Commit

Permalink
accel/kvm: avoid using predefined PAGE_SIZE
Browse files Browse the repository at this point in the history
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 <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
  • Loading branch information
FlyGoat authored and huth committed Jan 20, 2021
1 parent d2c4f38 commit eb8b1a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions accel/kvm/kvm-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eb8b1a7

Please sign in to comment.