translate-all.c: Don't pass puc, locked to tb_invalidate_phys_page()
commit75809229bbf28b371afce14921ff5be98ddc5faa
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 17 May 2016 14:18:02 +0000 (17 15:18 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 9 Jun 2016 14:55:02 +0000 (9 15:55 +0100)
treec2bef3ace4ece1689bb554c3ab38ee2158e073c4
parent9bbbf6497a10c5066af415d2d187a18679ffb18c
translate-all.c: Don't pass puc, locked to tb_invalidate_phys_page()

The user-mode-only function tb_invalidate_phys_page() is only
called from two places:
 * page_unprotect(), which passes in a non-zero pc, a puc pointer
   and the value 'true' for the locked argument
 * page_set_flags(), which passes in a zero pc, a NULL puc pointer
   and a 'false' locked argument

If the pc is non-zero then we may call cpu_resume_from_signal(),
which does a longjmp out of the calling code (and out of the
signal handler); this is to cover the case of a target CPU with
"precise self-modifying code" (currently only x86) executing
a store instruction which modifies code in the same TB as the
store itself. Rather than doing the longjump directly here,
return a flag to the caller which indicates whether the current
TB was modified, and move the longjump to page_unprotect.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Sergey Fedorov <sergey.fedorov@linaro.org>
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Riku Voipio <riku.voipio@linaro.org>
Message-id: 1463494687-25947-2-git-send-email-peter.maydell@linaro.org
translate-all.c