Skip to content

Commit

Permalink
Merge pull request #405 from 00xc/apic
Browse files Browse the repository at this point in the history
platform/snp: enable alternate injection only if requested
  • Loading branch information
00xc authored Jul 5, 2024
2 parents 6552a8b + 6946a54 commit 5573dd5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kernel/src/platform/snp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ impl SvsmPlatform for SnpPlatform {
}

fn configure_alternate_injection(&mut self, alt_inj_requested: bool) -> Result<(), SvsmError> {
if !alt_inj_requested {
return Ok(());
}

// If alternate injection was requested, then it must be supported by
// the hypervisor.
if alt_inj_requested
&& !hypervisor_ghcb_features().contains(GHCBHvFeatures::SEV_SNP_EXT_INTERRUPTS)
{
if !hypervisor_ghcb_features().contains(GHCBHvFeatures::SEV_SNP_EXT_INTERRUPTS) {
return Err(SvsmError::NotSupported);
}

Expand Down

0 comments on commit 5573dd5

Please sign in to comment.