Skip to content

Commit 6372c61

Browse files
committed
Revert "x86/sev: Get cc blob information via boot param"
This commit was introduced to pass cc blob information via boot param address field to enlighten SEV-SNP guest. OpenHCL may use setup field of bootparam to pass cc blob information. Signed-off-by: tianyu Lan <[email protected]>
1 parent 1aefefb commit 6372c61

File tree

1 file changed

+7
-20
lines changed
  • arch/x86/boot/compressed

1 file changed

+7
-20
lines changed

arch/x86/boot/compressed/sev.c

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,6 @@ static struct cc_blob_sev_info *find_cc_blob(struct boot_params *bp)
424424
{
425425
struct cc_blob_sev_info *cc_info;
426426

427-
/* Boot kernel would have passed the CC blob via boot_params. */
428-
if (bp->cc_blob_address)
429-
return (struct cc_blob_sev_info *)(unsigned long)bp->cc_blob_address;
430-
431427
cc_info = find_cc_blob_efi(bp);
432428
if (cc_info)
433429
goto found_cc_info;
@@ -477,11 +473,9 @@ static bool early_snp_init(struct boot_params *bp)
477473
/*
478474
* Pass run-time kernel a pointer to CC info via boot_params so EFI
479475
* config table doesn't need to be searched again during early startup
480-
* phase. Hypervisor also may popualte cc_blob_address directyly
481-
* in direct boot mode.
476+
* phase.
482477
*/
483-
if (!bp->cc_blob_address)
484-
bp->cc_blob_address = (u32)(unsigned long)cc_info;
478+
bp->cc_blob_address = (u32)(unsigned long)cc_info;
485479

486480
return true;
487481
}
@@ -523,24 +517,17 @@ static int sev_check_cpu_support(void)
523517

524518
void sev_enable(struct boot_params *bp)
525519
{
526-
struct cc_blob_sev_info *cc_info;
527520
struct msr m;
528521
int bitpos;
529522
bool snp;
530523

531524
/*
532-
* bp->cc_blob_address should only be set by boot/compressed
533-
* kernel and hypervisor with direct boot mode. Initialize it
534-
* to 0 after checking in order to ensure that uninitialized
535-
* values from buggy bootloaders aren't propagated.
525+
* bp->cc_blob_address should only be set by boot/compressed kernel.
526+
* Initialize it to 0 to ensure that uninitialized values from
527+
* buggy bootloaders aren't propagated.
536528
*/
537-
if (bp) {
538-
cc_info = (struct cc_blob_sev_info *)(unsigned long)
539-
bp->cc_blob_address;
540-
541-
if (cc_info->magic != CC_BLOB_SEV_HDR_MAGIC)
542-
bp->cc_blob_address = 0;
543-
}
529+
if (bp)
530+
bp->cc_blob_address = 0;
544531

545532
/*
546533
* Do an initial SEV capability check before early_snp_init() which

0 commit comments

Comments
 (0)