|
121 | 121 | #define ESR_ELx_FSC_SECC (0x18)
|
122 | 122 | #define ESR_ELx_FSC_SECC_TTW(n) (0x1c + (n))
|
123 | 123 |
|
| 124 | +/* Status codes for individual page table levels */ |
| 125 | +#define ESR_ELx_FSC_ACCESS_L(n) (ESR_ELx_FSC_ACCESS + n) |
| 126 | +#define ESR_ELx_FSC_PERM_L(n) (ESR_ELx_FSC_PERM + n) |
| 127 | + |
| 128 | +#define ESR_ELx_FSC_FAULT_nL (0x2C) |
| 129 | +#define ESR_ELx_FSC_FAULT_L(n) (((n) < 0 ? ESR_ELx_FSC_FAULT_nL : \ |
| 130 | + ESR_ELx_FSC_FAULT) + (n)) |
| 131 | + |
124 | 132 | /* ISS field definitions for Data Aborts */
|
125 | 133 | #define ESR_ELx_ISV_SHIFT (24)
|
126 | 134 | #define ESR_ELx_ISV (UL(1) << ESR_ELx_ISV_SHIFT)
|
@@ -388,20 +396,33 @@ static inline bool esr_is_data_abort(unsigned long esr)
|
388 | 396 |
|
389 | 397 | static inline bool esr_fsc_is_translation_fault(unsigned long esr)
|
390 | 398 | {
|
391 |
| - /* Translation fault, level -1 */ |
392 |
| - if ((esr & ESR_ELx_FSC) == 0b101011) |
393 |
| - return true; |
394 |
| - return (esr & ESR_ELx_FSC_TYPE) == ESR_ELx_FSC_FAULT; |
| 399 | + esr = esr & ESR_ELx_FSC; |
| 400 | + |
| 401 | + return (esr == ESR_ELx_FSC_FAULT_L(3)) || |
| 402 | + (esr == ESR_ELx_FSC_FAULT_L(2)) || |
| 403 | + (esr == ESR_ELx_FSC_FAULT_L(1)) || |
| 404 | + (esr == ESR_ELx_FSC_FAULT_L(0)) || |
| 405 | + (esr == ESR_ELx_FSC_FAULT_L(-1)); |
395 | 406 | }
|
396 | 407 |
|
397 | 408 | static inline bool esr_fsc_is_permission_fault(unsigned long esr)
|
398 | 409 | {
|
399 |
| - return (esr & ESR_ELx_FSC_TYPE) == ESR_ELx_FSC_PERM; |
| 410 | + esr = esr & ESR_ELx_FSC; |
| 411 | + |
| 412 | + return (esr == ESR_ELx_FSC_PERM_L(3)) || |
| 413 | + (esr == ESR_ELx_FSC_PERM_L(2)) || |
| 414 | + (esr == ESR_ELx_FSC_PERM_L(1)) || |
| 415 | + (esr == ESR_ELx_FSC_PERM_L(0)); |
400 | 416 | }
|
401 | 417 |
|
402 | 418 | static inline bool esr_fsc_is_access_flag_fault(unsigned long esr)
|
403 | 419 | {
|
404 |
| - return (esr & ESR_ELx_FSC_TYPE) == ESR_ELx_FSC_ACCESS; |
| 420 | + esr = esr & ESR_ELx_FSC; |
| 421 | + |
| 422 | + return (esr == ESR_ELx_FSC_ACCESS_L(3)) || |
| 423 | + (esr == ESR_ELx_FSC_ACCESS_L(2)) || |
| 424 | + (esr == ESR_ELx_FSC_ACCESS_L(1)) || |
| 425 | + (esr == ESR_ELx_FSC_ACCESS_L(0)); |
405 | 426 | }
|
406 | 427 |
|
407 | 428 | /* Indicate whether ESR.EC==0x1A is for an ERETAx instruction */
|
|
0 commit comments