[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 1/9] memory: Initialize MemoryRegionOps for RAM memory re
From: |
P J P |
Subject: |
Re: [RFC PATCH 1/9] memory: Initialize MemoryRegionOps for RAM memory regions |
Date: |
Tue, 18 Aug 2020 15:22:01 +0530 (IST) |
+-- On Mon, 17 Aug 2020, Philippe Mathieu-Daudé wrote --+
| Fix by initializing the MemoryRegionOps to ram_device_mem_ops, this way the
| memory accesses are properly dispatched using
| memory_region_ram_device_read() / memory_region_ram_device_write().
|
| Fixes: 4a2e242bbb ("memory: Don't use memcpy for ram_device regions")
| Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
| ---
| Since v1: Corrected description (PJP)
| Cc: P J P <ppandit@redhat.com>
| ---
| softmmu/memory.c | 10 ++++++++++
| 1 file changed, 10 insertions(+)
|
| diff --git a/softmmu/memory.c b/softmmu/memory.c
| index 651705b7d1..8139da1a58 100644
| --- a/softmmu/memory.c
| +++ b/softmmu/memory.c
| @@ -1517,6 +1517,8 @@ void
memory_region_init_ram_shared_nomigrate(MemoryRegion *mr,
| Error *err = NULL;
| memory_region_init(mr, owner, name, size);
| mr->ram = true;
| + mr->ops = &ram_device_mem_ops;
| + mr->opaque = mr;
| mr->terminates = true;
I wonder if 'mr->ops = &ram_device_mem_ops' could be done in
memory_region_init() instead?
Otherwise looks okay.
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
- [RFC PATCH 0/9] hw/misc: Add support for interleaved memory accesses, Philippe Mathieu-Daudé, 2020/08/17
- [RFC PATCH 2/9] qtest: Add local qtest_mem_as() getter, Philippe Mathieu-Daudé, 2020/08/17
- [RFC PATCH 3/9] qtest: Directly use global address_space_memory when no CPU available, Philippe Mathieu-Daudé, 2020/08/17
- [RFC PATCH 4/9] hw/misc: Add interleaver device to make interleaved memory accesses, Philippe Mathieu-Daudé, 2020/08/17
- [RFC PATCH 1/9] memory: Initialize MemoryRegionOps for RAM memory regions, Philippe Mathieu-Daudé, 2020/08/17
- Re: [RFC PATCH 1/9] memory: Initialize MemoryRegionOps for RAM memory regions,
P J P <=
- [RFC PATCH 5/9] hw/misc: Add MMIO test device, Philippe Mathieu-Daudé, 2020/08/17
- [RFC PATCH 9/9] hw/misc/interleaver: Display subregions in 'info mtree', Philippe Mathieu-Daudé, 2020/08/17
- [RFC PATCH 6/9] hw/core/null-machine: Allow to use the MMIO 'test' device, Philippe Mathieu-Daudé, 2020/08/17
- [RFC PATCH 7/9] tests/qtest: Add generic MMIO tests, Philippe Mathieu-Daudé, 2020/08/17
- [RFC PATCH 8/9] memory: Allow memory region to display its subregions own descriptions, Philippe Mathieu-Daudé, 2020/08/17
- Re: [RFC PATCH 0/9] hw/misc: Add support for interleaved memory accesses, no-reply, 2020/08/17
- Re: [RFC PATCH 0/9] hw/misc: Add support for interleaved memory accesses, Philippe Mathieu-Daudé, 2020/08/22
- Re: [RFC PATCH 0/9] hw/misc: Add support for interleaved memory accesses, Philippe Mathieu-Daudé, 2020/08/22