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. ]
Showing the changes to include/uapi (1 of 3 files). Show all
Unified · Split
| @@ -69,6 +69,12 @@ typedef enum { · 68 unmodified lines | ||
| 69 | 69 | SEV_RET_RESOURCE_LIMIT, |
| 70 | 70 | SEV_RET_SECURE_DATA_INVALID, |
| 71 | 71 | 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, | |
| 72 | 78 | SEV_RET_MAX, |
| 73 | 79 | } sev_ret_code; |
| 74 | 80 | |
| @@ -155,6 +161,56 @@ struct sev_user_data_get_id2 { · 80 unmodified lines | ||
| 155 | 161 | __u32 length; /* In/Out */ |
| 156 | 162 | } __packed; |
| 157 | 163 | |
| 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 | + | |
| 158 | 214 | /** |
| 159 | 215 | * struct sev_issue_cmd - SEV ioctl parameters |
| 160 | 216 | * |