arm-trusted-firmware/include/drivers/arm
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
..
cryptocell Fix order of #includes 2017-07-12 14:45:31 +01:00
arm_gic.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
arm_gicv3_common.h GICv3: add functions for save and restore 2017-10-05 16:47:53 +01:00
cci.h CCI: Adapt for specific product at run time 2017-08-01 14:33:47 +01:00
cci400.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
ccn.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
gic_common.h BL31: Program Priority Mask for SMC handling 2017-11-13 07:49:30 +00:00
gic_v2.h ARM platforms: Migrate to using interrupt properties 2017-10-16 16:50:02 +01:00
gic_v3.h Fix type of `unsigned long` constants 2017-09-21 12:03:53 +01:00
gicv2.h GIC: Allow specifying interrupt properties 2017-10-16 16:50:02 +01:00
gicv3.h GIC: Introduce API to get interrupt ID 2017-11-13 07:49:30 +00:00
nic_400.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
pl011.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
pl061_gpio.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
smmu_v3.h Add SMMUv3 driver 2017-08-01 14:33:47 +01:00
sp804_delay_timer.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
sp805.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
tzc400.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
tzc_common.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
tzc_dmc500.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00