Blame SOURCES/kvm-memory-exec-Expose-all-memory-block-related-flags.patch

357786
From dfca592a8a3fb1e781775020961ed16b8aea258e Mon Sep 17 00:00:00 2001
357786
From: "plai@redhat.com" <plai@redhat.com>
357786
Date: Fri, 31 Aug 2018 16:25:53 +0200
357786
Subject: [PATCH 11/29] memory, exec: Expose all memory block related flags.
357786
357786
RH-Author: plai@redhat.com
357786
Message-id: <1535732759-22481-4-git-send-email-plai@redhat.com>
357786
Patchwork-id: 82006
357786
O-Subject: [RHEL7.6 PATCH BZ 1539280 3/9] memory, exec: Expose all memory block related flags.
357786
Bugzilla: 1539280
357786
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
357786
RH-Acked-by: Pankaj Gupta <pagupta@redhat.com>
357786
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
357786
From: Junyan He <junyan.he@intel.com>
357786
357786
We need to use these flags in other files rather than just in exec.c,
357786
For example, RAM_SHARED should be used when create a ram block from file.
357786
We expose them the exec/memory.h
357786
357786
Signed-off-by: Junyan He <junyan.he@intel.com>
357786
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
357786
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
357786
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
357786
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
357786
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
357786
(cherry picked from commit b0e5de93811077254a536c23b713b49e12efb742)
357786
Signed-off-by: Paul Lai <plai@redhat.com>
357786
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
---
357786
 exec.c                | 20 --------------------
357786
 include/exec/memory.h | 20 ++++++++++++++++++++
357786
 2 files changed, 20 insertions(+), 20 deletions(-)
357786
357786
diff --git a/exec.c b/exec.c
357786
index 7323d39..f21be9c 100644
357786
--- a/exec.c
357786
+++ b/exec.c
357786
@@ -87,26 +87,6 @@ AddressSpace address_space_memory;
357786
 
357786
 MemoryRegion io_mem_rom, io_mem_notdirty;
357786
 static MemoryRegion io_mem_unassigned;
357786
-
357786
-/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
357786
-#define RAM_PREALLOC   (1 << 0)
357786
-
357786
-/* RAM is mmap-ed with MAP_SHARED */
357786
-#define RAM_SHARED     (1 << 1)
357786
-
357786
-/* Only a portion of RAM (used_length) is actually used, and migrated.
357786
- * This used_length size can change across reboots.
357786
- */
357786
-#define RAM_RESIZEABLE (1 << 2)
357786
-
357786
-/* UFFDIO_ZEROPAGE is available on this RAMBlock to atomically
357786
- * zero the page and wake waiting processes.
357786
- * (Set during postcopy)
357786
- */
357786
-#define RAM_UF_ZEROPAGE (1 << 3)
357786
-
357786
-/* RAM can be migrated */
357786
-#define RAM_MIGRATABLE (1 << 4)
357786
 #endif
357786
 
357786
 #ifdef TARGET_PAGE_BITS_VARY
357786
diff --git a/include/exec/memory.h b/include/exec/memory.h
357786
index 31eae0a..db46501 100644
357786
--- a/include/exec/memory.h
357786
+++ b/include/exec/memory.h
357786
@@ -102,6 +102,26 @@ struct IOMMUNotifier {
357786
 };
357786
 typedef struct IOMMUNotifier IOMMUNotifier;
357786
 
357786
+/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
357786
+#define RAM_PREALLOC   (1 << 0)
357786
+
357786
+/* RAM is mmap-ed with MAP_SHARED */
357786
+#define RAM_SHARED     (1 << 1)
357786
+
357786
+/* Only a portion of RAM (used_length) is actually used, and migrated.
357786
+ * This used_length size can change across reboots.
357786
+ */
357786
+#define RAM_RESIZEABLE (1 << 2)
357786
+
357786
+/* UFFDIO_ZEROPAGE is available on this RAMBlock to atomically
357786
+ * zero the page and wake waiting processes.
357786
+ * (Set during postcopy)
357786
+ */
357786
+#define RAM_UF_ZEROPAGE (1 << 3)
357786
+
357786
+/* RAM can be migrated */
357786
+#define RAM_MIGRATABLE (1 << 4)
357786
+
357786
 static inline void iommu_notifier_init(IOMMUNotifier *n, IOMMUNotify fn,
357786
                                        IOMMUNotifierFlag flags,
357786
                                        hwaddr start, hwaddr end)
357786
-- 
357786
1.8.3.1
357786