Skip to content

KVM: x86: gmem populate fix and cleanups

Sean Christopherson kvm linux-coco lkml sashiko-reviews 1 version Applied

Status from this message: Applied to kvm-x86 misc, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 11 repliesApplied

Changes in v2 from the cover letter

- Rewrite the SNP patch changelog.
- Tweak the code to avoid checking KVM_SEV_SNP_PAGE_TYPE_ZERO twice.
- Drop what is now effectively a sanity check in sev_gmem_post_populate(), so that we don't have to duplicate the logic when in-place conversion comes along.
- Tack on the TDX change.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: SEV: Explicitly disallow NULL user address for SNP_LAUNCH_UPDATEarch/x86/kvm/svm/sev.c+5 -62 replies
2/2KVM: TDX: Return EINVAL, not EOPNOTSUPP, for NULL INIT_MEM_REGION sourcearch/x86/kvm/vmx/tdx.c+2 -58 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchYan ZhaoBinbin WuKiryl Shutsemau (Meta)Ackerley TngXiaoyao Li
1/2R-b
2/2R-b T-b R-b A-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/2] KVM: x86: gmem populate fix and cleanups

Fix a user-triggerable WARN due to KVM not pre-checking that userspace provided a source page for non-ZERO pages for SNP_LAUNCH_UPDATE, and then clean up the equivalent TDX code to also explicitly check the incoming source page *before* calling into guest_memfd, and to return -EINVAL, not -EOPNOTSUPP.

v2:
- Rewrite the SNP patch changelog.
- Tweak the code to avoid checking KVM_SEV_SNP_PAGE_TYPE_ZERO twice.
- Drop what is now effectively a sanity check in sev_gmem_post_populate(), so that we don't have to duplicate the logic when in-place conversion comes along.
- Tack on the TDX change.

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

Joerg Roedel (1):
KVM: SEV: Explicitly disallow NULL user address for SNP_LAUNCH_UPDATE

Sean Christopherson (1):
KVM: TDX: Return EINVAL, not EOPNOTSUPP, for NULL INIT_MEM_REGION
source

 arch/x86/kvm/svm/sev.c | 11 +++++------
 arch/x86/kvm/vmx/tdx.c |  7 ++-----
 2 files changed, 7 insertions(+), 11 deletions(-)

base-commit: a204badd8432f93b7e862e7dac6db0fe3d65f370

Signature · 1 line
2.55.0.rc0.799.gd6f94ed593-goog