From patchwork Fri May 16 17:58:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 349703 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2E7DD14008F for ; Sat, 17 May 2014 03:59:48 +1000 (EST) Received: from localhost ([::1]:37133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlMQ6-0001YV-7m for incoming@patchwork.ozlabs.org; Fri, 16 May 2014 13:59:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlMPY-0000Vf-P3 for qemu-devel@nongnu.org; Fri, 16 May 2014 13:59:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlMPR-0002ME-PO for qemu-devel@nongnu.org; Fri, 16 May 2014 13:59:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlMPR-0002M3-Hr for qemu-devel@nongnu.org; Fri, 16 May 2014 13:59:05 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4GHx3AZ027587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 May 2014 13:59:03 -0400 Received: from localhost (ovpn-113-115.phx2.redhat.com [10.3.113.115]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s4GHx2Qo021730; Fri, 16 May 2014 13:59:03 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 16 May 2014 14:58:47 -0300 Message-Id: <1400263128-19107-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1400263128-19107-1-git-send-email-ehabkost@redhat.com> References: <1400263128-19107-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [qom-cpu PATCH v2 1/2] target-i386: Use x86_cpu_get_supported_feature_word() for "-cpu host" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This will make "-cpu host" 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 715078a..61e8800 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1279,6 +1279,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); @@ -1293,10 +1296,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); }