History

KVM: Introduce KVM_EXIT_SNP_REQ_CERTS for SNP certificate-fetching

For SEV-SNP, the host can optionally provide a certificate table to the guest when it issues an attestation request to firmware (see GHCB 2.0 specification regarding "SNP Extended Guest Requests"). This certificate table can then be used to verify the endorsement key used by firmware to sign the attestation report. While it is possible for guests to obtain the certificates through other means, handling it via the host provides more flexibility in being able to keep the certificate data in sync with the endorsement key throughout host-side operations that might resulting in the endorsement key changing. In the case of KVM, userspace will be responsible for fetching the certificate table and keeping it in sync with any modifications to the endorsement key by other userspace management tools. Define a new KVM_EXIT_SNP_REQ_CERTS event where userspace is provided with the GPA of the buffer the guest has provided as part of the attestation request so that userspace can write the certificate data into it while relying on filesystem-based locking to keep the certificates up-to-date relative to the endorsement keys installed/utilized by firmware at the time the certificates are fetched. [Melody: Update the documentation scheme about how file locking is expected to happen.]

Michael Roth committed 10 months ago

Commit fa9893f1 parent 55780d84 files · +110 −6Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/kvm.h+9−0
@@ -135,6 +135,12 @@ struct kvm_xen_exit { · 134 unmodified lines
135135 } u;
136136 };
137137
138+struct kvm_exit_snp_req_certs {
139+ __u64 gpa;
140+ __u64 npages;
141+ __u64 ret;
142+};
143+
138144 #define KVM_S390_GET_SKEYS_NONE 1
139145 #define KVM_S390_SKEYS_MAX 1048576
140146
@@ -180,6 +186,7 @@ struct kvm_xen_exit { · 39 unmodified lines
180186 #define KVM_EXIT_MEMORY_FAULT 39
181187 #define KVM_EXIT_TDX 40
182188 #define KVM_EXIT_ARM_SEA 41
189+#define KVM_EXIT_SNP_REQ_CERTS 42
183190
184191 /* For KVM_EXIT_INTERNAL_ERROR */
185192 /* Emulate instruction failed. */
@@ -482,6 +489,8 @@ struct kvm_run { · 296 unmodified lines
482489 __u64 gva;
483490 __u64 gpa;
484491 } arm_sea;
492+ /* KVM_EXIT_SNP_REQ_CERTS */
493+ struct kvm_exit_snp_req_certs snp_req_certs;
485494 /* Fix the size of the union. */
486495 char padding[256];
487496 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t