I wouldnt jump to assumptions there. perf shares some facilities with the
kernel on the source code level - they can be built both in the kernel and in
user-space.
But my main thought wasnt even to actually share the implementation - but to
actually synchronize when a piece of device emulation moves into the kernel.
It is arguably bad for performance in most cases when Qemu handles a given
device - so all the common devices should be kernel accelerated.
The version and testing matrix would be simplified significantly as well: as
kernel and qemu goes hand in hand, they are always on the same version.
So is it your argument that the difference and the duplication in x86
instruction emulation is a good thing? You said it some time ago that
the kvm x86 emulator was very messy and you wish it was cleaner.
While qemu's is indeed rather different (it's partly a translator/JIT), i'm
sure the decoder logic could be shared - and qemu has a slow-path
full-emulation fallback in any case, which is similar to what in-kernel
emulator does (IIRC ...).
That might have changed meanwhile.
Ingo
--