IP Library Granted Patent US 12682126
Granted Patent B2
US 12682126 · App. 17/134,320 · Granted Jul 14, 2026

Apparatuses, methods, and systems for instructions to allow trusted execution environments to react to asynchronous exits

Inventors: Scott Constable (Portland, OR); Mark Shanahan (Raleigh, NC); Mona Vij (Hillsboro, OR); Bin Xing (Hillsboro, OR); Krystof Zmudzinski (Forest Grove, OR)
Assignee: Intel Corporation
G06F21/75
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12682126
App. No.
17/134,320
Granted
Jul 14, 2026
Kind
B2
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.

Claims (33)

1 . 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.

2 . The hardware processor of claim 1 , where the single instruction is a user mode instruction.

3 . The hardware processor of claim 1 , wherein the asynchronous exit is caused by an interrupt.

4 . The hardware processor of claim 1 , wherein the asynchronous exit is caused by a hardware exception.

5 . 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.

6 . 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.

7 . 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.

8 . 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.

9 . 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.

10 . The method of claim 9 , where the single instruction is a user mode instruction.

11 . The method of claim 9 , wherein the asynchronous exit is caused by an interrupt.

12 . The method of claim 9 , wherein the asynchronous exit is caused by a hardware exception.

13 . 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.

14 . 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.

15 . 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.

16 . 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.

17 . 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.

18 . The non-transitory machine readable medium of claim 17 , where the single instruction is a user mode instruction.

19 . The non-transitory machine readable medium of claim 17 , wherein the asynchronous exit is caused by an interrupt.

20 . The non-transitory machine readable medium of claim 17 , wherein the asynchronous exit is caused by a hardware exception.

21 . 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.

22 . 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.

23 . 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.

24 . 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.