sysbus: Remove sysbus_mmio_unmap
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Peter Maydell
Reviewed-byQuoted 5 lines · Peter Delevoryas
Cedric removed usage of this function in a previous commit.
Fixes 981b1c6266c6 ("spapr/xive: rework the mapping the KVM memory regions")Signed-off-by Peter Delevoryas <[email protected]>
We only added this function for the XIVE in the first place so I guess it makes sense to remove it now it's unused. (People doing complicated stuff that needs to unmap MRs should probably not be using sysbus_mmio_map()/unmap() anyway...)
-- PMM
Cédric Le Goater
Reviewed-byQuoted 4 lines · Peter Delevoryas
Cedric removed usage of this function in a previous commit.
Fixes 981b1c6266c6 ("spapr/xive: rework the mapping the KVM memory regions")Signed-off-by Peter Delevoryas <[email protected]>
Thanks,
C.
Quoted 38 lines
--- hw/core/sysbus.c | 10 ---------- include/hw/sysbus.h | 1 - 2 files changed, 11 deletions(-)hw/core/sysbus.c +0
-10@@ -154,16 +154,6 @@ static void sysbus_mmio_map_common(SysBusDevice *dev, int n, hwaddr addr, } } -void sysbus_mmio_unmap (SysBusDevice *dev,int n) -{ -assert (n >=0 && n < dev->num_mmio); - -if (dev->mmio[n].addr != (hwaddr)-1 ) { -memory_region_del_subregion (get_system_memory (), dev->mmio[n].memory); - dev->mmio[n].addr = (hwaddr)-1 ; - } -} -void sysbus_mmio_map (SysBusDevice *dev,int n,hwaddr addr) {sysbus_mmio_map_common (dev, n, addr, false,0 );include/hw/sysbus.h +0
-1@@ -82,7 +82,6 @@ qemu_irq sysbus_get_connected_irq(SysBusDevice *dev, int n);void sysbus_mmio_map (SysBusDevice *dev,int n,hwaddr addr);void sysbus_mmio_map_overlap (SysBusDevice *dev,int n,hwaddr addr,int priority); -void sysbus_mmio_unmap (SysBusDevice *dev,int n);void sysbus_add_io (SysBusDevice *dev,hwaddr addr,MemoryRegion *mem);MemoryRegion *sysbus_address_space (SysBusDevice *dev);
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 06/14] aspeed: Add system-memory QOM link to SoC
Review
Quoted 11 lines · Peter Delevoryas
Right now it's just defined as the regular global system memory. If we migrate all the SoC code to use this property instead of directly calling
get_system_memory(), then we can restrict the memory container for the SoC, which will be useful for multi-SoC machines.Signed-off-by Peter Delevoryas <[email protected]>static Property aspeed_soc_properties[] = {
(quoted diff) +2
-0+ DEFINE_PROP_LINK("system-memory", AspeedSoCState, system_memory, + TYPE_MEMORY_REGION, MemoryRegion *),
To the extent that we have a convention, we tend to call this property on an SoC or CPU "memory", I think. (Better suggestions welcome...)
-- PMM
Re: [PATCH 06/14] aspeed: Add system-memory QOM link to SoC
Quoted 13 lines · Peter Maydell
Quoted 7 lines · Peter Delevoryas
Right now it's just defined as the regular global system memory. If we migrate all the SoC code to use this property instead of directly calling
get_system_memory(), then we can restrict the memory container for the SoC, which will be useful for multi-SoC machines.Signed-off-by Peter Delevoryas <[email protected]>
Quoted 7 lines
Review
Quoted 3 lines
static Property aspeed_soc_properties[] = {
(quoted diff) +2
-0+ DEFINE_PROP_LINK("system-memory", AspeedSoCState, system_memory, + TYPE_MEMORY_REGION, MemoryRegion *),To the extent that we have a convention, we tend to call this property on an SoC or CPU "memory", I think. (Better suggestions welcome...)
Oh oops, yes, in hindsight that is very obvious. I’ll change this from “system-memory” to “memory”.
Quoted 2 lines
-- PMM
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 11/14] aspeed: Switch to create_unimplemented_device_in
Quoted 16 lines · Peter Delevoryas
Signed-off-by Peter Delevoryas <[email protected]>--- hw/arm/aspeed_ast10x0.c | 10 ++++------ hw/arm/aspeed_ast2600.c | 19 ++++++++++--------- hw/arm/aspeed_soc.c | 9 +++++---- 3 files changed, 19 insertions(+), 19 deletions(-)hw/arm/aspeed_ast10x0.c +0
-0@@ -158,12 +158,10 @@ static void aspeed_soc_ast1030_realize(DeviceState *dev_soc, Error **errp) }/* General I/O memory space to catch all unimplemented device */
hw/arm/aspeed_ast10x0.c static void aspeed_soc_ast1030_realize(DeviceState *dev_soc, Error **errp) · line 164
Quoted 10 lines
hw/arm/aspeed_ast10x0.c +4
-6-create_unimplemented_device ("aspeed.sbc" , - sc->memmap[ASPEED_DEV_SBC ], -0x40000 ); -create_unimplemented_device ("aspeed.io" , - sc->memmap[ASPEED_DEV_IOMEM ], -ASPEED_SOC_IOMEM_SIZE ); +create_unimplemented_device_in ("aspeed.sbc" , sc->memmap[ASPEED_DEV_SBC ], +0x40000 , s->system_memory); +create_unimplemented_device_in ("aspeed.io" , sc->memmap[ASPEED_DEV_IOMEM ], +ASPEED_SOC_IOMEM_SIZE , s->system_memory);
This is SoC code, so it should probably be handling its unimplemented devices by creating and mapping TYPE_UNIMPLEMENTED_DEVICE child objects directly, the same way it handles all its other child devices.
thanks
-- PMM
Re: [PATCH 11/14] aspeed: Switch to create_unimplemented_device_in
Quoted 20 lines · Peter Maydell
Quoted 15 lines · Peter Delevoryas
Signed-off-by Peter Delevoryas <[email protected]>---
hw/arm/aspeed_ast10x0.c | 10 ++++------ hw/arm/aspeed_ast2600.c | 19 ++++++++++--------- hw/arm/aspeed_soc.c | 9 +++++---- 3 files changed, 19 insertions(+), 19 deletions(-)hw/arm/aspeed_ast10x0.c +0
-0@@ -158,12 +158,10 @@ static void aspeed_soc_ast1030_realize(DeviceState *dev_soc, Error **errp) }
Quoted 15 lines
hw/arm/aspeed_ast10x0.c static void aspeed_soc_ast1030_realize(DeviceState *dev_soc, Error **errp) · line 164
Quoted 11 lines
hw/arm/aspeed_ast10x0.c +4
-6/* General I/O memory space to catch all unimplemented device */ -create_unimplemented_device ("aspeed.sbc" , - sc->memmap[ASPEED_DEV_SBC ], -0x40000 ); -create_unimplemented_device ("aspeed.io" , - sc->memmap[ASPEED_DEV_IOMEM ], -ASPEED_SOC_IOMEM_SIZE ); +create_unimplemented_device_in ("aspeed.sbc" , sc->memmap[ASPEED_DEV_SBC ], +0x40000 , s->system_memory); +create_unimplemented_device_in ("aspeed.io" , sc->memmap[ASPEED_DEV_IOMEM ], +ASPEED_SOC_IOMEM_SIZE , s->system_memory);This is SoC code, so it should probably be handling its unimplemented devices by creating and mapping
TYPE_UNIMPLEMENTED_DEVICEchild objects directly, the same way it handles all its other child devices.
Ah, right. I’ll include a patch to create the device as a regular child object, and after that it will probably make more sense to remove “create_unimplemented_device_in” too and just do that memory mapping directly. Especially since I’m going to remove the “sysbus_mmio_map_overlap_in” function too.
Quoted 3 lines
thanks
-- PMM