Revision 551a2dec target-i386/cpuid.c

b/target-i386/cpuid.c
230 230
          CPUID_PAE | CPUID_SEP | CPUID_APIC)
231 231
#define EXT2_FEATURE_MASK 0x0183F3FF
232 232

  
233
#define TCG_FEATURES (CPUID_FP87 | CPUID_PSE | CPUID_TSC | CPUID_MSR | \
234
          CPUID_PAE | CPUID_MCE | CPUID_CX8 | CPUID_APIC | CPUID_SEP | \
235
          CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | CPUID_PAT | \
236
          CPUID_PSE36 | CPUID_CLFLUSH | CPUID_ACPI | CPUID_MMX | \
237
          CPUID_FXSR | CPUID_SSE | CPUID_SSE2 | CPUID_SS)
238
#define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | \
239
          CPUID_EXT_CX16 | CPUID_EXT_POPCNT | CPUID_EXT_XSAVE | \
240
          CPUID_EXT_HYPERVISOR)
241
#define TCG_EXT2_FEATURES ((TCG_FEATURES & EXT2_FEATURE_MASK) | \
242
          CPUID_EXT2_NX | CPUID_EXT2_MMXEXT | CPUID_EXT2_RDTSCP | \
243
          CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT)
244
#define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
245
          CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
246

  
233 247
/* maintains list of cpu model definitions
234 248
 */
235 249
static x86_def_t *x86_defs = {NULL};
......
792 806
    env->cpuid_ext3_features = def->ext3_features;
793 807
    env->cpuid_xlevel = def->xlevel;
794 808
    env->cpuid_kvm_features = def->kvm_features;
809
    if (!kvm_enabled()) {
810
        env->cpuid_features &= TCG_FEATURES;
811
        env->cpuid_ext_features &= TCG_EXT_FEATURES;
812
        env->cpuid_ext2_features &= (TCG_EXT2_FEATURES
813
#ifdef TARGET_X86_64
814
            | CPUID_EXT2_SYSCALL | CPUID_EXT2_LM
815
#endif
816
            );
817
        env->cpuid_ext3_features &= TCG_EXT3_FEATURES;
818
    }
795 819
    {
796 820
        const char *model_id = def->model_id;
797 821
        int c, len, i;

Also available in: Unified diff