Skip to content

KVM: SEV: Drop user-triggerable WARN clean up REG_REGION

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Applied to kvm-x86 svm. Like the other large set of SEV fixes, I'll omit this

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5KVM: SEV: Drop WARN on large size for KVM_MEMORY_ENCRYPT_REG_REGIONarch/x86/kvm/svm/sev.c+7 -40 replies
2/5KVM: SEV: Drop useless sanity checks in sev_mem_enc_register_region()arch/x86/kvm/svm/sev.c+0 -30 replies
3/5KVM: SEV: Disallow pinning more pages than exist in the systemarch/x86/kvm/svm/sev.c+9 -50 replies
4/5KVM: SEV: Use PFN_DOWN() to simplify "number of pages" math when pinning memoryarch/x86/kvm/svm/sev.c+2 -50 replies
5/5KVM: SEV: Use kvzalloc_objs() when pinning userpagesarch/x86/kvm/svm/sev.c+9 -110 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLiam Merwick
SeriesR-b T-b
1/5
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] KVM: SEV: Drop user-triggerable WARN clean up REG_REGION

Drop a WARN in sev_pin_memory() that is comically easy to trigger, and then clean up the code a bit.

*** WARNING ***

The last patch impacts KVM's ABI due to a size restriction that's applied to kvmalloc() but not vmalloc(). If my math is correct (definitely a big "if), it will only impact VMMs that attempt to do KVM_MEMORY_ENCRYPT_REG_REGION with a single region of ~1TiB+.

Liam, I Cc'd you specifically because it looks like Oracle supports SEV VMs with more than 1TiB of _total_ memory. I assume that's spread across multiple memslots and thus multiple KVM_MEMORY_ENCRYPT_REG_REGION calls, but I wanted to double check before potentially breaking userspace.

Sean Christopherson (5):
KVM: SEV: Drop WARN on large size for KVM_MEMORY_ENCRYPT_REG_REGION
KVM: SEV: Drop useless sanity checks in sev_mem_enc_register_region()
KVM: SEV: Disallow pinning more pages than exist in the system
KVM: SEV: Use PFN_DOWN() to simplify "number of pages" math when
pinning memory
KVM: SEV: Use kvzalloc_objs() when pinning userpages

 arch/x86/kvm/svm/sev.c | 51 +++++++++++++++++++++---------------------
 1 file changed, 25 insertions(+), 26 deletions(-)

base-commit: bfd7f4adc1230373c25e1b787a6f1ee407eb0656

Signature · 1 line
2.53.0.851.ga537e3e6e9-goog