qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 13/18] target-i386: Support "-cpu host" in TC


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH v4 13/18] target-i386: Support "-cpu host" in TCG mode
Date: Thu, 15 May 2014 16:21:36 -0300
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, May 15, 2014 at 09:12:44PM +0200, Andreas Färber 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 enabled.
> > We just need to set all feature bits supported by TCG, accordingly.
> > 
> > Signed-off-by: Eduardo Habkost <address@hidden>
> 
> 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_model, 
FeatureWord w,
     }
 }
 
-#ifdef CONFIG_KVM
-
 static int cpu_x86_fill_model_id(char *str)
 {
     uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
@@ -1269,8 +1267,6 @@ static const TypeInfo host_x86_cpu_type_info = {
     .class_init = host_x86_cpu_class_init,
 };
 
-#endif
-
 static void report_unavailable_features(FeatureWord w, uint32_t mask)
 {
     FeatureWordInfo *f = &feature_word_info[w];
@@ -1808,11 +1804,8 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf)
         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");
 
     (*cpu_fprintf)(f, "\nRecognized CPUID flags:\n");
     for (i = 0; i < ARRAY_SIZE(feature_word_info); i++) {
@@ -2857,9 +2850,7 @@ static void x86_cpu_register_types(void)
     for (i = 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
 }
 
 type_init(x86_cpu_register_types)

-- 
Eduardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]