aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/align.S
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2014-08-04 07:24:58 -0400
committerMax Filippov <jcmvbkbc@gmail.com>2014-08-14 03:59:29 -0400
commit21570465a30f13197991eb2637d6ffc6c6880eef (patch)
tree55bfd3614cf56def95926fd9e30d6a27466ddad2 /arch/xtensa/kernel/align.S
parente9500dd852ca6ede346500010545975bf10244dc (diff)
xtensa: move invalid unaligned instruction handler closer to its users
With this change a threaded jump from .Linvalid_instruction_load to .Linvalid_instruction can be removed and more code may be added to common load/store exit path. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel/align.S')
-rw-r--r--arch/xtensa/kernel/align.S62
1 files changed, 29 insertions, 33 deletions
diff --git a/arch/xtensa/kernel/align.S b/arch/xtensa/kernel/align.S
index 2c7c13d8e91a..87d80d8c33e5 100644
--- a/arch/xtensa/kernel/align.S
+++ b/arch/xtensa/kernel/align.S
@@ -230,10 +230,6 @@ ENTRY(fast_unaligned)
230 addx8 a5, a6, a5 230 addx8 a5, a6, a5
231 jx a5 # jump into table 231 jx a5 # jump into table
232 232
233 /* Invalid instruction, CRITICAL! */
234.Linvalid_instruction_load:
235 j .Linvalid_instruction
236
237 /* Load: Load memory address. */ 233 /* Load: Load memory address. */
238 234
239.Lload: movi a3, ~3 235.Lload: movi a3, ~3
@@ -319,6 +315,35 @@ ENTRY(fast_unaligned)
319 mov a3, a14 ; _j 1f; .align 8 315 mov a3, a14 ; _j 1f; .align 8
320 mov a3, a15 ; _j 1f; .align 8 316 mov a3, a15 ; _j 1f; .align 8
321 317
318 /* We cannot handle this exception. */
319
320 .extern _kernel_exception
321.Linvalid_instruction_load:
322.Linvalid_instruction_store:
323
324 movi a4, 0
325 rsr a3, excsave1
326 s32i a4, a3, EXC_TABLE_FIXUP
327
328 /* Restore a4...a8 and SAR, set SP, and jump to default exception. */
329
330 l32i a8, a2, PT_AREG8
331 l32i a7, a2, PT_AREG7
332 l32i a6, a2, PT_AREG6
333 l32i a5, a2, PT_AREG5
334 l32i a4, a2, PT_AREG4
335 wsr a0, sar
336 mov a1, a2
337
338 rsr a0, ps
339 bbsi.l a0, PS_UM_BIT, 2f # jump if user mode
340
341 movi a0, _kernel_exception
342 jx a0
343
3442: movi a0, _user_exception
345 jx a0
346
3221: # a7: instruction pointer, a4: instruction, a3: value 3471: # a7: instruction pointer, a4: instruction, a3: value
323 348
324 movi a6, 0 # mask: ffffffff:00000000 349 movi a6, 0 # mask: ffffffff:00000000
@@ -416,35 +441,6 @@ ENTRY(fast_unaligned)
416 l32i a2, a2, PT_AREG2 441 l32i a2, a2, PT_AREG2
417 rfe 442 rfe
418 443
419 /* We cannot handle this exception. */
420
421 .extern _kernel_exception
422.Linvalid_instruction_store:
423.Linvalid_instruction:
424
425 movi a4, 0
426 rsr a3, excsave1
427 s32i a4, a3, EXC_TABLE_FIXUP
428
429 /* Restore a4...a8 and SAR, set SP, and jump to default exception. */
430
431 l32i a8, a2, PT_AREG8
432 l32i a7, a2, PT_AREG7
433 l32i a6, a2, PT_AREG6
434 l32i a5, a2, PT_AREG5
435 l32i a4, a2, PT_AREG4
436 wsr a0, sar
437 mov a1, a2
438
439 rsr a0, ps
440 bbsi.l a0, PS_UM_BIT, 1f # jump if user mode
441
442 movi a0, _kernel_exception
443 jx a0
444
4451: movi a0, _user_exception
446 jx a0
447
448ENDPROC(fast_unaligned) 444ENDPROC(fast_unaligned)
449 445
450ENTRY(fast_unaligned_fixup) 446ENTRY(fast_unaligned_fixup)