On Fri, Nov 10, 2023, Jacky Li wrote: > Use a bitmap to provide the flexibility on deciding whether the flush is > needed for a specific mmu notifier event. The cache flush during memory > reclamation was originally introduced to address the cache incoherency > issues in some SME_COHERENT platforms. User may configure the bitmap > depending on the hardware (e.g. No flush needed when SME_COHERENT can > extend to DMA devices) or userspace VMM (e.g. No flush needed when VMM > ensures guest memory is properly unpinned). Absolutely not. KVM and the kernel must know when a flush is needed and when it is not. The various errata around cache line aliasing is far too messy to punt to userspace. Not to mention this bleeds kernel internals to userspace and thus risks unintentionally creating an ABI.