From 6ead2c3d1f04a373ee259908cb284e1e05c5a8a6 Mon Sep 17 00:00:00 2001 From: Junyan He Date: Wed, 22 Aug 2018 12:59:52 -0400 Subject: [PATCH] memory, exec: Expose all memory block related flags. We need to use these flags in other files rather than just in exec.c, For example, RAM_SHARED should be used when create a ram block from file. We expose them the exec/memory.h Backports commit b0e5de93811077254a536c23b713b49e12efb742 from qemu --- qemu/exec.c | 15 --------------- qemu/include/exec/memory.h | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/qemu/exec.c b/qemu/exec.c index 987a2dc1..36231b40 100644 --- a/qemu/exec.c +++ b/qemu/exec.c @@ -53,21 +53,6 @@ //#define DEBUG_SUBPAGE -#if !defined(CONFIG_USER_ONLY) - -/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */ -#define RAM_PREALLOC (1 << 0) - -/* RAM is mmap-ed with MAP_SHARED */ -#define RAM_SHARED (1 << 1) - -/* Only a portion of RAM (used_length) is actually used, and migrated. - * This used_length size can change across reboots. - */ -#define RAM_RESIZEABLE (1 << 2) - -#endif - bool set_preferred_target_page_bits(struct uc_struct *uc, int bits) { /* The target page size is the lowest common denominator for all diff --git a/qemu/include/exec/memory.h b/qemu/include/exec/memory.h index d3eedbe2..d0f9548f 100644 --- a/qemu/include/exec/memory.h +++ b/qemu/include/exec/memory.h @@ -62,6 +62,26 @@ struct IOMMUTLBEntry { IOMMUAccessFlags perm; }; +/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */ +#define RAM_PREALLOC (1 << 0) + +/* RAM is mmap-ed with MAP_SHARED */ +#define RAM_SHARED (1 << 1) + +/* Only a portion of RAM (used_length) is actually used, and migrated. + * This used_length size can change across reboots. + */ +#define RAM_RESIZEABLE (1 << 2) + +/* UFFDIO_ZEROPAGE is available on this RAMBlock to atomically + * zero the page and wake waiting processes. + * (Set during postcopy) + */ +#define RAM_UF_ZEROPAGE (1 << 3) + +/* RAM can be migrated */ +#define RAM_MIGRATABLE (1 << 4) + /* * Memory region callbacks */