Received: by 10.192.165.156 with SMTP id m28csp1173939imm; Wed, 11 Apr 2018 13:54:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+iU3dhha6cqJN0JbnfwJWo11oSgnpoUmirNvVmmkrmygnIy39u/DbwbILiu1OCJUkyUJUX X-Received: by 2002:a17:902:68c5:: with SMTP id x5-v6mr70027plm.194.1523480065198; Wed, 11 Apr 2018 13:54:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523480065; cv=none; d=google.com; s=arc-20160816; b=lQ5bexXWnZ7Ab8TbD+DEFpICFqwQ+nLeGcZYPb4DQZ4VwDEZkborliyx3Ge1S/sMFe N2TgpRp+aXElNBd166NvdXju+2f4gNKHqH4mdydVdi+LbUGyohMFVvuayUFejHPvTq6Q IYKrkvcOt7ja10VNN9KOOGVtzh8frLQjN+H2vesIFu7FUbANDvEetjrwXojosCdjGaVS pAR2MiZc3O8pe7Kx7xKsB/BiogyYU/8UF7d/IZKsP9Iu5evy/+Mr2TWf1Q0rdlRNPh9k mMa/t72+ea0UqQtIiYEEVI7n+WQKmMVVNDpTo6ZrA2xn9KAnJW2TVGgLjUpfA1V7pBow 9nqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=M+c3tt4+80N+BcnaW3Oqg87HWxl0iHqWzHUQSOmjXVI=; b=CSiazTsXsx3GiMtDqsvDsCivT5yGyHoM1EOZ8A7pQDA0wf40ZZ/GnAeawF+bKLG8/N jyuJF5wtZRx3zfzSrPLGio6Q62j4P1wnqrGPWzGIc+Ld6HhybAuk7e2/P2kMS7nNpVu4 WxCtzW+7W4L50TeLl7Xe9qFnTCdUrg1wTY4WqIemk2dIGowgK1/7x6gi9IT9e+jidDev D0HKyH26NFQm2UPT0UVSjnxHLBpDKRyTtjLq8n1pBsyCOKnQzngvH92Y/unf/RRHSON7 KHzj4RGgRBB/nsiLYV5HifqolzN4vI/Z+ykFS61LOUO6Oand55pylHSiaB3U0q7u+wUp KyoA== ARC-Authentication-Results: i=1; mx.google.com; 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 u75si1401687pfd.183.2018.04.11.13.53.48; Wed, 11 Apr 2018 13:54:25 -0700 (PDT) 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; 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 S1755957AbeDKUuy (ORCPT + 99 others); Wed, 11 Apr 2018 16:50:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58710 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755591AbeDKSps (ORCPT ); Wed, 11 Apr 2018 14:45:48 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 54FDCCA5; Wed, 11 Apr 2018 18:45:47 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman , Michael Neuling , Sasha Levin Subject: [PATCH 4.4 053/190] selftests/powerpc: Fix TM resched DSCR test with some compilers Date: Wed, 11 Apr 2018 20:34:59 +0200 Message-Id: <20180411183553.414119907@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183550.114495991@linuxfoundation.org> References: <20180411183550.114495991@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Ellerman [ Upstream commit fe06fe860250a4f01d0eaf70a2563b1997174a74 ] The tm-resched-dscr test has started failing sometimes, depending on what compiler it's built with, eg: test: tm_resched_dscr Check DSCR TM context switch: tm-resched-dscr: tm-resched-dscr.c:76: test_body: Assertion `rv' failed. !! child died by signal 6 When it fails we see that the compiler doesn't initialise rv to 1 before entering the inline asm block. Although that's counter intuitive, it is allowed because we tell the compiler that the inline asm will write to rv (using "=r"), meaning the original value is irrelevant. Marking it as a read/write parameter would presumably work, but it seems simpler to fix it by setting the initial value of rv in the inline asm. Fixes: 96d016108640 ("powerpc: Correct DSCR during TM context switch") Signed-off-by: Michael Ellerman Acked-by: Michael Neuling Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/powerpc/tm/tm-resched-dscr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/testing/selftests/powerpc/tm/tm-resched-dscr.c +++ b/tools/testing/selftests/powerpc/tm/tm-resched-dscr.c @@ -45,12 +45,12 @@ int test_body(void) printf("Check DSCR TM context switch: "); fflush(stdout); for (;;) { - rv = 1; asm __volatile__ ( /* set a known value into the DSCR */ "ld 3, %[dscr1];" "mtspr %[sprn_dscr], 3;" + "li %[rv], 1;" /* start and suspend a transaction */ TBEGIN "beq 1f;"