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

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