arm-trusted-firmware/include/drivers
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
..
arm BL31: Program Priority Mask for SMC handling 2017-11-13 07:49:30 +00:00
auth plat/arm: enlarge the BL2 size on Arm platforms when TBB is enabled 2017-10-25 09:27:15 +08:00
cadence Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
io Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
partition Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
synopsys Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
ti/uart Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
console.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
delay_timer.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
dw_ufs.h drivers: add designware ufs driver 2017-05-31 11:00:57 +08:00
emmc.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
generic_delay_timer.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
gpio.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
ufs.h drivers: add ufs stack 2017-05-31 11:00:38 +08:00