[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/33] softmmu/physmem: Fix qemu_ram_remap() to handle shared anon
From: |
Paolo Bonzini |
Subject: |
[PULL 17/33] softmmu/physmem: Fix qemu_ram_remap() to handle shared anonymous memory |
Date: |
Tue, 15 Jun 2021 15:38:39 +0200 |
From: David Hildenbrand <david@redhat.com>
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 | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index b417f9c282..2f106d0680 100644
--- 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);
}
--
2.31.1
- [PULL 06/33] esp: only assert INTR_DC interrupt flag if selection fails, (continued)
- [PULL 06/33] esp: only assert INTR_DC interrupt flag if selection fails, Paolo Bonzini, 2021/06/15
- [PULL 02/33] vl: Fix an assert failure in error path, Paolo Bonzini, 2021/06/15
- [PULL 07/33] esp: only set ESP_RSEQ at the start of the select sequence, Paolo Bonzini, 2021/06/15
- [PULL 13/33] esp: fix migration version check in esp_is_version_5(), Paolo Bonzini, 2021/06/15
- [PULL 08/33] esp: allow non-DMA callback in esp_transfer_data() initial transfer, Paolo Bonzini, 2021/06/15
- [PULL 10/33] esp: ensure PDMA write transfers are flushed from the FIFO to the target immediately, Paolo Bonzini, 2021/06/15
- [PULL 16/33] softmmu/physmem: Fix ram_block_discard_range() to handle shared anonymous memory, Paolo Bonzini, 2021/06/15
- [PULL 11/33] esp: revert 75ef849696 "esp: correctly fill bus id with requested lun", Paolo Bonzini, 2021/06/15
- [PULL 04/33] block/scsi: correctly emulate the VPD block limits page, Paolo Bonzini, 2021/06/15
- [PULL 15/33] softmmu/physmem: Mark shared anonymous memory RAM_SHARED, Paolo Bonzini, 2021/06/15
- [PULL 17/33] softmmu/physmem: Fix qemu_ram_remap() to handle shared anonymous memory,
Paolo Bonzini <=
- [PULL 09/33] esp: handle non-DMA transfers from the target one byte at a time, Paolo Bonzini, 2021/06/15
- [PULL 23/33] softmmu/memory: Pass ram_flags to qemu_ram_alloc() and qemu_ram_alloc_internal(), Paolo Bonzini, 2021/06/15
- [PULL 22/33] softmmu/memory: Pass ram_flags to memory_region_init_ram_shared_nomigrate(), Paolo Bonzini, 2021/06/15
- [PULL 03/33] qemu-config: use qemu_opts_from_qdict, Paolo Bonzini, 2021/06/15
- [PULL 12/33] esp: correctly accumulate extended messages for PDMA, Paolo Bonzini, 2021/06/15
- [PULL 14/33] esp: store lun coming from the MESSAGE OUT phase, Paolo Bonzini, 2021/06/15
- [PULL 19/33] util/mmap-alloc: Factor out reserving of a memory region to mmap_reserve(), Paolo Bonzini, 2021/06/15
- [PULL 20/33] util/mmap-alloc: Factor out activating of memory to mmap_activate(), Paolo Bonzini, 2021/06/15
- [PULL 25/33] memory: Introduce RAM_NORESERVE and wire it up in qemu_ram_mmap(), Paolo Bonzini, 2021/06/15
- [PULL 33/33] configure: map x32 to cpu_family x86_64 for meson, Paolo Bonzini, 2021/06/15