Eager Memory Cryptography in Caches
Xin Wang, Jagadish B. Kotra, Xun Jian
Abstract
To protect memory values from adversaries with physical access to data centers, secure memory systems ensure memory confidentiality and integrity via memory encryption and verification. The corresponding cryptography calculations require a memory block's write counter as input. As such, CPUs today cache counters in the memory controller (MC).
Due to the large memory footprint and irregular access patterns of many real-world applications, MC's counter cache is too small to achieve high hit rate. A promising solution is also caching counters in the much bigger Last Level cache (LLC). As such, many prior works use LLC as a second level cache for counters to back up the smaller counter cache in MC.
Caching counters in LLC introduces a new problem, however. Modern server CPUs have a long LLC access latency that not only can diminish the benefit of caching counters in LLC, but also can sometimes significantly increase counter access latency compared to not caching counters in LLC.
We note the problem lies with MC sitting behind LLC; due to its physical location, MC can only see LLC misses and, therefore, can only serially access and use counters after data miss in LLC has completed. However, prior designs without caching counters in LLC can access and use counters in parallel with accessing data. If a block's counter misses in MC's counter cache, MC can fetch the counter from DRAM in parallel with data; if the counter hits in MC's counter cache, MC can use counters for cryptography calculation in parallel with data traveling from DRAM to MC.
To parallelize the access and use of counters with data access while caching counters in LLC, we observe that in modern CPUs, L2 is typically the first place that caches data from DRAM (i.e., L2 and L3 are non-inclusive); as such, data from DRAM need not be decrypted and verified until they reach L2. So it is possible to offload some decryption and verification tasks from MC to L2. Since L2 sits before L3, L2 can access counter and data in parallel from L3; L2 can also use counters for cryptography calculation in parallel with data traveling from DRAM to L2, instead of just from DRAM to MC. As such, we propose caching and using counters directly in L2 and refer to this idea as Eager Memory Cryptography in Caches (EMCC). Our evaluation shows that when applied to the state-of-the-art baseline, EMCC improves performance of large and/or irregular workloads by 7%, on average.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers4
- Characterizing Off-path SmartNIC for Accelerating Distributed SystemsXingda Wei, Rongxin Cheng, Yuhan Yang, Rong Chen et al.OSDI 2023 · 68 citations
- Counter-light Memory EncryptionXin Wang, Jagadish Kotra, Alex Jones, Wenjie Xiong et al.ISCA 2024 · 5 citations
- Conduit: Programmer-Transparent Near-Data Processing Using Multiple Compute-Capable Resources in Solid State DrivesRakesh Nadig, Vamanan Arulchelvan, Mayank Kabra, Harshita Gupta et al.HPCA 2026 · 2 citations
- COSMOS: RL-Enhanced Locality-Aware Counter Cache Optimization for Secure MemoryHaoran Geng, Xiaoyang Lu, Yuezhi Che, Ziang Tian et al.MICRO 2025 · 1 citation
Builds on4
- DRAMA: Exploiting DRAM Addressing for Cross-CPU AttacksPeter Pessl, Daniel Gruss, Clémentine Maurice, Michael Schwarz et al.USENIX Security 2016 · 500 citations
- Perforated Page: Supporting Fragmented Memory Allocation for Large PagesChang Hyun Park, Sanghoon Cha, Bokyeong Kim, Youngjin Kwon et al.ISCA 2020 · 35 citations
- Every walk's a hit: making page walks single-access cache hitsChang Hyun Park, Ilias Vougioukas, Andreas Sandberg, David Black-SchafferASPLOS 2022 · 34 citations
- Persist Level Parallelism: Streamlining Integrity Tree Updates for Secure Persistent MemoryAlexander Freij, Shougang Yuan, Huiyang Zhou, Yan SolihinMICRO 2020 · 31 citations
Related papers
- Self-Reinforcing Memoization for Cryptography Calculations in Secure Memory SystemsXin Wang, Daulet Talapkaliyev, Matthew Hicks, Xun JianMICRO 2022 · 9 citations
- Common Counters: Compressed Encryption Counters for Secure GPU MemorySeonjin Na, Sunho Lee, Yeonjae Kim, Jongse Park et al.HPCA 2021 · 34 citations
- PhantomCache: Obfuscating Cache Conflicts with Localized RandomizationQinhan Tan, Zhihua Zeng, Kai Bu, Kui RenNDSS 2020
- Secret Caching Sauce for High-Performance Secure MemoryXu Jiang, Xueliang Wei, Yifei Qu, Dan Feng et al.HPCA 2026
- : Practical Cache Attacks from the NetworkMichael Kurth, Ben Gras, Dennis Andriesse, Cristiano Giuffrida et al.S&P 2020 · 78 citations
