@@ -2217,11 +2217,14 @@ static void sev_flush_encrypted_page(str
unsigned long addr = (unsigned long)va;
/*
- * If hardware enforced cache coherency for encrypted mappings of the
- * same physical page is supported, nothing to do.
+ * If CPU enforced cache coherency for encrypted mappings of the
+ * same physical page is supported, use CLFLUSHOPT instead. NOTE: cache
+ * flush is still needed in order to work properly with DMA devices.
*/
- if (boot_cpu_has(X86_FEATURE_SME_COHERENT))
+ if (boot_cpu_has(X86_FEATURE_SME_COHERENT)) {
+ clflush_cache_range(va, PAGE_SIZE);
return;
+ }
/*
* VM Page Flush takes a host virtual address and a guest ASID. Fall