1 /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
3 * Userspace interface for AMD SEV and SNP guest driver.
5 * Copyright (C) 2021 Advanced Micro Devices, Inc.
7 * Author: Brijesh Singh <brijesh.singh@amd.com>
9 * SEV API specification is available at: https://developer.amd.com/sev/
12 #ifndef __UAPI_LINUX_SEV_GUEST_H_
13 #define __UAPI_LINUX_SEV_GUEST_H_
15 #include <linux/types.h>
17 struct snp_report_req {
18 /* user data that should be included in the report */
21 /* The vmpl level to be included in the report */
24 /* Must be zero filled */
28 struct snp_report_resp {
29 /* response data, see SEV-SNP spec for the format */
33 struct snp_derived_key_req {
34 __u32 root_key_select;
36 __u64 guest_field_select;
42 struct snp_derived_key_resp {
43 /* response data, see SEV-SNP spec for the format */
47 struct snp_guest_request_ioctl {
48 /* message version number (must be non-zero) */
51 /* Request and response structure address */
55 /* firmware error code on failure (see psp-sev.h) */
59 struct snp_ext_report_req {
60 struct snp_report_req data;
62 /* where to copy the certificate blob */
65 /* length of the certificate blob */
69 #define SNP_GUEST_REQ_IOC_TYPE 'S'
71 /* Get SNP attestation report */
72 #define SNP_GET_REPORT _IOWR(SNP_GUEST_REQ_IOC_TYPE, 0x0, struct snp_guest_request_ioctl)
74 /* Get a derived key from the root */
75 #define SNP_GET_DERIVED_KEY _IOWR(SNP_GUEST_REQ_IOC_TYPE, 0x1, struct snp_guest_request_ioctl)
77 /* Get SNP extended report as defined in the GHCB specification version 2. */
78 #define SNP_GET_EXT_REPORT _IOWR(SNP_GUEST_REQ_IOC_TYPE, 0x2, struct snp_guest_request_ioctl)
80 #endif /* __UAPI_LINUX_SEV_GUEST_H_ */