android_kernel_xiaomi_sm8350/arch/powerpc/kernel
Paul Mackerras 1bd79336a4 powerpc: Fix various syscall/signal/swapcontext bugs
A careful reading of the recent changes to the system call entry/exit
paths revealed several problems, plus some things that could be
simplified and improved:

* 32-bit wasn't testing the _TIF_NOERROR bit in the syscall fast exit
  path, so it was only doing anything with it once it saw some other
  bit being set.  In other words, the noerror behaviour would apply to
  the next system call where we had to reschedule or deliver a signal,
  which is not necessarily the current system call.

* 32-bit wasn't doing the call to ptrace_notify in the syscall exit
  path when the _TIF_SINGLESTEP bit was set.

* _TIF_RESTOREALL was in both _TIF_USER_WORK_MASK and
  _TIF_PERSYSCALL_MASK, which is odd since _TIF_RESTOREALL is only set
  by system calls.  I took it out of _TIF_USER_WORK_MASK.

* On 64-bit, _TIF_RESTOREALL wasn't causing the non-volatile registers
  to be restored (unless perhaps a signal was delivered or the syscall
  was traced or single-stepped).  Thus the non-volatile registers
  weren't restored on exit from a signal handler.  We probably got
  away with it mostly because signal handlers written in C wouldn't
  alter the non-volatile registers.

* On 32-bit I simplified the code and made it more like 64-bit by
  making the syscall exit path jump to ret_from_except to handle
  preemption and signal delivery.

* 32-bit was calling do_signal unnecessarily when _TIF_RESTOREALL was
  set - but I think because of that 32-bit was actually restoring the
  non-volatile registers on exit from a signal handler.

* I changed the order of enabling interrupts and saving the
  non-volatile registers before calling do_syscall_trace_leave; now we
  enable interrupts first.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-03-08 13:24:22 +11:00
..
vdso32 [PATCH] powerpc: Add some missing .gitignore's 2006-01-11 15:35:35 +11:00
vdso64 [PATCH] powerpc: vdso 64bits gettimeofday bug 2006-02-28 16:25:54 +11:00
align.c
asm-offsets.c powerpc: Fix various syscall/signal/swapcontext bugs 2006-03-08 13:24:22 +11:00
binfmt_elf32.c
btext.c
cpu_setup_power4.S [PATCH] powerpc: Cleanup LOADADDR etc. asm macros 2006-01-13 21:16:23 +11:00
cputable.c [PATCH] powerpc: Expose SMT and L1 icache snoop userland features 2006-03-03 22:00:23 +11:00
crash_dump.c powerpc: Fix compile error when CONFIG_PROC_VMCORE is not defined 2006-01-11 15:30:07 +11:00
crash.c [PATCH] powerpc: Trivial fix to set the proper timeout value for kdump 2006-02-24 11:36:21 +11:00
dma_64.c
entry_32.S powerpc: Fix various syscall/signal/swapcontext bugs 2006-03-08 13:24:22 +11:00
entry_64.S powerpc: Fix various syscall/signal/swapcontext bugs 2006-03-08 13:24:22 +11:00
firmware.c
fpu.S powerpc/64: Fix bug in setting floating-point exception mode 2006-02-07 13:55:30 +11:00
head_4xx.S
head_8xx.S
head_32.S [PATCH] powerpc: fix altivec_unavailable_exception Oopses 2006-02-24 11:36:23 +11:00
head_44x.S
head_64.S [PATCH] powerpc64: remove broken/bitrotted HMT support 2006-02-24 11:36:33 +11:00
head_fsl_booke.S
ibmebus.c
idle_6xx.S
idle_64.c
idle_power4.S [PATCH] powerpc: Cleanup LOADADDR etc. asm macros 2006-01-13 21:16:23 +11:00
init_task.c
iomap.c
iommu.c [PATCH] powerpc: IOMMU SG paranoia 2006-02-07 21:28:38 +11:00
irq.c [PATCH] powerpc: Remove lppaca structure from the PACA 2006-01-13 21:17:39 +11:00
kprobes.c [PATCH] kprobes: fix race in recovery of reentrant probe 2006-01-11 18:42:12 -08:00
legacy_serial.c [PATCH] CONFIG_ISA does not make sense for CONFIG_PPC_PSERIES 2006-02-01 08:53:08 -08:00
lparcfg.c [PATCH] powerpc: Fix OOPS in lparcfg on G5 2006-02-20 10:44:34 +11:00
lparmap.c
machine_kexec_32.c
machine_kexec_64.c [PATCH] powerpc: Only calculate htab_size in one place for kexec 2006-02-24 11:36:18 +11:00
machine_kexec.c [PATCH] powerpc: remove remaining crash_notes variable from machine_kexec.c 2006-01-11 14:48:02 +11:00
Makefile ppc: Use the system call table from arch/powerpc/kernel/systbl.S 2006-02-10 16:02:20 +11:00
misc_32.S [PATCH] powerpc: Cleanup LOADADDR etc. asm macros 2006-01-13 21:16:23 +11:00
misc_64.S [PATCH] powerpc: Cleanup LOADADDR etc. asm macros 2006-01-13 21:16:23 +11:00
module_64.c
nvram_64.c
of_device.c [PATCH] Add of_platform_bus_type probe and remove methods 2006-01-13 11:26:06 -08:00
paca.c [PATCH] powerpc: Remove lppaca structure from the PACA 2006-01-13 21:17:39 +11:00
pci_32.c powerpc/32: Restore previous version of 32-bit PCI code 2006-01-15 22:05:47 +11:00
pci_64.c [PATCH] powerpc: small pci cleanups 2006-01-12 20:09:30 +11:00
pci_direct_iommu.c
pci_dn.c
pci_iommu.c
pmc.c
ppc32.h
ppc_ksyms.c [PATCH] powerpc: remove duplicate exports 2006-02-20 10:44:31 +11:00
proc_ppc64.c
process.c [PATCH] powerpc: Fix runlatch performance issues 2006-02-24 11:36:31 +11:00
prom_init.c [PATCH] powerpc: incorrect rmo_top handling in prom_init 2006-03-03 22:01:05 +11:00
prom_parse.c [PATCH] powerpc: add refcounting to setup_peg2 and of_get_pci_address 2006-02-07 21:32:45 +11:00
prom.c [PATCH] powerpc: Fix mem= cmdline handling on arch/powerpc for !MULTIPLATFORM 2006-02-24 14:34:50 -08:00
ptrace32.c
ptrace-common.h [PATCH] powerpc: task_thread_info() 2006-01-12 09:08:57 -08:00
ptrace.c powerpc: Fix various syscall/signal/swapcontext bugs 2006-03-08 13:24:22 +11:00
rtas_flash.c [PATCH] Don't check pointer for NULL before passing it to kfree [arch/powerpc/kernel/rtas_flash.c] 2006-02-07 21:51:53 +11:00
rtas_pci.c [PATCH] powerpc: Save device BARs much earlier in the boot sequence 2006-01-10 15:30:39 +11:00
rtas-proc.c
rtas-rtc.c
rtas.c [PATCH] powerpc: remove useless call to touch_softlockup_watchdog 2006-02-07 21:32:44 +11:00
semaphore.c
setup_32.c powerpc: Introduce a new config symbol to control 16550 early debug code 2006-01-10 16:19:05 +11:00
setup_64.c [PATCH] powerpc: Don't start secondary CPUs in a UP && KEXEC kernel 2006-02-20 12:03:34 +11:00
setup-common.c [PATCH] powerpc: Allow for ppc_md restart, power_off, and halt to be NULL 2006-01-14 11:12:23 +11:00
setup.h
signal_32.c powerpc: Fix various syscall/signal/swapcontext bugs 2006-03-08 13:24:22 +11:00
signal_64.c powerpc: Fix various syscall/signal/swapcontext bugs 2006-03-08 13:24:22 +11:00
smp-tbsync.c
smp.c [PATCH] powerpc: avoid timer interrupt replay effect when onlining cpu 2006-02-07 21:51:54 +11:00
sys_ppc32.c powerpc: Keep xtime and gettimeofday in sync 2006-02-20 10:38:56 +11:00
syscalls.c
sysfs.c
systbl.S powerpc: Fix various syscall/signal/swapcontext bugs 2006-03-08 13:24:22 +11:00
time.c powerpc: Keep xtime and gettimeofday in sync 2006-02-20 10:38:56 +11:00
traps.c powerpc: Fix might-sleep warning in program check exception handler 2006-03-03 17:11:40 +11:00
udbg_16550.c [PATCH] powerpc: fix compile warning in udbg_init_maple_realmode 2006-02-07 21:51:52 +11:00
udbg.c [PATCH] powerpc: Make early debugging configurable via Kconfig 2006-01-11 14:48:26 +11:00
vdso.c [PATCH] Add mm->task_size and fix powerpc vdso 2006-02-28 20:53:44 -08:00
vecemu.c
vector.S
vio.c [PATCH] Add vio_bus_type probe and remove methods 2006-01-13 11:26:07 -08:00
vmlinux.lds.S