Skip to content

Commit

Permalink
target/i386: Allow MCDT_NO if host supports
Browse files Browse the repository at this point in the history
MCDT_NO bit indicates HW contains the security fix and doesn't need to
be mitigated to avoid data-dependent behaviour for certain instructions.
It needs no hypervisor support. Treat it as supported regardless of what
KVM reports.

Signed-off-by: Tao Su <tao1.su@linux.intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-ID: <20230706054949.66556-4-tao1.su@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
taosu-linux authored and bonzini committed Jul 7, 2023
1 parent 9dd8b71 commit ba3709f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions target/i386/kvm/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
uint32_t eax;
host_cpuid(7, 1, &eax, &unused, &unused, &unused);
ret |= eax & (CPUID_7_1_EAX_FZRM | CPUID_7_1_EAX_FSRS | CPUID_7_1_EAX_FSRC);
} else if (function == 7 && index == 2 && reg == R_EDX) {
uint32_t edx;
host_cpuid(7, 2, &unused, &unused, &unused, &edx);
ret |= edx & CPUID_7_2_EDX_MCDT_NO;
} else if (function == 0xd && index == 0 &&
(reg == R_EAX || reg == R_EDX)) {
/*
Expand Down

0 comments on commit ba3709f

Please sign in to comment.