linux/arch/arm64
Will Deacon 412fcb6ceb arm64: entry: always restore x0 from the stack on syscall return
We have a micro-optimisation on the fast syscall return path where we
take care to keep x0 live with the return value from the syscall so that
we can avoid restoring it from the stack. The benefit of doing this is
fairly suspect, since we will be restoring x1 from the stack anyway
(which lives adjacent in the pt_regs structure) and the only additional
cost is saving x0 back to pt_regs after the syscall handler, which could
be seen as a poor man's prefetch.

More importantly, this causes issues with the context tracking code.

The ct_user_enter macro ends up branching into C code, which is free to
use x0 as a scratch register and consequently leads to us returning junk
back to userspace as the syscall return value. Rather than special case
the context-tracking code, this patch removes the questionable
optimisation entirely.

Cc: <stable@vger.kernel.org>
Cc: Larry Bassel <larry.bassel@linaro.org>
Cc: Kevin Hilman <khilman@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Hanjun Guo <hanjun.guo@linaro.org>
Tested-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-08-21 15:11:43 +01:00
..
boot arm64: enable more compressed Image formats 2015-07-27 11:08:39 +01:00
configs arm64: defconfig: Add Ceva ahci to the defconfig 2015-07-06 17:22:59 +01:00
crypto Merge branch 'mvebu/drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc 2015-06-19 22:07:07 +08:00
include arm64: Add __exception_irq_entry definition for function graph 2015-08-12 17:23:45 +01:00
kernel arm64: entry: always restore x0 from the stack on syscall return 2015-08-21 15:11:43 +01:00
kvm arm64: kvm: Adopt new alternative assembler macros 2015-07-27 11:08:40 +01:00
lib arm64: atomics: prefetch the destination word for write prior to stxr 2015-07-27 15:28:53 +01:00
mm arm64: mdscr_el1: avoid exposing DCC to userspace 2015-08-20 16:17:58 +01:00
net arm64: bpf: fix endianness conversion bugs 2015-06-26 14:15:39 +01:00
xen arm: xen: implement multicall hypercall support. 2014-04-24 13:09:46 +01:00
Kconfig arm64: kconfig: Move LIST_POISON to a safe value 2015-08-19 17:10:21 +01:00
Kconfig.debug coresight: moving to new "hwtracing" directory 2015-04-03 16:17:04 +02:00
Makefile arm64: atomics: patch in lse instructions when supported by the CPU 2015-07-27 15:28:50 +01:00