From: Peter Gonda <pgonda@google.com>
To: kvm@vger.kernel.org
Cc: Peter Gonda <pgonda@google.com>,
linux-kernel@vger.kernel.org, seanjc@google.com,
michael.roth@amd.com, thomas.lendacky@amd.com, joro@8bytes.org,
pbonzini@redhat.com, andrew.jones@linux.dev,
vannapurve@google.com, ackerleytng@google.com
Subject: [PATCH V7 0/8] KVM: selftests: Add simple SEV test
Date: Mon, 18 Dec 2023 08:11:38 -0800 [thread overview]
Message-ID: <20231218161146.3554657-1-pgonda@google.com> (raw)
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/20220825232522.3997340-8-seanjc@google.com/
* 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/20220715192956.1873315-1-pgonda@google.com/
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: seanjc@google.com
Cc: michael.roth@amd.com
Cc: thomas.lendacky@amd.com
Cc: joro@8bytes.org
Cc: pbonzini@redhat.com
Cc: andrew.jones@linux.dev
Cc: vannapurve@google.com
Cc: ackerleytng@google.com
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
--
2.43.0.472.g3155946c3a-goog
next reply other threads:[~2023-12-18 16:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-18 16:11 Peter Gonda [this message]
2023-12-18 16:11 ` [PATCH V7 1/8] KVM: selftests: Extend VM creation's @mode to allow control of VM subtype Peter Gonda
2024-01-30 19:38 ` Sean Christopherson
2023-12-18 16:11 ` [PATCH V7 2/8] KVM: selftests: Make sparsebit structs const where appropriate Peter Gonda
2023-12-18 16:11 ` [PATCH V7 3/8] KVM: selftests: add hooks for managing protected guest memory Peter Gonda
2024-01-30 19:41 ` Sean Christopherson
2023-12-18 16:11 ` [PATCH V7 4/8] KVM: selftests: Allow tagging protected memory in guest page tables Peter Gonda
2024-01-30 19:43 ` Sean Christopherson
2023-12-18 16:11 ` [PATCH V7 5/8] KVM: selftests: add support for protected vm_vaddr_* allocations Peter Gonda
2023-12-18 16:11 ` [PATCH V7 6/8] KVM: selftests: add library for creating/interacting with SEV guests Peter Gonda
2024-01-30 19:35 ` Sean Christopherson
2024-01-30 21:49 ` Ackerley Tng
2023-12-18 16:11 ` [PATCH V7 7/8] KVM: selftests: Update ucall pool to allocate from shared memory Peter Gonda
2023-12-18 16:11 ` [PATCH V7 8/8] KVM: selftests: Add simple sev vm testing Peter Gonda
2024-01-30 19:36 ` Sean Christopherson
2024-01-30 19:45 ` [PATCH V7 0/8] KVM: selftests: Add simple SEV test Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231218161146.3554657-1-pgonda@google.com \
--to=pgonda@google.com \
--cc=ackerleytng@google.com \
--cc=andrew.jones@linux.dev \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=thomas.lendacky@amd.com \
--cc=vannapurve@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.