All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v1 04/13] exec: Drop "shared" parameter from ram_block_add()
       [not found] <CGME20200204131635eucas1p12355b0ec54898ef7a1632ce73c0b9474@eucas1p1.samsung.com>
@ 2020-02-04 13:16 ` Igor Kotrasiński
  0 siblings, 0 replies; 3+ messages in thread
From: Igor Kotrasiński @ 2020-02-04 13:16 UTC (permalink / raw)
  To: david; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

> Properly store it in the flags of the ram block instead (and the flag
> even already exists and is used).
>
> E.g., qemu_ram_is_shared() now properly succeeds on all ram blocks that are
> actually shared.
>
> Cc: Richard Henderson <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> Signed-off-by: David Hildenbrand <address@hidden>
> ---
Reviewed-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>


[-- Attachment #2.1: Type: text/html, Size: 1425 bytes --]

[-- Attachment #2.2: Type: image/gif, Size: 13168 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 04/13] exec: Drop "shared" parameter from ram_block_add()
  2020-02-03 18:31 ` [PATCH v1 04/13] exec: Drop "shared" parameter from ram_block_add() David Hildenbrand
@ 2020-02-06 11:44   ` Richard Henderson
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2020-02-06 11:44 UTC (permalink / raw)
  To: David Hildenbrand, qemu-devel
  Cc: Paolo Bonzini, Richard Henderson, Eduardo Habkost,
	Dr . David Alan Gilbert, Michael S . Tsirkin

On 2/3/20 6:31 PM, David Hildenbrand wrote:
> Properly store it in the flags of the ram block instead (and the flag
> even already exists and is used).
> 
> E.g., qemu_ram_is_shared() now properly succeeds on all ram blocks that are
> actually shared.
> 
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  exec.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v1 04/13] exec: Drop "shared" parameter from ram_block_add()
  2020-02-03 18:31 [PATCH v1 00/13] Ram blocks with resizable anonymous allocations under POSIX David Hildenbrand
@ 2020-02-03 18:31 ` David Hildenbrand
  2020-02-06 11:44   ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: David Hildenbrand @ 2020-02-03 18:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Michael S . Tsirkin, David Hildenbrand,
	Dr . David Alan Gilbert, Paolo Bonzini, Richard Henderson

Properly store it in the flags of the ram block instead (and the flag
even already exists and is used).

E.g., qemu_ram_is_shared() now properly succeeds on all ram blocks that are
actually shared.

Cc: Richard Henderson <rth@twiddle.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 exec.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/exec.c b/exec.c
index f7525867ec..fc65c4f7ca 100644
--- a/exec.c
+++ b/exec.c
@@ -2249,7 +2249,7 @@ static void dirty_memory_extend(ram_addr_t old_ram_size,
     }
 }
 
-static void ram_block_add(RAMBlock *new_block, Error **errp, bool shared)
+static void ram_block_add(RAMBlock *new_block, Error **errp)
 {
     RAMBlock *block;
     RAMBlock *last_block = NULL;
@@ -2272,7 +2272,8 @@ static void ram_block_add(RAMBlock *new_block, Error **errp, bool shared)
             }
         } else {
             new_block->host = phys_mem_alloc(new_block->max_length,
-                                             &new_block->mr->align, shared);
+                                             &new_block->mr->align,
+                                             qemu_ram_is_shared(new_block));
             if (!new_block->host) {
                 error_setg_errno(errp, errno,
                                  "cannot set up guest memory '%s'",
@@ -2376,7 +2377,7 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
         return NULL;
     }
 
-    ram_block_add(new_block, &local_err, ram_flags & RAM_SHARED);
+    ram_block_add(new_block, &local_err);
     if (local_err) {
         g_free(new_block);
         error_propagate(errp, local_err);
@@ -2438,10 +2439,13 @@ RAMBlock *qemu_ram_alloc_internal(ram_addr_t size, ram_addr_t max_size,
     if (host) {
         new_block->flags |= RAM_PREALLOC;
     }
+    if (share) {
+        new_block->flags |= RAM_SHARED;
+    }
     if (resizeable) {
         new_block->flags |= RAM_RESIZEABLE;
     }
-    ram_block_add(new_block, &local_err, share);
+    ram_block_add(new_block, &local_err);
     if (local_err) {
         g_free(new_block);
         error_propagate(errp, local_err);
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-06 11:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200204131635eucas1p12355b0ec54898ef7a1632ce73c0b9474@eucas1p1.samsung.com>
2020-02-04 13:16 ` [PATCH v1 04/13] exec: Drop "shared" parameter from ram_block_add() Igor Kotrasiński
2020-02-03 18:31 [PATCH v1 00/13] Ram blocks with resizable anonymous allocations under POSIX David Hildenbrand
2020-02-03 18:31 ` [PATCH v1 04/13] exec: Drop "shared" parameter from ram_block_add() David Hildenbrand
2020-02-06 11:44   ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.