Skip to content

Commit

Permalink
Merge pull request #8533 from fidencio/topic/fix-invalid-cpu-topology…
Browse files Browse the repository at this point in the history
…-for-tdx

Revert "runtime: confidential: Do not set the max_vcpu to cpu"
  • Loading branch information
fidencio committed Nov 30, 2023
2 parents 1f1e537 + f15e16b commit 9b30d97
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/runtime/virtcontainers/hypervisor_config_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func validateHypervisorConfig(conf *HypervisorConfig) error {
conf.DefaultMaxVCPUs = defaultMaxVCPUs
}

if conf.ConfidentialGuest && conf.NumVCPUs() != conf.DefaultMaxVCPUs {
hvLogger.Warnf("Confidential guests do not support hotplugging of vCPUs. Setting DefaultMaxVCPUs to NumVCPUs (%d)", conf.NumVCPUs())
conf.DefaultMaxVCPUs = conf.NumVCPUs()
}

if conf.Msize9p == 0 && conf.SharedFS != config.VirtioFS {
conf.Msize9p = defaultMsize9p
}
Expand Down

0 comments on commit 9b30d97

Please sign in to comment.