From patchwork Fri Oct 19 06:06:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 149232 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2911875lji; Thu, 18 Oct 2018 23:18:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV62pIXHYjS9YW1VJWe+9ezZRZlHYKGg+UGc9zA59KX3qsUlLbjmoV2o24jq5CqFRNs14kfJt X-Received: by 2002:a37:8fc7:: with SMTP id r190-v6mr31614785qkd.36.1539929905824; Thu, 18 Oct 2018 23:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539929905; cv=none; d=google.com; s=arc-20160816; b=op1c8OubW6krShZqo3sTZMUGJksSAv3QoDTwg7Kru8UACGBAy+lGVkiNHEVW3mBXA+ 7dPqBnWcUXlY+HJme1/PT6Obfp84mUUOg4SG22Ot1FSODROiZN/jYiIfm/k3NG2yo1Hk UUEZ/BxdZOIX6Qdy7tgvnTNEllYWhzduKSfibnjhEUeIWFim9xGnnswVZw7YBD3iAOsA cRr/UzYaOjMWwamqibhvGOWCdiZtFWyv/ZiKv7Z+YrC1Y5JMFirAFc1xKQvbbr7I6psJ 4AP5w6VEfVc/RKD1cdJMUZUjOdPxcbykhmZmyTvypEX+2y+q7XG5iXHCkhnC4+IsU6X0 CuSQ== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=d0dyaKvSPopezwzsfmkll4fXI/kC81rwwkatVdVGoD8=; b=RvMoxdRfPxhvflzY7mo+7zYQn3RD+NZll7oTFIYU8scFt7AupIDRGbXGMOgOpLehfB PCMO/aHhy4Sh9uoFIcmIwUbSaWnq8U3hsSdpn9ZkIdUbl9tyEufYd6VkQxaz3E687qZI eG+F7mUc+h/64a7KqAHMT+JQhPJerEZtVEyNY7xNiZoKCsenAxaqwcRBnK8MSFO2MVJU 6PXiPgsMeOEnHpKGJRZxqzftZcHONpmFHU3fiIzT7RRSg8aJ+ZEW4DGFj1TO3UoGoXUa v1qFQE1jGNbD+kKWy/Gmo4supAOz7wsRT2QcM28trMrcMFCiMewj8nn2oO9CepH6bSYK uaxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=j+4PHveC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k189-v6si2579391qkf.123.2018.10.18.23.18.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 18 Oct 2018 23:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=j+4PHveC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:47273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDO77-00068D-8t for patch@linaro.org; Fri, 19 Oct 2018 02:18:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDNwh-0004SC-EK for qemu-devel@nongnu.org; Fri, 19 Oct 2018 02:07:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDNwf-0002m3-Ip for qemu-devel@nongnu.org; Fri, 19 Oct 2018 02:07:39 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:38379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDNwf-0002Lt-2N for qemu-devel@nongnu.org; Fri, 19 Oct 2018 02:07:37 -0400 Received: by mail-pg1-x542.google.com with SMTP id f8-v6so15301185pgq.5 for ; Thu, 18 Oct 2018 23:07:26 -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=j+4PHveCmgXcXlqpKcbiLkbgA7dpjxZcRqcsgLW32kuy9mS4/GjecwIIGKLtOVohpe F3jrzjv8/2iXcAClGu6BfuE4OqVfAGCN7Xkfoi9R1RmZ7yFbrN4wQ12rFD/CaRpYPvOh E69A4E3KfQUCoPzzWpWZz+CK3FMbYNFJzsmxg= 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=OvP5CptYhHrf5aU1g/SDvyEFEhfRYsbErW7DI6TqDCcmoX+mM5EajMOuKOzK6HaaoL HXbpmWU10+bzYBiGdtGcFK8HB3sztXrc5V/zYqHXqjB+QtJyKCaytaS7nsYEhhB2j2dV xBGra/dbhBAG2AqNwsVFvU4CrC8ASSRTE/xgpL3sFffApc8AcNZuzvRxyEcRpscace7D cD82142yUZVXkJ2ihTpwRzC6AuthE/OYOAR7UNttunkzX83x2csfDlKBzq5SeRr2CMzt dMGcJGKxcaxuggyoEZZbCUPRuqiFl06ekGvWrHncIipzJfoVeqN6TNQHeIUWSghNI73D w+9w== X-Gm-Message-State: ABuFfogSCynhjn/sjKWhzszE0Hg29oneinEoVFJK9mKanxI2t1kEQlwT iuZc5stxdqZ/m0/IdIypncs/6Uq1Y7g= X-Received: by 2002:a63:3203:: with SMTP id y3-v6mr31550905pgy.101.1539929244994; Thu, 18 Oct 2018 23:07:24 -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 q24-v6sm25609327pff.83.2018.10.18.23.07.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Oct 2018 23:07:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2018 23:06:54 -0700 Message-Id: <20181019060656.7968-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181019060656.7968-1-richard.henderson@linaro.org> References: <20181019060656.7968-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::542 Subject: [Qemu-devel] [PULL v2 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.17.2 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 { const char *name; + /* 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 *); uint64_t data; @@ -6125,11 +6133,13 @@ static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s) if (insn->help_op) { ret = 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 != DISAS_NORETURN) { + if (insn->help_wout) { + insn->help_wout(s, &f, &o); + } + if (insn->help_cout) { + insn->help_cout(s, &o); + } } /* Free any temporaries created by the helpers. */