On Mon, Mar 01, 2010 at 02:13:32PM -0500, john cooper wrote:
Gleb Natapov wrote:Exception condition during instruction emulation _is_
Think about what happens if in the middle ofsetjmp/longjmp are useful constructs in general but
instruction emulation some data from device emulated in userspace is
needed. Emulator should be able to tell KVM that exit to userspace is
needed and restart instruction emulation when data is available.
IME are better suited for infrequent exceptions vs.
Although setjmp/longjmp that I know about
are routine usage. See QEMU TCG main loop or userspace
If the issue is finding some clean and regular wayI don't see how state machine will help. But the goal
to back out from (and possibly reeneter) logic
expressed within nested function invocations, have
you considered turning the problem inside out and
using a state machine approach?
is not to rewrite emulator.c (this will no be excepted
by kvm maintainers), but improve it gradually.