On 4/19/21 2:43 AM, Philippe Mathieu-Daudé wrote:
Instead of using a device specific feature for mapping the flash memory multiple times over a wider region, use the generic memory_region_add_subregion_aliased() helper.There is no change in the memory layout: - before: (qemu) info mtree 00000000fe000000-00000000ffffffff (prio 0, i/o): pflash 00000000fe000000-00000000fe7fffff (prio 0, romd): alias pflash-alias @musicpal.flash 0000000000000000-00000000007fffff 00000000fe800000-00000000feffffff (prio 0, romd): alias pflash-alias @musicpal.flash 0000000000000000-00000000007fffff 00000000ff000000-00000000ff7fffff (prio 0, romd): alias pflash-alias @musicpal.flash 0000000000000000-00000000007fffff 00000000ff800000-00000000ffffffff (prio 0, romd): alias pflash-alias @musicpal.flash 0000000000000000-00000000007fffff - after: 00000000fe000000-00000000ffffffff (prio 0, i/o): masked musicpal.flash [span of 8 MiB] 00000000fe000000-00000000fe7fffff (prio 0, romd): alias musicpal.flash [#0/4] @musicpal.flash 0000000000000000-00000000007fffff 00000000fe800000-00000000feffffff (prio 0, romd): alias musicpal.flash [#1/4] @musicpal.flash 0000000000000000-00000000007fffff 00000000ff000000-00000000ff7fffff (prio 0, romd): alias musicpal.flash [#2/4] @musicpal.flash 0000000000000000-00000000007fffff 00000000ff800000-00000000ffffffff (prio 0, romd): alias musicpal.flash [#3/4] @musicpal.flash 0000000000000000-00000000007fffff Flatview is the same: (qemu) info mtree -f FlatView #0 AS "memory", root: system AS "cpu-memory-0", root: system AS "emac-dma", root: system Root memory region: system 00000000fe000000-00000000fe7fffff (prio 0, romd): musicpal.flash 00000000fe800000-00000000feffffff (prio 0, romd): musicpal.flash 00000000ff000000-00000000ff7fffff (prio 0, romd): musicpal.flash 00000000ff800000-00000000ffffffff (prio 0, romd): musicpal.flash Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]> r~
