]> git.ipfire.org Git - thirdparty/qemu.git/commit
i386/tdx: Fetch and validate CPUID of TD guest
authorXiaoyao Li <xiaoyao.li@intel.com>
Thu, 8 May 2025 14:59:57 +0000 (10:59 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 28 May 2025 17:35:55 +0000 (19:35 +0200)
commite3d1a4a6d1d61cf5fbd0e4b389cfb3976093739f
treed08890188a15312a8f8f49d3ebf9bdb38ee1451e
parentadf25ad70f2f989e63c2cd3e9de4e38152d05e84
i386/tdx: Fetch and validate CPUID of TD guest

Use KVM_TDX_GET_CPUID to get the CPUIDs that are managed and enfored
by TDX module for TD guest. Check QEMU's configuration against the
fetched data.

Print wanring  message when 1. a feature is not supported but requested
by QEMU or 2. QEMU doesn't want to expose a feature while it is enforced
enabled.

- If cpu->enforced_cpuid is not set, prints the warning message of both
1) and 2) and tweak QEMU's configuration.

- If cpu->enforced_cpuid is set, quit if any case of 1) or 2).

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20250508150002.689633-52-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/cpu.c
target/i386/cpu.h
target/i386/kvm/tdx.c