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

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