All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 00/16] KVM: selftests: Add tests for SEV, SEV-ES, and SEV-SNP guests
@ 2021-10-05 23:44 Michael Roth
  2021-10-05 23:44 ` [RFC 01/16] KVM: selftests: move vm_phy_pages_alloc() earlier in file Michael Roth
                   ` (17 more replies)
  0 siblings, 18 replies; 57+ messages in thread
From: Michael Roth @ 2021-10-05 23:44 UTC (permalink / raw)
  To: linux-kselftest
  Cc: kvm, linux-kernel, x86, Nathan Tempelman, Marc Orr,
	Steve Rutherford, Sean Christopherson, Mingwei Zhang,
	Brijesh Singh, Tom Lendacky, Varad Gautam, Shuah Khan,
	Vitaly Kuznetsov, David Woodhouse, Ricardo Koller, Jim Mattson,
	Wanpeng Li, Joerg Roedel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, H . Peter Anvin

These patches and are also available at:

  https://github.com/mdroth/linux/commits/sev-selftests-rfc1

They are based on top of v5 of Brijesh's SEV-SNP hypervisor patches[1]
to allow for SEV-SNP testing and provide some context for the overall
design, but the SEV/SEV-ES patches can be carved out into a separate
series as needed.

== OVERVIEW ==

This series introduces a set of memory encryption-related parameter/hooks
in the core kselftest library, then uses the hooks to implement a small
library for creating/managing SEV, SEV-ES, SEV-SNP guests. This library
is then used to implement a basic boot/memory test that's run for all
variants of SEV/SEV-ES/SEV-SNP guest types, as well as a set of SEV-SNP
tests that cover various permutations of pvalidate/page-state changes.

- Patches 1-7 implement SEV boot tests and should run against existing
  kernels
- Patch 8 is a KVM changes that's required to allow SEV-ES/SEV-SNP
  guests to boot with an externally generated page table, and is a
  host kernel prequisite for the remaining patches in the series.
- Patches 9-12 extend the boot tests to cover SEV-ES
- Patches 13-16 extend the boot testst to cover SEV-SNP, and introduce
  an additional test for page-state changes.

Any review/comments are greatly appreciated!

[1] https://lore.kernel.org/linux-mm/20210820155918.7518-1-brijesh.singh@amd.com/

----------------------------------------------------------------
Michael Roth (16):
      KVM: selftests: move vm_phy_pages_alloc() earlier in file
      KVM: selftests: add hooks for managing encrypted guest memory
      KVM: selftests: handle encryption bits in page tables
      KVM: selftests: set CPUID before setting sregs in vcpu creation
      KVM: selftests: add support for encrypted vm_vaddr_* allocations
      KVM: selftests: add library for creating/interacting with SEV guests
      KVM: selftests: add SEV boot tests
      KVM: SVM: include CR3 in initial VMSA state for SEV-ES guests
      KVM: selftests: account for error code in #VC exception frame
      KVM: selftests: add support for creating SEV-ES guests
      KVM: selftests: add library for handling SEV-ES-related exits
      KVM: selftests: add SEV-ES boot tests
      KVM: selftests: add support for creating SEV-SNP guests
      KVM: selftests: add helpers for SEV-SNP-related instructions/exits
      KVM: selftests: add SEV-SNP boot tests
      KVM: selftests: add SEV-SNP tests for page-state changes

 arch/x86/include/asm/kvm-x86-ops.h                 |   1 +
 arch/x86/include/asm/kvm_host.h                    |   1 +
 arch/x86/kvm/svm/svm.c                             |  22 ++
 arch/x86/kvm/vmx/vmx.c                             |   8 +
 arch/x86/kvm/x86.c                                 |   3 +-
 tools/testing/selftests/kvm/.gitignore             |   2 +
 tools/testing/selftests/kvm/Makefile               |   3 +
 tools/testing/selftests/kvm/include/kvm_util.h     |   8 +
 tools/testing/selftests/kvm/include/x86_64/sev.h   |  70 ++++
 .../selftests/kvm/include/x86_64/sev_exitlib.h     |  20 ++
 tools/testing/selftests/kvm/include/x86_64/svm.h   |  35 ++
 .../selftests/kvm/include/x86_64/svm_util.h        |   2 +
 tools/testing/selftests/kvm/lib/kvm_util.c         | 249 +++++++++-----
 .../testing/selftests/kvm/lib/kvm_util_internal.h  |  10 +
 tools/testing/selftests/kvm/lib/x86_64/handlers.S  |   4 +-
 tools/testing/selftests/kvm/lib/x86_64/processor.c |  30 +-
 tools/testing/selftests/kvm/lib/x86_64/sev.c       | 381 +++++++++++++++++++++
 .../testing/selftests/kvm/lib/x86_64/sev_exitlib.c | 326 ++++++++++++++++++
 .../selftests/kvm/x86_64/sev_all_boot_test.c       | 367 ++++++++++++++++++++
 .../selftests/kvm/x86_64/sev_snp_psc_test.c        | 378 ++++++++++++++++++++
 20 files changed, 1820 insertions(+), 100 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/include/x86_64/sev.h
 create mode 100644 tools/testing/selftests/kvm/include/x86_64/sev_exitlib.h
 create mode 100644 tools/testing/selftests/kvm/lib/x86_64/sev.c
 create mode 100644 tools/testing/selftests/kvm/lib/x86_64/sev_exitlib.c
 create mode 100644 tools/testing/selftests/kvm/x86_64/sev_all_boot_test.c
 create mode 100644 tools/testing/selftests/kvm/x86_64/sev_snp_psc_test.c




^ permalink raw reply	[flat|nested] 57+ messages in thread

end of thread, other threads:[~2021-11-04 13:44 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 23:44 [RFC 00/16] KVM: selftests: Add tests for SEV, SEV-ES, and SEV-SNP guests Michael Roth
2021-10-05 23:44 ` [RFC 01/16] KVM: selftests: move vm_phy_pages_alloc() earlier in file Michael Roth
2021-10-18 15:00   ` Mingwei Zhang
2021-10-21  3:45     ` Michael Roth
2021-10-21 15:20       ` Paolo Bonzini
2021-10-26 15:52       ` Mingwei Zhang
2021-11-01 17:43         ` Mingwei Zhang
2021-10-05 23:44 ` [RFC 02/16] KVM: selftests: add hooks for managing encrypted guest memory Michael Roth
2021-10-13  2:20   ` Krish Sadhukhan
2021-10-13 15:07     ` Michael Roth
2021-10-21 15:22       ` Paolo Bonzini
2021-10-18 15:00   ` Mingwei Zhang
2021-10-21  3:37     ` Michael Roth
2021-10-21 15:22       ` Paolo Bonzini
2021-10-26 15:48       ` Mingwei Zhang
2021-11-01 17:44         ` Mingwei Zhang
2021-10-05 23:44 ` [RFC 03/16] KVM: selftests: handle encryption bits in page tables Michael Roth
2021-10-21 15:26   ` Paolo Bonzini
2021-10-24 16:49     ` Michael Roth
2021-10-25  7:34       ` Paolo Bonzini
2021-10-25 14:14         ` Michael Roth
2021-10-05 23:44 ` [RFC 09/16] KVM: selftests: account for error code in #VC exception frame Michael Roth
2021-10-05 23:44 ` [RFC 10/16] KVM: selftests: add support for creating SEV-ES guests Michael Roth
2021-10-05 23:44 ` [RFC 11/16] KVM: selftests: add library for handling SEV-ES-related exits Michael Roth
2021-10-05 23:44 ` [RFC 12/16] KVM: selftests: add SEV-ES boot tests Michael Roth
2021-10-05 23:44 ` [RFC 13/16] KVM: selftests: add support for creating SEV-SNP guests Michael Roth
2021-10-05 23:44 ` [RFC 14/16] KVM: selftests: add helpers for SEV-SNP-related instructions/exits Michael Roth
2021-10-05 23:44 ` [RFC 15/16] KVM: selftests: add SEV-SNP boot tests Michael Roth
2021-10-05 23:44 ` [RFC 16/16] KVM: selftests: add SEV-SNP tests for page-state changes Michael Roth
2021-10-06 20:28 ` [RFC 04/16] KVM: selftests: add library for creating/interacting with SEV guests Michael Roth
2021-10-06 20:59   ` Michael Roth
2021-10-06 20:36 ` [RFC 04/16] KVM: selftests: set CPUID before setting sregs in vcpu creation Michael Roth
2021-10-08 19:03   ` Nathan Tempelman
2021-10-13  1:45   ` Krish Sadhukhan
2021-10-13 15:05     ` Michael Roth
2021-10-21 15:29   ` Paolo Bonzini
2021-10-06 20:36 ` [RFC 05/16] KVM: selftests: add support for encrypted vm_vaddr_* allocations Michael Roth
2021-10-06 20:37 ` [RFC 06/16] KVM: selftests: add library for creating/interacting with SEV guests Michael Roth
2021-10-11  3:17   ` Marc Orr
2021-10-12  1:15     ` Michael Roth
2021-10-12 12:55       ` Michael Roth
2021-10-21 15:43         ` Paolo Bonzini
2021-11-04  5:25       ` Mingwei Zhang
2021-11-04 13:44         ` Tom Lendacky
2021-10-14  1:26   ` Krish Sadhukhan
2021-10-16  2:56   ` Krish Sadhukhan
2021-10-21 15:39   ` Paolo Bonzini
2021-10-25  3:58     ` Michael Roth
2021-10-06 20:37 ` [RFC 07/16] KVM: selftests: add SEV boot tests Michael Roth
2021-10-16  2:55   ` Krish Sadhukhan
2021-10-21  3:35     ` Michael Roth
2021-10-06 20:37 ` [RFC 08/16] KVM: SVM: include CR3 in initial VMSA state for SEV-ES guests Michael Roth
2021-10-21 16:43   ` Paolo Bonzini
2021-10-25  3:59     ` Michael Roth
2021-10-21 16:48 ` [RFC 00/16] KVM: selftests: Add tests for SEV, SEV-ES, and SEV-SNP guests Paolo Bonzini
2021-10-25  4:27   ` Michael Roth
2021-10-25  7:35     ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.