]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: SEV: Add support to handle MSR based Page State Change VMGEXIT
authorMichael Roth <michael.roth@amd.com>
Wed, 1 May 2024 08:51:59 +0000 (03:51 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 12 May 2024 08:09:30 +0000 (04:09 -0400)
commitd46b7b6a5f9ec652a9e3ac6344f679235c9b67da
tree46c69dcb6f2f30dc70b15479118434c6dffec907
parent0c76b1d08280649f789e1b537b397cefc43da7a0
KVM: SEV: Add support to handle MSR based Page State Change VMGEXIT

SEV-SNP VMs can ask the hypervisor to change the page state in the RMP
table to be private or shared using the Page State Change MSR protocol
as defined in the GHCB specification.

When using gmem, private/shared memory is allocated through separate
pools, and KVM relies on userspace issuing a KVM_SET_MEMORY_ATTRIBUTES
KVM ioctl to tell the KVM MMU whether or not a particular GFN should be
backed by private memory or not.

Forward these page state change requests to userspace so that it can
issue the expected KVM ioctls. The KVM MMU will handle updating the RMP
entries when it is ready to map a private page into a guest.

Use the existing KVM_HC_MAP_GPA_RANGE hypercall format to deliver these
requests to userspace via KVM_EXIT_HYPERCALL.

Signed-off-by: Michael Roth <michael.roth@amd.com>
Co-developed-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Message-ID: <20240501085210.2213060-10-michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/sev-common.h
arch/x86/kvm/svm/sev.c