mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-05-03 09:29:57 +00:00
Merge changes from topic "mp/ras_refactoring" into integration
* changes: fix(debug): decouple "get_el_str()" from backtrace fix(bl31): harden check in delegate_async_ea
This commit is contained in:
commit
680b7aa9c0
5 changed files with 18 additions and 35 deletions
|
@ -195,23 +195,30 @@ endfunc delegate_sync_ea
|
||||||
*/
|
*/
|
||||||
func delegate_async_ea
|
func delegate_async_ea
|
||||||
#if RAS_EXTENSION
|
#if RAS_EXTENSION
|
||||||
|
/* Check Exception Class to ensure SError, as this function should
|
||||||
|
* only be invoked for SError. If that is not the case, which implies
|
||||||
|
* either an HW error or programming error, panic.
|
||||||
|
*/
|
||||||
|
ubfx x2, x1, #ESR_EC_SHIFT, #ESR_EC_LENGTH
|
||||||
|
cmp x2, EC_SERROR
|
||||||
|
b.ne do_panic
|
||||||
/*
|
/*
|
||||||
* Check for Implementation Defined Syndrome. If so, skip checking
|
* Check for Implementation Defined Syndrome. If so, skip checking
|
||||||
* Uncontainable error type from the syndrome as the format is unknown.
|
* Uncontainable error type from the syndrome as the format is unknown.
|
||||||
*/
|
*/
|
||||||
tbnz x1, #SERROR_IDS_BIT, 1f
|
tbnz x1, #SERROR_IDS_BIT, 1f
|
||||||
|
|
||||||
|
/* AET only valid when DFSC is 0x11 */
|
||||||
|
ubfx x2, x1, #EABORT_DFSC_SHIFT, #EABORT_DFSC_WIDTH
|
||||||
|
cmp x2, #DFSC_SERROR
|
||||||
|
b.ne 1f
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for Uncontainable error type. If so, route to the platform
|
* Check for Uncontainable error type. If so, route to the platform
|
||||||
* fatal error handler rather than the generic EA one.
|
* fatal error handler rather than the generic EA one.
|
||||||
*/
|
*/
|
||||||
ubfx x2, x1, #EABORT_AET_SHIFT, #EABORT_AET_WIDTH
|
ubfx x3, x1, #EABORT_AET_SHIFT, #EABORT_AET_WIDTH
|
||||||
cmp x2, #ERROR_STATUS_UET_UC
|
cmp x3, #ERROR_STATUS_UET_UC
|
||||||
b.ne 1f
|
|
||||||
|
|
||||||
/* Check DFSC for SError type */
|
|
||||||
ubfx x3, x1, #EABORT_DFSC_SHIFT, #EABORT_DFSC_WIDTH
|
|
||||||
cmp x3, #DFSC_SERROR
|
|
||||||
b.ne 1f
|
b.ne 1f
|
||||||
|
|
||||||
no_ret plat_handle_uncontainable_ea
|
no_ret plat_handle_uncontainable_ea
|
||||||
|
|
|
@ -54,17 +54,6 @@ static inline uintptr_t extract_address(uintptr_t address)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *get_el_str(unsigned int el)
|
|
||||||
{
|
|
||||||
if (el == 3U) {
|
|
||||||
return "EL3";
|
|
||||||
} else if (el == 2U) {
|
|
||||||
return "EL2";
|
|
||||||
} else {
|
|
||||||
return "S-EL1";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns true if the address points to a virtual address that can be read at
|
* Returns true if the address points to a virtual address that can be read at
|
||||||
* the current EL, false otherwise.
|
* the current EL, false otherwise.
|
||||||
|
|
|
@ -91,9 +91,10 @@
|
||||||
# define VERBOSE(...) no_tf_log(LOG_MARKER_VERBOSE __VA_ARGS__)
|
# define VERBOSE(...) no_tf_log(LOG_MARKER_VERBOSE __VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char *get_el_str(unsigned int el);
|
||||||
|
|
||||||
#if ENABLE_BACKTRACE
|
#if ENABLE_BACKTRACE
|
||||||
void backtrace(const char *cookie);
|
void backtrace(const char *cookie);
|
||||||
const char *get_el_str(unsigned int el);
|
|
||||||
#else
|
#else
|
||||||
#define backtrace(x)
|
#define backtrace(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -67,17 +67,15 @@ int plat_sdei_validate_entry_point(uintptr_t ep, unsigned int client_mode)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !ENABLE_BACKTRACE
|
const char *get_el_str(unsigned int el)
|
||||||
static const char *get_el_str(unsigned int el)
|
|
||||||
{
|
{
|
||||||
if (el == MODE_EL3) {
|
if (el == MODE_EL3) {
|
||||||
return "EL3";
|
return "EL3";
|
||||||
} else if (el == MODE_EL2) {
|
} else if (el == MODE_EL2) {
|
||||||
return "EL2";
|
return "EL2";
|
||||||
}
|
}
|
||||||
return "S-EL1";
|
return "EL1";
|
||||||
}
|
}
|
||||||
#endif /* !ENABLE_BACKTRACE */
|
|
||||||
|
|
||||||
/* RAS functions common to AArch64 ARM platforms */
|
/* RAS functions common to AArch64 ARM platforms */
|
||||||
void plat_default_ea_handler(unsigned int ea_reason, uint64_t syndrome, void *cookie,
|
void plat_default_ea_handler(unsigned int ea_reason, uint64_t syndrome, void *cookie,
|
||||||
|
|
|
@ -16,18 +16,6 @@
|
||||||
|
|
||||||
#define A53_SERR_INT_AXI_SLVERR_ON_EXTERNAL_ACCESS 0xbf000002
|
#define A53_SERR_INT_AXI_SLVERR_ON_EXTERNAL_ACCESS 0xbf000002
|
||||||
|
|
||||||
#if !ENABLE_BACKTRACE
|
|
||||||
static const char *get_el_str(unsigned int el)
|
|
||||||
{
|
|
||||||
if (el == MODE_EL3) {
|
|
||||||
return "EL3";
|
|
||||||
} else if (el == MODE_EL2) {
|
|
||||||
return "EL2";
|
|
||||||
}
|
|
||||||
return "S-EL1";
|
|
||||||
}
|
|
||||||
#endif /* !ENABLE_BACKTRACE */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This source file with custom plat_ea_handler function is compiled only when
|
* This source file with custom plat_ea_handler function is compiled only when
|
||||||
* building TF-A with compile option HANDLE_EA_EL3_FIRST=1
|
* building TF-A with compile option HANDLE_EA_EL3_FIRST=1
|
||||||
|
|
Loading…
Add table
Reference in a new issue