aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel
diff options
context:
space:
mode:
authorMarc Zyngier <Marc.Zyngier@arm.com>2013-04-08 12:17:03 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2013-04-17 10:58:25 -0400
commit5c1ce6f7c2aae5329f667fb079b3198266d9a3fa (patch)
tree5e8b0db09bf756512d42a0c2e7d7fa8918248921 /arch/arm64/kernel
parentd4784be3b20ed0dd19bbde3b2d58df023ae1dc86 (diff)
arm64: add explicit symbols to ESR_EL1 decoding
The ESR_EL1 decoding process is a bit cryptic, and KVM has also a need for the same constants. Add a new esr.h file containing the appropriate exception classes constants, and change entry.S to use it. Fix a small bug in the EL1 breakpoint check while we're at it. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel')
-rw-r--r--arch/arm64/kernel/entry.S53
1 files changed, 27 insertions, 26 deletions
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 514d6098dbee..c7e047049f2c 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -24,6 +24,7 @@
24#include <asm/assembler.h> 24#include <asm/assembler.h>
25#include <asm/asm-offsets.h> 25#include <asm/asm-offsets.h>
26#include <asm/errno.h> 26#include <asm/errno.h>
27#include <asm/esr.h>
27#include <asm/thread_info.h> 28#include <asm/thread_info.h>
28#include <asm/unistd.h> 29#include <asm/unistd.h>
29#include <asm/unistd32.h> 30#include <asm/unistd32.h>
@@ -239,18 +240,18 @@ ENDPROC(el1_error_invalid)
239el1_sync: 240el1_sync:
240 kernel_entry 1 241 kernel_entry 1
241 mrs x1, esr_el1 // read the syndrome register 242 mrs x1, esr_el1 // read the syndrome register
242 lsr x24, x1, #26 // exception class 243 lsr x24, x1, #ESR_EL1_EC_SHIFT // exception class
243 cmp x24, #0x25 // data abort in EL1 244 cmp x24, #ESR_EL1_EC_DABT_EL1 // data abort in EL1
244 b.eq el1_da 245 b.eq el1_da
245 cmp x24, #0x18 // configurable trap 246 cmp x24, #ESR_EL1_EC_SYS64 // configurable trap
246 b.eq el1_undef 247 b.eq el1_undef
247 cmp x24, #0x26 // stack alignment exception 248 cmp x24, #ESR_EL1_EC_SP_ALIGN // stack alignment exception
248 b.eq el1_sp_pc 249 b.eq el1_sp_pc
249 cmp x24, #0x22 // pc alignment exception 250 cmp x24, #ESR_EL1_EC_PC_ALIGN // pc alignment exception
250 b.eq el1_sp_pc 251 b.eq el1_sp_pc
251 cmp x24, #0x00 // unknown exception in EL1 252 cmp x24, #ESR_EL1_EC_UNKNOWN // unknown exception in EL1
252 b.eq el1_undef 253 b.eq el1_undef
253 cmp x24, #0x30 // debug exception in EL1 254 cmp x24, #ESR_EL1_EC_BREAKPT_EL1 // debug exception in EL1
254 b.ge el1_dbg 255 b.ge el1_dbg
255 b el1_inv 256 b el1_inv
256el1_da: 257el1_da:
@@ -346,27 +347,27 @@ el1_preempt:
346el0_sync: 347el0_sync:
347 kernel_entry 0 348 kernel_entry 0
348 mrs x25, esr_el1 // read the syndrome register 349 mrs x25, esr_el1 // read the syndrome register
349 lsr x24, x25, #26 // exception class 350 lsr x24, x25, #ESR_EL1_EC_SHIFT // exception class
350 cmp x24, #0x15 // SVC in 64-bit state 351 cmp x24, #ESR_EL1_EC_SVC64 // SVC in 64-bit state
351 b.eq el0_svc 352 b.eq el0_svc
352 adr lr, ret_from_exception 353 adr lr, ret_from_exception
353 cmp x24, #0x24 // data abort in EL0 354 cmp x24, #ESR_EL1_EC_DABT_EL0 // data abort in EL0
354 b.eq el0_da 355 b.eq el0_da
355 cmp x24, #0x20 // instruction abort in EL0 356 cmp x24, #ESR_EL1_EC_IABT_EL0 // instruction abort in EL0
356 b.eq el0_ia 357 b.eq el0_ia
357 cmp x24, #0x07 // FP/ASIMD access 358 cmp x24, #ESR_EL1_EC_FP_ASIMD // FP/ASIMD access
358 b.eq el0_fpsimd_acc 359 b.eq el0_fpsimd_acc
359 cmp x24, #0x2c // FP/ASIMD exception 360 cmp x24, #ESR_EL1_EC_FP_EXC64 // FP/ASIMD exception
360 b.eq el0_fpsimd_exc 361 b.eq el0_fpsimd_exc
361 cmp x24, #0x18 // configurable trap 362 cmp x24, #ESR_EL1_EC_SYS64 // configurable trap
362 b.eq el0_undef 363 b.eq el0_undef
363 cmp x24, #0x26 // stack alignment exception 364 cmp x24, #ESR_EL1_EC_SP_ALIGN // stack alignment exception
364 b.eq el0_sp_pc 365 b.eq el0_sp_pc
365 cmp x24, #0x22 // pc alignment exception 366 cmp x24, #ESR_EL1_EC_PC_ALIGN // pc alignment exception
366 b.eq el0_sp_pc 367 b.eq el0_sp_pc
367 cmp x24, #0x00 // unknown exception in EL0 368 cmp x24, #ESR_EL1_EC_UNKNOWN // unknown exception in EL0
368 b.eq el0_undef 369 b.eq el0_undef
369 cmp x24, #0x30 // debug exception in EL0 370 cmp x24, #ESR_EL1_EC_BREAKPT_EL0 // debug exception in EL0
370 b.ge el0_dbg 371 b.ge el0_dbg
371 b el0_inv 372 b el0_inv
372 373
@@ -375,21 +376,21 @@ el0_sync:
375el0_sync_compat: 376el0_sync_compat:
376 kernel_entry 0, 32 377 kernel_entry 0, 32
377 mrs x25, esr_el1 // read the syndrome register 378 mrs x25, esr_el1 // read the syndrome register
378 lsr x24, x25, #26 // exception class 379 lsr x24, x25, #ESR_EL1_EC_SHIFT // exception class
379 cmp x24, #0x11 // SVC in 32-bit state 380 cmp x24, #ESR_EL1_EC_SVC32 // SVC in 32-bit state
380 b.eq el0_svc_compat 381 b.eq el0_svc_compat
381 adr lr, ret_from_exception 382 adr lr, ret_from_exception
382 cmp x24, #0x24 // data abort in EL0 383 cmp x24, #ESR_EL1_EC_DABT_EL0 // data abort in EL0
383 b.eq el0_da 384 b.eq el0_da
384 cmp x24, #0x20 // instruction abort in EL0 385 cmp x24, #ESR_EL1_EC_IABT_EL0 // instruction abort in EL0
385 b.eq el0_ia 386 b.eq el0_ia
386 cmp x24, #0x07 // FP/ASIMD access 387 cmp x24, #ESR_EL1_EC_FP_ASIMD // FP/ASIMD access
387 b.eq el0_fpsimd_acc 388 b.eq el0_fpsimd_acc
388 cmp x24, #0x28 // FP/ASIMD exception 389 cmp x24, #ESR_EL1_EC_FP_EXC32 // FP/ASIMD exception
389 b.eq el0_fpsimd_exc 390 b.eq el0_fpsimd_exc
390 cmp x24, #0x00 // unknown exception in EL0 391 cmp x24, #ESR_EL1_EC_UNKNOWN // unknown exception in EL0
391 b.eq el0_undef 392 b.eq el0_undef
392 cmp x24, #0x30 // debug exception in EL0 393 cmp x24, #ESR_EL1_EC_BREAKPT_EL0 // debug exception in EL0
393 b.ge el0_dbg 394 b.ge el0_dbg
394 b el0_inv 395 b el0_inv
395el0_svc_compat: 396el0_svc_compat: