]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: SVM: Mark VMCB dirty before processing incoming snp_vmsa_gpa
authorSean Christopherson <seanjc@google.com>
Thu, 27 Feb 2025 01:25:39 +0000 (17:25 -0800)
committerSean Christopherson <seanjc@google.com>
Mon, 3 Mar 2025 15:34:54 +0000 (07:34 -0800)
commite268beee4a25ce58807a96253e95e96c2e3a5c1a
treeb32996b449cc418794b628e6faed80348be0b799
parent46332437e1c546e2ade4fedab2715c66bce573cc
KVM: SVM: Mark VMCB dirty before processing incoming snp_vmsa_gpa

Mark the VMCB dirty, i.e. zero control.clean, prior to handling the new
VMSA.  Nothing in the VALID_PAGE() case touches control.clean, and
isolating the VALID_PAGE() code will allow simplifying the overall logic.

Note, the VMCB probably doesn't need to be marked dirty when the VMSA is
invalid, as KVM will disallow running the vCPU in such a state.  But it
also doesn't hurt anything.

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20250227012541.3234589-9-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c