From patchwork Tue Apr 4 15:04:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 670045 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp2496259wrt; Tue, 4 Apr 2023 08:05:28 -0700 (PDT) X-Google-Smtp-Source: AKy350YJWcjApTlYXzbkdT6BfRc61XgVsS54L4FKD7+9RtkMRqPR/b1LztfiOaw6IUwh1Wi85JW/ X-Received: by 2002:ac8:5dc7:0:b0:3bf:c474:df98 with SMTP id e7-20020ac85dc7000000b003bfc474df98mr3168517qtx.56.1680620727453; Tue, 04 Apr 2023 08:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680620727; cv=none; d=google.com; s=arc-20160816; b=zyTVU3gVtFh12sTgWqPr+FBbN+nTcMhX261YGXV7drrRw6+beQk3zvfykFj7USKR8O dAEeoUmsQ/CQ/IGcAiahh255zmZz4+PJ6bKEwQgSIIoS+E3KQ+zh7qx3sOQySEAqSqU8 32JnXUEorOi5bwWkSPemVZtrALeHGakYf4uKuvqNR/yIRKla8O4xXJgYaIV8XxMhpgwi /erFFCz6QfYAJnGrICIwZ56Ajoxp51XluPCunoTHoagfuVx375Aa9lPjEhA6gyFCvwk8 w2VKspbSzHbKqct/c0ZCLyi3ViBAbTrF4+j9yibMBROMv67C9twFzCZ3zCVhjDWxM5jw EpLg== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=6xMVCBhwZpi/WE/lHJiBdLctPgtyWm5BEEwKw+b1210=; b=HMaFGPOlfjnl2w+aFZJebA+sXwM+L4cpY4RTiL0c11SdaAhqTpPtLrgQ1x2rYuwRIe ymrf65M4QpwDmCtLtshhlme3a6d75vMHcN/BTOykTd0hlOe/1/wHqd7iTESENWLUM7ya fDaQZ+VigdI3iT6Tu/qhFsmMEefcXl7xaiXHyfZGeftUBy6EA6oA79hWM5vYVQ5cPxKQ G12/UVSphu+JNk1KRK5NCAkP/Neqcr2dj1g2wM2L5gH05AprJRaE3uCU3ypKGaJBz9iG MZdARojH9CncLF4xdywVl51Ah1poeZoTphLoi7I+rDVdhpYtCe8B5uHtDnTG9+B3aGt0 +jnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u5twseoF; 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 g6-20020ac85806000000b003b9bf43fcfbsi8104501qtg.74.2023.04.04.08.05.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Apr 2023 08:05:27 -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=u5twseoF; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjiDI-00036W-Cl; Tue, 04 Apr 2023 11:04:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjiDC-00035x-DA for qemu-devel@nongnu.org; Tue, 04 Apr 2023 11:04:46 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjiD9-0000AK-2B for qemu-devel@nongnu.org; Tue, 04 Apr 2023 11:04:42 -0400 Received: by mail-pl1-x629.google.com with SMTP id n14so15690090plc.8 for ; Tue, 04 Apr 2023 08:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680620677; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6xMVCBhwZpi/WE/lHJiBdLctPgtyWm5BEEwKw+b1210=; b=u5twseoF9tbzcnlt4UkX6wkoaT17OkMZaMib9Vh3WZ6MZUvaN8ljY0DTPBZGIqYSf/ EaaG04k9cMVj/NtHT6ZxNz6MidV/x1i2Y7OQlX3QNFKvy7gi6eVXz6s3uSWn0503IDps pwCzXEi2tel7nMEGftlWUfZaTuH4k7eCHIiNZbmNZo2EMGOyY+ZlnQBX7GjyTcOqBOVQ P/HcDw0+fK3Ye9hfmPFgFCh+CCmfAP/kiDypiW89oXLS8chsHS80/Gz+AqJ0V2orOnva wqwakKn4EvuPpz9VKRnG9danymkRdw8ZHqnugnerCHGHlYVv4qRPX6kzc9Qc8eyICEWQ sQ9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680620677; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6xMVCBhwZpi/WE/lHJiBdLctPgtyWm5BEEwKw+b1210=; b=f8ct/a2Hb8YwqI5v3esyT/R2Cf2eSmHNYQlXl3RVh4isXvZ6bZ7Ss7tngsB4HR2xEw TqgtPxhjS25a53sSzfWqimwpR4JB8O+wRbbTimglTf/bIQizbk2qbnDbhQgmzotcw8th xKzRn+z6gqJx9GxeyMZF4zBv9WrcYgGo3PXvy1fzJpiPwmtcJTw8X0IS3wPVqVw3ud40 iJayWkuHwzfKmzjzlQxmmBMRv1Id21z+QqQUMfJC+y4vucmHsmdTL63wmxV2LwqterDH x1xGF6UHU5xg9l8yU4JneWhVlbwEmEnzDA9nlTRM0482a+IfW3FfacT4QOKz9IHF40SP 6FDg== X-Gm-Message-State: AAQBX9dLLGyVX1yJRkBbBvjTf7t37TSqfyfQDZLMSpWU61KEwzWvEpXr gRdg+btryabJEMvMPEMiJMDKIErikQmlWDfLT48= X-Received: by 2002:a05:6a20:8b14:b0:cc:a5d4:c31e with SMTP id l20-20020a056a208b1400b000cca5d4c31emr2887797pzh.10.1680620677012; Tue, 04 Apr 2023 08:04:37 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:1d41:7730:d7dd:6f41]) by smtp.gmail.com with ESMTPSA id e14-20020a62aa0e000000b00622e01989cbsm1782703pff.176.2023.04.04.08.04.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 08:04:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, philmd@linaro.org Subject: [PATCH for-8.0] tcg/sparc64: Disable direct linking for goto_tb Date: Tue, 4 Apr 2023 08:04:35 -0700 Message-Id: <20230404150435.1571646-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 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.29 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-bounces+patch=linaro.org@nongnu.org Something is wrong with this code, and also wrong with gdb on the sparc systems to which I have access, so I cannot debug it either. Disable for now, so the release is not broken. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- tcg/sparc64/tcg-target.c.inc | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index ccc4144f7c..694f2b9dd4 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -1445,12 +1445,12 @@ static void tcg_out_goto_tb(TCGContext *s, int which) { ptrdiff_t off = tcg_tbrel_diff(s, (void *)get_jmp_target_addr(s, which)); - /* Direct branch will be patched by tb_target_set_jmp_target. */ + /* Load link and indirect branch. */ set_jmp_insn_offset(s, which); - tcg_out32(s, CALL); - /* delay slot */ - tcg_debug_assert(check_fit_ptr(off, 13)); tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TB, TCG_REG_TB, off); + tcg_out_arithi(s, TCG_REG_G0, TCG_REG_TB, 0, JMPL); + /* delay slot */ + tcg_out_nop(s); set_jmp_reset_offset(s, which); /* @@ -1469,28 +1469,6 @@ static void tcg_out_goto_tb(TCGContext *s, int which) void tb_target_set_jmp_target(const TranslationBlock *tb, int n, uintptr_t jmp_rx, uintptr_t jmp_rw) { - uintptr_t addr = tb->jmp_target_addr[n]; - intptr_t br_disp = (intptr_t)(addr - jmp_rx) >> 2; - tcg_insn_unit insn; - - br_disp >>= 2; - if (check_fit_ptr(br_disp, 19)) { - /* ba,pt %icc, addr */ - insn = deposit32(INSN_OP(0) | INSN_OP2(1) | INSN_COND(COND_A) - | BPCC_ICC | BPCC_PT, 0, 19, br_disp); - } else if (check_fit_ptr(br_disp, 22)) { - /* ba addr */ - insn = deposit32(INSN_OP(0) | INSN_OP2(2) | INSN_COND(COND_A), - 0, 22, br_disp); - } else { - /* The code_gen_buffer can't be larger than 2GB. */ - tcg_debug_assert(check_fit_ptr(br_disp, 30)); - /* call addr */ - insn = deposit32(CALL, 0, 30, br_disp); - } - - qatomic_set((uint32_t *)jmp_rw, insn); - flush_idcache_range(jmp_rx, jmp_rw, 4); } static void tcg_out_op(TCGContext *s, TCGOpcode opc,