lkml.org 
[lkml]   [2018]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 4.14 29/72] locking/qspinlock, x86: Provide liveness guarantee
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
> > <gregkh@linuxfoundation.org> 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
From 35c4feb16f5204faa40e9b0451cd86549819f375 Mon Sep 17 00:00:00 2001
From: Peter Zijlstra <peterz@infradead.org>
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 <lkp@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-kernel@vger.kernel.org
Fixes: 7aa54be29765 ("locking/qspinlock, x86: Provide liveness guarantee")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
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
\
 
 \ /
  Last update: 2018-12-20 19:51    [W:0.373 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site