projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cdfa56c
)
softmmu/physmem: Fix qemu_ram_remap() to handle shared anonymous memory
author
David Hildenbrand
<david@redhat.com>
Tue, 6 Apr 2021 08:01:26 +0000
(10:01 +0200)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Tue, 15 Jun 2021 18:27:37 +0000
(20:27 +0200)
RAM_SHARED now also properly indicates shared anonymous memory. Let's check
that flag for anonymous memory as well, to restore the proper mapping.
Fixes: 06329ccecfa0 ("mem: add share parameter to memory-backend-ram")
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <
20210406080126
.24010-4-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
softmmu/physmem.c
patch
|
blob
|
history
diff --git
a/softmmu/physmem.c
b/softmmu/physmem.c
index c0a3c47167c22249f34d211ad81969e625208735..b75d205e8a4add9ca2e2a83918d4a0ae6e61d31c 100644
(file)
--- a/
softmmu/physmem.c
+++ b/
softmmu/physmem.c
@@
-2243,13
+2243,13
@@
void qemu_ram_remap(ram_addr_t addr, ram_addr_t length)
abort();
} else {
flags = MAP_FIXED;
+ flags |= block->flags & RAM_SHARED ?
+ MAP_SHARED : MAP_PRIVATE;
if (block->fd >= 0) {
- flags |= (block->flags & RAM_SHARED ?
- MAP_SHARED : MAP_PRIVATE);
area = mmap(vaddr, length, PROT_READ | PROT_WRITE,
flags, block->fd, offset);
} else {
- flags |= MAP_
PRIVATE | MAP_
ANONYMOUS;
+ flags |= MAP_ANONYMOUS;
area = mmap(vaddr, length, PROT_READ | PROT_WRITE,
flags, -1, 0);
}