Messages in this thread | | | Date | Mon, 01 Mar 2010 14:13:32 -0500 | From | john cooper <> | Subject | Re: use of setjmp/longjmp in x86 emulator. |
| |
Gleb Natapov wrote:
> Think about what happens if in the middle of > 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.
setjmp/longjmp are useful constructs in general but IME are better suited for infrequent exceptions vs. routine usage.
If the issue is finding some clean and regular way 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?
-- john.cooper@third-harmonic.com
| |