Enclave exit handlers 222 and 232 may also perform actions to determine whether enclave mode handling is to be performed. The determination of whether enclave mode handling is to be performed can be made after the requested TLB entries are invalidated based on the received RAR interrupt or signal. These actions can include determining whether the RLP is running in an enclave mode and whether the TLB entries to be invalidated correspond to enclave pages (i.e., pages within an enclave address range). Determining whether the RLP is running in an enclave mode may be accomplished by evaluating a flag that is set if the RLP is currently running in the enclave mode Determining whether the invalidated TLB entries correspond to enclave pages may be achieved by comparing page addresses specified in a payload of the RAR interrupt or signal to the enclave linear address range. If at least one page address in the payload is within the enclave linear address range and if it is determined that the RLP is running in an enclave mode, then enclave mode handling can be performed.
Enclave mode handling can include determining whether the RLP entered the enclave during the current enclave epoch. This determination can be performed by comparing a current value of a global epoch variable and a current value of an enclave entry epoch variable associated with the RLP. If the values are equivalent, then the RLP entered the enclave during the current enclave epoch.