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: 472331 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1361786jao; Sat, 10 Jul 2021 08:32:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh0PuOrT1R4i2BLROwbn5FKMqmCeyl5qUcEnjiGUihCUo8lKGHRq7DeIZkXa1DoCHepVru X-Received: by 2002:ac8:5a94:: with SMTP id c20mr18500213qtc.30.1625931152972; Sat, 10 Jul 2021 08:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931152; cv=none; d=google.com; s=arc-20160816; b=At4hZkKK+FJZlXRzd/HsTzRjCJppm+k1910nuj6SlCvjH98o9hudwU8RDrK3WDhrdS 8RXSMey9Mic4BSaFEWLGQBtSLwDg90gN4GtvF2wPoVus/cu3FI5IIx8h2X55YCnLfvMD LJCsDQaQ236mczXq7GyMFiVi15dd/btWiPTLBYTybZcYN1r3rCw2IPNASTGunn4DLsUm ylDsB7gupofTvM+lQKEJAMpgIke3p17CMTA/MFzbH2xFk4u/ks2z/kKO1n+UxO9zMCSe GprRqcJU55c1n7578HGdOzwGmpS0OC/cXsTUSCLx7NfFiHUtklt1P9MASw/mLYezYmJP 0lIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=6CQ6Qnqlq6xTqG9WUDwZDgwIT9JsVyB41tajyHgQO/U=; b=FWE61+aVF0N4Cny3U9ruV5SwYQ0K4/f2F4AFQZ1lT5SYGvlrAPNS1l9/kLl2GqrVKm O+CybB5jSgIZw9kC2OZQ9WIaO8w9aB7g9CaA+2paOHzBJlR6EnU44VcM/akwHgu2FgMN VaY7oP4TAq2iAGyhJfLxfIMbr5anh+kHJIWWSFBldeXNX5KzlqJRv8JXXDO2zMOvYI7L qUXIzkWBndbW8uCGclh5DHgHSzGV842aB42ByatuTrPlmpxtvrKucgF7d6XuAEk8THUs l8uqiU5EFgD4qjcg+4YlKSs/DeM7hBVN0CO/xj6QZTBBUC3Ksq0HAZpYb2jLoyIIwDH+ R1Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OaOa9Dcr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q11si8761237qvc.37.2021.07.10.08.32.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:32:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OaOa9Dcr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Ey0-0004xh-8X for patch@linaro.org; Sat, 10 Jul 2021 11:32:32 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472337 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1363974jao; Sat, 10 Jul 2021 08:36:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhTUvKgOSo2yOVtStYWc0w+QlDmWugwgMdIFIyak/UuMMyzfBEU+d0+VraLcksKEZiV0rQ X-Received: by 2002:a92:d451:: with SMTP id r17mr8885203ilm.109.1625931371385; Sat, 10 Jul 2021 08:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931371; cv=none; d=google.com; s=arc-20160816; b=WGtN9EU5n62eFc/8S6ZP+N/rQOVoj/V4PRNw1rWK5HHAV5X6uqU5y3K6Xw52ybx0CR qrEJ3jvGN3zchSz2mJ68N81p2PGscSv6aBPPJHdCyM8ERUX+73mXWekPQkF9FDwnXfKL Z29ui9Ji/WFdt9j1prJ0HHoQnESjeK9tWcmh8oODjvJ7cqyjpryNEERH+1ymnwfVO5Cq NmTSPuvwDoVpdIxV3mnTIl7b4VlXTH1WGgft100xtnBwiWHCKCODUno7OkGHAUqbo811 R19WQUFMSfQ9kLEpqzjlHsEDQu9MDEhTbhmQcy436jsYFFR2TsPJLKvA3C5CYjTPBBnD cIZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=e4JQCoLagiwo+NLZJ+PbMyT1KAOuchSbSiU5YOPxFFA=; b=WjTgNc1FA1vPVqQa9TdGBi40sn0Iblw5T7ZEqVr12V0N7eNGYe+8KcQIKq+Yb2GuS4 Wn5pux603t2jbaGqvKgCgzeETgMgg4ettIznjYsmW768DP6RCoUOcprjEaHULg2xd76T PoH/SixLtb9i0M52ph9BNvwHuxCby3ax37CHoSupNRen9mQWz1TnQTtosa0mseiTTrc7 KHZvitBwcKyf12p2Q0d86PLnzHiO7TWRPzH7C+AceX8SUHNiJ6N3tHRTr+2nXZ0OwjZF 8RS6UqZBHWYPOrcizeDPRgj0k5AIbXQHITpqBCa6EftDgGDrymBKm0lR8sgpallQDRot nbPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=trAzHBpt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a23si9820914jal.6.2021.07.10.08.36.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:36:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=trAzHBpt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F1W-0008Ch-Ol for patch@linaro.org; Sat, 10 Jul 2021 11:36:10 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472333 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1362646jao; Sat, 10 Jul 2021 08:33:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAp/wPcpIFycvKM8SnAEtCLmwXD1HqKUyKpMPHP5ygscuJEgRy5w5C4wLWi9DZh0U2DrIZ X-Received: by 2002:ab0:906:: with SMTP id w6mr32500593uag.37.1625931235142; Sat, 10 Jul 2021 08:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931235; cv=none; d=google.com; s=arc-20160816; b=Ix9jPoSFU3BUlosqdfd1guveCEY8Sk/pAOgRl2zEMklVLVxgoqSNB1XWGCxgzq0sua Cc7d9lr1FYua9XYto5U/0r7sm2HrBGCTcJk+Du+VDJVIOy3uC0DFpT3ZygBZ7O2HNM67 c51HonhbDQOHyiAOWgzsl0oDKKY6LaQMoShBCBwNARCvCxeiecanS/6cbKYedTv4QtLy jWy/3gaEM7bL6Sj5TyVkDzSln6689Kvps+ag/wGXHgZXBqaYm6fcqaW2PBzuAUSDPiSr k47KJr9Fn5Xb+gXXK0I3E4/QT9Rmh5H2ZXS+esS1+5Ow8XXSSjiZLQ8jQfHwQ8Adsa8i 2l0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=VN95zM/QiA1dKqmcNx9SH5nqAvJGbQXCoyX6bpKYZ80=; b=qwIIp8Fq9DpuqOt6rxgcK2KLm3T57PYJYEkjrsHLCReBZkXQUiGXRcWOzfgFMO3ZdS tEhggZawiQKWL/lPi0EU1OgqHWl7/6YY4qMTJzG1caeHja9jb088R/qWiHwLdHgD+kOD vNre03nrn5upfUJAIQYip6DKAn+1plw+xjooei3llJs4nT6537wAtpDNOM1xCluy8+3P 6OQzEZzCoktGGOOe2eOOSfie7WCEcpjJAx6NYYRW9zlpnG1smfEfBhzrqfOKEs/j+EP9 AHH2i7fTDwEsnejpu3QjL6yQtHyGz6smrVVABTF8c52OwQxm76OogBhb1rAoN+w9UcZ3 Jcvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xwApZ3sX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z26si1620565uaq.67.2021.07.10.08.33.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:33:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xwApZ3sX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2EzK-0002dT-GV for patch@linaro.org; Sat, 10 Jul 2021 11:33:54 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472332 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1362642jao; Sat, 10 Jul 2021 08:33:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmYCayltwrY8hxdzrC0bsa4nk6imeOiLt7K49/va42/SXEzBdmQJr3BsnnSwyD2q+O7ZhK X-Received: by 2002:a92:5409:: with SMTP id i9mr30531647ilb.138.1625931235030; Sat, 10 Jul 2021 08:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931235; cv=none; d=google.com; s=arc-20160816; b=SQAjpyDmmHyaUTuBakydRytDnqfpqCRO7sjDcd803+jclTa9SnGRQsS6snuSmMZ1Va PFSaRAdS2GvTL4DxsT5zxTec6Q8AafvHV7+dFnYD04xNakCBZvwsF4inOm2iu+1b08hC HkDec+6IjfmqYYoBBURp31Gj7XNXja4J3PImm9MvH26BNjMz92ExnC4hf0gweYOti2gn YhMDeMzxIGdggDD3GnyWBdX22dTpGeV32lELTGaVg1ykj0TXus2rlSUakLi1eJKodsgd yKLeyWqMtJNGqTzetfXqe99GLGiRMVMxulS6PHUmYoAJVbyc1vvldeThhWjvU541WDxQ y0/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Y3lANsHAiYr3NfirOwYT3hcp5c4TVyMIYJgJoxKd7BA=; b=lD1S5aAVC73wcUIgvMrif2lNVVbKOHZrRJgabG6CBrN5t9k/OBcZOiH9a0Qd8CTOED xbv0/trxq0PVNS5fWQdqjAQMaozxuSWY7kLQ4QLfabGh/aVcYzKn7uJfrK3f0iHjrzF0 GuH40Le3RkvXJReWb33flkNUH+9yEWCD9iKWmxa6JM2PxYtyNPZoOftzUxZOXm4AQC9x 09E9Cr6kI8IrfXKqB6hrwcN9PoZlM0/oG5YArH2LQzNBBFN7hNPPbCqHKgfUYyWkp0F6 szd6gt1jwMjhPq6SnsrhKcpLr8KoUl+HhGbnWWv05lL6FWbpAsAPKp8uxr/dWTwNvneQ KHEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZNFS46LO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h16si11239872ilc.129.2021.07.10.08.33.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:33:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZNFS46LO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2EzK-0002cw-GC for patch@linaro.org; Sat, 10 Jul 2021 11:33:54 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472338 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1363978jao; Sat, 10 Jul 2021 08:36:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkBn5/DeFLLWvQ1Sb+N1zDJc95jlNbWYkDSSJYftmaecFlbW5DZJ1UMAyNinl2NthuSlBL X-Received: by 2002:ab0:4128:: with SMTP id j37mr42771096uad.79.1625931371572; Sat, 10 Jul 2021 08:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931371; cv=none; d=google.com; s=arc-20160816; b=ocwRtvtMXQyFc6oilVZURnS2EXnbNvuG2bRBKROzjgUSFSopWnZAuhpcyFbgqbG8Yr Nv76uC6ZMiq58T3xmN9/5RXs3vcTwJWHNk1RvagneIxutnwmXbyf41XP52Hkbs96jAUy zEIM8iKbSR0MEfQpIaINeHq3pNQSw+0HTAOQz8+OAqj5vmjdpOT7v2/g71EvGPbf/8Fb VZk3ig3knP4IcIjfGRqzfAnNchaRhGEwKMsZQsnlz6eWlvby7EWTo+EZLEspZtVWcKZ4 1d3scI5J04g7BwxHQl//8c1suDJc04hCzD14vbm+TD3iNiXCQzW2c0Y0/9FWoRVXcMJZ 1K5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=wPpFfUs4h86ewu3F3iemYnJMaalb1kmHYOs+LuBl5DE=; b=p30SWnKIVIy8p29I9rcN+WL/U2zUJZYquuIesJ2v+VjI5XgFF8iI2gPj9mHnncaewv AxbcAwpFYrWPp3OM0BZpWxmwcxhdXiVIkKVPBro3RxdQfzfFJNk9Cpl+dn0PPrTYAyC1 d6B8ZrQ3U031rgp9Q61gyYtYLNOmx3EdJVRsrDiWxR2nPnZLmsYQ5+ckR5prX3ZVuI8t 4uRabYziQURg8q76vNc4QW/w0XbiQuaVsY9FNeX0GLeN5wBFo4QFjdqh7CzvhcB+BeJI fnOD8YTBBHoLQK90mOre2bi9bGHEQ/kdBa7K7ZUXk2e1lFhcRwFKGbpvUw6+YApzNmV6 mMdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PmrRTxuG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n10si10499168vsp.41.2021.07.10.08.36.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:36:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PmrRTxuG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F1W-0008GY-Ux for patch@linaro.org; Sat, 10 Jul 2021 11:36:10 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472329 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1361531jao; Sat, 10 Jul 2021 08:32:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzwKKZEI4ync6Q4gf8vR3vsU3e64PEE+fgAZ18icgJcQCzkaxLzK+OCPP64tE6vpgogD/k X-Received: by 2002:a05:620a:298a:: with SMTP id r10mr34787378qkp.268.1625931128271; Sat, 10 Jul 2021 08:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931128; cv=none; d=google.com; s=arc-20160816; b=eOLN81mf6ONmi+iAR3tPtKHMwuMvsBJ6ycgtnRELqMX7plT+/ufNl66Y6pgO3KWBNY ksMB91fNB3AHb1Ag/eOmk/8EyziNsDnd7lv7zW4OS5YGKtB72NbGt4Njv1qEw6xcQPDf qAvulfj6FS1oTePMPfujztPCxXxQCqGRhmHDhnCHz/HFIGILFoZ9KAu+ZwqOIjpHNnhO OyhVmslXNlGorkIwnQVLKHglIXSI0SbYtc9L4Rb2I5S2+FZEtSQe6mtTGYZj1J8yBe6U Z/RgXrISTSqi/sSb4OG2km4eizUeJgPt5XwZOyf+5nGi3v6zXHnTIJbM0z4xGwF0zVc/ NovQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=CYAA0gCcixaZvejCGIEmqi8brwY1zVT0feeRzB35ZxQ=; b=NuNhC9r+tZ8fJUtL/agctd3FOekmnpTI8dR0HijgIJQ1h7USiwpV0QFRTVWqU25sgb kZSidlPBmMfdV5EFFXAhHyNnuJx4m+DQImStWb4kcWY/Znpm3l1ElnZWY0bHQgZmCgz1 Z3paEL9yyY1+qRcVTjopBJlmzgL15FC9aOSJF/gg6QoFsIeqtXv4gI/xTe6DSJT7YznU mhlk0nYZwAEemmHsXrjca8gZk0mk0tqlKYJHQdBa18bDxEHTAZhS8Kjtsh1xp+C6LWqR 69K75B/XL9Rd0bpb64zw9nOPGLPGLsEFxK9Sq4ZZujdWfrmcfWaD6yhjB9T7RvFyLqN5 zcTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tED+WZ27; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 9si9078226qvs.115.2021.07.10.08.32.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:32:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tED+WZ27; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Exb-00055O-L0 for patch@linaro.org; Sat, 10 Jul 2021 11:32: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-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?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.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(+) -- 2.25.1 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: 472340 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1364875jao; Sat, 10 Jul 2021 08:37:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygcNgTQ+jSrTiFZgFZ8q2uSqt0I6lchIU5aov8jhjfrU1pQe5t8ywUAnMneZsSF+zxsHqU X-Received: by 2002:a05:6214:10c8:: with SMTP id r8mr41848931qvs.28.1625931456497; Sat, 10 Jul 2021 08:37:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931456; cv=none; d=google.com; s=arc-20160816; b=XTIM6TVUm+2e3781gVmrXVNJDHPSUU+yAH0rsH15LufmMiX6tXD8oyS4RcGkUqJCsT 3yUVDk1Hhke/PMn410P/1n1oPNUDfFKU3v8FQNnRTVlB7DXL62RgLXkb+sQVlzac/SBC UqDbTDFrxj9xyTO8zs34vqgo/ix9HX2tiPM/tXAEXr0P3JEiVpMcvJdskY4PfPGrbJi8 sVGVWADAUMcSQyfvuB5+DMsHG1TqeVm5uNWYcpldsO3VTk8Fg006Lu1NrYhvZu2KWdjL jV2M2WxXmdloKWqhpZz0lDa8GCGRqW9MQ4BET/+HqyCBY29y3r+WMY6nXOBA2oA3n2VF 2PAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=YLJ230I1oEo8wIMfdqq6LnEEYsPnK+bG8iGL/6v72HE=; b=LcrGIaADpeG++uvFh5m90SNmwPzc5uPYGcTDO8M1aHHvs6xZ9FtGvzTKN3OAb0NNg4 YBUjm+uaz4qeboCFAQeCPnAeKnxSRd11L4c2Dn/cPz8f3FRyhgZUMesHeGc1teHxBq0W 9pUoyAIatNmpHcLSmPfA5SMJEUtCfVQAJpx0aGO90aF8ZDMcwuwA0AqapVm/9m8Qrc11 sp7OUQ8o3QvRNv/N9bEmu54U5uCPH9x7aK3c1HA99SvGmQMQxrFE0fbgRLj0CNXJ3y/q 6JDuxhxIZjxTvDnq30hzTCs4fe0q2pcUM5bk56ARf+z4kBe+LIu3rpJ4qvai8hd0MQxW gV3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gVpAOqLn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b64si7714957qkd.267.2021.07.10.08.37.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:37:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gVpAOqLn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F2t-0005WO-RI for patch@linaro.org; Sat, 10 Jul 2021 11:37:35 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472341 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1365495jao; Sat, 10 Jul 2021 08:38:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbpbhMsfTMZXK1sgW55c+IWJWnV74vkDjVPRxJJsb5j13cNh91BfeUQ9Bl7wcmheeVU00b X-Received: by 2002:ac8:46d0:: with SMTP id h16mr11775894qto.362.1625931524439; Sat, 10 Jul 2021 08:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931524; cv=none; d=google.com; s=arc-20160816; b=rifjD7g5LXS2L/8Yev25zfV65iWtj39qRPTytgeAQJ9lxIIQNNoccPPqDrjwAFaWdX qNHFwUZdlzFuf3BB6oup3J16WH9UnUDRV1tGVrA5ngAmazNqnamdh/Naai0CQPkivB7U x9Cb3PzShRslCMRbKHWhU4+EDiPOnqs+9vyGxHgPmYDoGmBxVQxL8bOZ7IHzjmUDNwMe 1i1DPw0dC9SDrzp3hKmw9+XTVNYJTMwFcpPttgvYt9jjvpymX1+SzquFxGT/KgxpJ405 9QSYtYa+UcYhY6Y0d4YwsuXEjeCliYkTNCmaujFRU3BokRhFJCV6s3cLIKesxGcJFWsm lu3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=XCqRJMe+RdTFdeG7cM5qJnxRaVl12uLPvY3JnI4VuRk=; b=akgedz3AaJKUHaY+Z2AqYwZ7/gTeYSJi1wdWSKxrdLH7zBxQ6VUmDCVPLtXx3rKexG YuuZxN/8qVYOpGQKvwDvfi/4Jx/FXRNnFbSA/w6Cz5zqqtruF3MM39rD6qGrQGseGfQh +KcXUAubsmvD6Vd97cmFUVBGvJxRZhl3cG7aSsMk5s1Anc5XlVLEsn+tiiwQ3uZF60Yn uQOrKuK9Nj7q0X6l/9rDHfQOtdSoq0DY5HTUQZ/RxAyaWBuYadA8yvZWsyKwqoEdV2Ue V3mWFwwn4C2+9U0BOjOhdMqy/4ASfiM+tOvYp3wsMikWCTtdvhWitY0xh40djI9fXs47 8fkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nwlCfDEU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o69si8545380qvo.170.2021.07.10.08.38.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:38:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nwlCfDEU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F3z-0005YY-Qp for patch@linaro.org; Sat, 10 Jul 2021 11:38:43 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472334 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1362679jao; Sat, 10 Jul 2021 08:33:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXC5WLp+GLlLZkwgi96OUD+4T9qt7DttsnzOOL1eS7O77hB2aZwmKn+15aYVIq1c2C52iB X-Received: by 2002:a1f:c704:: with SMTP id x4mr37724853vkf.9.1625931238809; Sat, 10 Jul 2021 08:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931238; cv=none; d=google.com; s=arc-20160816; b=VQiy0dU3KSeqgtkOf4koqErMIsJioOw6/7Fo2hDkr0yoctFVNOhaxnoFoFKgSWnB+/ Au5/IkK8HWlq6EkacTNzYwPyRYg2QKkcfavRhiWyjzjclf9fGQ+jroE1cbknBQPn6F5B B115hNj+4KeZdfiCT/yck9NKNdfUwvv+DBTUy1towWsSBhkGN44MMOZlmT56JDba8iL6 i5LlWWLNW+10J5kCKu+ojhe4WEDWWKdW88ZDhcpxoaQuCmg2h000AHDwDZHTg0gZZv6+ Uc3QvBCzvlEuHVp2WQ578xy51ock7686cLstUeu/nVknM3SrPKk96kJHTX/0Uk860+Du 1Gug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=966eOOQRBaspjRNs052m7zB6E/T5XsOP0DeM1nAzdlc=; b=utkFlYS106bvnXF39Y4WJVQ7c0zMUqEfjAtZkXnazEJ1ejlM5QeNfeKXIjA0sWllzf uSj5bkp/4lbOqm8pK+B2KqzkMgEsGfxCosFFOmsT3ixnqGTZfetX6mNmm3LchiB3kNTn As4+HZDO1FB4g4NRLQZUschD/zgCf0Ir1eMpHh1R0PqQX+w730hh8cNrx+PvS+UcN9fj cCVcrwNUjxNIudttDhI5zuQ850vb/3/YLn76brK1hmU1z0tkGpe39cDnO91kDLtT038O k2KUna3Th+/7ALvyOVC4LPVGA/edCgpcrryeNl9iDOzdQYZlZiou7nCjiYoClfOEo1ll qbEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sQuD/u1b"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x23si10452144vsj.133.2021.07.10.08.33.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:33:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sQuD/u1b"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2EzO-0002pa-6I for patch@linaro.org; Sat, 10 Jul 2021 11:33:58 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472330 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1361565jao; Sat, 10 Jul 2021 08:32:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrls9Io/MQ12sDslihpFl8wkXDTd7YAnGPFp4MckA53Sr8JM9YDIRQwZWynmKFFMjFztPO X-Received: by 2002:a92:c543:: with SMTP id a3mr24136416ilj.303.1625931131466; Sat, 10 Jul 2021 08:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931131; cv=none; d=google.com; s=arc-20160816; b=SNIJW8UXL+S8H5BvBrj9Te6CjQhF/jHQzxBgtpBPYNzwccjKTSNUjDwu8xcSY+gnN2 j7mGQpqOj2nq7glRxenmwjFYSKuTPCNqVDNC6i8mAt0HEA0Bz8gOUhZ2g6KDZ9yuc6gV P7ztavSxbACbRw9sXRCmpXFq9vbJFBBY/qJ7F6XpoJtK0TXq7XghyZJllRfCrVh+7Vsj 2qTbeIN41NLRDPaODf7K8Di62Noohww6BBWz5qiWU+vRxKx+vNakKazdp25EnLv98DDP 4C5EriuheD313PPM+VzvVppuK9+7bIw7g2yATYR1vfc/Dwyo0NlOwFRXQWpr6GTCXXNq lX4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Cv9aQndI0rEwp95MS68py3M2LPMGPGCFK/5GDBRseGA=; b=Ow4rgJOV/3g0eIgrMcRCwz1OwlpEWq8Co+V9R5UD3Tzp3FJ6osRtkMpuHDPgGKDno5 UI2RkGNkxvQ0mx/Rh9FFMAj3QN/1JQ2HyStnk8p5kkSJETXRlnXOVdh1m4LF916Vachi AAJIHEBr3EO4stMlB/XmybU1YqFl1y8tG7TslLo6rbL7jYbOOONPPndi6orxZbbpDDmb NLfuJ+Z0LgKD0FRYDLgIgYihiLvdwEM5Ei3a1SKzv3AG0Nrn/4gAyhaU62TwjFUsMPLc AZGAHz/uFGqVitCytBDM2FFjEBtR3r0jPVgo+k4JETWQ8CsvCv39Oa5BOHvvOZOC6BJ7 QrHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kqrb0bDb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c26si10753991ioo.54.2021.07.10.08.32.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:32:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kqrb0bDb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Exe-0005Cz-Qo for patch@linaro.org; Sat, 10 Jul 2021 11:32:10 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472344 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1366571jao; Sat, 10 Jul 2021 08:40:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpNuQKI/EsBNGEaTSYhamzfkM5vsVDdDLgCaIQtzBWmRiWDE0iYfbgDwVfuoVa95RImg0N X-Received: by 2002:ad4:4e6a:: with SMTP id ec10mr3136545qvb.58.1625931634270; Sat, 10 Jul 2021 08:40:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931634; cv=none; d=google.com; s=arc-20160816; b=x1J8YmwDwVR9DSAu7+lLmfmuy8+ACpxE7U9dAk49zpQlPWffdUzWU/yWThM0vCbP1u Iq7Jg+YrTJbIe+FCSzZcPAoBxFNY2pnc4JcbcT4XdwswwxuxqSK1Jq/AVSOrMqBwrDhs yiDQVIIQ6sec2GNGGkAM4PUxUwdlXf/Uu6WoxUaKz+ZEWBwvne7LIA5aZROg5t3VXmeC uhKbNWAD3DvrfBAp4gRYuQtQQaUAn7rH13M9Im0xjFvLdh0PRxgpxgyP5gddRbh4EkWP 4xyqe+EU84RYDRaS2/b1qLQVMlAZDadzeznW9czCmLIsNhx04EB13hJ4HiZCELzZ/7h4 vnGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=z7Ncc5FKGICE8G9HC6MS3YW5C1jF/+Zh1RQa1f4ley4=; b=Wgw+34Dezl9b8V+RoBybqTFopZAOd4Iqy05SJpvbORj2cBcAW2qwXn1zp9wzSHrh8Q 6o4/PDAjX6XGHn3if9rt5trqxvgWrxd/jtGhdo+K0CAtWDxqKE1yZNc5geMh+Gr0XGgy lfOc3/l525+rxQZIK/4g5HBF/JqK/jUmEFMNUHbZ1aq/NoQL39kIrJ6B1MUKtwRpSb6u BRbtSnJsZaRIiLm59hyorFTCfiUT/L6HW3GKPIIAKosUistC65Kk7SLnWvr5AxZSdMOS LU5rbsqfCYOsrn64p0C/jUz/r4+P+jzaD/zRX1G597Fl3fwSpJfbn0wN2QR3E4DELuN6 viUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RANhMiEC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f1si8525566qvt.163.2021.07.10.08.40.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:40:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RANhMiEC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F5l-0002oE-IN for patch@linaro.org; Sat, 10 Jul 2021 11:40:33 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472345 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1367037jao; Sat, 10 Jul 2021 08:41:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKPDyJoM+iK2rdKzPEa/C4R1dzxe8623OwfQie70zBvqiens83EhHhoO+obXBlZAtny3ry X-Received: by 2002:a37:9504:: with SMTP id x4mr42929966qkd.235.1625931685056; Sat, 10 Jul 2021 08:41:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931685; cv=none; d=google.com; s=arc-20160816; b=CPXMEbimdcO29wHG1NQfbJhzRATPEoD6HEPmGRQstQq0FjqJaB/Ofc+qEMVwqF5cwA oTMwWupnnXxlx7LzqYsmvWu9oD4ztH0ptOJ1bm3N1YNuOPnefGAaQHFh0RE9UBPmR0gg 6h0hdBC3Ew30l2iZIakaMR2ikifQLDQuDaW7mFiF8DFWy/sYODkjkP9/t2ndkJFDbxEg yoylDXfqM4iphLuzX6kRuODFpspjzywZ15pLDuWyysgomJ3emFWTc4sDR9iqgqKK+gYp PSDfs/0Q4N7CLFWy9Ltz2Dk64XWd1+9DW7FLaXyCvPo4TJjNH7jpWs1GEkkQdZWXlLNQ IXGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=gi4JUoURliPyWsKfGdialikoU/us1Pcocvv5cHbTgz8=; b=A5A3aQJ8H45UlBLhJtoYQxrvaKlOlczpwnIfK/UqXEIaFI7PeOxsMhvzQYIeydFVcD nhW09uGnvec0oVEvUrg9zZGB08xOUwhp9Pa7C7LCIrnDvKTL4RDzEndleMl+pjt9pzsz PzTtiWLjQJx10K9K/Y3UTai0wdZyuF6MzcjMehjW1YBNYRf2ppLM9I4hW5BiYQbizouq 2j2GafRocyfHEAFUsR68HPHTB7halEBlASzVM9bQiTdpxnbh4/T5T6kPS/fFZGS6ERQ4 Ge8Kw2dd/hlQmkGT+s8BWTTQcJWROFI8cL8yWqwrwza4bCD2jrVuR6jY8rTm/uEe3HsE KLAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fJ8SxhNk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b8si8212646qtp.276.2021.07.10.08.41.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:41:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fJ8SxhNk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F6a-0002mQ-EM for patch@linaro.org; Sat, 10 Jul 2021 11:41:24 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472336 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1363609jao; Sat, 10 Jul 2021 08:35:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhUDfff06JyT7BlvlNngCKmZpGj2iJe+pcDcjS0qkcE7wgE+RBDNYJOCoWGXcENo6v9g3V X-Received: by 2002:a67:887:: with SMTP id 129mr42202067vsi.23.1625931339277; Sat, 10 Jul 2021 08:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931339; cv=none; d=google.com; s=arc-20160816; b=ZiFRMKfh2+P0/51ccmkQr5j96l7dFact7QvbBwn/c+YBiG2ePiLuvxH9GxECstSHBZ SdkZH90yk+Y+9v7RxJX4FCl4cm7wUkVVYCaWPGVnye+WaWOaJZj2POvhU1ZvveD3qQLI TDHJEN6XX3/nu2CV83fIr610A2nxonktUi13oRxnFcEG1jY7g9Zx9c0wT6WcIyI0Z1Z+ rFHwv7c/eJ+vkvjljt7R7J0+e2BS6EQI3nnUv5ahk+7MMuxjACOmKstGmg9EGrZEOkj+ 9YXVhed7e4NRmgYMkgbUtJHEc98Nzakn0gOtsz/E09Gq5VGh255Y0peGqTyDzE1pP3CA Lm8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=k3KB/Tkz24jiJG0J6xu6GsoVxf3biKKstX86Aezy0Ms=; b=qQj7LqDjEq2tRMoNOMhH3sFOyfoEbE/MSyvBhX+cHq5TA3xn2A+DXVXaRDX5FeaWfp tT+zDFbiY7XyCWnQgqvLImhkTcJYv17mJxBMIO7FlrafRLtc4vc98rff1jA/QWwENMFZ 4RZr441rK2UdGaAxhTjSEsmzffkK2emBVt42oBZJRPRYxSaumoYS1RfO43Rc+DZkJOY1 6g6kbg9p3zxbsZsrsPf59+VU4lJNOLRY/GafPxplHUUyVxztBRRynDlrGVx4sp3QVVNW b3lTV0GzIwRYbR3AZYlLMSxRtnUOfeO0eeQcrTFzsrtQRAkoBticPay5afMZAThJibGy 59qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AAe2sx0h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ba15si10130937vsb.175.2021.07.10.08.35.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:35:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AAe2sx0h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F10-0008SM-M6 for patch@linaro.org; Sat, 10 Jul 2021 11:35:38 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472349 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1367965jao; Sat, 10 Jul 2021 08:42:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDz3UZzwm3zgvJDcaydWRa+KfH5aN8o28lc/t6ugAFc4/z72jxvBTNh9OOwHbmIgRgduKR X-Received: by 2002:a05:622a:108:: with SMTP id u8mr39651364qtw.326.1625931779229; Sat, 10 Jul 2021 08:42:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931779; cv=none; d=google.com; s=arc-20160816; b=aYhZIpBIBzLEr1dMNtoFGTKPmECjmkp27epcvnUc60akJlV8A1sqw7tEXBw3SdTQnL yHnMTVLH3GsBRXd3JkuBgC5GCRepGamL3vDMqxpsGIMMpKreid9knD8ULbw4CDJF9YDN 4qz4+YZtQHzdGXkblfA/8vM+kSOKDFlCY7AkXSH+dDh0zMnWvTTUsVd1XKNCf1zX1CoE i6blUfNkcfnkZQCds8pOFAp/fauQ1Z+u8yGzCZuUEUTQqnr2+TPkMPXzwLMRhwr6foC2 /oWy2D3Djsd4jLxh3oCMfVGHtUAAlnWOtHe+w+Z3eiLRCQ3HSCrmva8V61+NY/buzD6B G0Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=J78iIrV/uBjFzK3bTpbLy3S7PgpqgxUhkktjGy5U398=; b=y/CqiVgEIecDe5CvMt33eLP2vdF3Qo0A8RMCLAN5v3wi9194fYcLgOHd7ssooQH9xO urBwY0s+GrNB3kvHioXMlSGWIndii7JCZhLc1gNX8q7IrqmVLAFCStN7DdeHHXshc3Ma 5K4ldPXB4QILx0MXZdk89Z+JjM5i0ycHHuGkdtlMu93F9NsyFLvKuqJREGyxLwhHVLc5 4QKx2mXuYKkScAie6c+hkL9ZCm15GomrppMuY2jk5yXEMzUdXcChJyxIHrtdyZx6Ubfy Ls3xNOx90noE9qEPvUfvg/URvDLTgdn/g70Q5vw6i/8apKwftFQBWw+Lc41NxFxb0DGT 7jOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="GIIoO/5x"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z11si3175878qta.128.2021.07.10.08.42.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:42:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="GIIoO/5x"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F86-0008WL-Ky for patch@linaro.org; Sat, 10 Jul 2021 11:42:58 -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-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?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.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(-) -- 2.25.1 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: 472342 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1365511jao; Sat, 10 Jul 2021 08:38:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzikGw/6JyH12yr1f9nQjGcRTG/ZpwfLHGIP74NxccTowSiS04Ki4eLAI1eZIKgp9Tnwkt7 X-Received: by 2002:aed:204c:: with SMTP id 70mr39874232qta.260.1625931526442; Sat, 10 Jul 2021 08:38:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931526; cv=none; d=google.com; s=arc-20160816; b=GJ/kq0htWPBS0LI8CyuiSKsxq20/CPrEeW4cmwsS8LY2kSGtFz/XKZbeGDnB1U6d3/ 8anEarvqWr/BfI4bAzAWmpK+3w0qHIEhB8ELvG+yS0P7X1ILce1nV5Q6bAATGdY/9rD/ le6Pa3rR2imKdEFsmmejzm7BfdGmon0ocW9JuDi7E4R/lGiItK9S1QlRo8nlqFl69yUi l2IYoyE5zlriqB53Cyx6yT5ZQ2RPm9cCecD4f3vODuxH5L5zIX7MKyCRyrpRnau/a1DX flO0G5dHZKZ9jfzT79nBYyMXnPzCjNbCZAGgk0+/LSkCXgVZTpbwgLiABsQeMpZ6qJ6f 41ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=6X5LcOGj/+Ng0LgouhznZyWXrpfHmdfU0n7UCveDgJU=; b=cPjZ5u4tVjApkKwMgx0Rtj3iBfDtXy9yXgNgDXjq8vbxbdgnMe3hL3Q/ONadVtmvzm PEfK+ZTRo4VKkJIFoyao/fF3GstemTlQo/iE1qUhoLl99IfPJhmjraEz4hm7/nSDjVi2 oSt8hRo3OsinXyxJEk/ReCZdXqtSd7z17GGw46IJg0xQPj+nr9K5+cc3jfnJrE33CJqz NKirwwDfknKYc7+iO60IrrxzaDu32+S5LkAu98bP2tuedz0S6guwzkyxfFS+0JNjXnJd 60YvrRfX5u7NmxpS6AWDcho3dUDiocv0kWMJFMkqlTHLhzm9vnwuvx2aiy8odMtprWrM azNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xt3Wfbt2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 8si11157248qtr.394.2021.07.10.08.38.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:38:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xt3Wfbt2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F41-0005ic-R9 for patch@linaro.org; Sat, 10 Jul 2021 11:38:45 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472347 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1367748jao; Sat, 10 Jul 2021 08:42:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbDeBQgyWo9Z+eN7A/Fh1Tw4qBGm8GN913H3DZhyi2axTd2GEd0oi4MDasdgDfE4YwoOtC X-Received: by 2002:a37:6856:: with SMTP id d83mr2546687qkc.4.1625931754876; Sat, 10 Jul 2021 08:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931754; cv=none; d=google.com; s=arc-20160816; b=st4Ic11j3M6EeUzEVPrZIp247R486T6LQBLkhMGHlpQmVajptSmgv4AWamvbvYrO2D YWGXtqrPaGx2DBTM55idar5bOGglRMihqDy/XKm9zF//glHpUSM2daZuxRtF6ha8zyV/ gGEAa4ENtSqD0BD8Ffa2oHMPTiuBgBjhRIFmSj1Mm+2k1KIRq9y2OZ0PcK55ALk33Eby /ZURhKXNYzn7+0kQsRDYM6Ux3K5WVjLbSpE5/qP20UrY84xmodPEmZAlORZcL7bR28VT 0nGcFur4iNHBoVPWSUyHVw+irXoSfjxye7whI3bPm9JVyvQmBbKBiPUI0G0LpmH0Ar4g 1uRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ZglPt3N3rss3fI4UqwR7t9q8pcVs9CWbKgZQEubMq5c=; b=rDK57UYcGdo18/ie5ZH+/iW8MsubIR7nxqX38fbTZOCiGPxSsHBF7UazyejzdA6uf3 bkeBEPjs3NNJRoogv1LicZkxyIXRYNaDWnPQq8mgyBLzEw9H/5AARC6MNUUKmMLaL2Pf O1iD2g8rJI5f4nKE+dfVFWBU23HQsQ2OZj3PlEcuYkFPvsPqnzj6cB8SemRqd5eQLU2q m2vE3kwJp9KjGg10wPbFEJclBN0dN5sjTuWZ0oJpYeDWiQEUPqdJo500uNi5Ko54Jk2W n5/w9HXfT9FgCYw+LYFn0Kel0z0bY5jWBPkidALVBhO42OHbJpHHWv/2aNFEAvyu6ZQX BlyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VF2E9FFC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jz1si9411353qvb.158.2021.07.10.08.42.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:42:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VF2E9FFC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F7i-00005X-8n for patch@linaro.org; Sat, 10 Jul 2021 11:42:34 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472352 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1368561jao; Sat, 10 Jul 2021 08:44:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz41QKJmcBvLrC4ve5mTP7wfAU8NcKXSAVzg9G6+UVxKD48Wb+tdWmwRfIU4GUmM4nrNeuB X-Received: by 2002:ad4:40c1:: with SMTP id x1mr42396629qvp.33.1625931851597; Sat, 10 Jul 2021 08:44:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931851; cv=none; d=google.com; s=arc-20160816; b=x+rrIiq6CNoaXlTb5zMVhlMByWC5DRq8yvih1/hBZxTpwalj2ZZjJ8EVpL1mWVZO9h nipm27EP0lVbTMR4KyrIIO1b4Ti1xTy3nnIam9Px5dfvIpTTZffOy4SYZE3vzDBrzEiS OCZee3+KQi+qdlJAN1D10znPDAJJewrQsZPK+Obu1H7dq6iySCx+5R/vxWkIos4LI4d1 LMke+GuUE30mYMnZYhiVi2L+n52reRMou5XjWHMCo0LkgU8sHXjsYzz9byS2W98ZjqoO G6PbSlVUFaQ8Z7n/y39WCFviGUVzF5RBJIzmyHyYfZQq8sOqMK7gW0KvTiEvO5YUVhos aIcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=wgZhcSy8wA9T7RvUf4moyrqBuAXS045DsDPF940MlKs=; b=ljV25vDWcK6X82Ed/etv9Cp68S6we41nJE5WdyIRBNp34s9GHVrgRqvBQGUUBtSCZU tpphHfrHcumsqQ2NLiOyZ/T4nBH2oNAOvTIHy+z//ugwe8q0Wdc8wYNeSqwUG5NSGblh qiZR8zcGQW7PvYd7I5MsovXyLW3CEv2jP98MJcop1NLuJVCZmi9LWY1Udf2uew+8uAJU Rp9jjiVKxRQGFAFDmv1dBU9f+37wS0Hwn0XFMcSwO0zP3VbBRmQUZr8xtpaPK29ICUhW Fc2uOmMG0HPvG6TwtpEYP90xJYSvedbkWtL7kVeWextn1TfpiJHViZLj2DKkm+WbBiTZ QHDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UgyQSEEd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f11si7750374qtv.339.2021.07.10.08.44.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:44:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UgyQSEEd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F9H-0005e6-1O for patch@linaro.org; Sat, 10 Jul 2021 11:44:11 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472354 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1369445jao; Sat, 10 Jul 2021 08:45:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwB/RFRNorMG9q8wnNZUEFge9+lfs8PLxpQyzJW+Nld4F+Uao59gk+GzCJcptnkiPdseT0l X-Received: by 2002:a5d:8b8b:: with SMTP id p11mr33288784iol.77.1625931951949; Sat, 10 Jul 2021 08:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931951; cv=none; d=google.com; s=arc-20160816; b=KPIPVTXQ6xPoN/hTXGu0qNCVfS3jQVaxHbiy6cGSGQCXpUB1BDDzB41csOt92DB0HH FnYCKc1dZvAwKy9i8DlMYMRf/uSafd3mQLpvglIMwLl8Y9DYyghsaGKbRNKUDLtvlKo2 2TX3Zmn77UEEPz20sFp/S2nmgvQF95RgKwaN4fnStaMThu5HokLInS5La0ko98v9SLnr Dr3ms6MuKlaKHzy0zK4pzkK5wKGu1woqJ5hwEY/Xdh4ZkoDT4RKAL8mWf5zxb1V5hcQ8 MlJKpMch5kl4fcLmWEjkyH2We3uewBpkI8RoWcapZ+5js3clnkpOgEmJEaLIPs19xGOj AmDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=sdOgSd63WVU1p/GLMq6rl3ZMILt/ihpRB26uHAUfMXo=; b=oZUyKM7esa64jQYYF2vOfcHDRdF9ygd7bGe//Sji4UDgX9JA913KXuPTVS7TK7MiQX 04BES4JJWcSkrWhAuz90MVSxngySQevSm/MCu3Vs4Z5QVFOVbwJyXYFqS2AelNENYkbQ zT5iBVgrsQ3tp29TW+GcvLRv0NN5dePoWLztlCgwBdnrva1k4g/wOcnbgF9w1yD6FxG3 Ulwu8f1Dtyr42UI+sgw1IxOTHGbBdS+79v36DfRBxYHNcs1joZNt1cLCw8nOz94Ll047 zCHUNa+pugVB2eatc6BEOdTe9ML1v3Zbdx13VPpgy2mHmggziaXPcvAHDSIn5RXcTXSs FjHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qSSz5CLa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v1si10068283iot.7.2021.07.10.08.45.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:45:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qSSz5CLa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FAt-0001uW-EA for patch@linaro.org; Sat, 10 Jul 2021 11:45:51 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472351 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1368550jao; Sat, 10 Jul 2021 08:44:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFreNseLu9+mP/GBQ8PiTOKaXFFkthlM16x4IuI4p+auAV6OJ4/nYRKx2sADUHSiQ0T/Le X-Received: by 2002:a37:aa96:: with SMTP id t144mr14997779qke.451.1625931850539; Sat, 10 Jul 2021 08:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931850; cv=none; d=google.com; s=arc-20160816; b=rzxDop7VcBaSjceIy86fCQ5eR7TgsF9BrQ48rrHP7M5Iqu/QojvlDcm3t1kXmcBqaQ 7rbfFhU1c0/SNtf9k0mrQVZRUQVKWaoyJLzuVKv0FS1yjZkcwx/ZWvLP/PnXL1OYEtkg dO25NyXrHC1+jzUjXE39G67tqo18QuZao8mLJrFBcc+9bY6x6JlcKKGn8DuAZyMDzvcX t7sVPr1vhOpY0kgSiUrsb2Oua9MKJcw85xAF5QYYZe3N2Si537nIU0aE6JWx624frifn 4It5WiqjbkvkOWYzNnJtqcrUpcIwUTfKesG6kWsM8D+KXFF4BKpUb5W+xjMc4yixR93d isbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=o9A9j6l/wX1G4+Ye4FYMb+DUZWuGQ1B3FFGlncSiSJM=; b=j6aecFpCsIYTMU/0ZbAz2WcGYPUkOmWA1VxfkoqqpyUDE1CI6uNpVh7hMs9HznIR/j AuITKjiPTUhPQMXr+AVrD1KFqrlN9+I9ik1UdG0a2qW9Hb7Y82tyKUbhQolWaHRMT1U7 UA5lZQqL+vqQTXj0uHv47HcZh/LmI7x2TEg5lzalOVia1GdDD4MyEE+frCFzSWoRfTNs 5Ap2CUhueR1EKPf2Bir0jtRQg5e3ncXFeOlyD4NxI8u2iXBuKh3LarxSJsh4zmxlHu47 pHAhMrfuCNZ6vJ0o+Fb7qmYgMp2Z+dp6/9LVZsEf4T3DqLYkWi/OY3KOtgCImU6Lglff 3pmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jVPkH4TM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a5si8837743qke.278.2021.07.10.08.44.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:44:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jVPkH4TM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F9F-0005aT-UZ for patch@linaro.org; Sat, 10 Jul 2021 11:44:09 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472355 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1369889jao; Sat, 10 Jul 2021 08:46:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyo6nwwTFCnOm9t+Ai54ayiM9SHGd0gkUVGDOuZa52KT6oHutKyCSh1L49YlW5gmayG5a05 X-Received: by 2002:a6b:c90f:: with SMTP id z15mr24039604iof.183.1625931998996; Sat, 10 Jul 2021 08:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931998; cv=none; d=google.com; s=arc-20160816; b=k3ugc9q8dYOEfOTD+NvR70GGZbl0kfc+PT7Y3fFhIBWvfcGZHHT3ZHmZtIP1r46/K8 EfdRAowvWqvwOpywcB5T6hpEkJhZ+NaG5ghVDU7iE4VsYO9V5F0D+Mv+YnJrvhiSz99F tEqKm6z7lAQZ4X4xGXIiU3ipahuclBinpRs6QBd8iMh4bzt9d5Fru6EQsIJYCoA9ExmE Pd0XpxBr7s1laBgumLO86TIh/A15/EvgWRFOQOfJnTRh2VXCwoAdvtouYoW5CoFUFTvr omcKvaMDKt02qdM8vMFw+G9acJAUCf98Rs1BchUP5qlwi91TgfpB3xbjorw4U1Ero+ao OhVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=QtV1oQWQj2aiAo4khTYZosWNvQunNKSfTN6eXGpTJBs=; b=R2ByLYLWYSvuiqb+J92RieP3qP9P3RUPb7NPTV9412bYZ5NkbnecQWYQSlGr2dcmlo VWQLj/l+wJDyyvjf3LtTJ2hCMjPBT1WwVcR+YF4fcj7KuAoxohH2NbCtyASF5kSRIRp1 W2WfVH8bCoLtfwcsg+plM5qwloy6n/oPQjwEGDJ/bY6jrZIZ74QttjMYXhTz+1ni5/U8 2sAYkEQOOWNafACs08oTS20sZckUGtoOtDaFP36gUofxq2dDgqiDWDUzVxlj72/2bl1H R6eygvteIMOoATnSziyQpe6+2wrKtrLBE0DLCvxIBa3HYEc2SwJ/khgG8QpvXNbgVadA zyMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jWkaKA0s; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e3si1255260iow.52.2021.07.10.08.46.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jWkaKA0s; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FBe-0001sj-Dz for patch@linaro.org; Sat, 10 Jul 2021 11:46:38 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472346 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1367134jao; Sat, 10 Jul 2021 08:41:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/0o0SxGZpDf3Gaww8+T3Nuiq4RLSZNsmgFis5PyAxvfj1+bLoQimfimEpMdGzNXCN4zGM X-Received: by 2002:a37:a2d4:: with SMTP id l203mr39793411qke.154.1625931692570; Sat, 10 Jul 2021 08:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931692; cv=none; d=google.com; s=arc-20160816; b=0G+0SvI3cG0MQvDjaVKYdYvbpuxiF2Np+GBJn3VVHdbxBepSEoShEkFpUJgA9TdRah JIeXuyJIq59qAx4rMlJX1YS7zoTlxX7/6hxNJNG4JdaGW33TAMl3lh7bTCs02IEcjVfY SQDxuAS5Kb1uuxTeJ6abuCNa2g7U5eJbwkwN2/rvKd/LTedfvivYAJY0sGzdydazVReI pQHk1Ie6JOF1PnpNiO+di/SXvddCK//6OSQPqhDUOERvqVxVOlWuMcW0TC+Akt9/cREk NAvrQXfNjOFk/dNko5Les1c0CsTw2hvZtwyc+HMRCrWFnzx78iChR9gv1TKw7UsyvSqw aAoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=54L5C75jlygvay8zC4dzGDDxDxXFnKO0N5KrZ/57hyE=; b=TCQXNI15xhqpJ+G8h2RETXays6F0TRE1bjNcavaA5irqeoX35FDIEPTd+D+pQcxWwB S0hoSIQsqIH7CGX+jfxcSU36mKIT+NsaK5rM3xLqlXJB6uH2ng62n5c4eAZ0wKxlzXEd GEtQkumOGWX9iJi0SD6DF0GlFMeH8L0ZVFNvurWg0Bbk2sW0N9Vbe2WCZASmc27CAoJq wK92roxf0LK0PVorpesgSm656TJVhX0iWPJBjB7SOAn4gmBZP+9HEJH7YZ9qJyJmlmn8 bOpmmHqwZ7WeyhvPZO2YWtbO59qePU78zd5FZiY6M0a26FP516A90w9Mx4podhm8hVGR ltcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hswm1tv4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jl13si6648810qvb.93.2021.07.10.08.41.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hswm1tv4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F6h-0002xx-J3 for patch@linaro.org; Sat, 10 Jul 2021 11:41:31 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472357 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1370440jao; Sat, 10 Jul 2021 08:47:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy76MHMMqd1zyR6tkb/3+3lgghoLNuRUpBhYHqG3CvikGH4EeILpYdKm+QxpoWyOPXEnEj/ X-Received: by 2002:a05:6e02:1288:: with SMTP id y8mr29992876ilq.86.1625932062644; Sat, 10 Jul 2021 08:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932062; cv=none; d=google.com; s=arc-20160816; b=y1ldPtuB0ezQRBOM3RI8wKTwVwMZWF1V3enRJ+usPeAASHb9dtA537iJdoxcN2nYYk /l+J27eyO7MhbHYFus6qKVPYjr9WWJm2iLuh2bA6QAksRpkTW4Kq7NSIvaVgVA+VEebr VATQx4Ou1cqrhHrHdkJ2rLBo6FUYGXfZ5975VdwhO3CVyaKQ6xEc+lUpRu+qQHQJavAP mClrslCMU7knG1jR5JolnL+Vfjq/pjylf0Xn2Z5zS8vKvup9aCITmqX0Zr6w/jSpjAiQ QSTr/scuGgH25eu7kf9MTeE3VnAmeFvu1k48MfyWSsJU0I92URqBO8nZDwSAvvE5p4mf iRgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ecRVVJ3PnvHarcdzmtFHD+/SxpG+hJSwypTpiV6o5c4=; b=rvOvqCNVXsB1Har4YmwuMyAAn2D9OxB0uXw5L4rmtvDfIbAVQc6yadVouZkG9cLW/f Wr8vMNafGyBA0prcJIvsZoi0KGBF4MEScItd1w0rm9pPGt5oMl4gBn1fVQItFHakVGpN 4QGJwID8+0phOo0cbfa/7MfOwkmdJhCYQwP7YQ5v5wGH+Ic9P93cNqgK24apFHwa+6aa IHjx2vyp5AHB7313qVtcNqo+qnkemng05KOyhySqUJ2yRuZa0wyUPKabpKsZvzRq2VLn fEmDCL/ZqBeD1yPG2rx0MgrnIcjdQDRzEC0Zmji/4s5S/ejTr5p8z5dryCA36VnjjcdA HpGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z0w78xEr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v17si11867119jat.19.2021.07.10.08.47.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:47:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z0w78xEr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FCg-0006PD-3c for patch@linaro.org; Sat, 10 Jul 2021 11:47:42 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472359 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1371297jao; Sat, 10 Jul 2021 08:49:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj6oDIAtFVkXhuWFlqWQL91IyLKB7gyp7Xc57VquRWuJtrKYe/8wRTMO3CcxS1M5gb9BBb X-Received: by 2002:a92:8712:: with SMTP id m18mr15984901ild.132.1625932168357; Sat, 10 Jul 2021 08:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932168; cv=none; d=google.com; s=arc-20160816; b=oxZD8f5wDvo4x0X+V8ctICdaKEJQQsc0AedOPnu3lTE2iR9mqbnrVPPrXJrLHyJX7T KvIGI6lueRVrG4Ymrt+50e7NykkFVHBDm8eAuW8u00iR1tipplXlUu3j7QkYwJDexE6N 1Pd/DOMhi75QWeMZAQW7XVAaTEpvGkuVT54Vih8SuzQPMqzqGOfoTfma1/7jpbnw4y5t QBEKSR/4tpdUiuvBTki1K6fcW36MkynNXf8ZfUmMTedMAYhZEvjkOgaKnZpbSo0YewUd R+QIWJ9pK9trxT/wxNJ3jVnnPmgaezGeRKP45ch1siDrT3AbphrGDYrvO2lDouOV8wtR q5Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=z0rbZYpLmN7OBA+o9g3ziAIPPJLFXElqgMaQw5pyuig=; b=KD+yMqKAuPIOCGQGwl1GLIEYMP0EQoNchYKc7ca7xvIoyJBUEQaSVwGuYh2AUV0f3a 3ENdU+sNoODIJKfvsqab7XU1a1dhYNYZ7TWZm6w9ufEuN51om5U5ljAQe7TroS8tmEKg pWwyC5kMPPtjeczryd9Hb5GDvQD4wdp8Ud/L3nmLJ50YBouRPcnRyyUtbCUEI0gOnX3O FYBD6Kf2OwMGDiDmfuoWEPeYONJbqcYR4Y1ksSMOK3Y3BF2kef7vU2DjHcHUtMVvrXGW IKf0Kw1GigTuSQ6SHjLjodFum9o/yg43l8djeK3P3QecXSW9+7Am88df0gmL+/D4AHep DhbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AihVAPyr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w25si8987827jaq.39.2021.07.10.08.49.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AihVAPyr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FEN-0001Wc-Rp for patch@linaro.org; Sat, 10 Jul 2021 11:49:27 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472358 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1370806jao; Sat, 10 Jul 2021 08:48:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0vVueIZVZExgq+nSUg9pK0aQWEcxdbKhsTnLBrEmthndHBv2OEfmGwAS1plphUJvsR5LC X-Received: by 2002:a05:6602:1c4:: with SMTP id w4mr32141802iot.44.1625932104714; Sat, 10 Jul 2021 08:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932104; cv=none; d=google.com; s=arc-20160816; b=QeoaGB1igBumEw6I/0nP/IfinKWI1x0AK9fbErAjjpC1HYuHIPT2aX3n8Y4u4j/N4/ YIXpBazIXFV6pYdUwmr4PNJiPONBCLVbTBmogCz2kIv7xwM5TjIxdJ2iS/gPAnv5F5+M AScLYpW5Z3DgUHtISaWayaEmQpgYMWbS/DXR0Du6mC1FoMQGoG796MWfXWXMdu+yUDvR qwKz55cpAqAFLFC26hniejWyQ5UkS0ywS3d/6b6xRb8DRVLYNjAbbQhwv+sErIjv7upA ekjOcQC9b2nEQe48SK2tz3Tp45hMXW5mW9bdsdRCdB8h6Mn1eNJYHATXpouEeowRw6GA BQqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=4qenbk3bz7QNKjCkCTPORT5jxhyyeVTLVG8BsPWvMRw=; b=l++By9dNsf0+yGrNJxSFyUw7VAuw5zM0Ac9XVI9FOKHTRqNnEvFl8lfBVJlhxxmkQp dAxs9ifc8XkcLgba5GBWFb3QRzwd+8hZW3ngNOrPOeslVQ2yL5RfF1fSlwywwI94GkQk tUE7PdGlPNcUW4XZBSqfl3UP2SFCTjzrNKNAOGjFObNbcUb9IiH6cxAeYxTf0Py1K+LV WBBAQWbE5iXN/txbN64BW3Si4JP+7adEg1mVaS2J6oYGefgoJ35Rny211DaUeyuiW/gc Vtv4iInYaFMDQVzpTgpJwQ090QcSMn/D5Cx8UT8Ur8cueehYvFCDXZCHVBrHWGpYE+EN Ppuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVZllncH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s10si9976479iot.35.2021.07.10.08.48.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:48:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVZllncH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FDM-0006Qd-6F for patch@linaro.org; Sat, 10 Jul 2021 11:48:24 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472362 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1372323jao; Sat, 10 Jul 2021 08:51:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN7lnzS7N0O1AJo5bUDz1TaHK+cpCUi3yO+GbHriZFSbaDkuom/AnxrDF7I2bi8fWVtz7g X-Received: by 2002:ac8:5853:: with SMTP id h19mr13322156qth.66.1625932275304; Sat, 10 Jul 2021 08:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932275; cv=none; d=google.com; s=arc-20160816; b=iJP8P3dbJCxhFz8Cs+u345rVldcCkJNjoOjF/myfZg5Zh6JfZGe11wwRPP7fESkKIc 8qGIooW3yWuHFYmkYoifhQQFVqSrbbic59fgC2pVququGmVT7b365/LhOwiVBN1w4jb0 HKLUIdPGyLo7v8btkBMhThEX/uNum/RA9rYjzcP0OIvx/aeVH1Xln/qu37jftrkiWiuw JSrCRyeWGYinZHN3xaCAXro4bEK2AJO/VQjabw9m/L6Ivy2LPmmFG3WnFV/faRU40uBg AUnHKRYAyO3OPimnxbTOAshYTWRX8rR94drqyuPLUVaioP6CjxwV3vBppMm9Wpc4D5dX c+1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Q7Ia+ie6XOcjpcC/dD6Ub5PbrcGQ/yV9nqv+RZL1T9E=; b=JAyOv6WXLXE1AiehukaTtyCmRDfO3FmCvS/OAnLc9xFy5hkXxajTyZg0UawuR+Znbn LSwcG6rLC+a6ZXby6LwJHWSRMgNW4ZDUWv54q3SwKmQLvTILfaYX6dKvIuKst7eb7PtA 1dwF0rf4aYAMWUppUmay7cF9fH/aUUdlWiOSUlcZbHvJPc87g8Nt96P+2gSF8T6IHgYU TXRxxd7q6Ueunq/xVo5Zu95FDwTINHi1ZhAddBsxoWO7riR/WFny4w6Jgh13Yu7DRbw7 Dy5qNregBip+cguMAVAE0UpHALCaB/WpLuxHkEwOTLayQavezji1p44TBlnhe1zG2PbR XUaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w+2mOkg2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x1si2227228qkm.41.2021.07.10.08.51.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:51:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w+2mOkg2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FG6-0004M3-O2 for patch@linaro.org; Sat, 10 Jul 2021 11:51:14 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472350 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1367972jao; Sat, 10 Jul 2021 08:43:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqa5rAh79o/fb8q5W2dFeYiN9WPSh8eiNvOvSKine87DP0FML9ODI5s8UNxndWaK2u/0nh X-Received: by 2002:ad4:5344:: with SMTP id v4mr20841139qvs.46.1625931780119; Sat, 10 Jul 2021 08:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931780; cv=none; d=google.com; s=arc-20160816; b=qmsU1Tw2Ji+EP4YY1IezI5xZSBoq1awydg4DsR514XOHgArBJrKyIzODYFW4UxUq8z 1yiKIMaBrmfyvxJaa8l7tlKqCMYilVeUoBZFMw2YllvYKeflQ4t8/EGHIY3oFdWSiIrE g/1F9suIh9vIFReP6UqdELSQxG98slhzH6si/u4R3HTz8CQchWE8ZY+qV6JAAjl4fN7y AYlFcFH9xP+rL8c9mZNCy0zRTuDW0FJVNoXfsgMERY/1JV5KXJazPHnQ5id3dOq16AGU AYZStFvT76Xkl4fGQxoocHi1MFCD63Fgp77Jun9Y37n6c9aWt15OJPHlBnhgdeXbPcRp +EQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=id9iV5umHb8tt/5JMvNxOccVr78sQJff/CPKYNI34Tc=; b=DLE8xLLGYGrW1hND+zfKguU3uPhPineOpeHzfFq4DkErmMW4ysB3u44aj09oY7vQdS zNh5Lq+qvVVHFZbAT8/aJSGdjwEq1SE8kumwk7HcKJPRZolWlX6W38TEn7RDU1k55i+F zCndmo9bt+JEEvpUsZyPcbjDXGTmzEWPeLjPFm/f/KU4qF4WFHg71YZK9G52e/6DWbAz M8BtlER6I/P5CgzBeRySrs192zQ5GmwEivBjcBUjiZwfg0IZ0nVC00q9G9MyudyygMA3 H4EyVkISqUtuprlqFDMq1y+u9vpWWiMmgM2jNWGkH0JQpQ6fumPCUgOlfc8c2Rm1s3f+ MtPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bi7m9PNM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u5si8042070qtq.336.2021.07.10.08.43.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:43:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bi7m9PNM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F87-0000Bu-GJ for patch@linaro.org; Sat, 10 Jul 2021 11:42:59 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472335 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1363005jao; Sat, 10 Jul 2021 08:34:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTHDDVhoaotgIuGwnq/vnHx4CYEd+ato3KQDapY+mVZyUJq6X4ruRnTP9nYc0MJAT1c1pk X-Received: by 2002:a05:6102:c0e:: with SMTP id x14mr614680vss.47.1625931274833; Sat, 10 Jul 2021 08:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931274; cv=none; d=google.com; s=arc-20160816; b=YC4R1tcsg9miDDQUMAlLrKHXy7QysPo8HY+2frrEpIa+Ah4QRfQqlQjpNM4wDUm76s ig0Wv8KjrsYuuGoJfKYlBavP7kvfm0T8rZ7CatMFZtWBNpSZzaTsEgRQ76IPo2961r+d WZXi9aBeP3GjVRAEwPHTNHKYTCLcQQruUnnRYfFiYw35YxVWPJHUOmoRtITvaRkYAadW UFgFCPp7n+14DC5y5ALLscbkzDaiARNizMqJ6AZDo6CyYWCtbUplBib1AtzT3mqj3Vm0 BoOfV+KGTK/jdycZl+NTxGeNkQBg6imMQZFVCcn2Y77XEa4cxaXQyQ/Hja6p6YyN7ofT WyRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=cuDFz+AjESRkTBOBfcUaJCGcjz05pqAAlTOVb+wGFjY=; b=ugLb9wO3ZCvXNRRoYgtvpy3Mrlo46jEf3KwkDVps982n39uuZQrx1NwhH4GX2iipZI EhxbgjzQ7vz9ISGE5LRcw+2e67lNyH6DPwex4dPg4qwvW4V5RGmIs+wmwAcNRjFf9dPc TmFx8glzf5rQC33oDraEw6E+vdRcBfwVnDga4dsTCHWAQNscAUr4fzOSBWhGD+IH4tkX QWI5+wgCft4PJKJgT4tsdDSTZC+9BYGcuhEZNcZ2X5NqaleORwwzPfr47Ge43lIk/O68 8xkd2PMG8mHZgfLvMC3sGLtCbkJ6SSHqEOArM5OJGvo8dHOi9WpQREwFVEI28pMf7xbq RbGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nbPj/Xvd"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d28si10319373vsj.408.2021.07.10.08.34.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:34:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nbPj/Xvd"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Ezy-00051o-5J for patch@linaro.org; Sat, 10 Jul 2021 11:34:34 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472364 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1373023jao; Sat, 10 Jul 2021 08:52:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyfljJEf4c2IQtgI5PEjiXpkz5VM36mHyuXWu0RXOAjRvV/L9Jfko7EUlruUKJZkkuFvJX X-Received: by 2002:a05:6102:321c:: with SMTP id r28mr17246397vsf.40.1625932357320; Sat, 10 Jul 2021 08:52:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932357; cv=none; d=google.com; s=arc-20160816; b=0aXM3fhUQ+5I6FTTOGLRNW0Yvj4EeoSOJfW75Wd0P6GAykanFN0VmYK3ZRN6xAPvm1 vTlR/Be0mC7DfyoKHLPXJIXrytzoFL83ENvKojdw4bR3LJMVtoLK4KISdRsyXH2n0uLs TZP71VmR3fdNNcLKIWG6KK1xuE9NIpls2wm2lphOXFBldRZSidkCour19GwwWE4nTHr6 v13BLfODvDoAxVgdHlH9+gwnueBCVJx7U1k2pq+tTxbkRLzHXG7gMtpT6crA6IlWzV8u P+YJSYfooMVZoMf2BBokPkEG53qEncmUjgQCAIbVjMGYCqRS8OWTuqxHrNpykEuUoB73 5diA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=rWhSjxDGBxYaiJEkKRwtWFyISfQcdIqDSvEuPe1mAyo=; b=trYfnbYwClmVKJ/HIWnCSoQBVGY75DzdhxsFVrJjPbSW1HmDzF4kYy2UsGl75p/ufd jHEhvwWaBGgxeZLH8ItTWgsKtsTSGMLWZWBVwhiFIKEjlcpchjidQ0DE2Kiwjhg+6iUR MlO24y0F3SgjZo7THQ+sinp0ZRywuNpOOWWANplTcwBLmkRhQcJdg46oKnFAXrQGQFtS XvIeyQGXx/Xinmy0I+v9roG0G9pExiw77//6Ri6guBn7Pr6zIKcNn9KmBwxTdHvN13Po srWjwkCLq6H6KNUAmT7u8p5So0sXrpbHjGxpHIWZ3jpjCsf5aoQ5cWF+Dfs8UuBpPYRh iXRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZRM+lDQp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y127si1667348vsc.285.2021.07.10.08.52.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:52:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZRM+lDQp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FHQ-0007HI-PP for patch@linaro.org; Sat, 10 Jul 2021 11:52:36 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472339 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1364145jao; Sat, 10 Jul 2021 08:36:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxue6lXV0Rve4wCQ3mdc+gH9HG0tgyWBcuueYYq+Q6dZzwHGRZxh7LRF76W6b5uNAUK66ey X-Received: by 2002:a05:6102:2131:: with SMTP id f17mr23623171vsg.1.1625931383910; Sat, 10 Jul 2021 08:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931383; cv=none; d=google.com; s=arc-20160816; b=MxisNAPLr5zgZgNCV8s8Us/jbZeyFEmJ+1iq/is8YFY44kji+Ir2kaZhmOy7NgvR4U nEzF2ztmk+hkyfZNg4unUF6CqMDq1EvL+5SvUNtysbqMDA11uTb3eAGZDF9oIIPVTWj2 RTnZss5Dg6TGurZ7PDseXl1vyKDxbVVuAYrZQAj3Wzx/ZYHWE5ap2KA58jRL3sCCcWbW Nsl7vJWXXZ7KXZKOBGr2nM/04zTkqe8IBqt4ev0vZsSHXkdJ0dpx89Ej1Bpoyw5A2m6B Xfl7QS9cD/8XBZKb08hp5881HN6uYu3FcpHiQGALdW0Exch+9UbkOMvjORrgaF0YmeRe bTjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=KOIIIgFSsplaRIYV7/xcUpt+eZ6DdDmbIOsCJze1E68=; b=gbMsjFDQgH/25vfU2g/iUWTMdQ1mu/0rF610o1D9cUQuCDb0SkmkWLGUqh5fMtcbX9 lcBgcUyNBkj1k3TChizDc757NarSfFO/uaXK5fEJUMwzqjfs44OkMIhOeNVdhFY8cS6G k0OfKE021fAI3VQs9R8nqO0evn+3Z/CAj3JowC+nVkSfSZQbPla6n4CcM1Xcns2MTSM1 o3hKd+8p5fpt7ZRR4weut03VYIFvHCjgaztm7ABpXFoTc2mVx9bi//jGbKsknrICgSeY /1JKfld3UHBycKnndtc79SkfDXO2W5rYklRVKtIZnFgaUKrhBcG0dPLboLrQUIKkgCWY Sr9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZT596TWr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r11si10912523vsp.389.2021.07.10.08.36.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:36:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZT596TWr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F1j-0002Mi-8X for patch@linaro.org; Sat, 10 Jul 2021 11:36:23 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472353 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1368775jao; Sat, 10 Jul 2021 08:44:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcF/23Ix1SchcfYWauFQOBcOWzNRsqNZNSXb1QFoCqASW6yfkmi34bYHPhDhDQry3vMwHr X-Received: by 2002:ac8:13c4:: with SMTP id i4mr34322353qtj.136.1625931874474; Sat, 10 Jul 2021 08:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931874; cv=none; d=google.com; s=arc-20160816; b=uJpREhTBumNIFIpidociWep9bHEsC0HOveBoBYsJcxnKd13H/+8NH0V1lSt05VtcoP /dAbHVGFTr8XroZ/AepTs+03Pg1Ki7dSqleaoq4R1JfamlnsEvXYD4pd83fChl78OYr6 Xqj7HV7Brs5NOsMJS/msci+xuvD0MMPj0os97q4zgaH1DmxLDuJ/liNJPpNpV1MAbobG qnvfPT1n+53Z0S6nqw+K5yqP0IbKIIiwzQYzwCUbQQsCMqEZW+kTDhLL7qgTNmo8bktc EmtuFSdTKYFa3LyPiuVaTEsJQ3tSbCMc44Wsv44CDhwcNKjDVy+NNJNB7kqzUn+nSOvh 5ZBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=S4t3A3e3be4F+i7H1Y7Otgz4LVcV6jSvJ2vc23385UI=; b=Dfd9cbj9rw7ninJqrrSnNqmpItjcti2vyCcTLpgaGMJb+3hm8MF4PJh5UGA1Z+Urzm 988DezdqCrDgmwtqhP/o3SiZKr29xP3EF7/0rJO+QRDVAnHUyxPdGVSgEIn+GCWRGbRQ FrOwl038XSdwcDUw0spN/LtDd2GyGG7NvS+wBHprTHYmcFK01xiSgXjwr1HH77Qa9h88 KQ+GNJPIqwk1twQOfOgLiMhT6xvvw4ZbujQ1LW/0EFGFTJCZDgplSPkWFouRVJNScg3G eGj3iBwAeX2Vwf01c7VR0NshecJ/HD66XKVC02mr7TS2gdWc86v6bd9SNeKHHMNfYRgR HQvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J9FCHdFk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u5si8115518qkj.10.2021.07.10.08.44.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:44:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J9FCHdFk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F9d-0005f2-Po for patch@linaro.org; Sat, 10 Jul 2021 11:44:33 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472365 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1373515jao; Sat, 10 Jul 2021 08:53:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfpBrqxWn0//vUx/lYSspvzOojAkmbLj7fMTaqd8lmEylp5sLtaJK85TSWhJJf3igblWgD X-Received: by 2002:ae9:eb8a:: with SMTP id b132mr12811070qkg.208.1625932417245; Sat, 10 Jul 2021 08:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932417; cv=none; d=google.com; s=arc-20160816; b=ZDIbO62RkepK9P3CHjgGJsQ1Fa9PivUJbIj21MbHydeul7fidRlNwNEIvO95zmuW2E 0Bv1kpKlQsKiF97weTys/VwvRWWJGmEYt7oo/a9Qx2TpoGSrODUMjtzAYKLig8RluZb+ P7dl4iXSBLzfBcKu85+APcli0eUCPONMhZ5Cl6OqzofmwUeD1vk2GZ43IPjQte/3bfkL aSzFCPPCyQkHTK++xKuQYrwrBwa59fClcJRtSjI/dYs3LxYxCm2jdl8Hy8kUH+Db00Gb /LDWZrJB+tPU9OwHbd/eayS5U8tZvAqNe1JnfHqtKRpFND0hB30q02W3ftMwGKOWT7YS pNFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=HmrvZ2YDmFmQRowDiyGgkhSWbFuv8fekjQLGpsBU/NM=; b=WBydkUgAK/4fUIBBDVaVnp28HnmscB7hEGEOTEx3Vx2GGE+u7SOC8+CVvS0yQduiMy WUN9esAeWLPI5oG4ogCk4rNPitsHP/b5bp/9rAlpu0PJpr8IVu6uZ63S2yzFNvSck7S5 G6j/R4hRzIEj2wRPqRCih1L0Zg1iyOT4x1/plnqpVSX/ZAKZth8WrW5xYBBv+lGN+wBv ZFL7zOqRVsCQsJlcf3tblNdFGf/6kxDsWP4w0ruMnjIgWcaiw7Tjb7PxT4C4xWwnLiSB yNy2CR+rn3Q8CsqtrWFzODdjmaN52fHy8qHIAh2RP+cht0+pX+C9YHu/wwiaAfBzSIyl uKXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qUEtvDtP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c10si5143980qtd.63.2021.07.10.08.53.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:53:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qUEtvDtP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FIO-0001la-NE for patch@linaro.org; Sat, 10 Jul 2021 11:53:36 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472360 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1371305jao; Sat, 10 Jul 2021 08:49:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGH3ICdS0rA5jI/eoNyGO/zI5vBGqvzlJBT7d+ALvORhgAHgBDx1j5O/FaEQeDknJ/e4Lk X-Received: by 2002:a6b:ef01:: with SMTP id k1mr4409139ioh.102.1625932169453; Sat, 10 Jul 2021 08:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932169; cv=none; d=google.com; s=arc-20160816; b=o0o91rqUtr8HTwEvkma4/zCHOFFKRNptlCKdEhueB8Fdi+b57HPo60btLKaNxHv2qH qjAxgO3zAfEmimU5Ssv8ZE8QFS36iL8vwMq6S44oUDMmQ8IPb9ThmjcUAPal8Y9RdQIH Hd7jPQTs6reScOnKdSpkwte9GWz+BcNgGNVka+f9tRtOigY4/DD3LS4gc3VAwY1x3KPC WKeIGbT4eSZQgIYPp2P9sVzR63cO/RePBb/FamxCkhj1VBlCoOSgEy927NETuPeCZUsk MgChdzCqUYx6nfLh/cQ+TdLvxNXN1zQnT079fntm/WKx6UXX0SckdYw/sdBnc9vbTt+I SaOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=jlb9t26eUmvNmKvxgmiWrSkxF75bfUaFnwmdpAxQL3Q=; b=NEQL09+owbwnZBOoTQa2Rg0eTQwqT9LMnsAw+8RGJFpANzE60IEOs6ufbMzHHngHJN wg8zKwDoAUMENwL3RLpc1to5SjoM6CFj6IRF+PD3KgDIDiGhKkuuQYiOtDmoeHrjNIEV dJawLiAermYBheatgCdmZmCWjhWQ02jdQwVw+QLgjXHATRrfqQEM8nvdjpqSMAN6DCLl N+Ik0No9tIzFSDuw7xvWPZn98QP8L30GS+V6o6TWuCIhC7Kbxhdjgv0SUI0hR3fZr+qA YOT8f4I6lcoPzhS/oTiDoXBHM7dSWX/5j9OnfUZpE4nxn2J9wXPldW0cks+6tDNOaul4 neUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gJ9ffspH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b15si6181004ilj.38.2021.07.10.08.49.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:49:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gJ9ffspH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FEO-0001Yo-VG for patch@linaro.org; Sat, 10 Jul 2021 11:49:28 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472343 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1366118jao; Sat, 10 Jul 2021 08:39:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4QRFpvgiQueqRulqa3M2AibzoqhBJy/ea1RvCH0WGXoEkspoDLQkxGdcxGyxr2H6XZaMo X-Received: by 2002:ad4:5de4:: with SMTP id jn4mr41973266qvb.41.1625931589606; Sat, 10 Jul 2021 08:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931589; cv=none; d=google.com; s=arc-20160816; b=e0AgTuyhYL6v+7qvRjtRRst7sFO3ewTncPxZehl7RBtp87g044/4T8eiqvrvOrA+T4 iy2PumqTYiSFkiI0jNd6C3dzw/35y1WK7pJ00ocA25PsRXqQk6cEtiH/Mypo4VFv4nGC bxd19x5rfjqXVODanc4q+dChZk54IDyq2wJZ18BsJXThE0GXtqUBm+Btcy4IYHSHNMzQ 8+gY2J/qBI1K/BubtbtMndfKT1FCdSyr53ugUbfsFzRJPIWWwOj9LONau+BlCn5+Rk0F Ny8kMMOwZYUIeDEEX3kPBoV+mKXsR6v0K4mUzdOabLVVn1pW9AvPVxTwqId+y/IDReXd CsZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=0TpBf4qKV0D0B2PVgq/Ik4yquVh/66Vd5JijaCSKrFk=; b=YbAo4CLZJfEcmrrA9Epi9ZMOWaNMtItrVpbLhvVRLFk397U/V1HTVukk0BndO+hdhc rHN9AuHZ40JCKcwD3NKv6ARmMH6/8YhWlAUH9nYSn+DCQtM3MLT4RxXB3E4Z0Ab61DXG oJn68gOn5vmg5vyMc9ItjbDPjZdpLIGpLIrnZfzK76vCDl7wE8FBa/gtGvQ0nSMN7yPF 3aTpZrmbdl3U4Ty6JgC6ukyBTnu/QBXiCgv3XMLJd8oIsTwZ8cYztOE+BfhYpf8KyfXK iRsqAjRFTal5l7MTF6+IVJPpKeWgC//44zETk1HtBU/HRyX/4iEjW832BMg2bij41vyx /Prw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BGBFyYHD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gw1si7612800qvb.223.2021.07.10.08.39.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:39:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BGBFyYHD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F52-0007zi-T6 for patch@linaro.org; Sat, 10 Jul 2021 11:39:48 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472366 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1374114jao; Sat, 10 Jul 2021 08:54:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3a5mJzG43hB9KxwOG3qud0svKigfZkfy9XSE6mTUb2CUwHNpxHVik9WddvlNvCf+XOOcH X-Received: by 2002:a67:edd4:: with SMTP id e20mr42254509vsp.52.1625932481381; Sat, 10 Jul 2021 08:54:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932481; cv=none; d=google.com; s=arc-20160816; b=ew74vq/dD1BcnNdIhmhUFjLBgjlDV7L5NXk1QmNbGseZUww+Pe/oT5v/l+DaSx/JU2 jbFn0GtvoG6DWRmbJhMza+9hpPB0D9DfbqSUVfQIzBepl2VLa49aT8xtdH1tfLeGkMq6 m8ZilWCLkTPZFE1b5y38W221K7hVT2RtW5UBTdJPAoId+i4teEzuoHCuIy/Fj3HLjKU+ 3uGRHE/K6nHPC8liY0yLc04HeiapPdJGHoeNTw0nimd175r3qWEGhnmwaMq+Vhza5RQ9 yAKz9PvPt8NralAXHPhmOuweARjXU2/9ajl0Ga/t7PiJLrNNq/rk9IyoXAHe2T1XitxJ gw6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=mkAz14ohKaEU7KoR8ytu+L59auoxHOiI3rwm13ILEcE=; b=o+fdkk53BZYWE8imr9+xuBz5IWcBZmWoogwsRcJDlkUMJzWxTOKGhnZUpgYAbEOqBC 4Yf0lPittSBs0+jqmWQe+mwaZDrcPlXXWPLEYFBsg88Q1KePHeCtaLIYYO3gx2AxhMYC TX+I3rCGHRX73vnOrbcGkdWYgukro0tv1yjJDsK2n8Q/Cb6l8jWnG10Dz2YKT+rcxRHS HKewsRp9KW7msCSOMY7S8+ETU8eo5tH+7N5omt4UaRHFdL1I01paGGbDJ02s3162aJlZ YYZqgNJ3sSId4lct+JUdKRnyCPmmkKLcxl/gLfaFEKw5ixb+fD3Woxubfw3/L82R7LpB KYpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EFDs7r0y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i20si13600239vke.23.2021.07.10.08.54.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:54:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EFDs7r0y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FJQ-0003M4-Rb for patch@linaro.org; Sat, 10 Jul 2021 11:54:40 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472356 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1369902jao; Sat, 10 Jul 2021 08:46:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWWTEBOTA0ZOAqo3kudp0gkdhAXyw30LpZXE34sVzoDdf3NqfmcVanFclv/W8ME/I2IVOF X-Received: by 2002:a05:6e02:114e:: with SMTP id o14mr30946638ill.201.1625931999973; Sat, 10 Jul 2021 08:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931999; cv=none; d=google.com; s=arc-20160816; b=dka4hrZIeXTHKr7G1UPuj9+sZl+ahiVv/31AAaI4febIMjDaisnjLyMFGtyU4hAL6I uvmAFdUOcDgSTADpaOnHkDwamJStfnIrXZBbsaTfSBd/joM/bLpQdNccYKz2OACMuYs9 Z1qN8WTWccuICFl26x63SAGRE1XdEWl9CAXbA/WzNV5rCE+zjQqQFad9hkiX0sYs3hR9 cuEGJNPUyNyUrtWzxtg+YNOCpxzkea4SoAfrHpvtz2Z888DgxCfqCM6/1EGnHbByVaVH 8aIJIw0EGsw8/jCLaddsr1OhNtwdCvUUuACpECYN+YYliOwqLUVIQJMydoitFm/kcmwQ VF8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ROJxUKF4ozP3LXQH8wzMsHzOmSKxOrW0h+5+6kQNd1M=; b=OjLL9lEhLcZdv98IBGLwqIILxuZBqzdNl+Vs4On95GyZaBU55yTmgwv7a7pqZxTgiE aipsoqcZPzb1owzak9vybAMNwQ5e7dAfGGWCdFXXUdiKCh9k6FPIJugo5cK5S0EGNlvR MD3GJxacNbxV9FGnRurG0pAE3iHtLHVW2FvudBcBhtLCAOUZ3E0CWL1OafxDK+LdnGl8 Q3g1tohEc8vzHiGQ2bngtjTxwipq0KMWp4TP0ayi6ukyDy2bUj35Jeu3EKSTrkxLpldk y4/OFOdUKcqmFBF+drKaWlYfSH4y7UDXyF3CNxQtpNU5m4Bx1VytCZ2yVphA3JxWMqAS Dmnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GbmokYcD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j20si10506444jak.112.2021.07.10.08.46.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:46:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GbmokYcD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FBf-0001wg-FG for patch@linaro.org; Sat, 10 Jul 2021 11:46:39 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472367 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1374820jao; Sat, 10 Jul 2021 08:56:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ7G6eqOERO7nxcGNqcJK2tuJGOPEcOrRI4xy4YIHQ8AfyjtdmXlW0Uw8Psfwe4MdXEYph X-Received: by 2002:a67:6d01:: with SMTP id i1mr41988334vsc.15.1625932561432; Sat, 10 Jul 2021 08:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932561; cv=none; d=google.com; s=arc-20160816; b=nn7mrLl3wnaYRTCVbMfV91rt7JmesHKv05goiE6hmGvnHVd7XKmHf8+vqAb9MIVExF d9UQE947afV3/LcDpj+J677wDLuboalEY+8ca4gwkd26no5ACHv5ALHNG4bJGqcD21Dn EGU/Od5Mn0yVrWN3k1WB/KdypJNS0go/vPss2rFGBSj9iyeqH5Y4lqoAmlhfjEBW7DnG oa0mppsjf90IlJ39WdjvIU4MijaDVz1Z4jHI8t872mE6geJcxOTLHmYBLLkdCXDSnEdB lgx6djabBDeQ3LEWshaSEx5otnQGrY3ZW6K/O/hxfH7DRxWQUBlrKToE2xR1sPxOEVnG CkjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ZRs8c+bYXTrMqFwEkSuK8yjMifIV/i4B8zW/9Y2Jl1o=; b=oE3yctJmtDwr0R0WX+6zVqoLlpUeqBBJn1NHK02o9AJBM3ay7PMZ7cOuZNLogcGZw+ m8/5MPxlgZHmh9AOLF5YHVn6ia/z8fsSuE4T9SftMjH7dDgqtcuzfxaPCwVOWY20B7pz 1zcKsnuGyxUE+u4DfLRm0zJ4WiXlZCPujykpuyzTjuwbQiaZuI9LePmchPxmrhP8izPf ytzGalQeIT0W5uLvlK8RJsUYnRS/gwOquLxAi+p7hu/Nj18cKjp+ORLwLCw0d6rObzQ4 2cvujsE+zPRTBuNEuew7t74Vk8HtsX6sx1f7KNf/ecwc4drLwt5WjRtOOlOU0m6wtfdm IcZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MYMWwg/Y"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i59si8935667uad.36.2021.07.10.08.56.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:56:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MYMWwg/Y"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FKi-0004t4-Sm for patch@linaro.org; Sat, 10 Jul 2021 11:56:00 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472368 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1375697jao; Sat, 10 Jul 2021 08:57:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ9XN2oRIx1i/vswjdxLvGJVlmYiWfdagfzd4PY9dZJ36XzPtzv85IhC3DtfLiV1r68OjU X-Received: by 2002:a05:6214:4b:: with SMTP id c11mr41862259qvr.18.1625932642786; Sat, 10 Jul 2021 08:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932642; cv=none; d=google.com; s=arc-20160816; b=CF8pNl9cFxrlmkdcjnMZm1cZqHvIbFeLnMbQGbBQP+NAobGNvDUXzZKm4s1885iI5i NPi+1s5nVK1ITlqCQIOBFHNPCii0pyDm1Ss3Ldn5L6H4HCKO/UHQAkmmiFxrBf9h2nqb qnx12b7QpccIfBx4daPOLJrAO+JENaDbrr0ZDisBb2Dn9U/gWW8yAbDKfHGqqR+ikLNE RRaKZW/k1m+G0LCddGnbBLszLLuL4UJWuPttUN1aLKqnIiITdpztQWgBMGDxY+gc75Y1 Zx8JiTN+ILyT3flPOo7Z+y6QotbOkZO6zdMjnOe0ucz3Wrx4TXRQC3GjdxnLYuz08MkM Pjig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=N9trJ1kjKGoNILkYQrFrW0/ogeTQmik7Rpq4HjTsUMQ=; b=aXnzvFTKVALIfPxQJ7xZ3wWkzVcaUnD/Y4UBVa5eP+alhSkTfhrbrN+/yn8Cv9X9M+ lkSTHnsmxlcsWfBJjPWI8Xmr9xVNDKjrv5kWpkZfpO/dLHLswnYJPvq/UmmPCyQaxWvO bU40/aOneKdCcat0rnJSrFEbKZbcFOR9Uc6CQTwcBOlNY8o8WWbKU6IwCxG+t6MVt/vC Fjcr3JHK5+Nm4ysBSnAwK3bh6SwCNYfpNkhO4pcWlhAxDbPE5YzSrcQwCWwK+ErAmgq8 uJ1aacghjaf/o9G+Z4LgKRJbXBv+pi4TYacRqv6fVDb4pSfU9ckjFS4iMps/+wNpxl7m 5Nuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tpns8aJP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y124si8448350qke.378.2021.07.10.08.57.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:57:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tpns8aJP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FM2-0006SB-5X for patch@linaro.org; Sat, 10 Jul 2021 11:57:22 -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-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+patch=linaro.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 -- 2.25.1 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: 472369 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1375999jao; Sat, 10 Jul 2021 08:58:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLSdjAYFmvgGkjHGwaxFXoOl8aj7PQvFl8s3QOKtHwyoNH69sVSR/4EMktq1Bek2kyng4t X-Received: by 2002:a0c:e54e:: with SMTP id n14mr12649246qvm.41.1625932685163; Sat, 10 Jul 2021 08:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932685; cv=none; d=google.com; s=arc-20160816; b=z85/FEioVWaSen2lKOhh91bU+yXoIYNO41E8lOzHS2qEhuQZhGZnuACeRCPBRp6UZh CrYCgR4zE9FwK73Kfim8uRcTCgGbQYl86h/6GhxK9Yl6l/lvudgXpahrU70KSTaU1co/ hwBgyS+G0pNByJN2p/Y5OJ6+xxIicECkR2TANCTEt5jz9lhqj1rqps5nbpXXzP1csNrj QmG4VljAXQF1cc8CootanPkt2YFI0fN36UGwkkvtGEF2Dw+1bR6i8jMaDXhQO7E0Z+5f pkn+p0NMmxajfUzMuRmJvcx3l0sCm06+zxRFXPkJDbfHuVne2v2ze2WCstM60BCYUcdi R2SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=i7Yv44S3soVKhBIR2nVe5GqBZQT4ofBHKeU6kY+QU8k=; b=w7/Bisr/SIrdok80qZu5pjllnvDHRwoshIyRRlHLlvpfdqKvkv9hdEiBB/sMgdMskF 9Eq8UwHGIiUJO/COE0fe3wKrH2tsGAoYI4N5Zllh9vHmRCpIFF+RBJSpae18lIWKJSHP 6GMm8FJ1hwRHyXRA4qi2CFXy5jxxJtchp3zdMR8miCd7DGUJjQHaP2h6CrKFcdrZNpGs 0QvLy1ns2wQtmbd6BjnLBaF874e3xmibnTsNGKwGXqpghNAlJym60CiFFbaIC6DNwCR7 Hig3QyTT4Pa4LQ5Y6e3vvdb4LIfSu53VkibsIcaWZ1CW3Pws8lgkFPCkXz3vYrBHiAGZ SPJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V0dlMkBD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w17si8036559qkw.155.2021.07.10.08.58.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:58:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V0dlMkBD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FMi-0007yS-JN for patch@linaro.org; Sat, 10 Jul 2021 11:58:04 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472361 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1372321jao; Sat, 10 Jul 2021 08:51:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5CvFq/G/zmnycaUCuzvT+0vDanpalNiWI1wVp+5Cr5Hdaxz9tXH2QdxLrC8HsVVbniXA5 X-Received: by 2002:a92:d8d1:: with SMTP id l17mr1518250ilo.187.1625932275207; Sat, 10 Jul 2021 08:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932275; cv=none; d=google.com; s=arc-20160816; b=0aliPziydsa7qnXsZEq4MSviPrmW0HcffOlB1hYwzDVPRH09vK/IZMcsUF5Q+56mOw kO58lSpXblv8SCh7MwtSBQ8v9T4oNfIsFuLBcaDH+SJtLRUYyrxx7IGlOqxYHAIMfWNs sHTbLUM4DG5qsRDk9JipPtE4hprIbkiU6vbaiNpLzOrskx6QvToD2qYPMx2bcEq6MwtP DQvULNs3TIHCPzHMRLU9XCONRPR+I/aHD6NsjNklVrQQ71b0p32gfg7KJ2inXygfP5l+ ujLPw1Xf5CHL8ERWtaE54eh3srPZgRxdJ+4p/IfUzhVrzJHxG4veTLhxRaGUYg5qOCjL Cr1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=UL9lKIoQlLvt7I/sySzh/3RjeNWeRLX3v5RFNYO4U8s=; b=bZ+cuxkjYYsmXLgTBTDZ2hBT2mVlvWrf8bEnIqgtmvO3xAS6gu9cxIeW8ayly0DIta vko/HYyORMXVsrJZt+fJPLz6HXc5fX1DtMFdQLQTJQtFAREkX2+uY+G6bHODXRt5UDYr pULVUr6sFf1ll+EDgHEcs/9hMwCnspddC9yEqRlhFHX9iJaPFdrc4jyaYue8Tp7nm8Wi 8memudbDmmyrM0okUexA1g/P0wfwa4E95A/MC9Hh18pxZFZEhnlRLCTZB29EZVhIk6/m wQGOA8kVi7GpSyoQ2X0V7FV19N0HkktzqePynuRtB5AFvSqK5GWxx4zv2IUieQQkZSDb Lb1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fkm12orO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p31si11935349jac.95.2021.07.10.08.51.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:51:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fkm12orO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FG6-0004MG-MN for patch@linaro.org; Sat, 10 Jul 2021 11:51:14 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472363 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1372900jao; Sat, 10 Jul 2021 08:52:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzevJw7QEjmdCfL3oiAtQpIR7OlZVIbaSShi6HFs9KHOUAk/GXFGq8pnttfvXFniblXEXT X-Received: by 2002:ab0:2ea1:: with SMTP id y1mr3802290uay.3.1625932343416; Sat, 10 Jul 2021 08:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625932343; cv=none; d=google.com; s=arc-20160816; b=eyG9U8mu5bwgAEgKYBjfeY6Z37BQQAljRiAXAo/WDYXgZ+a+KNjWyoEFZQ1usA7sC+ VbAA4hucTPMIveZU+v/UmTrdEEPEnyscUDcBWK39XWKTgqOlsfVKOfyDTF7AMMoSVFux 3DutCGzDnHtqhxCwuhYsHuw6b/5Wtu2EanlHwK7WjTnB3OdJo1puAPdjDTt3ePNNNwfZ yEClV8on4xNzjRU4jSxqobGdN7Dv+ZFWiQV2KiXz36a4VhGR2IkvO403ug4SKeN90tQV mwfTsG8xbH603BFnz/9mgG6qRFq3BxTu/dcGCGw/yhSGjhohQBoVNXhpc9/IRGsoHlQ6 LxDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=86TtjrEbriXGpZEXnuTm5RRc+rJIXXR9ggO6OBw5ugM=; b=icWRUvPUncrO/hDLhwWfJLPExmMcE8Dn94vcKY7+dsJun7v4yMQBBtIJAHerbmAAjC w/h/MsZXLJQwMbSeUD5/f6ohHTXuqAcw0Bke/FrsaZS7uGG8r16+cbE8qwoLy8tK72Ry IeElsJkAZxt4mJccT8sBS7/LV97QbtjR1gvuWUWTnKNC86FgPXqikIkrm8Hke/KxIRZT DHyzZAdmAvbAfvvrFLx37Ks5Miz5A/zc8W5rIept9vrUlRN2RY0bpzGBJqp1A7DOYBXo Hz3hmneoagdraeTKjhIEmkmQXPdzwsbOySGxQtqigDf/y1XTiG2xbEKUliTVLXXJmLIK qQaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qwj4aO2I; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o8si9657316vkf.80.2021.07.10.08.52.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:52:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qwj4aO2I; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2FHC-0007VC-N9 for patch@linaro.org; Sat, 10 Jul 2021 11:52:22 -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-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+patch=linaro.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(-) -- 2.25.1 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: 472348 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1367779jao; Sat, 10 Jul 2021 08:42:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMn+O7cVXiqu/P3Y/wpNb0YWAFH7C3tKYkZz5aDD6UjboeqfoCLnK30T69WTC18Xwxhtqk X-Received: by 2002:a05:620a:450f:: with SMTP id t15mr40866756qkp.411.1625931759420; Sat, 10 Jul 2021 08:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625931759; cv=none; d=google.com; s=arc-20160816; b=EjdCz1DrLG+cJ+qoVLRx7hjdeoJLayb0eMuQdlXJRmBp0GkC5YQoUMyVlez/L3I5X4 8926AJ1sAc7fE9Q355Jo66nmkFEGckfY90hSPHbJ/8STefkPqj7tmtyQXbe/8Enb6cL9 oNuG/cfHaAKpsMfp/PLrW6lsMeq/BGv/Eio9imP8iVcrodGO/UcHGXIG9lII5/X6jTSf Vlc0bMUzWwgMnLIMER+Ua2tFaI0YPTiWjONEs2vbxWogh92mw7LqHTQ9yIjO3q3GA5TH sbViqm6N0f7B6VcBPIDrlb/EMAlkJIXobq17akeWotQxr28GTnZQliEVfA3iIyIHrhKV GV7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=E/MTlm5POUZQMp7Vf72rfKOh2eap4oJEXTCEaGTp+rQ=; b=T68p54GAQe6glZpe9HRHwhAVUwEMWtimyHa4DQgXwEZtUGZveOFGX3Vmr9ah14XWZ0 BehVd8AL7FHGWecGM5TuBzO++tobGUA8f+xz4xtz0aFM9DBxddlOfOMxUJTp5QZg2Lbb qfx54C+A6ocJ2QYTlATvkDlLESQFLawBwfGRnet0aDZjfHr81oOta38LKZOEc2N+YtAl PywTGu1lS5qOvma9X7mhwDCDpAjfkJJtTHQtJ/mN/iBEN/B0uTGvF0pQYFY4T09OzJML VCldsbAWVmnkNUfG+8/VcYv1oFQWGTiBzTppqd4vVXpmBszj69wMQoa5VCx8AnsepNWs +uVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n5dQdGQa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r14si7705759qtc.78.2021.07.10.08.42.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jul 2021 08:42:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n5dQdGQa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2F7m-0007Dt-Ql for patch@linaro.org; Sat, 10 Jul 2021 11:42:38 -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-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+patch=linaro.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(-) -- 2.25.1 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"