IP Library › Granted Patent US 12,572,644
Granted Patent B2
US 12,572,644 · App. 17/711,768 · Granted Mar 10, 2026

Micro-enclaves for instruction-slice-grained contained execution outside supervisory runtime

Inventors: Kshitij Arun Doshi (Tempe, AZ); Francesc Guim Bernat (Barcelona, ES)
Assignee: Intel Corporation
G06F21/53G06F2221/034
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 12,572,644
App. No.
17/711,768
Granted
Mar 10, 2026
Kind
B2
Abstract

The present disclosure describes a micro-enclave (μenclave) framework including μenclave operations, which are library functions that split off from normal code execution. The μenclaves contain a mix of stateful and stateless operations, including such steps as reading or writing various hardware registers or resource counters in operating system, timer setup, deferring preemption events by a small value within a threshold set by the operating system, and the like. The operations in a μenclave, even though performed at a user level privilege, are compiled by a separate compilation sequence and installed unforgeably as static and unforgeable procedure collections that do not yield control to an operating system scheduler.

Claims (91)

1 . An apparatus to provide micro-enclave services, the apparatus comprising:

memory circuitry arranged to isolate a micro-enclave memory space for the micro-enclave services from other memory spaces of the memory circuitry, wherein the memory circuitry is to:

store user level code of an application, and

store sensitive code within a micro-enclave, wherein the sensitive code comprises library functions split off from a privileged runtime that read and write hardware registers and resource counters in operating system, set up timers, defer preemption events, and are compiled separately and installed as static unforgeable procedures that do not yield operating system scheduler control; and

processor circuitry connected to the memory circuitry, wherein the processor circuitry is to:

execute, during execution of the user level code, a first bridge instruction of the micro-enclave indicating entry into the micro-enclave;

execute the sensitive code within the micro-enclave after execution of the first bridge instruction, wherein execution continues on a normal stack of the application;

execute a second bridge instruction of the micro-enclave to exit the micro-enclave; and

resume execution of the user level code after execution of the second bridge instruction.

2 . The apparatus of claim 1 , wherein the first bridge instruction is a bridge instruction in an enter mode, and the processor circuitry is to:

receive a token in a designated register;

translate the token into a length and a decryption key, wherein the length is a number of data units of the sensitive code between the first bridge instruction and the second bridge instruction; and

decode, using the decryption key, instructions of the sensitive code into a scratchpad memory.

3 . The apparatus of claim 2 , wherein the number of data units of the length includes the sensitive code between the first bridge instruction and the second bridge instruction and including a number of data units of the first bridge instruction and the second bridge instruction.

4 . The apparatus of claim 2 , wherein, to execute the sensitive code, the processor circuitry is to:

execute the decoded instructions without retiring the instructions of the sensitive code until the second bridge instruction is reached.

5 . The apparatus of claim 2 , wherein, to execute the sensitive code, the processor circuitry is, when an exception occurs during execution of the sensitive code, to:

set a program counter back to a beginning of the first bridge instruction;

suppress the exception;

deliver a signal frame to the application, wherein the signal frame includes the exception that occurred during execution of the sensitive code; and

terminate execution of the sensitive code when the application does not receive the signal frame.

6 . The apparatus of claim 2 , wherein the processor circuitry is to:

mask one or more interrupts to begin non-preemptive execution of the sensitive code.

7 . The apparatus of claim 1 , wherein the second bridge instruction is a bridge instruction in a leave mode, and the processor circuitry is to:

bulk retire all instructions not already retired after execution of the first bridge instruction.

8 . The apparatus of claim 7 , wherein the processor circuitry is to:

unmask one or more interrupts for pre-emptible execution of the user level code.

9 . The apparatus of claim 7 , wherein the processor circuitry is to:

implement one or more fence instructions.

10 . The apparatus of claim 1 , wherein the micro-enclave is a first micro-enclave, the second bridge instruction is a bridge instruction in a connect mode, and the processor circuitry is to:

continue non-pre-emptible execution of second sensitive code within a second micro-enclave after execution of the second bridge instruction without retiring instructions of the sensitive code of the first micro-enclave; and

bulk retire all instructions not already retired after execution of the first bridge instruction.

11 . The apparatus of claim 1 , wherein the micro-enclave is a first micro-enclave, and the processor circuitry is to:

enqueue a key into a bidirectional buffer shared with a second micro-enclave, wherein the enqueued key points to a memory location storing data intended to be communicated between the first micro-enclave and the second micro-enclave.

12 . The apparatus of claim 1 , wherein the micro-enclave is a first micro-enclave, and the processor circuitry is to:

dequeue a key from a bidirectional buffer shared with a second micro-enclave, wherein the key is placed in the bidirectional buffer by the second micro-enclave;

hash the key to obtain an index referencing a memory location where data for the first micro-enclave is stored; and

access the data stored in the referenced memory location.

13 . The apparatus of claim 2 , wherein, to execute the sensitive code, the processor circuitry is to:

hash a virtual address of at least one instruction of the sensitive code;

identify a decoded version of the at least one instruction in a sensitive instruction cache when the at least one instruction of the sensitive code has previously been decoded and executed; and

decode the instructions of the sensitive code using the decryption key when the decoded version of the at least one instruction is not included in the sensitive instruction cache.

14 . The apparatus of claim 13 , wherein the processor circuitry is to:

provide performance monitoring unit (PMU) with an encryption key, wherein the encryption key is for encrypting PMU events that occur during execution of the sensitive code.

15 . One or more non-transitory computer-readable media (NTCRM) comprising instructions for operating a micro-enclave, wherein execution of the instructions by a compute node is to cause the compute node to:

during execution of user level code of an application, execute a first bridge instruction of the micro-enclave, the first bridge instruction for entry into the micro-enclave, and the micro-enclave includes sensitive code, wherein the sensitive code comprises library functions split off from a privileged runtime that read and write hardware registers and resource counters in operating system, set up timers, defer preemption events, and are compiled separately and installed as static unforgeable procedures that do not yield operating system scheduler control;

hash a virtual address of the sensitive code;

identify, using the hashed virtual address, an already decoded version of the sensitive code in a decoded sensitive instruction cache (DSIC) when an instruction of the sensitive code has previously been decoded and executed;

decode instructions of the sensitive code using a decryption key when no previously decoded version of the sensitive code is in the DSIC;

execute the decoded instructions of the sensitive code within the micro-enclave after execution of the first bridge instruction, wherein execution continues on a normal stack of the application;

execute a second bridge instruction to exit the micro-enclave; and

resume execution of the user level code after execution of the second bridge instruction.

16 . The one or more NTCRM of claim 15 , wherein the first bridge instruction is a bridge instruction in an enter mode, and execution of the instructions is to cause the compute node to decode the instructions of the sensitive code including:

receive a token in a designated register;

translate the token into a length and the decryption key, wherein the length is a number of data units of the sensitive code between the first bridge instruction and the second bridge instruction; and

decode, using the decryption key, the instructions of the sensitive code into a scratchpad memory.

17 . The one or more NTCRM of claim 16 , wherein execution of the instructions is to cause the compute node to:

execute the decoded instructions without retiring the instructions of the sensitive code until the second bridge instruction is reached; and

mask one or more interrupts to begin non-preemptive execution of the sensitive code.

18 . The one or more NTCRM of claim 17 , wherein, when an exception occurs during execution of the sensitive code, execution of the instructions is to cause the compute node to:

set a program counter back to a beginning of the first bridge instruction;

suppress the exception;

deliver a signal frame to the application, wherein the signal frame includes the exception that occurred during execution of the sensitive code; and

terminate execution of the sensitive code when the application does not receive the signal frame.

19 . The one or more NTCRM of claim 15 , wherein the second bridge instruction is a bridge instruction in a leave mode, and execution of the instructions is to cause the compute node to:

bulk retire all instructions not already retired after execution of the first bridge instruction; and

unmask one or more interrupts for pre-emptible execution of the user level code.

20 . The one or more NTCRM of claim 15 , wherein the micro-enclave is a first micro-enclave, the second bridge instruction is a bridge instruction in a connect mode, and execution of the instructions is to cause the compute node to:

continue non-pre-emptible execution of second sensitive code within a second micro-enclave after execution of the second bridge instruction without retiring instructions of the sensitive code of the first micro-enclave; and

bulk retire all instructions not already retired after execution of the first bridge instruction.

21 . A method of sensitive code execution in a micro-enclave, the method comprising:

during execution of user level code of an application, executing a first bridge instruction in an enter mode, and when the first bridge instruction is in the enter mode,

receiving a token in a designated register,

translating the token into a length and a decryption key, wherein the length is a number of data units of the sensitive code between the first bridge instruction and a second bridge instruction,

decoding, using the decryption key, instructions of the sensitive code into a scratchpad memory,

executing the decoded instructions of the sensitive code within the micro-enclave after execution of the first bridge instruction without retiring any of the decoded instructions until the second bridge instruction is reached, wherein execution continues on a normal stack of the application, and wherein the sensitive code comprises library functions split off from a privileged runtime that read and write hardware registers and resource counters in operating system, set up timers, defer preemption events, and are compiled separately and installed as static unforgeable procedures that do not yield operating system scheduler control;

executing the second bridge instruction not in the enter mode to exit the micro-enclave; and

resuming execution of the user level code after execution of the second bridge instruction.

22 . The method of claim 21 , wherein, when an exception occurs during execution of the sensitive code, the method includes:

setting a program counter back to a beginning of the first bridge instruction;

suppressing the exception;

delivering a signal frame to the application including the exception that occurred during the execution of the sensitive code; and

terminating the execution of the sensitive code when the application does not receive the signal frame.

23 . The method of claim 22 , wherein the method includes:

masking one or more interrupts to begin non-preemptive execution of the sensitive code.

24 . The method of claim 21 , wherein the micro-enclave is a first micro-enclave, and the method includes:

enqueuing a key into a bidirectional buffer shared with a second micro-enclave, wherein the enqueued key points to a memory location storing data intended to be communicated between the first micro-enclave and the second micro-enclave.

25 . The method of claim 21 , wherein the micro-enclave is a first micro-enclave, and the method includes:

dequeuing a key from a bidirectional buffer shared with a second micro-enclave, wherein the key is placed in the bidirectional buffer by the second micro-enclave;

hashing the key to obtain an index referencing a memory location where data for the first micro-enclave is stored; and

accessing the data stored in the referenced memory location.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 8, 2022
From: DOSHI, KSHITIJ ARUN; GUIM BERNAT, FRANCESC
To: INTEL CORPORATION
Reel/Frame 059550/0565 →
Continuity (1)
Related Publication 20220222337A1 · Jul 14, 2022
References Cited (23)
US 10691457B1 · Kountanis · 2020 [cited by examiner]
US 20020073316A1 · Collins · 2002 [cited by examiner]
US 20030009620A1 · Solomon · 2003 [cited by examiner]
US 20100138608A1 · Rappoport · 2010 [cited by examiner]
US 20170177457A1 · Swanson · 2017 [cited by examiner]
US 20180113811A1 · Xing · 2018 [cited by examiner]
US 20190102538A1 · Gentili · 2019 [cited by examiner]
US 20190310974A1 · Pishe · 2019 [cited by examiner]
US 20190332427A1 · Tian · 2019 [cited by examiner]
US 20200125742A1 · Kounavis · 2020 [cited by examiner]
US 20200150734A1 · Ma · 2020 [cited by examiner]
US 20210089321A1 · Liu · 2021 [cited by examiner]
US 20210157682A1 · Antonopoulos · 2021 [cited by examiner]
US 20210232676A1 · Gingell · 2021 [cited by examiner]
US 20220229565A1 · Saby · 2022 [cited by examiner]
US 20220269797A1 · Saby · 2022 [cited by examiner]
“Intel® 64 and IA-32 Architectures Software Developer's Manual”, Order No. 325462-076US, Intel Corp., 4830 pages (Dec. 2021). [cited by applicant]
Thomas E. Anderson, “The Case for Application-Specific Operating Systems”, Proceedings of 3rd IEEE Workshop on Workstation Operating Systems, pp. 92-94 (1992), https://homes.cs.washington.edu/˜tom/pubs/app-spec.pdf. [cited by applicant]
Young et al., “The True Cost of Containing: A gVisor Case Study”, 11th USENIX Conference on Hot Topics in Cloud Computing (HotCloud 19), pp. 16-16 (Jul. 8, 2019), https://www.usenix.org/system/files/hotcloud 19-paper-yo… [cited by applicant]
Katz et al., Unforgeable Encryption and Chosen Ciphertext Secure Modes of Operation, In Goos et al. (eds), Fast Software Encryption (FSE 2000), Lecture Notes in Computer Science, vol. 1978, Springer, Berlin, Heidelberg … [cited by applicant]
Porter et al., “Rethinking the Library OS from the Top Down”, Proceedings of the sixteenth Int'l Conference on Architectural Support for Programming Languages and Operating Systems, pp. 291-304 (Mar. 5, 2011), https://w… [cited by applicant]
Tazaki et al., Library Operating System with Mainline Linux Network Stack, Proceedings of netdev 0.1, (Feb. 2015), http://libos-nuse.github.io/files/netdev01-tazaki.pdf. [cited by applicant]
Chia-Che Tsai, “Library OS is the New Container”, https://events19.linuxfoundation.org/wp-content/uploads/2017/12/Library-OS-is-the-New-Container-Why-is-Library-OS-A-Better-Option-for-Compatibility-and-Sandboxing-Chia-C… [cited by applicant]