On 230310 0802, Alexander Bulekov wrote: > On 230310 1245, Peter Maydell wrote: > > On Fri, 10 Mar 2023 at 12:32, Alexander Bulekov <alx...@bu.edu> wrote: > > > This MR seems to be "lsi-ram". > > > > > > From hw/scsi/lsi53c895a.c: > > > > > > memory_region_init_io(&s->ram_io, OBJECT(s), &lsi_ram_ops, s, > > > "lsi-ram", 0x2000); > > > > > > So the LSI device is reading an LSI "Script" from its own IO region.. In > > > this particular case, I think there was no reason to use > > > memory_region_init_io rather than memory_region_init_ram, but this makes > > > me worried that there are other devices that use something like this. > > > > This particular device predates the entire MemoryRegion set of > > abstractions, so it might have seemed easier at the time. > > The endianness handling of the current code is also a bit > > confusing and might make it tricky to convert to a RAM MR. > > With my trivial mr_io - > mr_ram conversion, I no longer hit the > re-entrancy tracepoint, and my livecd boots, but it's probably not > exhaustively using the script functionality.. > > Does the endianness actually cause a problem? As long as all accesses > (CPU -> LSI_RAM and LSI -> LSI_RAM) occur through the address_space API, > are we safe? > -Alex
Or maybe a rom_device with memory_region_rom_device_set_romd(romd_mode = false) is better here?