From patchwork Fri Feb 22 18:10:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 15032 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5DA8223F78 for ; Fri, 22 Feb 2013 18:10:19 +0000 (UTC) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by fiordland.canonical.com (Postfix) with ESMTP id 01D88A18B66 for ; Fri, 22 Feb 2013 18:10:18 +0000 (UTC) Received: by mail-vb0-f53.google.com with SMTP id fj18so576415vbb.12 for ; Fri, 22 Feb 2013 10:10:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=Y6PlajcXB4rdHzfblGeE5z7N0UGU531f8Uherb8TL9c=; b=EfxaO5l5Wrm8Fzp9Iya/vup9tcC6bUZ3S1wpJb9hk6FKbDOgJCXgXH+LBVvjiWyq48 /hvi5QIgEVac3MB7gSqbb/UCjaUH3n6ACVUMiLTEK7ov+N6i3wDlBovHDEYZiPz+NkBf /9pIs1VEA0ZEDZYk7yD9RvqtFiFgynWDnWgqiVIrG585Cr2j1IzEjOKgKJuOlJ6tNVW7 wWF4DSgt0kbX3uiWw34DjKBiU15DAk29nTKbG8e8+smNuXQTrCyzXzl1WnVB8CjdVaE0 sHqc5lJocNz2NexEKheTzZ/2ZXz6u2udn/D7XZ9uGgtdbCpZFLLhngF4EA86VJmCpmFl zRAQ== X-Received: by 10.52.177.163 with SMTP id cr3mr3355780vdc.94.1361556618500; Fri, 22 Feb 2013 10:10:18 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp101292veb; Fri, 22 Feb 2013 10:10:17 -0800 (PST) X-Received: by 10.152.113.164 with SMTP id iz4mr2513129lab.50.1361556612023; Fri, 22 Feb 2013 10:10:12 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id si3si1422328lab.79.2013.02.22.10.10.10 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 22 Feb 2013 10:10:11 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1U8x4Q-0005iq-45; Fri, 22 Feb 2013 18:10:06 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Blue Swirl , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Paul Brook , Anthony Liguori , Richard Henderson , Alexander Graf Subject: [PATCH 5/6] translate-all.c: Remove cpu_unlink_tb() Date: Fri, 22 Feb 2013 18:10:04 +0000 Message-Id: <1361556605-21963-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1361556605-21963-1-git-send-email-peter.maydell@linaro.org> References: <1361556605-21963-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQlAHqtviJYd5FYCVt99neNmg3j1sAILPRh3ojou6HQjjFT1IaU71ufY4irxprKqqjBj2agv 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 --- translate-all.c | 69 ------------------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/translate-all.c b/translate-all.c index 9741d96..90ea002 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1349,55 +1349,6 @@ static TranslationBlock *tb_find_pc(uintptr_t tc_ptr) return &tcg_ctx.tb_ctx.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) && !defined(CONFIG_USER_ONLY) void tb_invalidate_phys_addr(hwaddr addr) { @@ -1416,26 +1367,6 @@ void tb_invalidate_phys_addr(hwaddr addr) } #endif /* TARGET_HAS_ICE && !defined(CONFIG_USER_ONLY) */ -void cpu_unlink_tb(CPUState *cpu) -{ - /* 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 = cpu->current_tb; - /* if the cpu is currently executing code, we must unlink it and - all the potentially executing TB */ - if (tb) { - cpu->current_tb = NULL; - tb_reset_jump_recursive(tb); - } - spin_unlock(&interrupt_lock); -} - void tb_check_watchpoint(CPUArchState *env) { TranslationBlock *tb;