Skip to content

KVM: SEV: Fixups for the cache maintenance fixes

Sean Christopherson kvm lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: SEV: Nullify "have run CPUs" mask pointer when freeing itarch/x86/kvm/svm/sev.c+22 -110 replies
2/2KVM: SEV: Do cache maintenance on the source VM *before* clearing SEV statearch/x86/kvm/svm/sev.c+7 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: SEV: Fixups for the cache maintenance fixes

Two fixes, two bugs. I'm batting a 1.000. Fix a double-free and a race pointed out by Sashiko.

Regarding fixing the double free, I initially said I'd just move the allocation to avoid having to deal with CPUMASK_OFFSTACK=n[*], but that felt too much like I was leaving trap for someone else. So instead I elected to nullify the pointer with memset(), which has a fairly desirable side effect of clearing the mask when CPUMASK_OFFSTACK=n.

[*] https://lore.kernel.org/all/[email protected]

Sean Christopherson (2):
KVM: SEV: Nullify "have run CPUs" mask pointer when freeing it
KVM: SEV: Do cache maintenance on the source VM *before* clearing SEV
state

 arch/x86/kvm/svm/sev.c | 46 ++++++++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 17 deletions(-)

base-commit: a4bab1c12fd528ccaafee00360e07463873404a9

Signature · 1 line
2.56.0.rc1.315.gc6ed9934b7-goog