From patchwork Sun Feb 6 10:31:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 540406 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp4635442imr; Sun, 6 Feb 2022 02:47:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLts5ZBXwC+ArL9j0NgzW2tAgNlIlDOmIY9+WPJmdXgD2JOVd3btvJpseo92EVYYiLCZCx X-Received: by 2002:a05:620a:f13:: with SMTP id v19mr3885841qkl.84.1644144464166; Sun, 06 Feb 2022 02:47:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644144464; cv=none; d=google.com; s=arc-20160816; b=zBxyj64IYJhDTm9fIqlinAw6Yytdbpj4cQRBZUQCY1p5wFyifAWhBYWLQVqIgLEAZQ U3NySCOJ2opwO/WV+k1kQogN5VYB9J8d1lg58Z6cpQhnGLmUaOPk3CMQJAGFP4RrH8c2 Qb09NOinMki1kwPheXo4JFlW8u/2hp8665jp4D+dJcWCzC1iQp1cjhw+W49p/0jdG7wY 7YEZN7CE2vBImF71nZCOh7ibuH0xCR0rVDkO733Syl0ZkxJQXvkJQVJt6RqVU0yJZKHX +Juxa3FWjWdRdR6t5gVxylI+v2NSDfvLNuhkgNYbQz9hQDTjf/eiK1aDE8VlbWCOqWCA IRjg== 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=veQnK6WaTjZ3A8j4hv7hC4c+w1i5jtwOSMWU/0mqUcQ=; b=BYQbDsVJBq4qQyTBlF4KiumH2c9nyeHEFHd3Azq+fXHFnkR/WNB+pRrZAi7I+6TqBY icR6j6s5SFlhfeZUxLV9jOyJ2zNv6lQdof/8gC52s8GWlyCY5pcsP76x/wC5jIMuBBDy ixaZ6XtAZHxsZJd0jxnR5gtzEsbU0fWeQit+xHd7yEymfLRdmA9aCMco+YfEmoVaLjia 0hgPf1da6c1h0HsKOiBDmVgrpBDz9Mis8UFGMDe+LY2SftOsJnMNgMl/8gMHBeyVBzlT GnFIIg2sO+9WRBaWjG6y4/QM0Lb8nZFpyBq/PpPEdTcVBOHgl8UgJaxrOqcuhx5Q09LO 0CtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s2H2kKG5; 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 t124si1585151qkb.699.2022.02.06.02.47.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 06 Feb 2022 02:47:44 -0800 (PST) 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=s2H2kKG5; 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]:52378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGf55-0004a3-P4 for patch@linaro.org; Sun, 06 Feb 2022 05:47:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGepn-0004Va-8W for qemu-devel@nongnu.org; Sun, 06 Feb 2022 05:31:55 -0500 Received: from [2607:f8b0:4864:20::434] (port=40842 helo=mail-pf1-x434.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGepk-0002OW-Kp for qemu-devel@nongnu.org; Sun, 06 Feb 2022 05:31:54 -0500 Received: by mail-pf1-x434.google.com with SMTP id e6so9138603pfc.7 for ; Sun, 06 Feb 2022 02:31:52 -0800 (PST) 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=veQnK6WaTjZ3A8j4hv7hC4c+w1i5jtwOSMWU/0mqUcQ=; b=s2H2kKG5xzFoKo5msj7vNX98PpxvnZw0q4MPyti7Se8jRwGsqp1zbzqZsu+Yjbs/eh ksACrSBxP2Xulnv+KNzwJGYXWghsPkLpch7FEk4d8KVx6vuO/FS4/ViQqQf+0+ZNOCeX aCPni6SQ9kSYDenj5+kOOsDDyGPEG+fg4G9Y/YA/P5ARhxTiUFQ1tidUHF6OJCAqrsBE PMciEeHCRi1SNoXii6a8jjxBso4W375RtmaY9pdRlBk7b02mpQj3qDfTmrkY3ExJ3lcQ DFJjwAoM+Q07WqveDCvLPyhY/FQdIcgR1+TxqgUv9VDs69DYmZHax+KvESdOGKKHy0Lk A0/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=veQnK6WaTjZ3A8j4hv7hC4c+w1i5jtwOSMWU/0mqUcQ=; b=6eRB9bVc0XCIHyBvlv8H/fVkYCInTmwDBQJhHFNKmqvAvbk02FGJP5/VQqy4YW8dXa Mbd+M0qsv6H7jqoNW+quHIucud4pAY6aP0ZKUcc8rNEcKwAsVhBCLKw4LaE+PJ91mz7e EOZNNBf1s4cpd50/1mpy7OCeUhARREtjpaZ0N1IB7QmOIr0VoMKH5b0nOl/frwLp95TW tbO1mU4XLL9KkAz9MKieBWjvdKmL7XGaoM6bZsh5QV7NubPiOkqldJ19uNsYzkuw2Vs+ 4zsOzsbILo8XBrWojGyw43b288jkNvUpd/+aFO1p0LoqW3CDautI0QYeTLIE/nu/nuKu bToA== X-Gm-Message-State: AOAM531EtsoWqU6ZYV6QRWI+eieE4kEnqq4NjQxdors0W/mp6rOZwbv8 RS+WuFLaGXfs2SFq1dwqQnAE1O4qIfcbl1qf X-Received: by 2002:a05:6a00:1396:: with SMTP id t22mr11095603pfg.82.1644143511235; Sun, 06 Feb 2022 02:31:51 -0800 (PST) Received: from localhost.localdomain ([220.235.247.127]) by smtp.gmail.com with ESMTPSA id s2sm5605937pgl.21.2022.02.06.02.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 02:31:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 3/6] tcg/sparc: Convert patch_reloc to return bool Date: Sun, 6 Feb 2022 21:31:35 +1100 Message-Id: <20220206103138.36105-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220206103138.36105-1-richard.henderson@linaro.org> References: <20220206103138.36105-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::434 (failed) 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: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Since 7ecd02a06f8, if patch_reloc fails we restart translation with a smaller TB. Sparc had its function signature changed, but not the logic. Replace assert with return false. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- tcg/sparc/tcg-target.c.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tcg/sparc/tcg-target.c.inc b/tcg/sparc/tcg-target.c.inc index f9afb1bffc..f3043e6833 100644 --- a/tcg/sparc/tcg-target.c.inc +++ b/tcg/sparc/tcg-target.c.inc @@ -323,12 +323,16 @@ static bool patch_reloc(tcg_insn_unit *src_rw, int type, switch (type) { case R_SPARC_WDISP16: - assert(check_fit_ptr(pcrel >> 2, 16)); + if (!check_fit_ptr(pcrel >> 2, 16)) { + return false; + } insn &= ~INSN_OFF16(-1); insn |= INSN_OFF16(pcrel); break; case R_SPARC_WDISP19: - assert(check_fit_ptr(pcrel >> 2, 19)); + if (!check_fit_ptr(pcrel >> 2, 19)) { + return false; + } insn &= ~INSN_OFF19(-1); insn |= INSN_OFF19(pcrel); break;