Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp441601imu; Fri, 21 Dec 2018 01:37:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN4+Tj9IHTiinrfprGoo+0oNeCyLG/CbvH/WdsA6+UkyRfL56wCBhENj4+X4zMUUSwc6oGHg X-Received: by 2002:a63:df13:: with SMTP id u19mr1702281pgg.294.1545385034235; Fri, 21 Dec 2018 01:37:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545385034; cv=none; d=google.com; s=arc-20160816; b=k2oRnoQA11fChjq6B5EWY8AlJuwsq3tQuPdiL6mP0lwTSdGKes5U7GUqFqq1mPXquk eLyszWZJwZ9xJxtVMn283U0DGm2iidKi+h6QKM8bMw5vJtHS6DNKkdelIIv/leI5tEUp YJUnDsjuHi+dF9HRcBri8ZDg2odLL4B/ImBF+rHW2nimk+KDHe9jtzR6jorWf1WNtvik yqah9D4RR6vgi7l49mqur4ruVIKSt673kJcuBkZZPJ4/dWXYtSxQ1oSPsy0X3vZENaD5 2MNLBdIPr30NZOMU1gah2SKa0DNlVnprP+m/LumA0LBxh+04/vH3Y00ovDNfcRVtsUpn fyyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Hfv1b1fuyLl/ox0Hum/uZPqMCgwZnE/AhERr7F4zW7A=; b=Rq/1n2sNmrU0GPwD8eMFdkeAPmSPlPeKWtknRWN3Ehjrns4EH5LQw40goWH8QX9t9q +80I7LH470uLEEb43TMQQS9TmSppZEiGhpjismHukg2j/dSd4tikk2SEfeTCyUkSC7cx 6icU9E+iNGgDT2UF5yBPoscysWBysvxL2nMaHJO9Rz9YAy/Vr8KiVaiJoxxI9r/cPjm+ RF7at6f/EHrlucbOv4HKLyncf9ehojqMBIdeFlZfwxr9ypLjS0gzsv5MOKrcGaAyVS+T AtUYuKr81k7J4UjZ4V75tfxx2uSGuY8k/XiVrClzZEBdp7V/ljQ0wdre7ikF9f4agnCI 95Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qgQst0l0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si20319497pgq.553.2018.12.21.01.36.53; Fri, 21 Dec 2018 01:37:14 -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=@gmail.com header.s=20161025 header.b=qgQst0l0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388747AbeLTStr (ORCPT + 99 others); Thu, 20 Dec 2018 13:49:47 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42200 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725790AbeLTStr (ORCPT ); Thu, 20 Dec 2018 13:49:47 -0500 Received: by mail-wr1-f66.google.com with SMTP id q18so2827546wrx.9; Thu, 20 Dec 2018 10:49:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Hfv1b1fuyLl/ox0Hum/uZPqMCgwZnE/AhERr7F4zW7A=; b=qgQst0l0uutKUJlzdyrW7WZ/dYkArcrAcjnlTpRCbSL4dnrSDLNnA5Ux70oPX5SFaK g41K7Oux6NOt1uNs2Y6PdVkFN7K83rqgLGRmUvIS20Bz2VgOkdJUglXRloFUfMH4hheX Gqkz3icynAsRNh3KqIa5v+ySf6nm9C2aV8BJ623d1N4BedgZM4Uubz/xxt1wQYk1YLCh i+WG6d+6Ox7Stw461RsHHdcGjkwL/sj69nORIP+vro2i7w4BwMov1mU/kmI1C/YGSial 90pgt3MrUydBHRoQ/ESMgpH+12XBTS304zvXJUFGkHD6gOXohrT7li3r2AoTyA+YlmX/ lcxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Hfv1b1fuyLl/ox0Hum/uZPqMCgwZnE/AhERr7F4zW7A=; b=VdJKEUmg3GPVreovodY5zmPsrk2odn4yG8QVcp1W1GBBQdKvDtqUZ3jN9SxaIvf0Kp dZl/uF5omB0I1YI1wmypwSFpg10XLqPSNxNjB0sEDYxapmeUfR9lGZ7tLVtwF/yut5nC buTswssKg2iqnahmGRRaydEYQbC9Z20Cc46TmSK5lP+fgvLNOHG8ifBpENsCjlVAS7hq Z06gDhPScJebDSKQ/Jp09tM68xandy1rTPVIupIhhSh/HFtA8jQOzitTorcZkQaukbmW feoeyMqwrQ09UDdpwmySC8dRJpfeUOphccBnbhr/TB+cJ4E/nywFEehJ+yC+PAsqnlIs mxnw== X-Gm-Message-State: AA+aEWah0cR0Qxu8YCkxZqLud9X13avpTIjtGgLJFBO29gjax5rWvGB3 heymAoPNwqC8AuhEtFXLxxD9Ur8h X-Received: by 2002:a05:6000:1287:: with SMTP id f7mr24905398wrx.302.1545331784865; Thu, 20 Dec 2018 10:49:44 -0800 (PST) Received: from debian (cpc101300-bagu16-2-0-cust362.1-3.cable.virginm.net. [86.21.41.107]) by smtp.gmail.com with ESMTPSA id q185sm11408777wmg.14.2018.12.20.10.49.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Dec 2018 10:49:43 -0800 (PST) Date: Thu, 20 Dec 2018 18:49:41 +0000 From: Sudip Mukherjee To: Greg Kroah-Hartman Cc: linux-kernel , Stable , Will Deacon , Thomas Gleixner , "Peter Zijlstra (Intel)" , Linus Torvalds , andrea.parri@amarulasolutions.com, longman@redhat.com, Ingo Molnar , Sebastian Andrzej Siewior , Sasha Levin Subject: Re: [PATCH 4.14 29/72] locking/qspinlock, x86: Provide liveness guarantee Message-ID: <20181220184941.ykfjubbo3nj2mnpm@debian> References: <20181220085922.332225035@linuxfoundation.org> <20181220085923.488666294@linuxfoundation.org> <20181220154030.GA9962@kroah.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5babtpi2vnasgoql" Content-Disposition: inline In-Reply-To: <20181220154030.GA9962@kroah.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --5babtpi2vnasgoql Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Dec 20, 2018 at 04:40:30PM +0100, Greg Kroah-Hartman wrote: > On Thu, Dec 20, 2018 at 12:14:00PM +0000, Sudip Mukherjee wrote: > > Hi Greg, > > > > On Thu, Dec 20, 2018 at 9:28 AM Greg Kroah-Hartman > > wrote: > > > > > > 4.14-stable review patch. If anyone has any objections, please let me know. > > > > > > ------------------ > > > > > > commit 7aa54be2976550f17c11a1c3e3630002dea39303 upstream. > > > > Another upstream commit fixes this. > > b987ffc18fb3 ("x86/qspinlock: Fix compile error") > > Maybe, but that commit doesn't apply to any of these stable trees :( > > Care to provide a backport? Attached now. -- Regards Sudip --5babtpi2vnasgoql Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-x86-qspinlock-Fix-compile-error.patch" From 35c4feb16f5204faa40e9b0451cd86549819f375 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Fri, 2 Nov 2018 14:26:53 +0100 Subject: [PATCH] x86/qspinlock: Fix compile error commit b987ffc18fb3b3b76b059aa9e372dbee26f7c4f2 upstream With a compiler that has asm-goto but not asm-cc-output and CONFIG_PROFILE_ALL_BRANCHES=y we get a compiler error: arch/x86/include/asm/rmwcc.h:23:17: error: jump into statement expression Fix this by writing the if() as a boolean multiplication instead. Reported-by: kbuild test robot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-kernel@vger.kernel.org Fixes: 7aa54be29765 ("locking/qspinlock, x86: Provide liveness guarantee") Signed-off-by: Ingo Molnar Signed-off-by: Sudip Mukherjee --- arch/x86/include/asm/qspinlock.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/qspinlock.h b/arch/x86/include/asm/qspinlock.h index f784b95e44df..f0f2dd74b8c9 100644 --- a/arch/x86/include/asm/qspinlock.h +++ b/arch/x86/include/asm/qspinlock.h @@ -19,10 +19,14 @@ static __always_inline bool __queued_RMW_btsl(struct qspinlock *lock) static __always_inline u32 queued_fetch_set_pending_acquire(struct qspinlock *lock) { - u32 val = 0; + u32 val; - if (__queued_RMW_btsl(lock)) - val |= _Q_PENDING_VAL; + /* + * We can't use GEN_BINARY_RMWcc() inside an if() stmt because asm goto + * and CONFIG_PROFILE_ALL_BRANCHES=y results in a label inside a + * statement expression, which GCC doesn't like. + */ + val = __queued_RMW_btsl(lock) * _Q_PENDING_VAL; val |= atomic_read(&lock->val) & ~_Q_PENDING_MASK; -- 2.11.0 --5babtpi2vnasgoql--