From patchwork Sat Jul 10 15:31:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 737DDC07E9B for ; Sat, 10 Jul 2021 15:32:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1398860FF2 for ; Sat, 10 Jul 2021 15:32:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1398860FF2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2EyM-0007xo-2Q for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:32:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExJ-0004wf-N0 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:49 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:45992) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExH-0002BD-Cd for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:49 -0400 Received: by mail-pf1-x42f.google.com with SMTP id q10so11649352pfj.12 for ; Sat, 10 Jul 2021 08:31:46 -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=6CQ6Qnqlq6xTqG9WUDwZDgwIT9JsVyB41tajyHgQO/U=; b=OaOa9DcrNQEGHqLgJejxdc4OrxKuG7ipg7/1MKx8RF3WGKB+YwQyawMWQm9XAZ4sgW 9jW+NUbtJkEY6jRX/dywsIoL3LPg86bGqaxUEekNO9AAN3qroU3CN+oyWvvRm+en20D0 USCKvBFnYL6GgXaUs+vuMbdz5soE9wi9QveAOP/ISTJwbT1cCjD15D3Y0n9sKhDrPX0K UEz1EurUV3+VT0kXnFYFJ6lzrNkupgJMyyeUUYBolzb1Cd5RzTZ+FepFb/YHdar75b/b Yv2GWJ1dZOynab3wafmEBjmIC7TluiKygtw29gZE4wnMvMBhCs3iEZvc9L0fe356K85V EGOw== 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=6CQ6Qnqlq6xTqG9WUDwZDgwIT9JsVyB41tajyHgQO/U=; b=I80v3OrzQAba3hVHjxynTBehyUbjH9aqmj3Fy+Wl2yTmZnFjM2NlGSNY6mcGxK+Jzi f/uIWYE/IhMXvsRAtfRTUMcmokPVPvk/Poj5FDMgqmKXnLtXaVHPbf2+vGq7HCXq9aPU wv+Nfb/0dvgVLtQmK2oo2s5N/KZPm3p2F3u6nge+uMfPj+PFnPyK88tzsfCeggOJ5NOW /jGCL9fU8Qx7C4k0MysscHSjqRytHJHOueodJqiPnl8zPOnIXzP1IYOqVfsz8NprU5iP KEFzgw0HvICeDu/ViSEx8Dld4KGixij8wNa+YrmVAgO5D9JhMEceQxYoUABf0w+ZP6FN OhYA== X-Gm-Message-State: AOAM53310yYlm2oX/K6XT9YQ/cWSAgiF+z2C2PA1d9dRzqHKkeWnc7ZG NKy6gjqGVt/b9Sdd7h5Qaot5ijQj0+kT6g== X-Google-Smtp-Source: ABdhPJzTW6c03uP2a1PXVGgg1A3n1P0fvHHc84VMiM0n4ztvK5A2Yq4GEF8NEU6wsYWoBwsTE0hY0Q== X-Received: by 2002:a65:6283:: with SMTP id f3mr14639285pgv.370.1625931105548; Sat, 10 Jul 2021 08:31:45 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 01/41] tcg: Add separator in INDEX_op_call dump Date: Sat, 10 Jul 2021 08:31:03 -0700 Message-Id: <20210710153143.1320521-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We lost the ',' following the called function name. Fixes: 3e92aa34434 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 5150ed700e..4dd4084419 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1849,7 +1849,7 @@ static void tcg_dump_ops(TCGContext *s, bool have_prefs) col += qemu_log("plugin(%p)", func); } - col += qemu_log("$0x%x,$%d", info->flags, nb_oargs); + col += qemu_log(",$0x%x,$%d", info->flags, nb_oargs); for (i = 0; i < nb_oargs; i++) { col += qemu_log(",%s", tcg_get_arg_str(s, buf, sizeof(buf), op->args[i])); From patchwork Sat Jul 10 15:31:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66A33C07E9C for ; Sat, 10 Jul 2021 15:36:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2AB8610E6 for ; Sat, 10 Jul 2021 15:36:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2AB8610E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F1q-0002XQ-2U for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:36:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExK-0004wu-3y for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:50 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:35409) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExH-0002Bo-BM for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:49 -0400 Received: by mail-pg1-x52a.google.com with SMTP id v7so13187746pgl.2 for ; Sat, 10 Jul 2021 08:31:46 -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=e4JQCoLagiwo+NLZJ+PbMyT1KAOuchSbSiU5YOPxFFA=; b=trAzHBptJnNp+NxqI4nE63DfDqV6VOF87YocvASlnhQ91dVjUVZwyTOClozZyxq2fU 62YVGwSz1Iz2XBOUU+SIJfPTFd2mvqnqSfkjD8jU63qOj65WR4laPR1VlC2guvztt2QJ 0qg0Xqw3g99VkjK4u/z3DVGuXBrh/YBqfd0/kMh9xWmVzXZS8UEca+eKCGFBWxBqUMWr dxgyEqjR6id+q72LmOIt45ZkblEov1HSBVGQyLF4Ro0Sf6VyCkwjj8UwVjFP48jSi7Di f7y+JJTD+vJB0l24LVlrScg8z3K9/dqUIOfOeqHb7Bomh6huXiYoZoVwG2NhZuVhrNBb WXng== 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=e4JQCoLagiwo+NLZJ+PbMyT1KAOuchSbSiU5YOPxFFA=; b=cZ2JcbsyVRKUy5uQkqBR9fARu6w5v327dsMGP/3FAxbmW6NBjlbXn5D1eyyizdy8NW Zb+JDgyUqqHoXYZ0rgZA0DEDNOS+OCZVYmigzitTTPgyeNYXfxPmlS1dcKpEdG+nldRs kKNueaTPzDwEsGjWCvWxnXbip/2rxUNfdJyPsbjEgBNL2UEZHBtmhelSbLObeI5sdP2E XqaSSZ8ex+ecUKpY3WMdknNEDP0MQEIqsW1YARqzj29b2ibUweBtFyTZVSs0vUGOigGx azhmUuxhmsmr/3Q2bQ+us6EDq8/ScbF2JEMfYsBDEhJwsU0b+wJwXq110M2ZCJFIhpVs inKQ== X-Gm-Message-State: AOAM5306HhF3kR7lNLM5Fqz0KGw0B/D/j0F/EM4QveNQj5bOvmxNt5wL o6J5nqAx7cG8uniL8V1P1O9j+143L9l/VA== X-Google-Smtp-Source: ABdhPJxcwHEX2yo1lElM9aHIuF8oN9eotJpHShOC+VhvznvTorDkGRnK01O9O3afqcVelILaKvrf4Q== X-Received: by 2002:a65:5503:: with SMTP id f3mr39079189pgr.232.1625931106186; Sat, 10 Jul 2021 08:31:46 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 02/41] tcg: Avoid including 'trace-tcg.h' in target translate.c Date: Sat, 10 Jul 2021 08:31:04 -0700 Message-Id: <20210710153143.1320521-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The root trace-events only declares a single TCG event: $ git grep -w tcg trace-events trace-events:115:# tcg/tcg-op.c trace-events:137:vcpu tcg guest_mem_before(TCGv vaddr, uint16_t info) "info=%d", "vaddr=0x%016"PRIx64" info=%d" and only a tcg/tcg-op.c uses it: $ git grep -l trace_guest_mem_before_tcg tcg/tcg-op.c therefore it is pointless to include "trace-tcg.h" in each target (because it is not used). Remove it. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210629050935.2570721-1-f4bug@amsat.org> Signed-off-by: Richard Henderson --- target/alpha/translate.c | 1 - target/arm/translate-a64.c | 1 - target/arm/translate-sve.c | 1 - target/arm/translate.c | 1 - target/cris/translate.c | 1 - target/hppa/translate.c | 1 - target/i386/tcg/translate.c | 1 - target/m68k/translate.c | 1 - target/microblaze/translate.c | 1 - target/mips/tcg/translate.c | 1 - target/openrisc/translate.c | 1 - target/ppc/translate.c | 1 - target/rx/translate.c | 1 - target/s390x/translate.c | 1 - target/sh4/translate.c | 1 - target/sparc/translate.c | 1 - target/xtensa/translate.c | 1 - 17 files changed, 17 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index f2922f5f8c..a607c898f4 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -28,7 +28,6 @@ #include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "trace-tcg.h" #include "exec/translator.h" #include "exec/log.h" diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index e81cc20d04..a6dd9ec701 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -35,7 +35,6 @@ #include "exec/helper-gen.h" #include "exec/log.h" -#include "trace-tcg.h" #include "translate-a64.h" #include "qemu/atomic128.h" diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 46210eb696..35d838aa06 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -30,7 +30,6 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/log.h" -#include "trace-tcg.h" #include "translate-a64.h" #include "fpu/softfloat.h" diff --git a/target/arm/translate.c b/target/arm/translate.c index 28e478927d..fdf2b3d1c8 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -34,7 +34,6 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "trace-tcg.h" #include "exec/log.h" diff --git a/target/cris/translate.c b/target/cris/translate.c index 4cfe5c86d9..a6796c83b9 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -37,7 +37,6 @@ #include "exec/helper-gen.h" -#include "trace-tcg.h" #include "exec/log.h" diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 64af1e0d5c..424ec3252e 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -27,7 +27,6 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/translator.h" -#include "trace-tcg.h" #include "exec/log.h" /* Since we have a distinction between register size and address size, diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index b21873ed23..85b00a6945 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -30,7 +30,6 @@ #include "exec/helper-gen.h" #include "helper-tcg.h" -#include "trace-tcg.h" #include "exec/log.h" #define PREFIX_REPZ 0x01 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index f0c5bf9154..348fc6e844 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -31,7 +31,6 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "trace-tcg.h" #include "exec/log.h" #include "fpu/softfloat.h" diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index c1b13f4c7d..5dfb08d49f 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -29,7 +29,6 @@ #include "exec/translator.h" #include "qemu/qemu-print.h" -#include "trace-tcg.h" #include "exec/log.h" #define EXTRACT_FIELD(src, start, end) \ diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index ae33c75f08..cb82426f66 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -32,7 +32,6 @@ #include "semihosting/semihost.h" #include "trace.h" -#include "trace-tcg.h" #include "exec/translator.h" #include "exec/log.h" #include "qemu/qemu-print.h" diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index a9c81f8bd5..5db63d7609 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -33,7 +33,6 @@ #include "exec/helper-gen.h" #include "exec/gen-icount.h" -#include "trace-tcg.h" #include "exec/log.h" /* is_jmp field values */ diff --git a/target/ppc/translate.c b/target/ppc/translate.c index f65d1e81ea..07d79acc08 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -32,7 +32,6 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "trace-tcg.h" #include "exec/translator.h" #include "exec/log.h" #include "qemu/atomic128.h" diff --git a/target/rx/translate.c b/target/rx/translate.c index 9ea941c630..22a15ee11d 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -26,7 +26,6 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/translator.h" -#include "trace-tcg.h" #include "exec/log.h" typedef struct DisasContext { diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 03dab9f350..5af68e01c6 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -42,7 +42,6 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "trace-tcg.h" #include "exec/translator.h" #include "exec/log.h" #include "qemu/atomic128.h" diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 4dcfff81f6..8a25a4362e 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -28,7 +28,6 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/translator.h" -#include "trace-tcg.h" #include "exec/log.h" #include "qemu/qemu-print.h" diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 4bfa3179f8..f3fe7a0369 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -29,7 +29,6 @@ #include "exec/helper-gen.h" -#include "trace-tcg.h" #include "exec/translator.h" #include "exec/log.h" #include "asi.h" diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 14028d307d..d5da35f4fc 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -43,7 +43,6 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "trace-tcg.h" #include "exec/log.h" From patchwork Sat Jul 10 15:31:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53A3BC07E95 for ; Sat, 10 Jul 2021 15:34:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12A1A610E6 for ; Sat, 10 Jul 2021 15:34:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12A1A610E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F04-0005Dx-84 for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:34:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExJ-0004wg-RA for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:49 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:45639) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExI-0002CB-0v for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:49 -0400 Received: by mail-pg1-x52b.google.com with SMTP id y17so13140004pgf.12 for ; Sat, 10 Jul 2021 08:31:47 -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=VN95zM/QiA1dKqmcNx9SH5nqAvJGbQXCoyX6bpKYZ80=; b=xwApZ3sXPHwhMQLPV31hIAce4ZF4vSuX2WMx0cgfJeditQZIT/JV8M1OibGCCek0Z+ X0LJ+AyM6q1TOM6Q080db4hcmtMgXOK7pUXr3v9fKUc/J5k0cdf8gRtkqR/6iPNQbJ2c ZS9RAznldlgrFTW6vumK9T4euxhpPX13gJfyOqy8zS/bEkKUt87VFLEYPSaCzwtqjVDz 1LNZ5CFm2aAQfhl2kJWuC36SdC6ll5PbwTN5zfpgrYGBT5ueApxqCOF/5DrZ+myMQ80S jN6sWITDEG/fau8VbwiIbsfwF67THHZudk4PW50/nMAxO0QX68iOV7AOxOw8Dud2ZWOB uDqg== 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=VN95zM/QiA1dKqmcNx9SH5nqAvJGbQXCoyX6bpKYZ80=; b=KDAzLAERM0sFQwD2+J+0IoT/5Q99JIKyk1ubxkJIkqIs//syNUte7lUcKXpXe16rI0 6jWcL2fybzyiUBbbpsUWzouWco/z7i4sLrFTu2ybL+pRSapJZ17Qn8IM0GJGV8RpMCGN Lq3UMRQp/IPZrIRqcxDQZJfgk77i6yA93PCq4lU28hvuCM8HfnPgfbA/vABELQEqhmdE gEWJcWCXUiMRL5FRyPqyD2dzWRls/v661/uoCUvdHeDRScrRpfjd3aFWq+4iy+VvWARt i9sxxp4wdGZKoWMxeXtjBkt1h9rgztK5RjCL7qMyP9NSaaMml7T7Q0hjsH2zmBv9AJzc gh2w== X-Gm-Message-State: AOAM531EBCh1HHKyUzwWPsS312wEcythqvVpqOO4UeUp46gMoPB0/E1t nXWiGDTVk9SozLFFiQ9N/cMtZziLn/ZXXw== X-Google-Smtp-Source: ABdhPJzPGQmqAbKOQVPL5JFqmvSKnFbGdar07i/Nho9x97hOjv8LNth7FHh7cTEdicUraopbz1JKCA== X-Received: by 2002:a63:5946:: with SMTP id j6mr45108065pgm.0.1625931106894; Sat, 10 Jul 2021 08:31:46 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 03/41] accel/tcg: Hoist tcg_tb_insert() up above tb_link_page() Date: Sat, 10 Jul 2021 08:31:05 -0700 Message-Id: <20210710153143.1320521-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liren Wei Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Liren Wei TranslationBlocks not inserted into the corresponding region tree shall be regarded as partially initialized objects, and needs to be finalized first before inserting into QHT. Signed-off-by: Liren Wei Message-Id: Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 7929a7e320..75e4d06557 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1657,6 +1657,13 @@ TranslationBlock *tb_gen_code(CPUState *cpu, return tb; } + /* + * Insert TB into the corresponding region tree before publishing it + * through QHT. Otherwise rewinding happened in the TB might fail to + * lookup itself using host PC. + */ + tcg_tb_insert(tb); + /* check next page if needed */ virt_page2 = (pc + tb->size - 1) & TARGET_PAGE_MASK; phys_page2 = -1; @@ -1675,9 +1682,9 @@ TranslationBlock *tb_gen_code(CPUState *cpu, orig_aligned -= ROUND_UP(sizeof(*tb), qemu_icache_linesize); qatomic_set(&tcg_ctx->code_gen_ptr, (void *)orig_aligned); tb_destroy(tb); + tcg_tb_remove(tb); return existing_tb; } - tcg_tb_insert(tb); return tb; } From patchwork Sat Jul 10 15:31:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368711 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7223C07E95 for ; Sat, 10 Jul 2021 15:34:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 774DF61107 for ; Sat, 10 Jul 2021 15:34:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 774DF61107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F08-0005Fb-LT for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:34:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExK-0004wy-8U for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:50 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:34635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExI-0002CY-Ia for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:50 -0400 Received: by mail-pf1-x432.google.com with SMTP id o201so6620346pfd.1 for ; Sat, 10 Jul 2021 08:31:48 -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=Y3lANsHAiYr3NfirOwYT3hcp5c4TVyMIYJgJoxKd7BA=; b=ZNFS46LO/h8QELM7+nuF74WGT/Bc7GrQKLElQH2f1DLHsWOVTeEfuI5/iZkVe7np0+ qVFQnPW9ms7GAEusg4meX8jeP7OeQ9VaA9aff93+bkpHqTI45KCkd9LE4tSEmrnpnkTn 01EhCocfF5+qZp5sZR6TsZoa36sglurIfXZoujNctcMy9F6vDj7Yh51r92htVbeDWwSP OmkEEl531tvxyFvAds1/gCsyNq9pOoAVeimKpK0kYbSkKxKWUQlnNhtqIlPHCTKiyp27 R4d0PZ9kFFG6KttDdA3EVwoPMd4uxjN2Eeh7vVXj3FDjhxm992PSJcXrb2fmdrNiPxFd /1Sg== 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=Y3lANsHAiYr3NfirOwYT3hcp5c4TVyMIYJgJoxKd7BA=; b=r3DzlX2G4qTlGSnuRFWBEzzjRS0Da6u1sPAmDWY5FiTv1BYksBc3hMH253vCvMDp44 ubXlX/NZILYegUkGerIQYgHbepIjLND/BgWsFHpAdfaGo2q9gAB6dPNvExVxARk513OR /yDJNa3wsMDc34NMj5z0SqcG6fjyBuUxepy0NiGcnNbz8Go+VpRK8zFANxYBhYni8Z18 aJFqwkD2PPDi7lrmwVjTwnvCyBKh/eqYZ4RCUkAPTdt5UKWkbxI7C0mW5kEtt3HpXmv3 ORliY4VdrXiHRTTlNDkDPI1vhNqmvPYa/r7lL/EXI/jyaCVkJBI6a3O866nCf0a/+jGI iW0Q== X-Gm-Message-State: AOAM533FqZbahKFcEx/zbzfgRSJrSiYb1IqGo4adGg7b35rZqvtBuhsC ntbCQ/MoOuqQyaWclxG7sXdgpcqosjfIVg== X-Google-Smtp-Source: ABdhPJznV5SmpWoVPFqev+xymkcPckS0JAgk59WWzHb3YjUe+DAeGp8Suy2VAy20Sbx7hl/QWPr0Yg== X-Received: by 2002:a63:ff25:: with SMTP id k37mr29858512pgi.353.1625931107375; Sat, 10 Jul 2021 08:31:47 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 04/41] tcg: Bake tb_destroy() into tcg_region_tree Date: Sat, 10 Jul 2021 08:31:06 -0700 Message-Id: <20210710153143.1320521-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liren Wei Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Liren Wei The function is called only at tcg_gen_code() when duplicated TBs are translated by different threads, and when the tcg_region_tree is reset. Bake it into the underlying GTree as its value destroy function to unite these situations. Also remove tcg_region_tree_traverse() which now becomes useless. Signed-off-by: Liren Wei Message-Id: <8dc352f08d038c4e7a1f5f56962398cdc700c3aa.1625404483.git.lrwei@bupt.edu.cn> [rth: Name the new tb_tc_cmp parameter correctly.] Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 1 - accel/tcg/translate-all.c | 6 ------ tcg/region.c | 19 ++++++++----------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 899493701c..dedb86939a 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -808,7 +808,6 @@ void *tcg_malloc_internal(TCGContext *s, int size); void tcg_pool_reset(TCGContext *s); TranslationBlock *tcg_tb_alloc(TCGContext *s); -void tb_destroy(TranslationBlock *tb); void tcg_region_reset_all(void); size_t tcg_code_size(void); diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 75e4d06557..57455d8639 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -378,11 +378,6 @@ static int cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, return 0; } -void tb_destroy(TranslationBlock *tb) -{ - qemu_spin_destroy(&tb->jmp_lock); -} - bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc, bool will_exit) { /* @@ -1681,7 +1676,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu, orig_aligned -= ROUND_UP(sizeof(*tb), qemu_icache_linesize); qatomic_set(&tcg_ctx->code_gen_ptr, (void *)orig_aligned); - tb_destroy(tb); tcg_tb_remove(tb); return existing_tb; } diff --git a/tcg/region.c b/tcg/region.c index 00b0c3b091..d3a3658e81 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -112,7 +112,7 @@ static int ptr_cmp_tb_tc(const void *ptr, const struct tb_tc *s) return 0; } -static gint tb_tc_cmp(gconstpointer ap, gconstpointer bp) +static gint tb_tc_cmp(gconstpointer ap, gconstpointer bp, gpointer userdata) { const struct tb_tc *a = ap; const struct tb_tc *b = bp; @@ -143,6 +143,12 @@ static gint tb_tc_cmp(gconstpointer ap, gconstpointer bp) return ptr_cmp_tb_tc(b->ptr, a); } +static void tb_destroy(gpointer value) +{ + TranslationBlock *tb = value; + qemu_spin_destroy(&tb->jmp_lock); +} + static void tcg_region_trees_init(void) { size_t i; @@ -153,7 +159,7 @@ static void tcg_region_trees_init(void) struct tcg_region_tree *rt = region_trees + i * tree_size; qemu_mutex_init(&rt->lock); - rt->tree = g_tree_new(tb_tc_cmp); + rt->tree = g_tree_new_full(tb_tc_cmp, NULL, NULL, tb_destroy); } } @@ -277,14 +283,6 @@ size_t tcg_nb_tbs(void) return nb_tbs; } -static gboolean tcg_region_tree_traverse(gpointer k, gpointer v, gpointer data) -{ - TranslationBlock *tb = v; - - tb_destroy(tb); - return FALSE; -} - static void tcg_region_tree_reset_all(void) { size_t i; @@ -293,7 +291,6 @@ static void tcg_region_tree_reset_all(void) for (i = 0; i < region.n; i++) { struct tcg_region_tree *rt = region_trees + i * tree_size; - g_tree_foreach(rt->tree, tcg_region_tree_traverse, NULL); /* Increment the refcount first so that destroy acts as a reset */ g_tree_ref(rt->tree); g_tree_destroy(rt->tree); From patchwork Sat Jul 10 15:31:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368717 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-24.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 165EAC07E95 for ; Sat, 10 Jul 2021 15:36:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1BC661154 for ; Sat, 10 Jul 2021 15:36:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1BC661154 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F1p-0002Zk-VL for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:36:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExM-00050a-44 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:52 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:45603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExK-0002E2-BO for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:51 -0400 Received: by mail-pl1-x62a.google.com with SMTP id p17so6109861plf.12 for ; Sat, 10 Jul 2021 08:31:49 -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=wPpFfUs4h86ewu3F3iemYnJMaalb1kmHYOs+LuBl5DE=; b=PmrRTxuGXUAj0eFvREXvAAM5IPPizJxSXQjpBPBAGNYlL3e+0PbvknpVE7Ka7ODO/M ToK5ZeGElpMfZ6Q/MrBsbp/LIGAGlyBvgr36Iu0q5TQpoW1XyEh6GyhnQLrL1xWu6mSE VrsZUb5lqwqUokwPgOv2a6FjEkhIF609KZnu1UJjD8Z6TGlykFvgcPdBC8fTP2Bpu2Is GJRcngy1kFVO+MdflcBvsFDTCBAruG4qa3Gx7UCwKutZzN+VLIYKUEzI1uPci3BYtvku Nw0tGsvgHI8spi0WexuEWTKmtIgr7opotWYNC5becdbchE9ktBV0bxE7E0Oqo+i7XLwL Di+g== 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=wPpFfUs4h86ewu3F3iemYnJMaalb1kmHYOs+LuBl5DE=; b=BulBVXOhPot4NPvhghmU5TMDxoIyobPpkW80bcsdc7dnWCASYrVxUiIRJVqcmN6fPO 8R0KDuHaA/Hp5Pasz9tOosV2mafp9qc6tKGsX05HxOmagEiFJ6NwT7GCRjXecJejOavq awctinC2yFw3K8mG3dOIWBG1WdEt6I4AhzD1JhOUezpBdmm3HiM1CTMrwRqRt7v12DZV gUMsoDAh9mL2reFo8x2njk5lkyR2jannGKEB6kKMlQH4nBqmQ1sTJN73Q8BmMygY2OfW upPSydxWlUY278cewDfl5C+E5im/llS5WlZTDub6gXKW0gvSG0tXaI7T2HUTIQ9TVqjV 4jWA== X-Gm-Message-State: AOAM532Jt4TTPfn2dCGk3k3pWa3JkkGFc5slESOOBNaRWAR9F5w+O/2L gkOwJ1JR7pCpP9I+PWSVVLrYrMArok2tHg== X-Google-Smtp-Source: ABdhPJyz+n9sN4H/oMn53tf4++2ZxI5j18l8aBGqvCYUBG+AUvG2HI6JWTpn4T1NM4QOab4W/uD1tg== X-Received: by 2002:a17:90a:1a:: with SMTP id 26mr4765510pja.187.1625931108959; Sat, 10 Jul 2021 08:31:48 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 05/41] tcg: Move tb_phys_invalidate_count to tb_ctx Date: Sat, 10 Jul 2021 08:31:07 -0700 Message-Id: <20210710153143.1320521-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Viktor Ashirov Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We can call do_tb_phys_invalidate from an iocontext, which has no per-thread tcg_ctx. Move this to tb_ctx, which is global. The actual update still takes place with a lock held, so only an atomic set is required, not an atomic increment. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/457 Tested-by: Viktor Ashirov Signed-off-by: Richard Henderson --- accel/tcg/tb-context.h | 1 + include/tcg/tcg.h | 3 --- accel/tcg/translate-all.c | 8 ++++---- tcg/region.c | 14 -------------- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/accel/tcg/tb-context.h b/accel/tcg/tb-context.h index cc33979113..cac62d9749 100644 --- a/accel/tcg/tb-context.h +++ b/accel/tcg/tb-context.h @@ -34,6 +34,7 @@ struct TBContext { /* statistics */ unsigned tb_flush_count; + unsigned tb_phys_invalidate_count; }; extern TBContext tb_ctx; diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index dedb86939a..25dd19d6e1 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -579,8 +579,6 @@ struct TCGContext { /* Threshold to flush the translated code buffer. */ void *code_gen_highwater; - size_t tb_phys_invalidate_count; - /* Track which vCPU triggers events */ CPUState *cpu; /* *_trans */ @@ -815,7 +813,6 @@ size_t tcg_code_capacity(void); void tcg_tb_insert(TranslationBlock *tb); void tcg_tb_remove(TranslationBlock *tb); -size_t tcg_tb_phys_invalidate_count(void); TranslationBlock *tcg_tb_lookup(uintptr_t tc_ptr); void tcg_tb_foreach(GTraverseFunc func, gpointer user_data); size_t tcg_nb_tbs(void); diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 57455d8639..4df26de858 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1219,8 +1219,8 @@ static void do_tb_phys_invalidate(TranslationBlock *tb, bool rm_from_page_list) /* suppress any remaining jumps to this TB */ tb_jmp_unlink(tb); - qatomic_set(&tcg_ctx->tb_phys_invalidate_count, - tcg_ctx->tb_phys_invalidate_count + 1); + qatomic_set(&tb_ctx.tb_phys_invalidate_count, + tb_ctx.tb_phys_invalidate_count + 1); } static void tb_phys_invalidate__locked(TranslationBlock *tb) @@ -2128,8 +2128,8 @@ void dump_exec_info(void) qemu_printf("\nStatistics:\n"); qemu_printf("TB flush count %u\n", qatomic_read(&tb_ctx.tb_flush_count)); - qemu_printf("TB invalidate count %zu\n", - tcg_tb_phys_invalidate_count()); + qemu_printf("TB invalidate count %u\n", + qatomic_read(&tb_ctx.tb_phys_invalidate_count)); tlb_flush_counts(&flush_full, &flush_part, &flush_elide); qemu_printf("TLB full flushes %zu\n", flush_full); diff --git a/tcg/region.c b/tcg/region.c index d3a3658e81..e64c3ea230 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -980,17 +980,3 @@ size_t tcg_code_capacity(void) return capacity; } - -size_t tcg_tb_phys_invalidate_count(void) -{ - unsigned int n_ctxs = qatomic_read(&tcg_cur_ctxs); - unsigned int i; - size_t total = 0; - - for (i = 0; i < n_ctxs; i++) { - const TCGContext *s = qatomic_read(&tcg_ctxs[i]); - - total += qatomic_read(&s->tb_phys_invalidate_count); - } - return total; -} From patchwork Sat Jul 10 15:31:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E11E3C07E95 for ; Sat, 10 Jul 2021 15:33:08 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 99EEC60FF2 for ; Sat, 10 Jul 2021 15:33:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99EEC60FF2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2EyZ-0008AG-KC for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:33:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExM-000521-Ma for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:52 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:46913) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExL-0002EM-2l for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:52 -0400 Received: by mail-pl1-x635.google.com with SMTP id c15so6622036pls.13 for ; Sat, 10 Jul 2021 08:31:50 -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=CYAA0gCcixaZvejCGIEmqi8brwY1zVT0feeRzB35ZxQ=; b=tED+WZ27q/v2AbfSeaZysfo10uxy09ZcSkxdPCt+9nT1EhDdPQogqyyeZPoYbwt7r6 I/rcNbiVgN2oa7KsscUcnKXdI9twVnadwuN3GUZrs8WfGWoAIWXFc/DUshX78vK2VIgd 9Sit04/g4MZkb3lZQDsgPW1YqdXBfC7gRn5frukkzOGNdrGPO6oCLNIJhOF1r+CldvzU oDkXreu4fwKlKX6sPdJ9QejAoQP1sSzd6FDzM8bhUTg8pYawpGtPuJv5HccTULcTbvg5 mXgLf1l0R2aQHTtjqxCuc6INAEfmFeJZsvBP6LEk9YEO9nwiTsC5RJS/GD1l9xNCBl0i rJVg== 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=CYAA0gCcixaZvejCGIEmqi8brwY1zVT0feeRzB35ZxQ=; b=lEvGsFVbvRgKJcr6BrmYx+2uJhtjWeGrmK5mCDr7pLYXV7BIRFhonCcM/knRhl/FbP BhBcAOh1KAZB5LdNRVfAjx3emtJaJvwiC5kFWo5JKrfHsATdnkmGx9GHfcy9yb9B1Q6U +3oNn4oi5B3TK87PQcVoPUSWjacdVGPMpSyOFgk8yRPNQfWPK0LpGDkoDffQB3hWnCQh oNID8efMDgHhmsk8D+PtIEb4uycZpc0nZbnAChvblhDIjCbXZ7fDd/K82hTTxweGJvI3 SO6ITWw1E3SFATlg+LBt17ZnwflMwABVnt5mZwTNzSy5ElHhojKqZQoEOgTa5nXX4vn6 xyEg== X-Gm-Message-State: AOAM533omZa7M21pqQfEM0mmD25Q39sufOz6bRFa3NLbvr5+TGm+3Jfz rRWExHqC+6bbFFR0JDcpN66AYUd90xibsw== X-Google-Smtp-Source: ABdhPJzVaBs3OI6rhKnVTBKCpl1c/i0CSj1luOg53YCJUVEOA+/2aTeoPZKsqdJ6M0lpLRASG6syuA== X-Received: by 2002:a17:903:248e:b029:101:fa49:3f96 with SMTP id p14-20020a170903248eb0290101fa493f96mr35667689plw.16.1625931109686; Sat, 10 Jul 2021 08:31:49 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 06/41] accel/tcg: Introduce translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:08 -0700 Message-Id: <20210710153143.1320521-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add a generic version of the common use_goto_tb test. Various targets avoid the page crossing test for CONFIG_USER_ONLY, but that is wrong: mmap and mprotect can change page permissions. Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/translator.h | 10 ++++++++++ accel/tcg/translator.c | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/exec/translator.h b/include/exec/translator.h index 24232ead41..dd9c06d40d 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -145,6 +145,16 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db, void translator_loop_temp_check(DisasContextBase *db); +/** + * translator_use_goto_tb + * @db: Disassembly context + * @dest: target pc of the goto + * + * Return true if goto_tb is allowed between the current TB + * and the destination PC. + */ +bool translator_use_goto_tb(DisasContextBase *db, target_ulong dest); + /* * Translator Load Functions * diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 1d32732198..59804af37b 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -31,6 +31,17 @@ void translator_loop_temp_check(DisasContextBase *db) } } +bool translator_use_goto_tb(DisasContextBase *db, target_ulong dest) +{ + /* Suppress goto_tb in the case of single-steping. */ + if (db->singlestep_enabled || singlestep) { + return false; + } + + /* Check for the dest on the same page as the start of the TB. */ + return ((db->pc_first ^ dest) & TARGET_PAGE_MASK) == 0; +} + void translator_loop(const TranslatorOps *ops, DisasContextBase *db, CPUState *cpu, TranslationBlock *tb, int max_insns) { From patchwork Sat Jul 10 15:31:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368725 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67C7DC07E95 for ; Sat, 10 Jul 2021 15:39:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0835961175 for ; Sat, 10 Jul 2021 15:39:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0835961175 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F4g-0008Ch-VY for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:39:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExN-00053p-EF for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:53 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:39681) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExL-0002EX-Hd for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:53 -0400 Received: by mail-pj1-x102f.google.com with SMTP id p14-20020a17090ad30eb02901731c776526so7665935pju.4 for ; Sat, 10 Jul 2021 08:31:51 -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=YLJ230I1oEo8wIMfdqq6LnEEYsPnK+bG8iGL/6v72HE=; b=gVpAOqLn+f74efQ6shB0Z+7X1nZlH7rcD1oFtW0rxqglvJ8WxYJ468IGUazzmgXOqJ j8+MCFUpnOeGBdWZwl2O/AVH/0mnX8FmGLNLyVWZJYJLoU23B8ByYTwAblCgZI3XKA0t PEasLwoxttyjX4bB8/IGcrHXZhvOIBdMuKqsCIlWu9imAbCL/M/oHOrMzOVQuwFxEoTs zZoVdlZWiaFY0criETRISRj1fXYAZbunITZpSuZk7OhLrdRW6LtSnIxPsnRARyPMudSw HDITHnfh4nQJT7Umlzx15gTlZ7+YGq9pnn13PJTN59t28OKfVgmtdUrCjjr+aWUmaaJT ch5w== 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=YLJ230I1oEo8wIMfdqq6LnEEYsPnK+bG8iGL/6v72HE=; b=NDmdzssHHCLSGTZDGEvGTRJhiEx4nh+IeknVkn3nR+pZktEAVlkBc4kke6swSGDnkU PHP88380m3IwDyyXC0KtewNuRaGFFisk3O3n5r8NoZ0839/l9b8cyd/APt9Bh4Y2bwie LEQZ+qAfQJFf6U0Mq5sLyjxBJztXvTwnEzrOjX/PZ+qaVmE2bIzTdorcC2zg86Pyfe0/ 9pK6k1yW1kqw+Bkd0ieBWfpU4wwZdN66TqryVA+1ionIzzWQCpHCzY1kMJvR+g76qY1W 2PG9WOc6y8XkKfdoMiNyNSE4SM3YbuK9uZcHft8KCxDhjM8GzDvdWO01rGsu219Z+PGt pSNQ== X-Gm-Message-State: AOAM533jmsEGG5R/+hsnM+8I9kqla7r/VC5WUwgqG8hbHEdaM1iqeeD0 gwtzNa+t7WV7iRPmcP6SPG9UJNUlQ15jfg== X-Google-Smtp-Source: ABdhPJziXB0Dm5sk0OkzZNx+VbXOB/sYJOXpG0f1di+VcJwKQUsBlT4klI8yoY6XBJMAiHx3XtU9Mw== X-Received: by 2002:a17:90a:86c6:: with SMTP id y6mr8023192pjv.16.1625931110256; Sat, 10 Jul 2021 08:31:50 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 07/41] target/alpha: Remove use_exit_tb Date: Sat, 10 Jul 2021 08:31:09 -0700 Message-Id: <20210710153143.1320521-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We have not needed to end a TB for I/O since ba3e7926691 ("icount: clean up cpu_can_io at the entry to the block"). We do not need to use exit_tb for singlestep, which only means generate one insn per TB. Which leaves only singlestep_enabled, which means raise a debug trap after every TB, which does not use exit_tb, which would leave the function mis-named. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/alpha/translate.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index a607c898f4..cb2cb2de6b 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -449,19 +449,8 @@ static bool in_superpage(DisasContext *ctx, int64_t addr) #endif } -static bool use_exit_tb(DisasContext *ctx) -{ - return ((tb_cflags(ctx->base.tb) & CF_LAST_IO) - || ctx->base.singlestep_enabled - || singlestep); -} - static bool use_goto_tb(DisasContext *ctx, uint64_t dest) { - /* Suppress goto_tb in the case of single-steping and IO. */ - if (unlikely(use_exit_tb(ctx))) { - return false; - } #ifndef CONFIG_USER_ONLY /* If the destination is in the superpage, the page perms can't change. */ if (in_superpage(ctx, dest)) { @@ -1270,7 +1259,7 @@ static DisasJumpType gen_call_pal(DisasContext *ctx, int palcode) need the page permissions check. We'll see the existence of the page when we create the TB, and we'll flush all TBs if we change the PAL base register. */ - if (!use_exit_tb(ctx)) { + if (!ctx->base.singlestep_enabled) { tcg_gen_goto_tb(0); tcg_gen_movi_i64(cpu_pc, entry); tcg_gen_exit_tb(ctx->base.tb, 0); @@ -3094,7 +3083,7 @@ static void alpha_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); /* FALLTHRU */ case DISAS_PC_UPDATED: - if (!use_exit_tb(ctx)) { + if (!ctx->base.singlestep_enabled) { tcg_gen_lookup_and_goto_ptr(); break; } From patchwork Sat Jul 10 15:31:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368727 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCB28C07E9B for ; Sat, 10 Jul 2021 15:39:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 963B961184 for ; Sat, 10 Jul 2021 15:39:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 963B961184 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F4h-0008Eg-P9 for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:39:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExO-000560-13 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:54 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:41843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExM-0002FS-7m for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:53 -0400 Received: by mail-pj1-x1035.google.com with SMTP id oj10-20020a17090b4d8ab0290172f77377ebso7822189pjb.0 for ; Sat, 10 Jul 2021 08:31:51 -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=XCqRJMe+RdTFdeG7cM5qJnxRaVl12uLPvY3JnI4VuRk=; b=nwlCfDEU+AT8OMBSeTIrvwv4l7jOmWubC+VKK2zzeHHX26Z6GIKqXM4kVnF8leugWQ 8c+cV7SK5LRtmFmUBGTYY0h8rer16X+biWFbL3hXNEz98yssyK29i0CnpLxOzR79Levk OTXmlxjLRHUCqMEBmPWG/f8/GLWbPMtpwFlTbyYZNBP0ORVIJKZvHqxuyEOw/JRSKAkQ 5gb12cYUGWsO4umE8D/BUWi8t1Gwh4LJb8H2hShqLqWQeMjNBnh+ArUtx5ZauJ7RPVwA lSG4hgpTggzEBW0YIt4e0hBcp8llQkEjsnhZ6oSA5RBAvvtbWM0lcmDl8sXl5pikjD8Q Q//A== 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=XCqRJMe+RdTFdeG7cM5qJnxRaVl12uLPvY3JnI4VuRk=; b=HbDGKT7gBwDgd5CfvDap8N1YyPc59OpC4fPONNr3ku2Srom77sbn2HLw3pP8nVo+qy Suy8pDVFA4i3Qz+7i06PG1X+9CA3c8XgoxlBYP6Gq92S5Ihib2UoxUg+y4PUz+f7wFti Dzx7yiN4VqNp1CgYOsQXE1WE7bNLPdeSlYVFhJAuRAfp2PLdtRAsaCAKL5yzfSERWj4k JGUS6dDhgt2cH+78+Y/8ia44Sc+5kV2hgb4DIJZ0JleADfC73s5yEd2aaekFS3WVPjZ3 vtTM7ePzPtTdeqKnL7ADX3Y9dYYjj1NawkQHAaW9iKvsN7j3PR5hYU7o153xGPHcEHjd tBww== X-Gm-Message-State: AOAM531jHafFhKdgDnCdmzJo00gVaTvGoDZ5j1XjV9YbRtPnd2iKgsiZ PZchCvMBohnj/xjPYB77dWEpGVI/VcD/fA== X-Google-Smtp-Source: ABdhPJxWQgloEl8cH692D93CgmwT7O04s+aqrZnvn2bs4gRewPdig1Ib+/K9x6r9+RHD4DQiVB8xdQ== X-Received: by 2002:a17:902:864c:b029:10d:8c9e:5f56 with SMTP id y12-20020a170902864cb029010d8c9e5f56mr36119865plt.8.1625931110857; Sat, 10 Jul 2021 08:31:50 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 08/41] target/alpha: Remove in_superpage Date: Sat, 10 Jul 2021 08:31:10 -0700 Message-Id: <20210710153143.1320521-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The number of links across (normal) pages using this is low, and it will shortly violate the contract for breakpoints. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/alpha/translate.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index cb2cb2de6b..bb7b5ce994 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -438,24 +438,9 @@ static DisasJumpType gen_store_conditional(DisasContext *ctx, int ra, int rb, return DISAS_NEXT; } -static bool in_superpage(DisasContext *ctx, int64_t addr) -{ -#ifndef CONFIG_USER_ONLY - return ((ctx->tbflags & ENV_FLAG_PS_USER) == 0 - && addr >> TARGET_VIRT_ADDR_SPACE_BITS == -1 - && ((addr >> 41) & 3) == 2); -#else - return false; -#endif -} - static bool use_goto_tb(DisasContext *ctx, uint64_t dest) { #ifndef CONFIG_USER_ONLY - /* If the destination is in the superpage, the page perms can't change. */ - if (in_superpage(ctx, dest)) { - return true; - } /* Check for the dest on the same page as the start of the TB. */ return ((ctx->base.tb->pc ^ dest) & TARGET_PAGE_MASK) == 0; #else @@ -2990,7 +2975,7 @@ static void alpha_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) { DisasContext *ctx = container_of(dcbase, DisasContext, base); CPUAlphaState *env = cpu->env_ptr; - int64_t bound, mask; + int64_t bound; ctx->tbflags = ctx->base.tb->flags; ctx->mem_idx = cpu_mmu_index(env, false); @@ -3019,12 +3004,7 @@ static void alpha_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) ctx->lit = NULL; /* Bound the number of insns to execute to those left on the page. */ - if (in_superpage(ctx, ctx->base.pc_first)) { - mask = -1ULL << 41; - } else { - mask = TARGET_PAGE_MASK; - } - bound = -(ctx->base.pc_first | mask) / 4; + bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4; ctx->base.max_insns = MIN(ctx->base.max_insns, bound); } From patchwork Sat Jul 10 15:31:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AE28C07E95 for ; Sat, 10 Jul 2021 15:34:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A8EE610E6 for ; Sat, 10 Jul 2021 15:34:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A8EE610E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F0D-0005SY-6I for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:34:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExO-00056c-93 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:54 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:43739) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExM-0002Fp-Ld for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:54 -0400 Received: by mail-pf1-x42b.google.com with SMTP id a127so11671828pfa.10 for ; Sat, 10 Jul 2021 08:31:52 -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=966eOOQRBaspjRNs052m7zB6E/T5XsOP0DeM1nAzdlc=; b=sQuD/u1b5YzsFYuc2hKS4vTmW0o1CV+T3BOcAcu+4FEwArKTlf//ki+jy21+D6d9uO iB4yeOsL8s6PeZ/zOrB5RtIK3+wh54qBuCmAIZz8BIg7TvgUUsOJzmLuAo3mgDH1laHF 5Zk/9t1At/QKwYIIxvW/1hlkYXQs+maAKYwlqdEP21hDYCZbmTi74u8deiQ59Wx/kbwn MSejRMPq5QjN4Nm8coMqKA5mVCmNGPdgCKiq6R30IGJdzs8/GEjK7pEg6HVx34sylDCv imPIbgLjy4LCOtNz889iNam60C1tFNAeJ29naHUwf4lfeJujW4gHJt7ZbyPKz5JFaZQN rmQg== 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=966eOOQRBaspjRNs052m7zB6E/T5XsOP0DeM1nAzdlc=; b=N9JzFEpX6+/M1xpqYNUjj/aFRZs7m/5Q6cS9ZipNBrCm+/scdayrjqioLVnkfqFXLf Huw4lNVmbC/kcKGAIPcjI5+X2K49Wh0hy16h68Dc7xP0gmOcgaqwsbcwGxcN7auKcPEe Thay5EJKADi2EoDHETiObSfKxM5as/fU03R2Y3VwWGA+453ozwMh11J26W5REO46q2kN oaE0re5eNrJ7D0m8oO0at1j/y/gvhdw9f78e7lwZJQJbKchyNo1LVDNR10g3hT+NmBDK /XSj5fQ6kzYAON16F7bTlTwrtGLXjcCt5bZ+9nR8DQO7Sk4R8z3EXjjvHSEm0T8W4Bm3 fJCw== X-Gm-Message-State: AOAM531FJQc0CvivIvTHI7Q+hgAshUpauFMUoftS5qlAGQjFYNlfwUfJ Uhry5EZjtnzgToBuCHy3anZXGU9xQX3jrw== X-Google-Smtp-Source: ABdhPJxGwTXOUPROVJLWahxE/uye/VfbAFkkgVX5V9xZRQMcprtxGVpga+2DGAdzlJAt7ScngJgblw== X-Received: by 2002:a63:b48:: with SMTP id a8mr33036940pgl.169.1625931111470; Sat, 10 Jul 2021 08:31:51 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/41] target/alpha: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:11 -0700 Message-Id: <20210710153143.1320521-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/alpha/translate.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index bb7b5ce994..833d3baa7b 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -440,12 +440,7 @@ static DisasJumpType gen_store_conditional(DisasContext *ctx, int ra, int rb, static bool use_goto_tb(DisasContext *ctx, uint64_t dest) { -#ifndef CONFIG_USER_ONLY - /* Check for the dest on the same page as the start of the TB. */ - return ((ctx->base.tb->pc ^ dest) & TARGET_PAGE_MASK) == 0; -#else - return true; -#endif + return translator_use_goto_tb(&ctx->base, dest); } static DisasJumpType gen_bdirect(DisasContext *ctx, int ra, int32_t disp) From patchwork Sat Jul 10 15:31:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3B58C07E95 for ; Sat, 10 Jul 2021 15:33:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48D9360E0B for ; Sat, 10 Jul 2021 15:33:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48D9360E0B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Eyh-0008Jj-BW for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:33:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExP-00059C-0W for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:55 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:51721) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExN-0002GZ-CG for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:54 -0400 Received: by mail-pj1-x102b.google.com with SMTP id n11so7433067pjo.1 for ; Sat, 10 Jul 2021 08:31:52 -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=Cv9aQndI0rEwp95MS68py3M2LPMGPGCFK/5GDBRseGA=; b=kqrb0bDbXJVnVvo4sIaPpp3dDLUb5LWbSCHmDYoKnmuySncdTbzMlK5zxn2la3J/ce 8H8pq0q+JejMnDcaBW+ALSBMFhlOhmJNuP2gGTtpbLX8aJejyswENN9ZW9Cj1ok+kGSO DNMZGIqFQveqxusJd4zQH2POhUNVYfzOSq8GMVrDneAj3iLNaK8jqBJyXpRFC4bw1c5Z T+zyf1ou5AXX3wWONV936ZCwXTktRBXkGitMNipz28tsC7BZn6aZgLPEofJXqpgBUQms 7Yw0TeD357fmB3W5+RyRbqxAf41992xCvqeG8IoZJN61ZzWdrZdcVBkmwtvWnBcEcqv9 9chg== 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=Cv9aQndI0rEwp95MS68py3M2LPMGPGCFK/5GDBRseGA=; b=Sl/1zlPTXor6utTDhtfp3KvSJaoEkerF9J2QP8Czr3ksWtbpWm8NmzsOiA0H/roWDE 3Jeyj/+egjUlvdqtpcRLg9L/BUxtbyAxKniuEo8eUfGNPCB7qUvpqsinzLMNXxoXoGWy SeaJUaiBOCiWs9cBQvWB+66yGKHyo32FOLNgWJanIO0Uvjno2mYjcVDQHAagyNdxsCfz FmHlRkE1WXia0wu5PvitsqLYoSGU69klQyCYjpjcMCd17nD7fx89EXvLDx6MDc46qnjC 9cr9oCwzAyF9XYwGZAFTLl5es45pAhh8Zl2fFeUjwqqDKwbN0AiHyYHDDitcb/nLWmUQ 1a5w== X-Gm-Message-State: AOAM530KiKOM8P+mdjLTqJ4tAWWfSMLvt57bLb/ZUwcF/rvJJDyZ+qdX mi0W6VFNsvrhrW3sXQ8qVz4X4BnC1+zUzw== X-Google-Smtp-Source: ABdhPJxlTcl/E5LQAJyRC8EQmp92kjNJKKwHNQaSLFMTG3wInog7TvuzFpxDe+Z7Y7BRLeVH7X+lBw== X-Received: by 2002:a17:902:aa49:b029:10d:22fa:13d4 with SMTP id c9-20020a170902aa49b029010d22fa13d4mr35660319plr.78.1625931112109; Sat, 10 Jul 2021 08:31:52 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 10/41] target/arm: Use DISAS_TOO_MANY for ISB and SB Date: Sat, 10 Jul 2021 08:31:12 -0700 Message-Id: <20210710153143.1320521-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Using gen_goto_tb directly misses the single-step check. Let the branch or debug exception be emitted by arm_tr_tb_stop. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index fdf2b3d1c8..6d2867be1d 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -8904,7 +8904,7 @@ static bool trans_ISB(DisasContext *s, arg_ISB *a) * self-modifying code correctly and also to take * any pending interrupts immediately. */ - gen_goto_tb(s, 0, s->base.pc_next); + s->base.is_jmp = DISAS_TOO_MANY; return true; } @@ -8918,7 +8918,7 @@ static bool trans_SB(DisasContext *s, arg_SB *a) * for TCG; MB and end the TB instead. */ tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC); - gen_goto_tb(s, 0, s->base.pc_next); + s->base.is_jmp = DISAS_TOO_MANY; return true; } From patchwork Sat Jul 10 15:31:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F17BC07E95 for ; Sat, 10 Jul 2021 15:41:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF0D3611B0 for ; Sat, 10 Jul 2021 15:41:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF0D3611B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F72-0005TN-01 for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:41:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExP-0005BX-LR for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:55 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:35838) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExN-0002Gi-Vk for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:55 -0400 Received: by mail-pj1-x1029.google.com with SMTP id h1-20020a17090a3d01b0290172d33bb8bcso10004605pjc.0 for ; Sat, 10 Jul 2021 08:31:53 -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=z7Ncc5FKGICE8G9HC6MS3YW5C1jF/+Zh1RQa1f4ley4=; b=RANhMiECF+dWk8ZxPygJ3eH8FcPHjhQs4bxuO0AIacN1f4Ob2fJhnJR2grxc3AU481 YZ73zCRUZFs77t9c3v4b1fUgjjEErmvsc/94aRoi6usnw8MAx5hVtnANz7lrAIiiq6Wr TqzHBFkqfSRkremeALMCusyS+pV/N/4vyZ2NouzMluzZzExLyAF6V5tOKugWYs+Ux5TW 0sCBG87oslx+cStwycTxkIBT5XJwbrNiOQiLuN+JPK5fI5l2ffJJDL4E6KwWavIztVRC uXwE0n/cJzbKcaxESVjb4reBFWiFzi8NI/06U8PSccT7zrPMdtktL7Dy98X59dnUC7dU ar6g== 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=z7Ncc5FKGICE8G9HC6MS3YW5C1jF/+Zh1RQa1f4ley4=; b=owO1HZ4Xnr9elArExQ08j3jMQDzGMGynC9X3xQXUBCtk5RBRPvao0lDxxRvZKvHOx6 kI277EjU8ccuNYT7KBGNmZtV6AYq0DqK22z+KEG1x6jWvV6o4nB+/RQ5TnqyXUz5eazW WgLdzOLEEHo5yOiS4l74umTOWl5Y/dH9dQjg7M/v6AqFr6LFSwtBy51ume86H16ws9+m 4UOLSozb0EmRRo/4+wRBUEkzvv6e1HCI4ejn5WX4StTfTDADsJLkbX+bncmtuvoavjp+ sv9L4txgURVjDBv9evcZpsNGvEvWouw3c4nIGJQNTcu96jAMo35MEPz+bY9KRscS57Gz 2WIQ== X-Gm-Message-State: AOAM533IqeOI2pBbcE4ROyecKxglH95CqFTkQfNLM5JKRi/M001VICKK NfgsnLWZq+VgFJSPQ/Tl7/I/uF8B3GlePQ== X-Google-Smtp-Source: ABdhPJzyU+YTzYfn9zomUymO04eViNqarW/nnBX40G3XizTsNWaL4pmDqy0fX9e/DMLgH9MgfKe+nw== X-Received: by 2002:a17:90a:928c:: with SMTP id n12mr43274630pjo.30.1625931112705; Sat, 10 Jul 2021 08:31:52 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/41] target/arm: Use translator_use_goto_tb for aarch64 Date: Sat, 10 Jul 2021 08:31:13 -0700 Message-Id: <20210710153143.1320521-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We have not needed to end a TB for I/O since ba3e7926691 ("icount: clean up cpu_can_io at the entry to the block"), and gdbstub singlestep is handled by the generic function. Drop the unused 'n' argument to use_goto_tb. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index a6dd9ec701..ca11a5fecd 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -385,35 +385,20 @@ static void gen_step_complete_exception(DisasContext *s) s->base.is_jmp = DISAS_NORETURN; } -static inline bool use_goto_tb(DisasContext *s, int n, uint64_t dest) +static inline bool use_goto_tb(DisasContext *s, uint64_t dest) { - /* No direct tb linking with singlestep (either QEMU's or the ARM - * debug architecture kind) or deterministic io - */ - if (s->base.singlestep_enabled || s->ss_active || - (tb_cflags(s->base.tb) & CF_LAST_IO)) { + if (s->ss_active) { return false; } - -#ifndef CONFIG_USER_ONLY - /* Only link tbs from inside the same guest page */ - if ((s->base.tb->pc & TARGET_PAGE_MASK) != (dest & TARGET_PAGE_MASK)) { - return false; - } -#endif - - return true; + return translator_use_goto_tb(&s->base, dest); } static inline void gen_goto_tb(DisasContext *s, int n, uint64_t dest) { - const TranslationBlock *tb; - - tb = s->base.tb; - if (use_goto_tb(s, n, dest)) { + if (use_goto_tb(s, dest)) { tcg_gen_goto_tb(n); gen_a64_set_pc_im(dest); - tcg_gen_exit_tb(tb, n); + tcg_gen_exit_tb(s->base.tb, n); s->base.is_jmp = DISAS_NORETURN; } else { gen_a64_set_pc_im(dest); From patchwork Sat Jul 10 15:31:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368733 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B529C07E9B for ; Sat, 10 Jul 2021 15:41:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D8A25611AD for ; Sat, 10 Jul 2021 15:41:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8A25611AD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F72-0005Qd-2t for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:41:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExQ-0005D9-5P for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:56 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:45606) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExO-0002Gt-JY for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:55 -0400 Received: by mail-pl1-x62d.google.com with SMTP id p17so6109908plf.12 for ; Sat, 10 Jul 2021 08:31:54 -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=gi4JUoURliPyWsKfGdialikoU/us1Pcocvv5cHbTgz8=; b=fJ8SxhNkAxMZ1QLGseq+NoCsfxA+jzRRa/QKazbivVmvhiych7F3hDK8yLAkoDPXe/ 1Wk/LTAQip0euRZo+Ta1dVIwG1/TYwrM07fPQeU1CyKQjeRcBDV3t5Y2tA1dBxOpVRV1 nbRPF3zMNQIfS3LGf347GN/pg5ELv7DUJv6cu+oFSr8qSAEfzoFc0Qdg6hLC49/TN2Sy /x4nFhn6ceNmvAm2Op7zaWzLDGk/Gk1LzgSZDzyntm+ow8S52G3Jenvemdx5ODzTC/Uq SPH3VvnDGDjdiMLpamAo/bjcU7LfWOUGy8jGV0eQOhN6OhR8hGD2JigP2yqowi6BqfeQ h0Mw== 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=gi4JUoURliPyWsKfGdialikoU/us1Pcocvv5cHbTgz8=; b=eaxEVzukJ8WGmoyp7E+6BjYCtLz6LjCprkLvp8tlQX9RnqzXmXT7g8dRCAllbKDhME 1eg7zZ7Czt0+amCwVekfjALxQ8cJrEF3dqKUFuU58Kbb5rUVhASNwoOQUe8Z/QRf9Cw7 hmdWfeW37cqqvxi52aKB9WWTJo7nD/Kfh26oFHT8Jw3P19tabsKTepWBuO5Kw0P13FOV wDBBwzy7qDgbVY/bOcwiNE27F2d3OZl0ijCk3uLCi6Cgfjlg9/mUGEjvTWAYsMqAtNjL EV3Zv+e26mMg2kYgM9grTff5r6t4lZoq99s1eD+/aEJbP08PKpDfv2p8H/0n/TbBzbwi DdNA== X-Gm-Message-State: AOAM531Muv4vQq+Bg68BjTyAxod6N/zOuc74gzhnOHXeBK9JTS7KJUNu 2/a5D6PJvJ6jcX0iORqimgrJXpLOQWRc2Q== X-Google-Smtp-Source: ABdhPJwbifQJPzm5MM0vArqPYyYxrFwEaCvdE3emkYlkBTTUEJCWdkiYSjC3PR01iK4sBCt7Un55lw== X-Received: by 2002:a17:902:d694:b029:129:b8db:c815 with SMTP id v20-20020a170902d694b0290129b8dbc815mr19906297ply.74.1625931113307; Sat, 10 Jul 2021 08:31:53 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 12/41] target/arm: Use translator_use_goto_tb for aarch32 Date: Sat, 10 Jul 2021 08:31:14 -0700 Message-Id: <20210710153143.1320521-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just use translator_use_goto_tb directly at the one call site, rather than maintaining a local wrapper. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 6d2867be1d..e1a8152598 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -2578,16 +2578,6 @@ static int disas_dsp_insn(DisasContext *s, uint32_t insn) return 1; } -static inline bool use_goto_tb(DisasContext *s, target_ulong dest) -{ -#ifndef CONFIG_USER_ONLY - return (s->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) || - ((s->base.pc_next - 1) & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif -} - static void gen_goto_ptr(void) { tcg_gen_lookup_and_goto_ptr(); @@ -2599,7 +2589,7 @@ static void gen_goto_ptr(void) */ static void gen_goto_tb(DisasContext *s, int n, target_ulong dest) { - if (use_goto_tb(s, dest)) { + if (translator_use_goto_tb(&s->base, dest)) { tcg_gen_goto_tb(n); gen_set_pc_im(s, dest); tcg_gen_exit_tb(s->base.tb, n); From patchwork Sat Jul 10 15:31:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DDF8C07E95 for ; Sat, 10 Jul 2021 15:36:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A5F361154 for ; Sat, 10 Jul 2021 15:36:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A5F361154 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F1s-0002j6-Aj for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:36:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExQ-0005G2-Rn for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:56 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:38564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExP-0002Hi-7P for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:56 -0400 Received: by mail-pl1-x62e.google.com with SMTP id u3so1515796plf.5 for ; Sat, 10 Jul 2021 08:31:54 -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=k3KB/Tkz24jiJG0J6xu6GsoVxf3biKKstX86Aezy0Ms=; b=AAe2sx0hx4GS4/VBdE075MymUp8Qz5UJSVBAjFBiEr3m3w1MxwFbfhekwxil/9MQF0 se2uwvnOIhg9TG+SGybufMzOZiCzJZOzzeqwh6UvAYGf85lAS8yyiSq9Rtxh+tCWFkG8 t3VEXz764DczZqVCqwHufQV28LFpIac/wEsdVaIGmR+MMlcVxG+skbOdjyghz0gyWG0U u1/ByyX9+wQNmK/5SZQdVpBHGkYFO2jSks6b6st2/uXVMmOeSJMkT8nuaIjj3Tp7ezIT EHpkw/He+rz5Zuq5MaptgW0Dhvwtkw1FCT75r4CGlAvSwyxxhu1ZJO7pVunZvwHIHlvx H4ZA== 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=k3KB/Tkz24jiJG0J6xu6GsoVxf3biKKstX86Aezy0Ms=; b=QoDfDY2Q5TLQJd4d2kZntdUiEjMhkICPakNNLj5++k+ION3YH+GVjFJW3PGXeEZ9eG IHpKLkgXOXsEEb6//4nLt6kIeqhvV5yvxGYlnCgT1DI7ye7uSGRqneH0Jo0/XbI9rG/Z 5zolIHrWHODOOabdMXKnHnSTkjxlTe9+5scipgheVyHjrL2+YmyprNckYEHLZv4VeLl4 pdKbPsTPKXQ9VzsLZ5AhkGFxF8Xe/Gh3GWbBjH3aNemwPb8CJQADdZ5LkLf9YmQfmhYQ z7w9lEXK77FpJb5F8T4Mp4EpgmkT0IQo6ajoxTwbe6IJmEDxDQU82ZzI4ZHa7rBnAs6G YheQ== X-Gm-Message-State: AOAM533ROY4aPqFmWP2uE2AzOAfp2Xc74cxRkbyURDM8m/esD9ERJJ+B tZ7G//9IBKvZupKWXQhqULN04JD40hsQGw== X-Google-Smtp-Source: ABdhPJw48/e79ptC4n8lLF0VM9ZVqYXwyUgcNaQIz1zBozJfopB+W0NQPe8WTl1mVuAIXTv+x+Molg== X-Received: by 2002:a17:90a:4e4a:: with SMTP id t10mr44057558pjl.173.1625931113917; Sat, 10 Jul 2021 08:31:53 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 13/41] target/avr: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:15 -0700 Message-Id: <20210710153143.1320521-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Single stepping is not the only reason not to use goto_tb. If goto_tb is disallowed, and single-stepping is not enabled, then use tcg_gen_lookup_and_goto_tb to indirectly chain. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/avr/translate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c index c06ce45bc7..8237a03c23 100644 --- a/target/avr/translate.c +++ b/target/avr/translate.c @@ -1083,14 +1083,17 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) { const TranslationBlock *tb = ctx->base.tb; - if (!ctx->base.singlestep_enabled) { + if (translator_use_goto_tb(&ctx->base, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_i32(cpu_pc, dest); tcg_gen_exit_tb(tb, n); } else { tcg_gen_movi_i32(cpu_pc, dest); - gen_helper_debug(cpu_env); - tcg_gen_exit_tb(NULL, 0); + if (ctx->base.singlestep_enabled) { + gen_helper_debug(cpu_env); + } else { + tcg_gen_lookup_and_goto_ptr(); + } } ctx->base.is_jmp = DISAS_NORETURN; } From patchwork Sat Jul 10 15:31:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368741 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EED10C07E95 for ; Sat, 10 Jul 2021 15:43:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D69F611AD for ; Sat, 10 Jul 2021 15:43:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D69F611AD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F8d-0002kx-RL for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:43:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExR-0005Ip-Hm for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:57 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:36759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExP-0002IR-Qy for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:57 -0400 Received: by mail-pg1-x531.google.com with SMTP id f5so13162790pgv.3 for ; Sat, 10 Jul 2021 08:31:55 -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=J78iIrV/uBjFzK3bTpbLy3S7PgpqgxUhkktjGy5U398=; b=GIIoO/5xKbWWYqmwwtrB4C4MHHxPxAo74NX6bOiHHyov8GPu2E1HjYK8b8kPJ5vkMa y73Y+Mn8lKKBdsrX0tn5Tnls/sYAubshefOEXWEEBKTLHveF+Ibuk2KraIMkn28SAcZr gw9V6tibNLAD0E294BgwnV8kJ+GOeJX6mOccw7N7DzdVsgrfJ9zrj/SpQD9YeP+OgoI/ WapaOoxvkFlu0ysNyYqv6UUuSZlHc2BAoXLD7XZgNCo4a467rkbyg8cL8xq2RGmDICB3 hz0mW280MVmKovgcAJYfe+frBjbwEEil9CHK7nMW2oT7jYWTc3euXUUvRxWHM+9TxiqN JKOg== 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=J78iIrV/uBjFzK3bTpbLy3S7PgpqgxUhkktjGy5U398=; b=IEr3GjUMsWsiv6JeOKmLiPyIbv9ttdgv61e0x4/4iqHB3V5ZIQh2gITaBaM9gJVNK3 RvEmyMyt5BzVxp9cZP0l46rYysvEO1EyVMeJiJl0aEDe4V5VfNBBTkcQ+GPMgpSmRY1z kTletR4owCx+K40NPbdvWGZMz4Ng5j/x1eIhNyMtMcNVwpKKCgxrcZpjSLVLshIbrgV5 OD6hKMQRTiMBQcV8oMiST+u2MYAlMEptEsaAdOuN9+UVcZPkYqZX/JHo8SEpIvrVpynz DuRfAc49wZrtxLsx7WDUVIPONAA33xklZ2KZnMa1gFc684oQ8XMG4YPwX7B6qZo8ZQQl ZWcw== X-Gm-Message-State: AOAM531JWCnm0xXC8Z9/XvZ2u2n6gotEQuRdwqZ7ybhRdb+S0n9H0eus btlFXnj+LrHmcFZC2uU/Wuq60kA7NPHx9g== X-Google-Smtp-Source: ABdhPJxx3ZinqZhxkUK4D31SpuV//uWBVbF5RI+H36iuBptw00wJxvJT8mE48ap8lxpEd5aEGoPlIw== X-Received: by 2002:a63:383:: with SMTP id 125mr39210085pgd.208.1625931114554; Sat, 10 Jul 2021 08:31:54 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 14/41] target/avr: Mark some helpers noreturn Date: Sat, 10 Jul 2021 08:31:16 -0700 Message-Id: <20210710153143.1320521-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Rolnik , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" All of these helpers end with cpu_loop_exit. Reviewed-by: Michael Rolnik Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/avr/helper.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/avr/helper.h b/target/avr/helper.h index 8e1ae7fda0..4d02e648fa 100644 --- a/target/avr/helper.h +++ b/target/avr/helper.h @@ -19,10 +19,10 @@ */ DEF_HELPER_1(wdr, void, env) -DEF_HELPER_1(debug, void, env) -DEF_HELPER_1(break, void, env) -DEF_HELPER_1(sleep, void, env) -DEF_HELPER_1(unsupported, void, env) +DEF_HELPER_1(debug, noreturn, env) +DEF_HELPER_1(break, noreturn, env) +DEF_HELPER_1(sleep, noreturn, env) +DEF_HELPER_1(unsupported, noreturn, env) DEF_HELPER_3(outb, void, env, i32, i32) DEF_HELPER_2(inb, tl, env, i32) DEF_HELPER_3(fullwr, void, env, i32, i32) From patchwork Sat Jul 10 15:31:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 809A6C07E95 for ; Sat, 10 Jul 2021 15:39:30 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3621661175 for ; Sat, 10 Jul 2021 15:39:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3621661175 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F4j-0008ND-BM for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:39:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExS-0005Ld-5U for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:58 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:40606) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExQ-0002J8-GG for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:57 -0400 Received: by mail-pj1-x1033.google.com with SMTP id b14-20020a17090a7aceb029017261c7d206so9960935pjl.5 for ; Sat, 10 Jul 2021 08:31:56 -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=6X5LcOGj/+Ng0LgouhznZyWXrpfHmdfU0n7UCveDgJU=; b=Xt3Wfbt23W9FDJ7E652mM0XdYa0SxGiJo9gXN44zUk4YwjHf2tP9PqYwe0wR4p/m+c q0NWQfB5Yf+GG8vzK9kufdTQIVgcLo0xQQAQl0Jzxd1zR1wfR/2aIydbhCLtMOJvoU2Z /5AGIROK7iW+l3vJqc1qQyAd76w1U2XEDbIX9twRVDzT7gqHHFpbiHcLLNkeoHG5L1nN J+xCRsxEh95ih4ZnhsCEkRpjy1JYzY+RXCJkXzFArOZJ+uO2R05dfhF4fY0BIgcKer46 U9Ov4m4clVFg61n4RgeFCwyj6aRB+I4i9EFtpfU0tuX2mSR7j50uKxI/tEdgPz6Xn6h0 z4Cw== 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=6X5LcOGj/+Ng0LgouhznZyWXrpfHmdfU0n7UCveDgJU=; b=EVyL1nx5YMASKz3l43YhiIuvHAOzA9q7JW0J932taEIS1cdklLhCptvZiEXJ6GUXvn TyMtZkk6/wkqywIVeusxhIIUXR9Vl9MgwAITqKpCo0ZhwifpgvvTBv9iPH+vUJhqKYsx D8/Bdo84dQRUdXiZzORzurVM63Y+7eTKwzSpyw0VPVC/Kf8tw8Z/6VrZ4KD2Kscs/245 cwwWo8IozF+S6QcZiSgvo/prVLJkBmqPO/5Oj8EeQx5yoJh+DQCtZaH22p1PnETURqzw eBmR9YkLPWBVEkguuWTp2LubzNz4Dh5SLZgIHo9NBdtsbyCbU+WxPFmL702DmnCk3gdw bF0g== X-Gm-Message-State: AOAM532Z9+cEQvjxhh7J9RcBR70ABzAvHLSNlDmTcWLj4rNlCxfRmfz/ +9C+PlnKu+SHlvl13Z6VpXcG06WpQws98g== X-Google-Smtp-Source: ABdhPJw6xsH6CBqDD/23FevN6VF6Eqo4jIUY1m0O8QQ2jZt/haUJQudYJ7vLBuhx4cPPPcpw/PttsA== X-Received: by 2002:a17:902:e04e:b029:10f:133f:87c8 with SMTP id x14-20020a170902e04eb029010f133f87c8mr35537436plx.70.1625931115179; Sat, 10 Jul 2021 08:31:55 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 15/41] target/cris: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:17 -0700 Message-Id: <20210710153143.1320521-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The test for singlestepping is done in translator_use_goto_tb, so we may elide it from cris_tr_tb_stop. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/cris/translate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index a6796c83b9..9258c13e9f 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -481,7 +481,7 @@ static void t_gen_swapr(TCGv d, TCGv s) static bool use_goto_tb(DisasContext *dc, target_ulong dest) { - return ((dest ^ dc->base.pc_first) & TARGET_PAGE_MASK) == 0; + return translator_use_goto_tb(&dc->base, dest); } static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) @@ -3234,8 +3234,7 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) * Use a conditional branch if either taken or not-taken path * can use goto_tb. If neither can, then treat it as indirect. */ - if (likely(!dc->base.singlestep_enabled) - && likely(!dc->cpustate_changed) + if (likely(!dc->cpustate_changed) && (use_goto_tb(dc, dc->jmp_pc) || use_goto_tb(dc, npc))) { TCGLabel *not_taken = gen_new_label(); From patchwork Sat Jul 10 15:31:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368743 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AD4FC07E9E for ; Sat, 10 Jul 2021 15:43:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D4B861209 for ; Sat, 10 Jul 2021 15:43:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D4B861209 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F8e-0002m1-Ae for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:43:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExS-0005Or-Qz for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:58 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:36606) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExR-0002JK-6M for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:58 -0400 Received: by mail-pj1-x1032.google.com with SMTP id d9-20020a17090ae289b0290172f971883bso9383767pjz.1 for ; Sat, 10 Jul 2021 08:31:56 -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=ZglPt3N3rss3fI4UqwR7t9q8pcVs9CWbKgZQEubMq5c=; b=VF2E9FFCb8GFoOsU8hlNnbmXVtj9nyJ7DzkhHu6VGfVpCwlc88g90F5cL7H9No09OG RKj/Gg5UiHnRTkG0UH1Yo2bb/eat1RPt6+u7VB7CJzdCzcYWTV3l4pywx9anzxkA6qbj cqUisAWWmQZT8Sz+NWfnLv/PYBxS+04r+bVdmuWchJYwyZwW4Aq16ptJJ+6X0gGvsDAi kLhJ97p/3faxi79Q9S8uT1R9Wmr6v9Km/tL0YuGP0QeBy6nmblRA8F6dIuPKqJTA+Nz4 NwyQ6LVnY+wZY0beDdQE/69kDiHCztmYCmwQopzV3A2sx9i8PCEmU9pCa4MeVy12m3j3 NWOA== 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=ZglPt3N3rss3fI4UqwR7t9q8pcVs9CWbKgZQEubMq5c=; b=QuT9VgxUMueA5TSC3aJEUXi0h21WlV8EldFXRZDtoG5yE5T3czWXT0KkYKS9O0N9d0 wS3n6V9R9ekIZKqRSup1Zpxyhvcrmayl9Bf3ICmu5qxgeALVggj9dcysVKldg/C1Sq4i a+vxp4c+lmGp1p7rtni16tHFUzbQn9wrNRE12ICKziP+RxdmNdT7MxNqTHq/ZNb4pvFh +7XrfNp13ad3uKQNye2+67sXd34Lw5rFgP0JZ+l+Cq76rmHnJeNZ49bkwmXLty255xam bQjxigAtQq2LqUOSdxiDCJL89PZDx63vpoCCUY7ew2NOa9MfM3ezC3mE/WL9JmAona7R 0yGA== X-Gm-Message-State: AOAM530FZgfAwGWEMM+m0vDqDWpVpaDs2uw3Y7YLVWO1bq5DSH8ArgVN k/gGPHkouBbTSaT3IuUCbANLI8Z1IpeKZA== X-Google-Smtp-Source: ABdhPJxz05CsnotTBnWWrYdjqaRKZR1PK50AZxVnVWAWt/bmwGkVtqs6aLri85kxPSA3N+t567RfUQ== X-Received: by 2002:a17:90a:bd06:: with SMTP id y6mr44234358pjr.6.1625931115853; Sat, 10 Jul 2021 08:31:55 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 16/41] target/hppa: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:18 -0700 Message-Id: <20210710153143.1320521-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/hppa/translate.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 424ec3252e..835120c038 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -816,10 +816,7 @@ static bool gen_illegal(DisasContext *ctx) static bool use_goto_tb(DisasContext *ctx, target_ureg dest) { - /* Suppress goto_tb for page crossing, IO, or single-steping. */ - return !(((ctx->base.pc_first ^ dest) & TARGET_PAGE_MASK) - || (tb_cflags(ctx->base.tb) & CF_LAST_IO) - || ctx->base.singlestep_enabled); + return translator_use_goto_tb(&ctx->base, dest); } /* If the next insn is to be nullified, and it's on the same page, From patchwork Sat Jul 10 15:31:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368749 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15C65C07E9C for ; Sat, 10 Jul 2021 15:44:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB9B361208 for ; Sat, 10 Jul 2021 15:44:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB9B361208 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F9t-0007kM-Sx for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:44:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExT-0005Qd-5i for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:59 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:55989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExR-0002JR-MS for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:31:58 -0400 Received: by mail-pj1-x1033.google.com with SMTP id l11so7418876pji.5 for ; Sat, 10 Jul 2021 08:31:57 -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=wgZhcSy8wA9T7RvUf4moyrqBuAXS045DsDPF940MlKs=; b=UgyQSEEdU8Gle9tNrK/5kZJSrK28Hb7itWhRwryEUlQVoRakQp4xnZ6fYsTFMnlyC/ NdKI4yn04RoNHefaLdT2+awNFIvcPTM89IGIwMUtZO7Exto6IJR/cIM8pG/17z56xYCI 1FnIcpIe5wDd7/Cv6ZupUYuTq+EyMlCa6sZYzZQLoa4Q+Dy6EzkCeInRNc2mmvAUsWN1 giJiTRBgbCN4hd0L2N6Ol+8p0FiFJu884PrTDZXvR7VpsiW68GV3EQBFYitesoKNDVd2 LW2nRpmzkVxIDU6TqSDqUa4liwM3OVs+nhpq4wfLrNDGvwNYBmKKOhUw7kZX8IglaVY/ e/UQ== 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=wgZhcSy8wA9T7RvUf4moyrqBuAXS045DsDPF940MlKs=; b=O2gB7bU6mYHvsm3q0ZCsWFWIxH0JLclQnu8jwlB9vMZO0upW+eRaNPRdE0dHJEMpKJ 4wlqv8oWom9c1cUtk1U1vGi5akr6xY6KA6ClNPYKYX3Txic5+/dy4Z0GcBizS3NzpWRT vz1w/+6ztxIGTXpiZQKEJm54Sga/JC/KhE4T37m5/GXYjiQsicz7yZVYkrvRAqIvisIT XhOsf9Aq3v4djnlByd/3N40ykBHJbHpi9uwfVTA94l6FVKQQzdtYvy8eqhu6OBMegMid EBDwG1siKmrvTW5uCEel0s1alLVN1a0GeHcsm7laRfFfDaq7p7BXxzv+XEkhYmW8l3lE q0Kg== X-Gm-Message-State: AOAM531TM1T9S3UQHZB5lggFDWtKoW/i1zVthCnytrzQ8L0LzJBAVTRR +bQcHC6TuH6Xe2JWpQ1vJunlJ0Fbck1qvA== X-Google-Smtp-Source: ABdhPJzMHryPDmrKtS+zPAH9yW6cG8yZAjhAWilC43NPvfYzku+Bo/RwDwBxmyyCG3S4GbRJst4bAw== X-Received: by 2002:a17:902:dad0:b029:129:c3fa:715 with SMTP id q16-20020a170902dad0b0290129c3fa0715mr17568018plx.45.1625931116388; Sat, 10 Jul 2021 08:31:56 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 17/41] target/i386: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:19 -0700 Message-Id: <20210710153143.1320521-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just use translator_use_goto_tb directly at the one call site, rather than maintaining a local wrapper. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 85b00a6945..37a66b4097 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2313,21 +2313,11 @@ static inline int insn_const_size(MemOp ot) } } -static inline bool use_goto_tb(DisasContext *s, target_ulong pc) -{ -#ifndef CONFIG_USER_ONLY - return (pc & TARGET_PAGE_MASK) == (s->base.tb->pc & TARGET_PAGE_MASK) || - (pc & TARGET_PAGE_MASK) == (s->pc_start & TARGET_PAGE_MASK); -#else - return true; -#endif -} - -static inline void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip) +static void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip) { target_ulong pc = s->cs_base + eip; - if (use_goto_tb(s, pc)) { + if (translator_use_goto_tb(&s->base, pc)) { /* jump to same page: we can use a direct jump */ tcg_gen_goto_tb(tb_num); gen_jmp_im(s, eip); From patchwork Sat Jul 10 15:31:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B980AC07E95 for ; Sat, 10 Jul 2021 15:47:00 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 80AA061208 for ; Sat, 10 Jul 2021 15:47:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80AA061208 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FBx-00042C-6H for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:46:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExU-0005UY-DL for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:00 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:36501) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExS-0002KG-PH for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:00 -0400 Received: by mail-pf1-x436.google.com with SMTP id 21so11703617pfp.3 for ; Sat, 10 Jul 2021 08:31:58 -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=sdOgSd63WVU1p/GLMq6rl3ZMILt/ihpRB26uHAUfMXo=; b=qSSz5CLaMfP2Vu0D8doc5pjj540IkJ9engKjlilM28uz0d9g4KxBe79Wh9EKOxCRTS 1SJ4gXW88v4kodPKhlDJWA0lzFI4Y9xtmUYCemLXitz+Afe3mEDq4V2ESmniRA1Jr/3r RvuBezlYn3FPcbB49Zkg5J5MvXZyxXIlCtgd5KVV4qFKAWcCdjGaqGuaiGzcubPK5iFp Kh8Uv0X1J6QzhNa5lJrejwS+jsfgga8S1ouTmo57uqThBOeFpMKcD32AwsyW+TXdPc5e Tu4ru3s0q7j9lTbtVKncz6G+Qs37Rvqgtou/8u9iMVnsZD9jMAEYynfm7Taza+BeZpzb 1+Cg== 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=sdOgSd63WVU1p/GLMq6rl3ZMILt/ihpRB26uHAUfMXo=; b=Z/xb22IXdVcvvErgY+ZfHiFexvvaF+Iv913rC/EXN6aIRs/a+Jh7v5/bBTb7evFTH4 N8spO9PwhHrWyPUnS9DXIZcIYZV2Tmk1RTwEAkgV8l9kjLs3RxXeddFRcqWTOxx2NdEx K6AzLgQPmA9peGfmFCYVzykfDFnohG0K5IjsMRtz0FETpZkSezqM8oIXqXimr16vE831 pdjefZicPvZxL6p01ydo2RfbeKjZHyeOkaM04+4FTDBvQpebdOYgqnKFOl+76WgYTCzc 2bmRfPS7vRyhmq8ZFLxc62Q9iamuAPiQlM/yZa9+IM8qPn8RFdqwQCWJ1eowv6pIQQsy +zOg== X-Gm-Message-State: AOAM530V6u5bzuvfo3AL535kHF2tTabLDx+5Afc5J9YOyvxoiDq8gUsR muWsqzL20nz2pXzHWvu1N6jWNnZv5FF3tw== X-Google-Smtp-Source: ABdhPJzBQdooxVIFD4NRQrgVrYhrXZUieRyQCnSIhO2wyLpzvwSZwjHG0p692yd3FdxBycEJ14AUOQ== X-Received: by 2002:a63:5802:: with SMTP id m2mr29842992pgb.171.1625931117514; Sat, 10 Jul 2021 08:31:57 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 18/41] target/m68k: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:20 -0700 Message-Id: <20210710153143.1320521-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Laurent Vivier Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just use translator_use_goto_tb directly at the one call site, rather than maintaining a local wrapper. Acked-by: Laurent Vivier Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/m68k/translate.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 348fc6e844..1fee04b8dd 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -1519,16 +1519,6 @@ static void gen_exit_tb(DisasContext *s) } \ } while (0) -static inline bool use_goto_tb(DisasContext *s, uint32_t dest) -{ -#ifndef CONFIG_USER_ONLY - return (s->base.pc_first & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) - || (s->base.pc_next & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif -} - /* Generate a jump to an immediate address. */ static void gen_jmp_tb(DisasContext *s, int n, uint32_t dest) { @@ -1536,7 +1526,7 @@ static void gen_jmp_tb(DisasContext *s, int n, uint32_t dest) update_cc_op(s); tcg_gen_movi_i32(QREG_PC, dest); gen_singlestep_exception(s); - } else if (use_goto_tb(s, dest)) { + } else if (translator_use_goto_tb(&s->base, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_i32(QREG_PC, dest); tcg_gen_exit_tb(s->base.tb, n); From patchwork Sat Jul 10 15:31:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24BDDC07E95 for ; Sat, 10 Jul 2021 15:44:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8AA061208 for ; Sat, 10 Jul 2021 15:44:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8AA061208 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F9s-0007iD-Ud for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:44:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExW-0005d3-FW for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:02 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:33528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExT-0002L0-EO for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:02 -0400 Received: by mail-pl1-x630.google.com with SMTP id d1so1426772plg.0 for ; Sat, 10 Jul 2021 08:31:59 -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=o9A9j6l/wX1G4+Ye4FYMb+DUZWuGQ1B3FFGlncSiSJM=; b=jVPkH4TM9bGxmXZGnooq9FIUvwkK6gD5WpJaufSouLTElI1T7g5DLCEcjId5ASsI2o UvZC5Pe/tcXf53nz8e/70eDeGbWJstnBLnrWkJ2WtOSYGz9KNLtYZO+NjTSdGlJWN1WA IjQcj9wbY5ud7BFpoaZELzgnHraOBDbvcpyEWYvgbeFcCXQJDiXpito2b/2DPMRRbXoI PgeBbVL4y6C5iIz/c+Q26Vs/iuHC1webs9qmmjRmiT7zlIlC4cK+v/43nza7B7ZRyvk4 6aI8L9LY9kTyoZN+36Ly4agJqbgevUNI2zxp8MsFXCr5csBcksPqy31Kgs3nbbv2Gm6Z 0ROA== 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=o9A9j6l/wX1G4+Ye4FYMb+DUZWuGQ1B3FFGlncSiSJM=; b=by34XcLKoG+zpVMU+qQ8OUkyAZ6CKx2twAqpgwVN0j7shEecq6mwzHIW463pdAA6fu 5TneJeXaiBfunrJ6LOOE/AWLnXjbpYQHByJ63tst21OvCpv0o72dVmkJPcWSOd05UNPO uGRzrY4lt/OSMN096KJLEN+g4+0pvJrnooMi8rC7Zc8TO3jS3GmOpEQHiHXYZ+K/sGd6 skjpSzMl686qO7g+MgZnDouBHImsCcOZbEBAG/sUhRXjsm3/X3Fu0Nn45MOeKLJFzA6K suszPsoWkYObVHfqMcRg+hKKUvPIxtnDbnGi8LVrbsybJZAOzAI98U/wvE8mZYTuJxDw tr1g== X-Gm-Message-State: AOAM5328Dq9zrJlW3ktnSyJ56fRVGoZrWmEzhEd/CtRkm2D8/OrukU4n p1OXJMQflmTAhisbp5h3dQZEEtJOVp+GSA== X-Google-Smtp-Source: ABdhPJz+/zPYz37mMdZ6YGqoE3p2LKiz0j5eauPhbdqRaI/+YxPmXd1dFrhuZWuvATlUUsly/LqWww== X-Received: by 2002:a17:902:9a8c:b029:113:d891:2eaf with SMTP id w12-20020a1709029a8cb0290113d8912eafmr35874381plp.61.1625931118030; Sat, 10 Jul 2021 08:31:58 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 19/41] target/microblaze: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:21 -0700 Message-Id: <20210710153143.1320521-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just use translator_use_goto_tb directly at the one call site, rather than maintaining a local wrapper. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 5dfb08d49f..c68a84a219 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -124,15 +124,6 @@ static void gen_raise_hw_excp(DisasContext *dc, uint32_t esr_ec) gen_raise_exception_sync(dc, EXCP_HW_EXCP); } -static inline bool use_goto_tb(DisasContext *dc, target_ulong dest) -{ -#ifndef CONFIG_USER_ONLY - return (dc->base.pc_first & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif -} - static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) { if (dc->base.singlestep_enabled) { @@ -140,7 +131,7 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) tcg_gen_movi_i32(cpu_pc, dest); gen_helper_raise_exception(cpu_env, tmp); tcg_temp_free_i32(tmp); - } else if (use_goto_tb(dc, dest)) { + } else if (translator_use_goto_tb(&dc->base, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_i32(cpu_pc, dest); tcg_gen_exit_tb(dc->base.tb, n); From patchwork Sat Jul 10 15:31:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26779C07E95 for ; Sat, 10 Jul 2021 15:46:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF655611CE for ; Sat, 10 Jul 2021 15:46:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF655611CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FBw-000401-0K for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:46:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExW-0005ex-Tf for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:02 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:46741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExU-0002Lo-3u for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:02 -0400 Received: by mail-pj1-x1032.google.com with SMTP id b5-20020a17090a9905b029016fc06f6c5bso7781831pjp.5 for ; Sat, 10 Jul 2021 08:31:59 -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=QtV1oQWQj2aiAo4khTYZosWNvQunNKSfTN6eXGpTJBs=; b=jWkaKA0sfixNsD3Tueey6DRh92hFfNjI34WGD0Sv6+M9S8RkqcKs58EMDX5L5lgzXT sQK5tLN/m/0HQF6uJttASsVOKzSkj0Km4lbqfZKt7AUB3n9PwMB4E8AK49BnfvfNYmfo PAjojWg4+FF/fu/iMAaTcCtYfLWGB06lft40z8RdmVNQCkkcNAVPkutRA9OSeYTMw8sh swJZOLtu8TGfMV6zLtALvCEnGvr746DS4aE1wN3S4ni/mPbpt8DsPU+JRDAlMP24Lu8f 6vdeyTC2b30eR8hKoxjpDAjaJjawhF0StfDeXCbjuj/hr5XZmo9dFMkx9WRqBPUUSRuo GDrQ== 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=QtV1oQWQj2aiAo4khTYZosWNvQunNKSfTN6eXGpTJBs=; b=Y/lrrPkU1560hXRXCEiQ+uIGMZBAtTZ1W1ZIUqoCt43ORCZVs83OqhWtLTWwHalTb3 sKS9eSbToYz7TmJh2vXwgLCoMSitRFKYYx1uthDZklsL0zJPyNLRuDMIpZyeKLpYgg0v EZhCAsSbyM2XwkHwXTpslS0MPIcjHZLgZ7aanx9RP/ow9WuSHzWmgAOoUSBENcTjY4Wx qp0NQenKdERPcvsDX1+mqOBDxng6DhrciC1RRYSGvrtntaSHjZ6PBtc77jx7Ek9EqqCv kE5qOBPaOtHId3RrkanXUQlT5Sizd9aYdwtzuKk1zX3Ndl4GM3ySp6y1PdD5hNpJfxXN sVBw== X-Gm-Message-State: AOAM530+tqZZj+tLrzwzHhhdf/rDfdUNHWsnU6zPWabxdOxJUA8XnZ3z Ck663Im4s0SUs0/fqwJh6QDi6bvEoVcR7g== X-Google-Smtp-Source: ABdhPJx0OIwevQ4a55CxsbuZ6iXd9IIw31ToqcfIgX3GzLie3OzHL7CpI3pZ6O+6Glrz2FcZyCBDlQ== X-Received: by 2002:a17:902:249:b029:12a:fb53:2035 with SMTP id 67-20020a1709020249b029012afb532035mr1151098plc.73.1625931118874; Sat, 10 Jul 2021 08:31:58 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 20/41] target/mips: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:22 -0700 Message-Id: <20210710153143.1320521-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just use translator_use_goto_tb directly at the one call site, rather than maintaining a local wrapper. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/mips/tcg/translate.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index cb82426f66..5cd3e7d8dd 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -4947,22 +4947,9 @@ static void gen_trap(DisasContext *ctx, uint32_t opc, tcg_temp_free(t1); } -static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest) +static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) { - if (unlikely(ctx->base.singlestep_enabled)) { - return false; - } - -#ifndef CONFIG_USER_ONLY - return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif -} - -static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) -{ - if (use_goto_tb(ctx, dest)) { + if (translator_use_goto_tb(&ctx->base, dest)) { tcg_gen_goto_tb(n); gen_save_pc(dest); tcg_gen_exit_tb(ctx->base.tb, n); From patchwork Sat Jul 10 15:31:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368737 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC834C07E9B for ; Sat, 10 Jul 2021 15:41:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CAFF611B0 for ; Sat, 10 Jul 2021 15:41:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CAFF611B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F73-0005bx-Ol for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:41:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExW-0005c3-7f for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:02 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:50787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExU-0002Lv-LP for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:01 -0400 Received: by mail-pj1-x1033.google.com with SMTP id cu14so2112164pjb.0 for ; Sat, 10 Jul 2021 08:32:00 -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=54L5C75jlygvay8zC4dzGDDxDxXFnKO0N5KrZ/57hyE=; b=hswm1tv4/Y7f8EZfsmIVmEIUGwHENz5qnUpvxRm82HuFygP9LOoeqprp2LUYTDndQ6 BbAu3WyQxWo570iHjKu5JX3sipYHrEPlIFu7kIe8nBlXfEm0GI70qwxBAZGOrsHbqx+N w847x/iDPQRVp8ekNE/v7ovotBxqjsfhrN/9LpxTp1Ul08RiDN/MdKPLfmmuA/st1po9 fHWRJh4F9EIcT4Y2FSLJqitaO/FvZH+q07oHnWiv2oCWwLzSyx7iEmiAmHNBlQNyrS3T 4mRjz4xyh5hJrXlb7L0jcXlkaGx3yaKdawf6V5LVW3aYoUT6VqW5J2mwESUvhadDEgXX Hg8w== 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=54L5C75jlygvay8zC4dzGDDxDxXFnKO0N5KrZ/57hyE=; b=JPY9w+Ll9BtQfuG4WiM2Syz9noguLT5bhMUal87wpj0LLzoKLPZcn9bd37Luxudbxy lciXpAjr6et9YhwlkKfFne2BgHywZF7ePiVg9lkardZGIwAaM8wVI5I3OoqXg9ifPyCL TD9teQs3Td8wx8wNw/CbTzOh3g0wEbbH8ys0Azy6ftyNu08o9HICOrIlpKjxWBuz9NzY NX6kM/O+30hE2pPkAz/YBnp4MYa0s4MsfOVXI4pcUmBWlrYzqXP5x2KQ3v0RoMDfeTly GjFGVMeGhaueES0+1xvQIzP+IQh4gVa0OKp/aaZ+R3oIF6lpBfCP+xYiqHOlz0W5DOye AdOw== X-Gm-Message-State: AOAM531w7PJWtIuaplbHKY38P0d3XHf+O0WaiRdHxxxAYLH2Cpl61Evs D1I+rJMHAqbqMLw0HIgnZ8iU9ni0wrMTWg== X-Google-Smtp-Source: ABdhPJyYDp2jpvXES0B9jjJcQf7IhGIwP9pKLQZn/j5l0oCsOzrE/KgeIP8ND9jHQ2927n1KTOje0w== X-Received: by 2002:a17:90a:4417:: with SMTP id s23mr4776204pjg.228.1625931119462; Sat, 10 Jul 2021 08:31:59 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 21/41] target/mips: Fix missing else in gen_goto_tb Date: Sat, 10 Jul 2021 08:31:23 -0700 Message-Id: <20210710153143.1320521-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Do not emit dead code for the singlestep_enabled case, after having exited the TB with a debug exception. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/mips/tcg/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 5cd3e7d8dd..47c967acbf 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -4958,8 +4958,9 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) if (ctx->base.singlestep_enabled) { save_cpu_state(ctx, 0); gen_helper_raise_exception_debug(cpu_env); + } else { + tcg_gen_lookup_and_goto_ptr(); } - tcg_gen_lookup_and_goto_ptr(); } } From patchwork Sat Jul 10 15:31:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 605D4C07E95 for ; Sat, 10 Jul 2021 15:48:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1DCBD611CE for ; Sat, 10 Jul 2021 15:48:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DCBD611CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FDs-0008Qq-Ai for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:48:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExX-0005hc-LL for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:03 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:46902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExV-0002M3-Ah for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:03 -0400 Received: by mail-pl1-x629.google.com with SMTP id c15so6622166pls.13 for ; Sat, 10 Jul 2021 08:32:00 -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=ecRVVJ3PnvHarcdzmtFHD+/SxpG+hJSwypTpiV6o5c4=; b=z0w78xErV9Q5ye6dE/JYPJiEaGxka+dq2yUQJT6vX0Xrt9b7+zn9mArFpQZQXID4vq oxlE4fz3ZvbRzPNWCJjDtd+NeiewumKKTHQUF2wDBYFnvUfDdKByZvD+KaM4YlK+kZ39 Eoz1+T8Mhqr614JGrYt61tSXhvADyIUxoc++BpVOsuIApmPqANd0VgyD+ZknKjtHgnb9 bPYk8BoXdgz3UEnyUAewGS9WHmTHplnHsdaJjvgso8K/YugGI9aUEzQ7c2C8huzhGiui W5QYJ7NrLRRVB1JGKv8j641SQOiPmCBOYPfUra6MiCDBJdt9GqnoLiuZbdnvFxA7TMIJ f9zw== 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=ecRVVJ3PnvHarcdzmtFHD+/SxpG+hJSwypTpiV6o5c4=; b=XPr5Ds3APvH8ejQyB6fpwAi228foLwI5nJ9xP02VYqRM3uz1hmXtOO4TWJPQvtdjOO 0cxp36e5t2BSsMVSi2a7/38ZkNQ8AgM9hwp5C00RchkKevIy/tu8z/bx3H61J3gxXneV ogwlTaR2Bv4dDmT2UFp4cYM2YXTCpTY/C9wInTvnCTLUpFlBA48wZj4/svEx1tNkOFLH +qGTuN7uudWBRZTbw3u9YQVxygO32lzewkVj+LKkQLkkIb+AwjKrL80SsmzFWtGMNbxa OHW45ZcSReLz8f1OMe8drSKb0zCApR+7eKXoP6T1GzOABE20toaAQ25nS/xNASoDYJNg +26g== X-Gm-Message-State: AOAM533hjLXydmal65ibAD9+TJ+RJaCi64uxKOHbWtzUlfvsqOG6BmZ5 Ppz6Qyv5dp0gPT4sUAXVOe985NFNDfwwIw== X-Google-Smtp-Source: ABdhPJwUbdvzEU4yI5eKHwsTqVqSORyLijJtYpOD6Pxdqf/CmcP/QmZPWLjPUcDb3LHcmXCVKsswWA== X-Received: by 2002:a17:902:ff13:b029:129:9a0b:c2dc with SMTP id f19-20020a170902ff13b02901299a0bc2dcmr24846099plj.45.1625931120100; Sat, 10 Jul 2021 08:32:00 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:31:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 22/41] target/nios2: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:24 -0700 Message-Id: <20210710153143.1320521-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just use translator_use_goto_tb directly at the one call site, rather than maintaining a local wrapper. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/translate.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/target/nios2/translate.c b/target/nios2/translate.c index 930f3d3395..17742cebc7 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -150,24 +150,11 @@ static void t_gen_helper_raise_exception(DisasContext *dc, dc->base.is_jmp = DISAS_NORETURN; } -static bool use_goto_tb(DisasContext *dc, uint32_t dest) -{ - if (unlikely(dc->base.singlestep_enabled)) { - return false; - } - -#ifndef CONFIG_USER_ONLY - return (dc->base.pc_first & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif -} - static void gen_goto_tb(DisasContext *dc, int n, uint32_t dest) { const TranslationBlock *tb = dc->base.tb; - if (use_goto_tb(dc, dest)) { + if (translator_use_goto_tb(&dc->base, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_tl(cpu_R[R_PC], dest); tcg_gen_exit_tb(tb, n); From patchwork Sat Jul 10 15:31:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6767C07E9C for ; Sat, 10 Jul 2021 15:50:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 457E761209 for ; Sat, 10 Jul 2021 15:50:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 457E761209 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FEv-0002rJ-Ad for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:50:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExY-0005j5-2N for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:04 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:55194) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExW-0002MT-95 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:03 -0400 Received: by mail-pj1-x1030.google.com with SMTP id g24so7415750pji.4 for ; Sat, 10 Jul 2021 08:32:01 -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=z0rbZYpLmN7OBA+o9g3ziAIPPJLFXElqgMaQw5pyuig=; b=AihVAPyrF8jDHZkbysV1bD4yuSHfwpcIOLJc1i3mJt8xoKLGJ7z2VeneNQlpbigOjL BwZLhzrZ/k0CjdYGYu/dCAhxGke9EAlc0ARhFh2LL4sFTVgocrY8UiJuWHZnmSPcXaT3 u19yX5ngeKvxjoBbIaQld1TDtZjV+cW9ZEr/1ulyo3+jHTEbCYmz8eF3Iyqylq831I05 Ae9cmGL0gdDZ17v8NSrRNSrRYlXZ/xZhWkuA2+QfEVrAyYcZ9SXJbg36usNDoLlJUL3J W6u1NUkGLMv9aIfov3mjtr2OfV8RTmjLcVuYVhEnZ9LQgQhBacC3UN2Rq1ADuUQyCJ4J 5oMQ== 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=z0rbZYpLmN7OBA+o9g3ziAIPPJLFXElqgMaQw5pyuig=; b=WWBfP4N21ot9Qwo5F/rHMLNEPpOeMmZ2xgByveo20v/RqscCNu6iW+wM9RGgRe9gCQ DQMdFN9ITBgsEiEdw+Y8rQDTlu6j0sebpr4BhwdefeXuN7HWkh2PkoRNtzl+YUZV48VL 4g7jpFRbLraYptqZL0f1HJvZFMXgqUMrvpSUR4Mqe/Rz0+dv7/xcfvDXwRSWRIchPOfb ycU3rp/1sf325EbKBCca30j2V82VEA752dj/Z+JFsdNCKqXzo3BZCnb74G9mCba7pBeM bxR98Jf7U4vlE6iGAyxezWeeqOuFSfhz4Bft15N959IRJqVvPvTJNIwknYNlfEXAbdIg avyA== X-Gm-Message-State: AOAM531u3SstK20+sBc+ape/QfZ76sIEn8tV4OnLM17UWvQuxoLVjFt6 QGv07ud6iQt1MzsBVPzhuKctSQLrue4n1g== X-Google-Smtp-Source: ABdhPJzDn+9rgmRu8xwbMjhPl39cBikrKH3CEGpsnMikPp6cWp79JnF/jJhPMDavatfLJgVu7sVcug== X-Received: by 2002:a17:902:f682:b029:128:e54c:f58a with SMTP id l2-20020a170902f682b0290128e54cf58amr35873297plg.13.1625931120956; Sat, 10 Jul 2021 08:32:00 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 23/41] target/openrisc: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:25 -0700 Message-Id: <20210710153143.1320521-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stafford Horne Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reorder the control statements to allow using the page boundary check from translator_use_goto_tb(). Reviewed-by: Stafford Horne Signed-off-by: Richard Henderson --- target/openrisc/translate.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 5db63d7609..37c3e3e0a3 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -1719,16 +1719,17 @@ static void openrisc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) /* fallthru */ case DISAS_TOO_MANY: - if (unlikely(dc->base.singlestep_enabled)) { - tcg_gen_movi_tl(cpu_pc, jmp_dest); - gen_exception(dc, EXCP_DEBUG); - } else if ((dc->base.pc_first ^ jmp_dest) & TARGET_PAGE_MASK) { - tcg_gen_movi_tl(cpu_pc, jmp_dest); - tcg_gen_lookup_and_goto_ptr(); - } else { + if (translator_use_goto_tb(&dc->base, jmp_dest)) { tcg_gen_goto_tb(0); tcg_gen_movi_tl(cpu_pc, jmp_dest); tcg_gen_exit_tb(dc->base.tb, 0); + break; + } + tcg_gen_movi_tl(cpu_pc, jmp_dest); + if (unlikely(dc->base.singlestep_enabled)) { + gen_exception(dc, EXCP_DEBUG); + } else { + tcg_gen_lookup_and_goto_ptr(); } break; From patchwork Sat Jul 10 15:31:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6840C07E9C for ; Sat, 10 Jul 2021 15:48:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8113061209 for ; Sat, 10 Jul 2021 15:48:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8113061209 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FDs-0008TH-Nc for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:48:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExY-0005k0-9L for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:04 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:45608) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExW-0002NP-QV for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:03 -0400 Received: by mail-pl1-x62f.google.com with SMTP id p17so6110008plf.12 for ; Sat, 10 Jul 2021 08:32:02 -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=4qenbk3bz7QNKjCkCTPORT5jxhyyeVTLVG8BsPWvMRw=; b=hVZllncHPTcFQVtMLmh0BqjVoqPTxIg/jC89WTQzH0JNgRr8We6d+Orz/aJzNXUqsl iNgYH/3/rHUvmrKuh5d6KbxYq/AeCLtrHx/HifBTKzxVVgqqJXH57c7e2Sn+A2FC9c+/ oeMFHCZj7GaiI4jVJVXmNT4+7Ezl6JAyG3QaugvfKyxSGTKH2U2wdqRTEqjXI8QyiOtF lbBgkTPYnGGGetTwASS3+jgm3EhsMAjo7xvcbe/R/v5rR1UUVDRX5iChqd/sNAAvRU5l VRBE32zWeoIPJtVpf8kRLKHfmOUG7QpM/jQFs95fI1TFQ2S8hF1qrBqtn1wlhe2jTM30 JQJA== 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=4qenbk3bz7QNKjCkCTPORT5jxhyyeVTLVG8BsPWvMRw=; b=GL9rUSQXj1s9NcC3ee7gr4z1kQKOxkRP9ilJnd7GIAv28nSfeHrcH+9w9pLXNT03ys qFn2bXHIiWXF0FCoS9YAuHweAovdeTpzbNi1PRGJSQjz+w0mbd/Zf1apWqbTZgxDGM93 XaHbW0YHqStFHWSKRtC+qiJwj/ubSDjVHglavUlcQYEHayzCK1Kh76ljzMIbQRiQZbdx MQbCYGBESStXWtnV2JXIPgJGSJuccm8d0JkvmRPtrOmm81m3wmm6yD622hEj1jrJoGap /LFBNUQAVBQzywsUgTpPC2HvIwWNKD1aiOGntiRG6NchW3yIYWpdjFTZ+Kwrcarmq52M tjBA== X-Gm-Message-State: AOAM530ENpnMm7e+aLQV7nF+g5xIZ095vexqZvqt9eH+cDnuvRDOW63S TT43LnD1NfaxJnP8GjnbsoF3WNl720Ip3g== X-Google-Smtp-Source: ABdhPJzpDuQiP+hC5Mt40ggIu7LGOkFwux8XQd7UPJn6a8kHuw8MQ5GC035PrcpG/wzsSkd3ttC1yg== X-Received: by 2002:a17:90b:338d:: with SMTP id ke13mr1248954pjb.151.1625931121524; Sat, 10 Jul 2021 08:32:01 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 24/41] target/ppc: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:26 -0700 Message-Id: <20210710153143.1320521-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Luis Pires Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Luis Pires Signed-off-by: Richard Henderson --- target/ppc/translate.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 07d79acc08..0ad601793c 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -4301,15 +4301,7 @@ static inline void gen_update_cfar(DisasContext *ctx, target_ulong nip) static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest) { - if (unlikely(ctx->singlestep_enabled)) { - return false; - } - -#ifndef CONFIG_USER_ONLY - return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif + return translator_use_goto_tb(&ctx->base, dest); } static void gen_lookup_and_goto_ptr(DisasContext *ctx) From patchwork Sat Jul 10 15:31:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86DFAC07E9C for ; Sat, 10 Jul 2021 15:51:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4456B61209 for ; Sat, 10 Jul 2021 15:51:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4456B61209 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:56232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FGZ-0005mN-Fo for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:51:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ExZ-0005oR-Gj for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:05 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:35332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExX-0002Ov-AR for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:05 -0400 Received: by mail-pj1-x102f.google.com with SMTP id h1-20020a17090a3d01b0290172d33bb8bcso10004763pjc.0 for ; Sat, 10 Jul 2021 08:32:02 -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=Q7Ia+ie6XOcjpcC/dD6Ub5PbrcGQ/yV9nqv+RZL1T9E=; b=w+2mOkg2SmviNZKs9u9VvgjoT4TxhsBVmJdsDZjFvLFJ1eZ/s8c4o+wLzcb8SMxeI4 usdEWLWja4zmNtVcfCQeVo1huZftEEUbdu6hLbCPVUhE+Py9dVCIvRGNnwGehXu72A6S KrFvUiRkDI5XDE0lV4VqNGqtSoOaiPt0jIkCJzf93INSnAgN4nf0w7a7u+9CR11fUip9 pgF/2212EPbxTzirMdH5IjIwE9XkaxM9C6Mf6AVMZGFgmEKW5NTeBngup4k4/t+9Jk0G ZCLTJZ4UKQamw1ZppUEavo1KQNVGpUlV+picMgKNST93KEFHgNQwPDsnOouD327XGGOH 74CA== 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=Q7Ia+ie6XOcjpcC/dD6Ub5PbrcGQ/yV9nqv+RZL1T9E=; b=SKrUhX9KxLfTfCTF5aa8ZYkuThGsIv9TmPlT9sscrVI7SPHLHjtCskmCQhy5GRr8YY WUuhehNbF+QS6YhLkxkGsPZJRlmOw+dpOlBajCGa6qOp03zpKF+UYjz01Vxo1JSXOPHH 3YCxj730ohRksAVczoLMeMPvSumH+4h3AMj2XibBDjS8PCEPt5LqnfvZ8jZVycnvndt0 PMO5vDmEg89+OCem/uFlsmpAbRhUY4rdwh2zbg0CA57rXXX+xzrZmmz2CVPQT2JfPhWh DDHzi3He1QE/+1PPt7TJ3cDU35NKx5UDpkSI7ekl2o9hGxM9KRgm/dszoCQhqN1Gs/R6 J6AA== X-Gm-Message-State: AOAM530MqspmUSP6d55qazVniLNokaT1Wj9VdDrPrCm0qujgnIsq1rKx oE/Q2cJE6GKxlRrkrizFHx/Q2dvqLlD4WA== X-Google-Smtp-Source: ABdhPJzr32ipZLNgldMbAYO4y1/r5CVw220c1UybtosgjnPFw/QD3DkwSBKxrBrdp+qwnWhsgB54+Q== X-Received: by 2002:a17:902:7108:b029:129:5858:b388 with SMTP id a8-20020a1709027108b02901295858b388mr35885155pll.37.1625931122117; Sat, 10 Jul 2021 08:32:02 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 25/41] target/riscv: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:27 -0700 Message-Id: <20210710153143.1320521-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just use translator_use_goto_tb directly at the one call site, rather than maintaining a local wrapper. Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/translate.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 62a7d7e4c7..deda0c8a44 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -168,29 +168,11 @@ static void gen_exception_inst_addr_mis(DisasContext *ctx) generate_exception_mtval(ctx, RISCV_EXCP_INST_ADDR_MIS); } -static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest) -{ - if (unlikely(ctx->base.singlestep_enabled)) { - return false; - } - -#ifndef CONFIG_USER_ONLY - return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif -} - static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) { - if (use_goto_tb(ctx, dest)) { - /* chaining is only allowed when the jump is to the same page */ + if (translator_use_goto_tb(&ctx->base, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_tl(cpu_pc, dest); - - /* No need to check for single stepping here as use_goto_tb() will - * return false in case of single stepping. - */ tcg_gen_exit_tb(ctx->base.tb, n); } else { tcg_gen_movi_tl(cpu_pc, dest); From patchwork Sat Jul 10 15:31:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368745 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20033C11F66 for ; Sat, 10 Jul 2021 15:43:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFED7611B0 for ; Sat, 10 Jul 2021 15:43:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFED7611B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F8e-0002od-VI for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:43:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exc-0005xx-BX for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:08 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:38691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExX-0002PD-Tk for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:08 -0400 Received: by mail-pj1-x1035.google.com with SMTP id cs1-20020a17090af501b0290170856e1a8aso9984624pjb.3 for ; Sat, 10 Jul 2021 08:32:03 -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=id9iV5umHb8tt/5JMvNxOccVr78sQJff/CPKYNI34Tc=; b=bi7m9PNM99JbckhsrUjSlcBVs2JxEzUOsFsPyzVjAPfBHvgaDwGYvw6roMUnuDpoYF BP6BmUaja6qe6thVDSuV51DShXIdEB9wc8kh6r6AuEnZqJmwLMy8hcZpLZcR93hiXdM5 yC+esm/U45TUJsnZKUEy/kWRqmsdrlubp0bf9M++LBvaiREXDTuHX7Vr5Ny8EoKtu7Jw HhUlnOFRJ4HeO4altHUGriEOBiPuHJXgxx0veQcvt3qEBw0b+fWMkgy8UEw2l7eOrZGf mE34+LrrTER3gsupehpDerUyPJmOg8wFyqBi4lAJA5KksekG8OlSFQZuaDXHab/DSX+r PBNw== 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=id9iV5umHb8tt/5JMvNxOccVr78sQJff/CPKYNI34Tc=; b=dPbyNMmvroI5mTHgjcpN1vNDZ8/gOYGCPaOhszOFWWM9RXCJ5+iK7A6PD54Jn0Rv1S HzMjOXHd45kFo3tanf7sb3M+MK1RH+/TZXHYYOIzC9M4U907QgJDe3/N892epG/fdv0d 2ngxKky+/FmtkJNdqeaPcB2xeIGuCZg1INHCEsK9Nz7Rq+IHeNvorrvjew0iprqkHeWj QMRtPekpjyYjH+NctszmYRhuXWonQrvB9zM8c9GdjYiIW4fn4PFQCEeKM3ywFcpBacUx 0X23CpofQfBUlFrGFsDQF62PaR6OIQ0tZvloNCAuahTeIsNoPIN7FGk0MopquOqkwJQJ 4VAg== X-Gm-Message-State: AOAM532t4H/7vFUzRDwiy3/lcwRtk02euR8OWChs0ot2tSImD28J0BZ8 oDjdc5tRQ63KcH9SmZc8bPl958ftNNSypg== X-Google-Smtp-Source: ABdhPJxgx7v0X8UOCdxqNwQzaYS/HmqN32u6WkrRocXkTlwocTGzqOA3Xf86ueaBMG1ToB4HM/i61g== X-Received: by 2002:a17:90b:4b52:: with SMTP id mi18mr27055678pjb.37.1625931122735; Sat, 10 Jul 2021 08:32:02 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 26/41] target/rx: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:28 -0700 Message-Id: <20210710153143.1320521-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just use translator_use_goto_tb directly at the one call site, rather than maintaining a local wrapper. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/rx/translate.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index 22a15ee11d..23a626438a 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -142,18 +142,9 @@ void rx_cpu_dump_state(CPUState *cs, FILE *f, int flags) } } -static bool use_goto_tb(DisasContext *dc, target_ulong dest) -{ - if (unlikely(dc->base.singlestep_enabled)) { - return false; - } else { - return true; - } -} - static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) { - if (use_goto_tb(dc, dest)) { + if (translator_use_goto_tb(&dc->base, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_i32(cpu_pc, dest); tcg_gen_exit_tb(dc->base.tb, n); From patchwork Sat Jul 10 15:31:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 683CEC07E95 for ; Sat, 10 Jul 2021 15:35:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2989F61154 for ; Sat, 10 Jul 2021 15:35:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2989F61154 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F0s-0007gN-8N for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:35:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exa-0005rL-Bn for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:06 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:39902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExY-0002PM-IY for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:05 -0400 Received: by mail-pl1-x635.google.com with SMTP id h1so6636704plf.6 for ; Sat, 10 Jul 2021 08:32:04 -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=cuDFz+AjESRkTBOBfcUaJCGcjz05pqAAlTOVb+wGFjY=; b=nbPj/Xvd3873WIvua2AwG2rjUl9nVsruIeixf2yQiGkXjaqwHRP8nwclkB5VrZHdsv OjXcaAjZbDZBGfKCE2DhSLLrAijzPoaiULsFCOmczRmtX6ciPXgiLCl7r4PVsEJ/bb8D WvjeJgLY4Twafl7M0MTIYaVffevIZNSnT5Emxv8PsgLrsPxehzCNDzsaf9WqtkHl5G2s kBpBar2DKkNkAAj/kvki13WIW/XztXuBf9kWz31pyKlTRP4vCNR/AqVmcgUBqrzVwA7l jVz48arq7MQhmzuLN65UvmX38aDtT3djhsN8hMMHd34cMfIADDa0jhSBlZkj+ez8pt3n NBAw== 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=cuDFz+AjESRkTBOBfcUaJCGcjz05pqAAlTOVb+wGFjY=; b=AUD+eNbf6gI6VP73xsOFkZoBE1aU+XnPRV23JDWx8iX0hvM73zZIacxSW9/vHe0Wrh uI2RsoTmII7V4XbImk7o509BmajlsMytwgxUeOX3a5/tHAFjERDGBxM89WacmehDZ89d Qhjoim59FHZvbjHRVIYssXg2rGTJ4JIHdVdJte+rWS9u6ctNOyAtg6JIT5lclxye+UDi 8F6mBFE1H+0SJvbJ1rgDsrxdKWesDcBagnbWDP1vPPZyNsSkZJFrZk9YBUfvmJnIkfQC xTwNLS0hOx2dvWADAAHp3SEgEvC9rr11Lm94ixPc62UqOuhfynhJ/yENcIko6tCfRLB4 FErQ== X-Gm-Message-State: AOAM532smbJpjwqZ7BZnYxYy4MwHPvIvDDnHNupJXh9h4O0GJiVkoRuN GtfqkGqqgWYGu+BlXy4ssBnVS5wH6+0nXQ== X-Google-Smtp-Source: ABdhPJxkGbDPjBM5hnnODhPywTzVwVr10/i2l8Pu4lovkJTmbm6PdqEkwn1O5kmX/R9viBSUQWttBQ== X-Received: by 2002:a17:90a:6a43:: with SMTP id d3mr4944161pjm.15.1625931123370; Sat, 10 Jul 2021 08:32:03 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 27/41] target/s390x: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:29 -0700 Message-Id: <20210710153143.1320521-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Hildenbrand Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/translate.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 5af68e01c6..767e77ca19 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -696,12 +696,7 @@ static bool use_goto_tb(DisasContext *s, uint64_t dest) if (unlikely(use_exit_tb(s))) { return false; } -#ifndef CONFIG_USER_ONLY - return (dest & TARGET_PAGE_MASK) == (s->base.tb->pc & TARGET_PAGE_MASK) || - (dest & TARGET_PAGE_MASK) == (s->base.pc_next & TARGET_PAGE_MASK); -#else - return true; -#endif + return translator_use_goto_tb(&s->base, dest); } static void account_noninline_branch(DisasContext *s, int cc_op) From patchwork Sat Jul 10 15:31:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2B8EC07E95 for ; Sat, 10 Jul 2021 15:52:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 449116120D for ; Sat, 10 Jul 2021 15:52:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 449116120D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FHe-0000A9-F9 for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:52:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exa-0005tI-TP for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:06 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:41537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExZ-0002Pc-5n for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:06 -0400 Received: by mail-pf1-x436.google.com with SMTP id f17so11691109pfj.8 for ; Sat, 10 Jul 2021 08:32:04 -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=rWhSjxDGBxYaiJEkKRwtWFyISfQcdIqDSvEuPe1mAyo=; b=ZRM+lDQp7Q2Y+HXX/bJEw6GGFJcqvi7u3I17ZlX06Wpg01l8x/Hz7XuQEUTYlfzhxw LDPJMWl42KF7j3iHA3PgCU0lkk+5PU4woRjl+3auZxdur7xai39F4cfr+E3SB+FwNuX4 RQGWjLkVWv1EZEZ7ZfTV/uxn4yo4KNywhsOe9cmVBMYzz7/jxE2eToEpihNYh0zwPmOY W0qSTQA0Qdh8r/fMaAcH7CdRetYRIfLniXSXb8iiIgMLLcGWbwszA/l3ARHOO76K5Kqc vf4YFGUthNwYZjbaQ/fDwtjzZukFOZ7bwqDrNkAK1CvNIgZieVWXXtes3V8/BB/XV2BP IiLQ== 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=rWhSjxDGBxYaiJEkKRwtWFyISfQcdIqDSvEuPe1mAyo=; b=rEm/p9bUucIN35fmAYJVlPgg82dZPs1KtGJYN0Vp6B/O9J9Iz7yFdKPiQE4qxmi0w+ h9DQ+6Oijj6dW589KhgamzTLZ17zOTR1lU3VzoRbi/DHSpy3ShSXo994OXf2Yl4/KAXk DoZxFNRgE8bELVS0qIAbU1r8Mjss6VB1BhSscnRksgMY3AUWIAMcYYF7rzLTT7CPEFb6 1gfiyxRKr2Ij83OSORw3HnOAh5esP6K4HIBf9wFG96Ou4R3NrgEuwmpJ6YICJHCHA5iS rWVrMk1TLwd788GKbYfbYB2PKcJTP9r9NNSellTB4lPmdX+mhanMiDzhaVI77wNi0jqo Edkg== X-Gm-Message-State: AOAM531LSDE/ctCzRG5o8v0ZKv5F38Las4/95EOtjufCWln+DE2DQi4l pgPYqKm9gJiaZqoprtoAvMavS2VOrI4Smw== X-Google-Smtp-Source: ABdhPJyMprnDTzJFjui/rqTG4fqKxGxq9AF67WDlx5kPDBuUnXwXBnayaQWkGMhxmSWbS2aCgZLbRA== X-Received: by 2002:a63:e948:: with SMTP id q8mr44639338pgj.52.1625931123953; Sat, 10 Jul 2021 08:32:03 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 28/41] target/s390x: Remove use_exit_tb Date: Sat, 10 Jul 2021 08:31:30 -0700 Message-Id: <20210710153143.1320521-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Hildenbrand Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We have not needed to end a TB for I/O since ba3e7926691 ("icount: clean up cpu_can_io at the entry to the block"). In use_goto_tb, the check for singlestep_enabled is in the generic translator_use_goto_tb. In s390x_tr_tb_stop, the check for singlestep_enabled is in the preceding do_debug test. Which leaves only FLAG_MASK_PER: fold that test alone into the two callers of use_exit tb. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/translate.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 767e77ca19..0cfe29d227 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -684,16 +684,9 @@ static void gen_op_calc_cc(DisasContext *s) set_cc_static(s); } -static bool use_exit_tb(DisasContext *s) -{ - return s->base.singlestep_enabled || - (tb_cflags(s->base.tb) & CF_LAST_IO) || - (s->base.tb->flags & FLAG_MASK_PER); -} - static bool use_goto_tb(DisasContext *s, uint64_t dest) { - if (unlikely(use_exit_tb(s))) { + if (unlikely(s->base.tb->flags & FLAG_MASK_PER)) { return false; } return translator_use_goto_tb(&s->base, dest); @@ -6633,7 +6626,7 @@ static void s390x_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) /* Exit the TB, either by raising a debug exception or by return. */ if (dc->do_debug) { gen_exception(EXCP_DEBUG); - } else if (use_exit_tb(dc) || + } else if ((dc->base.tb->flags & FLAG_MASK_PER) || dc->base.is_jmp == DISAS_PC_STALE_NOCHAIN) { tcg_gen_exit_tb(NULL, 0); } else { From patchwork Sat Jul 10 15:31:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 334FCC07E95 for ; Sat, 10 Jul 2021 15:37:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E4A4861154 for ; Sat, 10 Jul 2021 15:37:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4A4861154 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F2o-0004yd-3b for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:37:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exb-0005w1-Le for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:07 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:33296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2ExZ-0002QK-Oz for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:07 -0400 Received: by mail-pg1-x533.google.com with SMTP id 37so13197632pgq.0 for ; Sat, 10 Jul 2021 08:32:05 -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=KOIIIgFSsplaRIYV7/xcUpt+eZ6DdDmbIOsCJze1E68=; b=ZT596TWrwqnrpxOUlpSLqlN0xbeS+ZMp87D0ZrsphHVoHt49pHMBJ3rFqRa7EQR0VR I6FZZxMWejSyFLwUbXSK05Lam3pehYi3JAPy7sg5cB755IO4i84rAxsnEE3pauXanCGY 7r+kkxVxQjQ0INsFCFAR0zMW/ch+c0e+89JmtLs0gtAxT5Xii1pR5Y4bLbmkXAgQfOyr 6vhbD4i767YscOzEt32uubCvT3M5hFth4CknyMr4FvYSZJLgOaR6S6M20iibqB59gR7o 2Qc6PJa/VHgIx2PtGsjQP9jGUHjiLnL13stxDcGLilUTXKpi9Pud/d8vddrO9BeXbbec ymhQ== 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=KOIIIgFSsplaRIYV7/xcUpt+eZ6DdDmbIOsCJze1E68=; b=NFP5Cmh9sU1Goh1nnukWwihjoFpImaEg2SwgIqRio89XedhbZvnR4sarLJIVJD2aoG 4j72ErxZL0PTmwMs0EWGqe5PcWZzBE7sMnuEPHgYpF3MKfBVpq0UywPM9V8LA5yc3DV1 U4uf00FANpqTGr6ftN6IZdUG9sYH4RhcPNZ9zECcdddbm2Xjo9UQXkyNlzMgZsV6SYcj Xs6/8kRP2PecCa/vlZNfYzsVU3eMf3OmxCDEPwzfXIFOstOR0a6bwrMO+tcZM3V+Grbo ekhfJws0aifn65u9oyBabnZe9YDqoZvbSHrpVe2wYJqwNuIiiUXGJ75Q5fDms3BJgc9I FQ7A== X-Gm-Message-State: AOAM532xVOREzaZ2W8OuGBZFp1SNn4JO53x/uK181NZMbHzB8jcYK2Yw yna2sTjEJjt4/eapLWQt+1ZHDdFl019v5Q== X-Google-Smtp-Source: ABdhPJyTMO/7XEHPs3DXZgBVwWMDmtTdBqFqb24c85NxFocTvbM/8y0R5nWTKh9Uk2g1GPIXxzLhew== X-Received: by 2002:a65:6a0b:: with SMTP id m11mr4043505pgu.380.1625931124570; Sat, 10 Jul 2021 08:32:04 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 29/41] target/sh4: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:31 -0700 Message-Id: <20210710153143.1320521-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/sh4/translate.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 8a25a4362e..40898e2393 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -224,17 +224,12 @@ static inline bool use_exit_tb(DisasContext *ctx) return (ctx->tbflags & GUSA_EXCLUSIVE) != 0; } -static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest) +static bool use_goto_tb(DisasContext *ctx, target_ulong dest) { - /* Use a direct jump if in same page and singlestep not enabled */ - if (unlikely(ctx->base.singlestep_enabled || use_exit_tb(ctx))) { + if (use_exit_tb(ctx)) { return false; } -#ifndef CONFIG_USER_ONLY - return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif + return translator_use_goto_tb(&ctx->base, dest); } static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) From patchwork Sat Jul 10 15:31:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368751 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A031C07E9E for ; Sat, 10 Jul 2021 15:44:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D0EAE611CE for ; Sat, 10 Jul 2021 15:44:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0EAE611CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F9t-0007mq-U5 for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:44:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exd-00061e-Ao for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:09 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:42969) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2Exa-0002R4-Ij for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:08 -0400 Received: by mail-pf1-x430.google.com with SMTP id y4so11668025pfi.9 for ; Sat, 10 Jul 2021 08:32:06 -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=S4t3A3e3be4F+i7H1Y7Otgz4LVcV6jSvJ2vc23385UI=; b=J9FCHdFkyH6+FNHaZmDuurlwUKG16NojZ6OW6WbFeuxzsYET+Ug4Td7tO3ECfB/WgJ khCjyVyawzED2edYlWOc4u0FXWdJ3n7yRXOeyk+mjjODBo9OiSvyNxr21ys+iK0kC+Rn v3SAzCf3wQjOM39LlZS6AaGFKLyJVJWThFxaQt9gpvbm5kKua+lgfVP6S2/OEpgZe5fA FIlS3eJOadWGaRAC9pVDuQTOYEabTy3H0LlsTeVSgr7ju1oKQ7IC3XEQxyJwXh9H6V5g ALnDDn4PGZr1l/9YDzRXBFU1z+NVwQfFlCXMExkrkLTk7eXbZ+LnjGcxYwj7UBvhTHPe sADw== 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=S4t3A3e3be4F+i7H1Y7Otgz4LVcV6jSvJ2vc23385UI=; b=HmlInYtX3QWK4j+PD4w+Dri88Q3UZoZN1AxP7Xxgj8ZgS4Zdb7F7dWwYxdYkzIyMuJ hKnG8TQhuqtk+Ne3LSaGUNBGYsb10QhLn1mZ0a/0GEjqab8iCG9IQxT/jjg1hkb4YPZt /9LV89KDAg9uQ1Bx5zXFIkvOjyyKH5aiVGIymcZs+0opGiFdzXP8jmxijC3UR0gbn8Un EE0BU1WvolCnqhrbAwQo2JRjZX+HHeSwVACYTIIGTJ8neAa4s3oqc8NKv5WhQmLaeqli x42ApO05K6GfOXldSlW4waNsCYhx51B3H26mU1J0Zyh4LG8ik0OjEhxRTe5odpBQT8KB 5cVA== X-Gm-Message-State: AOAM531LiyyyFbfCDR7wAK5LINkADzGispFAYBEaekRzXbMGo/LtwI73 ogm90w8L0U9uWwDp9ZU921WVuv8uCmZREQ== X-Google-Smtp-Source: ABdhPJzz13fJyMW66rZ27ydpn3MXrCDWEDoZMaq6rFMJ0k5krIoomEIe/7nhwWToKJQeEV/bZ2Cr8A== X-Received: by 2002:a63:f751:: with SMTP id f17mr44089226pgk.373.1625931125198; Sat, 10 Jul 2021 08:32:05 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 30/41] target/sparc: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:32 -0700 Message-Id: <20210710153143.1320521-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/translate.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index f3fe7a0369..e530cb4aa8 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -338,23 +338,14 @@ static inline TCGv gen_dest_gpr(DisasContext *dc, int reg) } } -static inline bool use_goto_tb(DisasContext *s, target_ulong pc, - target_ulong npc) +static bool use_goto_tb(DisasContext *s, target_ulong pc, target_ulong npc) { - if (unlikely(s->base.singlestep_enabled || singlestep)) { - return false; - } - -#ifndef CONFIG_USER_ONLY - return (pc & TARGET_PAGE_MASK) == (s->base.tb->pc & TARGET_PAGE_MASK) && - (npc & TARGET_PAGE_MASK) == (s->base.tb->pc & TARGET_PAGE_MASK); -#else - return true; -#endif + return translator_use_goto_tb(&s->base, pc) && + translator_use_goto_tb(&s->base, npc); } -static inline void gen_goto_tb(DisasContext *s, int tb_num, - target_ulong pc, target_ulong npc) +static void gen_goto_tb(DisasContext *s, int tb_num, + target_ulong pc, target_ulong npc) { if (use_goto_tb(s, pc, npc)) { /* jump to same page: we can use a direct jump */ From patchwork Sat Jul 10 15:31:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80A28C07E95 for ; Sat, 10 Jul 2021 15:54:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3CDA161209 for ; Sat, 10 Jul 2021 15:54:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CDA161209 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FJ0-0002bA-Bu for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:54:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exc-0005zv-Q1 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:08 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:34638) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2Exb-0002RH-2q for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:08 -0400 Received: by mail-pf1-x434.google.com with SMTP id o201so6620817pfd.1 for ; Sat, 10 Jul 2021 08:32:06 -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=HmrvZ2YDmFmQRowDiyGgkhSWbFuv8fekjQLGpsBU/NM=; b=qUEtvDtPYfegydw0pJYrorQFMFKSnTz8nE8dsHS4vddDrUVd94+OTyLP5WuxXJZCRO f8HCDzZxF9AbfvlRboGgpoYN8r1WHGivIvCIAY+hVYwFn3zqJaQwcU05Aq+GxIytEPF+ Dv45MWagTfv+bIRI57CrbmgSqYVG+H1rR+56zisKRudCiL8zk8JyaY41JDcrFIXtq8YT bvBrGElh16p1RW0y+B7eZyb2w9NPak4mUBe030aqZOtgczsnBlMBguIiyMgbHggaFMg4 9kC4wO3a/EXFLdJZYhI6f1xFw8UU0AbaeeSNvcEoufszmgNNaIaJmw5FdyZRtiPslQHf 409g== 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=HmrvZ2YDmFmQRowDiyGgkhSWbFuv8fekjQLGpsBU/NM=; b=SQeUawYgcO1L+bKtrB+xB/8qIqZ/CFpk2SX/D4QqjKP0JWF3m6N+Na9fPUhfL3TuPf d9rniynlrUXDWGUXl7O1XVspAZPpSOQuPgxkhWR8aUHDMGEtogw/JM5SIRrStWs0Am8a ojiDptdS0QBhD0oVngNmn8njVTavo+FLP2gBFvrbddOjEjbMlSbTtfbMvmk5U7rHLmAc 84/Dr/XkpBBRSPxaO5d09fzDrrt0DzNnjXjLjPG5LieoPnVS/biv8ByjkfvGxo/JpS9o apciHcc+w9vQtd9qsG1c2FwfpeVY37j0YgeArGu53MIROFw4XTxbx/5AvC+EbY70I0Nk UtuA== X-Gm-Message-State: AOAM532GBNhqj7b1gLD0ZDKbL8KkET3n+n7AnVZe2ugYlZucTiotO6oz 2E2eYZ9qJ98aMwcsBa6sz7SR4N3ouuJ6Zw== X-Google-Smtp-Source: ABdhPJxHeX4TZCcN58m1NPTnRc/qRPNBsdytDoCqgea9DzcTVQ7NpijKCFbaIk9FTvWQX2iBtX5Rhw== X-Received: by 2002:a63:ba1e:: with SMTP id k30mr8226441pgf.39.1625931125806; Sat, 10 Jul 2021 08:32:05 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 31/41] target/tricore: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:33 -0700 Message-Id: <20210710153143.1320521-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bastian Koppelmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just use translator_use_goto_tb directly at the one call site, rather than maintaining a local wrapper. Reviewed-by: Bastian Koppelmann Signed-off-by: Richard Henderson --- target/tricore/translate.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 2a814263de..09465ea013 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -3225,19 +3225,6 @@ static inline void gen_save_pc(target_ulong pc) tcg_gen_movi_tl(cpu_PC, pc); } -static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest) -{ - if (unlikely(ctx->base.singlestep_enabled)) { - return false; - } - -#ifndef CONFIG_USER_ONLY - return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif -} - static void generate_qemu_excp(DisasContext *ctx, int excp) { TCGv_i32 tmp = tcg_const_i32(excp); @@ -3246,9 +3233,9 @@ static void generate_qemu_excp(DisasContext *ctx, int excp) tcg_temp_free(tmp); } -static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) +static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) { - if (use_goto_tb(ctx, dest)) { + if (translator_use_goto_tb(&ctx->base, dest)) { tcg_gen_goto_tb(n); gen_save_pc(dest); tcg_gen_exit_tb(ctx->base.tb, n); From patchwork Sat Jul 10 15:31:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B45EBC07E95 for ; Sat, 10 Jul 2021 15:50:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 45D136120D for ; Sat, 10 Jul 2021 15:50:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 45D136120D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FEv-0002t4-8U for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:50:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exf-00069m-ER for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:11 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:45649) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2Exb-0002S4-NM for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:11 -0400 Received: by mail-pg1-x534.google.com with SMTP id y17so13140533pgf.12 for ; Sat, 10 Jul 2021 08:32:07 -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=jlb9t26eUmvNmKvxgmiWrSkxF75bfUaFnwmdpAxQL3Q=; b=gJ9ffspHBwaXZpkdmN59XMxVThYTTTAGaVsp9mKiIDf+XNOA+xMpGoL4lf1zMvVqtP 0eeMlKk3duISt3OVZ14V+FqVnD7UHNd5Zxb5p4CzNdfyKwU5fVO00Kc4ZI6mhrSOP+CL x/OiAu/z7L9nZO+/K2Rs0G2occkSr6F5ugKrse8znUh753cPdPVcyRuPccF0Yr7DMIgF 8O3rBBS+l+GiTg2OdvBDPC6Rlk0ROGBWzX5dBFXszI5lZqyYoq98D6Qs7fa2H4f/BfRY FaMJ/SeqJ+TdICIbnwTMScskNdVVa1IEwkmagbsGNUVT9m4QAsN7GVQVurWKrcZ2KH4L QT1A== 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=jlb9t26eUmvNmKvxgmiWrSkxF75bfUaFnwmdpAxQL3Q=; b=GwKzeHfNE3WehKlWM61RbUSKdPFkW6ib6KxKHysr6vLtU03U0R9h2wzsRkuCDU1cOg nuS8WEVrw9eO7xOqOSiQ8U77DLhdRD6yFiTlha4sg+u2CXwEKXu3D0WdHHKyGHhq4w80 WDyCm6qtvTkXP1n7eWpw1kvVZ2GLm1JQg4eRsZbtTSV7kXQbLudjAFB4rw/8dAUR5e8N 34JU17SyZ+v7+U6ABvUA5cIjq1BWM5LGXMGdn35eJ3vM8xOUoJcH2ancYy9YiL+gozv6 oG6TMFZKx1j2UX/8J0tA4gF/ZnLPQPoNEDbZCNFjpdM2jOQmbJUIakujLaVbLZZ2xawY mo8g== X-Gm-Message-State: AOAM533JbTAFeFM6TqjXbjBUwvTIj60sIPB/5EoRmc0JW/whngUY9WPJ t9NYhg96PgpsnocNk/hXvGACKHg0abbKkg== X-Google-Smtp-Source: ABdhPJxi7EEa73EdAlK+rbkxhhRMofPDZEPmx56jtRC1LhHm2ujyNhTq0wLuePn9NBbvXGB00ACo3A== X-Received: by 2002:a63:450e:: with SMTP id s14mr34955763pga.312.1625931126503; Sat, 10 Jul 2021 08:32:06 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 32/41] target/tricore: Use tcg_gen_lookup_and_goto_ptr Date: Sat, 10 Jul 2021 08:31:34 -0700 Message-Id: <20210710153143.1320521-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bastian Koppelmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The non-single-step case of gen_goto_tb may use tcg_gen_lookup_and_goto_ptr to indirectly chain. Reviewed-by: Bastian Koppelmann Signed-off-by: Richard Henderson --- target/tricore/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 09465ea013..865020754d 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -3243,8 +3243,9 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) gen_save_pc(dest); if (ctx->base.singlestep_enabled) { generate_qemu_excp(ctx, EXCP_DEBUG); + } else { + tcg_gen_lookup_and_goto_ptr(); } - tcg_gen_exit_tb(NULL, 0); } } From patchwork Sat Jul 10 15:31:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368731 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2646C07E95 for ; Sat, 10 Jul 2021 15:40:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7085961185 for ; Sat, 10 Jul 2021 15:40:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7085961185 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F5T-0002Cm-ID for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:40:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exd-00064I-V7 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:09 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:36765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2Exc-0002SG-C0 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:09 -0400 Received: by mail-pg1-x536.google.com with SMTP id f5so13163192pgv.3 for ; Sat, 10 Jul 2021 08:32:07 -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=0TpBf4qKV0D0B2PVgq/Ik4yquVh/66Vd5JijaCSKrFk=; b=BGBFyYHDYLo2NrsJ6QyUsaleBRRm7lCJq1UeKjqx+znKYk8yn0Ls0TIAPWcL8g1rrR 5oDuQ1OcFCFSG1HLyH0OSgLdmvmoRBhH3mUZln4N1cIp5vmXKXctcNA6UyrWAgpsHCGU xwzODdpOTCzQbp8SAWfDwqillga+d2L6y1j186JSSik6EeEg9TRhxJEOv5kkjVwLlZoz NaTn/GqR83m31KoR6j/QvFzw9Gx0gH/CZxMRp+ww3WtcneJiExI3q4XY1KeSlm2ssNk8 UsHjk2BgkkABMEZy36AwL2HqC3seImF+DJPwMlh6euqzAkcgb8XBzgOB0zdr2XEUFpab SfMw== 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=0TpBf4qKV0D0B2PVgq/Ik4yquVh/66Vd5JijaCSKrFk=; b=glTcPfvfQ+Fopp0DyZcoW5icM98vJaveWdJAQmibNlyBPTtFBXrbEeMFH8nbSINMrC qOIThTT3LgNnsSFKhwpx6y75kBBs8I6wfkovnFs5kCbB0Pb3uhE7BJdBr0kXtb0FmRN2 FsYjGKnS+xcFWzwdaIeXN92jWyh13TeJnooWnDdvEa66+vOYLQnijO0UqReSwKYL1nGL PDCtKLI8GVtg8Vy5E9rKTnn6f3VqWKVkmHTrxLyF06zkmSV8QE/KG1d7+dfU87hoL6MH uP37WHSTOyFq7EXZ27pCm1JGHGOIB5/g+O2wEdBlXJyOWZabtnsQHTvWbY7tjCLmtZbI gZig== X-Gm-Message-State: AOAM530KftKdiJu7StfiJoV6X5f5OWaQcqIKDbyyfcfceHWlI6+8BUyM 8btdWXZslB+FLiIHK+KwKQzj8rgJpPiCLw== X-Google-Smtp-Source: ABdhPJyWBeFyiBG4ZQqYAiiPFhfIRiZhB+sxiV4mvkadVWbuo+p8gBSpFWMfZWtZp0r1aKMvaV8xsQ== X-Received: by 2002:a63:eb04:: with SMTP id t4mr45165865pgh.84.1625931127054; Sat, 10 Jul 2021 08:32:07 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 33/41] target/xtensa: Use translator_use_goto_tb Date: Sat, 10 Jul 2021 08:31:35 -0700 Message-Id: <20210710153143.1320521-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Max Filippov Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index d5da35f4fc..7094cfcf1d 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -405,11 +405,7 @@ static void gen_jump(DisasContext *dc, TCGv dest) static int adjust_jump_slot(DisasContext *dc, uint32_t dest, int slot) { - if (((dc->base.pc_first ^ dest) & TARGET_PAGE_MASK) != 0) { - return -1; - } else { - return slot; - } + return translator_use_goto_tb(&dc->base, dest) ? slot : -1; } static void gen_jumpi(DisasContext *dc, uint32_t dest, int slot) From patchwork Sat Jul 10 15:31:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4187AC07E9B for ; Sat, 10 Jul 2021 15:55:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0646061241 for ; Sat, 10 Jul 2021 15:55:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0646061241 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FJt-000411-12 for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:55:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exe-00067W-Q3 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:10 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:39696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2Exd-0002SO-0L for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:10 -0400 Received: by mail-pf1-x42c.google.com with SMTP id b12so11678695pfv.6 for ; Sat, 10 Jul 2021 08:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=mkAz14ohKaEU7KoR8ytu+L59auoxHOiI3rwm13ILEcE=; b=EFDs7r0yNiH3qWFi4usGTVsVaukeRn8UfBj6eMIAPrPZcUSdr/q9ggTcurYUzuMByd aJ4/oSAs1bf2y/F0qPQRG4gu8TzWklI4jKqey+MgtSy/qOFU8bh0ibCDJoq/9+qaOp42 sTkOxbKxE2jBsiv4JL/z9m0x7AVeWyrvbDPbcGb/EBjLyW93JWn8ZVO2XC7w/LuzxOKZ wo02nyYjIE5He3Cz8LaRhVf2nuNzb72tpHQiYZI1OXV3HnJmUphjmqaR7b75qvpNoTYK 4G+ujTlkgrRqtRvd6MzJ3M4vaifrs0ntgpY+HAp9EBb78gu8YZPoJhOZBHeKrM3PksDY odOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mkAz14ohKaEU7KoR8ytu+L59auoxHOiI3rwm13ILEcE=; b=jD78lz5V17yqQtrrPwIvlmfFC2cZP+qosaUQxhpi0Wn23UKv6qCXyX6bcM5RbetkIK 8slImD8I4C2vVxdnFkxiA6sGcmW+VCzZ3ChaQPJLgi6YrpwUgYCv5z9g2RTXQkbl47s+ ntbbTB90K9DLYaxzAh5SaxyH4EvsLMmx8Ub2qSifI9XxFM2is2HBuuIO3iGYgeVry123 0s1rBZ+IOe9vrRpaKx2GkPP4pHigPDVTRofMA4YPV/gFz77m5d718baEARRwS+kXkR2b LmqYErnhtAo9Gd4T8Dm0QmpMhmU6e1utqKrlqaVvVjRTaGDrS8NEhJ3lqBDDKUbhEIhD iSxw== X-Gm-Message-State: AOAM531kzQERixMFNZGBvJXxZZawaLucnB7e2aN+FfgVKONxV8McMCvE Zn5KvL+HMCBNq/9SFgwfaSOhXvo+Bq9GhQ== X-Google-Smtp-Source: ABdhPJwSBUGX92TO6jBzb3DFiWRV+1fdpgr8Xmhcjrrx/VPTcZnM2x5M5iWXFI7q36Tv1rJv9+yfew== X-Received: by 2002:a65:6283:: with SMTP id f3mr14640614pgv.370.1625931127693; Sat, 10 Jul 2021 08:32:07 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 34/41] tcg: Fix prologue disassembly Date: Sat, 10 Jul 2021 08:31:36 -0700 Message-Id: <20210710153143.1320521-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" In tcg_region_prologue_set, we reset TCGContext.code_gen_ptr. So do that after we've used it to dump the prologue contents. Fixes: b0a0794a0f16 Signed-off-by: Richard Henderson --- tcg/tcg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 4dd4084419..ed86a70b79 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -752,8 +752,6 @@ void tcg_prologue_init(TCGContext *s) (uintptr_t)s->code_buf, prologue_size); #endif - tcg_region_prologue_set(s); - #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_OUT_ASM)) { FILE *logfile = qemu_log_lock(); @@ -795,6 +793,8 @@ void tcg_prologue_init(TCGContext *s) tcg_debug_assert(tcg_code_gen_epilogue != NULL); } #endif + + tcg_region_prologue_set(s); } void tcg_func_start(TCGContext *s) From patchwork Sat Jul 10 15:31:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DDA4C07E9B for ; Sat, 10 Jul 2021 15:47:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC53C61208 for ; Sat, 10 Jul 2021 15:47:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC53C61208 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FC0-00043h-4O for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:47:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exf-00068p-5L for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:11 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:42971) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2Exd-0002Sb-FZ for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:10 -0400 Received: by mail-pf1-x432.google.com with SMTP id y4so11668098pfi.9 for ; Sat, 10 Jul 2021 08:32:09 -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=ROJxUKF4ozP3LXQH8wzMsHzOmSKxOrW0h+5+6kQNd1M=; b=GbmokYcDXH1HsCZjsZgkZtZBnrctaHdRaChjMnZpsmuNAz/HTCjkgfqbGo27cLiDSK NsYLojUaiR+28S2UPP96TEI8Al4WHp2/45mJ77RLhNsbr42zvUyLlN562HDsPoncaPH0 LvHNWDdKakUO5ea9abK+wuOCX4Vbqln451YVTmy5UmdGiTDswbEqcmx7lxUDplC0W6Vc bBw8VU14vzkldrmcYBvj+ZYXO6mNN9EO924bXTjDmGKoGy6AMkmfayK4MGzWbEuIdVJZ r6Y/RVZzHr6wwAplHKGa70s93VDDj+yrOenx2DlaEYO9tavakLUEanQ4xNS0qYeio1ym Z3mQ== 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=ROJxUKF4ozP3LXQH8wzMsHzOmSKxOrW0h+5+6kQNd1M=; b=BeozLPOV7xjTLFN1dLduyvs3o4zKilxotGs8Dni10FbO5ltq9OKNdhEGjh2mJ2MaE2 Nm+M3ji6xT4w8ZifmBpmB/aWjvGQ9kHcHeDOHht1i836N9pxY2Sdg9PeZ8A16iUYpMyf 4o8X/r62FFaJJGtLkJIrVy3bFKbbjktQcXDm6k/sK2JbBqWSGtBch8bE4Ff7HQGv1Hij Sf3V784hz9tvNUJmURFmAoRF9gjGMIb0y5bmWR7kkGQxgad88cXIb2Cf8QA3nbq51wcr M8Pi0w478F0dESwVfkVF2LYE9DnqoIX3b528iV4YZ2/oDbz/bMSjfo2cfNrzMlICcpwb xtTQ== X-Gm-Message-State: AOAM5338hX959sFr1u14BSmnIB4P5Gz6t0AZkEQLhNVwiFhqQla/0Gep FnSND6KwjLs8N5th0EGQxiHAc+kh832PDw== X-Google-Smtp-Source: ABdhPJyQeJLJJCYj247OU72GhW/d07Q8AyqCjWhm08XCaDQYPJziIwgWgy7WOAP9b1V0RKis6+CqMg== X-Received: by 2002:a65:4289:: with SMTP id j9mr12601186pgp.256.1625931128308; Sat, 10 Jul 2021 08:32:08 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 35/41] target/i386: Use cpu_breakpoint_test in breakpoint_handler Date: Sat, 10 Jul 2021 08:31:37 -0700 Message-Id: <20210710153143.1320521-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The loop is performing a simple boolean test for the existence of a BP_CPU breakpoint at EIP. Plus it gets the iteration wrong, if we happen to have a BP_GDB breakpoint at the same address. We have a function for this: cpu_breakpoint_test. Signed-off-by: Richard Henderson Reviewed-by: Eduardo Habkost Message-Id: <20210620062317.1399034-1-richard.henderson@linaro.org> --- target/i386/tcg/sysemu/bpt_helper.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/target/i386/tcg/sysemu/bpt_helper.c b/target/i386/tcg/sysemu/bpt_helper.c index 9bdf7e170b..f1fb479ad9 100644 --- a/target/i386/tcg/sysemu/bpt_helper.c +++ b/target/i386/tcg/sysemu/bpt_helper.c @@ -210,7 +210,6 @@ void breakpoint_handler(CPUState *cs) { X86CPU *cpu = X86_CPU(cs); CPUX86State *env = &cpu->env; - CPUBreakpoint *bp; if (cs->watchpoint_hit) { if (cs->watchpoint_hit->flags & BP_CPU) { @@ -222,14 +221,9 @@ void breakpoint_handler(CPUState *cs) } } } else { - QTAILQ_FOREACH(bp, &cs->breakpoints, entry) { - if (bp->pc == env->eip) { - if (bp->flags & BP_CPU) { - check_hw_breakpoints(env, true); - raise_exception(env, EXCP01_DB); - } - break; - } + if (cpu_breakpoint_test(cs, env->eip, BP_CPU)) { + check_hw_breakpoints(env, true); + raise_exception(env, EXCP01_DB); } } } From patchwork Sat Jul 10 15:31:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368779 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F5A0C07E95 for ; Sat, 10 Jul 2021 15:56:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1262A61209 for ; Sat, 10 Jul 2021 15:56:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1262A61209 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FLK-0005h5-5h for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:56:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exg-0006Cb-52 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:12 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:40600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2Exe-0002TP-6S for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:11 -0400 Received: by mail-pj1-x102c.google.com with SMTP id b14-20020a17090a7aceb029017261c7d206so9961183pjl.5 for ; Sat, 10 Jul 2021 08:32:09 -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=ZRs8c+bYXTrMqFwEkSuK8yjMifIV/i4B8zW/9Y2Jl1o=; b=MYMWwg/Y+O2hTJus4l/OaD77isoxwMkkwxEQdMR7UWAO0QunAIIf2gQOx1seA19lyM fA8GrFMKgigYpt+JcKmfY4DGAHTmD5eDJq9pNmg2UBIWOGP1sn9aePzUcTZeUXB6Kpjr o3EhnBv+E3QegS0x0bDYV5AepRsh7iosjRaKFuuZL2GVfSUTLrYZHmfSCuI5ORTLBT4O 41c5BBbYWEkfxBxpDcsr77AmT7g4ZcEUIXqZzoJB+OHtJBChzc9fftA/7uLn3QltM+pt k+Ttgt0Lo6ACCbPUMQp6CKcSnWfod+mQ3G9MXlWe4VzQ5CH1OgntAN3+BplPVRvU51Mm Gz8w== 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=ZRs8c+bYXTrMqFwEkSuK8yjMifIV/i4B8zW/9Y2Jl1o=; b=YSNbNE4GkzitdmCUb1PlGQn+XEdGDfGRP/TRqPVIVDfqDpYpMLswCnJCNiesNfz/wm u9U/ZUZN595eT6jsnEQ2xxZnAk/37q+2gCz2QjgwGyVbkzFjHk2RmAEzWfbUlK9HcaEH gCbpMAKtwSCzYsN6mhEjR2VSGOkcpYj0ubd19rCa6FqIqvxxthwHALF3gq3IJYNP4YKe OvU6hoF2SZ2phFoRe0zeXazAm34BxEt2EKmnWTp2UWgfW4AwGqaCY5sPqA0meU47+EPN PQpvdxwFNl2YQ76M8JYqWQvS8aEPgbm9OwTVzCFnCF/beR/QGGniX7tJibuhygJGs0to Cgkw== X-Gm-Message-State: AOAM5314H1388R5rPJ1XrZsJqVo4flteKkqC1z1m1CMo1/McgvR+tl2O 8u94LjqN6AP6dHkyoZLFcYjokhwG8rpqRQ== X-Google-Smtp-Source: ABdhPJx1ixG3GxJBLg97UdgOrP9bMgHt3nOBN7MTntEah8tDUXftpTRDJ4iwi+gVy7njaW4zKA4Zdw== X-Received: by 2002:a17:902:d88b:b029:128:cd59:ead2 with SMTP id b11-20020a170902d88bb0290128cd59ead2mr35851874plz.27.1625931128919; Sat, 10 Jul 2021 08:32:08 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 36/41] accel/tcg: Move helper_lookup_tb_ptr to cpu-exec.c Date: Sat, 10 Jul 2021 08:31:38 -0700 Message-Id: <20210710153143.1320521-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This will allow additional code sharing. No functional change. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 30 ++++++++++++++++++++++++++++++ accel/tcg/tcg-runtime.c | 22 ---------------------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index ad1279d2ed..fb6668606f 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -38,6 +38,7 @@ #include "exec/cpu-all.h" #include "sysemu/cpu-timers.h" #include "sysemu/replay.h" +#include "exec/helper-proto.h" #include "tb-hash.h" #include "tb-lookup.h" #include "tb-context.h" @@ -145,6 +146,35 @@ static void init_delay_params(SyncClocks *sc, const CPUState *cpu) } #endif /* CONFIG USER ONLY */ +/** + * helper_lookup_tb_ptr: quick check for next tb + * @env: current cpu state + * + * Look for an existing TB matching the current cpu state. + * If found, return the code pointer. If not found, return + * the tcg epilogue so that we return into cpu_tb_exec. + */ +const void *HELPER(lookup_tb_ptr)(CPUArchState *env) +{ + CPUState *cpu = env_cpu(env); + TranslationBlock *tb; + target_ulong cs_base, pc; + uint32_t flags; + + cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags); + + tb = tb_lookup(cpu, pc, cs_base, flags, curr_cflags(cpu)); + if (tb == NULL) { + return tcg_code_gen_epilogue; + } + qemu_log_mask_and_addr(CPU_LOG_EXEC, pc, + "Chain %d: %p [" + TARGET_FMT_lx "/" TARGET_FMT_lx "/%#x] %s\n", + cpu->cpu_index, tb->tc.ptr, cs_base, pc, flags, + lookup_symbol(pc)); + return tb->tc.ptr; +} + /* Execute a TB, and fix up the CPU state afterwards if necessary */ /* * Disable CFI checks. diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c index 66ac830e2f..e4e030043f 100644 --- a/accel/tcg/tcg-runtime.c +++ b/accel/tcg/tcg-runtime.c @@ -30,7 +30,6 @@ #include "disas/disas.h" #include "exec/log.h" #include "tcg/tcg.h" -#include "tb-lookup.h" /* 32-bit helpers */ @@ -145,27 +144,6 @@ uint64_t HELPER(ctpop_i64)(uint64_t arg) return ctpop64(arg); } -const void *HELPER(lookup_tb_ptr)(CPUArchState *env) -{ - CPUState *cpu = env_cpu(env); - TranslationBlock *tb; - target_ulong cs_base, pc; - uint32_t flags; - - cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags); - - tb = tb_lookup(cpu, pc, cs_base, flags, curr_cflags(cpu)); - if (tb == NULL) { - return tcg_code_gen_epilogue; - } - qemu_log_mask_and_addr(CPU_LOG_EXEC, pc, - "Chain %d: %p [" - TARGET_FMT_lx "/" TARGET_FMT_lx "/%#x] %s\n", - cpu->cpu_index, tb->tc.ptr, cs_base, pc, flags, - lookup_symbol(pc)); - return tb->tc.ptr; -} - void HELPER(exit_atomic)(CPUArchState *env) { cpu_loop_exit_atomic(env_cpu(env), GETPC()); From patchwork Sat Jul 10 15:31:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368781 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86105C07E95 for ; Sat, 10 Jul 2021 15:57:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F25476120D for ; Sat, 10 Jul 2021 15:57:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F25476120D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FME-0007CC-6K for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:57:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exg-0006EJ-GS for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:12 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:46909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2Exe-0002UK-PD for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:12 -0400 Received: by mail-pl1-x630.google.com with SMTP id c15so6622300pls.13 for ; Sat, 10 Jul 2021 08:32:10 -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=N9trJ1kjKGoNILkYQrFrW0/ogeTQmik7Rpq4HjTsUMQ=; b=tpns8aJPE6wLgu/SUznDn9IsAIvqw6libgybVkfiz6F7Y3v25IAa0nx32UMVNnniNk 9F80eI4iJZQroZV9B9+uuv/CC40RTKS5gTJ1N5xmPoQ4nJIyHzIHonNp8KSDvADhvPws KBMw/BBQp/sl9Vk7ojcB/cpCKGMZSrQUGqMPZsL6TYXjktruW3TPAx+S1lztwULkrtCU SQzlhN1tRwSbfrjCJthwBuqKgFD3txkSvaWk0tSVnWtEB3njyIrk54qYX/WiDTXhNZbr MOh529cfRrD2uudOY+d1OAh49wP2i74O3XwB7oiaoa+lt1VzPpEkqrIOs37DZ/VTmFh2 xIlA== 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=N9trJ1kjKGoNILkYQrFrW0/ogeTQmik7Rpq4HjTsUMQ=; b=h2QOHa5KPzgMdCBAUjJmrur9+05l534ZMjA4eEsGOE2Vh37QAyQasLrKXop/v3cIh1 l8oK6Rfiy1mXz3lqikTZrauqnEpjBkCF1x20eVvLLw5HOXnmWvwbmRvpeVU0/Nbn1nGN lZXUIP+dnjLPCmnYuPTf1Wcao1hLIJb5Bfhdn7QAdz/dno4B4c85kaIFSkRvMbkzXyRQ Uut50YA12NErim+GpB4j2l8jmsplWG/6Z4KgvajMkYkho2F2lyHnn41Nd2dOjMJZsVQH Xv3ClbEW4zM6408nAYeysR7hS37FgBVtB1tPifeEzNR3/1ThBJ830kv94vVjrPRGhSOF B0uA== X-Gm-Message-State: AOAM531juDcZL6VYnPeGDhpH1+SSY4HsowrKEEDMucvB8gMNQq2HVbED oc6c7WcLqFNlcYE7vWkQ5BNP2VTo9Df+Jg== X-Google-Smtp-Source: ABdhPJwal1GmSslzL67mW4/0KXALokxZ2sqSeZa4S0jhZ2CzJomMCFCNFKY4s/wZSK9lIv4sRP1xRw== X-Received: by 2002:a17:902:9895:b029:128:cdfb:f389 with SMTP id s21-20020a1709029895b0290128cdfbf389mr35038289plp.45.1625931129519; Sat, 10 Jul 2021 08:32:09 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 37/41] accel/tcg: Move tb_lookup to cpu-exec.c Date: Sat, 10 Jul 2021 08:31:39 -0700 Message-Id: <20210710153143.1320521-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Now that we've moved helper_lookup_tb_ptr, the only user of tb-lookup.h is cpu-exec.c; merge the contents in. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/tb-lookup.h | 49 ------------------------------------------- accel/tcg/cpu-exec.c | 31 ++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 50 deletions(-) delete mode 100644 accel/tcg/tb-lookup.h diff --git a/accel/tcg/tb-lookup.h b/accel/tcg/tb-lookup.h deleted file mode 100644 index 9c9e0079da..0000000000 --- a/accel/tcg/tb-lookup.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2017, Emilio G. Cota - * - * License: GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ -#ifndef EXEC_TB_LOOKUP_H -#define EXEC_TB_LOOKUP_H - -#ifdef NEED_CPU_H -#include "cpu.h" -#else -#include "exec/poison.h" -#endif - -#include "exec/exec-all.h" -#include "tb-hash.h" - -/* Might cause an exception, so have a longjmp destination ready */ -static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, - target_ulong cs_base, - uint32_t flags, uint32_t cflags) -{ - TranslationBlock *tb; - uint32_t hash; - - /* we should never be trying to look up an INVALID tb */ - tcg_debug_assert(!(cflags & CF_INVALID)); - - hash = tb_jmp_cache_hash_func(pc); - tb = qatomic_rcu_read(&cpu->tb_jmp_cache[hash]); - - if (likely(tb && - tb->pc == pc && - tb->cs_base == cs_base && - tb->flags == flags && - tb->trace_vcpu_dstate == *cpu->trace_dstate && - tb_cflags(tb) == cflags)) { - return tb; - } - tb = tb_htable_lookup(cpu, pc, cs_base, flags, cflags); - if (tb == NULL) { - return NULL; - } - qatomic_set(&cpu->tb_jmp_cache[hash], tb); - return tb; -} - -#endif /* EXEC_TB_LOOKUP_H */ diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index fb6668606f..0d92698030 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -40,7 +40,6 @@ #include "sysemu/replay.h" #include "exec/helper-proto.h" #include "tb-hash.h" -#include "tb-lookup.h" #include "tb-context.h" #include "internal.h" @@ -146,6 +145,36 @@ static void init_delay_params(SyncClocks *sc, const CPUState *cpu) } #endif /* CONFIG USER ONLY */ +/* Might cause an exception, so have a longjmp destination ready */ +static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, + target_ulong cs_base, + uint32_t flags, uint32_t cflags) +{ + TranslationBlock *tb; + uint32_t hash; + + /* we should never be trying to look up an INVALID tb */ + tcg_debug_assert(!(cflags & CF_INVALID)); + + hash = tb_jmp_cache_hash_func(pc); + tb = qatomic_rcu_read(&cpu->tb_jmp_cache[hash]); + + if (likely(tb && + tb->pc == pc && + tb->cs_base == cs_base && + tb->flags == flags && + tb->trace_vcpu_dstate == *cpu->trace_dstate && + tb_cflags(tb) == cflags)) { + return tb; + } + tb = tb_htable_lookup(cpu, pc, cs_base, flags, cflags); + if (tb == NULL) { + return NULL; + } + qatomic_set(&cpu->tb_jmp_cache[hash], tb); + return tb; +} + /** * helper_lookup_tb_ptr: quick check for next tb * @env: current cpu state From patchwork Sat Jul 10 15:31:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368783 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3A8CC07E95 for ; Sat, 10 Jul 2021 15:59:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 865C86120D for ; Sat, 10 Jul 2021 15:59:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 865C86120D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FNc-0000Dq-PR for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:59:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exj-0006ME-49 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:15 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:43933) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2Exf-0002Uj-FL for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:14 -0400 Received: by mail-pj1-x102d.google.com with SMTP id x21-20020a17090aa395b029016e25313bfcso7798878pjp.2 for ; Sat, 10 Jul 2021 08:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=i7Yv44S3soVKhBIR2nVe5GqBZQT4ofBHKeU6kY+QU8k=; b=V0dlMkBDUppj2vYrDVMIW1RhDpAgvvk4A5reOzDZwhxgm3mPK9nw99kGeeuNkJTd/q Xv39QeJ/Ih+fFBr5tP9WgIsTSp2ujPjUnSjHskwqebuCMMw1FyNARx7lJ7vsj0J/t2vm ZHF80rOdojmT9HxTi2l+CLgwd0xteSc/7GcHxLgAhDxa9ME4Y0Lk47nNnpksCY/z/75O tYq76F4ZpiM0mY76FPwgQ7FteH0TAobAnuB1BLL0Id9//8U2VMqgPu9A+Qb7Vtg9CJso 3+90vqmLNenIaGYGOqnc6vVivPlxID+2xrBa/bKJ+yRduBaezArY3YiqJvfqAu1kqlfe Iivw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=i7Yv44S3soVKhBIR2nVe5GqBZQT4ofBHKeU6kY+QU8k=; b=Fjeueui8zYL8ZYydcxFocEZ4/CJ9dUKVXTzpuFxbfVOGw/WoiM58EIRsLcAJRYv7VI bOJ1db4q8+h5vqPdG0qjgWzSYrN8vDjcpgogWal6jEkjQzvFNbTc06Kf9GK+4h/X0suj pP0vnEZs3NVlq10fe+Qb2hHqO3gISabuigmjBYOWcW1ew408T7qBVoRCGE3CvHPt7R/u gxvd9MFmfMO3DKDaEBF3FsqKRhjbBRjMCeHPRJlzh2zHng/oREeK47PUVJCgOKIwj9YV o+4KLVKjs68JEGcSSXCkmAX7hr7lNjvZeRcs1NB3xUKTALJUO0NwpOfJXVLKsQdCaatb 61lg== X-Gm-Message-State: AOAM532rKDEZaSwsIlWuzstfsnQ2WWDWISkAsV4aPnAbEhG19gC4Xs3D t8dYdm+njmx1GBHckRmtW1Hpz0nQGziNxg== X-Google-Smtp-Source: ABdhPJwTNwA4nnN/Xr4auPxOktkRWnHAC/T0HWYxwkDqtNIPQ+4qTJkJJinhKg6IWyzXOJBIi7u7tw== X-Received: by 2002:a17:902:9a04:b029:129:7769:2b01 with SMTP id v4-20020a1709029a04b029012977692b01mr31621654plp.76.1625931130118; Sat, 10 Jul 2021 08:32:10 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 38/41] accel/tcg: Split out log_cpu_exec Date: Sat, 10 Jul 2021 08:31:40 -0700 Message-Id: <20210710153143.1320521-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Split out CPU_LOG_EXEC and CPU_LOG_TB_CPU logging from cpu_tb_exec to a new function. Perform only one pc range check after a combined mask check. Use the new function in lookup_tb_ptr. This enables CPU_LOG_TB_CPU between indirectly chained tbs. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 61 ++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 0d92698030..67ed25beb9 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -175,6 +175,36 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, return tb; } +static inline void log_cpu_exec(target_ulong pc, CPUState *cpu, + const TranslationBlock *tb) +{ + if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_CPU | CPU_LOG_EXEC)) + && qemu_log_in_addr_range(pc)) { + + qemu_log_mask(CPU_LOG_EXEC, + "Trace %d: %p [" TARGET_FMT_lx + "/" TARGET_FMT_lx "/%#x] %s\n", + cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc, tb->flags, + lookup_symbol(pc)); + +#if defined(DEBUG_DISAS) + if (qemu_loglevel_mask(CPU_LOG_TB_CPU)) { + FILE *logfile = qemu_log_lock(); + int flags = 0; + + if (qemu_loglevel_mask(CPU_LOG_TB_FPU)) { + flags |= CPU_DUMP_FPU; + } +#if defined(TARGET_I386) + flags |= CPU_DUMP_CCOP; +#endif + log_cpu_state(cpu, flags); + qemu_log_unlock(logfile); + } +#endif /* DEBUG_DISAS */ + } +} + /** * helper_lookup_tb_ptr: quick check for next tb * @env: current cpu state @@ -196,11 +226,9 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env) if (tb == NULL) { return tcg_code_gen_epilogue; } - qemu_log_mask_and_addr(CPU_LOG_EXEC, pc, - "Chain %d: %p [" - TARGET_FMT_lx "/" TARGET_FMT_lx "/%#x] %s\n", - cpu->cpu_index, tb->tc.ptr, cs_base, pc, flags, - lookup_symbol(pc)); + + log_cpu_exec(pc, cpu, tb); + return tb->tc.ptr; } @@ -222,28 +250,7 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit) TranslationBlock *last_tb; const void *tb_ptr = itb->tc.ptr; - qemu_log_mask_and_addr(CPU_LOG_EXEC, itb->pc, - "Trace %d: %p [" - TARGET_FMT_lx "/" TARGET_FMT_lx "/%#x] %s\n", - cpu->cpu_index, itb->tc.ptr, - itb->cs_base, itb->pc, itb->flags, - lookup_symbol(itb->pc)); - -#if defined(DEBUG_DISAS) - if (qemu_loglevel_mask(CPU_LOG_TB_CPU) - && qemu_log_in_addr_range(itb->pc)) { - FILE *logfile = qemu_log_lock(); - int flags = 0; - if (qemu_loglevel_mask(CPU_LOG_TB_FPU)) { - flags |= CPU_DUMP_FPU; - } -#if defined(TARGET_I386) - flags |= CPU_DUMP_CCOP; -#endif - log_cpu_state(cpu, flags); - qemu_log_unlock(logfile); - } -#endif /* DEBUG_DISAS */ + log_cpu_exec(itb->pc, cpu, itb); qemu_thread_jit_execute(); ret = tcg_qemu_tb_exec(env, tb_ptr); From patchwork Sat Jul 10 15:31:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4498DC07E95 for ; Sat, 10 Jul 2021 15:51:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD5B761185 for ; Sat, 10 Jul 2021 15:51:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD5B761185 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:56226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FGZ-0005mG-0E for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:51:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Exi-0006IF-0E for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:14 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:38572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2Exg-0002Uv-1B for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:32:13 -0400 Received: by mail-pl1-x636.google.com with SMTP id u3so1516029plf.5 for ; Sat, 10 Jul 2021 08:32:11 -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=UL9lKIoQlLvt7I/sySzh/3RjeNWeRLX3v5RFNYO4U8s=; b=fkm12orOgtnCIcCvbwfe3RBI3AOfFHzqmJ9C8Pc3tQf/z5Jp59EnxRiFFtwQgoyOFe +SxWfujgMW4KXRTX1h/y57sk6M/XpybCTZGl5sLIe+VrkZOITR3NZWY0VV5622EVwlP2 /uBULXrd5ONjCPieN5yNdK9bjAc1k2KGxVmsDnt5eVOxFBhrHJ8AS7NkSG4hNlZeVJDw bvbHv6/DKJnHN/fN4g7CyDXHNEJkKWH1iJJ8AeusUjIZTKgNm+oBDmkVsIf91sIrs7BJ 69T26IATvjEIahL2NO1Wvl7RgVZMvE+R8k9sitcsUX2YDc3jiOL0s2Jj09Cr5rFOp/Ve 9+5g== 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=UL9lKIoQlLvt7I/sySzh/3RjeNWeRLX3v5RFNYO4U8s=; b=tilAxQ/pufQh8IYiWWRH/xPxnQtW4nIysQrUjWXBGLn/fLIfo0yoZtqxqBbsDbNgmE 47OSnUw950houTilo3RLfJ3q8/rwhu27Jtk8xUtari+l4eJvgplM3cxmVJQclTEX9zKW 6QrC76gTGwVriz9LZwOZHeuk9zweMjrFaS08NaGHkUyVFJLmKpxnD27CBw57i7YSL+lS 5VBoUZUHl+2YyOxl70SBlG53LrQzrW/ZVmh0LUpMr28gzNlXQvYj1KHMbZWERCQ+pNYT AAfF8drweAnaqaSsqq/6jxGtUSz+mDcYqE2+NElxcl9OPtXAEm+Y+WJMuqn1A7HgmlcZ maBQ== X-Gm-Message-State: AOAM530zOR/POhWxOSu/W6/BljDDPqvJVmMg0AUmlyd8+xI9F4zfuZO/ IWDusoBRfY5yIVh+YJBsfHod0kDWH8fsxw== X-Google-Smtp-Source: ABdhPJw5LdPL6PltHOLLdg1Cz2sOWWmTtqf0c2ODLnlCDumKCpaLYXsggnnc5CKEvcYRX4hvIO1Z9g== X-Received: by 2002:a17:902:9006:b029:107:394a:387 with SMTP id a6-20020a1709029006b0290107394a0387mr35855632plp.35.1625931130708; Sat, 10 Jul 2021 08:32:10 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id u23sm11975374pgk.38.2021.07.10.08.32.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:32:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 39/41] accel/tcg: Log tb->cflags with -d exec Date: Sat, 10 Jul 2021 08:31:41 -0700 Message-Id: <20210710153143.1320521-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 67ed25beb9..e22bcb99f7 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -183,9 +183,9 @@ static inline void log_cpu_exec(target_ulong pc, CPUState *cpu, qemu_log_mask(CPU_LOG_EXEC, "Trace %d: %p [" TARGET_FMT_lx - "/" TARGET_FMT_lx "/%#x] %s\n", - cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc, tb->flags, - lookup_symbol(pc)); + "/" TARGET_FMT_lx "/%08x/%08x] %s\n", + cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc, + tb->flags, tb->cflags, lookup_symbol(pc)); #if defined(DEBUG_DISAS) if (qemu_loglevel_mask(CPU_LOG_TB_CPU)) { From patchwork Sat Jul 10 15:31:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368773 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA137C07E95 for ; Sat, 10 Jul 2021 15:52:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F19761221 for ; Sat, 10 Jul 2021 15:52:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F19761221 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FHk-0000PV-G0 for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:52:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2F0d-0007wf-6j for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:35:15 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:39690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2F0b-0004ET-6G for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:35:14 -0400 Received: by mail-pj1-x1032.google.com with SMTP id p14-20020a17090ad30eb02901731c776526so7668766pju.4 for ; Sat, 10 Jul 2021 08:35:12 -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=86TtjrEbriXGpZEXnuTm5RRc+rJIXXR9ggO6OBw5ugM=; b=Qwj4aO2IhKWIyIisKHcIG8j953sZ0G+ruToLUDQmBIRi5nCwt4Pwwg6IzgGTmU66hf 4quYCRfN1p1EkxSxUGhe6PH9KA7Ady6VFzQxOUAlMnftarvtO/1m1peez1BiuL3+w44m W4F21O2TIOaLGUovp1BH7SOz1/YLR+ZX4Tv9Aqg15kgCoTo1kfpnGZm1SMqx+XtdhwyW 0meGOQnge0JtXu4flYp3kozoW4ROgvG7T4s5v5mygN111yE0oFIoV2BRKIgiavP5U9QL TAuOPom9TdU0MuWC4rDNewY9NMOCabkOm47QVh4aqpqtQQEhMtnZYjjf+BLW4Twnv4pw aPtQ== 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=86TtjrEbriXGpZEXnuTm5RRc+rJIXXR9ggO6OBw5ugM=; b=BU+XUCjkmyQB/oUF2PBNE/47gTUQRlZGRuq9NkSF2lObsxj0PQxfBHLNXk79KbJJay m+GCN2iGjltO8fX+1targgSpR7MWQDrf5ANKfUb2IuwHFPlIVC5cJQ2l/30v5/Xn4rhW Bb4GUoicA0iTsK4wfMPxd4JfjPo1ZK/N0ydaD7zwxaElj1If+p8yA6cKcBQBhFeBi3zg Mp2sIBTzDFtRelQGwSKkPY904dSTTdEZRB3lv/FKE9vOYjRFPN5CKnGjWk5JG0vu+a2n 1Xs76w1j+T1cn5bUhHkCROqnut622XO9bc+n5j048866EXEZqy1CNiKOroRuHYmirBvH hmZA== X-Gm-Message-State: AOAM531bb0vZf5uduXBw46kl4w9NqHuQoHO/F4KThCPpDCD3lMnDoFrt 8Aa9gtTfj7iIpeDjdVYeQBtrWWVgNYfLXg== X-Google-Smtp-Source: ABdhPJwpjlswvXCtkfk+ZzDYpGNSizdvNLHkCD0/rtcszw6YWNPxv7WTEfPW+XSFzQRbxFZEuvt/7w== X-Received: by 2002:a17:902:b113:b029:128:cec4:e01e with SMTP id q19-20020a170902b113b0290128cec4e01emr35895227plr.78.1625931311826; Sat, 10 Jul 2021 08:35:11 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id cx4sm7966136pjb.53.2021.07.10.08.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:35:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 40/41] tcg: Remove TCG_TARGET_HAS_goto_ptr Date: Sat, 10 Jul 2021 08:31:42 -0700 Message-Id: <20210710153143.1320521-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Since 6eea04347eb6, all tcg backends support goto_ptr. Remove the conditional, making support mandatory. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-opc.h | 3 +-- tcg/aarch64/tcg-target.h | 1 - tcg/arm/tcg-target.h | 1 - tcg/i386/tcg-target.h | 1 - tcg/mips/tcg-target.h | 1 - tcg/ppc/tcg-target.h | 1 - tcg/riscv/tcg-target.h | 1 - tcg/s390/tcg-target.h | 1 - tcg/sparc/tcg-target.h | 1 - tcg/tci/tcg-target.h | 1 - tcg/tcg-op.c | 2 +- tcg/tcg.c | 8 ++------ 12 files changed, 4 insertions(+), 18 deletions(-) diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index 993992373e..675873e200 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -194,8 +194,7 @@ DEF(insn_start, 0, 0, TLADDR_ARGS * TARGET_INSN_START_WORDS, TCG_OPF_NOT_PRESENT) DEF(exit_tb, 0, 0, 1, TCG_OPF_BB_EXIT | TCG_OPF_BB_END) DEF(goto_tb, 0, 0, 1, TCG_OPF_BB_EXIT | TCG_OPF_BB_END) -DEF(goto_ptr, 0, 1, 0, - TCG_OPF_BB_EXIT | TCG_OPF_BB_END | IMPL(TCG_TARGET_HAS_goto_ptr)) +DEF(goto_ptr, 0, 1, 0, TCG_OPF_BB_EXIT | TCG_OPF_BB_END) DEF(plugin_cb_start, 0, 0, 3, TCG_OPF_NOT_PRESENT) DEF(plugin_cb_end, 0, 0, 0, TCG_OPF_NOT_PRESENT) diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index 551baf8da3..7a93ac8023 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -88,7 +88,6 @@ typedef enum { #define TCG_TARGET_HAS_mulsh_i32 0 #define TCG_TARGET_HAS_extrl_i64_i32 0 #define TCG_TARGET_HAS_extrh_i64_i32 0 -#define TCG_TARGET_HAS_goto_ptr 1 #define TCG_TARGET_HAS_qemu_st8_i32 0 #define TCG_TARGET_HAS_div_i64 1 diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 95fcef33bc..d113b7f8db 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -148,7 +148,6 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_mulsh_i32 0 #define TCG_TARGET_HAS_div_i32 use_idiv_instructions #define TCG_TARGET_HAS_rem_i32 0 -#define TCG_TARGET_HAS_goto_ptr 1 #define TCG_TARGET_HAS_direct_jump 0 #define TCG_TARGET_HAS_qemu_st8_i32 0 diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index ac10066c3e..b00a6da293 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -135,7 +135,6 @@ extern bool have_movbe; #define TCG_TARGET_HAS_muls2_i32 1 #define TCG_TARGET_HAS_muluh_i32 0 #define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_goto_ptr 1 #define TCG_TARGET_HAS_direct_jump 1 #if TCG_TARGET_REG_BITS == 64 diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index e81e824cab..3a62055f04 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -136,7 +136,6 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_muluh_i32 1 #define TCG_TARGET_HAS_mulsh_i32 1 #define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_goto_ptr 1 #define TCG_TARGET_HAS_direct_jump 1 #if TCG_TARGET_REG_BITS == 64 diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index c13ed5640a..0943192cde 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -108,7 +108,6 @@ extern bool have_vsx; #define TCG_TARGET_HAS_muls2_i32 0 #define TCG_TARGET_HAS_muluh_i32 1 #define TCG_TARGET_HAS_mulsh_i32 1 -#define TCG_TARGET_HAS_goto_ptr 1 #define TCG_TARGET_HAS_direct_jump 1 #define TCG_TARGET_HAS_qemu_st8_i32 0 diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index 87ea94666b..ef78b99e98 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -85,7 +85,6 @@ typedef enum { #define TCG_TARGET_CALL_STACK_OFFSET 0 /* optional instructions */ -#define TCG_TARGET_HAS_goto_ptr 1 #define TCG_TARGET_HAS_movcond_i32 0 #define TCG_TARGET_HAS_div_i32 1 #define TCG_TARGET_HAS_rem_i32 1 diff --git a/tcg/s390/tcg-target.h b/tcg/s390/tcg-target.h index b04b72b7eb..2e4ede2ea2 100644 --- a/tcg/s390/tcg-target.h +++ b/tcg/s390/tcg-target.h @@ -98,7 +98,6 @@ extern uint64_t s390_facilities; #define TCG_TARGET_HAS_mulsh_i32 0 #define TCG_TARGET_HAS_extrl_i64_i32 0 #define TCG_TARGET_HAS_extrh_i64_i32 0 -#define TCG_TARGET_HAS_goto_ptr 1 #define TCG_TARGET_HAS_direct_jump (s390_facilities & FACILITY_GEN_INST_EXT) #define TCG_TARGET_HAS_qemu_st8_i32 0 diff --git a/tcg/sparc/tcg-target.h b/tcg/sparc/tcg-target.h index 86bb9a2d39..c050763049 100644 --- a/tcg/sparc/tcg-target.h +++ b/tcg/sparc/tcg-target.h @@ -121,7 +121,6 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_muls2_i32 1 #define TCG_TARGET_HAS_muluh_i32 0 #define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_goto_ptr 1 #define TCG_TARGET_HAS_direct_jump 1 #define TCG_TARGET_HAS_qemu_st8_i32 0 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 7b6089f304..033e613f24 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -87,7 +87,6 @@ #define TCG_TARGET_HAS_muls2_i32 1 #define TCG_TARGET_HAS_muluh_i32 0 #define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_goto_ptr 1 #define TCG_TARGET_HAS_direct_jump 0 #define TCG_TARGET_HAS_qemu_st8_i32 0 diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 44d711c0fc..3d5db9a33c 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -2754,7 +2754,7 @@ void tcg_gen_goto_tb(unsigned idx) void tcg_gen_lookup_and_goto_ptr(void) { - if (TCG_TARGET_HAS_goto_ptr && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { + if (!qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { TCGv_ptr ptr; plugin_gen_disable_mem_helpers(); diff --git a/tcg/tcg.c b/tcg/tcg.c index ed86a70b79..4142d42d77 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -789,9 +789,7 @@ void tcg_prologue_init(TCGContext *s) * For tci, we use NULL as the signal to return from the interpreter, * so skip this check. */ - if (TCG_TARGET_HAS_goto_ptr) { - tcg_debug_assert(tcg_code_gen_epilogue != NULL); - } + tcg_debug_assert(tcg_code_gen_epilogue != NULL); #endif tcg_region_prologue_set(s); @@ -1176,6 +1174,7 @@ bool tcg_op_supported(TCGOpcode op) case INDEX_op_insn_start: case INDEX_op_exit_tb: case INDEX_op_goto_tb: + case INDEX_op_goto_ptr: case INDEX_op_qemu_ld_i32: case INDEX_op_qemu_st_i32: case INDEX_op_qemu_ld_i64: @@ -1185,9 +1184,6 @@ bool tcg_op_supported(TCGOpcode op) case INDEX_op_qemu_st8_i32: return TCG_TARGET_HAS_qemu_st8_i32; - case INDEX_op_goto_ptr: - return TCG_TARGET_HAS_goto_ptr; - case INDEX_op_mov_i32: case INDEX_op_setcond_i32: case INDEX_op_brcond_i32: From patchwork Sat Jul 10 15:31:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12368739 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22711C07E95 for ; Sat, 10 Jul 2021 15:42:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D8AF661175 for ; Sat, 10 Jul 2021 15:42:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8AF661175 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F83-0001Qs-VS for qemu-devel@archiver.kernel.org; Sat, 10 Jul 2021 11:42:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2F0d-0007xx-G9 for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:35:15 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:37434) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2F0b-0004Ev-SO for qemu-devel@nongnu.org; Sat, 10 Jul 2021 11:35:15 -0400 Received: by mail-pg1-x536.google.com with SMTP id t9so13198515pgn.4 for ; Sat, 10 Jul 2021 08:35:13 -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=E/MTlm5POUZQMp7Vf72rfKOh2eap4oJEXTCEaGTp+rQ=; b=n5dQdGQaSiKXYF7ql9LUYN7V4c77oIDJLu7nrR+z695H+Czap24F+rIlgeCGnSN4cL 4/ssu/Eg38amNfS9MmH3JZbmBeG3GY6UAQ5ZIKFJrIgM1gKMTxE8gaw5NNYY35Jefkxs OSun7FQ4jKoyfLnFIaNGGzoul+2iZQMSkCfqKH3MqMLni4TBCYl/DBmslB6mGTan28u5 hXGwN4jMfM0d5GggnaeyEL7cSFN7yuxKfAXjtLPyqY8QO1sWbk8Lno+NuSS8ceURdZHD Di47xA5QTYCRcGVPOZ06kNMhM5dhbO+V1pg9zfBdOVgnF22a2+oybP82fp5AtzwVOwFw cVkg== 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=E/MTlm5POUZQMp7Vf72rfKOh2eap4oJEXTCEaGTp+rQ=; b=BNWfrddjIxzUWtssJOgilC5CXitxKLYmqbjanMppm4mbHx0Ndq6mxUl3SWRtH9eIf/ rnchiwxT6hM4ZOd3TcfMpd8+fo3IwtYJJbjDKbrHrBBYd0O3n2fZMNtD04LRnmm7+umO WbMHr9KwK4g8kEa2eADa0Y0o3hIowogCoaCVr70W+MEI6IZ9noVO99n2wa7p03Z3B64D 9aOzSkVpHVxcSBEj6NpiieKigVyHLNdJgufJ639PSVxD7qdjrmziwQWDWll++dzDFniG SzRiQqjkVbqXOZsAX20/X0rOz13QEazWcNVrs6sC/LFlPKteaKneLrO72pHfSTi5hRhV WvVg== X-Gm-Message-State: AOAM530zgQe9G/xhLYi3fYypHIc15LrC3fsVBPi07/p6R3qTYInTG7eP j6oTfAecdqf5K69somNtuxlgcqq8aC0FzA== X-Google-Smtp-Source: ABdhPJz6ijAW8RZ3nwmQLJ5rtCHDyFEA9WuYL7ILlFYgz0l3Rq1jl0VtXMUTB+K911rmIYGWrUV6Ew== X-Received: by 2002:a62:a107:0:b029:328:a1c6:5736 with SMTP id b7-20020a62a1070000b0290328a1c65736mr11158412pff.61.1625931312449; Sat, 10 Jul 2021 08:35:12 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id cx4sm7966136pjb.53.2021.07.10.08.35.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 08:35:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 41/41] cpu: Add breakpoint tracepoints Date: Sat, 10 Jul 2021 08:31:43 -0700 Message-Id: <20210710153143.1320521-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710153143.1320521-1-richard.henderson@linaro.org> References: <20210710153143.1320521-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- cpu.c | 13 +++++++++---- trace-events | 5 +++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cpu.c b/cpu.c index 164fefeaa3..83059537d7 100644 --- a/cpu.c +++ b/cpu.c @@ -38,6 +38,7 @@ #include "exec/translate-all.h" #include "exec/log.h" #include "hw/core/accel-cpu.h" +#include "trace/trace-root.h" uintptr_t qemu_host_page_size; intptr_t qemu_host_page_mask; @@ -285,6 +286,8 @@ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags, if (breakpoint) { *breakpoint = bp; } + + trace_breakpoint_insert(cpu->cpu_index, pc, flags); return 0; } @@ -303,13 +306,14 @@ int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags) } /* Remove a specific breakpoint by reference. */ -void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint) +void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *bp) { - QTAILQ_REMOVE(&cpu->breakpoints, breakpoint, entry); + QTAILQ_REMOVE(&cpu->breakpoints, bp, entry); - breakpoint_invalidate(cpu, breakpoint->pc); + breakpoint_invalidate(cpu, bp->pc); - g_free(breakpoint); + trace_breakpoint_remove(cpu->cpu_index, bp->pc, bp->flags); + g_free(bp); } /* Remove all matching breakpoints. */ @@ -337,6 +341,7 @@ void cpu_single_step(CPUState *cpu, int enabled) /* XXX: only flush what is necessary */ tb_flush(cpu); } + trace_breakpoint_singlestep(cpu->cpu_index, enabled); } } diff --git a/trace-events b/trace-events index 765fe251e6..c4cca29939 100644 --- a/trace-events +++ b/trace-events @@ -25,6 +25,11 @@ # # The should be a sprintf()-compatible format string. +# cpu.c +breakpoint_insert(int cpu_index, uint64_t pc, int flags) "cpu=%d pc=0x%" PRIx64 " flags=0x%x" +breakpoint_remove(int cpu_index, uint64_t pc, int flags) "cpu=%d pc=0x%" PRIx64 " flags=0x%x" +breakpoint_singlestep(int cpu_index, int enabled) "cpu=%d enable=%d" + # dma-helpers.c dma_blk_io(void *dbs, void *bs, int64_t offset, bool to_dev) "dbs=%p bs=%p offset=%" PRId64 " to_dev=%d" dma_aio_cancel(void *dbs) "dbs=%p"