arm-trusted-firmware/include
Jeenu Viswambharan 3d732e23e7 BL31: Program Priority Mask for SMC handling
On GICv3 systems, as a side effect of adding provision to handle EL3
interrupts (unconditionally routing FIQs to EL3), pending Non-secure
interrupts (signalled as FIQs) may preempt execution in lower Secure ELs
[1]. This will inadvertently disrupt the semantics of Fast SMC
(previously called Atomic SMC) calls.

To retain semantics of Fast SMCs, the GIC PMR must be programmed to
prevent Non-secure interrupts from preempting Secure execution. To that
effect, two new functions in the Exception Handling Framework subscribe
to events introduced in an earlier commit:

  - Upon 'cm_exited_normal_world', the Non-secure PMR is stashed, and
    the PMR is programmed to the highest Non-secure interrupt priority.

  - Upon 'cm_entering_normal_world', the previously stashed Non-secure
    PMR is restored.

The above sequence however prevents Yielding SMCs from being preempted
by Non-secure interrupts as intended. To facilitate this, the public API
exc_allow_ns_preemption() is introduced that programs the PMR to the
original Non-secure PMR value. Another API
exc_is_ns_preemption_allowed() is also introduced to check if
exc_allow_ns_preemption() had been called previously.

API documentation to follow.

[1] On GICv2 systems, this isn't a problem as, unlike GICv3, pending NS
    IRQs during Secure execution are signalled as IRQs, which aren't
    routed to EL3.

Change-Id: Ief96b162b0067179b1012332cd991ee1b3051dd0
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-11-13 07:49:30 +00:00
..
bl1 FWU: Introduce FWU_SMC_IMAGE_RESET 2017-06-01 14:52:12 +01:00
bl31 BL31: Program Priority Mask for SMC handling 2017-11-13 07:49:30 +00:00
bl32 bl32: add secure interrupt handling in AArch32 sp_min 2017-08-09 15:48:53 +02:00
common SPM: Introduce Secure Partition Manager 2017-11-08 18:05:14 +00:00
drivers BL31: Program Priority Mask for SMC handling 2017-11-13 07:49:30 +00:00
lib BL31: Introduce Exception Handling Framework 2017-11-13 07:49:30 +00:00
plat GIC: Introduce API to get interrupt ID 2017-11-13 07:49:30 +00:00
services SPM: Introduce Secure Partition Manager 2017-11-08 18:05:14 +00:00
tools_share Support Trusted OS firmware extra images in TF tools 2017-08-09 18:06:05 +08:00