Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3428299imu; Sun, 11 Nov 2018 14:53:21 -0800 (PST) X-Google-Smtp-Source: AJdET5eVzYuV1E3DzUVaRn1s2A6V3ACbqIMQLtEpEP0ozaHyLSvDPOTpCjoWKtiJJV2IkRlWmJWK X-Received: by 2002:a62:9402:: with SMTP id m2mr1038704pfe.34.1541976801323; Sun, 11 Nov 2018 14:53:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541976801; cv=none; d=google.com; s=arc-20160816; b=1EhJNPdP1tyLNkTBv9bF7SfSTHGt/ho+/6KH/5mtTBSS++cKfxVI4l7CFav9si/OSF MOo7FJsZkOuwWprX05mD5IaW4xJHyNm6iyBG9E1XxSynBvZWx0TsLOaDae6j69VmgeYm JvlpLB424Y//9ABt2n6wytyhHz2PFY73ItYWPhRX38CN3pr7w97qoyZSOu9VnWn3ChgH agO+WeCZub7B6kCItPfciW4VSe1/7yop3IiRpKCpWYp1XTGiWh8FWB08Tzu7r/ND2rDC xansgASeLSjBtviqwNqJtzJ10dFKp05X1idRRB7BtLaGy3WTmTJpaw5OfwiSvPJrBaXL Vu8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NVXmBTqcjjwlgjc7Xzm4oc8RBTtVfudDPjPL5/yLit4=; b=gTosQRuaJCse+cW886own8mIsCEgHsD7+FWMsouyLp6r0nZTR9DjddBT8NPNraZDNA oWkE/Y6FsVXfprR9qaQ9jiFURsRsDH+7EYTS7YyRYA3+dbRhQwBgKzgT260pRCovZ//O GKV6dm+1SHqmuKqG1uof8DfBBBWxJVGGn4ZNqB367XBaqh2DheXdY0swaI2af0f11+kU g20NQ1MmP/FJi70LJ/cGX9tmYZb4Wzao9JHcmLLzHs9+BHpsCW+fTZ6yqICPOtwTSESM 15kD64avFhKsR7YPHsiRqIZqsSdHdEzvpmj0G0OIm0U1tQqR2ECt6cGNMguWNOSXKI0Q M5NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dTr9dRUt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 20si13769323pgg.271.2018.11.11.14.53.06; Sun, 11 Nov 2018 14:53:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dTr9dRUt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404164AbeKLIXG (ORCPT + 99 others); Mon, 12 Nov 2018 03:23:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:54672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404047AbeKLIXF (ORCPT ); Mon, 12 Nov 2018 03:23:05 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 357B521582; Sun, 11 Nov 2018 22:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975588; bh=/EPWfoYsszQ8SpP8mmrSf7ynesryXKHQ+feuK5bbDPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dTr9dRUt6+rzMryizj/g0orjyR9xWIUpv8Lj5y+keB9EBx+OqOqgePgskrZ0aiTb5 y21suPfEr2KVPdHV1s4FGmYvW2fyC65DUkBjSdZ+Tw+SbcuH88vrUwM6bZAv5t2lkV WkNeVZGguBBF0vT5zx0r1dgrFF451g8q8oQVH24Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Breno Leitao , Segher Boessenkool , Michael Ellerman Subject: [PATCH 4.14 195/222] selftests/powerpc: Fix ptrace tm failure Date: Sun, 11 Nov 2018 14:24:52 -0800 Message-Id: <20181111221704.257267154@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Breno Leitao commit 48dc0ef19044bfb69193302fbe3a834e3331b7ae upstream. 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 Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-gpr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-gpr.c +++ b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-gpr.c @@ -67,8 +67,8 @@ trans: "3: ;" : [res] "=r" (result), [texasr] "=r" (texasr) : [gpr_1]"i"(GPR_1), [gpr_2]"i"(GPR_2), [gpr_4]"i"(GPR_4), - [sprn_texasr] "i" (SPRN_TEXASR), [flt_1] "r" (&a), - [flt_2] "r" (&b), [flt_4] "r" (&d) + [sprn_texasr] "i" (SPRN_TEXASR), [flt_1] "b" (&a), + [flt_4] "b" (&d) : "memory", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",