xtensa: save a4 in spill_registers

Without this fix the value of a0 spilled from the oldest live window is
wrong if the newest window has only 4 live registers, because a4 in the
newest window overlaps a0 in the oldest one.

This may be reproduced by invoking spill syscall after the following
sequence of calls: 4 -> 12 -> 12 -> 4 on configuration with 32 physical
registers.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: put stack pointer into a1 for call12 spill case

call12 spill procedure starts with the following code:

	s32e    a4, a1, -16     # a1 is valid with an empty spill area
	l32e    a4, a5, -12
	s32e    a8, a4, -48
	mov     a8, a4
	l32e    a4, a1, -16
	j       .Lc12c

a1 is expected to point to the topmost stack frame, but this is almost
never the case after the initial register window rotation. The result is
either stack corruption or infinite attempt to call fixup routine after the
first s32e.

This may be reproduced by invoking spill syscall after the following
sequence of calls: 4 -> 12 -> 12 -> 8 on configuration with 32 physical
registers.

The rest of the patch fixes two _spill_registers call sites, functions
spill_registers and _switch_to, re-arranging live registers so that they
don't get clobbered, saving/restoring them across the call or explicitly
marking them as clobbered for gcc.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: save current register frame in fast_syscall_spill_registers_fixup

We need it saved because it contains a3 where we track which register
windows we still need to spill, and fixup handler may call C exception
handlers. Also fix comments.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: add register spill code debugging

Introduce new CONFIG_DEBUG_SPILL symbol. When enabled _spill_registers
will always clobber registers it potentially may clobber, making the
kernel more likely crash if not all relevant registers are saved across
the call to _spill_registers.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>