Re: [PATCH v1 14/40] i386/tdx: Initialize TDX before creating TD vcpus

Gerd Hoffmann
2022-08-25T11:29:13Z

On Tue, Aug 02, 2022 at 03:47:24PM +0800, Xiaoyao Li wrote:
> Invoke KVM_TDX_INIT in kvm_arch_pre_create_vcpu() that KVM_TDX_INIT
> configures global TD state, e.g. the canonical CPUID config, and must
> be executed prior to creating vCPUs.
>
> Use kvm_x86_arch_cpuid() to setup the CPUID settings for TDX VM and
> tie x86cpu->enable_pmu with TD's attributes.
>
> Note, this doesn't address the fact that QEMU may change the CPUID
> configuration when creating vCPUs, i.e. punts on refactoring QEMU to
> provide a stable CPUID config prior to kvm_arch_init().

Acked-by: Gerd Hoffmann <kraxel@redhat.com>