[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 01/11] hw/arm/aspeed: Do not directly map ram container onto m
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 01/11] hw/arm/aspeed: Do not directly map ram container onto main address bus |
Date: |
Sat, 17 Apr 2021 12:30:18 +0200 |
The RAM container is exposed as an AddressSpace.
AddressSpaces root MemoryRegion must not be mapped into other
MemoryRegion, therefore map the RAM container using an alias.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/arm/aspeed.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index a17b75f4940..daeef5b32a2 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -40,6 +40,7 @@ struct AspeedMachineState {
AspeedSoCState soc;
MemoryRegion ram_container;
+ MemoryRegion ram_container_alias;
MemoryRegion max_ram;
bool mmio_exec;
char *fmc_model;
@@ -339,9 +340,12 @@ static void aspeed_machine_init(MachineState *machine)
}
qdev_realize(DEVICE(&bmc->soc), NULL, &error_abort);
+ memory_region_init_alias(&bmc->ram_container_alias, NULL,
+ "ram-container-alias", &bmc->ram_container, 0,
+ memory_region_size(&bmc->ram_container));
memory_region_add_subregion(get_system_memory(),
sc->memmap[ASPEED_DEV_SDRAM],
- &bmc->ram_container);
+ &bmc->ram_container_alias);
max_ram_size = object_property_get_uint(OBJECT(&bmc->soc), "max-ram-size",
&error_abort);
--
2.26.3
- [PATCH v2 00/11] memory: Forbid mapping AddressSpace root MemoryRegion, Philippe Mathieu-Daudé, 2021/04/17
- [PATCH v2 01/11] hw/arm/aspeed: Do not directly map ram container onto main address bus,
Philippe Mathieu-Daudé <=
- [PATCH v2 02/11] hw/aspeed/smc: Use the RAM memory region for DMAs, Philippe Mathieu-Daudé, 2021/04/17
- [PATCH v2 03/11] hw/arm/aspeed: Do not sysbus-map mmio flash region directly, use alias, Philippe Mathieu-Daudé, 2021/04/17
- [PATCH v2 04/11] hw/pci-host: Rename Raven ASIC PCI bridge as raven.c, Philippe Mathieu-Daudé, 2021/04/17
- [PATCH v2 05/11] hw/pci-host/raven: Add PCI_IO_BASE_ADDR definition, Philippe Mathieu-Daudé, 2021/04/17
- [PATCH v2 06/11] hw/pci-host/raven: Assert PCI I/O AddressSpace is based at 0x80000000, Philippe Mathieu-Daudé, 2021/04/17