kernel_optimize_test/arch/arm64/kernel
Keno Fischer 1cf6022bd9 arm64: Fix PTRACE_SYSEMU semantics
Quoth the man page:
```
       If the tracee was restarted by PTRACE_SYSCALL or PTRACE_SYSEMU, the
       tracee enters syscall-enter-stop just prior to entering any system
       call (which will not be executed if the restart was using
       PTRACE_SYSEMU, regardless of any change made to registers at this
       point or how the tracee is restarted after this stop).
```

The parenthetical comment is currently true on x86 and powerpc,
but not currently true on arm64. arm64 re-checks the _TIF_SYSCALL_EMU
flag after the syscall entry ptrace stop. However, at this point,
it reflects which method was used to re-start the syscall
at the entry stop, rather than the method that was used to reach it.
Fix that by recording the original flag before performing the ptrace
stop, bringing the behavior in line with documentation and x86/powerpc.

Fixes: f086f67485 ("arm64: ptrace: add support for syscall emulation")
Cc: <stable@vger.kernel.org> # 5.3.x-
Signed-off-by: Keno Fischer <keno@juliacomputing.com>
Acked-by: Will Deacon <will@kernel.org>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Bin Lu <Bin.Lu@arm.com>
[catalin.marinas@arm.com: moved 'flags' bit masking]
[catalin.marinas@arm.com: changed 'flags' type to unsigned long]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2020-05-20 12:02:42 +01:00
..
probes
vdso arm64: vdso: Add -fasynchronous-unwind-tables to cflags 2020-04-30 18:35:32 +01:00
vdso32 SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
acpi_numa.c
acpi_parking_protocol.c
acpi.c arm64: acpi: fix DAIF manipulation with pNMI 2020-01-22 14:41:22 +00:00
alternative.c
armv8_deprecated.c arm64: armv8_deprecated: Fix undef_hook mask for thumb setend 2020-04-08 18:19:20 +01:00
asm-offsets.c arm64: initialize and switch ptrauth kernel keys 2020-03-18 09:50:20 +00:00
cacheinfo.c
cpu_errata.c arm64: Mark call_smc_arch_workaround_1 as __maybe_unused 2020-03-11 12:01:59 +00:00
cpu_ops.c arm64: Introduce get_cpu_ops() helper function 2020-03-24 17:24:19 +00:00
cpu-reset.h
cpu-reset.S arm64: use mov_q instead of literal ldr 2020-03-24 11:48:24 +00:00
cpufeature.c Merge branch 'for-next/kernel-ptrauth' into for-next/core 2020-03-25 11:11:08 +00:00
cpuidle.c arm64: Introduce get_cpu_ops() helper function 2020-03-24 17:24:19 +00:00
cpuinfo.c Merge branch 'for-next/rng' into for-next/core 2020-01-22 11:38:53 +00:00
crash_core.c
crash_dump.c
debug-monitors.c
efi-entry.S efi/arm64: Clean EFI stub exit code from cache instead of avoiding it 2020-02-29 10:16:57 +01:00
efi-header.S efi/libstub: Introduce symbolic constants for the stub major/minor version 2020-02-23 21:59:42 +01:00
efi-rt-wrapper.S
efi.c
entry-common.c arm64: entry: unmask IRQ in el0_sp() 2020-03-11 14:34:28 +00:00
entry-fpsimd.S
entry-ftrace.S arm64: entry-ftrace.S: Fix missing argument for CONFIG_FUNCTION_GRAPH_TRACER=y 2020-03-11 11:06:48 +00:00
entry.S Merge branch 'for-next/kernel-ptrauth' into for-next/core 2020-03-25 11:11:08 +00:00
fpsimd.c arm64: nofpsmid: Handle TIF_FOREIGN_FPSTATE flag cleanly 2020-01-14 17:11:53 +00:00
ftrace.c arm64: ftrace: minimize ifdeffery 2019-11-06 14:17:36 +00:00
head.S Merge branch 'for-next/kernel-ptrauth' into for-next/core 2020-03-25 11:11:08 +00:00
hibernate-asm.S arm64: remove gratuitious/stray .ltorg stanzas 2020-03-04 15:47:47 +00:00
hibernate.c arm64: hibernate: Use bringup_hibernate_cpu() 2020-03-25 12:59:34 +01:00
hw_breakpoint.c Printk changes for 5.5 2019-11-25 19:40:40 -08:00
hyp-stub.S arm64: use mov_q instead of literal ldr 2020-03-24 11:48:24 +00:00
image-vars.h efi/arm64: Clean EFI stub exit code from cache instead of avoiding it 2020-02-29 10:16:57 +01:00
image.h
insn.c arm64: insn: consistently handle exit text 2019-12-04 11:32:20 +00:00
io.c
irq.c
jump_label.c
kaslr.c arm64: Fix CONFIG_ARCH_RANDOM=n build 2020-02-11 09:47:01 +00:00
kexec_image.c arm64: kexec_file: add crash dump support 2020-01-08 17:05:23 +00:00
kgdb.c
kuser32.S
machine_kexec_file.c arm64: kexec_file: Fixed code style. 2020-03-17 18:23:20 +00:00
machine_kexec.c arm64: fix the flush_icache_range arguments in machine_kexec 2020-05-11 12:02:14 +01:00
Makefile arm64: efi: add efi-entry.o to targets instead of extra-$(CONFIG_EFI) 2020-03-09 18:13:25 +00:00
module-plts.c arm64: implement ftrace with regs 2019-11-06 14:17:35 +00:00
module.c arm64: implement ftrace with regs 2019-11-06 14:17:35 +00:00
module.lds
paravirt.c
pci.c
perf_callchain.c
perf_event.c arm64: perf: Add support for ARMv8.5-PMU 64-bit counters 2020-03-17 22:50:30 +00:00
perf_regs.c
pointer_auth.c arm64: install user ptrauth keys at kernel exit time 2020-03-18 09:50:19 +00:00
process.c arm64 updates for 5.7: 2020-03-31 10:05:01 -07:00
psci.c
ptrace.c arm64: Fix PTRACE_SYSEMU semantics 2020-05-20 12:02:42 +01:00
reloc_test_core.c
reloc_test_syms.S
relocate_kernel.S arm64: use mov_q instead of literal ldr 2020-03-24 11:48:24 +00:00
return_address.c
sdei.c
setup.c arm64: Introduce get_cpu_ops() helper function 2020-03-24 17:24:19 +00:00
signal.c arm64: signal: nofpsimd: Handle fp/simd context for signal frames 2020-01-14 17:11:46 +00:00
signal32.c arm64: signal: nofpsimd: Handle fp/simd context for signal frames 2020-01-14 17:11:46 +00:00
sigreturn32.S
sleep.S arm64: ptrauth: Add bootup/runtime flags for __cpu_setup 2020-03-18 09:50:19 +00:00
smccc-call.S
smp_spin_table.c
smp.c arm64 updates for 5.7: 2020-03-31 10:05:01 -07:00
ssbd.c Return ENODEV when the selected speculation misfeature is unsupported 2020-01-08 17:27:41 +00:00
stacktrace.c arm64: unwind: strip PAC from kernel addresses 2020-03-18 09:50:20 +00:00
suspend.c
sys_compat.c
sys.c
sys32.c
syscall.c arm64: entry: cleanup el0 svc handler naming 2020-01-17 13:22:14 +00:00
time.c arm64: time: Replace <linux/clk-provider.h> by <linux/of_clk.h> 2020-02-12 17:26:38 +00:00
topology.c arm64: use activity monitors for frequency invariance 2020-03-06 16:02:50 +00:00
trace-events-emulation.h
traps.c sched/rt, arm64: Use CONFIG_PREEMPTION 2019-12-08 14:37:32 +01:00
vdso.c arm64: vdso: don't free unallocated pages 2020-04-15 11:13:16 +01:00
vmlinux.lds.S arm64 updates for 5.5: 2019-12-06 14:18:01 -08:00