On 23 April 2012 01:06, Xin Tong <xerox.time.t...@gmail.com> wrote: > QEMU uses this very hard to understand setjmp and longjmp to handle > asynchronous interrupt. what i do not understand is that say one of > the process is doing a context switching in the guest os. tlb_flush > gets called, what if in the middle of tlb_flush, an interrupt comes in > ( longjmp executed ).
We don't do a longjmp for interrupts. Mostly they're used for exceptions (eg "memory access faulted"), so they only happen in fairly restricted contexts where it is safe to longjmp. -- PMM