From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, James Hogan <james.hogan@imgtec.com>,
linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 4.9 080/125] MIPS: Fix mips_atomic_set() with EVA
Date: Tue, 25 Jul 2017 12:19:55 -0700 [thread overview]
Message-ID: <20170725192018.694820190@linuxfoundation.org> (raw)
In-Reply-To: <20170725192014.314851996@linuxfoundation.org>
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <james.hogan@imgtec.com>
commit 4915e1b043d6286928207b1f6968197b50407294 upstream.
EVA linked loads (LLE) and conditional stores (SCE) should be used on
EVA kernels for the MIPS_ATOMIC_SET operation of the sysmips system
call, or else the atomic set will apply to the kernel view of the
virtual address space (potentially unmapped on EVA kernels) rather than
the user view (TLB mapped).
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/16151/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/mips/kernel/syscall.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -28,6 +28,7 @@
#include <linux/elf.h>
#include <asm/asm.h>
+#include <asm/asm-eva.h>
#include <asm/branch.h>
#include <asm/cachectl.h>
#include <asm/cacheflush.h>
@@ -138,9 +139,11 @@ static inline int mips_atomic_set(unsign
__asm__ __volatile__ (
" .set "MIPS_ISA_ARCH_LEVEL" \n"
" li %[err], 0 \n"
- "1: ll %[old], (%[addr]) \n"
+ "1: \n"
+ user_ll("%[old]", "(%[addr])")
" move %[tmp], %[new] \n"
- "2: sc %[tmp], (%[addr]) \n"
+ "2: \n"
+ user_sc("%[tmp]", "(%[addr])")
" beqz %[tmp], 4f \n"
"3: \n"
" .insn \n"
next prev parent reply other threads:[~2017-07-25 19:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170725192014.314851996@linuxfoundation.org>
2017-07-25 19:19 ` [PATCH 4.9 079/125] MIPS: Fix mips_atomic_set() retry condition Greg Kroah-Hartman
2017-07-25 19:19 ` Greg Kroah-Hartman [this message]
2017-07-25 19:19 ` [PATCH 4.9 081/125] MIPS: Negate error syscall return in trace Greg Kroah-Hartman
2017-07-25 19:20 ` [PATCH 4.9 087/125] MIPS: Fix MIPS I ISA /proc/cpuinfo reporting Greg Kroah-Hartman
2017-07-25 19:20 ` [PATCH 4.9 088/125] MIPS: Save static registers before sysmips Greg Kroah-Hartman
2017-07-25 19:20 ` [PATCH 4.9 089/125] MIPS: Actually decode JALX in `__compute_return_epc_for_insn Greg Kroah-Hartman
2017-07-25 19:20 ` [PATCH 4.9 090/125] MIPS: Fix unaligned PC interpretation in `compute_return_epc Greg Kroah-Hartman
2017-07-25 19:20 ` [PATCH 4.9 091/125] MIPS: math-emu: Prevent wrong ISA mode instruction emulation Greg Kroah-Hartman
2017-07-25 19:20 ` [PATCH 4.9 092/125] MIPS: Send SIGILL for BPOSGE32 in `__compute_return_epc_for_insn Greg Kroah-Hartman
2017-07-25 19:20 ` [PATCH 4.9 093/125] MIPS: Rename `sigill_r6 to `sigill_r2r6 " Greg Kroah-Hartman
2017-07-25 19:20 ` [PATCH 4.9 094/125] MIPS: Send SIGILL for linked branches " Greg Kroah-Hartman
2017-07-25 19:20 ` [PATCH 4.9 095/125] MIPS: Send SIGILL for R6 " Greg Kroah-Hartman
2017-07-25 19:20 ` [PATCH 4.9 096/125] MIPS: Fix a typo: s/preset/present/ in r2-to-r6 emulation error message 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=20170725192018.694820190@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=james.hogan@imgtec.com \
--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