From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Viit0-0000o0-IC for qemu-devel@nongnu.org; Tue, 19 Nov 2013 05:50:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Viisu-0003Vu-Er for qemu-devel@nongnu.org; Tue, 19 Nov 2013 05:50:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Viisu-0003Vo-6O for qemu-devel@nongnu.org; Tue, 19 Nov 2013 05:50:20 -0500 Message-ID: <528B4262.9050409@redhat.com> Date: Tue, 19 Nov 2013 11:50:10 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1379694292-1601-1-git-send-email-pbonzini@redhat.com> <1379694292-1601-12-git-send-email-pbonzini@redhat.com> <528A310A.60607@dlhnet.de> <528A3422.1030701@kamp.de> <528A3C4A.4090001@redhat.com> <528A701D.8020002@kamp.de> In-Reply-To: <528A701D.8020002@kamp.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: qemu-devel@nongnu.org, =?ISO-8859-15?Q?Beno=EEt_Canet?= 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;