On 20/05/2020 11:07, Igor Mammedow wrote: > On Thu, 14 May 2020 14:13:11 +0200 > Philippe Mathieu-Daudé <f4...@amsat.org> wrote: > >> On 5/14/20 12:09 PM, Igor Mammedov wrote: >>> On Sun, 10 May 2020 13:35:05 +0200 >>> Philippe Mathieu-Daudé <f4...@amsat.org> wrote: >>> >>>> Since commit 82b911aaff3, machine_run_board_init() checks for >>>> ram_memdev_id and consume it. As TYPE_SUN4M_MEMORY is no more >>>> needed, replace it by the generic memdev allocated MemoryRegion >>>> and remove it. This completes commit b2554752b1da7c8f. >>> >>> I don't get justification here. >>> You are removing 'frontend' device model that has little/nothing >>> to do with how backend is instantiated. >>> >>> TYPE_SUN4M_MEMORY is analog to pc-dimm, only for builtin RAM >>> (not really useful but could serve as an example). >> >> I have no idea about the benefits of using memory frontend/backend >> with emulation. Is there documentation and examples? I'm seeing this >> code as a complicated way of doing a simple thing, but I guess I'm >> missing the big picture here. > > Examples are pc-dimm and nv-dimm which thanks to separation easily > reusable across pc/spapr/virt-arm. > > Having frontend is also useful for mgmt purposes, where HMP/QMP > just has to enumerate all RAM devices, otherwise boards would have > to provide a callback to describe their custom mappings. > > But for embed boards with a single blob of RAM nailed down, > having frontend is probably overkill (at least ATM). > So I'm fine with this patch /with amended commit message/
I don't feel too strongly about this, however if there is a standard way of doing things then I would prefer to do that since it makes it easier for me as a maintainer if there are existing (and up-to-date) examples that I can use as a reference. Presumably it also means that if HMP/QMP commands are added in relation to machine RAM then the SPARC machines would get that new functionality automatically... ATB, Mark.