From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 726ABC46475 for ; Tue, 23 Oct 2018 17:02:46 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE2C220665 for ; Tue, 23 Oct 2018 17:02:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE2C220665 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42ffpC5wfBzDrRN for ; Wed, 24 Oct 2018 04:02:43 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: lists.ozlabs.org; spf=permerror (mailfrom) smtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=segher@kernel.crashing.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42ffm83jxrzDrcP for ; Wed, 24 Oct 2018 04:00:56 +1100 (AEDT) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w9NH0hgm006584; Tue, 23 Oct 2018 12:00:43 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id w9NH0f7o006583; Tue, 23 Oct 2018 12:00:41 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 23 Oct 2018 12:00:40 -0500 From: Segher Boessenkool To: Breno Leitao Subject: Re: [PATCH] selftests/powerpc: Fix ptrace tm failure Message-ID: <20181023170040.GP5205@gate.crashing.org> References: <1540242986-7510-1-git-send-email-leitao@debian.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1540242986-7510-1-git-send-email-leitao@debian.org> User-Agent: Mutt/1.4.2.3i X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mikey@neuling.org, linuxppc-dev@lists.ozlabs.org, stable@vger.kernel.org, gromero@linux.vnet.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Oct 22, 2018 at 06:16:26PM -0300, Breno Leitao wrote: > Test ptrace-tm-spd-gpr fails on current kernel (4.19) due to a segmentation > fault that happens on the child process prior to setting cptr[2] = 1. This > causes the parent process to wait forever at 'while (!pptr[2])' and the test to > be killed by the test harness framework by timeout, thus, failing. > > The segmentation fault happens because of a inline assembly being > generated as: > > 0x10000355c lfs f0, 0(0) > > This is reading memory position 0x0 and causing the segmentation fault. > > This code is being generated by ASM_LOAD_FPR_SINGLE_PRECISION(flt_4), where > flt_4 is passed to the inline assembly block as: > > [flt_4] "r" (&d) > > Since the inline assembly 'r' constraint means any GPR, gpr0 is being > chosen, thus causing this issue when issuing a Load Floating-Point Single > instruction. > > This patch simply changes the constraint to 'b', which specify that this > register will be used as base, and r0 is not allowed to be used, avoiding > this issue. > > Other than that, removing flt_2 register from the input operands, since it > is not used by the inline assembly code at all. > > Cc: stable@vger.kernel.org > Signed-off-by: Breno Leitao Acked-by: Segher Boessenkool Segher