sphinx.addnodesdocument)}( rawsourcechildren](docutils.nodessubstitution_definition)}(h&.. |AArch32| replace:: :term:`AArch32`h]h pending_xref)}(h:term:`AArch32`h]h inline)}(hhh]h TextAArch32}(hhparenthuba attributes}(ids]classes](xrefstdstd-termenames]dupnames]backrefs]utagnamehh!hubah"}(h$]h&]h+]h-]h/]refdoccomponents/exception-handling refdomainh)reftypeterm refexplicitrefwarn reftargetAArch32uh1hsource lineKh!h ubah"}(h$]h&]h+]AArch32ah-]h/]uh1h hAhBhCKh!hhhubh )}(h&.. |AArch64| replace:: :term:`AArch64`h]h)}(h:term:`AArch64`h]h)}(hhQh]hAArch64}(hhh!hSubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!hOubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainh]reftypeterm refexplicitrefwarnh?AArch64uh1hhAhBhCKh!hKubah"}(h$]h&]h+]AArch64ah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |AMU| replace:: :term:`AMU`h]h)}(h :term:`AMU`h]h)}(hh|h]hAMU}(hhh!h~ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!hzubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainhreftypeterm refexplicitrefwarnh?AMUuh1hhAhBhCKh!hvubah"}(h$]h&]h+]AMUah-]h/]uh1h hAhBhCKh!hhhubh )}(h&.. |AMUs| replace:: :term:`AMUs `h]h)}(h:term:`AMUs `h]h)}(hhh]hAMUs}(hhh!hubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!hubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainhreftypeterm refexplicitrefwarnh?AMUuh1hhAhBhCKh!hubah"}(h$]h&]h+]AMUsah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |API| replace:: :term:`API`h]h)}(h :term:`API`h]h)}(hhh]hAPI}(hhh!hubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!hubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainhތreftypeterm refexplicitrefwarnh?APIuh1hhAhBhCKh!hubah"}(h$]h&]h+]APIah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |BTI| replace:: :term:`BTI`h]h)}(h :term:`BTI`h]h)}(hhh]hBTI}(hhh!hubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!hubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?BTIuh1hhAhBhCKh!hubah"}(h$]h&]h+]BTIah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |CoT| replace:: :term:`CoT`h]h)}(h :term:`CoT`h]h)}(hj(h]hCoT}(hhh!j*ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j&ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj4reftypeterm refexplicitrefwarnh?CoTuh1hhAhBhCKh!j"ubah"}(h$]h&]h+]CoTah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |COT| replace:: :term:`COT`h]h)}(h :term:`COT`h]h)}(hjSh]hCOT}(hhh!jUubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jQubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj_reftypeterm refexplicitrefwarnh?COTuh1hhAhBhCKh!jMubah"}(h$]h&]h+]COTah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |CSS| replace:: :term:`CSS`h]h)}(h :term:`CSS`h]h)}(hj~h]hCSS}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j|ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?CSSuh1hhAhBhCK h!jxubah"}(h$]h&]h+]CSSah-]h/]uh1h hAhBhCK h!hhhubh )}(h.. |CVE| replace:: :term:`CVE`h]h)}(h :term:`CVE`h]h)}(hjh]hCVE}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?CVEuh1hhAhBhCK h!jubah"}(h$]h&]h+]CVEah-]h/]uh1h hAhBhCK h!hhhubh )}(h.. |DTB| replace:: :term:`DTB`h]h)}(h :term:`DTB`h]h)}(hjh]hDTB}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?DTBuh1hhAhBhCK h!jubah"}(h$]h&]h+]DTBah-]h/]uh1h hAhBhCK h!hhhubh )}(h .. |DS-5| replace:: :term:`DS-5`h]h)}(h :term:`DS-5`h]h)}(hjh]hDS-5}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?DS-5uh1hhAhBhCK h!jubah"}(h$]h&]h+]DS-5ah-]h/]uh1h hAhBhCK h!hhhubh )}(h.. |DSU| replace:: :term:`DSU`h]h)}(h :term:`DSU`h]h)}(hj*h]hDSU}(hhh!j,ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j(ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj6reftypeterm refexplicitrefwarnh?DSUuh1hhAhBhCK h!j$ubah"}(h$]h&]h+]DSUah-]h/]uh1h hAhBhCK h!hhhubh )}(h.. |DT| replace:: :term:`DT`h]h)}(h :term:`DT`h]h)}(hjUh]hDT}(hhh!jWubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jSubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjareftypeterm refexplicitrefwarnh?DTuh1hhAhBhCKh!jOubah"}(h$]h&]h+]DTah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |EL| replace:: :term:`EL`h]h)}(h :term:`EL`h]h)}(hjh]hEL}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j~ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?ELuh1hhAhBhCKh!jzubah"}(h$]h&]h+]ELah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |EHF| replace:: :term:`EHF`h]h)}(h :term:`EHF`h]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?EHFuh1hhAhBhCKh!jubah"}(h$]h&]h+]EHFah-]h/]uh1h hAhBhCKh!hhhubh )}(h".. |FCONF| replace:: :term:`FCONF`h]h)}(h :term:`FCONF`h]h)}(hjh]hFCONF}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?FCONFuh1hhAhBhCKh!jubah"}(h$]h&]h+]FCONFah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |FDT| replace:: :term:`FDT`h]h)}(h :term:`FDT`h]h)}(hjh]hFDT}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?FDTuh1hhAhBhCKh!jubah"}(h$]h&]h+]FDTah-]h/]uh1h hAhBhCKh!hhhubh )}(h .. |FF-A| replace:: :term:`FF-A`h]h)}(h :term:`FF-A`h]h)}(hj,h]hFF-A}(hhh!j.ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j*ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj8reftypeterm refexplicitrefwarnh?FF-Auh1hhAhBhCKh!j&ubah"}(h$]h&]h+]FF-Aah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |FIP| replace:: :term:`FIP`h]h)}(h :term:`FIP`h]h)}(hjWh]hFIP}(hhh!jYubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jUubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjcreftypeterm refexplicitrefwarnh?FIPuh1hhAhBhCKh!jQubah"}(h$]h&]h+]FIPah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |FVP| replace:: :term:`FVP`h]h)}(h :term:`FVP`h]h)}(hjh]hFVP}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?FVPuh1hhAhBhCKh!j|ubah"}(h$]h&]h+]FVPah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |FWU| replace:: :term:`FWU`h]h)}(h :term:`FWU`h]h)}(hjh]hFWU}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?FWUuh1hhAhBhCKh!jubah"}(h$]h&]h+]FWUah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |GIC| replace:: :term:`GIC`h]h)}(h :term:`GIC`h]h)}(hjh]hGIC}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?GICuh1hhAhBhCKh!jubah"}(h$]h&]h+]GICah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |ISA| replace:: :term:`ISA`h]h)}(h :term:`ISA`h]h)}(hjh]hISA}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?ISAuh1hhAhBhCKh!jubah"}(h$]h&]h+]ISAah-]h/]uh1h hAhBhCKh!hhhubh )}(h$.. |Linaro| replace:: :term:`Linaro`h]h)}(h:term:`Linaro`h]h)}(hj.h]hLinaro}(hhh!j0ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j,ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj:reftypeterm refexplicitrefwarnh?Linarouh1hhAhBhCKh!j(ubah"}(h$]h&]h+]Linaroah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |MMU| replace:: :term:`MMU`h]h)}(h :term:`MMU`h]h)}(hjYh]hMMU}(hhh!j[ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jWubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjereftypeterm refexplicitrefwarnh?MMUuh1hhAhBhCKh!jSubah"}(h$]h&]h+]MMUah-]h/]uh1h hAhBhCKh!hhhubh )}(h .. |MPAM| replace:: :term:`MPAM`h]h)}(h :term:`MPAM`h]h)}(hjh]hMPAM}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?MPAMuh1hhAhBhCKh!j~ubah"}(h$]h&]h+]MPAMah-]h/]uh1h hAhBhCKh!hhhubh )}(h .. |MPMM| replace:: :term:`MPMM`h]h)}(h :term:`MPMM`h]h)}(hjh]hMPMM}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?MPMMuh1hhAhBhCKh!jubah"}(h$]h&]h+]MPMMah-]h/]uh1h hAhBhCKh!hhhubh )}(h".. |MPIDR| replace:: :term:`MPIDR`h]h)}(h :term:`MPIDR`h]h)}(hjh]hMPIDR}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?MPIDRuh1hhAhBhCKh!jubah"}(h$]h&]h+]MPIDRah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |MTE| replace:: :term:`MTE`h]h)}(h :term:`MTE`h]h)}(hjh]hMTE}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?MTEuh1hhAhBhCKh!jubah"}(h$]h&]h+]MTEah-]h/]uh1h hAhBhCKh!hhhubh )}(h.. |OEN| replace:: :term:`OEN`h]h)}(h :term:`OEN`h]h)}(hj0h]hOEN}(hhh!j2ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j.ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj<reftypeterm refexplicitrefwarnh?OENuh1hhAhBhCKh!j*ubah"}(h$]h&]h+]OENah-]h/]uh1h hAhBhCKh!hhhubh )}(h$.. |OP-TEE| replace:: :term:`OP-TEE`h]h)}(h:term:`OP-TEE`h]h)}(hj[h]hOP-TEE}(hhh!j]ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jYubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjgreftypeterm refexplicitrefwarnh?OP-TEEuh1hhAhBhCK h!jUubah"}(h$]h&]h+]OP-TEEah-]h/]uh1h hAhBhCK h!hhhubh )}(h.. |OTE| replace:: :term:`OTE`h]h)}(h :term:`OTE`h]h)}(hjh]hOTE}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?OTEuh1hhAhBhCK!h!jubah"}(h$]h&]h+]OTEah-]h/]uh1h hAhBhCK!h!hhhubh )}(h.. |PDD| replace:: :term:`PDD`h]h)}(h :term:`PDD`h]h)}(hjh]hPDD}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?PDDuh1hhAhBhCK"h!jubah"}(h$]h&]h+]PDDah-]h/]uh1h hAhBhCK"h!hhhubh )}(h".. |PAUTH| replace:: :term:`PAUTH`h]h)}(h :term:`PAUTH`h]h)}(hjh]hPAUTH}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?PAUTHuh1hhAhBhCK#h!jubah"}(h$]h&]h+]PAUTHah-]h/]uh1h hAhBhCK#h!hhhubh )}(h.. |PMF| replace:: :term:`PMF`h]h)}(h :term:`PMF`h]h)}(hjh]hPMF}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?PMFuh1hhAhBhCK$h!jubah"}(h$]h&]h+]PMFah-]h/]uh1h hAhBhCK$h!hhhubh )}(h .. |PSCI| replace:: :term:`PSCI`h]h)}(h :term:`PSCI`h]h)}(hj2h]hPSCI}(hhh!j4ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j0ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj>reftypeterm refexplicitrefwarnh?PSCIuh1hhAhBhCK%h!j,ubah"}(h$]h&]h+]PSCIah-]h/]uh1h hAhBhCK%h!hhhubh )}(h.. |RAS| replace:: :term:`RAS`h]h)}(h :term:`RAS`h]h)}(hj]h]hRAS}(hhh!j_ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j[ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjireftypeterm refexplicitrefwarnh?RASuh1hhAhBhCK&h!jWubah"}(h$]h&]h+]RASah-]h/]uh1h hAhBhCK&h!hhhubh )}(h.. |ROT| replace:: :term:`ROT`h]h)}(h :term:`ROT`h]h)}(hjh]hROT}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?ROTuh1hhAhBhCK'h!jubah"}(h$]h&]h+]ROTah-]h/]uh1h hAhBhCK'h!hhhubh )}(h .. |SCMI| replace:: :term:`SCMI`h]h)}(h :term:`SCMI`h]h)}(hjh]hSCMI}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?SCMIuh1hhAhBhCK(h!jubah"}(h$]h&]h+]SCMIah-]h/]uh1h hAhBhCK(h!hhhubh )}(h.. |SCP| replace:: :term:`SCP`h]h)}(h :term:`SCP`h]h)}(hjh]hSCP}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?SCPuh1hhAhBhCK)h!jubah"}(h$]h&]h+]SCPah-]h/]uh1h hAhBhCK)h!hhhubh )}(h .. |SDEI| replace:: :term:`SDEI`h]h)}(h :term:`SDEI`h]h)}(hj h]hSDEI}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?SDEIuh1hhAhBhCK*h!jubah"}(h$]h&]h+]SDEIah-]h/]uh1h hAhBhCK*h!hhhubh )}(h.. |SDS| replace:: :term:`SDS`h]h)}(h :term:`SDS`h]h)}(hj4h]hSDS}(hhh!j6ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j2ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj@reftypeterm refexplicitrefwarnh?SDSuh1hhAhBhCK+h!j.ubah"}(h$]h&]h+]SDSah-]h/]uh1h hAhBhCK+h!hhhubh )}(h.. |SEA| replace:: :term:`SEA`h]h)}(h :term:`SEA`h]h)}(hj_h]hSEA}(hhh!jaubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j]ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjkreftypeterm refexplicitrefwarnh?SEAuh1hhAhBhCK,h!jYubah"}(h$]h&]h+]SEAah-]h/]uh1h hAhBhCK,h!hhhubh )}(h.. |SiP| replace:: :term:`SiP`h]h)}(h :term:`SiP`h]h)}(hjh]hSiP}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?SiPuh1hhAhBhCK-h!jubah"}(h$]h&]h+]SiPah-]h/]uh1h hAhBhCK-h!hhhubh )}(h.. |SIP| replace:: :term:`SIP`h]h)}(h :term:`SIP`h]h)}(hjh]hSIP}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?SIPuh1hhAhBhCK.h!jubah"}(h$]h&]h+]SIPah-]h/]uh1h hAhBhCK.h!hhhubh )}(h.. |SMC| replace:: :term:`SMC`h]h)}(h :term:`SMC`h]h)}(hjh]hSMC}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?SMCuh1hhAhBhCK/h!jubah"}(h$]h&]h+]SMCah-]h/]uh1h hAhBhCK/h!hhhubh )}(h".. |SMCCC| replace:: :term:`SMCCC`h]h)}(h :term:`SMCCC`h]h)}(hj h]hSMCCC}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?SMCCCuh1hhAhBhCK0h!jubah"}(h$]h&]h+]SMCCCah-]h/]uh1h hAhBhCK0h!hhhubh )}(h.. |SoC| replace:: :term:`SoC`h]h)}(h :term:`SoC`h]h)}(hj6h]hSoC}(hhh!j8ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j4ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjBreftypeterm refexplicitrefwarnh?SoCuh1hhAhBhCK1h!j0ubah"}(h$]h&]h+]SoCah-]h/]uh1h hAhBhCK1h!hhhubh )}(h.. |SP| replace:: :term:`SP`h]h)}(h :term:`SP`h]h)}(hjah]hSP}(hhh!jcubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j_ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjmreftypeterm refexplicitrefwarnh?SPuh1hhAhBhCK2h!j[ubah"}(h$]h&]h+]SPah-]h/]uh1h hAhBhCK2h!hhhubh )}(h.. |SPD| replace:: :term:`SPD`h]h)}(h :term:`SPD`h]h)}(hjh]hSPD}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?SPDuh1hhAhBhCK3h!jubah"}(h$]h&]h+]SPDah-]h/]uh1h hAhBhCK3h!hhhubh )}(h.. |SPM| replace:: :term:`SPM`h]h)}(h :term:`SPM`h]h)}(hjh]hSPM}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?SPMuh1hhAhBhCK4h!jubah"}(h$]h&]h+]SPMah-]h/]uh1h hAhBhCK4h!hhhubh )}(h .. |SSBS| replace:: :term:`SSBS`h]h)}(h :term:`SSBS`h]h)}(hjh]hSSBS}(hhh!jubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypeterm refexplicitrefwarnh?SSBSuh1hhAhBhCK5h!jubah"}(h$]h&]h+]SSBSah-]h/]uh1h hAhBhCK5h!hhhubh )}(h.. |SVE| replace:: :term:`SVE`h]h)}(h :term:`SVE`h]h)}(hj h]hSVE}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?SVEuh1hhAhBhCK6h!j ubah"}(h$]h&]h+]SVEah-]h/]uh1h hAhBhCK6h!hhhubh )}(h.. |TBB| replace:: :term:`TBB`h]h)}(h :term:`TBB`h]h)}(hj8 h]hTBB}(hhh!j: ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j6 ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjD reftypeterm refexplicitrefwarnh?TBBuh1hhAhBhCK7h!j2 ubah"}(h$]h&]h+]TBBah-]h/]uh1h hAhBhCK7h!hhhubh )}(h .. |TBBR| replace:: :term:`TBBR`h]h)}(h :term:`TBBR`h]h)}(hjc h]hTBBR}(hhh!je ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!ja ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjo reftypeterm refexplicitrefwarnh?TBBRuh1hhAhBhCK8h!j] ubah"}(h$]h&]h+]TBBRah-]h/]uh1h hAhBhCK8h!hhhubh )}(h.. |TEE| replace:: :term:`TEE`h]h)}(h :term:`TEE`h]h)}(hj h]hTEE}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?TEEuh1hhAhBhCK9h!j ubah"}(h$]h&]h+]TEEah-]h/]uh1h hAhBhCK9h!hhhubh )}(h .. |TF-A| replace:: :term:`TF-A`h]h)}(h :term:`TF-A`h]h)}(hj h]hTF-A}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?TF-Auh1hhAhBhCK:h!j ubah"}(h$]h&]h+]TF-Aah-]h/]uh1h hAhBhCK:h!hhhubh )}(h .. |TF-M| replace:: :term:`TF-M`h]h)}(h :term:`TF-M`h]h)}(hj h]hTF-M}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?TF-Muh1hhAhBhCK;h!j ubah"}(h$]h&]h+]TF-Mah-]h/]uh1h hAhBhCK;h!hhhubh )}(h.. |TLB| replace:: :term:`TLB`h]h)}(h :term:`TLB`h]h)}(hj h]hTLB}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?TLBuh1hhAhBhCKh!j_ ubah"}(h$]h&]h+]TRNGah-]h/]uh1h hAhBhCK>h!hhhubh )}(h.. |TSP| replace:: :term:`TSP`h]h)}(h :term:`TSP`h]h)}(hj h]hTSP}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?TSPuh1hhAhBhCK?h!j ubah"}(h$]h&]h+]TSPah-]h/]uh1h hAhBhCK?h!hhhubh )}(h.. |TZC| replace:: :term:`TZC`h]h)}(h :term:`TZC`h]h)}(hj h]hTZC}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?TZCuh1hhAhBhCK@h!j ubah"}(h$]h&]h+]TZCah-]h/]uh1h hAhBhCK@h!hhhubh )}(h".. |UBSAN| replace:: :term:`UBSAN`h]h)}(h :term:`UBSAN`h]h)}(hj h]hUBSAN}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?UBSANuh1hhAhBhCKAh!j ubah"}(h$]h&]h+]UBSANah-]h/]uh1h hAhBhCKAh!hhhubh )}(h .. |UEFI| replace:: :term:`UEFI`h]h)}(h :term:`UEFI`h]h)}(hj h]hUEFI}(hhh!j ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypeterm refexplicitrefwarnh?UEFIuh1hhAhBhCKBh!j ubah"}(h$]h&]h+]UEFIah-]h/]uh1h hAhBhCKBh!hhhubh )}(h .. |WDOG| replace:: :term:`WDOG`h]h)}(h :term:`WDOG`h]h)}(hj< h]hWDOG}(hhh!j> ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!j: ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjH reftypeterm refexplicitrefwarnh?WDOGuh1hhAhBhCKCh!j6 ubah"}(h$]h&]h+]WDOGah-]h/]uh1h hAhBhCKCh!hhhubh )}(h!.. |XLAT| replace:: :term:`XLAT` h]h)}(h :term:`XLAT`h]h)}(hjg h]hXLAT}(hhh!ji ubah"}(h$]h&](h(stdstd-termeh+]h-]h/]uh1hh!je ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjs reftypeterm refexplicitrefwarnh?XLATuh1hhAhBhCKDh!ja ubah"}(h$]h&]h+]XLATah-]h/]uh1h hAhBhCKDh!hhhubh section)}(hhh](h title)}(hException Handling Frameworkh]hException Handling Framework}(hj h!j hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!j hhhA^/home/test/workspace/code/optee_3.16/trusted-firmware-a/docs/components/exception-handling.rsthCKubh paragraph)}(hThis document describes various aspects of handling exceptions by Runtime Firmware (BL31) that are targeted at EL3, other than SMCs. The |EHF| takes care of the following exceptions when targeted at EL3:h](hThis document describes various aspects of handling exceptions by Runtime Firmware (BL31) that are targeted at EL3, other than SMCs. The }(hThis document describes various aspects of handling exceptions by Runtime Firmware (BL31) that are targeted at EL3, other than SMCs. The h!j hhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!j ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j hhubh= takes care of the following exceptions when targeted at EL3:}(h= takes care of the following exceptions when targeted at EL3:h!j hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!j hhubh bullet_list)}(hhh](h list_item)}(h Interruptsh]j )}(hj h]h Interrupts}(hj h!j ubah"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!j ubah"}(h$]h&]h+]h-]h/]uh1j h!j hhhAj hCNubj )}(hSynchronous External Abortsh]j )}(hj h]hSynchronous External Aborts}(hj h!j ubah"}(h$]h&]h+]h-]h/]uh1j hAj hCK h!j ubah"}(h$]h&]h+]h-]h/]uh1j h!j hhhAj hCNubj )}(hAsynchronous External Aborts h]j )}(hAsynchronous External Abortsh]hAsynchronous External Aborts}(hj h!j ubah"}(h$]h&]h+]h-]h/]uh1j hAj hCK h!j ubah"}(h$]h&]h+]h-]h/]uh1j h!j hhhAj hCNubeh"}(h$]h&]h+]h-]h/]bullet-uh1j hAj hCKh!j hhubj )}(hX|TF-A|'s handling of synchronous ``SMC`` exceptions raised from lower ELs is described in the :ref:`Firmware Design document `. However, the |EHF| changes the semantics of `Interrupt handling`_ and :ref:`synchronous exceptions ` other than SMCs.h](h)}(hj h]h)}(hj h]hTF-A}(hhh!j0 ubah"}(h$]h&](h(j j eh+]h-]h/]uh1hhANhCNh!j- ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypej refexplicitrefwarn reftargetj uh1hhAhBhCK:h!j) hhubh’s handling of synchronous }(h's handling of synchronous h!j) hhhANhCNubh literal)}(h``SMC``h]hSMC}(hhh!jP ubah"}(h$]h&]h+]h-]h/]uh1jN h!j) ubh6 exceptions raised from lower ELs is described in the }(h6 exceptions raised from lower ELs is described in the h!j) hhhANhCNubh)}(h1:ref:`Firmware Design document `h]h)}(hje h]hFirmware Design document}(hhh!jg ubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!jc ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjq reftyperef refexplicitrefwarnh?handling-an-smcuh1hhAj hCK h!j) ubh. However, the }(h. However, the h!j) hhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!j ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j) hhubh changes the semantics of }(h changes the semantics of h!j) hhhANhCNubh reference)}(h`Interrupt handling`_h]hInterrupt handling}(hInterrupt handlingh!j ubah"}(h$]h&]h+]h-]h/]nameInterrupt handlingrefidid3uh1j h!j) resolvedKubh and }(h and h!j) hhhANhCNubh)}(h3:ref:`synchronous exceptions `h]h)}(hj h]hsynchronous exceptions}(hhh!j ubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftyperef refexplicitrefwarnh?effect on smc callsuh1hhAj hCK h!j) ubh other than SMCs.}(h other than SMCs.h!j) hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCK h!j hhubj )}(hThe |EHF| is selected by setting the build option ``EL3_EXCEPTION_HANDLING`` to ``1``, and is only available for AArch64 systems.h](hThe }(hThe h!j hhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!j ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j hhubh) is selected by setting the build option }(h) is selected by setting the build option h!j hhhANhCNubjO )}(h``EL3_EXCEPTION_HANDLING``h]hEL3_EXCEPTION_HANDLING}(hhh!j ubah"}(h$]h&]h+]h-]h/]uh1jN h!j ubh to }(h to h!j hhhANhCNubjO )}(h``1``h]h1}(hhh!j, ubah"}(h$]h&]h+]h-]h/]uh1jN h!j ubh,, and is only available for AArch64 systems.}(h,, and is only available for AArch64 systems.h!j hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!j hhubj )}(hhh](j )}(h Introductionh]h Introduction}(hjJ h!jH hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!jE hhhAj hCKubj )}(hXThrough various control bits in the ``SCR_EL3`` register, the Arm architecture allows for asynchronous exceptions to be routed to EL3. As described in the :ref:`Interrupt Management Framework` document, depending on the chosen interrupt routing model, TF-A appropriately sets the ``FIQ`` and ``IRQ`` bits of ``SCR_EL3`` register to effect this routing. For most use cases, other than for the purpose of facilitating context switch between Normal and Secure worlds, FIQs and IRQs routed to EL3 are not required to be handled in EL3.h](h$Through various control bits in the }(h$Through various control bits in the h!jV hhhANhCNubjO )}(h ``SCR_EL3``h]hSCR_EL3}(hhh!j_ ubah"}(h$]h&]h+]h-]h/]uh1jN h!jV ubhl register, the Arm architecture allows for asynchronous exceptions to be routed to EL3. As described in the }(hl register, the Arm architecture allows for asynchronous exceptions to be routed to EL3. As described in the h!jV hhhANhCNubh)}(h%:ref:`Interrupt Management Framework`h]h)}(hjt h]hInterrupt Management Framework}(hhh!jv ubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!jr ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftyperef refexplicitrefwarnh?interrupt management frameworkuh1hhAj hCKh!jV ubhX document, depending on the chosen interrupt routing model, TF-A appropriately sets the }(hX document, depending on the chosen interrupt routing model, TF-A appropriately sets the h!jV hhhANhCNubjO )}(h``FIQ``h]hFIQ}(hhh!j ubah"}(h$]h&]h+]h-]h/]uh1jN h!jV ubh and }(h and h!jV hhhANhCNubjO )}(h``IRQ``h]hIRQ}(hhh!j ubah"}(h$]h&]h+]h-]h/]uh1jN h!jV ubh bits of }(h bits of h!jV hhhANhCNubjO )}(h ``SCR_EL3``h]hSCR_EL3}(hhh!j ubah"}(h$]h&]h+]h-]h/]uh1jN h!jV ubh register to effect this routing. For most use cases, other than for the purpose of facilitating context switch between Normal and Secure worlds, FIQs and IRQs routed to EL3 are not required to be handled in EL3.}(h register to effect this routing. For most use cases, other than for the purpose of facilitating context switch between Normal and Secure worlds, FIQs and IRQs routed to EL3 are not required to be handled in EL3.h!jV hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jE hhubj )}(hHowever, the evolving system and standards landscape demands that various exceptions are targeted at and handled in EL3. For instance:h]hHowever, the evolving system and standards landscape demands that various exceptions are targeted at and handled in EL3. For instance:}(hj h!j hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jE hhubj )}(hhh](j )}(hXStarting with ARMv8.2 architecture extension, many RAS features have been introduced to the Arm architecture. With RAS features implemented, various components of the system may use one of the asynchronous exceptions to signal error conditions to PEs. These error conditions are of critical nature, and it's imperative that corrective or remedial actions are taken at the earliest opportunity. Therefore, a *Firmware-first Handling* approach is generally followed in response to RAS events in the system. h]j )}(hXStarting with ARMv8.2 architecture extension, many RAS features have been introduced to the Arm architecture. With RAS features implemented, various components of the system may use one of the asynchronous exceptions to signal error conditions to PEs. These error conditions are of critical nature, and it's imperative that corrective or remedial actions are taken at the earliest opportunity. Therefore, a *Firmware-first Handling* approach is generally followed in response to RAS events in the system.h](hXStarting with ARMv8.2 architecture extension, many RAS features have been introduced to the Arm architecture. With RAS features implemented, various components of the system may use one of the asynchronous exceptions to signal error conditions to PEs. These error conditions are of critical nature, and it’s imperative that corrective or remedial actions are taken at the earliest opportunity. Therefore, a }(hXStarting with ARMv8.2 architecture extension, many RAS features have been introduced to the Arm architecture. With RAS features implemented, various components of the system may use one of the asynchronous exceptions to signal error conditions to PEs. These error conditions are of critical nature, and it's imperative that corrective or remedial actions are taken at the earliest opportunity. Therefore, a h!j ubh emphasis)}(h*Firmware-first Handling*h]hFirmware-first Handling}(hhh!j ubah"}(h$]h&]h+]h-]h/]uh1j h!j ubhH approach is generally followed in response to RAS events in the system.}(hH approach is generally followed in response to RAS events in the system.h!j ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCK"h!j ubah"}(h$]h&]h+]h-]h/]uh1j h!j hhhAj hCNubj )}(hXThe Arm `SDEI specification`_ defines interfaces through which Normal world interacts with the Runtime Firmware in order to request notification of system events. The |SDEI| specification requires that these events are notified even when the Normal world executes with the exceptions masked. This too implies that firmware-first handling is required, where the events are first received by the EL3 firmware, and then dispatched to Normal world through purely software mechanism. h]j )}(hXThe Arm `SDEI specification`_ defines interfaces through which Normal world interacts with the Runtime Firmware in order to request notification of system events. The |SDEI| specification requires that these events are notified even when the Normal world executes with the exceptions masked. This too implies that firmware-first handling is required, where the events are first received by the EL3 firmware, and then dispatched to Normal world through purely software mechanism.h](hThe Arm }(hThe Arm h!jubj )}(h`SDEI specification`_h]hSDEI specification}(hSDEI specificationh!j"ubah"}(h$]h&]h+]h-]h/]nameSDEI specificationrefuriqhttp://infocenter.arm.com/help/topic/com.arm.doc.den0054a/ARM_DEN0054A_Software_Delegated_Exception_Interface.pdfuh1j h!jj Kubh defines interfaces through which Normal world interacts with the Runtime Firmware in order to request notification of system events. The }(h defines interfaces through which Normal world interacts with the Runtime Firmware in order to request notification of system events. The h!jubh)}(hj h]h)}(hj h]hSDEI}(hhh!j=ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j:ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej# refexplicitrefwarn reftargetj&uh1hhAhBhCK*h!jubhX1 specification requires that these events are notified even when the Normal world executes with the exceptions masked. This too implies that firmware-first handling is required, where the events are first received by the EL3 firmware, and then dispatched to Normal world through purely software mechanism.}(hX1 specification requires that these events are notified even when the Normal world executes with the exceptions masked. This too implies that firmware-first handling is required, where the events are first received by the EL3 firmware, and then dispatched to Normal world through purely software mechanism.h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCK*h!jubah"}(h$]h&]h+]h-]h/]uh1j h!j hhhAj hCNubeh"}(h$]h&]h+]h-]h/]j' j( uh1j hAj hCK"h!jE hhubj )}(hX@For |TF-A|, firmware-first handling means that asynchronous exceptions are suitably routed to EL3, and the Runtime Firmware (BL31) is extended to include software components that are capable of handling those exceptions that target EL3. These components—referred to as *dispatchers* [#spd]_ in general—may choose to:h](hFor }(hFor h!jmhhhANhCNubh)}(hj h]h)}(hj h]hTF-A}(hhh!jyubah"}(h$]h&](h(j j eh+]h-]h/]uh1hhANhCNh!jvubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj reftypej refexplicitrefwarn reftargetj uh1hhAhBhCK:h!jmhhubhX, firmware-first handling means that asynchronous exceptions are suitably routed to EL3, and the Runtime Firmware (BL31) is extended to include software components that are capable of handling those exceptions that target EL3. These components—referred to as }(hX, firmware-first handling means that asynchronous exceptions are suitably routed to EL3, and the Runtime Firmware (BL31) is extended to include software components that are capable of handling those exceptions that target EL3. These components—referred to as h!jmhhhANhCNubj )}(h *dispatchers*h]h dispatchers}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jmubh }(h h!jmhhhANhCNubh footnote_reference)}(h[#spd]_h]h1}(hhh!jubah"}(h$]id1ah&]h+]h-]h/]autoKj spddocnameh9uh1jh!jmj Kubh in general—may choose to:}(h in general—may choose to:h!jmhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCK2h!jE hhubh target)}(h.. _delegation-use-cases:h]h"}(h$]h&]h+]h-]h/]j delegation-use-casesuh1jhCK}h!jE hhhAj referencedKubj )}(hhh](j )}(hbReceive and handle exceptions entirely in EL3, meaning the exceptions handling terminates in EL3. h]j )}(haReceive and handle exceptions entirely in EL3, meaning the exceptions handling terminates in EL3.h]haReceive and handle exceptions entirely in EL3, meaning the exceptions handling terminates in EL3.}(hjh!jubah"}(h$]h&]h+]h-]h/]uh1j hAj hCK:h!jubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubj )}(hReceive exceptions, but handle part of the exception in EL3, and delegate the rest of the handling to a dedicated software stack running at lower Secure ELs. In this scheme, the handling spans various secure ELs. h]j )}(hReceive exceptions, but handle part of the exception in EL3, and delegate the rest of the handling to a dedicated software stack running at lower Secure ELs. In this scheme, the handling spans various secure ELs.h]hReceive exceptions, but handle part of the exception in EL3, and delegate the rest of the handling to a dedicated software stack running at lower Secure ELs. In this scheme, the handling spans various secure ELs.}(hjh!jubah"}(h$]h&]h+]h-]h/]uh1j hAj hCK=h!jubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubj )}(hXReceive exceptions, but handle part of the exception in EL3, and delegate processing of the error to dedicated software stack running at lower secure ELs (as above); additionally, the Normal world may also be required to participate in the handling, or be notified of such events (for example, as an |SDEI| event). In this scheme, exception handling potentially and maximally spans all ELs in both Secure and Normal worlds. h]j )}(hXReceive exceptions, but handle part of the exception in EL3, and delegate processing of the error to dedicated software stack running at lower secure ELs (as above); additionally, the Normal world may also be required to participate in the handling, or be notified of such events (for example, as an |SDEI| event). In this scheme, exception handling potentially and maximally spans all ELs in both Secure and Normal worlds.h](hX,Receive exceptions, but handle part of the exception in EL3, and delegate processing of the error to dedicated software stack running at lower secure ELs (as above); additionally, the Normal world may also be required to participate in the handling, or be notified of such events (for example, as an }(hX,Receive exceptions, but handle part of the exception in EL3, and delegate processing of the error to dedicated software stack running at lower secure ELs (as above); additionally, the Normal world may also be required to participate in the handling, or be notified of such events (for example, as an h!jubh)}(hj h]h)}(hj h]hSDEI}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej# refexplicitrefwarn reftargetj&uh1hhAhBhCK*h!jubhu event). In this scheme, exception handling potentially and maximally spans all ELs in both Secure and Normal worlds.}(hu event). In this scheme, exception handling potentially and maximally spans all ELs in both Secure and Normal worlds.h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKAh!j ubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubeh"}(h$]jah&]h+]delegation-use-casesah-]h/]j' j( uh1j hAj hCK:h!jE hhexpect_referenced_by_name}jHjsexpect_referenced_by_id}jjsjKubj )}(hOn any given system, all of the above handling models may be employed independently depending on platform choice and the nature of the exception received.h]hOn any given system, all of the above handling models may be employed independently depending on platform choice and the nature of the exception received.}(hjQh!jOhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j hAj hCKHh!jE hhubh footnote)}(hNot to be confused with :ref:`Secure Payload Dispatcher `, which is an EL3 component that operates in EL3 on behalf of Secure OS. h](h label)}(hhh]h1}(hhh!jehhhANhCNubah"}(h$]h&]h+]h-]h/]uh1jch!j_hhhANhCNubj )}(hNot to be confused with :ref:`Secure Payload Dispatcher `, which is an EL3 component that operates in EL3 on behalf of Secure OS.h](hNot to be confused with }(hNot to be confused with h!jrubh)}(h;:ref:`Secure Payload Dispatcher `h]h)}(hj}h]hSecure Payload Dispatcher}(hhh!jubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!j{ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftyperef refexplicitrefwarnh?firmware_design_sel1_spduh1hhAj hCKLh!jrubhH, which is an EL3 component that operates in EL3 on behalf of Secure OS.}(hH, which is an EL3 component that operates in EL3 on behalf of Secure OS.h!jrubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKLh!j_ubeh"}(h$]jah&]h+]spdah-]h/]jajKjh9uh1j]hAj hCKLh!jE hhubeh"}(h$] introductionah&]h+] introductionah-]h/]uh1j h!j hhhAj hCKubj )}(hhh](j )}(h(The role of Exception Handling Frameworkh]h(The role of Exception Handling Framework}(hjh!jhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCKQubj )}(hXCorollary to the use cases cited above, the primary role of the |EHF| is to facilitate firmware-first handling of exceptions on Arm systems. The |EHF| thus enables multiple exception dispatchers in runtime firmware to co-exist, register for, and handle exceptions targeted at EL3. This section outlines the basics, and the rest of this document expands the various aspects of the |EHF|.h](h@Corollary to the use cases cited above, the primary role of the }(h@Corollary to the use cases cited above, the primary role of the h!jhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jhhubhL is to facilitate firmware-first handling of exceptions on Arm systems. The }(hL is to facilitate firmware-first handling of exceptions on Arm systems. The h!jhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jhhubh thus enables multiple exception dispatchers in runtime firmware to co-exist, register for, and handle exceptions targeted at EL3. This section outlines the basics, and the rest of this document expands the various aspects of the }(h thus enables multiple exception dispatchers in runtime firmware to co-exist, register for, and handle exceptions targeted at EL3. This section outlines the basics, and the rest of this document expands the various aspects of the h!jhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jhhubh.}(h.h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKSh!jhhubj )}(hX In order to arbitrate exception handling among dispatchers, the |EHF| operation is based on a priority scheme. This priority scheme is closely tied to how the Arm GIC architecture defines it, although it's applied to non-interrupt exceptions too (SErrors, for example).h](h@In order to arbitrate exception handling among dispatchers, the }(h@In order to arbitrate exception handling among dispatchers, the h!j8hhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jDubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jAubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j8hhubh operation is based on a priority scheme. This priority scheme is closely tied to how the Arm GIC architecture defines it, although it’s applied to non-interrupt exceptions too (SErrors, for example).}(h operation is based on a priority scheme. This priority scheme is closely tied to how the Arm GIC architecture defines it, although it's applied to non-interrupt exceptions too (SErrors, for example).h!j8hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKYh!jhhubj )}(hXUThe platform is required to `partition`__ the Secure priority space into priority levels as applicable for the Secure software stack. It then assigns the dispatchers to one or more priority levels. The dispatchers then register handlers for the priority levels at runtime. A dispatcher can register handlers for more than one priority level.h](hThe platform is required to }(hThe platform is required to h!jhhhhANhCNubj )}(h `partition`__h]h partition}(h partitionh!jqubah"}(h$]h&]h+]h-]h/]namejy anonymousKj partitioning-priority-levelsuh1j h!jhj KubhX, the Secure priority space into priority levels as applicable for the Secure software stack. It then assigns the dispatchers to one or more priority levels. The dispatchers then register handlers for the priority levels at runtime. A dispatcher can register handlers for more than one priority level.}(hX, the Secure priority space into priority levels as applicable for the Secure software stack. It then assigns the dispatchers to one or more priority levels. The dispatchers then register handlers for the priority levels at runtime. A dispatcher can register handlers for more than one priority level.h!jhhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCK^h!jhhubj)}(h&.. __: `Partitioning priority levels`_h]h"}(h$]id2ah&]h+]h-]h/]jKj juh1jindirect_reference_namePartitioning priority levelshCKh!jhhhAj jKj Kubj)}(h.. _ehf-figure:h]h"}(h$]h&]h+]h-]h/]j ehf-figureuh1jhCKh!jhhhAj jKubh image)}(h1.. image:: ../resources/diagrams/draw.io/ehf.svg h]h"}(h$]jah&]h+] ehf-figureah-]h/]uri"resources/diagrams/draw.io/ehf.svg candidates}*jsuh1jh!jhhhAj hCKjjK}jjsjM}jjsjKubj )}(hXA priority level is *active* when a handler at that priority level is currently executing in EL3, or has delegated the execution to a lower EL. For interrupts, this is implicit when an interrupt is targeted and acknowledged at EL3, and the priority of the acknowledged interrupt is used to match its registered handler. The priority level is likewise implicitly deactivated when the interrupt handling concludes by EOIing the interrupt.h](hA priority level is }(hA priority level is h!jhhhANhCNubj )}(h*active*h]hactive}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubhX when a handler at that priority level is currently executing in EL3, or has delegated the execution to a lower EL. For interrupts, this is implicit when an interrupt is targeted and acknowledged at EL3, and the priority of the acknowledged interrupt is used to match its registered handler. The priority level is likewise implicitly deactivated when the interrupt handling concludes by EOIing the interrupt.}(hX when a handler at that priority level is currently executing in EL3, or has delegated the execution to a lower EL. For interrupts, this is implicit when an interrupt is targeted and acknowledged at EL3, and the priority of the acknowledged interrupt is used to match its registered handler. The priority level is likewise implicitly deactivated when the interrupt handling concludes by EOIing the interrupt.h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKkh!jhhubj )}(hXNon-interrupt exceptions (SErrors, for example) don't have a notion of priority. In order for the priority arbitration to work, the |EHF| provides APIs in order for these non-interrupt exceptions to assume a priority, and to interwork with interrupts. Dispatchers handling such exceptions must therefore explicitly activate and deactivate the respective priority level as and when they're handled or delegated.h](hNon-interrupt exceptions (SErrors, for example) don’t have a notion of priority. In order for the priority arbitration to work, the }(hNon-interrupt exceptions (SErrors, for example) don't have a notion of priority. In order for the priority arbitration to work, the h!jhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jhhubhX provides APIs in order for these non-interrupt exceptions to assume a priority, and to interwork with interrupts. Dispatchers handling such exceptions must therefore explicitly activate and deactivate the respective priority level as and when they’re handled or delegated.}(hX provides APIs in order for these non-interrupt exceptions to assume a priority, and to interwork with interrupts. Dispatchers handling such exceptions must therefore explicitly activate and deactivate the respective priority level as and when they're handled or delegated.h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKrh!jhhubj )}(hXBecause priority activation and deactivation for interrupt handling is implicit and involves GIC priority masking, it's impossible for a lower priority interrupt to preempt a higher priority one. By extension, this means that a lower priority dispatcher cannot preempt a higher-priority one. Priority activation and deactivation for non-interrupt exceptions, however, has to be explicit. The |EHF| therefore disallows for lower priority level to be activated whilst a higher priority level is active, and would result in a panic. Likewise, a panic would result if it's attempted to deactivate a lower priority level when a higher priority level is active.h](hXBecause priority activation and deactivation for interrupt handling is implicit and involves GIC priority masking, it’s impossible for a lower priority interrupt to preempt a higher priority one. By extension, this means that a lower priority dispatcher cannot preempt a higher-priority one. Priority activation and deactivation for non-interrupt exceptions, however, has to be explicit. The }(hXBecause priority activation and deactivation for interrupt handling is implicit and involves GIC priority masking, it's impossible for a lower priority interrupt to preempt a higher priority one. By extension, this means that a lower priority dispatcher cannot preempt a higher-priority one. Priority activation and deactivation for non-interrupt exceptions, however, has to be explicit. The h!j hhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j hhubhX therefore disallows for lower priority level to be activated whilst a higher priority level is active, and would result in a panic. Likewise, a panic would result if it’s attempted to deactivate a lower priority level when a higher priority level is active.}(hX therefore disallows for lower priority level to be activated whilst a higher priority level is active, and would result in a panic. Likewise, a panic would result if it's attempted to deactivate a lower priority level when a higher priority level is active.h!j hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKyh!jhhubj )}(hXZIn essence, priority level activation and deactivation conceptually works like a stack—priority levels stack up in strictly increasing fashion, and need to be unstacked in strictly the reverse order. For interrupts, the GIC ensures this is the case; for non-interrupts, the |EHF| monitors and asserts this. See `Transition of priority levels`_.h](hXIn essence, priority level activation and deactivation conceptually works like a stack—priority levels stack up in strictly increasing fashion, and need to be unstacked in strictly the reverse order. For interrupts, the GIC ensures this is the case; for non-interrupts, the }(hXIn essence, priority level activation and deactivation conceptually works like a stack—priority levels stack up in strictly increasing fashion, and need to be unstacked in strictly the reverse order. For interrupts, the GIC ensures this is the case; for non-interrupts, the h!j<hhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jHubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jEubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j<hhubh monitors and asserts this. See }(h monitors and asserts this. See h!j<hhhANhCNubj )}(h `Transition of priority levels`_h]hTransition of priority levels}(hTransition of priority levelsh!jfubah"}(h$]h&]h+]h-]h/]nameTransition of priority levelsj transition-of-priority-levelsuh1j h!j<j Kubh.}(hj1h!j<hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jhhubj)}(h.. _interrupt-handling:h]h"}(h$]h&]h+]h-]h/]j interrupt-handlinguh1jhCKh!jhhhAj ubeh"}(h$](the-role-of-exception-handling-frameworkah&]h+](the role of exception handling frameworkah-]h/]uh1j h!j hhhAj hCKQubj )}(hhh](j )}(hInterrupt handlingh]hInterrupt handling}(hjh!jhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCKubj )}(hThe |EHF| is a client of *Interrupt Management Framework*, and registers the top-level handler for interrupts that target EL3, as described in the :ref:`Interrupt Management Framework` document. This has the following implications:h](hThe }(hThe h!jhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jhhubh is a client of }(h is a client of h!jhhhANhCNubj )}(h *Interrupt Management Framework*h]hInterrupt Management Framework}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubhZ, and registers the top-level handler for interrupts that target EL3, as described in the }(hZ, and registers the top-level handler for interrupts that target EL3, as described in the h!jhhhANhCNubh)}(h%:ref:`Interrupt Management Framework`h]h)}(hjh]hInterrupt Management Framework}(hhh!jubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftyperef refexplicitrefwarnh?interrupt management frameworkuh1hhAj hCKh!jubh/ document. This has the following implications:}(h/ document. This has the following implications:h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jhhubj )}(hhh](j )}(hXLOn GICv3 systems, when executing in S-EL1, pending Non-secure interrupts of sufficient priority are signalled as FIQs, and therefore will be routed to EL3. As a result, S-EL1 software cannot expect to handle Non-secure interrupts at S-EL1. Essentially, this deprecates the routing mode described as :ref:`CSS=0, TEL3=0 `. In order for S-EL1 software to handle Non-secure interrupts while having |EHF| enabled, the dispatcher must adopt a model where Non-secure interrupts are received at EL3, but are then :ref:`synchronously ` handled over to S-EL1. h](j )}(hXQOn GICv3 systems, when executing in S-EL1, pending Non-secure interrupts of sufficient priority are signalled as FIQs, and therefore will be routed to EL3. As a result, S-EL1 software cannot expect to handle Non-secure interrupts at S-EL1. Essentially, this deprecates the routing mode described as :ref:`CSS=0, TEL3=0 `.h](hX+On GICv3 systems, when executing in S-EL1, pending Non-secure interrupts of sufficient priority are signalled as FIQs, and therefore will be routed to EL3. As a result, S-EL1 software cannot expect to handle Non-secure interrupts at S-EL1. Essentially, this deprecates the routing mode described as }(hX+On GICv3 systems, when executing in S-EL1, pending Non-secure interrupts of sufficient priority are signalled as FIQs, and therefore will be routed to EL3. As a result, S-EL1 software cannot expect to handle Non-secure interrupts at S-EL1. Essentially, this deprecates the routing mode described as h!jubh)}(h%:ref:`CSS=0, TEL3=0 `h]h)}(hj h]h CSS=0, TEL3=0}(hhh!j"ubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj,reftyperef refexplicitrefwarnh?el3 interruptsuh1hhAj hCKh!jubh.}(hj1h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jubj )}(hIn order for S-EL1 software to handle Non-secure interrupts while having |EHF| enabled, the dispatcher must adopt a model where Non-secure interrupts are received at EL3, but are then :ref:`synchronously ` handled over to S-EL1.h](hIIn order for S-EL1 software to handle Non-secure interrupts while having }(hIIn order for S-EL1 software to handle Non-secure interrupts while having h!jHubh)}(hjh]h)}(hjh]hEHF}(hhh!jTubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jQubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jHubhj enabled, the dispatcher must adopt a model where Non-secure interrupts are received at EL3, but are then }(hj enabled, the dispatcher must adopt a model where Non-secure interrupts are received at EL3, but are then h!jHubh)}(h):ref:`synchronously `h]h)}(hjth]h synchronously}(hhh!jvubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!jrubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftyperef refexplicitrefwarnh?sp-synchronous-intuh1hhAj hCKh!jHubh handled over to S-EL1.}(h handled over to S-EL1.h!jHubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jubeh"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubj )}(hOn GICv2 systems, it's required that the build option ``GICV2_G0_FOR_EL3`` is set to ``1`` so that *Group 0* interrupts target EL3. h]j )}(hOn GICv2 systems, it's required that the build option ``GICV2_G0_FOR_EL3`` is set to ``1`` so that *Group 0* interrupts target EL3.h](h8On GICv2 systems, it’s required that the build option }(h6On GICv2 systems, it's required that the build option h!jubjO )}(h``GICV2_G0_FOR_EL3``h]hGICV2_G0_FOR_EL3}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh is set to }(h is set to h!jubjO )}(h``1``h]h1}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh so that }(h so that h!jubj )}(h *Group 0*h]hGroup 0}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubh interrupts target EL3.}(h interrupts target EL3.h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubj )}(hWhile executing in Secure world, |EHF| sets GIC Priority Mask Register to the lowest Secure priority. This means that no Non-secure interrupts can preempt Secure execution. See `Effect on SMC calls`_ for more details. h]j )}(hWhile executing in Secure world, |EHF| sets GIC Priority Mask Register to the lowest Secure priority. This means that no Non-secure interrupts can preempt Secure execution. See `Effect on SMC calls`_ for more details.h](h!While executing in Secure world, }(h!While executing in Secure world, h!jubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jubh sets GIC Priority Mask Register to the lowest Secure priority. This means that no Non-secure interrupts can preempt Secure execution. See }(h sets GIC Priority Mask Register to the lowest Secure priority. This means that no Non-secure interrupts can preempt Secure execution. See h!jubj )}(h`Effect on SMC calls`_h]hEffect on SMC calls}(hEffect on SMC callsh!j#ubah"}(h$]h&]h+]h-]h/]nameEffect on SMC callsj effect-on-smc-callsuh1j h!jj Kubh for more details.}(h for more details.h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubeh"}(h$]h&]h+]h-]h/]j' j( uh1j hAj hCKh!jhhubj )}(hXsAs mentioned above, with |EHF|, the platform is required to partition *Group 0* interrupts into distinct priority levels. A dispatcher that chooses to receive interrupts can then *own* one or more priority levels, and register interrupt handlers for them. A given priority level can be assigned to only one handler. A dispatcher may register more than one priority level.h](hAs mentioned above, with }(hAs mentioned above, with h!jLhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jXubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jUubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jLhhubh(, the platform is required to partition }(h(, the platform is required to partition h!jLhhhANhCNubj )}(h *Group 0*h]hGroup 0}(hhh!jvubah"}(h$]h&]h+]h-]h/]uh1j h!jLubhd interrupts into distinct priority levels. A dispatcher that chooses to receive interrupts can then }(hd interrupts into distinct priority levels. A dispatcher that chooses to receive interrupts can then h!jLhhhANhCNubj )}(h*own*h]hown}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jLubh one or more priority levels, and register interrupt handlers for them. A given priority level can be assigned to only one handler. A dispatcher may register more than one priority level.}(h one or more priority levels, and register interrupt handlers for them. A given priority level can be assigned to only one handler. A dispatcher may register more than one priority level.h!jLhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jhhubj )}(h@Dispatchers are assigned interrupt priority levels in two steps:h]h@Dispatchers are assigned interrupt priority levels in two steps:}(hjh!jhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jhhubj)}(h!.. _Partitioning priority levels:h]h"}(h$]h&]h+]h-]h/]j juh1jhCKh!jhhhAj jKubj )}(hhh](j )}(hPartitioning priority levelsh]hPartitioning priority levels}(hjh!jhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCKubj )}(hInterrupts are associated to dispatchers by way of grouping and assigning interrupts to a priority level. In other words, all interrupts that are to target a particular dispatcher should fall in a particular priority level. For priority assignment:h]hInterrupts are associated to dispatchers by way of grouping and assigning interrupts to a priority level. In other words, all interrupts that are to target a particular dispatcher should fall in a particular priority level. For priority assignment:}(hjh!jhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jhhubj )}(hhh](j )}(h]Of the 8 bits of priority that Arm GIC architecture permits, bit 7 must be 0 (secure space). h]j )}(h\Of the 8 bits of priority that Arm GIC architecture permits, bit 7 must be 0 (secure space).h]h\Of the 8 bits of priority that Arm GIC architecture permits, bit 7 must be 0 (secure space).}(hjh!jubah"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubj )}(hXDepending on the number of dispatchers to support, the platform must choose to use the top *n* of the 7 remaining bits to identify and assign interrupts to individual dispatchers. Choosing *n* bits supports up to 2\ :sup:`n` distinct dispatchers. For example, by choosing 2 additional bits (i.e., bits 6 and 5), the platform can partition into 4 secure priority ranges: ``0x0``, ``0x20``, ``0x40``, and ``0x60``. See `Interrupt handling example`_. h]j )}(hXDepending on the number of dispatchers to support, the platform must choose to use the top *n* of the 7 remaining bits to identify and assign interrupts to individual dispatchers. Choosing *n* bits supports up to 2\ :sup:`n` distinct dispatchers. For example, by choosing 2 additional bits (i.e., bits 6 and 5), the platform can partition into 4 secure priority ranges: ``0x0``, ``0x20``, ``0x40``, and ``0x60``. See `Interrupt handling example`_.h](h[Depending on the number of dispatchers to support, the platform must choose to use the top }(h[Depending on the number of dispatchers to support, the platform must choose to use the top h!jubj )}(h*n*h]hn}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubh_ of the 7 remaining bits to identify and assign interrupts to individual dispatchers. Choosing }(h_ of the 7 remaining bits to identify and assign interrupts to individual dispatchers. Choosing h!jubj )}(h*n*h]hn}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubh bits supports up to 2 }(h bits supports up to 2\ h!jubh superscript)}(h:sup:`n`h]hn}(hhh!j)ubah"}(h$]h&]h+]h-]h/]uh1j'h!jubh distinct dispatchers. For example, by choosing 2 additional bits (i.e., bits 6 and 5), the platform can partition into 4 secure priority ranges: }(h distinct dispatchers. For example, by choosing 2 additional bits (i.e., bits 6 and 5), the platform can partition into 4 secure priority ranges: h!jubjO )}(h``0x0``h]h0x0}(hhh!j<ubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh, }(h, h!jubjO )}(h``0x20``h]h0x20}(hhh!jOubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh, }(h, h!jubjO )}(h``0x40``h]h0x40}(hhh!jbubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh, and }(h, and h!jubjO )}(h``0x60``h]h0x60}(hhh!juubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh. See }(h. See h!jubj )}(h`Interrupt handling example`_h]hInterrupt handling example}(hInterrupt handling exampleh!jubah"}(h$]h&]h+]h-]h/]nameInterrupt handling examplej interrupt-handling-exampleuh1j h!jj Kubh.}(hj1h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubeh"}(h$]h&]h+]h-]h/]j' j( uh1j hAj hCKh!jhhubh note)}(hXnThe Arm GIC architecture requires that a GIC implementation that supports two security states must implement at least 32 priority levels; i.e., at least 5 upper bits of the 8 bits are writeable. In the scheme described above, when choosing *n* bits for priority range assignment, the platform must ensure that at least ``n+1`` top bits of GIC priority are writeable.h]j )}(hXnThe Arm GIC architecture requires that a GIC implementation that supports two security states must implement at least 32 priority levels; i.e., at least 5 upper bits of the 8 bits are writeable. In the scheme described above, when choosing *n* bits for priority range assignment, the platform must ensure that at least ``n+1`` top bits of GIC priority are writeable.h](hThe Arm GIC architecture requires that a GIC implementation that supports two security states must implement at least 32 priority levels; i.e., at least 5 upper bits of the 8 bits are writeable. In the scheme described above, when choosing }(hThe Arm GIC architecture requires that a GIC implementation that supports two security states must implement at least 32 priority levels; i.e., at least 5 upper bits of the 8 bits are writeable. In the scheme described above, when choosing h!jubj )}(h*n*h]hn}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubhL bits for priority range assignment, the platform must ensure that at least }(hL bits for priority range assignment, the platform must ensure that at least h!jubjO )}(h``n+1``h]hn+1}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh( top bits of GIC priority are writeable.}(h( top bits of GIC priority are writeable.h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jubah"}(h$]h&]h+]h-]h/]uh1jh!jhhhAj hCNubj )}(hXThe priority thus assigned to an interrupt is also used to determine the priority of delegated execution in lower ELs. Delegated execution in lower EL is associated with a priority level chosen with ``ehf_activate_priority()`` API (described `later`__). The chosen priority level also determines the interrupts masked while executing in a lower EL, therefore controls preemption of delegated execution.h](hThe priority thus assigned to an interrupt is also used to determine the priority of delegated execution in lower ELs. Delegated execution in lower EL is associated with a priority level chosen with }(hThe priority thus assigned to an interrupt is also used to determine the priority of delegated execution in lower ELs. Delegated execution in lower EL is associated with a priority level chosen with h!jhhhANhCNubjO )}(h``ehf_activate_priority()``h]hehf_activate_priority()}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh API (described }(h API (described h!jhhhANhCNubj )}(h `later`__h]hlater}(hlaterh!j ubah"}(h$]h&]h+]h-]h/]namejjKj ehf-apisuh1j h!jj Kubh). The chosen priority level also determines the interrupts masked while executing in a lower EL, therefore controls preemption of delegated execution.}(h). The chosen priority level also determines the interrupts masked while executing in a lower EL, therefore controls preemption of delegated execution.h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jhhubj)}(h.. __: `ehf-apis`_h]h"}(h$]id5ah&]h+]h-]h/]jKj juh1jjehf-apishCMh!jhhhAj jKj Kubj )}(hThe platform expresses the chosen priority levels by declaring an array of priority level descriptors. Each entry in the array is of type ``ehf_pri_desc_t``, and declares a priority level, and shall be populated by the ``EHF_PRI_DESC()`` macro.h](hThe platform expresses the chosen priority levels by declaring an array of priority level descriptors. Each entry in the array is of type }(hThe platform expresses the chosen priority levels by declaring an array of priority level descriptors. Each entry in the array is of type h!j5hhhANhCNubjO )}(h``ehf_pri_desc_t``h]hehf_pri_desc_t}(hhh!j>ubah"}(h$]h&]h+]h-]h/]uh1jN h!j5ubh?, and declares a priority level, and shall be populated by the }(h?, and declares a priority level, and shall be populated by the h!j5hhhANhCNubjO )}(h``EHF_PRI_DESC()``h]hEHF_PRI_DESC()}(hhh!jQubah"}(h$]h&]h+]h-]h/]uh1jN h!j5ubh macro.}(h macro.h!j5hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jhhubh warning)}(hX3The macro ``EHF_PRI_DESC()`` installs the descriptors in the array at a computed index, and not necessarily where the macro is placed in the array. The size of the array might therefore be larger than what it appears to be. The ``ARRAY_SIZE()`` macro therefore should be used to determine the size of array.h]j )}(hX3The macro ``EHF_PRI_DESC()`` installs the descriptors in the array at a computed index, and not necessarily where the macro is placed in the array. The size of the array might therefore be larger than what it appears to be. The ``ARRAY_SIZE()`` macro therefore should be used to determine the size of array.h](h The macro }(h The macro h!jpubjO )}(h``EHF_PRI_DESC()``h]hEHF_PRI_DESC()}(hhh!jyubah"}(h$]h&]h+]h-]h/]uh1jN h!jpubh installs the descriptors in the array at a computed index, and not necessarily where the macro is placed in the array. The size of the array might therefore be larger than what it appears to be. The }(h installs the descriptors in the array at a computed index, and not necessarily where the macro is placed in the array. The size of the array might therefore be larger than what it appears to be. The h!jpubjO )}(h``ARRAY_SIZE()``h]h ARRAY_SIZE()}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jpubh? macro therefore should be used to determine the size of array.}(h? macro therefore should be used to determine the size of array.h!jpubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jlubah"}(h$]h&]h+]h-]h/]uh1jjh!jhhhAj hCNubj )}(hcFinally, this array of descriptors is exposed to |EHF| via the ``EHF_REGISTER_PRIORITIES()`` macro.h](h1Finally, this array of descriptors is exposed to }(h1Finally, this array of descriptors is exposed to h!jhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jhhubh via the }(h via the h!jhhhANhCNubjO )}(h``EHF_REGISTER_PRIORITIES()``h]hEHF_REGISTER_PRIORITIES()}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh macro.}(h macro.h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jhhubj )}(hkRefer to the `Interrupt handling example`_ for usage. See also: `Interrupt Prioritisation Considerations`_.h](h Refer to the }(h Refer to the h!jhhhANhCNubj )}(h`Interrupt handling example`_h]hInterrupt handling example}(hInterrupt handling exampleh!jubah"}(h$]h&]h+]h-]h/]nameInterrupt handling examplej juh1j h!jj Kubh for usage. See also: }(h for usage. See also: h!jhhhANhCNubj )}(h*`Interrupt Prioritisation Considerations`_h]h'Interrupt Prioritisation Considerations}(h'Interrupt Prioritisation Considerationsh!j ubah"}(h$]h&]h+]h-]h/]name'Interrupt Prioritisation Considerationsj 'interrupt-prioritisation-considerationsuh1j h!jj Kubh.}(hj1h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!jhhubeh"}(h$](jid4eh&]h+]partitioning priority levelsah-]partitioning priority levelsah/]uh1j h!jhhhAj hCKjKjK}j.jsjM}jjsubj )}(hhh](j )}(hProgramming priorityh]hProgramming priority}(hj9h!j7hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!j4hhhAj hCKubj )}(hThe text in `Partitioning priority levels`_ only describes how the platform expresses the required levels of priority. It however doesn't choose interrupts nor program the required priority in GIC.h](h The text in }(h The text in h!jEhhhANhCNubj )}(h`Partitioning priority levels`_h]hPartitioning priority levels}(hPartitioning priority levelsh!jNubah"}(h$]h&]h+]h-]h/]namePartitioning priority levelsj juh1j h!jEj Kubh only describes how the platform expresses the required levels of priority. It however doesn’t choose interrupts nor program the required priority in GIC.}(h only describes how the platform expresses the required levels of priority. It however doesn't choose interrupts nor program the required priority in GIC.h!jEhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!j4hhubj )}(hXZThe :ref:`Firmware Design guide` explains methods for configuring secure interrupts. |EHF| requires the platform to enumerate interrupt properties (as opposed to just numbers) of Secure interrupts. The priority of secure interrupts must match that as determined in the `Partitioning priority levels`_ section above.h](hThe }(hThe h!jjhhhANhCNubh)}(h;:ref:`Firmware Design guide`h]h)}(hjuh]hFirmware Design guide}(hhh!jwubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!jsubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftyperef refexplicitrefwarnh?configuring-secure-interruptsuh1hhAj hCKh!jjubh5 explains methods for configuring secure interrupts. }(h5 explains methods for configuring secure interrupts. h!jjhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jjhhubh requires the platform to enumerate interrupt properties (as opposed to just numbers) of Secure interrupts. The priority of secure interrupts must match that as determined in the }(h requires the platform to enumerate interrupt properties (as opposed to just numbers) of Secure interrupts. The priority of secure interrupts must match that as determined in the h!jjhhhANhCNubj )}(h`Partitioning priority levels`_h]hPartitioning priority levels}(hPartitioning priority levelsh!jubah"}(h$]h&]h+]h-]h/]namePartitioning priority levelsj juh1j h!jjj Kubh section above.}(h section above.h!jjhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!j4hhubj )}(hUSee `Limitations`_, and also refer to `Interrupt handling example`_ for illustration.h](hSee }(hSee h!jhhhANhCNubj )}(h`Limitations`_h]h Limitations}(h Limitationsh!jubah"}(h$]h&]h+]h-]h/]namejj limitationsuh1j h!jj Kubh, and also refer to }(h, and also refer to h!jhhhANhCNubj )}(h`Interrupt handling example`_h]hInterrupt handling example}(hInterrupt handling exampleh!jubah"}(h$]h&]h+]h-]h/]nameInterrupt handling examplej juh1j h!jj Kubh for illustration.}(h for illustration.h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!j4hhubeh"}(h$]programming-priorityah&]h+]programming priorityah-]h/]uh1j h!jhhhAj hCKjKubeh"}(h$](jj eh&]h+](interrupt handlinginterrupt-handlingeh-]h/]uh1j h!j hhhAj hCKjK}jjsjM}jjsjKubj )}(hhh](j )}(hRegistering handlerh]hRegistering handler}(hj'h!j%hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!j"hhhAj hCKubj )}(hRDispatchers register handlers for their priority levels through the following API:h]hRDispatchers register handlers for their priority levels through the following API:}(hj5h!j3hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!j"hhubh literal_block)}(hAint ehf_register_priority_handler(int pri, ehf_handler_t handler)h]hAint ehf_register_priority_handler(int pri, ehf_handler_t handler)}(hhh!jCubah"}(h$]h&]h+]h-]h/]forcehighlight_args} xml:spacepreservelanguagecuh1jAhAj hCKh!j"hhubj )}(hThe API takes two arguments:h]hThe API takes two arguments:}(hjZh!jXhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j hAj hCKh!j"hhubj )}(hhh](j )}(h>The priority level for which the handler is being registered; h]j )}(h=The priority level for which the handler is being registered;h]h=The priority level for which the handler is being registered;}(hjoh!jmubah"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jiubah"}(h$]h&]h+]h-]h/]uh1j h!jfhhhAj hCNubj )}(hFThe handler to be registered. The handler must be aligned to 4 bytes. h]j )}(hEThe handler to be registered. The handler must be aligned to 4 bytes.h]hEThe handler to be registered. The handler must be aligned to 4 bytes.}(hjh!jubah"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jfhhhAj hCNubeh"}(h$]h&]h+]h-]h/]j' j( uh1j hAj hCMh!j"hhubj )}(h\If a dispatcher owns more than one priority levels, it has to call the API for each of them.h]h\If a dispatcher owns more than one priority levels, it has to call the API for each of them.}(hjh!jhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j"hhubj )}(h0The API will succeed, and return ``0``, only if:h](h!The API will succeed, and return }(h!The API will succeed, and return h!jhhhANhCNubjO )}(h``0``h]h0}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh , only if:}(h , only if:h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j"hhubj )}(hhh](j )}(h=There exists a descriptor with the priority level requested. h]j )}(h`.h](h2The parameters are as obtained from the top-level }(h2The parameters are as obtained from the top-level h!jHhhhANhCNubh)}(h3:ref:`EL3 interrupt handler `h]h)}(hjSh]hEL3 interrupt handler}(hhh!jUubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!jQubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj_reftyperef refexplicitrefwarnh?el3-runtime-firmwareuh1hhAj hCMh!jHubh.}(hj1h!jHhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j"hhubj )}(hX The :ref:`SDEI dispatcher`, for example, expects the platform to allocate two different priority levels— ``PLAT_SDEI_CRITICAL_PRI``, and ``PLAT_SDEI_NORMAL_PRI`` —and registers the same handler to handle both levels.h](hThe }(hThe h!j{hhhANhCNubh)}(hD:ref:`SDEI dispatcher`h]h)}(hjh]hSDEI dispatcher}(hhh!jubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftyperef refexplicitrefwarnh?,sdei: software delegated exception interfaceuh1hhAj hCMh!j{ubhQ, for example, expects the platform to allocate two different priority levels— }(hQ, for example, expects the platform to allocate two different priority levels— h!j{hhhANhCNubjO )}(h``PLAT_SDEI_CRITICAL_PRI``h]hPLAT_SDEI_CRITICAL_PRI}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!j{ubh, and }(h, and h!j{hhhANhCNubjO )}(h``PLAT_SDEI_NORMAL_PRI``h]hPLAT_SDEI_NORMAL_PRI}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!j{ubh9 —and registers the same handler to handle both levels.}(h9 —and registers the same handler to handle both levels.h!j{hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j"hhubeh"}(h$]registering-handlerah&]h+]registering handlerah-]h/]uh1j h!j hhhAj hCKubj )}(hhh](j )}(hInterrupt handling exampleh]hInterrupt handling example}(hjh!jhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCM ubj )}(hxThe following annotated snippet demonstrates how a platform might choose to assign interrupts to fictitious dispatchers:h]hxThe following annotated snippet demonstrates how a platform might choose to assign interrupts to fictitious dispatchers:}(hjh!jhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j hAj hCM"h!jhhubjB)}(hX#include #include #include ... /* * This platform uses 2 bits for interrupt association. In total, 3 upper * bits are in use. * * 7 6 5 3 0 * .-.-.-.----------. * |0|b|b| ..0.. | * '-'-'-'----------' */ #define PLAT_PRI_BITS 2 /* Priorities for individual dispatchers */ #define DISP0_PRIO 0x00 /* Not used */ #define DISP1_PRIO 0x20 #define DISP2_PRIO 0x40 #define DISP3_PRIO 0x60 /* Install priority level descriptors for each dispatcher */ ehf_pri_desc_t plat_exceptions[] = { EHF_PRI_DESC(PLAT_PRI_BITS, DISP1_PRIO), EHF_PRI_DESC(PLAT_PRI_BITS, DISP2_PRIO), EHF_PRI_DESC(PLAT_PRI_BITS, DISP3_PRIO), }; /* Expose priority descriptors to Exception Handling Framework */ EHF_REGISTER_PRIORITIES(plat_exceptions, ARRAY_SIZE(plat_exceptions), PLAT_PRI_BITS); ... /* List interrupt properties for GIC driver. All interrupts target EL3 */ const interrupt_prop_t plat_interrupts[] = { /* Dispatcher 1 owns interrupts d1_0 and d1_1, so assigns priority DISP1_PRIO */ INTR_PROP_DESC(d1_0, DISP1_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), INTR_PROP_DESC(d1_1, DISP1_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), /* Dispatcher 2 owns interrupts d2_0 and d2_1, so assigns priority DISP2_PRIO */ INTR_PROP_DESC(d2_0, DISP2_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), INTR_PROP_DESC(d2_1, DISP2_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), /* Dispatcher 3 owns interrupts d3_0 and d3_1, so assigns priority DISP3_PRIO */ INTR_PROP_DESC(d3_0, DISP3_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), INTR_PROP_DESC(d3_1, DISP3_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), }; ... /* Dispatcher 1 registers its handler */ ehf_register_priority_handler(DISP1_PRIO, disp1_handler); /* Dispatcher 2 registers its handler */ ehf_register_priority_handler(DISP2_PRIO, disp2_handler); /* Dispatcher 3 registers its handler */ ehf_register_priority_handler(DISP3_PRIO, disp3_handler); ...h]hX#include #include #include ... /* * This platform uses 2 bits for interrupt association. In total, 3 upper * bits are in use. * * 7 6 5 3 0 * .-.-.-.----------. * |0|b|b| ..0.. | * '-'-'-'----------' */ #define PLAT_PRI_BITS 2 /* Priorities for individual dispatchers */ #define DISP0_PRIO 0x00 /* Not used */ #define DISP1_PRIO 0x20 #define DISP2_PRIO 0x40 #define DISP3_PRIO 0x60 /* Install priority level descriptors for each dispatcher */ ehf_pri_desc_t plat_exceptions[] = { EHF_PRI_DESC(PLAT_PRI_BITS, DISP1_PRIO), EHF_PRI_DESC(PLAT_PRI_BITS, DISP2_PRIO), EHF_PRI_DESC(PLAT_PRI_BITS, DISP3_PRIO), }; /* Expose priority descriptors to Exception Handling Framework */ EHF_REGISTER_PRIORITIES(plat_exceptions, ARRAY_SIZE(plat_exceptions), PLAT_PRI_BITS); ... /* List interrupt properties for GIC driver. All interrupts target EL3 */ const interrupt_prop_t plat_interrupts[] = { /* Dispatcher 1 owns interrupts d1_0 and d1_1, so assigns priority DISP1_PRIO */ INTR_PROP_DESC(d1_0, DISP1_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), INTR_PROP_DESC(d1_1, DISP1_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), /* Dispatcher 2 owns interrupts d2_0 and d2_1, so assigns priority DISP2_PRIO */ INTR_PROP_DESC(d2_0, DISP2_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), INTR_PROP_DESC(d2_1, DISP2_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), /* Dispatcher 3 owns interrupts d3_0 and d3_1, so assigns priority DISP3_PRIO */ INTR_PROP_DESC(d3_0, DISP3_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), INTR_PROP_DESC(d3_1, DISP3_PRIO, INTR_TYPE_EL3, GIC_INTR_CFG_LEVEL), }; ... /* Dispatcher 1 registers its handler */ ehf_register_priority_handler(DISP1_PRIO, disp1_handler); /* Dispatcher 2 registers its handler */ ehf_register_priority_handler(DISP2_PRIO, disp2_handler); /* Dispatcher 3 registers its handler */ ehf_register_priority_handler(DISP3_PRIO, disp3_handler); ...}(hhh!jubah"}(h$]h&]h+]h-]h/]forcehighlight_args}jTjUjVjWuh1jAhAj hCM%h!jhhubj )}(h9See also the `Build-time flow`_ and the `Run-time flow`_.h](h See also the }(h See also the h!j hhhANhCNubj )}(h`Build-time flow`_h]hBuild-time flow}(hBuild-time flowh!jubah"}(h$]h&]h+]h-]h/]nameBuild-time flowj build-time-flowuh1j h!j j Kubh and the }(h and the h!j hhhANhCNubj )}(h`Run-time flow`_h]h Run-time flow}(h Run-time flowh!j-ubah"}(h$]h&]h+]h-]h/]name Run-time flowj run-time-flowuh1j h!j j Kubh.}(hj1h!j hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMgh!jhhubj)}(h+.. _Activating and Deactivating priorities:h]h"}(h$]h&]h+]h-]h/]j &activating-and-deactivating-prioritiesuh1jhCMh!jhhhAj ubeh"}(h$]jah&]h+]interrupt handling exampleah-]h/]uh1j h!j hhhAj hCM jKubj )}(hhh](j )}(h&Activating and Deactivating prioritiesh]h&Activating and Deactivating priorities}(hj`h!j^hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!j[hhhAj hCMlubj )}(hXcA priority level is said to be *active* when an exception of that priority is being handled: for interrupts, this is implied when the interrupt is acknowledged; for non-interrupt exceptions, such as SErrors or :ref:`SDEI explicit dispatches `, this has to be done via calling ``ehf_activate_priority()``. See `Run-time flow`_.h](hA priority level is said to be }(hA priority level is said to be h!jlhhhANhCNubj )}(h*active*h]hactive}(hhh!juubah"}(h$]h&]h+]h-]h/]uh1j h!jlubh when an exception of that priority is being handled: for interrupts, this is implied when the interrupt is acknowledged; for non-interrupt exceptions, such as SErrors or }(h when an exception of that priority is being handled: for interrupts, this is implied when the interrupt is acknowledged; for non-interrupt exceptions, such as SErrors or h!jlhhhANhCNubh)}(h=:ref:`SDEI explicit dispatches `h]h)}(hjh]hSDEI explicit dispatches}(hhh!jubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftyperef refexplicitrefwarnh?explicit-dispatch-of-eventsuh1hhAj hCMnh!jlubh", this has to be done via calling }(h", this has to be done via calling h!jlhhhANhCNubjO )}(h``ehf_activate_priority()``h]hehf_activate_priority()}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jlubh. See }(h. See h!jlhhhANhCNubj )}(h`Run-time flow`_h]h Run-time flow}(h Run-time flowh!jubah"}(h$]h&]h+]h-]h/]name Run-time flowj j>uh1j h!jlj Kubh.}(hj1h!jlhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMnh!j[hhubj )}(hX@Conversely, when the dispatcher has reached a logical resolution for the cause of the exception, the corresponding priority level ought to be deactivated. As above, for interrupts, this is implied when the interrupt is EOId in the GIC; for other exceptions, this has to be done via calling ``ehf_deactivate_priority()``.h](hX"Conversely, when the dispatcher has reached a logical resolution for the cause of the exception, the corresponding priority level ought to be deactivated. As above, for interrupts, this is implied when the interrupt is EOId in the GIC; for other exceptions, this has to be done via calling }(hX"Conversely, when the dispatcher has reached a logical resolution for the cause of the exception, the corresponding priority level ought to be deactivated. As above, for interrupts, this is implied when the interrupt is EOId in the GIC; for other exceptions, this has to be done via calling h!jhhhANhCNubjO )}(h``ehf_deactivate_priority()``h]hehf_deactivate_priority()}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh.}(hj1h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMth!j[hhubj )}(h|Thanks to `different provisions`__ for exception delegation, there are potentially more than one work flow for deactivation:h](h Thanks to }(h Thanks to h!jhhhANhCNubj )}(h`different provisions`__h]hdifferent provisions}(hdifferent provisionsh!jubah"}(h$]h&]h+]h-]h/]namedifferent provisionsjKj juh1j h!jj KubhZ for exception delegation, there are potentially more than one work flow for deactivation:}(hZ for exception delegation, there are potentially more than one work flow for deactivation:h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMzh!j[hhubj)}(h.. __: `delegation-use-cases`_h]h"}(h$]id7ah&]h+]h-]h/]jKj juh1jjdelegation-use-caseshCMh!j[hhhAj jKj Kubj)}(h.. _deactivation workflows:h]h"}(h$]h&]h+]h-]h/]j deactivation-workflowsuh1jhCMh!j[hhhAj jKubj )}(hhh](j )}(hX'The dispatcher has addressed the cause of the exception, and decided to take no further action. In this case, the dispatcher's handler deactivates the priority level before returning to the |EHF|. Runtime firmware, upon exit through an ``ERET``, resumes execution before the interrupt occurred. h]j )}(hX&The dispatcher has addressed the cause of the exception, and decided to take no further action. In this case, the dispatcher's handler deactivates the priority level before returning to the |EHF|. Runtime firmware, upon exit through an ``ERET``, resumes execution before the interrupt occurred.h](hThe dispatcher has addressed the cause of the exception, and decided to take no further action. In this case, the dispatcher’s handler deactivates the priority level before returning to the }(hThe dispatcher has addressed the cause of the exception, and decided to take no further action. In this case, the dispatcher's handler deactivates the priority level before returning to the h!j?ubh)}(hjh]h)}(hjh]hEHF}(hhh!jKubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jHubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j?ubh). Runtime firmware, upon exit through an }(h). Runtime firmware, upon exit through an h!j?ubjO )}(h``ERET``h]hERET}(hhh!jiubah"}(h$]h&]h+]h-]h/]uh1jN h!j?ubh2, resumes execution before the interrupt occurred.}(h2, resumes execution before the interrupt occurred.h!j?ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j;ubah"}(h$]h&]h+]h-]h/]uh1j h!j8hhhAj hCNubj )}(hXThe dispatcher has to delegate the execution to lower ELs, and the cause of the exception can be considered resolved only when the lower EL returns signals complete (via an ``SMC``) at a future point in time. The following sequence ensues: #. The dispatcher calls ``setjmp()`` to setup a jump point, and arranges to enter a lower EL upon the next ``ERET``. #. Through the ensuing ``ERET`` from runtime firmware, execution is delegated to a lower EL. #. The lower EL completes its execution, and signals completion via an ``SMC``. #. The ``SMC`` is handled by the same dispatcher that handled the exception previously. Noticing the conclusion of exception handling, the dispatcher does ``longjmp()`` to resume beyond the previous jump point. h](j )}(hThe dispatcher has to delegate the execution to lower ELs, and the cause of the exception can be considered resolved only when the lower EL returns signals complete (via an ``SMC``) at a future point in time. The following sequence ensues:h](hThe dispatcher has to delegate the execution to lower ELs, and the cause of the exception can be considered resolved only when the lower EL returns signals complete (via an }(hThe dispatcher has to delegate the execution to lower ELs, and the cause of the exception can be considered resolved only when the lower EL returns signals complete (via an h!jubjO )}(h``SMC``h]hSMC}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh;) at a future point in time. The following sequence ensues:}(h;) at a future point in time. The following sequence ensues:h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubh enumerated_list)}(hhh](j )}(hrThe dispatcher calls ``setjmp()`` to setup a jump point, and arranges to enter a lower EL upon the next ``ERET``. h]j )}(hqThe dispatcher calls ``setjmp()`` to setup a jump point, and arranges to enter a lower EL upon the next ``ERET``.h](hThe dispatcher calls }(hThe dispatcher calls h!jubjO )}(h ``setjmp()``h]hsetjmp()}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubhG to setup a jump point, and arranges to enter a lower EL upon the next }(hG to setup a jump point, and arranges to enter a lower EL upon the next h!jubjO )}(h``ERET``h]hERET}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh.}(hj1h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubj )}(hZThrough the ensuing ``ERET`` from runtime firmware, execution is delegated to a lower EL. h]j )}(hYThrough the ensuing ``ERET`` from runtime firmware, execution is delegated to a lower EL.h](hThrough the ensuing }(hThrough the ensuing h!jubjO )}(h``ERET``h]hERET}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh= from runtime firmware, execution is delegated to a lower EL.}(h= from runtime firmware, execution is delegated to a lower EL.h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubj )}(hMThe lower EL completes its execution, and signals completion via an ``SMC``. h]j )}(hLThe lower EL completes its execution, and signals completion via an ``SMC``.h](hDThe lower EL completes its execution, and signals completion via an }(hDThe lower EL completes its execution, and signals completion via an h!j!ubjO )}(h``SMC``h]hSMC}(hhh!j*ubah"}(h$]h&]h+]h-]h/]uh1jN h!j!ubh.}(hj1h!j!ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubj )}(hThe ``SMC`` is handled by the same dispatcher that handled the exception previously. Noticing the conclusion of exception handling, the dispatcher does ``longjmp()`` to resume beyond the previous jump point. h]j )}(hThe ``SMC`` is handled by the same dispatcher that handled the exception previously. Noticing the conclusion of exception handling, the dispatcher does ``longjmp()`` to resume beyond the previous jump point.h](hThe }(hThe h!jLubjO )}(h``SMC``h]hSMC}(hhh!jUubah"}(h$]h&]h+]h-]h/]uh1jN h!jLubh is handled by the same dispatcher that handled the exception previously. Noticing the conclusion of exception handling, the dispatcher does }(h is handled by the same dispatcher that handled the exception previously. Noticing the conclusion of exception handling, the dispatcher does h!jLubjO )}(h ``longjmp()``h]h longjmp()}(hhh!jhubah"}(h$]h&]h+]h-]h/]uh1jN h!jLubh* to resume beyond the previous jump point.}(h* to resume beyond the previous jump point.h!jLubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jHubah"}(h$]h&]h+]h-]h/]uh1j h!jubeh"}(h$]h&]h+]h-]h/]enumtypearabicprefixhsuffixj1uh1jh!jubeh"}(h$]h&]h+]h-]h/]uh1j h!j8hhhANhCNubeh"}(h$]j7ah&]h+]deactivation workflowsah-]h/]j' j( uh1j hAj hCMh!j[hhjK}jj-sjM}j7j-sjKubj )}(hdAs mentioned above, the |EHF| provides the following APIs for activating and deactivating interrupt:h](hAs mentioned above, the }(hAs mentioned above, the h!jhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jhhubhG provides the following APIs for activating and deactivating interrupt:}(hG provides the following APIs for activating and deactivating interrupt:h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j[hhubj)}(h .. _ehf-apis:h]h"}(h$]h&]h+]h-]h/]j juh1jhCMh!j[hhhAj jKubj )}(hhh](j )}(hX``ehf_activate_priority()`` activates the supplied priority level, but only if the current active priority is higher than the given one; otherwise panics. Also, to prevent interruption by physical interrupts of lower priority, the |EHF| programs the *Priority Mask Register* corresponding to the PE to the priority being activated. Dispatchers typically only need to call this when handling exceptions other than interrupts, and it needs to delegate execution to a lower EL at a desired priority level. h]j )}(hX``ehf_activate_priority()`` activates the supplied priority level, but only if the current active priority is higher than the given one; otherwise panics. Also, to prevent interruption by physical interrupts of lower priority, the |EHF| programs the *Priority Mask Register* corresponding to the PE to the priority being activated. Dispatchers typically only need to call this when handling exceptions other than interrupts, and it needs to delegate execution to a lower EL at a desired priority level.h](jO )}(h``ehf_activate_priority()``h]hehf_activate_priority()}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh activates the supplied priority level, but only if the current active priority is higher than the given one; otherwise panics. Also, to prevent interruption by physical interrupts of lower priority, the }(h activates the supplied priority level, but only if the current active priority is higher than the given one; otherwise panics. Also, to prevent interruption by physical interrupts of lower priority, the h!jubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jubh programs the }(h programs the h!jubj )}(h*Priority Mask Register*h]hPriority Mask Register}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubh corresponding to the PE to the priority being activated. Dispatchers typically only need to call this when handling exceptions other than interrupts, and it needs to delegate execution to a lower EL at a desired priority level.}(h corresponding to the PE to the priority being activated. Dispatchers typically only need to call this when handling exceptions other than interrupts, and it needs to delegate execution to a lower EL at a desired priority level.h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubj )}(hXx``ehf_deactivate_priority()`` deactivates a given priority, but only if the current active priority is equal to the given one; otherwise panics. |EHF| also restores the *Priority Mask Register* corresponding to the PE to the priority before the call to ``ehf_activate_priority()``. Dispatchers typically only need to call this after handling exceptions other than interrupts. h]j )}(hXw``ehf_deactivate_priority()`` deactivates a given priority, but only if the current active priority is equal to the given one; otherwise panics. |EHF| also restores the *Priority Mask Register* corresponding to the PE to the priority before the call to ``ehf_activate_priority()``. Dispatchers typically only need to call this after handling exceptions other than interrupts.h](jO )}(h``ehf_deactivate_priority()``h]hehf_deactivate_priority()}(hhh!j@ubah"}(h$]h&]h+]h-]h/]uh1jN h!j<ubht deactivates a given priority, but only if the current active priority is equal to the given one; otherwise panics. }(ht deactivates a given priority, but only if the current active priority is equal to the given one; otherwise panics. h!j<ubh)}(hjh]h)}(hjh]hEHF}(hhh!jVubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jSubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j<ubh also restores the }(h also restores the h!j<ubj )}(h*Priority Mask Register*h]hPriority Mask Register}(hhh!jtubah"}(h$]h&]h+]h-]h/]uh1j h!j<ubh< corresponding to the PE to the priority before the call to }(h< corresponding to the PE to the priority before the call to h!j<ubjO )}(h``ehf_activate_priority()``h]hehf_activate_priority()}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!j<ubh_. Dispatchers typically only need to call this after handling exceptions other than interrupts.}(h_. Dispatchers typically only need to call this after handling exceptions other than interrupts.h!j<ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j8ubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubeh"}(h$]jah&]h+]ehf-apisah-]h/]j' j( uh1j hAj hCMh!j[hhjK}jjsjM}jjsjKubj )}(hZThe calling of APIs are subject to allowed `transitions`__. See also the `Run-time flow`_.h](h+The calling of APIs are subject to allowed }(h+The calling of APIs are subject to allowed h!jhhhANhCNubj )}(h`transitions`__h]h transitions}(h transitionsh!jubah"}(h$]h&]h+]h-]h/]namejjKj jwuh1j h!jj Kubh. See also the }(h. See also the h!jhhhANhCNubj )}(h`Run-time flow`_h]h Run-time flow}(h Run-time flowh!jubah"}(h$]h&]h+]h-]h/]name Run-time flowj j>uh1j h!jj Kubh.}(hj1h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j[hhubj)}(h'.. __: `Transition of priority levels`_h]h"}(h$]id8ah&]h+]h-]h/]jKj jwuh1jjTransition of priority levelshCMh!j[hhhAj jKj Kubeh"}(h$](jSid6eh&]h+]&activating and deactivating prioritiesah-]&activating and deactivating prioritiesah/]uh1j h!j hhhAj hCMljKjK}jjIsjM}jSjIsubj )}(hhh](j )}(hTransition of priority levelsh]hTransition of priority levels}(hjh!jhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCMubj )}(hThe |EHF| APIs ``ehf_activate_priority()`` and ``ehf_deactivate_priority()`` can be called to transition the current priority level on a PE. A given sequence of calls to these APIs are subject to the following conditions:h](hThe }(hThe h!jhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jhhubh APIs }(h APIs h!jhhhANhCNubjO )}(h``ehf_activate_priority()``h]hehf_activate_priority()}(hhh!j:ubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh and }(h and h!jhhhANhCNubjO )}(h``ehf_deactivate_priority()``h]hehf_deactivate_priority()}(hhh!jMubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh can be called to transition the current priority level on a PE. A given sequence of calls to these APIs are subject to the following conditions:}(h can be called to transition the current priority level on a PE. A given sequence of calls to these APIs are subject to the following conditions:h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jhhubj )}(hhh](j )}(hcFor activation, the |EHF| only allows for the priority to increase (i.e. numeric value decreases); h]j )}(hbFor activation, the |EHF| only allows for the priority to increase (i.e. numeric value decreases);h](hFor activation, the }(hFor activation, the h!jmubh)}(hjh]h)}(hjh]hEHF}(hhh!jyubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jvubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jmubhI only allows for the priority to increase (i.e. numeric value decreases);}(hI only allows for the priority to increase (i.e. numeric value decreases);h!jmubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jiubah"}(h$]h&]h+]h-]h/]uh1j h!jfhhhAj hCNubj )}(hFor deactivation, the |EHF| only allows for the priority to decrease (i.e. numeric value increases). Additionally, the priority being deactivated is required to be the current priority. h]j )}(hFor deactivation, the |EHF| only allows for the priority to decrease (i.e. numeric value increases). Additionally, the priority being deactivated is required to be the current priority.h](hFor deactivation, the }(hFor deactivation, the h!jubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jubh only allows for the priority to decrease (i.e. numeric value increases). Additionally, the priority being deactivated is required to be the current priority.}(h only allows for the priority to decrease (i.e. numeric value increases). Additionally, the priority being deactivated is required to be the current priority.h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jfhhhAj hCNubeh"}(h$]h&]h+]h-]h/]j' j( uh1j hAj hCMh!jhhubj )}(h+If these are violated, a panic will result.h]h+If these are violated, a panic will result.}(hjh!jhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jhhubj)}(h.. _Effect on SMC calls:h]h"}(h$]h&]h+]h-]h/]j j4uh1jhCMh!jhhhAj jKubeh"}(h$]jwah&]h+]transition of priority levelsah-]h/]uh1j h!j hhhAj hCMjKubj )}(hhh](j )}(hEffect on SMC callsh]hEffect on SMC calls}(hjh!jhhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCMubj )}(hXIn general, Secure execution is regarded as more important than Non-secure execution. As discussed elsewhere in this document, EL3 execution, and any delegated execution thereafter, has the effect of raising GIC's priority mask—either implicitly by acknowledging Secure interrupts, or when dispatchers call ``ehf_activate_priority()``. As a result, Non-secure interrupts cannot preempt any Secure execution.h](hX7In general, Secure execution is regarded as more important than Non-secure execution. As discussed elsewhere in this document, EL3 execution, and any delegated execution thereafter, has the effect of raising GIC’s priority mask—either implicitly by acknowledging Secure interrupts, or when dispatchers call }(hX5In general, Secure execution is regarded as more important than Non-secure execution. As discussed elsewhere in this document, EL3 execution, and any delegated execution thereafter, has the effect of raising GIC's priority mask—either implicitly by acknowledging Secure interrupts, or when dispatchers call h!jhhhANhCNubjO )}(h``ehf_activate_priority()``h]hehf_activate_priority()}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubhI. As a result, Non-secure interrupts cannot preempt any Secure execution.}(hI. As a result, Non-secure interrupts cannot preempt any Secure execution.h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jhhubj )}(hSMCs from Non-secure world are synchronous exceptions, and are mechanisms for Non-secure world to request Secure services. They're broadly classified as *Fast* or *Yielding* (see `SMCCC`__).h](hSMCs from Non-secure world are synchronous exceptions, and are mechanisms for Non-secure world to request Secure services. They’re broadly classified as }(hSMCs from Non-secure world are synchronous exceptions, and are mechanisms for Non-secure world to request Secure services. They're broadly classified as h!j5hhhANhCNubj )}(h*Fast*h]hFast}(hhh!j>ubah"}(h$]h&]h+]h-]h/]uh1j h!j5ubh or }(h or h!j5hhhANhCNubj )}(h *Yielding*h]hYielding}(hhh!jQubah"}(h$]h&]h+]h-]h/]uh1j h!j5ubh (see }(h (see h!j5hhhANhCNubj )}(h `SMCCC`__h]hSMCCC}(hSMCCCh!jdubah"}(h$]h&]h+]h-]h/]namejljKj3-https://developer.arm.com/docs/den0028/latestuh1j h!j5j Kubh).}(h).h!j5hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jhhubj)}(h4.. __: https://developer.arm.com/docs/den0028/latesth]h"}(h$]id10ah&]h+]h-]h/]j3jtjKuh1jhCMh!jhhhAj jKubj )}(hhh](j )}(h*Fast* SMCs are atomic from the caller's point of view. I.e., they return to the caller only when the Secure world has finished serving the request. Any Non-secure interrupts that become pending meanwhile cannot preempt Secure execution. h]j )}(h*Fast* SMCs are atomic from the caller's point of view. I.e., they return to the caller only when the Secure world has finished serving the request. Any Non-secure interrupts that become pending meanwhile cannot preempt Secure execution.h](j )}(h*Fast*h]hFast}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubh SMCs are atomic from the caller’s point of view. I.e., they return to the caller only when the Secure world has finished serving the request. Any Non-secure interrupts that become pending meanwhile cannot preempt Secure execution.}(h SMCs are atomic from the caller's point of view. I.e., they return to the caller only when the Secure world has finished serving the request. Any Non-secure interrupts that become pending meanwhile cannot preempt Secure execution.h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubj )}(hX*Yielding* SMCs carry the semantics of a preemptible, lower-priority request. A pending Non-secure interrupt can preempt Secure execution handling a Yielding SMC. I.e., the caller might observe a Yielding SMC returning when either: #. Secure world completes the request, and the caller would find ``SMC_OK`` as the return code. #. A Non-secure interrupt preempts Secure execution. Non-secure interrupt is handled, and Non-secure execution resumes after ``SMC`` instruction. The dispatcher handling a Yielding SMC must provide a different return code to the Non-secure caller to distinguish the latter case. This return code, however, is not standardised (unlike ``SMC_UNKNOWN`` or ``SMC_OK``, for example), so will vary across dispatchers that handle the request. h](j )}(h*Yielding* SMCs carry the semantics of a preemptible, lower-priority request. A pending Non-secure interrupt can preempt Secure execution handling a Yielding SMC. I.e., the caller might observe a Yielding SMC returning when either:h](j )}(h *Yielding*h]hYielding}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubh SMCs carry the semantics of a preemptible, lower-priority request. A pending Non-secure interrupt can preempt Secure execution handling a Yielding SMC. I.e., the caller might observe a Yielding SMC returning when either:}(h SMCs carry the semantics of a preemptible, lower-priority request. A pending Non-secure interrupt can preempt Secure execution handling a Yielding SMC. I.e., the caller might observe a Yielding SMC returning when either:h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubj)}(hhh](j )}(h]Secure world completes the request, and the caller would find ``SMC_OK`` as the return code. h]j )}(h\Secure world completes the request, and the caller would find ``SMC_OK`` as the return code.h](h>Secure world completes the request, and the caller would find }(h>Secure world completes the request, and the caller would find h!jubjO )}(h ``SMC_OK``h]hSMC_OK}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!jubh as the return code.}(h as the return code.h!jubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubj )}(hA Non-secure interrupt preempts Secure execution. Non-secure interrupt is handled, and Non-secure execution resumes after ``SMC`` instruction. h]j )}(hA Non-secure interrupt preempts Secure execution. Non-secure interrupt is handled, and Non-secure execution resumes after ``SMC`` instruction.h](hzA Non-secure interrupt preempts Secure execution. Non-secure interrupt is handled, and Non-secure execution resumes after }(hzA Non-secure interrupt preempts Secure execution. Non-secure interrupt is handled, and Non-secure execution resumes after h!j ubjO )}(h``SMC``h]hSMC}(hhh!jubah"}(h$]h&]h+]h-]h/]uh1jN h!j ubh instruction.}(h instruction.h!j ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubah"}(h$]h&]h+]h-]h/]uh1j h!jubeh"}(h$]h&]h+]h-]h/]jjjhjj1uh1jh!jubj )}(hX!The dispatcher handling a Yielding SMC must provide a different return code to the Non-secure caller to distinguish the latter case. This return code, however, is not standardised (unlike ``SMC_UNKNOWN`` or ``SMC_OK``, for example), so will vary across dispatchers that handle the request.h](hThe dispatcher handling a Yielding SMC must provide a different return code to the Non-secure caller to distinguish the latter case. This return code, however, is not standardised (unlike }(hThe dispatcher handling a Yielding SMC must provide a different return code to the Non-secure caller to distinguish the latter case. This return code, however, is not standardised (unlike h!j7ubjO )}(h``SMC_UNKNOWN``h]h SMC_UNKNOWN}(hhh!j@ubah"}(h$]h&]h+]h-]h/]uh1jN h!j7ubh or }(h or h!j7ubjO )}(h ``SMC_OK``h]hSMC_OK}(hhh!jSubah"}(h$]h&]h+]h-]h/]uh1jN h!j7ubhH, for example), so will vary across dispatchers that handle the request.}(hH, for example), so will vary across dispatchers that handle the request.h!j7ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jubeh"}(h$]h&]h+]h-]h/]uh1j h!jhhhAj hCNubeh"}(h$]h&]h+]h-]h/]j' j( uh1j hAj hCMh!jhhubj )}(hFor the latter case above, dispatchers before |EHF| expect Non-secure interrupts to be taken to S-EL1 [#irq]_, so would get a chance to populate the designated preempted error code before yielding to Non-secure world.h](h.For the latter case above, dispatchers before }(h.For the latter case above, dispatchers before h!jxhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jxhhubh3 expect Non-secure interrupts to be taken to S-EL1 }(h3 expect Non-secure interrupts to be taken to S-EL1 h!jxhhhANhCNubj)}(h[#irq]_h]h2}(hhh!jubah"}(h$]id11ah&]h+]h-]h/]jKj irqjh9uh1jh!jxj Kubhl, so would get a chance to populate the designated preempted error code before yielding to Non-secure world.}(hl, so would get a chance to populate the designated preempted error code before yielding to Non-secure world.h!jxhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jhhubj )}(hVThe introduction of |EHF| changes the behaviour as described in `Interrupt handling`_.h](hThe introduction of }(hThe introduction of h!jhhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jhhubh' changes the behaviour as described in }(h' changes the behaviour as described in h!jhhhANhCNubj )}(h`Interrupt handling`_h]hInterrupt handling}(hInterrupt handlingh!jubah"}(h$]h&]h+]h-]h/]nameInterrupt handlingj j uh1j h!jj Kubh.}(hj1h!jhhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jhhubj )}(hXWhen |EHF| is enabled, in order to allow Non-secure interrupts to preempt Yielding SMC handling, the dispatcher must call ``ehf_allow_ns_preemption()`` API. The API takes one argument, the error code to be returned to the Non-secure world upon getting preempted.h](hWhen }(hWhen h!j hhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!j ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j hhubhp is enabled, in order to allow Non-secure interrupts to preempt Yielding SMC handling, the dispatcher must call }(hp is enabled, in order to allow Non-secure interrupts to preempt Yielding SMC handling, the dispatcher must call h!j hhhANhCNubjO )}(h``ehf_allow_ns_preemption()``h]hehf_allow_ns_preemption()}(hhh!j, ubah"}(h$]h&]h+]h-]h/]uh1jN h!j ubho API. The API takes one argument, the error code to be returned to the Non-secure world upon getting preempted.}(ho API. The API takes one argument, the error code to be returned to the Non-secure world upon getting preempted.h!j hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jhhubj^)}(hkIn case of GICv2, Non-secure interrupts while in S-EL1 were signalled as IRQs, and in case of GICv3, FIQs. h](jd)}(hhh]h2}(hhh!jI hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1jch!jE hhhANhCNubj )}(hjIn case of GICv2, Non-secure interrupts while in S-EL1 were signalled as IRQs, and in case of GICv3, FIQs.h]hjIn case of GICv2, Non-secure interrupts while in S-EL1 were signalled as IRQs, and in case of GICv3, FIQs.}(hjX h!jV ubah"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jE ubeh"}(h$]jah&]h+]irqah-]h/]jajKjh9uh1j]hAj hCMh!jhhubeh"}(h$](j4id9eh&]h+]effect on smc callsah-]effect on smc callsah/]uh1j h!j hhhAj hCMjKjK}jp jsjM}j4jsubj )}(hhh](j )}(hBuild-time flowh]hBuild-time flow}(hj{ h!jy hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!jv hhhAj hCMubj )}(h%Please refer to the `figure`__ above.h](hPlease refer to the }(hPlease refer to the h!j hhhANhCNubj )}(h `figure`__h]hfigure}(hfigureh!j ubah"}(h$]h&]h+]h-]h/]namej jKj juh1j h!j j Kubh above.}(h above.h!j hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jv hhubj)}(h.. __: `ehf-figure`_h]h"}(h$]id12ah&]h+]h-]h/]jKj juh1jj ehf-figurehCMAh!jv hhhAj jKj Kubj )}(h1The build-time flow involves the following steps:h]h1The build-time flow involves the following steps:}(hj h!j hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jv hhubj)}(hhh](j )}(hPlatform assigns priorities by installing priority level descriptors for individual dispatchers, as described in `Partitioning priority levels`_. h]j )}(hPlatform assigns priorities by installing priority level descriptors for individual dispatchers, as described in `Partitioning priority levels`_.h](hqPlatform assigns priorities by installing priority level descriptors for individual dispatchers, as described in }(hqPlatform assigns priorities by installing priority level descriptors for individual dispatchers, as described in h!j ubj )}(h`Partitioning priority levels`_h]hPartitioning priority levels}(hPartitioning priority levelsh!j ubah"}(h$]h&]h+]h-]h/]namePartitioning priority levelsj juh1j h!j j Kubh.}(hj1h!j ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j ubah"}(h$]h&]h+]h-]h/]uh1j h!j hhhAj hCNubj )}(h_Platform provides interrupt properties to GIC driver, as described in `Programming priority`_. h]j )}(h^Platform provides interrupt properties to GIC driver, as described in `Programming priority`_.h](hFPlatform provides interrupt properties to GIC driver, as described in }(hFPlatform provides interrupt properties to GIC driver, as described in h!j ubj )}(h`Programming priority`_h]hProgramming priority}(hProgramming priorityh!j!ubah"}(h$]h&]h+]h-]h/]nameProgramming priorityj juh1j h!j j Kubh.}(hj1h!j ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j ubah"}(h$]h&]h+]h-]h/]uh1j h!j hhhAj hCNubj )}(hYDispatcher calling ``ehf_register_priority_handler()`` to register an interrupt handler. h]j )}(hXDispatcher calling ``ehf_register_priority_handler()`` to register an interrupt handler.h](hDispatcher calling }(hDispatcher calling h!j(!ubjO )}(h#``ehf_register_priority_handler()``h]hehf_register_priority_handler()}(hhh!j1!ubah"}(h$]h&]h+]h-]h/]uh1jN h!j(!ubh" to register an interrupt handler.}(h" to register an interrupt handler.h!j(!ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j$!ubah"}(h$]h&]h+]h-]h/]uh1j h!j hhhAj hCNubeh"}(h$]h&]h+]h-]h/]jjjhjj1uh1jh!jv hhhAj hCMubj )}(h0Also refer to the `Interrupt handling example`_.h](hAlso refer to the }(hAlso refer to the h!jV!hhhANhCNubj )}(h`Interrupt handling example`_h]hInterrupt handling example}(hInterrupt handling exampleh!j_!ubah"}(h$]h&]h+]h-]h/]nameInterrupt handling examplej juh1j h!jV!j Kubh.}(hj1h!jV!hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCM h!jv hhubeh"}(h$]j'ah&]h+]build-time flowah-]h/]uh1j h!j hhhAj hCMjKubj )}(hhh](j )}(h Run-time flowh]h Run-time flow}(hj!h!j!hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!j!hhhAj hCM ubj)}(h.. _interrupt-flow:h]h"}(h$]h&]h+]h-]h/]j interrupt-flowuh1jhCMSh!j!hhhAj ubj )}(h0The following is an example flow for interrupts:h]h0The following is an example flow for interrupts:}(hj!h!j!hhhANhCNubah"}(h$]j!ah&]h+]interrupt-flowah-]h/]uh1j hAj hCMh!j!hhjK}j!j!sjM}j!j!subj)}(hhh](j )}(hXThe GIC driver, during initialization, iterates through the platform-supplied interrupt properties (see `Programming priority`_), and configures the interrupts. This programs the appropriate priority and group (Group 0) on interrupts belonging to different dispatchers. h]j )}(hX The GIC driver, during initialization, iterates through the platform-supplied interrupt properties (see `Programming priority`_), and configures the interrupts. This programs the appropriate priority and group (Group 0) on interrupts belonging to different dispatchers.h](hhThe GIC driver, during initialization, iterates through the platform-supplied interrupt properties (see }(hhThe GIC driver, during initialization, iterates through the platform-supplied interrupt properties (see h!j!ubj )}(h`Programming priority`_h]hProgramming priority}(hProgramming priorityh!j!ubah"}(h$]h&]h+]h-]h/]nameProgramming priorityj juh1j h!j!j Kubh), and configures the interrupts. This programs the appropriate priority and group (Group 0) on interrupts belonging to different dispatchers.}(h), and configures the interrupts. This programs the appropriate priority and group (Group 0) on interrupts belonging to different dispatchers.h!j!ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j!ubah"}(h$]h&]h+]h-]h/]uh1j h!j!hhhAj hCNubj )}(hThe |EHF|, during its initialisation, registers a top-level interrupt handler with the :ref:`Interrupt Management Framework` for EL3 interrupts. This also results in setting the routing bits in ``SCR_EL3``. h]j )}(hThe |EHF|, during its initialisation, registers a top-level interrupt handler with the :ref:`Interrupt Management Framework` for EL3 interrupts. This also results in setting the routing bits in ``SCR_EL3``.h](hThe }(hThe h!j!ubh)}(hjh]h)}(hjh]hEHF}(hhh!j!ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j!ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j!ubhN, during its initialisation, registers a top-level interrupt handler with the }(hN, during its initialisation, registers a top-level interrupt handler with the h!j!ubh)}(h;:ref:`Interrupt Management Framework`h]h)}(hj"h]hInterrupt Management Framework}(hhh!j"ubah"}(h$]h&](h(stdstd-refeh+]h-]h/]uh1hh!j"ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainj"reftyperef refexplicitrefwarnh?el3-runtime-firmwareuh1hhAj hCMh!j!ubhF for EL3 interrupts. This also results in setting the routing bits in }(hF for EL3 interrupts. This also results in setting the routing bits in h!j!ubjO )}(h ``SCR_EL3``h]hSCR_EL3}(hhh!j3"ubah"}(h$]h&]h+]h-]h/]uh1jN h!j!ubh.}(hj1h!j!ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!j!ubah"}(h$]h&]h+]h-]h/]uh1j h!j!hhhAj hCNubj )}(hmWhen an interrupt belonging to a dispatcher fires, GIC raises an EL3/Group 0 interrupt, and is taken to EL3. h]j )}(hlWhen an interrupt belonging to a dispatcher fires, GIC raises an EL3/Group 0 interrupt, and is taken to EL3.h]hlWhen an interrupt belonging to a dispatcher fires, GIC raises an EL3/Group 0 interrupt, and is taken to EL3.}(hjW"h!jU"ubah"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!jQ"ubah"}(h$]h&]h+]h-]h/]uh1j h!j!hhhAj hCNubj )}(hThe top-level EL3 interrupt handler executes. The handler acknowledges the interrupt, reads its *Running Priority*, and from that, determines the dispatcher handler. h]j )}(hThe top-level EL3 interrupt handler executes. The handler acknowledges the interrupt, reads its *Running Priority*, and from that, determines the dispatcher handler.h](h`The top-level EL3 interrupt handler executes. The handler acknowledges the interrupt, reads its }(h`The top-level EL3 interrupt handler executes. The handler acknowledges the interrupt, reads its h!jm"ubj )}(h*Running Priority*h]hRunning Priority}(hhh!jv"ubah"}(h$]h&]h+]h-]h/]uh1j h!jm"ubh3, and from that, determines the dispatcher handler.}(h3, and from that, determines the dispatcher handler.h!jm"ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMh!ji"ubah"}(h$]h&]h+]h-]h/]uh1j h!j!hhhAj hCNubj )}(heThe |EHF| programs the *Priority Mask Register* of the PE to the priority of the interrupt received. h]j )}(hdThe |EHF| programs the *Priority Mask Register* of the PE to the priority of the interrupt received.h](hThe }(hThe h!j"ubh)}(hjh]h)}(hjh]hEHF}(hhh!j"ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j"ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j"ubh programs the }(h programs the h!j"ubj )}(h*Priority Mask Register*h]hPriority Mask Register}(hhh!j"ubah"}(h$]h&]h+]h-]h/]uh1j h!j"ubh5 of the PE to the priority of the interrupt received.}(h5 of the PE to the priority of the interrupt received.h!j"ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCM"h!j"ubah"}(h$]h&]h+]h-]h/]uh1j h!j!hhhAj hCNubj )}(hSThe |EHF| marks that priority level *active*, and jumps to the dispatcher handler. h]j )}(hRThe |EHF| marks that priority level *active*, and jumps to the dispatcher handler.h](hThe }(hThe h!j"ubh)}(hjh]h)}(hjh]hEHF}(hhh!j"ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j"ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j"ubh marks that priority level }(h marks that priority level h!j"ubj )}(h*active*h]hactive}(hhh!j#ubah"}(h$]h&]h+]h-]h/]uh1j h!j"ubh&, and jumps to the dispatcher handler.}(h&, and jumps to the dispatcher handler.h!j"ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCM%h!j"ubah"}(h$]h&]h+]h-]h/]uh1j h!j!hhhAj hCNubj )}(hOnce the dispatcher handler finishes its job, it has to immediately *deactivate* the priority level before returning to the |EHF|. See `deactivation workflows`_. h]j )}(hOnce the dispatcher handler finishes its job, it has to immediately *deactivate* the priority level before returning to the |EHF|. See `deactivation workflows`_.h](hDOnce the dispatcher handler finishes its job, it has to immediately }(hDOnce the dispatcher handler finishes its job, it has to immediately h!j3#ubj )}(h *deactivate*h]h deactivate}(hhh!j<#ubah"}(h$]h&]h+]h-]h/]uh1j h!j3#ubh, the priority level before returning to the }(h, the priority level before returning to the h!j3#ubh)}(hjh]h)}(hjh]hEHF}(hhh!jR#ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jO#ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j3#ubh. See }(h. See h!j3#ubj )}(h`deactivation workflows`_h]hdeactivation workflows}(hdeactivation workflowsh!jp#ubah"}(h$]h&]h+]h-]h/]namedeactivation workflowsj j7uh1j h!j3#j Kubh.}(hj1h!j3#ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCM(h!j/#ubah"}(h$]h&]h+]h-]h/]uh1j h!j!hhhAj hCNubeh"}(h$]h&]h+]h-]h/]jjjhjj1uh1jh!j!hhhAj hCMubj)}(h.. _non-interrupt-flow:h]h"}(h$]h&]h+]h-]h/]j non-interrupt-flowuh1jhCMqh!j!hhhAj ubj )}(hVThe following is an example flow for exceptions that targets EL3 other than interrupt:h]hVThe following is an example flow for exceptions that targets EL3 other than interrupt:}(hj#h!j#hhhANhCNubah"}(h$]j#ah&]h+]non-interrupt-flowah-]h/]uh1j hAj hCM.h!j!hhjK}j#j#sjM}j#j#subj)}(hhh](j )}(hCThe platform provides handlers for the specific kind of exception. h]j )}(hBThe platform provides handlers for the specific kind of exception.h]hBThe platform provides handlers for the specific kind of exception.}(hj#h!j#ubah"}(h$]h&]h+]h-]h/]uh1j hAj hCM1h!j#ubah"}(h$]h&]h+]h-]h/]uh1j h!j#hhhAj hCNubj )}(hBThe exception arrives, and the corresponding handler is executed. h]j )}(hAThe exception arrives, and the corresponding handler is executed.h]hAThe exception arrives, and the corresponding handler is executed.}(hj#h!j#ubah"}(h$]h&]h+]h-]h/]uh1j hAj hCM3h!j#ubah"}(h$]h&]h+]h-]h/]uh1j h!j#hhhAj hCNubj )}(hX.The handler calls ``ehf_activate_priority()`` to activate the required priority level. This also has the effect of raising GIC priority mask, thus preventing interrupts of lower priority from preempting the handling. The handler may choose to do the handling entirely in EL3 or delegate to a lower EL. h]j )}(hX-The handler calls ``ehf_activate_priority()`` to activate the required priority level. This also has the effect of raising GIC priority mask, thus preventing interrupts of lower priority from preempting the handling. The handler may choose to do the handling entirely in EL3 or delegate to a lower EL.h](hThe handler calls }(hThe handler calls h!j#ubjO )}(h``ehf_activate_priority()``h]hehf_activate_priority()}(hhh!j#ubah"}(h$]h&]h+]h-]h/]uh1jN h!j#ubhX to activate the required priority level. This also has the effect of raising GIC priority mask, thus preventing interrupts of lower priority from preempting the handling. The handler may choose to do the handling entirely in EL3 or delegate to a lower EL.}(hX to activate the required priority level. This also has the effect of raising GIC priority mask, thus preventing interrupts of lower priority from preempting the handling. The handler may choose to do the handling entirely in EL3 or delegate to a lower EL.h!j#ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCM5h!j#ubah"}(h$]h&]h+]h-]h/]uh1j h!j#hhhAj hCNubj )}(hOnce exception handling concludes, the handler calls ``ehf_deactivate_priority()`` to deactivate the priority level activated earlier. This also has the effect of lowering GIC priority mask to what it was before. h]j )}(hOnce exception handling concludes, the handler calls ``ehf_deactivate_priority()`` to deactivate the priority level activated earlier. This also has the effect of lowering GIC priority mask to what it was before.h](h5Once exception handling concludes, the handler calls }(h5Once exception handling concludes, the handler calls h!j$ubjO )}(h``ehf_deactivate_priority()``h]hehf_deactivate_priority()}(hhh!j$ubah"}(h$]h&]h+]h-]h/]uh1jN h!j$ubh to deactivate the priority level activated earlier. This also has the effect of lowering GIC priority mask to what it was before.}(h to deactivate the priority level activated earlier. This also has the effect of lowering GIC priority mask to what it was before.h!j$ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCM;h!j$ubah"}(h$]h&]h+]h-]h/]uh1j h!j#hhhAj hCNubeh"}(h$]h&]h+]h-]h/]jjjhjj1uh1jh!j!hhhAj hCM1ubeh"}(h$]j>ah&]h+] run-time flowah-]h/]uh1j h!j hhhAj hCM jKubj )}(hhh](j )}(h'Interrupt Prioritisation Considerationsh]h'Interrupt Prioritisation Considerations}(hjP$h!jN$hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!jK$hhhAj hCMAubj )}(hThe GIC priority scheme, by design, prioritises Secure interrupts over Normal world ones. The platform further assigns relative priorities amongst Secure dispatchers through |EHF|.h](hThe GIC priority scheme, by design, prioritises Secure interrupts over Normal world ones. The platform further assigns relative priorities amongst Secure dispatchers through }(hThe GIC priority scheme, by design, prioritises Secure interrupts over Normal world ones. The platform further assigns relative priorities amongst Secure dispatchers through h!j\$hhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jh$ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!je$ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j\$hhubh.}(hj1h!j\$hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMCh!jK$hhubj )}(hXUAs mentioned in `Partitioning priority levels`_, interrupts targeting distinct dispatchers fall in distinct priority levels. Because they're routed via the GIC, interrupt delivery to the PE is subject to GIC prioritisation rules. In particular, when an interrupt is being handled by the PE (i.e., the interrupt is in *Active* state), only interrupts of higher priority are signalled to the PE, even if interrupts of same or lower priority are pending. This has the side effect of one dispatcher being starved of interrupts by virtue of another dispatcher handling its (higher priority) interrupts.h](hAs mentioned in }(hAs mentioned in h!j$hhhANhCNubj )}(h`Partitioning priority levels`_h]hPartitioning priority levels}(hPartitioning priority levelsh!j$ubah"}(h$]h&]h+]h-]h/]namePartitioning priority levelsj juh1j h!j$j KubhX, interrupts targeting distinct dispatchers fall in distinct priority levels. Because they’re routed via the GIC, interrupt delivery to the PE is subject to GIC prioritisation rules. In particular, when an interrupt is being handled by the PE (i.e., the interrupt is in }(hX, interrupts targeting distinct dispatchers fall in distinct priority levels. Because they're routed via the GIC, interrupt delivery to the PE is subject to GIC prioritisation rules. In particular, when an interrupt is being handled by the PE (i.e., the interrupt is in h!j$hhhANhCNubj )}(h*Active*h]hActive}(hhh!j$ubah"}(h$]h&]h+]h-]h/]uh1j h!j$ubhX state), only interrupts of higher priority are signalled to the PE, even if interrupts of same or lower priority are pending. This has the side effect of one dispatcher being starved of interrupts by virtue of another dispatcher handling its (higher priority) interrupts.}(hX state), only interrupts of higher priority are signalled to the PE, even if interrupts of same or lower priority are pending. This has the side effect of one dispatcher being starved of interrupts by virtue of another dispatcher handling its (higher priority) interrupts.h!j$hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMGh!jK$hhubj )}(hXThe |EHF| doesn't enforce a particular prioritisation policy, but the platform should carefully consider the assignment of priorities to dispatchers integrated into runtime firmware. The platform should sensibly delineate priority to various dispatchers according to their nature. In particular, dispatchers of critical nature (RAS, for example) should be assigned higher priority than others (|SDEI|, for example); and within |SDEI|, Critical priority |SDEI| should be assigned higher priority than Normal ones.h](hThe }(hThe h!j$hhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!j$ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j$ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j$hhubhX doesn’t enforce a particular prioritisation policy, but the platform should carefully consider the assignment of priorities to dispatchers integrated into runtime firmware. The platform should sensibly delineate priority to various dispatchers according to their nature. In particular, dispatchers of critical nature (RAS, for example) should be assigned higher priority than others (}(hX doesn't enforce a particular prioritisation policy, but the platform should carefully consider the assignment of priorities to dispatchers integrated into runtime firmware. The platform should sensibly delineate priority to various dispatchers according to their nature. In particular, dispatchers of critical nature (RAS, for example) should be assigned higher priority than others (h!j$hhhANhCNubh)}(hj h]h)}(hj h]hSDEI}(hhh!j$ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j$ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej# refexplicitrefwarn reftargetj&uh1hhAhBhCK*h!j$hhubh, for example); and within }(h, for example); and within h!j$hhhANhCNubh)}(hj h]h)}(hj h]hSDEI}(hhh!j%ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j%ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej# refexplicitrefwarn reftargetj&uh1hhAhBhCK*h!j$hhubh, Critical priority }(h, Critical priority h!j$hhhANhCNubh)}(hj h]h)}(hj h]hSDEI}(hhh!j2%ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j/%ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej# refexplicitrefwarn reftargetj&uh1hhAhBhCK*h!j$hhubh5 should be assigned higher priority than Normal ones.}(h5 should be assigned higher priority than Normal ones.h!j$hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMPh!jK$hhubeh"}(h$]jah&]h+]'interrupt prioritisation considerationsah-]h/]uh1j h!j hhhAj hCMAjKubj )}(hhh](j )}(h Limitationsh]h Limitations}(hjb%h!j`%hhhANhCNubah"}(h$]h&]h+]h-]h/]uh1j h!j]%hhhAj hCMYubj )}(h(The |EHF| has the following limitations:h](hThe }(hThe h!jn%hhhANhCNubh)}(hjh]h)}(hjh]hEHF}(hhh!jz%ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!jw%ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!jn%hhubh has the following limitations:}(h has the following limitations:h!jn%hhhANhCNubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCM[h!j]%hhubj )}(hhh](j )}(hX*Although there could be up to 128 Secure dispatchers supported by the GIC priority scheme, the size of descriptor array exposed with ``EHF_REGISTER_PRIORITIES()`` macro is currently limited to 32. This serves most expected use cases. This may be expanded in the future, should use cases demand so. h]j )}(hX)Although there could be up to 128 Secure dispatchers supported by the GIC priority scheme, the size of descriptor array exposed with ``EHF_REGISTER_PRIORITIES()`` macro is currently limited to 32. This serves most expected use cases. This may be expanded in the future, should use cases demand so.h](hAlthough there could be up to 128 Secure dispatchers supported by the GIC priority scheme, the size of descriptor array exposed with }(hAlthough there could be up to 128 Secure dispatchers supported by the GIC priority scheme, the size of descriptor array exposed with h!j%ubjO )}(h``EHF_REGISTER_PRIORITIES()``h]hEHF_REGISTER_PRIORITIES()}(hhh!j%ubah"}(h$]h&]h+]h-]h/]uh1jN h!j%ubh macro is currently limited to 32. This serves most expected use cases. This may be expanded in the future, should use cases demand so.}(h macro is currently limited to 32. This serves most expected use cases. This may be expanded in the future, should use cases demand so.h!j%ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCM]h!j%ubah"}(h$]h&]h+]h-]h/]uh1j h!j%hhhAj hCNubj )}(hThe platform must ensure that the priority assigned to the dispatcher in the exception descriptor and the programmed priority of interrupts handled by the dispatcher match. The |EHF| cannot verify that this has been followed. h]j )}(hThe platform must ensure that the priority assigned to the dispatcher in the exception descriptor and the programmed priority of interrupts handled by the dispatcher match. The |EHF| cannot verify that this has been followed.h](hThe platform must ensure that the priority assigned to the dispatcher in the exception descriptor and the programmed priority of interrupts handled by the dispatcher match. The }(hThe platform must ensure that the priority assigned to the dispatcher in the exception descriptor and the programmed priority of interrupts handled by the dispatcher match. The h!j%ubh)}(hjh]h)}(hjh]hEHF}(hhh!j%ubah"}(h$]h&](h(jjeh+]h-]h/]uh1hhANhCNh!j%ubah"}(h$]h&]h+]h-]h/]refdoch9 refdomainjreftypej refexplicitrefwarn reftargetjuh1hhAhBhCKh!j%ubh+ cannot verify that this has been followed.}(h+ cannot verify that this has been followed.h!j%ubeh"}(h$]h&]h+]h-]h/]uh1j hAj hCMch!j%ubah"}(h$]h&]h+]h-]h/]uh1j h!j%hhhAj hCNubeh"}(h$]h&]h+]h-]h/]j' j( uh1j hAj hCM]h!j]%hhubh transition)}(h--------------h]h"}(h$]h&]h+]h-]h/]uh1j &hAj hCMgh!j]%hhubj )}(hM*Copyright (c) 2018-2020, Arm Limited and Contributors. All rights reserved.*h]j )}(hj&h]hKCopyright (c) 2018-2020, Arm Limited and Contributors. All rights reserved.}(hhh!j&ubah"}(h$]h&]h+]h-]h/]uh1j h!j&ubah"}(h$]h&]h+]h-]h/]uh1j hAj hCMih!j]%hhubj)}(h.. _SDEI specification: http://infocenter.arm.com/help/topic/com.arm.doc.den0054a/ARM_DEN0054A_Software_Delegated_Exception_Interface.pdfh]h"}(h$]sdei-specificationah&]h+]sdei specificationah-]h/]j3j4uh1jhCMh!j]%hhhAj jKubeh"}(h$]jah&]h+] limitationsah-]h/]uh1j h!j hhhAj hCMYjKubeh"}(h$]exception-handling-frameworkah&]h+]exception handling frameworkah-]h/]uh1j h!hhhhAj hCKubeh"}(h$]h&]h+]h-]h/]sourcej uh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(j N generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjn&error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcej _destinationN _config_files]pep_referencesN pep_base_url https://www.python.org/dev/peps/pep_file_url_templatepep-%04drfc_referencesN rfc_base_urlhttps://tools.ietf.org/html/ tab_widthKtrim_footnote_reference_spacefile_insertion_enabled raw_enabledKsyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xformembed_stylesheetcloak_email_addressesenvNubreporterNindirect_targets](jj)j!jj esubstitution_defs}(hHh hshKhhvhhhhjhjJj"jujMjjxjjjjj!jjLj$jwjOjjzjjjjj#jjNj&jyjQjj|jjjjj%jjPj(j{jSjj~jjjjj'jjRj*j}jUjjjjjjj)jjTj,jjWjjjjjjj+jjVj.jjYjjjjjjj-jjXj0jj[jjjjj jj/ j jZ j2 j j] j j j j j j j1 j j\ j4 j j_ j j j j j j j3 j j^ j6 j ja usubstitution_names}(aarch32hHaarch64hsamuhamushɌapihbtijcotjucssjcvejdtbjds-5j!dsujLdtjweljehfjfconfjfdtj#ff-ajNfipjyfvpjfwujgicjisaj%linarojPmmuj{mpamjmpmmjmpidrjmtej'oenjRop-teej}otejpddjpauthjpmfj)pscijTrasjrotjscmijscpjsdeij+sdsjVseajsipjsmcjsmcccj-socjXspjspdjspmjssbsj svej/ tbbjZ tbbrj teej tf-aj tf-mj tlbj1 tlkj\ trngj tspj tzcj ubsanj uefij3 wdogj^ xlatj urefnames}(interrupt handling](j jesdei specification]j"aspd]jatransition of priority levels]jfaeffect on smc calls]j#ainterrupt handling example](jjjj_!e'interrupt prioritisation considerations]j apartitioning priority levels](jNjj j$e limitations]jabuild-time flow]ja run-time flow](j-jjeirq]japrogramming priority](j!j!edeactivation workflows]jp#aurefids}(j](jj!jej](jj j ej]jaj](jjjqejS]jIaj7]j-aj](jj)j ej4]jaj!]j!aj#]j#aj]jqaj/]j aj']jaj]jaj ]j ajw](jjej]jaj]jaunameids}(jH&jE&jjjHjjjjjjjjjjj j.jjjjjjXjjjSjj7jjjjwjp j4jh jj~!j'jH$j>j!j!j#j#jZ%jj@&jj9&j6&u nametypes}(jH&NjNjHjjNjjjNj.jNjNjXNjjjjNjp jh j~!NjH$Nj!j#jZ%Nj@&Nj9&uh$}(jE&j jjE jjjjjj_jjjjjjjjj jjjj+jj/j)jj4jj"jjjSj[jj[j'j!j7j8jjjjjwjj4jjm jjjjjjjE j'jv j j j>j!j!j!j#j#jjK$jj]%j6&j0&u footnote_refs}(j&]jaj']jau citation_refs} autofootnotes](j_jE eautofootnote_refs](jjesymbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}j|&K sRparse_messages](h system_message)}(hhh]j )}(h?Duplicate implicit target name: "partitioning priority levels".h]hCDuplicate implicit target name: “partitioning priority levels”.}(hhh!jB'ubah"}(h$]h&]h+]h-]h/]uh1j h!j?'ubah"}(h$]h&]h+]h-]h/]j+alevelKtypeINFOsourcej lineKuh1j='h!jhhhAj hCKubj>')}(hhh]j )}(hIDuplicate implicit target name: "activating and deactivating priorities".h]hMDuplicate implicit target name: “activating and deactivating priorities”.}(hhh!j^'ubah"}(h$]h&]h+]h-]h/]uh1j h!j['ubah"}(h$]h&]h+]h-]h/]jalevelKtypejX'sourcej lineMluh1j='h!j[hhhAj hCMlubj>')}(hhh]j )}(h6Duplicate implicit target name: "effect on smc calls".h]h:Duplicate implicit target name: “effect on smc calls”.}(hhh!jy'ubah"}(h$]h&]h+]h-]h/]uh1j h!jv'ubah"}(h$]h&]h+]h-]h/]jm alevelKtypejX'sourcej lineMuh1j='h!jhhhAj hCMubetransform_messages](j>')}(hhh]j )}(hhh]h8Hyperlink target "interrupt-handling" is not referenced.}(hhh!j'ubah"}(h$]h&]h+]h-]h/]uh1j h!j'ubah"}(h$]h&]h+]h-]h/]levelKtypejX'sourcej lineKuh1j='ubj>')}(hhh]j )}(hhh]hLHyperlink target "activating-and-deactivating-priorities" is not referenced.}(hhh!j'ubah"}(h$]h&]h+]h-]h/]uh1j h!j'ubah"}(h$]h&]h+]h-]h/]levelKtypejX'sourcej lineMuh1j='ubj>')}(hhh]j )}(hhh]h4Hyperlink target "interrupt-flow" is not referenced.}(hhh!j'ubah"}(h$]h&]h+]h-]h/]uh1j h!j'ubah"}(h$]h&]h+]h-]h/]levelKtypejX'sourcej lineMSuh1j='ubj>')}(hhh]j )}(hhh]h8Hyperlink target "non-interrupt-flow" is not referenced.}(hhh!j'ubah"}(h$]h&]h+]h-]h/]uh1j h!j'ubah"}(h$]h&]h+]h-]h/]levelKtypejX'sourcej lineMquh1j='ube transformerN decorationNhhub.