Taming the Incoherent Cache Issue in Confidential VMs
summary
AMD's SME_COHERENT hardware flag does not cover device DMA, so confidential guest pages can leave dirty CPU caches and later corrupt host memory (CVE-2022-0171). Upstream currently flushes caches whenever guest mappings are removed, causing large performance regressions on SEV-SNP workloads. Two concrete paths are explored: SME_COHERENT lacks CPU-device DMA coherence; use mmu_notifier "reason" filtering to flush only on true deallocation, and/or replace wbinvd with VMPAGE_FLUSH MSR to avoid machine-wide flushes. A mmu_notifier-based patch reduces unnecessary flushes but hits overloaded notifier reasons, so adding finer-grained reasons is necessary.
AI-written summary · about
chapters (5)
- 0:00Introduction to cache incoherence
- 3:30AMD hardware fixes and gaps
- 6:18MMU notifier solution approach
- 11:13Performance and security trade-offs
- 15:00Q&A and future considerations
related talks
38mUnmapped Private Memory for Confidential Guests
39mTaming DMA: Tales Wrestling Memory Corruption
21mScaling Data Analytics Via Confidential Computing on RISC-V
36mEverybody is talking about Confidential Computing - the minimum Devs should know
28mConfidential Devices (TEE I/O): A series of modest proposals
42mProtecting the Linux Kernel from Confidential Computing Threats in Virtual Environments
20mUnmapped Private Memory for Confidential Guests
22mHunting and Exploiting Recursive MMIO Flaws in QEMU KVM
