]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: SEV: Read start/end indices of PSC requests exactly once per #VMGEXIT
authorSean Christopherson <seanjc@google.com>
Fri, 29 May 2026 18:35:38 +0000 (20:35 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 3 Jun 2026 14:43:55 +0000 (16:43 +0200)
commitce6ea7b33e0075335b1eb3b227a21a98e3196e41
treebabcbee79de0a5dd03ab59d618a9bfd80f46cd34
parent00b9744a3688758c5c492756d08a1cd599a76965
KVM: SEV: Read start/end indices of PSC requests exactly once per #VMGEXIT

Rework Page State Change (PSC) handling to read the guest-provided start
and end indices exactly once, at the beginning of the request.  Re-reading
the indices is "fine", _if_ the guest is well-behaved.  KVM _should_ be
safe against concurrent guest modification of the indices, but there is
zero reason to introduce unnecessary risk.

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20260501202250.2115252-14-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20260529183549.1104619-14-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.h