CVE-2026-72239: x86/virt/sev: Revert "Drop WBINVD before setting MSR_AMD64_SYSCFG_SNP_EN"
In the Linux kernel, the following vulnerability has been resolved:
x86/virt/sev: Revert "Drop WBINVD before setting MSRAMD64SYSCFGSNPEN"
Revert
99cf1fb58e68 ("x86/virt/sev: Drop WBINVD before setting MSRAMD64SYSCFGSNPEN").
Section 8.8 of the SNP spec says:
Before invoking SNPINITEX with INITRMP set to 1, software must ensure that no CPUs contain dirty cache lines for the memory containing the RMP.
Cachelines can be moved from cache to cache in a dirty state. The wbinvdonallcpus() before SNPINITEX flushes the caches for each CPU, but if the IPIs for WBINVD race with this dirty cacheline movement, it is possible that they may not get flushed, violating the firmware requirement.
Doing wbinvdonallcpus() before setting SNPEn is safer since the RMP table is not yet in use.
[ Heroically bisected by Srikanth. ] [ bp: Massage commit message. ]