fix(sdei): fix assert while kdump issue

Assert condition:
1 Register secure timer(ppi=29) for sdei nmi watchdog;
2 kernel panic and then kdump;
While kdump, kernel mask all cores sdei, secure timer trigger
and go to handle_masked_trigger() and assert here:
assert(se->affinity == my_mpidr);

As kernel register with flag=0, mpidr=0 and TF-A set flag to
SDEI_REGF_RM_PE but leave mpidr=0. So set mpidr to fix his
assert issue.

Signed-off-by: Ming Huang <huangming@linux.alibaba.com>
Change-Id: Ia9182f40bde94fb004b46e2a72b186eb0ef05166
This commit is contained in:
Ming Huang 2021-09-09 17:42:27 +08:00
parent 663461b914
commit d39db2695b
1 changed files with 13 additions and 1 deletions

View File

@ -359,8 +359,20 @@ static int64_t sdei_event_register(int ev_num,
return SDEI_EINVAL;
/* Private events always target the PE */
if (is_event_private(map))
if (is_event_private(map)) {
/*
* SDEI internally handles private events in the same manner
* as public events with routing mode=RM_PE, since the routing
* mode flag and affinity fields are not used when registering
* a private event, set them here.
*/
flags = SDEI_REGF_RM_PE;
/*
* Kernel may pass 0 as mpidr, as we set flags to
* SDEI_REGF_RM_PE, so set mpidr also.
*/
mpidr = read_mpidr_el1();
}
se = get_event_entry(map);