Received: from eggs.gnu.org ([2001:4830:134:3::10]:53230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wl1E4-0004p7-SK for qemu-devel@nongnu.org; Thu, 15 May 2014 15:22:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wl1Dy-0002zr-Jf for qemu-devel@nongnu.org; Thu, 15 May 2014 15:21:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wl1Dy-0002zW-Cd for qemu-devel@nongnu.org; Thu, 15 May 2014 15:21:50 -0400 Date: Thu, 15 May 2014 16:21:36 -0300 From: Eduardo Habkost Message-ID: <20140515192136.GV3302@otherpad.lan.raisama.net> References: <1398876525-28831-1-git-send-email-ehabkost@redhat.com> <1398876525-28831-14-git-send-email-ehabkost@redhat.com> <537511AC.2020900@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <537511AC.2020900@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 13/18] target-i386: Support "-cpu host" in TCG mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Marcelo Tosatti , qemu-devel@nongnu.org, Igor Mammedov , Paolo Bonzini , Aurelien Jarno , Richard Henderson On Thu, May 15, 2014 at 09:12:44PM +0200, Andreas F=E4rber wrote: > Am 30.04.2014 18:48, schrieb Eduardo Habkost: > > As "-cpu host" simply means "enable every bit that can be enabled on > > this host", we can emulate similar behavior even if KVM is not enable= d. > > We just need to set all feature bits supported by TCG, accordingly. > >=20 > > Signed-off-by: Eduardo Habkost >=20 > Did you consider that this TCG -cpu host is only available when built > with KVM support? There is some #ifdef CONFIG_KVM in addition to these > kvm_enabled() checks. Oops, I intended to remove all the CONFIG_KVM #ifdefs but forgot to do it. Feel free to squash this into the patch: diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 2ef702c..3e9e2da 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1187,8 +1187,6 @@ void x86_cpu_compat_set_features(const char *cpu_mo= del, FeatureWord w, } } =20 -#ifdef CONFIG_KVM - static int cpu_x86_fill_model_id(char *str) { uint32_t eax =3D 0, ebx =3D 0, ecx =3D 0, edx =3D 0; @@ -1269,8 +1267,6 @@ static const TypeInfo host_x86_cpu_type_info =3D { .class_init =3D host_x86_cpu_class_init, }; =20 -#endif - static void report_unavailable_features(FeatureWord w, uint32_t mask) { FeatureWordInfo *f =3D &feature_word_info[w]; @@ -1808,11 +1804,8 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fp= rintf) snprintf(buf, sizeof(buf), "%s", def->name); (*cpu_fprintf)(f, "x86 %16s %-48s\n", buf, def->model_id); } -#ifdef CONFIG_KVM (*cpu_fprintf)(f, "x86 %16s %-48s\n", "host", - "KVM processor with all supported host features " - "(only available in KVM mode)"); -#endif + "CPU with all features supported by the host"); =20 (*cpu_fprintf)(f, "\nRecognized CPUID flags:\n"); for (i =3D 0; i < ARRAY_SIZE(feature_word_info); i++) { @@ -2857,9 +2850,7 @@ static void x86_cpu_register_types(void) for (i =3D 0; i < ARRAY_SIZE(builtin_x86_defs); i++) { x86_register_cpudef_type(&builtin_x86_defs[i]); } -#ifdef CONFIG_KVM type_register_static(&host_x86_cpu_type_info); -#endif } =20 type_init(x86_cpu_register_types) --=20 Eduardo