From patchwork Tue Oct 16 17:49:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 148997 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp5454945lji; Tue, 16 Oct 2018 11:40:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV62bmKtr1oHIrWi5Bl5AxKyLqaKTrsvq/OaXYJZIDG0zfLQaPDIKClCYO/zQpJmtFvAbbjzq X-Received: by 2002:ac8:ec3:: with SMTP id w3-v6mr21776366qti.138.1539715224886; Tue, 16 Oct 2018 11:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539715224; cv=none; d=google.com; s=arc-20160816; b=E146ERkzANfCkSeTmXLhcIABaDlSWbBJa8yISayiO+FCRvhcsf/WBCxQQoKuVeo3N5 dZp8pUEbBX6MsleL1fD9vsVJSXOnShMTQx4kKuWVVqn5s/jUb3nSR279jK05sNXar10S vKZc+821HDFWIbdtp9HDxwO+irjYb9hItXrCp5Fz8TPPTXMk23MtPPhKKjkRwZa1ND8+ 5qWs63n0GPRzU9WIgpetCfstzIbA8J9yFMFa2eM9ebLQ8Qr7nL5DAO54ta308oZnaGKR YT2/flMRFDuTfY33vW3LXz82iFCV6JvEbvp5JC9HzVfGv+xHNFuV210gtThxYiPOB5aW BqDQ== 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=tg/eyWAH9YXjRNfGh+1jTH/f3cfmIjH/9QT/DmF2LtPv9+L/NNAIzJSlNe4V2L0qC2 6IRTP6Czv7douxia6gZLJz9buBkrAi6XGBCKZcC7lNBrtKKZPS70dGYITPxzVR2es5tt /e9K4T2+lm7XzVOuCQdPXyJfXhaPIyO5XUCJZOLDCGsksVrtegqZ8SkSahMyPPropOdK cMMxxTrreIHp3q8dOJMeXGUBnp993g0o8wd1UBsBI2mv5BR1JN1iis7EBekfvQ7wl9oY x4iEHykJW5zILAPQRHyL8s4TlYdKO20JG8j4+CIShfyhFunmFga8VtVRs8CtCYyKLdj/ Ltcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Cpo7JPOZ; 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 f132-v6si3351420qkb.45.2018.10.16.11.40.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 16 Oct 2018 11:40:24 -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=Cpo7JPOZ; 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]:59696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCUGW-0006pM-81 for patch@linaro.org; Tue, 16 Oct 2018 14:40:24 -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) 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-Received: by 2002:a63:fd58:: with SMTP id m24-v6mr21494300pgj.132.1539712182372; Tue, 16 Oct 2018 10:49:42 -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) 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+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. */