Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3467541imu; Sun, 11 Nov 2018 15:46:57 -0800 (PST) X-Google-Smtp-Source: AJdET5daaAtapQgi+0CWpLSYnCAS+DRnqz7Vtpwz6JUyA6mzD30smHRl/uq9Hr5g/n9qtieCyi7E X-Received: by 2002:a63:da14:: with SMTP id c20mr14954681pgh.233.1541980017087; Sun, 11 Nov 2018 15:46:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980017; cv=none; d=google.com; s=arc-20160816; b=KrNqC6pJLoCAqTJniDvmzEXSohph8cE6iywecStd27FiimmeT1EdulvZvVsBvc164R j8MeR4m0ynSa53OPDD+7Vvj00TLe0XqdWUZOHO2Vkij+Py/wHiZZBpUeLqDE/n5UpJ9W FzIu5SEDD8FxbPELBrAqYRO50CLetwGgRc6VpRLYEQ55tSUqpKry6Yp7dSKBNzFT33zB BDlPjiuzC+nKq/Xygh+8yYHFx5GSknhBQY2QCQkXw/JYoda2UWXbnnR29BduwcPlSwP3 2xx/IiG86lndZEB5E4R/mFBgd2NFNgWRldgFIEeU86W0m+h3iNHXD9f/LBw03yYY4xwf RvEA== 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=UYPSY2KEQXkbPQqM6RwCB+8sgi7yGnTmHVUI7IQEITQ=; b=Y8yi8m6W5Vf9/PNYrfuIfDTA+bILoi0doG8gcf0Z9kEbACb+/hvT0ZYZsYe2NgPIYF LQ7kiQxYOMv0GNyRk2m/oTG5bGGSAy2gcbWF8PRF8V0ac65ibnjQMuk9j4IsVHUG5wi2 aQtnhl56dQ3ecoiouOIf0lYHEiw2f85KyxdiDv/pKUvuE5lMtJlUZNcTHT5XIy7oqKgb VSleT3Y6KEvo5qiY25u30F7WXEsHKAYWy+tsKZUy5zblj6gm4BLlYHIY7SE7NtDr8e+P eF2v84qYEzEHgAmZ3CvL21w+hNvRsv3DB9rVtXh16p46j7npuVYfICIj8eeXn9wWeu7w KGqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="W44v/Vil"; 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 l11-v6si15828115plt.5.2018.11.11.15.46.42; Sun, 11 Nov 2018 15:46:57 -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="W44v/Vil"; 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 S1733269AbeKLITB (ORCPT + 99 others); Mon, 12 Nov 2018 03:19:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:39662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730142AbeKLITA (ORCPT ); Mon, 12 Nov 2018 03:19:00 -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 7D11F21582; Sun, 11 Nov 2018 22:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975344; bh=apw8YlYBNGnGMRBA+HLO2jTJdDvWE2oVb8xj4laZfhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W44v/VilaGPeOu3VLFKlaTfxAoorzxY4yxGWyd/CEFveIv4KGYah3pJR9ZdnofWMK yETP2lGP+GLE0xXGn2KMmCEbfpUAkz+G+xIt2zxUwX5VVFicfUD38afnKPf+U0jsl+ /1U9rhdwp6K17Eity86PjEZjdeIbs3CCjH3X5IDA= 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.19 324/361] selftests/powerpc: Fix ptrace tm failure Date: Sun, 11 Nov 2018 14:21:11 -0800 Message-Id: <20181111221659.320523158@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@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.19-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",