[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 34/46] RFC: softmmu/memory: Add ops to memory_region_ram_init_
From: |
Jonathan Cameron |
Subject: |
[PATCH v7 34/46] RFC: softmmu/memory: Add ops to memory_region_ram_init_from_file |
Date: |
Sun, 6 Mar 2022 17:41:25 +0000 |
From: Jonathan Cameron <jonathan.cameron@huawei.com>
Inorder to implement memory interleaving we need a means to proxy
the calls. Adding mem_ops allows such proxying.
Note should have no impact on use cases not using _dispatch_read/write.
For now, only file backed hostmem is considered to seek feedback on
the approach before considering other hostmem backends.
Signed-off-by: Jonathan Cameron <jonathan.cameron@huawei.com>
---
softmmu/memory.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/softmmu/memory.c b/softmmu/memory.c
index 8060c6de78..99bd817150 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -1606,6 +1606,15 @@ void memory_region_init_ram_from_file(MemoryRegion *mr,
Error *err = NULL;
memory_region_init(mr, owner, name, size);
mr->ram = true;
+
+ /*
+ * ops used only when directly accessing via
+ * - memory_region_dispatch_read()
+ * - memory_region_dispatch_write()
+ */
+ mr->ops = &ram_device_mem_ops;
+ mr->opaque = mr;
+
mr->readonly = readonly;
mr->terminates = true;
mr->destructor = memory_region_destructor_ram;
--
2.32.0
- Re: [PATCH v7 24/46] acpi/cxl: Add _OSC implementation (9.14.2), (continued)
- [PATCH v7 25/46] acpi/cxl: Create the CEDT (9.14.1), Jonathan Cameron, 2022/03/06
- [PATCH v7 26/46] hw/cxl/component: Add utils for interleave parameter encoding/decoding, Jonathan Cameron, 2022/03/06
- [PATCH v7 27/46] hw/cxl/host: Add support for CXL Fixed Memory Windows., Jonathan Cameron, 2022/03/06
- [PATCH v7 28/46] acpi/cxl: Introduce CFMWS structures in CEDT, Jonathan Cameron, 2022/03/06
- [PATCH v7 29/46] hw/pci-host/gpex-acpi: Add support for dsdt construction for pxb-cxl, Jonathan Cameron, 2022/03/06
- [PATCH v7 30/46] pci/pcie_port: Add pci_find_port_by_pn(), Jonathan Cameron, 2022/03/06
- [PATCH v7 31/46] CXL/cxl_component: Add cxl_get_hb_cstate(), Jonathan Cameron, 2022/03/06
- [PATCH v7 32/46] mem/cxl_type3: Add read and write functions for associated hostmem., Jonathan Cameron, 2022/03/06
- [PATCH v7 33/46] cxl/cxl-host: Add memops for CFMWS region., Jonathan Cameron, 2022/03/06
- [PATCH v7 34/46] RFC: softmmu/memory: Add ops to memory_region_ram_init_from_file,
Jonathan Cameron <=
- [PATCH v7 35/46] hw/cxl/component Add a dumb HDM decoder handler, Jonathan Cameron, 2022/03/06
- [PATCH v7 36/46] i386/pc: Enable CXL fixed memory windows, Jonathan Cameron, 2022/03/06
- [PATCH v7 37/46] tests/acpi: q35: Allow addition of a CXL test., Jonathan Cameron, 2022/03/06
- [PATCH v7 38/46] qtests/bios-tables-test: Add a test for CXL emulation., Jonathan Cameron, 2022/03/06
- [PATCH v7 39/46] tests/acpi: Add tables for CXL emulation., Jonathan Cameron, 2022/03/06
- [PATCH v7 40/46] qtest/cxl: Add more complex test cases with CFMWs, Jonathan Cameron, 2022/03/06
- [PATCH v7 41/46] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl, Jonathan Cameron, 2022/03/06
- [PATCH v7 42/46] qtest/cxl: Add aarch64 virt test for CXL, Jonathan Cameron, 2022/03/06
- [PATCH v7 43/46] docs/cxl: Add initial Compute eXpress Link (CXL) documentation., Jonathan Cameron, 2022/03/06
- [PATCH v7 44/46] pci-bridge/cxl_upstream: Add a CXL switch upstream port, Jonathan Cameron, 2022/03/06