diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2021-07-19 19:21:14 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-09-30 14:50:20 +0200 |
commit | a04835414b8d1ba1af980692d5cf20f8fe4156a0 (patch) | |
tree | 6e28482dc1a3b561a75b23b2bf9076f33a80f22d /target/i386/kvm/kvm.c | |
parent | db888065233ab435a8ea9e589ce755668eef4f90 (diff) | |
download | qemu-a04835414b8d1ba1af980692d5cf20f8fe4156a0.zip qemu-a04835414b8d1ba1af980692d5cf20f8fe4156a0.tar.gz qemu-a04835414b8d1ba1af980692d5cf20f8fe4156a0.tar.bz2 |
i386: Add feature control MSR dependency when SGX is enabled
SGX adds multiple flags to FEATURE_CONTROL to enable SGX and Flexible
Launch Control.
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20210719112136.57018-12-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/kvm/kvm.c')
-rw-r--r-- | target/i386/kvm/kvm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 1155164..6dc4016 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -1877,6 +1877,11 @@ int kvm_arch_init_vcpu(CPUState *cs) !!(c->ecx & CPUID_EXT_SMX); } + c = cpuid_find_entry(&cpuid_data.cpuid, 7, 0); + if (c && (c->ebx & CPUID_7_0_EBX_SGX)) { + has_msr_feature_control = true; + } + if (env->mcg_cap & MCG_LMCE_P) { has_msr_mcg_ext_ctl = has_msr_feature_control = true; } |