The Design and Optimization of Memory Ballooning in SEV Confidential Virtual Machines

Chang Deng,Zheyun Shen,Dingji Li,Zeyu Mi,Yubin Xia
DOI: https://doi.org/10.1109/jcc62314.2024.00009
2024-01-01
Abstract:With the popularity of confidential computing, confidential virtual machines (CVMs) have been widely adopted and they guarantee strong security by hardware. However, there still exist some problems in memory management in CVMs. Since private memory pages of CVMs are encrypted and cannot be accessed by hypervisors, existing CVMs employ static page management to avoid crashes due to the relocation of encrypted memory pages, leading cloud platforms managing CVMs to face more severe memory management pressures than before. Memory ballooning, as an efficient, flexible, and highly compatible memory management mechanism in virtualization, is not available in CVMs based on SEV (Secure Encrypted Virtualization). In this paper, we analyze the design of SEV CVMs and memory ballooning, and enable memory ballooning on SEV CVMs by substituting static page management with dynamic page management and addressing communication issues between the guest frontend and the host backend. Besides, we propose three performance optimization strategies for memory ballooning on SEV CVMs, including asynchronous reclaiming on the host side, an additional shadow vCPU on the guest side, and accelerating cache flushing operations in the host kernel. Experiments show that the time cost of reclaiming memory from SEV CVMs by memory ballooning can be reduced by up to 38 times and up to 55% overhead caused by delaying reclamation in real-world applications like MYSQL can be eliminated.
What problem does this paper attempt to address?