vmm: config: Allow --kernel to be used with TDX

The TDVF specification has been updated with the ability to provide a
specific payload, which means we will be able to achieve direct kernel
boot.

For that reason, let's not prevent the user from using --kernel
parameter when running with TDX.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2021-12-15 14:10:13 +01:00
parent 1bd30dc69f
commit 7b93a8dd78

View File

@ -145,9 +145,6 @@ pub enum ValidationError {
/// CPU Hotplug is not permitted with TDX /// CPU Hotplug is not permitted with TDX
#[cfg(feature = "tdx")] #[cfg(feature = "tdx")]
TdxNoCpuHotplug, TdxNoCpuHotplug,
/// Specifying kernel is not permitted with TDX
#[cfg(feature = "tdx")]
TdxKernelSpecified,
/// Insuffient vCPUs for queues /// Insuffient vCPUs for queues
TooManyQueues, TooManyQueues,
/// Need shared memory for vfio-user /// Need shared memory for vfio-user
@ -198,10 +195,6 @@ impl fmt::Display for ValidationError {
TdxNoCpuHotplug => { TdxNoCpuHotplug => {
write!(f, "CPU hotplug is not permitted with TDX") write!(f, "CPU hotplug is not permitted with TDX")
} }
#[cfg(feature = "tdx")]
TdxKernelSpecified => {
write!(f, "Direct kernel boot is not permitted with TDX")
}
TooManyQueues => { TooManyQueues => {
write!(f, "Number of vCPUs is insufficient for number of queues") write!(f, "Number of vCPUs is insufficient for number of queues")
} }
@ -2080,9 +2073,6 @@ impl VmConfig {
if tdx_enabled && (self.cpus.max_vcpus != self.cpus.boot_vcpus) { if tdx_enabled && (self.cpus.max_vcpus != self.cpus.boot_vcpus) {
return Err(ValidationError::TdxNoCpuHotplug); return Err(ValidationError::TdxNoCpuHotplug);
} }
if tdx_enabled && self.kernel.is_some() {
return Err(ValidationError::TdxKernelSpecified);
}
} }
if self.console.mode == ConsoleOutputMode::Tty && self.serial.mode == ConsoleOutputMode::Tty if self.console.mode == ConsoleOutputMode::Tty && self.serial.mode == ConsoleOutputMode::Tty