Skip to content

Commit

Permalink
platform/tdx: remove unnecessary Unimplemented errors
Browse files Browse the repository at this point in the history
Several methods of the platform object can be implemented as no-op
methods in the TDP environment because there is no required work
associated with those methods.  There is no need to return an
uninmplemented error.  With this change, the kernel can boot and execute
the test-in-svsm environment on a single vCPU (at least in the Hyper-V
configuration which suppresses certain tests).

Signed-off-by: Jon Lange <[email protected]>
  • Loading branch information
msft-jlange committed Jan 29, 2025
1 parent 7c0cb21 commit 4503d3f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions kernel/src/platform/tdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ impl SvsmPlatform for TdpPlatform {
}

fn setup_percpu(&self, _cpu: &PerCpu) -> Result<(), SvsmError> {
Err(TdxError::Unimplemented.into())
Ok(())
}

fn setup_percpu_current(&self, _cpu: &PerCpu) -> Result<(), SvsmError> {
Err(TdxError::Unimplemented.into())
Ok(())
}

fn get_page_encryption_masks(&self) -> PageEncryptionMasks {
Expand Down Expand Up @@ -151,8 +151,12 @@ impl SvsmPlatform for TdpPlatform {
}
}

fn configure_alternate_injection(&mut self, _alt_inj_requested: bool) -> Result<(), SvsmError> {
Err(TdxError::Unimplemented.into())
fn configure_alternate_injection(&mut self, alt_inj_requested: bool) -> Result<(), SvsmError> {
if alt_inj_requested {
Err(SvsmError::NotSupported)
} else {
Ok(())
}
}

fn change_apic_registration_state(&self, _incr: bool) -> Result<bool, SvsmError> {
Expand Down

0 comments on commit 4503d3f

Please sign in to comment.