alistair23-linux/arch/arc/kernel
Peter Zijlstra e8708786d4 ARC: Improve cmpxchg syscall implementation
This is used in configs lacking hardware atomics to emulate atomic r-m-w
for user space, implemented by disabling preemption in kernel.

However there are issues in current implementation:

1. Process not terminated if invalid user pointer passed:
   i.e. __get_user() failed.

2. The reason for this patch was __put_user() failure not being handled
   either, specifically for the COW break scenario.
   The zero page is initially wired up and read from __get_user()
   succeeds. A subsequent write by __put_user() induces a
   Protection Violation, but COW can't finish as Linux page fault
   handler is disabled due to preempt disable.
   And what's worse is we silently return the stale value to user space.
   Fix this specific case by re-enabling preemption and explicitly
   fixing up the fault and retrying the whole sequence over.

Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
[vgupta: rewrote the changelog]
2018-07-09 11:22:05 -07:00
..
.gitignore ARC: Add some .gitignore entries 2013-08-26 09:40:24 +05:30
arc_hostlink.c ARC: Hostlink Pseudo-Driver for Metaware Debugger 2013-02-15 23:16:10 +05:30
arcksyms.c ARC: export __udivdi3 for modules 2016-08-19 14:09:33 -07:00
asm-offsets.c ARCv2: [vdk] dts files and defconfig for HS38 VDK 2015-06-25 06:00:21 +05:30
ctx_sw.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/debug.h> 2017-03-02 08:42:34 +01:00
ctx_sw_asm.S ARC: dw2 unwind: enable cfi pseudo ops in string lib 2016-09-30 14:48:22 -07:00
devtree.c ARC: [plat-hsdk] initial port for HSDK board 2017-09-01 11:26:28 -07:00
disasm.c ARC: rename kconfig option for unaligned emulation 2014-10-13 14:46:15 +05:30
entry-arcv2.S ARCv2: make unimplemented vectors as no-ops rather than halt core 2017-03-20 18:47:57 -07:00
entry-compact.S ARC: typos fix in kernel/entry-compact.S 2017-08-28 15:17:36 -07:00
entry.S ARC: Re-enable MMU upon Machine Check exception 2017-09-01 11:29:05 -07:00
fpu.c ARC: Process-creation/scheduling/idle-loop 2013-02-11 20:00:38 +05:30
head.S ARC: smp-boot: Decouple Non masters waiting API from jump to entry point 2017-01-24 11:12:28 -08:00
intc-arcv2.c ARCv2: SMP: Mask only private-per-core IRQ lines on boot at core intc 2017-08-28 16:11:15 -07:00
intc-compact.c ARCv2: SMP: Mask only private-per-core IRQ lines on boot at core intc 2017-08-28 16:11:15 -07:00
irq.c ARC: Enable machine_desc->init_per_cpu for !CONFIG_SMP 2018-06-20 16:12:06 -07:00
kgdb.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
kprobes.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-11-15 16:47:22 -08:00
Makefile ARC: Remove empty kernel/pcibios.c 2017-08-02 14:53:35 -05:00
mcip.c ARC: mcip: update MCIP debug mask when the new cpu came online 2018-02-28 10:45:31 -08:00
module.c ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds 2017-01-18 11:17:44 -08:00
perf_event.c ARCv2: perf: optimize given that num counters <= 32 2017-11-21 15:20:55 -08:00
process.c ARC: Improve cmpxchg syscall implementation 2018-07-09 11:22:05 -07:00
ptrace.c ARCv2: ptrace: provide regset for accumulator/r30 regs 2017-05-03 11:21:31 -07:00
reset.c arc: export symbol for pm_power_off in reset.c 2013-11-06 10:41:44 +05:30
setup.c ARCv2: boot log: fix HS48 release number 2018-02-28 10:45:30 -08:00
signal.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
smp.c ARC: setup cpu possible mask according to possible-cpus dts property 2018-02-28 10:45:32 -08:00
stacktrace.c arc: do not use __print_symbol() 2017-12-20 12:41:43 -08:00
sys.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
traps.c Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2018-01-30 14:18:52 -08:00
troubleshoot.c get rid of pointless includes of fs_struct.h 2018-02-22 14:28:50 -05:00
unaligned.c ARC: [arcompact] brown paper bag bug in unaligned access delay slot fixup 2017-02-07 10:02:01 -08:00
unwind.c treewide/trivial: Remove ';;$' typo noise 2018-02-22 10:59:33 +01:00
vmlinux.lds.S nmi_backtrace: generate one-line reports for idle cpus 2016-10-07 18:46:30 -07:00