From nobody Tue Apr 8 23:32:36 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539715290077636.6724758623652; Tue, 16 Oct 2018 11:41:30 -0700 (PDT) Received: from localhost ([::1]:59712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCUHY-0007jU-NZ for importer@patchew.org; Tue, 16 Oct 2018 14:41:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCTTZ-0004EU-3d for qemu-devel@nongnu.org; Tue, 16 Oct 2018 13:49:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCTTT-0001EW-W8 for qemu-devel@nongnu.org; Tue, 16 Oct 2018 13:49:48 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:41141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCTTT-0001Ds-OS for qemu-devel@nongnu.org; Tue, 16 Oct 2018 13:49:43 -0400 Received: by mail-pf1-x42d.google.com with SMTP id m77-v6so11819454pfi.8 for ; Tue, 16 Oct 2018 10:49:43 -0700 (PDT) Received: from cloudburst.twiddle.net (174-21-9-133.tukw.qwest.net. [174.21.9.133]) by smtp.gmail.com with ESMTPSA id 6-v6sm17441210pgl.6.2018.10.16.10.49.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Oct 2018 10:49:40 -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; bh=d0dyaKvSPopezwzsfmkll4fXI/kC81rwwkatVdVGoD8=; b=Cpo7JPOZd6YsZHXlS3c0n2gDspD0BliR55ClOs5tw87xOKcbWIuyLbfhQgmheKakcZ n8yeoCCtwc9v1Jz5AggPwR0DuEQQw3WosrbchcKIdWndr1PI3guDTvLNALD63be14+V6 Dt4ytOD3ZtkRcDbKj8TzMPh39KvK5R0nrHV50= 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; bh=d0dyaKvSPopezwzsfmkll4fXI/kC81rwwkatVdVGoD8=; b=HrgwnXyiHDuQCLpYat16i13xrWeBAyUC6NLjwRi89FdcAqSJ33X18WFg7xNlYDKMXP rsonmryYvykrwRP0/SLctpYRzj6m6OnPdgJ5EY38cHyfXgfYvUdyaMC1ngXWD2SqJLIS d08PnG3w887xzpQDGZ6EqEk/OJij64IIxg/ukSQigKzTlPTGZxbVsdw1RVO+SMYVGbSq ybg4QO+7hW8j6oDf6OFtxEJrhN/D+AK0IDniSE7jVdZRcEOS6z65zmE8IEH3OjDl6T0e vDHN2AxD7Fc98dNf/NyPYZOxlHLqDtd1Hslb8xbcO+q68p1Na3EGqQtwwAhRlBhtRN0n 7eAQ== X-Gm-Message-State: ABuFfog2n/6rSjvL0P3GQMSHjGnaEsE4toELEaEdpYryAH00DU1CCRTi aJSJBHdvm2pmcjfZxVsj0cVg1OCOzas= X-Google-Smtp-Source: ACcGV632nqno+hl1mWHqOc3wsTlZjjYfoCbiChFmbWv7kEg4TKy56lr7pWG5f1LoygK/PXF7OtUJsw== X-Received: by 2002:a63:fd58:: with SMTP id m24-v6mr21494300pgj.132.1539712182372; Tue, 16 Oct 2018 10:49:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 16 Oct 2018 10:49:09 -0700 Message-Id: <20181016174911.9052-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181016174911.9052-1-richard.henderson@linaro.org> References: <20181016174911.9052-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42d Subject: [Qemu-devel] [PULL 19/21] target/s390x: Skip wout, cout helpers if op helper does not return X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When op raises an exception, it may not have initialized the output temps that would be written back by wout or cout. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/translate.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 18861cd186..a7bd689337 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -1128,11 +1128,19 @@ struct DisasInsn { =20 const char *name; =20 + /* Pre-process arguments before HELP_OP. */ void (*help_in1)(DisasContext *, DisasFields *, DisasOps *); void (*help_in2)(DisasContext *, DisasFields *, DisasOps *); void (*help_prep)(DisasContext *, DisasFields *, DisasOps *); + + /* + * Post-process output after HELP_OP. + * Note that these are not called if HELP_OP returns DISAS_NORETURN. + */ void (*help_wout)(DisasContext *, DisasFields *, DisasOps *); void (*help_cout)(DisasContext *, DisasOps *); + + /* Implement the operation itself. */ DisasJumpType (*help_op)(DisasContext *, DisasOps *); =20 uint64_t data; @@ -6125,11 +6133,13 @@ static DisasJumpType translate_one(CPUS390XState *e= nv, DisasContext *s) if (insn->help_op) { ret =3D insn->help_op(s, &o); } - if (insn->help_wout) { - insn->help_wout(s, &f, &o); - } - if (insn->help_cout) { - insn->help_cout(s, &o); + if (ret !=3D DISAS_NORETURN) { + if (insn->help_wout) { + insn->help_wout(s, &f, &o); + } + if (insn->help_cout) { + insn->help_cout(s, &o); + } } =20 /* Free any temporaries created by the helpers. */ --=20 2.17.2