aboutsummaryrefslogtreecommitdiff
path: root/target-i386/cpu.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2013-05-06 13:20:08 -0300
committerAndreas Färber <afaerber@suse.de>2013-05-06 19:16:30 +0200
commit034acf4a581b03fc10cba772f731ae521e00fcd8 (patch)
tree61034b14cfad2ba5c8b00ed4dd6a684ba3c4b663 /target-i386/cpu.c
parent8e8aba5054c043027445c880fcb9dbc8f6a217f3 (diff)
target-i386: Introduce X86CPU::filtered_features field
This field will contain the feature bits that were filtered out because of missing host support. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386/cpu.c')
-rw-r--r--target-i386/cpu.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 3857514bb2..38793bc5c8 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1698,9 +1698,12 @@ static void filter_features_for_kvm(X86CPU *cpu)
for (w = 0; w < FEATURE_WORDS; w++) {
FeatureWordInfo *wi = &feature_word_info[w];
- env->features[w] &= kvm_arch_get_supported_cpuid(s, wi->cpuid_eax,
- wi->cpuid_ecx,
- wi->cpuid_reg);
+ uint32_t host_feat = kvm_arch_get_supported_cpuid(s, wi->cpuid_eax,
+ wi->cpuid_ecx,
+ wi->cpuid_reg);
+ uint32_t requested_features = env->features[w];
+ env->features[w] &= host_feat;
+ cpu->filtered_features[w] = requested_features & ~env->features[w];
}
}
#endif