Skip to content

Commit 5ea98e0

Browse files
codomaniasuryasaimadhu
authored andcommitted
x86/boot: Add Confidential Computing type to setup_data
While launching encrypted guests, the hypervisor may need to provide some additional information during the guest boot. When booting under an EFI-based BIOS, the EFI configuration table contains an entry for the confidential computing blob that contains the required information. To support booting encrypted guests on non-EFI VMs, the hypervisor needs to pass this additional information to the guest kernel using a different method. For this purpose, introduce SETUP_CC_BLOB type in setup_data to hold the physical address of the confidential computing blob location. The boot loader or hypervisor may choose to use this method instead of an EFI configuration table. The CC blob location scanning should give preference to a setup_data blob over an EFI configuration table. In AMD SEV-SNP, the CC blob contains the address of the secrets and CPUID pages. The secrets page includes information such as a VM to PSP communication key and the CPUID page contains PSP-filtered CPUID values. Define the AMD SEV confidential computing blob structure. While at it, define the EFI GUID for the confidential computing blob. [ bp: Massage commit message, mark struct __packed. ] Signed-off-by: Brijesh Singh <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 824f377 commit 5ea98e0

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

arch/x86/include/asm/sev.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,24 @@ struct es_em_ctxt {
4242
struct es_fault_info fi;
4343
};
4444

45+
/*
46+
* AMD SEV Confidential computing blob structure. The structure is
47+
* defined in OVMF UEFI firmware header:
48+
* https://github.com/tianocore/edk2/blob/master/OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h
49+
*/
50+
#define CC_BLOB_SEV_HDR_MAGIC 0x45444d41
51+
struct cc_blob_sev_info {
52+
u32 magic;
53+
u16 version;
54+
u16 reserved;
55+
u64 secrets_phys;
56+
u32 secrets_len;
57+
u32 rsvd1;
58+
u64 cpuid_phys;
59+
u32 cpuid_len;
60+
u32 rsvd2;
61+
} __packed;
62+
4563
void do_vc_no_ghcb(struct pt_regs *regs, unsigned long exit_code);
4664

4765
static inline u64 lower_bits(u64 val, unsigned int bits)

arch/x86/include/uapi/asm/bootparam.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define SETUP_EFI 4
1111
#define SETUP_APPLE_PROPERTIES 5
1212
#define SETUP_JAILHOUSE 6
13+
#define SETUP_CC_BLOB 7
1314

1415
#define SETUP_INDIRECT (1<<31)
1516

include/linux/efi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ void efi_native_runtime_setup(void);
390390
#define EFI_CERT_SHA256_GUID EFI_GUID(0xc1c41626, 0x504c, 0x4092, 0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28)
391391
#define EFI_CERT_X509_GUID EFI_GUID(0xa5c059a1, 0x94e4, 0x4aa7, 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72)
392392
#define EFI_CERT_X509_SHA256_GUID EFI_GUID(0x3bd2a492, 0x96c0, 0x4079, 0xb4, 0x20, 0xfc, 0xf9, 0x8e, 0xf1, 0x03, 0xed)
393+
#define EFI_CC_BLOB_GUID EFI_GUID(0x067b1f5f, 0xcf26, 0x44c5, 0x85, 0x54, 0x93, 0xd7, 0x77, 0x91, 0x2d, 0x42)
393394

394395
/*
395396
* This GUID is used to pass to the kernel proper the struct screen_info

0 commit comments

Comments
 (0)