Revision e8beac00

b/target-i386/cpu.c
148 148
typedef struct model_features_t {
149 149
    uint32_t *guest_feat;
150 150
    uint32_t *host_feat;
151
    uint32_t check_feat;
152 151
    const char **flag_names;
153 152
    uint32_t cpuid;
154 153
    int reg;
......
945 944
}
946 945

  
947 946
/* best effort attempt to inform user requested cpu flags aren't making
948
 * their way to the guest.  Note: ft[].check_feat ideally should be
949
 * specified via a guest_def field to suppress report of extraneous flags.
947
 * their way to the guest.
950 948
 *
951 949
 * This function may be called only if KVM is enabled.
952 950
 */
......
957 955
    int rv, i;
958 956
    struct model_features_t ft[] = {
959 957
        {&guest_def->features, &host_def.features,
960
            ~0, feature_name, 0x00000001, R_EDX},
958
            feature_name, 0x00000001, R_EDX},
961 959
        {&guest_def->ext_features, &host_def.ext_features,
962
            ~0, ext_feature_name, 0x00000001, R_ECX},
960
            ext_feature_name, 0x00000001, R_ECX},
963 961
        {&guest_def->ext2_features, &host_def.ext2_features,
964
            ~0, ext2_feature_name, 0x80000001, R_EDX},
962
            ext2_feature_name, 0x80000001, R_EDX},
965 963
        {&guest_def->ext3_features, &host_def.ext3_features,
966
            ~0, ext3_feature_name, 0x80000001, R_ECX}
964
            ext3_feature_name, 0x80000001, R_ECX}
967 965
    };
968 966

  
969 967
    assert(kvm_enabled());
......
971 969
    kvm_cpu_fill_host(&host_def);
972 970
    for (rv = 0, i = 0; i < ARRAY_SIZE(ft); ++i)
973 971
        for (mask = 1; mask; mask <<= 1)
974
            if (ft[i].check_feat & mask && *ft[i].guest_feat & mask &&
972
            if (*ft[i].guest_feat & mask &&
975 973
                !(*ft[i].host_feat & mask)) {
976 974
                    unavailable_host_feature(&ft[i], mask);
977 975
                    rv = 1;

Also available in: Unified diff