diff options
author | Chris Zankel <chris@zankel.net> | 2014-01-29 01:09:51 -0500 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2014-01-29 16:47:26 -0500 |
commit | c0e50d41126e4786d9cf1105bdf783e55c99f915 (patch) | |
tree | a4b3b7cfe0e0d8fe23008b5c44a5d4ff43081738 | |
parent | 6b5a1f74e50170e64104135490dc32b657483594 (diff) |
xtensa: fix fast_syscall_spill_registers
The original implementation could clobber registers under certain conditions.
The Xtensa processor architecture uses windowed registers and the original
implementation was using a4 as a temporary register, which under certain
conditions could be register a0 of the oldest window frame, and didn't always
restore the content correctly.
By moving the _spill_registers routine inside the fast system call, it frees
up one more register (the return address is not required anymore) for the
spill routine.
Signed-off-by: Chris Zankel <chris@zankel.net>
-rw-r--r-- | arch/xtensa/kernel/vectors.S | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/xtensa_ksyms.c | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/arch/xtensa/kernel/vectors.S b/arch/xtensa/kernel/vectors.S index cb8fd44caabc..f9e1ec346e35 100644 --- a/arch/xtensa/kernel/vectors.S +++ b/arch/xtensa/kernel/vectors.S | |||
@@ -235,7 +235,7 @@ ENTRY(_DoubleExceptionVector) | |||
235 | 235 | ||
236 | /* Check for overflow/underflow exception, jump if overflow. */ | 236 | /* Check for overflow/underflow exception, jump if overflow. */ |
237 | 237 | ||
238 | _bbci.l a0, 6, _DoubleExceptionVector_WindowOverflow | 238 | bbci.l a0, 6, _DoubleExceptionVector_WindowOverflow |
239 | 239 | ||
240 | /* | 240 | /* |
241 | * Restart window underflow exception. | 241 | * Restart window underflow exception. |
diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c index 74a60c7e085e..80b33ed51f31 100644 --- a/arch/xtensa/kernel/xtensa_ksyms.c +++ b/arch/xtensa/kernel/xtensa_ksyms.c | |||
@@ -122,9 +122,7 @@ EXPORT_SYMBOL(insw); | |||
122 | EXPORT_SYMBOL(insl); | 122 | EXPORT_SYMBOL(insl); |
123 | 123 | ||
124 | extern long common_exception_return; | 124 | extern long common_exception_return; |
125 | extern long _spill_registers; | ||
126 | EXPORT_SYMBOL(common_exception_return); | 125 | EXPORT_SYMBOL(common_exception_return); |
127 | EXPORT_SYMBOL(_spill_registers); | ||
128 | 126 | ||
129 | #ifdef CONFIG_FUNCTION_TRACER | 127 | #ifdef CONFIG_FUNCTION_TRACER |
130 | EXPORT_SYMBOL(_mcount); | 128 | EXPORT_SYMBOL(_mcount); |