From c8cad394b5b186f2480deb6ca0310cc85c2154ca Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 3 Mar 2021 12:08:42 +0000 Subject: [PATCH] vmm: cpu: Expose the common/shared CPUID data for all vCPUs This allows the CPUID data to be passed into the VM level ioctl used for initalizing TDX. Signed-off-by: Rob Bradford --- vmm/src/cpu.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index e0f0baadd..9671ac7a5 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -1091,6 +1091,11 @@ impl CpuManager { self.config.max_vcpus } + #[cfg(target_arch = "x86_64")] + pub fn common_cpuid(&self) -> CpuId { + self.cpuid.clone() + } + fn present_vcpus(&self) -> u8 { self.vcpu_states .iter()