Abstract
Trusted-execution environments (TEE), like Intel SGX, isolate user-space applications into secure enclaves without trusting the OS. While TEEs reduce the trusted computing base, they often introduce one to two orders of magnitude slowdown. This performance cost stems from a strict memory model, termed the spatial isolation model, where enclaves cannot share memory regions with each other. We present Elasticlave—a new TEE memory model that allows enclaves to selectively and temporarily share memory with other enclaves and the OS. Elasticlave eliminates the need for expensive data copy operations while offering the same level of application-desired security as the spatial model. Prototyped on an RTL-designed cycle-level RISC-V core, Elasticlave demonstrates 1 to 2 orders of magnitude performance improvements over the spatial model with a small hardware area footprint and TCB.
The Problem: Spatial Isolation
Modern TEEs rely on a rigid spatial isolation model where memory is strictly divided into private (accessible only by the enclave) and public (accessible by the OS and other enclaves) regions. While secure, this "all-or-nothing" approach creates significant bottlenecks for standard data processing patterns.
As shown in the figure above, if two enclaves wish to share data—such as in a producer-consumer pipeline—they cannot simply pass a pointer. Instead, the sender must encrypt the data and copy it to public memory. The receiver must then read, decrypt, and copy it into its own private memory. This constant cryptographic and copying overhead results in 10× to 100× performance slowdowns compared to native execution.
The Elasticlave Solution
ELASTICLAVE relaxes spatial isolation by allowing enclaves to securely share memory regions through three primary abstractions:
- Asymmetric Permission Views: Different enclaves can hold different permissions over the same shared memory region (e.g., a producer has read/write access while a consumer is read-only).
- Dynamic Permissions: Enclaves can dynamically downgrade or upgrade their permissions on the fly, up to a static maximum defined by the region's owner.
- Exclusive Locks: A hardware-enforced lock bit allows an enclave to gain temporary, exclusive access to a shared region, preventing race conditions or malicious interference without a trusted third-party coordinator.
By utilizing these "temporal contracts," ELASTICLAVE enables zero-copy sharing. Enclaves make trust decisions based only on their local view of permissions, avoiding the complexity of global permission broadcasts and keeping hardware implementation simple.
Implementation and Evaluation
ELASTICLAVE was prototyped on an open-source RISC-V processor (RocketChip) using the Keystone enclave framework. The system leverages RISC-V's Physical Memory Protection (PMP) registers to enforce dynamic permissions in hardware. Evaluation was conducted using synthetic workloads (producer-consumer, proxy, client-server) and real-world benchmarks including IOZone, SPLASH-2, and Torch.
Key Results
- Performance: ELASTICLAVE achieved 1 to 2 orders of magnitude (10×–100×) speedups over the spatial isolation baseline. For large data transfers (64KB), speedups reached up to 600×.
- Efficiency: Many workloads operated at 90% of native Linux execution speed, effectively bridging the gap between secure and native performance.
- Overhead: Supporting 8 additional shared memory regions increased the total chip area by less than 1%. The software TCB remains minimal at approximately 6,800 lines of code.
Conclusion
ELASTICLAVE demonstrates that the massive performance penalties associated with TEEs are not an inherent cost of security, but rather a byproduct of rigid memory models. By introducing flexible, hardware-enforced sharing, ELASTICLAVE provides a path toward high-performance secure computing for data-intensive applications.
Summary updated