]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: SEV: Mark source page dirty when writing back CPUID data on failure
authorAckerley Tng <ackerleytng@google.com>
Fri, 22 May 2026 22:46:10 +0000 (15:46 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 26 May 2026 16:56:36 +0000 (09:56 -0700)
commit97cd21d57e9bd2da79845178d9250cfd19289cd4
treeff4fb7b88963ceef90ea1c3e31a15a3bb5064269
parent138f5f9cbe374ff87084f1d32181d2a4a2d924e8
KVM: SEV: Mark source page dirty when writing back CPUID data on failure

When writing back CPUID data (provided by trusted firmware) to the source
page on failure, mark the page/folio as dirty so that the data isn't lost
in the unlikely scenario the page is reclaimed before its read by
userspace.

Fixes: 2a62345b3052 ("KVM: guest_memfd: GUP source pages prior to populating guest memory")
Signed-off-by: Ackerley Tng <ackerleytng@google.com>
Link: https://patch.msgid.link/20260522-fix-sev-gmem-post-populate-v2-5-3f196bfad5a1@google.com
[sean: use set_page_dirty(), massage changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c