From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2MFj-000113-Vo for qemu-devel@nongnu.org; Mon, 16 May 2016 13:24:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2MFe-0003Rx-NC for qemu-devel@nongnu.org; Mon, 16 May 2016 13:24:22 -0400 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:35367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2MFe-0003RK-Fc for qemu-devel@nongnu.org; Mon, 16 May 2016 13:24:18 -0400 Received: by mail-lf0-x242.google.com with SMTP id u64so15195193lff.2 for ; Mon, 16 May 2016 10:24:18 -0700 (PDT) References: <1463414992-8357-1-git-send-email-peter.maydell@linaro.org> <1463414992-8357-2-git-send-email-peter.maydell@linaro.org> <5739FFC5.9010706@gmail.com> From: Sergey Fedorov Message-ID: <573A023F.10704@gmail.com> Date: Mon, 16 May 2016 20:24:15 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/5] translate-all.c: Don't pass puc, locked to tb_invalidate_phys_page() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Paolo Bonzini , Riku Voipio , Richard Henderson , Eduardo Habkost , Patch Tracking On 16/05/16 20:15, Peter Maydell wrote: > On 16 May 2016 at 18:13, Sergey Fedorov 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". Reviewed-by: Sergey Fedorov Thanks, Sergey