Pull x86 SEV updates from Borislav Petkov: - Add the necessary glue so that the kernel can run as a confidential SEV-SNP vTOM guest on Hyper-V. A vTOM guest basically splits the address space in two parts: encrypted and unencrypted. The use case being running unmodified guests on the Hyper-V confidential computing hypervisor - Double-buffer messages between the guest and the hardware PSP device so that no partial buffers are copied back'n'forth and thus potential message integrity and leak attacks are possible - Name the return value the sev-guest driver returns when the hw PSP device hasn't been called, explicitly - Cleanups * tag 'x86_sev_for_v6.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/hyperv: Change vTOM handling to use standard coco mechanisms init: Call mem_encrypt_init() after Hyper-V hypercall init is done x86/mm: Handle decryption/re-encryption of bss_decrypted consistently Drivers: hv: Explicitly request decrypted in vmap_pfn() calls x86/hyperv: Reorder code to facilitate future work x86/ioremap: Add hypervisor callback for private MMIO mapping in coco VM x86/sev: Change snp_guest_issue_request()'s fw_err argument virt/coco/sev-guest: Double-buffer messages crypto: ccp: Get rid of __sev_platform_init_locked()'s local function pointer crypto: ccp - Name -1 return value as SEV_RET_NO_FW_CALL
Showing the changes to include/uapi (2 of 25 files). Show all
Unified · Split
| @@ -36,6 +36,13 @@ enum { · 35 unmodified lines | |||
| 36 | * SEV Firmware status code | 36 | * SEV Firmware status code |
| 37 | */ | 37 | */ |
| 38 | typedef enum { | 38 | typedef enum { |
| 39 | /* | ||
| 40 | * This error code is not in the SEV spec. Its purpose is to convey that | ||
| 41 | * there was an error that prevented the SEV firmware from being called. | ||
| 42 | * The SEV API error codes are 16 bits, so the -1 value will not overlap | ||
| 43 | * with possible values from the specification. | ||
| 44 | */ | ||
| 45 | SEV_RET_NO_FW_CALL = -1, | ||
| 39 | SEV_RET_SUCCESS = 0, | 46 | SEV_RET_SUCCESS = 0, |
| 40 | SEV_RET_INVALID_PLATFORM_STATE, | 47 | SEV_RET_INVALID_PLATFORM_STATE, |
| 41 | SEV_RET_INVALID_GUEST_STATE, | 48 | SEV_RET_INVALID_GUEST_STATE, |
| @@ -52,8 +52,14 @@ struct snp_guest_request_ioctl { · 51 unmodified lines | |||
| 52 | __u64 req_data; | 52 | __u64 req_data; |
| 53 | __u64 resp_data; | 53 | __u64 resp_data; |
| 54 | 54 | ||
| 55 | /* firmware error code on failure (see psp-sev.h) */ | 55 | /* bits[63:32]: VMM error code, bits[31:0] firmware error code (see psp-sev.h) */ |
| 56 | __u64 fw_err; | 56 | union { |
| 57 | __u64 exitinfo2; | ||
| 58 | struct { | ||
| 59 | __u32 fw_error; | ||
| 60 | __u32 vmm_error; | ||
| 61 | }; | ||
| 62 | }; | ||
| 57 | }; | 63 | }; |
| 58 | 64 | ||
| 59 | struct snp_ext_report_req { | 65 | struct snp_ext_report_req { |
| @@ -77,4 +83,12 @@ struct snp_ext_report_req { · 17 unmodified lines | |||
| 77 | /* Get SNP extended report as defined in the GHCB specification version 2. */ | 83 | /* 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) | 84 | #define SNP_GET_EXT_REPORT _IOWR(SNP_GUEST_REQ_IOC_TYPE, 0x2, struct snp_guest_request_ioctl) |
| 79 | 85 | ||
| 86 | /* Guest message request EXIT_INFO_2 constants */ | ||
| 87 | #define SNP_GUEST_FW_ERR_MASK GENMASK_ULL(31, 0) | ||
| 88 | #define SNP_GUEST_VMM_ERR_SHIFT 32 | ||
| 89 | #define SNP_GUEST_VMM_ERR(x) (((u64)x) << SNP_GUEST_VMM_ERR_SHIFT) | ||
| 90 | |||
| 91 | #define SNP_GUEST_VMM_ERR_INVALID_LEN 1 | ||
| 92 | #define SNP_GUEST_VMM_ERR_BUSY 2 | ||
| 93 | |||
| 80 | #endif /* __UAPI_LINUX_SEV_GUEST_H_ */ | 94 | #endif /* __UAPI_LINUX_SEV_GUEST_H_ */ |