From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Ben Hutchings <ben@decadent.org.uk>,
Ralf Baechle <ralf@linux-mips.org>,
Deng-Cheng Zhu <dengcheng.zhu@mips.com>,
linux-mips@linux-mips.org, James Hogan <jhogan@kernel.org>
Subject: [PATCH 4.14 023/193] MIPS: cmpxchg64() and HAVE_VIRT_CPU_ACCOUNTING_GEN dont work for 32-bit SMP
Date: Tue, 28 Nov 2017 11:24:30 +0100 [thread overview]
Message-ID: <20171128100614.611270137@linuxfoundation.org> (raw)
In-Reply-To: <20171128100613.638270407@linuxfoundation.org>
4.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <ben@decadent.org.uk>
commit a3f143106596d739e7fbc4b84c96b1475247d876 upstream.
__cmpxchg64_local_generic() is atomic only w.r.t tasks and interrupts
on the same CPU (that's what the 'local' means). We can't use it to
implement cmpxchg64() in SMP configurations.
So, for 32-bit SMP configurations:
- Don't define cmpxchg64()
- Don't enable HAVE_VIRT_CPU_ACCOUNTING_GEN, which requires it
Fixes: e2093c7b03c1 ("MIPS: Fall back to generic implementation of ...")
Fixes: bb877e96bea1 ("MIPS: Add support for full dynticks CPU time accounting")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Deng-Cheng Zhu <dengcheng.zhu@mips.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17413/
Signed-off-by: James Hogan <jhogan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/mips/Kconfig | 2 +-
arch/mips/include/asm/cmpxchg.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -65,7 +65,7 @@ config MIPS
select HAVE_PERF_EVENTS
select HAVE_REGS_AND_STACK_ACCESS_API
select HAVE_SYSCALL_TRACEPOINTS
- select HAVE_VIRT_CPU_ACCOUNTING_GEN
+ select HAVE_VIRT_CPU_ACCOUNTING_GEN if 64BIT || !SMP
select IRQ_FORCED_THREADING
select MODULES_USE_ELF_RELA if MODULES && 64BIT
select MODULES_USE_ELF_REL if MODULES
--- a/arch/mips/include/asm/cmpxchg.h
+++ b/arch/mips/include/asm/cmpxchg.h
@@ -204,8 +204,10 @@ static inline unsigned long __cmpxchg(vo
#else
#include <asm-generic/cmpxchg-local.h>
#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
+#ifndef CONFIG_SMP
#define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n))
#endif
+#endif
#undef __scbeqz
next parent reply other threads:[~2017-11-28 10:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171128100613.638270407@linuxfoundation.org>
2017-11-28 10:24 ` Greg Kroah-Hartman [this message]
2017-11-28 10:24 ` [PATCH 4.14 024/193] MIPS: ralink: Fix MT7628 pinmux Greg Kroah-Hartman
2017-11-28 10:24 ` [PATCH 4.14 025/193] MIPS: ralink: Fix typo in mt7628 pinmux function Greg Kroah-Hartman
2017-11-28 10:24 ` [PATCH 4.14 045/193] MIPS: pci: Remove KERN_WARN instance inside the mt7620 driver Greg Kroah-Hartman
2017-11-28 10:24 ` [PATCH 4.14 048/193] MIPS: Fix odd fp register warnings with MIPS64r2 Greg Kroah-Hartman
2017-11-28 10:24 ` [PATCH 4.14 049/193] MIPS: Fix MIPS64 FP save/restore on 32-bit kernels Greg Kroah-Hartman
2017-11-28 10:24 ` [PATCH 4.14 051/193] MIPS: Fix an n32 core file generation regset support regression Greg Kroah-Hartman
2017-11-28 10:24 ` [PATCH 4.14 052/193] MIPS: BCM47XX: Fix LED inversion for WRT54GSv1 Greg Kroah-Hartman
2017-11-28 10:25 ` [PATCH 4.14 053/193] MIPS: math-emu: Fix final emulation phase for certain instructions Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171128100614.611270137@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=ben@decadent.org.uk \
--cc=dengcheng.zhu@mips.com \
--cc=jhogan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox