thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

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

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