From patchwork Tue Oct 10 19:29:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115457 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4119277qgn; Tue, 10 Oct 2017 12:36:29 -0700 (PDT) X-Received: by 10.55.75.15 with SMTP id y15mr14300178qka.321.1507664189718; Tue, 10 Oct 2017 12:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507664189; cv=none; d=google.com; s=arc-20160816; b=HPh4sw1WgWQTYOTnaBJHnEFjScnOMXLsa+D13NEaAqItvZgDwL0K72IP45njmgHXCV Z2FVAGw7SARp4POrUQVTpxRMXbWLGlw4nikYpzcvBuInyY7MfTy60p8WlDf/9QHpk9ms YvKv15KYSd17osGl066STnc4WqM032fY88ozfvPdTl8QqM3ttYyT/lKi1GmTeRRprpf7 uXtDxlKxNZgdnAxlgRl0AjS8HNL1pMEAIR7PlAbI6jwarDQlNJVt9JYARENwX/ozaIqL l6z/vJioyYRaK4Q/iGnwMxygRljcdrCnfF4mjRrVsLsUtJLaT2SMGd0VzKMaBnXPYyEk blRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=WtXhE5x32c2lhsKUN0JsspH8di2RIEl9RhyDrTbaDsw=; b=Rd7wj8J6PgaDmqbrpLGJqcmR6bCCNKSoRzYCPDs5mMgoqIxtMxsrN/s+vCWf8EQp8D ZbCXGO7b0+t4fbkFQuBacUJPbCnKFUyJ5I+NJ5MXtbdeG9CtIwbE/C1GgC3kNPo/vXMm zsuczRHEsqzW4KatSEo+GyQwxPcTfWorppi5kWFWoYw6zGcBS+6bNAxRXpmpkqIxY/6m WdCbn3eg/ug4GTFw7cRKV2Uvzz/k81T7w1atJlzX3dQt8j3UA42YLNH5YIUAv1pj3W4I 1QB9TQ9aVju2Jbi+n0JMgH122ZqZ+jK/ffSb4HcOxJSqomDst5cw9jY1jrmA0tmsCG5w DeXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SKaVOj5h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z62si2083875qtc.418.2017.10.10.12.36.29 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 10 Oct 2017 12:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SKaVOj5h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e20KJ-0005B1-Jn for patch@linaro.org; Tue, 10 Oct 2017 15:36:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e20EW-0000jx-Lr for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e20EV-00055t-Ek for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:28 -0400 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]:45681) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e20EV-00054y-8n for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:27 -0400 Received: by mail-pf0-x22b.google.com with SMTP id d28so3569521pfe.2 for ; Tue, 10 Oct 2017 12:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WtXhE5x32c2lhsKUN0JsspH8di2RIEl9RhyDrTbaDsw=; b=SKaVOj5hTxQ36TQw/DGHWLcge9NjlIjnBkfurMhX+HGzKNW4eQnNVlSP8mYHCvlNkK WkWN/nUFRMe7i0fJM0xxixP3QKf68N8QXtAAVfeIeRsnpwU8KvtumcqbtR71dwpGJJ+i 3cJDtm4zyVM1+kJyzvfhjHK/a5H4p1zWoVqms= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WtXhE5x32c2lhsKUN0JsspH8di2RIEl9RhyDrTbaDsw=; b=ZHWl/I9nfpQTNniAexAOjBwob3GvNs7/hDqwmi0n3y8QNwchWaSC8kuPAgHFWTZeOo qAuLlk+bqRO+WL/Xjss1J6RfzjmJS1gkr74BiaBXj5LyNyQF48g0UDg+qPXbtwVoIZH7 LOiXgiuPjX32fOQTx1mIfWU/xo0HCy3kHDcw/BPEG5ZHNIvsjGLq2eNAsh+5uqz2F79O MifdE0LP+DCjAbQM+AqXbf1s/GWMo2E77LkBjOFhGlNXIrI2FvNQfAEzJ6TAzmsAdZko pgBqcbKq5mU3RWUXRGxWraw9tnI7/lRitjMksXJeutKChE8SLq+celUytVBNJRARodNo QHqA== X-Gm-Message-State: AMCzsaXE0qiPvnNJeVgj0LwWPSQBFzP8tT7z+ZuwXrOir1SAJAdVQNs9 PAlZbBYwaEQ+aUOsMm5g4KAf8btNZxg= X-Google-Smtp-Source: AOwi7QA9K5i3yAn2E6DXoFOTbei4V6l+W9d4oejZU9HVsmYK2gGrizxkTcAbGJ59H0+DHD3S99V/SQ== X-Received: by 10.84.205.69 with SMTP id o5mr13112094plh.122.1507663823825; Tue, 10 Oct 2017 12:30:23 -0700 (PDT) Received: from bigtime.twiddle.net (97-126-104-76.tukw.qwest.net. [97.126.104.76]) by smtp.gmail.com with ESMTPSA id r22sm19859788pfl.15.2017.10.10.12.30.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2017 12:30:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 10 Oct 2017 12:29:56 -0700 Message-Id: <20171010193003.28857-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171010193003.28857-1-richard.henderson@linaro.org> References: <20171010193003.28857-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22b Subject: [Qemu-devel] [PULL v2 13/20] translate-all: define and use DEBUG_TB_INVALIDATE_GATE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This gets rid of an ifdef check while ensuring that the debug code is compiled, which prevents bit rot. Suggested-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) -- 2.13.6 diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 90b3eed9c6..6b853b329c 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -65,6 +65,12 @@ /* make various TB consistency checks */ /* #define DEBUG_TB_CHECK */ +#ifdef DEBUG_TB_INVALIDATE +#define DEBUG_TB_INVALIDATE_GATE 1 +#else +#define DEBUG_TB_INVALIDATE_GATE 0 +#endif + #ifdef DEBUG_TB_FLUSH #define DEBUG_TB_FLUSH_GATE 1 #else @@ -1192,9 +1198,9 @@ static inline void tb_alloc_page(TranslationBlock *tb, } mprotect(g2h(page_addr), qemu_host_page_size, (prot & PAGE_BITS) & ~PAGE_WRITE); -#ifdef DEBUG_TB_INVALIDATE - printf("protecting code page: 0x" TB_PAGE_ADDR_FMT "\n", page_addr); -#endif + if (DEBUG_TB_INVALIDATE_GATE) { + printf("protecting code page: 0x" TB_PAGE_ADDR_FMT "\n", page_addr); + } } #else /* if some code is already present, then the pages are already