Apparatuses, methods, and systems for instructions to allow trusted execution environments to react to asynchronous exits
Abstract
Systems, methods, and apparatuses relating to an instruction that allows a trusted execution environment to react to an asynchronous exit are described. In one embodiment, a hardware processor includes a register comprising a field, that when set, is to enable an architecturally protected execution environment for code in an architecturally protected enclave in memory, a decoder circuit to decode a single instruction comprising an opcode into a decoded instruction, the opcode to indicate an execution circuit is to invoke a handler to handle an asynchronous exit from execution of the code in the architecturally protected enclave and then resume execution of the code in the architecturally protected enclave from where the asynchronous exit occurred, and the execution circuit to respond to the decoded instruction as specified by the opcode.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 13 · Forward citations: 0.
Claims (24 — 3 Independent, 21 Dependent)
- Claim 1Independent Claim
A hardware processor comprising: a register comprising a field, that when set, is to enable an architecturally protected execution environment for code in an architecturally protected enclave in memory; a decoder circuit to decode a single instruction comprising an opcode into a decoded instruction, the opcode to indicate an execution circuit is to invoke a handler to handle an asynchronous exit from execution of the code in the architecturally protected enclave and then resume execution of the code in the architecturally protected enclave from where the asynchronous exit occurred; and the execution circuit to respond to the decoded instruction as specified by the opcode.
- Claim 2Depends on #1
The hardware processor of claim 1, where the single instruction is a user mode instruction.
- Claim 3Depends on #1
The hardware processor of claim 1, wherein the asynchronous exit is caused by an interrupt.
- Claim 4Depends on #1
The hardware processor of claim 1, wherein the asynchronous exit is caused by a hardware exception.
- Claim 5Depends on #1
The hardware processor of claim 1, wherein the opcode of the single instruction further indicates the execution circuit is to cause the architecturally protected enclave to be notified that the asynchronous exit occurred.
- Claim 6Depends on #1
The hardware processor of claim 1, wherein the architecturally protected enclave comprises a thread control structure having a field that, when set to a first value, causes the execution circuit to execute the single decoded instruction to invoke the handler to handle the asynchronous exit from execution of the code in the architecturally protected enclave and then resume execution of the code in the architecturally protected enclave from where the asynchronous exit occurred, and when set to a second value, causes the execution circuit to execute the single decoded instruction to resume execution of the code in the architecturally protected enclave from where the asynchronous exit occurred without invoking the handler to handle the asynchronous exit from execution of the code in the architecturally protected enclave.
- Claim 7Depends on #1
The hardware processor of claim 1, wherein the architecturally protected enclave comprises a thread control structure having a field that identifies an address of the handler.
- Claim 8Depends on #1
The hardware processor of claim 1, wherein the architecturally protected enclave comprises a field to indicate a set of one or more exceptions to suppress, and when execution of the code in the architecturally protected enclave encounters an exception from the set, the execution circuit causes the handler to be invoked without delivering the exception to an operating system executing on the hardware processor.
- Claim 9Independent Claim
A method comprising: enabling an architecturally protected execution environment for code in an architecturally protected enclave in memory in response to a field of a register of a hardware processor being set; decoding a single instruction comprising an opcode into a decoded instruction with a decoder circuit of the hardware processor, the opcode indicating an execution circuit is to invoke a handler to handle an asynchronous exit from execution of the code in the architecturally protected enclave and then resume execution of the code in the architecturally protected enclave from where the asynchronous exit occurred; and executing the decoded instruction according to the opcode by the execution circuit of the hardware processor.
- Claim 10Depends on #9
The method of claim 9, where the single instruction is a user mode instruction.
- Claim 11Depends on #9
The method of claim 9, wherein the asynchronous exit is caused by an interrupt.
- Claim 12Depends on #9
The method of claim 9, wherein the asynchronous exit is caused by a hardware exception.
- Claim 13Depends on #9
The method of claim 9, wherein the opcode of the single instruction further indicates the execution circuit is to cause the architecturally protected enclave to be notified that the asynchronous exit occurred.
- Claim 14Depends on #9
The method of claim 9, wherein the architecturally protected enclave comprises a thread control structure having a field that, when set to a first value, causes the execution circuit to execute the single decoded instruction to invoke the handler to handle the asynchronous exit from execution of the code in the architecturally protected enclave and then resume execution of the code in the architecturally protected enclave from where the asynchronous exit occurred, and when set to a second value, causes the execution circuit to execute the single decoded instruction to resume execution of the code in the architecturally protected enclave from where the asynchronous exit occurred without invoking the handler to handle the asynchronous exit from execution of the code in the architecturally protected enclave.
- Claim 15Depends on #9
The method of claim 9, wherein the architecturally protected enclave comprises a thread control structure having a field that identifies an address of the handler.
- Claim 16Depends on #9
The method of claim 9, wherein the architecturally protected enclave comprises a field to indicate a set of one or more exceptions to suppress, and when execution of the code in the architecturally protected enclave encounters an exception from the set, the execution circuit causes the handler to be invoked without delivering the exception to an operating system executing on the hardware processor.
- Claim 17Independent Claim
A non-transitory machine readable medium that stores code that when executed by a machine causes the machine to perform a method comprising: enabling an architecturally protected execution environment for code in an architecturally protected enclave in memory in response to a field of a register of a hardware processor being set; decoding a single instruction comprising an opcode into a decoded instruction with a decoder circuit of the hardware processor, the opcode indicating an execution circuit is to invoke a handler to handle an asynchronous exit from execution of the code in the architecturally protected enclave and then resume execution of the code in the architecturally protected enclave from where the asynchronous exit occurred; and executing the decoded instruction according to the opcode by the execution circuit of the hardware processor.
- Claim 18Depends on #17
The non-transitory machine readable medium of claim 17, where the single instruction is a user mode instruction.
- Claim 19Depends on #17
The non-transitory machine readable medium of claim 17, wherein the asynchronous exit is caused by an interrupt.
- Claim 20Depends on #17
The non-transitory machine readable medium of claim 17, wherein the asynchronous exit is caused by a hardware exception.
- Claim 21Depends on #17
The non-transitory machine readable medium of claim 17, wherein the opcode of the single instruction further indicates the execution circuit is to cause the architecturally protected enclave to be notified that the asynchronous exit occurred.
- Claim 22Depends on #17
The non-transitory machine readable medium of claim 17, wherein the architecturally protected enclave comprises a thread control structure having a field that, when set to a first value, causes the execution circuit to execute the single decoded instruction to invoke the handler to handle the asynchronous exit from execution of the code in the architecturally protected enclave and then resume execution of the code in the architecturally protected enclave from where the asynchronous exit occurred, and when set to a second value, causes the execution circuit to execute the single decoded instruction to resume execution of the code in the architecturally protected enclave from where the asynchronous exit occurred without invoking the handler to handle the asynchronous exit from execution of the code in the architecturally protected enclave.
- Claim 23Depends on #17
The non-transitory machine readable medium of claim 17, wherein the architecturally protected enclave comprises a thread control structure having a field that identifies an address of the handler.
- Claim 24Depends on #17
The non-transitory machine readable medium of claim 17, wherein the architecturally protected enclave comprises a field to indicate a set of one or more exceptions to suppress, and when execution of the code in the architecturally protected enclave encounters an exception from the set, the execution circuit causes the handler to be invoked without delivering the exception to an operating system executing on the hardware processor.
Technical Overview & Description
TECHNICAL FIELD The disclosure relates generally to electronics, and, more specifically, an embodiment of the disclosure relates to circuitry to implement an instruction that allows a trusted execution environment to react to an asynchronous exit. BACKGROUND A processor, or set of processors, executes instructions from an instruction set, e.g., the instruction set architecture (ISA). The instruction set is the part of the computer architecture related to programming, and generally includes the native data types, instructions, register architecture, addressing modes, memory architecture, interrupt and exception handling, and external input and output (I/O). It should be noted that the term instruction herein may refer to a macro-instruction, e.g., an instruction that is provided to the processor for execution, or to a micro-instruction, e.g., an instruction that results from a processor's decoder decoding macro-instructions. BRIEF DESCRIPTION OF THE DRAWINGS The present disclosure is illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements and in which: FIG. 1 illustrates a hardware processor coupled to a memory having an enclave according to embodiments of the disclosure. FIG. 2 illustrates example fields of a thread control structure of an enclave according to embodiments of the disclosure. FIG. 3 illustrates a thread control structure and SSA stack according to embodiments of the disclosure. FIG. 4 illustrates a method of handling an asynchronous exit of the execution of code from an enclave that utilizes an enclave enter instruction, an enclave exit instruction, and an enclave resume instruction according to embodiments of the disclosure. FIG. 5 illustrates a method of handling an exception from the execution of code from an enclave that utilizes an enclave exit instruction, a system call instruction, and an enclave enter instruction according to embodiments of the disclosure.
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (13)
| Patent | Title | Year | Citations |
|---|
Non-Patent Literature (10)
- Costan et al.,
- “
- Intel SGX Explained
- ”
- , IACR, International Association for Cryptologic Research, vol. 20170115:005718, Jan. 15, 2017, pp. 1-118.
- European Search Report and Search Opinion, EP App. No. 21197375.5, Mar. 10, 2022, 10 pages.
- Intel,
- “
- Intel(registered) Software Guard Extensions Programming Reference
- ”