From patchwork Tue Oct 10 00:55:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115323 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3174075qgn; Mon, 9 Oct 2017 18:07:34 -0700 (PDT) X-Received: by 10.200.38.50 with SMTP id u47mr13972999qtu.112.1507597654010; Mon, 09 Oct 2017 18:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507597654; cv=none; d=google.com; s=arc-20160816; b=Apgd4tc+U8AvHsmnJP5WP/YSkS0Egfruw9sNU5sb4svEJybHAnOCJb4ZNlPH7SaTbe 5rxyhNRNsNzN9h4uo+oEE/z5d5xoV/UvwtBceQAYbF8TCemmLL1+j7/rXQvQ4osF/YNl OUGekDvz+DrKq4Mok3k9SevRDvBwkYWvMXvhk0ta57+QtDhwLEeh52M9Z7tj+640zZWw lEw/bvAUyWEqGO/6A8n25RHS7SKcWZNQZJg88+iXGLGPUenwRyi2FKOqGRVOdYMYv1Aw /spkvy+gn+FkSoS+7Wdq+E/md8ceBN8qW4oKdjq0kQD4Pi5nqlquB+yUgr6hQt2YIZBd L4Hw== 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=b4y7mzJIZT3j5Hxc7Y/DnD2UXXtphNtqoBQTlBqZHF7fQVxfmc/yFUSbfIFLQcUxPU 1becTaHEkZ6G26YmL5lNG+t22BKHC5QtwXODBTjiwJFmgXtiZnoiwtnQrxtDkTiOmL8j +bY3Nra1e2WgCnEn6ZX7kihUzUgqefgoVg8FSa1tGcoWb4OFW2oRJ+SwHGkVUoCB+rkT YajD92WgtBzGpRUaUhwh8r8Wr5hgorgOudTalNg5HJtnaLP8FQcVWi5rMQQPVFEPUC68 c4+Zs9NGkykdCiMpKvxUiavXyq+2Bkqyz8mr5u8wVpyhdJ7j/SiOvbGzoc+V6LoByEYa 4XFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KGtNX2ZY; 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 15si5214300qkg.511.2017.10.09.18.07.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 09 Oct 2017 18:07:33 -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=KGtNX2ZY; 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]:60531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1j19-0002Vo-Ve for patch@linaro.org; Mon, 09 Oct 2017 21:07:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1iqM-0002MH-0b for qemu-devel@nongnu.org; Mon, 09 Oct 2017 20:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1iqL-0004VZ-E9 for qemu-devel@nongnu.org; Mon, 09 Oct 2017 20:56:22 -0400 Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]:53905) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e1iqL-0004Uc-8e for qemu-devel@nongnu.org; Mon, 09 Oct 2017 20:56:21 -0400 Received: by mail-pf0-x22d.google.com with SMTP id n73so8794260pfg.10 for ; Mon, 09 Oct 2017 17:56:21 -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=KGtNX2ZYGLWLNvSHq1+Jkhvbr6qbur5Jt4krfrgsxd9j21I8yAtr41xrE5v344W8AT IbZ1w+b/ifWnewLSF9JIedftYAGbA5TQSFEmec65QaXcR12EFPrd6hClLphRwmG+Jol1 tPOZR6lH0F3oV7PuNjClrGU7qH0MXhBAnpjkU= 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=H+PO8hTrJQ6qTPzpfmAbfXIqI8ppOtAmiw/FKBVCporPNOBT3fEydKB10uZLe3h3vC YBjUTAIbcIu+yodEPOq6C0Q/rvuSSAkBqipFOMf4mxMNVgU11N9OGe8OzkHVpYgQJj31 61PFbUDP6OZ9pfGf2/C63MChAt4BGr9vICFa3pfjrAYngvTT14TpPArcnWKPJIFoxGhY +HzpHikIRMMMnDnxe5aRpE+v7cXhUWvgPHO7wOR7w7OrTaKeV6WpL4IY971sRUtr4hwJ CbKcJm1Re0o8Pvb3BY4a0kKT4aIAJfx8orqP29fpK0QCF/YWgNXTBthuRhidohduZN0P BmTQ== X-Gm-Message-State: AMCzsaVdj/nIEX0mIrbM0pZJskhWaZYQvlRLXiY7jjpuh+jz5cuh8X+R 4x/VcZXMp1TIc97LYZcSdk7snBbQaEQ= X-Google-Smtp-Source: AOwi7QCOpzqGxaBr12xTBsAXRpdoXiwIDW6SRRvqc/ZIjrNvERFdaxBYa49Q+unKUZVqrmfYM2xHYg== X-Received: by 10.98.9.17 with SMTP id e17mr526104pfd.329.1507596980028; Mon, 09 Oct 2017 17:56:20 -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 n19sm17121368pfj.52.2017.10.09.17.56.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2017 17:56:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 9 Oct 2017 17:55:50 -0700 Message-Id: <20171010005600.28735-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171010005600.28735-1-richard.henderson@linaro.org> References: <20171010005600.28735-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::22d Subject: [Qemu-devel] [PULL 13/23] 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