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

ae23c9
From 65df9633df636fa14fad0dde4915582f53ec00c3 Mon Sep 17 00:00:00 2001
ae23c9
From: "plai@redhat.com" <plai@redhat.com>
ae23c9
Date: Mon, 7 Jan 2019 17:02:16 +0000
ae23c9
Subject: [PATCH 15/22] memory, exec: Expose all memory block related flags.
ae23c9
ae23c9
RH-Author: plai@redhat.com
ae23c9
Message-id: <1546880543-24860-4-git-send-email-plai@redhat.com>
ae23c9
Patchwork-id: 83887
ae23c9
O-Subject: [RHEL8.0 qemu-kvm PATCH v7 03/10] memory, exec: Expose all memory block related flags.
ae23c9
Bugzilla: 1539285
ae23c9
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
ae23c9
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ae23c9
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
ae23c9
From: Junyan He <junyan.he@intel.com>
ae23c9
ae23c9
We need to use these flags in other files rather than just in exec.c,
ae23c9
For example, RAM_SHARED should be used when create a ram block from file.
ae23c9
We expose them the exec/memory.h
ae23c9
ae23c9
Signed-off-by: Junyan He <junyan.he@intel.com>
ae23c9
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
ae23c9
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
ae23c9
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
ae23c9
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
ae23c9
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
ae23c9
(cherry picked from commit b0e5de93811077254a536c23b713b49e12efb742)
ae23c9
Signed-off-by: Paul Lai <plai@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 exec.c                | 20 --------------------
ae23c9
 include/exec/memory.h | 20 ++++++++++++++++++++
ae23c9
 2 files changed, 20 insertions(+), 20 deletions(-)
ae23c9
ae23c9
diff --git a/exec.c b/exec.c
ae23c9
index fff49ba..b66377c 100644
ae23c9
--- a/exec.c
ae23c9
+++ b/exec.c
ae23c9
@@ -87,26 +87,6 @@ AddressSpace address_space_memory;
ae23c9
 
ae23c9
 MemoryRegion io_mem_rom, io_mem_notdirty;
ae23c9
 static MemoryRegion io_mem_unassigned;
ae23c9
-
ae23c9
-/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
ae23c9
-#define RAM_PREALLOC   (1 << 0)
ae23c9
-
ae23c9
-/* RAM is mmap-ed with MAP_SHARED */
ae23c9
-#define RAM_SHARED     (1 << 1)
ae23c9
-
ae23c9
-/* Only a portion of RAM (used_length) is actually used, and migrated.
ae23c9
- * This used_length size can change across reboots.
ae23c9
- */
ae23c9
-#define RAM_RESIZEABLE (1 << 2)
ae23c9
-
ae23c9
-/* UFFDIO_ZEROPAGE is available on this RAMBlock to atomically
ae23c9
- * zero the page and wake waiting processes.
ae23c9
- * (Set during postcopy)
ae23c9
- */
ae23c9
-#define RAM_UF_ZEROPAGE (1 << 3)
ae23c9
-
ae23c9
-/* RAM can be migrated */
ae23c9
-#define RAM_MIGRATABLE (1 << 4)
ae23c9
 #endif
ae23c9
 
ae23c9
 #ifdef TARGET_PAGE_BITS_VARY
ae23c9
diff --git a/include/exec/memory.h b/include/exec/memory.h
ae23c9
index 31eae0a..db46501 100644
ae23c9
--- a/include/exec/memory.h
ae23c9
+++ b/include/exec/memory.h
ae23c9
@@ -102,6 +102,26 @@ struct IOMMUNotifier {
ae23c9
 };
ae23c9
 typedef struct IOMMUNotifier IOMMUNotifier;
ae23c9
 
ae23c9
+/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
ae23c9
+#define RAM_PREALLOC   (1 << 0)
ae23c9
+
ae23c9
+/* RAM is mmap-ed with MAP_SHARED */
ae23c9
+#define RAM_SHARED     (1 << 1)
ae23c9
+
ae23c9
+/* Only a portion of RAM (used_length) is actually used, and migrated.
ae23c9
+ * This used_length size can change across reboots.
ae23c9
+ */
ae23c9
+#define RAM_RESIZEABLE (1 << 2)
ae23c9
+
ae23c9
+/* UFFDIO_ZEROPAGE is available on this RAMBlock to atomically
ae23c9
+ * zero the page and wake waiting processes.
ae23c9
+ * (Set during postcopy)
ae23c9
+ */
ae23c9
+#define RAM_UF_ZEROPAGE (1 << 3)
ae23c9
+
ae23c9
+/* RAM can be migrated */
ae23c9
+#define RAM_MIGRATABLE (1 << 4)
ae23c9
+
ae23c9
 static inline void iommu_notifier_init(IOMMUNotifier *n, IOMMUNotify fn,
ae23c9
                                        IOMMUNotifierFlag flags,
ae23c9
                                        hwaddr start, hwaddr end)
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9