History

crypto: ccp: Define the SEV-SNP commands

AMD introduced the next generation of SEV called SEV-SNP (Secure Nested Paging). SEV-SNP builds upon existing SEV and SEV-ES functionality while adding new hardware security protection. Define the commands and structures used to communicate with the AMD-SP when creating and managing the SEV-SNP guests. The SEV-SNP firmware spec is available at developer.amd.com/sev. [ mdr: update SNP command list and SNP status struct based on current spec, use C99 flexible arrays, fix kernel-doc issues. ]

Brijesh Singh committed 2 years ago

Commit 3a45dc21 parent 661b1c63 files · +337 −0Browse files

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

Unified · Split

include/uapi/linux/psp-sev.h+56−0
@@ -69,6 +69,12 @@ typedef enum { · 68 unmodified lines
6969 SEV_RET_RESOURCE_LIMIT,
7070 SEV_RET_SECURE_DATA_INVALID,
7171 SEV_RET_INVALID_KEY = 0x27,
72+ SEV_RET_INVALID_PAGE_SIZE,
73+ SEV_RET_INVALID_PAGE_STATE,
74+ SEV_RET_INVALID_MDATA_ENTRY,
75+ SEV_RET_INVALID_PAGE_OWNER,
76+ SEV_RET_INVALID_PAGE_AEAD_OFLOW,
77+ SEV_RET_RMP_INIT_REQUIRED,
7278 SEV_RET_MAX,
7379 } sev_ret_code;
7480
@@ -155,6 +161,56 @@ struct sev_user_data_get_id2 { · 80 unmodified lines
155161 __u32 length; /* In/Out */
156162 } __packed;
157163
164+/**
165+ * struct sev_user_data_snp_status - SNP status
166+ *
167+ * @api_major: API major version
168+ * @api_minor: API minor version
169+ * @state: current platform state
170+ * @is_rmp_initialized: whether RMP is initialized or not
171+ * @rsvd: reserved
172+ * @build_id: firmware build id for the API version
173+ * @mask_chip_id: whether chip id is present in attestation reports or not
174+ * @mask_chip_key: whether attestation reports are signed or not
175+ * @vlek_en: VLEK (Version Loaded Endorsement Key) hashstick is loaded
176+ * @rsvd1: reserved
177+ * @guest_count: the number of guest currently managed by the firmware
178+ * @current_tcb_version: current TCB version
179+ * @reported_tcb_version: reported TCB version
180+ */
181+struct sev_user_data_snp_status {
182+ __u8 api_major; /* Out */
183+ __u8 api_minor; /* Out */
184+ __u8 state; /* Out */
185+ __u8 is_rmp_initialized:1; /* Out */
186+ __u8 rsvd:7;
187+ __u32 build_id; /* Out */
188+ __u32 mask_chip_id:1; /* Out */
189+ __u32 mask_chip_key:1; /* Out */
190+ __u32 vlek_en:1; /* Out */
191+ __u32 rsvd1:29;
192+ __u32 guest_count; /* Out */
193+ __u64 current_tcb_version; /* Out */
194+ __u64 reported_tcb_version; /* Out */
195+} __packed;
196+
197+/**
198+ * struct sev_user_data_snp_config - system wide configuration value for SNP.
199+ *
200+ * @reported_tcb: the TCB version to report in the guest attestation report.
201+ * @mask_chip_id: whether chip id is present in attestation reports or not
202+ * @mask_chip_key: whether attestation reports are signed or not
203+ * @rsvd: reserved
204+ * @rsvd1: reserved
205+ */
206+struct sev_user_data_snp_config {
207+ __u64 reported_tcb ; /* In */
208+ __u32 mask_chip_id:1; /* In */
209+ __u32 mask_chip_key:1; /* In */
210+ __u32 rsvd:30; /* In */
211+ __u8 rsvd1[52];
212+} __packed;
213+
158214 /**
159215 * struct sev_issue_cmd - SEV ioctl parameters
160216 *

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