On 1 December 2016 at 13:33, Liviu Ionescu <i...@livius.net> wrote:
>> On 1 Dec 2016, at 14:38, Peter Maydell <peter.mayd...@linaro.org> wrote:
>> ... clean up QEMU's code so
>> that it is less interdependent ...
> that's a good idea anyway, but this does not address the current issue.
> if I'd have a separate library with ARM TCG, for Cortex-M emulation
> I'd probably write a simple memory management routine, to address
> flash, ram & peripherals and with an equally simple variant of the
> peripheral implementation I'd be done. no need to handle MMU,
> no need to worry about VM, KVM, save/restore objects, monitor,
> etc (actually no need for the complicated objects implementation at all).
The advantage of the 'MMU' layer for M profile is that it is the
path to having a working MPU (which we don't implement quite yet
but it would be nice to some day). The system emulation also pretty
much assumes our softmmu layer as the way to handle fast path
(memory) versus slowpath (device emulation, watchpoints, etc).
The advantage of save/restore is that users can do snapshotting, which
is a really useful debug technique.
You could throw away all our implementations of devices and
backends and so on, but then you'd have to reimplement them all
yourself (including things like network device backends), which
is a fair bit of work.