Skip to content

Add SEV-ES hypervisor support for GHCB protocol version 2

Michael Roth kvm linux-coco linux-crypto linux-mm lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: SEV: Add support to handle AP reset MSR protocolarch/x86/include/asm/sev-common.h arch/x86/kvm/svm/sev.c arch/x86/kvm/svm/svm.h+53 -100 replies
2/4KVM: SEV: Add GHCB handling for Hypervisor Feature Support requestsarch/x86/include/asm/sev-common.h arch/x86/kvm/svm/sev.c+16 -00 replies
3/4KVM: SEV: Add GHCB handling for termination requestsarch/x86/kvm/svm/sev.c+9 -00 replies
4/4KVM: SEV: Allow per-guest configuration of GHCB protocol versionDocumentation/virt/kvm/x86/amd-memory-encryption.rst arch/x86/include/uapi/asm/kvm.h arch/x86/kvm/svm/sev.c +1 more+42 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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/[email protected]/

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(-)