Skip to content

KVM: selftests: Add simple SEV test

Peter Gonda kvm lkml 9 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest8 patches 7 repliesIn review
  2. v6 posting 2/27 patches 9 repliesSuperseded
  3. v6 posting 1/27 patches 0 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v57 patches4 repliesSuperseded
v48 patches15 repliesSuperseded
v311 patches18 repliesSuperseded
v2 posting 2/211 patches11 repliesSuperseded
v2 posting 1/21 patch0 repliesSuperseded
v1 RFC10 patches5 repliesSuperseded

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8KVM: selftests: Extend VM creation's @mode to allow control of VM subtypetools/testing/selftests/kvm/include/kvm_util_base.h tools/testing/selftests/kvm/lib/guest_modes.c tools/testing/selftests/kvm/lib/kvm_util.c+73 -451 reply
2/8KVM: selftests: Make sparsebit structs const where appropriatetools/testing/selftests/kvm/include/sparsebit.h tools/testing/selftests/kvm/lib/sparsebit.c+42 -420 replies
3/8KVM: selftests: add hooks for managing protected guest memorytools/testing/selftests/kvm/include/kvm_util_base.h tools/testing/selftests/kvm/lib/kvm_util.c+26 -51 reply
4/8KVM: selftests: Allow tagging protected memory in guest page tablestools/arch/arm64/include/asm/kvm_host.h tools/arch/riscv/include/asm/kvm_host.h tools/arch/s390/include/asm/kvm_host.h +4 more+85 -41 reply
5/8KVM: selftests: add support for protected vm_vaddr_* allocationstools/testing/selftests/kvm/include/kvm_util_base.h tools/testing/selftests/kvm/lib/kvm_util.c+23 -50 replies
6/8KVM: selftests: add library for creating/interacting with SEV guestsinclude/uapi/linux/kvm.h tools/arch/x86/include/asm/kvm_host.h tools/testing/selftests/kvm/Makefile +6 more+274 -12 replies
7/8KVM: selftests: Update ucall pool to allocate from shared memorytools/testing/selftests/kvm/lib/ucall_common.c+2 -10 replies
8/8KVM: selftests: Add simple sev vm testingtools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/x86_64/sev_all_boot_test.c+60 -01 reply

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by.

PatchMichael Roth
1/8
2/8
3/8Originally-by
4/8Originally-by
5/8
6/8Originally-by
7/8
8/8

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

Read the v7 thread

Cover letter [PATCH V7 0/8] KVM: selftests: Add simple SEV test

This patch series continues the work Michael Roth has done in supporting SEV guests in selftests. It continues on top of the work Sean Christopherson has sent to support ucalls from SEV guests. Along with a very simple version of the SEV selftests Michael originally proposed.

V7
* Thanks to Sean for the branch:
https://github.com/sean-jc/linux/tree/x86/sev_selftests_for_peter. This series is now based on that.
* I kept is_pt_protected because without it the page tables are never readable. Its used for the elf loading in kvm_vm_elf_load().

V6
* Updated SEV VM create function based on Seanjc's feedback and new changes to VM creation functions.
* Removed pte_me_mask based on feedback.
* Fixed s_bit usage based on TDX
* Fixed bugs and took Ackerly's code for enc_region setup code.

V5
* Rebase onto seanjc@'s latest ucall pool series.
* More review changes based on seanjc:
** use protected instead of encrypted outside of SEV specific files ** Swap memcrypt struct for kvm_vm_arch arch specific struct
** Make protected page table data agnostic of address bit stealing specifics
of SEV
** Further clean up for SEV library to just vm_sev_create_one_vcpu()
* Due to large changes moved more authorships from mroth@ to pgonda@. Gave originally-by tags to mroth@ as suggested by Seanjc for this.

V4
* Rebase ontop of seanjc@'s latest Ucall Pool series:
https://lore.kernel.org/linux-arm-kernel/[email protected]/
* Fix up review comments from seanjc
* Switch authorship on 2 patches because of significant changes, added
* Michael as suggested-by or originally-by.

V3
* Addressed more of andrew.jones@ in ucall patches.
* Fix build in non-x86 archs.

V2
* Dropped RFC tag
* Correctly separated Sean's ucall patches into 2 as originally intended.
* Addressed andrew.jones@ in ucall patches.
* Fixed ucall pool usage to work for other archs

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

Michael Roth (2):
KVM: selftests: Make sparsebit structs const where appropriate
KVM: selftests: add support for protected vm_vaddr_* allocations

Peter Gonda (6):
KVM: selftests: Extend VM creation's @mode to allow control of VM
subtype
KVM: selftests: add hooks for managing protected guest memory
KVM: selftests: Allow tagging protected memory in guest page tables
KVM: selftests: add library for creating/interacting with SEV guests
KVM: selftests: Update ucall pool to allocate from shared memory
KVM: selftests: Add simple sev vm testing

 include/uapi/linux/kvm.h                      |   2 +-
 tools/arch/arm64/include/asm/kvm_host.h       |   7 +
 tools/arch/riscv/include/asm/kvm_host.h       |   7 +
 tools/arch/s390/include/asm/kvm_host.h        |   7 +
 tools/arch/x86/include/asm/kvm_host.h         |  15 ++
 tools/testing/selftests/kvm/Makefile          |   2 +
 .../selftests/kvm/include/kvm_util_base.h     | 113 +++++++---
 .../testing/selftests/kvm/include/sparsebit.h |  58 +++--
 .../selftests/kvm/include/x86_64/processor.h  |   2 +
 .../selftests/kvm/include/x86_64/sev.h        |  27 +++
 tools/testing/selftests/kvm/lib/guest_modes.c |   2 +-
 tools/testing/selftests/kvm/lib/kvm_util.c    | 103 ++++++---
 tools/testing/selftests/kvm/lib/sparsebit.c   |  48 ++---
 .../testing/selftests/kvm/lib/ucall_common.c  |   3 +-
 .../selftests/kvm/lib/x86_64/processor.c      |  31 ++-
 tools/testing/selftests/kvm/lib/x86_64/sev.c  | 202 ++++++++++++++++++
 .../selftests/kvm/x86_64/sev_all_boot_test.c  |  59 +++++
 17 files changed, 585 insertions(+), 103 deletions(-)
 create mode 100644 tools/arch/arm64/include/asm/kvm_host.h
 create mode 100644 tools/arch/riscv/include/asm/kvm_host.h
 create mode 100644 tools/arch/s390/include/asm/kvm_host.h
 create mode 100644 tools/arch/x86/include/asm/kvm_host.h
 create mode 100644 tools/testing/selftests/kvm/include/x86_64/sev.h
 create mode 100644 tools/testing/selftests/kvm/lib/x86_64/sev.c
 create mode 100644 tools/testing/selftests/kvm/x86_64/sev_all_boot_test.c
Signature · 1 line
2.43.0.472.g3155946c3a-goog