[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 08/23] i386/kvm: Skip KVM_X86_SETUP_MCE for TDX guests
From: |
Isaku Yamahata |
Subject: |
[RFC PATCH 08/23] i386/kvm: Skip KVM_X86_SETUP_MCE for TDX guests |
Date: |
Mon, 15 Feb 2021 18:13:04 -0800 |
Despite advertising MCE support to the guest, TDX-SEAM doesn't support
injecting #MCs into the guest. All of the associated setup is thus
rejected by KVM.
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
target/i386/kvm/kvm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 9c5f669b7c..fb94cdd370 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -1768,7 +1768,8 @@ int kvm_arch_init_vcpu(CPUState *cs)
if (((env->cpuid_version >> 8)&0xF) >= 6
&& (env->features[FEAT_1_EDX] & (CPUID_MCE | CPUID_MCA)) ==
(CPUID_MCE | CPUID_MCA)
- && kvm_check_extension(cs->kvm_state, KVM_CAP_MCE) > 0) {
+ && kvm_check_extension(cs->kvm_state, KVM_CAP_MCE) > 0
+ && vm_type != KVM_X86_TDX_VM) {
uint64_t mcg_cap, unsupported_caps;
int banks;
int ret;
--
2.17.1
- [RFC PATCH 00/23] [RFC PATCH 00/24] TDX support, Isaku Yamahata, 2021/02/15
- [RFC PATCH 05/23] vl: Introduce machine_init_done_late notifier, Isaku Yamahata, 2021/02/15
- [RFC PATCH 06/23] hw/i386: Introduce kvm-type for TDX guest, Isaku Yamahata, 2021/02/15
- [RFC PATCH 02/23] kvm: Switch KVM_CAP_READONLY_MEM to a per-VM ioctl(), Isaku Yamahata, 2021/02/15
- [RFC PATCH 07/23] i386/kvm: Squash getting/putting guest state for TDX VMs, Isaku Yamahata, 2021/02/15
- [RFC PATCH 03/23] KVM: i386: use VM capability check for KVM_CAP_X86_SMM, Isaku Yamahata, 2021/02/15
- [RFC PATCH 08/23] i386/kvm: Skip KVM_X86_SETUP_MCE for TDX guests,
Isaku Yamahata <=
- [RFC PATCH 04/23] i386/kvm: Move architectural CPUID leaf generation to separarte helper, Isaku Yamahata, 2021/02/15
- [RFC PATCH 09/23] target/i386: kvm: don't synchronize guest tsc for TD guest, Isaku Yamahata, 2021/02/15
- [RFC PATCH 01/23] target/i386: Expose x86_cpu_get_supported_feature_word() for TDX, Isaku Yamahata, 2021/02/15
- [RFC PATCH 10/23] linux-headers: Update headers to pull in TDX API changes, Isaku Yamahata, 2021/02/15
- [RFC PATCH 13/23] i386/tdx: Frame in tdx_get_supported_cpuid with KVM_TDX_CAPABILITIES, Isaku Yamahata, 2021/02/15
- [RFC PATCH 11/23] hw/i386: Initialize TDX via KVM ioctl() when kvm_type is TDX, Isaku Yamahata, 2021/02/15
- [RFC PATCH 14/23] i386/tdx: Frame in the call for KVM_TDX_INIT_VCPU, Isaku Yamahata, 2021/02/15
- [RFC PATCH 12/23] target/i386/tdx: Finalize the TD's measurement when machine is done, Isaku Yamahata, 2021/02/15
- [RFC PATCH 15/23] i386/tdx: Add hook to require generic device loader, Isaku Yamahata, 2021/02/15