From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wx03H-0005Mp-GE for qemu-devel@nongnu.org; Tue, 17 Jun 2014 16:32:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wx039-0007cc-Ms for qemu-devel@nongnu.org; Tue, 17 Jun 2014 16:32:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wx039-0007cO-Ds for qemu-devel@nongnu.org; Tue, 17 Jun 2014 16:32:11 -0400 From: Eduardo Habkost Date: Tue, 17 Jun 2014 17:31:52 -0300 Message-Id: <1403037113-7823-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1403037113-7823-1-git-send-email-ehabkost@redhat.com> References: <1403037113-7823-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [qom-cpu PATCH v3 1/2] target-i386: Use x86_cpu_get_supported_feature_word() for "-cpu host" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Cc: Paolo Bonzini , Richard Henderson , Marcelo Tosatti , Aurelien Jarno , Igor Mammedov This will make "-cpu host" to reuse the feature filtering logic used by x86_cpu_filter_features() (i.e. TCG support, and the new "migratable" flag). This doesn't add "-cpu host" support to TCG mode yet, but that may be possible eventually. Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index d401a7c..5db0338 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1276,6 +1276,9 @@ static void host_x86_cpu_class_init(ObjectClass *oc, void *data) dc->props = host_x86_cpu_properties; } +static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w, + bool migratable_only); + static void host_x86_cpu_initfn(Object *obj) { X86CPU *cpu = X86_CPU(obj); @@ -1290,10 +1293,8 @@ static void host_x86_cpu_initfn(Object *obj) env->cpuid_xlevel2 = kvm_arch_get_supported_cpuid(s, 0xC0000000, 0, R_EAX); 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); + x86_cpu_get_supported_feature_word(w, cpu->migratable); } object_property_set_bool(OBJECT(cpu), true, "pmu", &error_abort); } -- 1.9.3