On Thu, 14 Feb 2019 18:30:37 +0000 Peter Maydell <peter.mayd...@linaro.org> wrote:
> On Thu, 14 Feb 2019 at 14:07, Igor Mammedov <imamm...@redhat.com> wrote: > > Also some boards (ab)use memory_region_allocate_system_memory(), calling it > > several > > times to allocate various fixed sized chunks of RAM and ROMs, which is > > problematic > > to map to a single initial RAM Machine::memdev backend and is currently > > broken if > > -mem-path points to a not hugepage pool. > > These boards are buggy and we could fix them, if we wanted to > keep the existing API. We should in that case add assertions > that memory_region_allocate_system_memory() is called once and > only once, which would let "make check" enforce the rule. we can do this, but I'd rather remove memory_region_allocate_system_memory() API altogether which looks like overkill for most boards and use simpler memory_region_init_ram(). Then boards that need numa/hugepages could be switched to newer memdev/device model instead of using memory_region_init_ram() directly. My end-goal in all this exercise is to switch initial RAM to frontend/backend model and replace adhoc legacy numa memory code (-numa node,mem=size & default numa splitting) handling with a generic device or memdev based one. > > thanks > - PMM