Received: by 10.192.165.156 with SMTP id m28csp1137270imm; Wed, 11 Apr 2018 13:08:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx49uHK9K8bzBkV8PKK15nT4NOlvJAnU7vGqz7y3cKXwY6dQNjG0ScIyj2qx6CZp5D1qF4y4U X-Received: by 10.98.194.195 with SMTP id w64mr5186572pfk.83.1523477282397; Wed, 11 Apr 2018 13:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523477282; cv=none; d=google.com; s=arc-20160816; b=fhuL2p+1f2upjKzlBoLolfYVVyyTckQIRgDpqRdM3wBZZlhaLUu8jbbPZ54PYGhJcM OhBqmmtJcV/wWxSLpxjSbh+QE+5kE+B97FiLHiLRO2n+zZeOUGcMIkLtOGEdm8zlQS4G NvD222gC1h94IaK++UTW3XAzG526xYqTiQZJhbGhzAd7fVgD/fYb6uPjPYC4SAc80HkC 2hUFkWbcONW84kyfT6oHBuWQBvS1cOR4GGy5k1Osb78mMAOB8UteSkP7nrQBuv/Jk/f4 KWLFF1xAT5GwPna/6HE6UMjNM4n6AzUZTgJdXtFyGk6D3Fr1ahu2qmCVeRim4jMwkO7b +vyQ== 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=bKcY2SC02CDQmNRolIAJZPizvWpgMeUaLDe1IzXzsKc=; b=T8YypFB5cnTHXIHQJgsfdK2TteenJhkbX9shMsd6lGlA/iHz9cdcY5b8vdWdqZ58Jk vRuoypEj/pjC55lOyjjbSTrqgsm7NeL7yfUSmGfzaOxvuYwAd9iMDX4P1Ma+2WRu7/dE L/qjCKdGXVxgZ4xMAxqCF1HXgYLpMhlF199LG5tf1bnpVwjwCrWtKg4SFtSOhKs+CIBA k4+bdv1Aujd/ba0YmBtkMtSW3uc+EuTcuAY0gfPJ4j/rv5sBTJ6aOQTGTBk2bZxkvzvr B8QAH0LEo5wR9CBiyL68/W+PXasx6GEtQsQFlI1w3vA0oPnvkxNvZtKo8EiukL+MRv+p U++w== 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 61-v6si1778422plz.630.2018.04.11.13.07.25; Wed, 11 Apr 2018 13:08:02 -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 S933838AbeDKS4G (ORCPT + 99 others); Wed, 11 Apr 2018 14:56:06 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35654 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933012AbeDKS4C (ORCPT ); Wed, 11 Apr 2018 14:56:02 -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 02933C03; Wed, 11 Apr 2018 18:56:01 +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.9 080/310] selftests/powerpc: Fix TM resched DSCR test with some compilers Date: Wed, 11 Apr 2018 20:33:39 +0200 Message-Id: <20180411183625.738182385@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@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.9-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 @@ -42,12 +42,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;"