On 3/10/21 8:49 PM, Peter Xu wrote: > On Wed, Mar 10, 2021 at 08:12:54PM +0100, Philippe Mathieu-Daudé wrote: >> No need to create a local ISA I/O MemoryRegion, use get_system_io(). >> >> This partly reverts commit 5c63bcf7501527b844f61624957bdba254d75bfc. > > I think it's not a clean revert of that, see below. > >> >> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> >> --- >> hw/mips/jazz.c | 6 ++---- >> 1 file changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c >> index 1a0888a0fd5..9ac9361b7eb 100644 >> --- a/hw/mips/jazz.c >> +++ b/hw/mips/jazz.c >> @@ -158,7 +158,6 @@ static void mips_jazz_init(MachineState *machine, >> rc4030_dma *dmas; >> IOMMUMemoryRegion *rc4030_dma_mr; >> MemoryRegion *isa_mem = g_new(MemoryRegion, 1); >> - MemoryRegion *isa_io = g_new(MemoryRegion, 1); >> MemoryRegion *rtc = g_new(MemoryRegion, 1); >> MemoryRegion *i8042 = g_new(MemoryRegion, 1); >> MemoryRegion *dma_dummy = g_new(MemoryRegion, 1); >> @@ -259,11 +258,10 @@ static void mips_jazz_init(MachineState *machine, >> memory_region_add_subregion(address_space, 0x8000d000, dma_dummy); >> >> /* ISA bus: IO space at 0x90000000, mem space at 0x91000000 */ >> - memory_region_init(isa_io, NULL, "isa-io", 0x00010000); >> memory_region_init(isa_mem, NULL, "isa-mem", 0x01000000); >> - memory_region_add_subregion(address_space, 0x90000000, isa_io); >> + memory_region_add_subregion(address_space, 0x90000000, get_system_io()); > > The old code has an alias created just for adding subregion into > address_space: > > - /* ISA IO space at 0x90000000 */ > - memory_region_init_alias(isa, NULL, "isa_mmio", > - get_system_io(), 0, 0x01000000); > - memory_region_add_subregion(address_space, 0x90000000, isa); > - isa_mem_base = 0x11000000; > > While you didn't revert that part. Maybe that's the issue?
Hmm I'll have a look. This is not the series I'm working on, which is much bigger and not ready for posting yet. I simply looked for something similar (a bus mapped into sysbus) and remembered the ISA bus from Jazz machines. I'll see if I can find a better PoC. Thanks for having a look at this patch, Phil.