arXiv:2610.12695cs.CROct 2026

Manuscript Offprint

arXiv:2610.12695

Enabling Extended SGX Enclaves inside Confidential Virtual Machines

Pamenas Kariuki, Dong Yiliang, Quoc Do Le, Christof Fetzer

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

Confidential Virtual Machines (CVMs), such as AMD SEV-SNP, and process enclaves, such as Intel SGX, provide workload protection against cloud threats. However, they strongly differ in TCB, deployment cost and speed, peer workload protection, resource sharing, fine-grained isolation and attestation, and programming capabilities. Nesting process enclaves within CVMs offers an optimal solution and an opportunity to address long-standing SGX limitations: lack of intra-enclave protection, expensive transitions and exception paths, slow enclave cloning, and a restricted programming model that limits Library Operating Systems (LibOS).

This paper introduces TEEVisor, a CVM-resident architecture consisting of a security monitor and a kernel driver that leverages AMD SEV-SNP Virtual Machine Privilege Levels (VMPLs) to build hardware-protected, process-level enclaves inside a guest CVM with two modes: (1) an SGX binary compatibility mode to run unmodified SGX applications; and (2) a novel extended SGX (eSGX) mode optimizing slow execution paths and offering richer enclave programming capabilities. On commercial AMD EPYC hardware, against native CVM execution, TEEVisor incurs under 5% overhead on compute- and memory-bound workloads, around 12% on I/O-heavy applications, and accelerates enclave cloning to a rate of 93 μ\mus/MB of enclave size, demonstrating that eSGX semantics inside a CVM are practical for production use.

1 Introduction

Confidential computing has become a cornerstone primitive for running sensitive cloud workloads on shared infrastructure. Two common Trusted Execution Environment (TEE) abstractions are: process-based enclaves such as Intel SGX [13], isolating userspace components in behind a small Trusted Computing Base (TCB), and confidential virtual machines (CVMs) such as AMD SEV-SNP [19] and Intel TDX [6], which protect a VM from a malicious hypervisor. SGX is prevalent in server CPUs and at the core of Intel TDX attestation.

Critically, neither enclaves nor CVMs alone meet the demands of modern cloud services: enclaves retain a small, auditable TCB but impose rigid memory layouts, expensive transitions, and a poor programming model; CVMs offer binary compatibility and rich OS services but expose a large attack surface [14, 22].

This tension has concrete operational consequences. Workload isolation, resource sharing, deployment cost, and TCB

Quoc Do Le ∗^{*}

StackIT Cloud

Germany

Christof Fetzer

TU Dresden

Germany

size constrain confidential cloud orchestration: OS-level containers CVM offer limited protection against a compromised guest OS, while a single workload per CVM is costly, slow to provision, hard to scale, and weakens per-workload attestation. MicroCVM isolation (e.g., unikernels) reduce TCB but has same scaling issues. Some domains have strict requirements (e.g., healthcare [15]) for confidential isolation of workloads, and demand either enclaves or exclusive CVM per workload that is costlier or has higher orchestration complexity. Thus, we are motivated to explore solutions at the intersection of CVMs and process-based enclaves.

Architectural bottlenecks in SGX have hindered its broader adoption: enclave exceptions force costly transitions and host interaction, degrading memory management and latency in exception-heavy applications (JVM [44]); host-mediated signaling and transitions for preemption; and emulating fork/clone using sealing and state copying has significant overheads despite SGXv2 improvements and runtimes like Haven [9], SCONE [7], Graphene-SGX [37] and Occlum [35].

Lack of in-enclave privilege layers prevents efficient enforcement of trust and isolation. As such, LibOS secrets cannot be robustly isolated and protected from buggy or compromised enclave applications, especially in multi-party enclaves. Software-based isolation mechanisms —MPK-based [28, 38], nested enclaves [31], and compiler-based compartmentalization [35]—mitigate some risks but still demand host cooperation, restrict the programming model, may impose performance overheads, or leave enforcement gaps. Addressing this issue allows new capabilities: faster handling of syscalls and exceptions inside enclaves without software recompilation or enclave transitions; adding timers; easy preemptive scheduling and switching of threads; leading to efficient and richer enclave computing.

Comparatively, CVMs avoid these problems by reusing conventional OS stacks, but attempts to shrink the CVM TCB (unikernels [14], micro-VMs [22, 42], and hardened minimal images [12]) trade one set of compatibility challenges for another without restoring the small, auditable TCB of enclaves.

Recent CVM extensions, AMD SEV-SNP's Virtual Machine Privilege Levels (VMPLs) [2] and Intel TDX partitioning [4], expose primitives that allow a security monitor (SM) to create process-level isolation, protected from the guest OS, in a CVM. Prior related efforts—NestedSGX [39], vSGX [43], Veil [5], and Gramine-TDX [22]—demonstrate important directions but leave the SGX-CVM gap open: they either require modifications of applications or runtimes, incur large cross-VM transitions, or need hypervisor changes.

∗^{*}Quoc Do Le performed this work at TU Dresden.

Our insight is that a single CVM-resident SM can expose the full, unmodified SGX ISA to legacy enclaves and offer new enclave extensions that fix SGX's long-standing limitations—all without hypervisor, hardware, or host-kernel changes. The core idea combines VMPL isolation, a new in-enclave horizontal privilege separation, and a kernel driver outside the enclave TCB for resource management.

We present TEEVisor, a CVM firmware built on Coconut SVSM [3] and AMD SEV-SNP. It provides two enclave modes: (1) bit-for-bit SGX compatibility for unmodified binaries, and (2) a novel extended SGX mode with; horizontal privilege levels, copy-on-write cloning, in-enclave exception handling, direct memory management, soft timers, short syscall loops, new context-switch instructions, and SGX-style attestation while keeping resource management under guest OS.

We implement TEEVisor as a Rust SM and Linux kernel driver, evaluated on AMD EPYC 7313. An EENTER/ERESUME takes 9.7 μ\mus (dominated by a 4.5–5.5 μ\mus VMPL transition). Compute/memory workloads see 4.8% average overhead on nbench; no overhead on LMbench bw_mem, WolfSSL, or SGX-Gauge hash-join. TEEVisor adds under 5% overhead on Redis (SCONE), improves Nginx throughput by 25% (Gramine EXITLESS [18]), and incurs ∼\sim12% on MariaDB (SCONE). COW-Cloning scales linearly (93 μ\mus/MB), allowing elimination of costly page re-encryption steps in fork [8, 18].

This paper makes the following contributions:

  1. Zero-modification SGX on CVMs. TEEVisor executes unmodified SGX binaries, and runtimes (e.g., Gramine, SCONE) in a CVM, enabling drop-in adoption of the SGX ecosystem.

  2. Extended SGX (eSGX) novelties. eSGX introduces horizontal privilege levels, architectural enclave cloning, in-enclave exception handling and direct memory management, soft timers, and short syscall paths to address core SGX overheads and gaps.

  3. Minimal-TCB SM. TEEVisor excludes the guest OS from the enclave TCB, keeps resource management under the untrusted host, and composes with existing CVM attestation without requiring hypervisor or hardware changes.

  4. Implementation and evaluation. We implement TEEVisor on Coconut SVSM and SEV-SNP and demonstrate low overheads on compute- and memory-bound workloads, modest overhead on I/O-bound applications, and significant speedups for workloads previously dominated by exits, demonstrating practicality for production use.