summary refs log tree commit diff stats
path: root/include/exec/memory.h
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2025-01-15 11:00:31 -0800
committerFabiano Rosas <farosas@suse.de>2025-01-29 11:43:04 -0300
commit6169f1193657d0ba630a2ce33cef639ae918bce4 (patch)
tree33fd65ef73cb97e0b000bcb75e024b5a5d9226af /include/exec/memory.h
parent9fb40bb9621df9acb88a8128bee2e0f68631b245 (diff)
downloadfocaccia-qemu-6169f1193657d0ba630a2ce33cef639ae918bce4.tar.gz
focaccia-qemu-6169f1193657d0ba630a2ce33cef639ae918bce4.zip
memory: add RAM_PRIVATE
Define the RAM_PRIVATE flag.

In RAMBlock creation functions, if MAP_SHARED is 0 in the flags parameter,
in a subsequent patch the implementation may still create a shared mapping
if other conditions require it.  Callers who specifically want a private
mapping, eg for objects specified by the user, must pass RAM_PRIVATE.

After RAMBlock creation, MAP_SHARED in the block's flags indicates whether
the block is shared or private, and MAP_PRIVATE is omitted.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/1736967650-129648-6-git-send-email-steven.sistare@oracle.com
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'include/exec/memory.h')
-rw-r--r--include/exec/memory.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 3ee1901b52..9f73b59867 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -246,6 +246,16 @@ typedef struct IOMMUTLBEvent {
 /* RAM can be private that has kvm guest memfd backend */
 #define RAM_GUEST_MEMFD   (1 << 12)
 
+/*
+ * In RAMBlock creation functions, if MAP_SHARED is 0 in the flags parameter,
+ * the implementation may still create a shared mapping if other conditions
+ * require it.  Callers who specifically want a private mapping, eg objects
+ * specified by the user, must pass RAM_PRIVATE.
+ * After RAMBlock creation, MAP_SHARED in the block's flags indicates whether
+ * the block is shared or private, and MAP_PRIVATE is omitted.
+ */
+#define RAM_PRIVATE (1 << 13)
+
 static inline void iommu_notifier_init(IOMMUNotifier *n, IOMMUNotify fn,
                                        IOMMUNotifierFlag flags,
                                        hwaddr start, hwaddr end,