On 16 May 2016 at 18:13, Sergey Fedorov <serge.f...@gmail.com> wrote: > On 16/05/16 19:09, Peter Maydell wrote: >> @@ -1996,7 +1997,10 @@ int page_unprotect(target_ulong address, uintptr_t >> pc, void *puc) >> >> /* and since the content will be modified, we must invalidate >> the corresponding translated code. */ >> - tb_invalidate_phys_page(addr, pc, puc, true); >> + if (tb_invalidate_phys_page(addr, pc)) { >> + mmap_unlock(); >> + cpu_resume_from_signal(current_cpu, puc); >> + } >> #ifdef DEBUG_TB_CHECK >> tb_invalidate_check(addr); >> #endif > > Just my 2 cents: we could allow that cpu_resume_from_signal() call and > add mmap_lock_reset() similar to tb_lock_reset() to handle resetting > mmap_lock after a long jump.
There's no need -- if you look at the rest of the patchset, that call goes away from this function entirely and ends up in the caller, at which point this function's handling of the mmap lock is the straightforward "lock on entry, unlock before return". thanks -- PMM