[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/4] translate-all.c: Remove cpu_unlink_tb()
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PATCH 4/4] translate-all.c: Remove cpu_unlink_tb() |
Date: |
Thu, 9 May 2013 12:13:26 +0400 |
From: Peter Maydell <address@hidden>
The (unsafe) function cpu_unlink_tb() is now unused, so we can simply
remove it and any code that was only used by it.
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Blue Swirl <address@hidden>
(cherry picked from commit 3a808cc407744c30daa7470b5f191cde1fbc1aae)
Conflicts:
translate-all.c
(original code was in exec.c, so the patch title is now misleading)
Signed-off-by: Michael Tokarev <address@hidden>
---
exec.c | 67 ----------------------------------------------------------------
1 file changed, 67 deletions(-)
diff --git a/exec.c b/exec.c
index 54a37b5..fb72d74 100644
--- a/exec.c
+++ b/exec.c
@@ -1421,53 +1421,6 @@ TranslationBlock *tb_find_pc(uintptr_t tc_ptr)
return &tbs[m_max];
}
-static void tb_reset_jump_recursive(TranslationBlock *tb);
-
-static inline void tb_reset_jump_recursive2(TranslationBlock *tb, int n)
-{
- TranslationBlock *tb1, *tb_next, **ptb;
- unsigned int n1;
-
- tb1 = tb->jmp_next[n];
- if (tb1 != NULL) {
- /* find head of list */
- for(;;) {
- n1 = (uintptr_t)tb1 & 3;
- tb1 = (TranslationBlock *)((uintptr_t)tb1 & ~3);
- if (n1 == 2)
- break;
- tb1 = tb1->jmp_next[n1];
- }
- /* we are now sure now that tb jumps to tb1 */
- tb_next = tb1;
-
- /* remove tb from the jmp_first list */
- ptb = &tb_next->jmp_first;
- for(;;) {
- tb1 = *ptb;
- n1 = (uintptr_t)tb1 & 3;
- tb1 = (TranslationBlock *)((uintptr_t)tb1 & ~3);
- if (n1 == n && tb1 == tb)
- break;
- ptb = &tb1->jmp_next[n1];
- }
- *ptb = tb->jmp_next[n];
- tb->jmp_next[n] = NULL;
-
- /* suppress the jump to next tb in generated code */
- tb_reset_jump(tb, n);
-
- /* suppress jumps in the tb on which we could have jumped */
- tb_reset_jump_recursive(tb_next);
- }
-}
-
-static void tb_reset_jump_recursive(TranslationBlock *tb)
-{
- tb_reset_jump_recursive2(tb, 0);
- tb_reset_jump_recursive2(tb, 1);
-}
-
#if defined(TARGET_HAS_ICE)
#if defined(CONFIG_USER_ONLY)
static void breakpoint_invalidate(CPUArchState *env, target_ulong pc)
@@ -1711,26 +1664,6 @@ void cpu_set_log_filename(const char *filename)
cpu_set_log(loglevel);
}
-static void cpu_unlink_tb(CPUArchState *env)
-{
- /* FIXME: TB unchaining isn't SMP safe. For now just ignore the
- problem and hope the cpu will stop of its own accord. For userspace
- emulation this often isn't actually as bad as it sounds. Often
- signals are used primarily to interrupt blocking syscalls. */
- TranslationBlock *tb;
- static spinlock_t interrupt_lock = SPIN_LOCK_UNLOCKED;
-
- spin_lock(&interrupt_lock);
- tb = env->current_tb;
- /* if the cpu is currently executing code, we must unlink it and
- all the potentially executing TB */
- if (tb) {
- env->current_tb = NULL;
- tb_reset_jump_recursive(tb);
- }
- spin_unlock(&interrupt_lock);
-}
-
#ifndef CONFIG_USER_ONLY
/* mask must never be zero, except for A20 change call */
static void tcg_handle_interrupt(CPUArchState *env, int mask)
--
1.7.10.4
- Re: [Qemu-devel] [PATCH 0/6] Drop the irredeemably racy cpu_unlink_tb(), Michael Tokarev, 2013/05/09
- [Qemu-devel] [PATCH 2/4] cpu-exec: wrap tcg_qemu_tb_exec() in a fn to restore the PC, Michael Tokarev, 2013/05/09
- [Qemu-devel] [PATCH 3/4] Handle CPU interrupts by inline checking of a flag, Michael Tokarev, 2013/05/09
- [Qemu-devel] [PATCH 1/4] tcg: Document tcg_qemu_tb_exec() and provide constants for low bit uses, Michael Tokarev, 2013/05/09
- [Qemu-devel] [PATCH 4/4] translate-all.c: Remove cpu_unlink_tb(),
Michael Tokarev <=
- Re: [Qemu-devel] [PATCH 0/6] Drop the irredeemably racy cpu_unlink_tb(), Peter Maydell, 2013/05/09
- Re: [Qemu-devel] [PATCH 0/6] Drop the irredeemably racy cpu_unlink_tb(), Andreas Färber, 2013/05/09