Commit 6c3f6041172b78d5532c6bf3680d304e92ec2e66

Authored by Sheng Yang
Committed by Avi Kivity
1 parent 7ac77099ce

KVM: x86: Enable AVX for guest

Enable Intel(R) Advanced Vector Extension(AVX) for guest.

The detection of AVX feature includes OSXSAVE bit testing. When OSXSAVE bit is
not set, even if AVX is supported, the AVX instruction would result in UD as
well. So we're safe to expose AVX bits to guest directly.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -1963,13 +1963,13 @@
1963 1963 0 /* Reserved */ | f_lm | F(3DNOWEXT) | F(3DNOW);
1964 1964 /* cpuid 1.ecx */
1965 1965 const u32 kvm_supported_word4_x86_features =
1966   - F(XMM3) | 0 /* Reserved, DTES64, MONITOR */ |
  1966 + F(XMM3) | F(PCLMULQDQ) | 0 /* DTES64, MONITOR */ |
1967 1967 0 /* DS-CPL, VMX, SMX, EST */ |
1968 1968 0 /* TM2 */ | F(SSSE3) | 0 /* CNXT-ID */ | 0 /* Reserved */ |
1969 1969 0 /* Reserved */ | F(CX16) | 0 /* xTPR Update, PDCM */ |
1970 1970 0 /* Reserved, DCA */ | F(XMM4_1) |
1971 1971 F(XMM4_2) | F(X2APIC) | F(MOVBE) | F(POPCNT) |
1972   - 0 /* Reserved, AES */ | F(XSAVE) | 0 /* OSXSAVE */;
  1972 + 0 /* Reserved, AES */ | F(XSAVE) | 0 /* OSXSAVE */ | F(AVX);
1973 1973 /* cpuid 0x80000001.ecx */
1974 1974 const u32 kvm_supported_word6_x86_features =
1975 1975 F(LAHF_LM) | F(CMP_LEGACY) | F(SVM) | 0 /* ExtApicSpace */ |