]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/sev: Do not touch VMSA pages during SNP guest memory kdump
authorAshish Kalra <ashish.kalra@amd.com>
Mon, 28 Apr 2025 21:41:51 +0000 (21:41 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 13 May 2025 17:40:44 +0000 (19:40 +0200)
commitd2062cc1b1c367d5d019f595ef860159e1301351
tree3e7298082f006c19fca717889aec88bd27282a22
parent386cd3dcfd63491619b4034b818737fc0219e128
x86/sev: Do not touch VMSA pages during SNP guest memory kdump

When kdump is running makedumpfile to generate vmcore and dump SNP guest
memory it touches the VMSA page of the vCPU executing kdump.

It then results in unrecoverable #NPF/RMP faults as the VMSA page is
marked busy/in-use when the vCPU is running and subsequently a causes
guest softlockup/hang.

Additionally, other APs may be halted in guest mode and their VMSA pages
are marked busy and touching these VMSA pages during guest memory dump
will also cause #NPF.

Issue AP_DESTROY GHCB calls on other APs to ensure they are kicked out
of guest mode and then clear the VMSA bit on their VMSA pages.

If the vCPU running kdump is an AP, mark it's VMSA page as offline to
ensure that makedumpfile excludes that page while dumping guest memory.

Fixes: 3074152e56c9 ("x86/sev: Convert shared memory back to private on kexec")
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Tested-by: Srikanth Aithal <sraithal@amd.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/20250428214151.155464-1-Ashish.Kalra@amd.com
arch/x86/coco/sev/core.c