Re: [PATCH v8 34/40] x86/sev: add SEV-SNP feature detection/setup

Borislav Petkov
2022-01-25T18:43:34Z

On Fri, Dec 10, 2021 at 09:43:26AM -0600, Brijesh Singh wrote:
> +static struct cc_blob_sev_info *snp_find_cc_blob(struct boot_params *bp)
> +{
> + struct cc_blob_sev_info *cc_info;
> +
> + /* Boot kernel would have passed the CC blob via boot_params. */
> + if (bp->cc_blob_address) {
> + cc_info = (struct cc_blob_sev_info *)
> + (unsigned long)bp->cc_blob_address;

No need to break that line.

> + goto found_cc_info;
> + }
> +
> + /*
> + * If kernel was booted directly, without the use of the
> + * boot/decompression kernel, the CC blob may have been passed via
> + * setup_data instead.
> + */
> + cc_info = snp_find_cc_blob_setup_data(bp);
> + if (!cc_info)
> + return NULL;
> +
> +found_cc_info:
> + if (cc_info->magic != CC_BLOB_SEV_HDR_MAGIC)
> + sev_es_terminate(1, GHCB_SNP_UNSUPPORTED);

snp_abort() if you're gonna call it that.

--
Regards/Gruss,
Boris.