I think ucall should work for pthread (shared address space of eitherkvm_run or guest memories), however my thought was even simpler thanthat, something like:

- in guest code: do GUEST_SYNC after each GUEST_ASSERT - introduce a global_sem - in vcpu thread: when receive GUEST_SYNC, do "sem_post(&global_sem)" - in main thread: replace all usleep() with "sem_wait(&global_sem)"