mbox series

[0/4] Add SEV-ES hypervisor support for GHCB protocol version 2

Message ID 20240501071048.2208265-1-michael.roth@amd.com (mailing list archive)
Headers show
Series Add SEV-ES hypervisor support for GHCB protocol version 2 | expand

Message

Michael Roth May 1, 2024, 7:10 a.m. UTC
This patchset is also available at:

  https://github.com/amdese/linux/commits/sev-init2-ghcb-v1

and is based on commit 20cc50a0410f (just before the v13 SNP patches) from:

  https://git.kernel.org/pub/scm/virt/kvm/kvm.git/log/?h=kvm-coco-queue

Overview
--------

While the main additions from GHCB protocol version 1 to version 2 revolve
mostly around SEV-SNP support, there are a number of changes applicable to
SEV-ES guests as well. This series plucks a handful patches from the SNP
hypervisor patchset that comprise the total set of GHCB-related changes that
are also applicable to SEV-ES, and then introduces a KVM_SEV_INIT2 field so
that userspace can control the maximum GHCB protocol version advertised to
guests to help manage compatibility across kernels/versions.

For more background discussion, see:

  https://lore.kernel.org/kvm/ZimnngU7hn7sKoSc@google.com/


Patch Layout
------------

01-03: These patches add support for all version 2 GHCB requests that
       are applicable to SEV-ES
04:    This patch switches the KVM_SEV_INIT2 default to GHCB protocol
       version 2, and extends it with a new parameter that userspace
       can use to control the specific GHCB version for a guest


Testing
-------

For testing this via QEMU, use the following tree:

  https://github.com/amdese/qemu/commits/snp-v4-wip3c

A basic command-line invocation for SEV-ES would be:

 qemu-system-x86_64 -smp 32,maxcpus=255 -cpu EPYC-Milan-v2
  -machine q35,confidential-guest-support=sev0
  -object sev-guest,id=sev0,cbitpos=51,reduced-phys-bits=1,ghcb-version=2

Feedback/review is very much appreciated.

-Mike


----------------------------------------------------------------
Brijesh Singh (1):
      KVM: SEV: Add GHCB handling for Hypervisor Feature Support requests

Michael Roth (2):
      KVM: SEV: Add GHCB handling for termination requests
      KVM: SEV: Allow per-guest configuration of GHCB protocol version

Tom Lendacky (1):
      KVM: SEV: Add support to handle AP reset MSR protocol

 Documentation/virt/kvm/x86/amd-memory-encryption.rst |  11 ++++-
 arch/x86/include/asm/sev-common.h                    |   8 +++-
 arch/x86/include/uapi/asm/kvm.h                      |   4 +-
 arch/x86/kvm/svm/sev.c                               | 111 ++++++++++++++++++++++++++++++++++++++++-----
 arch/x86/kvm/svm/svm.h                               |   2 +
 5 files changed, 120 insertions(+), 16 deletions(-)