From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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> List-ID: --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--