On Thu, Feb 05, 2026 at 02:13:18AM +0100, BALATON Zoltan wrote:
> v4:
> - separate patch converting Sun machines from memory_region_init_ram_nomigrate
> - split helper to init ram into two functions: setup and error_propagate
> - also use memory_region_init_io in memory_region_init_ram_device_ptr
> 
> v3:
> - rebased on master after some patches were merged
> - drop some more line from memory-region-housekeeping.cocci
> - added comment to explain what factored out helper does
> - some more clean ups included
> 
> BALATON Zoltan (8):
>   hw/display/{cg3,tcx}: Do not use memory_region_init_rom_nomigrate()
>   memory: Remove memory_region_init_rom_nomigrate()
>   sun4m,sun4u,tcx: Do not use memory_region_init_ram_nomigrate()
>   memory: Remove memory_region_init_ram_nomigrate()

Could you help explain why we need to remove the above two small helpers?

Not saying that we can't remove them, but I don't yet see the point of
open-code those readonly=true setup either, or any problem with having the
smaller helpers when ram_flags=0.  Small helpers sometimes help readability.

Some of them are going backwards againist what the cocci scripts were
suggesting previously, like:

- memory_region_init_ram_nomigrate(E1, E2, E3, E4, E5);
+ memory_region_init_rom_nomigrate(E1, E2, E3, E4, E5);
  ... WHEN != E1
- memory_region_set_readonly(E1, true);

So you suggest open-code instead.  Why?

Is it required for your follow up cleanups?

Thanks,

>   memory: Factor out common ram region initialization
>   memory: Add internal memory_region_register_ram function
>   memory: Shorten memory_region_init_ram_device_ptr and
>     memory_region_init_rom_device
>   memory: Factor out more common ram region initialization
> 
>  docs/devel/memory.rst                         |   9 +-
>  hw/display/cg3.c                              |   6 +-
>  hw/display/tcx.c                              |  11 +-
>  hw/display/vga.c                              |   4 +-
>  hw/sparc/sun4m.c                              |  15 +-
>  hw/sparc64/sun4u.c                            |   9 +-
>  hw/xtensa/xtfpga.c                            |   4 +-
>  include/system/memory.h                       |  49 ----
>  .../memory-region-housekeeping.cocci          |  47 ---
>  system/memory.c                               | 269 ++++++------------
>  10 files changed, 120 insertions(+), 303 deletions(-)
> 
> -- 
> 2.41.3
> 

-- 
Peter Xu


Reply via email to