Hi Sandeep
-----Original Message----- From: TF-A tf-a-bounces@lists.trustedfirmware.org On Behalf Of Sandeep Tripathy via TF-A
EHF activates the routing model for ‘INTR_TYPE_EL3’ CSS = 0 , TEL3 = 1
ie FIQ trapped to EL3 and not visible and not mask-able to lower ELs.
Which means G0 interrupts (all EHF interrupts) expected to preempt any execution context. And secure state cannot mask such interrupts
eg: critical error interrupts. Sort of NMI behavior.
However from TSPD code I see ‘TSP_NS_INTR_ASYNC_PREEMPT’ enforces a
slightly different behavior. G0 interrupt cannot preempt a fast smc handler in SPD.
Except during yielding SMC ‘disable_intr_rm_local(INTR_TYPE_NS, SECURE);’
is in effect. Intention is to avoid NS interrupt preempt secure execution (Fast SMC).
But I think that will also disable G0 interrupt as both NS interrupt and G0
interrupt are on FIQ.
I haven't double checked but that sounds correct.
EHF already ensures this by GIC PMR adjustment. So disabling routing model
seems unnecessary in this case.
This is my understanding from the code please confirm if this is correct.
The TSPD's TSP_NS_INTR_ASYNC_PREEMPT functionality predates the EHF, which probably explains why NS interrupts are disabled in 2 ways in this config (i.e. when both TSP_NS_INTR_ASYNC_PREEMPT and EL3_EXCEPTION_HANDLING equal 1). I guess it's possible that the call to disable the routing model can be safely removed in this config but it would require some thorough code review and testing. I'm not sure if this config is tested much at all.
Do we think it is not aligned with G0 interrupt preemption rule. Or do we
treat Fast SMC at S_EL1/EL2 as non interruptible.
I think G0 interrupts should be handled in this case but I'm not sure if this is easy to fix in the TSPD.
I want to handle something similar in OP-TEED along with EHF depending on
what is the expected behavior.
Hmm, I thought OP-TEED was more like the TSP_NS_INTR_ASYNC_PREEMPT=0 case, where NS interrupts are routed to S-EL1 while processing a yielding SMC in S-EL1? Perhaps that's a better TSPD config for you to follow?
Regards
Dan.
tf-a@lists.trustedfirmware.org