qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves wh


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used
Date: Tue, 19 Nov 2013 11:50:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 18/11/2013 20:53, Peter Lieven ha scritto:
> The essential part is -enable-kvm -smp 2,sockets=1,cores=2,threads=1 -cpu 
> host.
> I believe the corect fix could be to disabled the cache leave forwarding as 
> soon
> as the user specifies his own socket/core/thread layout.

Please test this:

diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
index 6502488..170fd70 100644
--- a/include/sysemu/cpus.h
+++ b/include/sysemu/cpus.h
@@ -17,6 +17,7 @@ void qtest_clock_warp(int64_t dest);
 /* vl.c */
 extern int smp_cores;
 extern int smp_threads;
+extern bool smp_manual_topology;
 #else
 /* *-user doesn't have configurable SMP topology */
 #define smp_cores   1
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 864c80e..49b5d45 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1149,7 +1149,7 @@ static void kvm_cpu_fill_host(x86_def_t *x86_cpu_def)
     assert(kvm_enabled());
 
     x86_cpu_def->name = "host";
-    x86_cpu_def->cache_info_passthrough = true;
+    x86_cpu_def->cache_info_passthrough = !smp_manual_topology;
     host_cpuid(0x0, 0, &eax, &ebx, &ecx, &edx);
     x86_cpu_vendor_words2str(x86_cpu_def->vendor, ebx, edx, ecx);
 
diff --git a/vl.c b/vl.c
index 4ad15b8..f319976 100644
--- a/vl.c
+++ b/vl.c
@@ -207,6 +207,7 @@ CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES];
 CharDriverState *sclp_hds[MAX_SCLP_CONSOLES];
 int win2k_install_hack = 0;
 int singlestep = 0;
+bool smp_manual_topology = false;
 int smp_cpus = 1;
 int max_cpus = 0;
 int smp_cores = 1;
@@ -1391,6 +1392,8 @@ static void smp_parse(QemuOpts *opts)
         unsigned cores   = qemu_opt_get_number(opts, "cores", 0);
         unsigned threads = qemu_opt_get_number(opts, "threads", 0);
 
+        smp_manual_topology = sockets || threads || cores;
+
         /* compute missing values, prefer sockets over cores over threads */
         if (cpus == 0 || sockets == 0) {
             sockets = sockets > 0 ? sockets : 1;




reply via email to

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