From patchwork Tue Sep 19 10:45:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 815427 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xxKPh56d9z9s7m for ; Tue, 19 Sep 2017 20:49:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="V/L795LF"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xxKPh3vbBzDqXv for ; Tue, 19 Sep 2017 20:49:28 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="V/L795LF"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xxKKk4gz7zDq8f for ; Tue, 19 Sep 2017 20:46:02 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="V/L795LF"; dkim-atps=neutral Received: by ozlabs.org (Postfix, from userid 1010) id 3xxKKh4p2fz9sBZ; Tue, 19 Sep 2017 20:46:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1505817960; bh=piN7JiJskffwYtugGECP+D2ntwpnl/6miVBuG41hty0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V/L795LF2qByLdR7zKEF2diM7RVlHXrNvOadlRgfzNC7+YQS1JUhHzBMK5Z6O9c9g gxQI25qkbO3GgmAZQ/DOvaS/dUSXeHFrZWpVqay4CDij6PCOqlIVF3Rhf4g0yhxAs3 VtuFC80Q3InyTofSivrsWFOuFjqpo3mpdkLRnGKdDNscC1bc33h6wdKCyYlWNV9lXo T78PhAnkphjyjK9QtH4229IlNiMPq73UCjOwfzItc9dhrghSYJHO3Kih4M96z4dBZQ bX3EtA0oWLEIQi+7AVKnHwWCXph2XDRwDs2YK7lUZknx5ruVGHI0l4YW7KV0YEh5K5 iJWInBLjdDR5Q== From: Anton Blanchard To: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au Subject: [PATCH 2/2] powerpc/sstep: Fix issues with mcrf Date: Tue, 19 Sep 2017 20:45:53 +1000 Message-Id: <20170919104553.5146-2-anton@ozlabs.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170919104553.5146-1-anton@ozlabs.org> References: <20170919104553.5146-1-anton@ozlabs.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Anton Blanchard mcrf broke when we changed analyse_instr() to not modify the register state. The instruction writes to the CR, so we need to store the result in op->ccval, not op->val. Fixes: 3cdfcbfd32b9 ("powerpc: Change analyse_instr so it doesn't modify *regs") Signed-off-by: Anton Blanchard --- arch/powerpc/lib/sstep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index 9d72e5900320..c4cda1afb49d 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -1513,10 +1513,10 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, op->type = COMPUTE + SETCC; imm = 0xf0000000UL; val = regs->gpr[rd]; - op->val = regs->ccr; + op->ccval = regs->ccr; for (sh = 0; sh < 8; ++sh) { if (instr & (0x80000 >> sh)) - op->val = (op->val & ~imm) | + op->ccval = (op->ccval & ~imm) | (val & imm); imm >>= 4; }