Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Peter Lieven
On 18.11.2013 17:11, Paolo Bonzini wrote: Il 18/11/2013 16:37, Peter Lieven ha scritto: If I specify: -smp 2,sockets=1,cores=2,threads=1 to a Windows 2012 R2 Server it crashes at boot time. -smp 2 works. for Linux /proc/cpuinfo reveals no cpu layout information (sibliings, cores, threads

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Paolo Bonzini
Il 19/11/2013 11:25, Peter Lieven ha scritto: ~/git/qemu$ x86_64-softmmu/qemu-system-x86_64 -m 2048 -drive if=virtio,file=iscsi://172.21.200.45/iqn.2001-05.com.equallogic:0-8a0906-9d95c510a-344001d54795289f-2012-r2-1-7-0/0,format=raw,cache=writeback,aio=native -smp

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Paolo Bonzini
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

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Peter Lieven
On 19.11.2013 11:47, Paolo Bonzini wrote: Il 19/11/2013 11:25, Peter Lieven ha scritto: ~/git/qemu$ x86_64-softmmu/qemu-system-x86_64 -m 2048 -drive

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Peter Lieven
next question: is cache leaf forwarding a migration blocker?

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Paolo Bonzini
Il 19/11/2013 12:35, Peter Lieven ha scritto: next question: is cache leaf forwarding a migration blocker? -cpu host in general is interesting at migration time, so I would say no. Paolo

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Peter Lieven
On 19.11.2013 12:37, Paolo Bonzini wrote: Il 19/11/2013 12:35, Peter Lieven ha scritto: next question: is cache leaf forwarding a migration blocker? -cpu host in general is interesting at migration time, so I would say no. It works for for a long time as long as all cpu features that are

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Peter Lieven
On 19.11.2013 11:47, Paolo Bonzini wrote: Il 19/11/2013 11:25, Peter Lieven ha scritto: ~/git/qemu$ x86_64-softmmu/qemu-system-x86_64 -m 2048 -drive

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Peter Lieven
On 19.11.2013 13:03, Peter Lieven wrote: On 19.11.2013 11:47, Paolo Bonzini wrote: Il 19/11/2013 11:25, Peter Lieven ha scritto: ~/git/qemu$ x86_64-softmmu/qemu-system-x86_64 -m 2048 -drive

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Paolo Bonzini
Il 19/11/2013 13:03, Peter Lieven ha scritto: Can you test which of these two work? But I agree it's best to disable cache-leaf forwarding. The first does make windows boot again and it calculates a correct combination of cpus, threads, cores and sockets. But I think the reason it boots is

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Peter Lieven
On 19.11.2013 13:14, Paolo Bonzini wrote: Il 19/11/2013 13:03, Peter Lieven ha scritto: Can you test which of these two work? But I agree it's best to disable cache-leaf forwarding. The first does make windows boot again and it calculates a correct combination of cpus, threads, cores and

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Paolo Bonzini
Il 19/11/2013 13:32, Peter Lieven ha scritto: + +/* We give out APIC IDs ourselves, so force bits 31..26 even for -cpu host. */ +if (cs-nr_cores 1) { +*eax |= (cs-nr_cores - 1) 26; } break; case 5: I already tried exactly this

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Peter Lieven
On 19.11.2013 14:21, Paolo Bonzini wrote: Il 19/11/2013 13:32, Peter Lieven ha scritto: + +/* We give out APIC IDs ourselves, so force bits 31..26 even for -cpu host. */ +if (cs-nr_cores 1) { +*eax |= (cs-nr_cores - 1) 26; } break;

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Paolo Bonzini
Il 19/11/2013 15:11, Peter Lieven ha scritto: I already tried exactly this fix. Its reading index 0x004 for increasing indexes until qemu aborts: Oops, it should be I guess if ((*eax 31) cs-nr_cores 1). Maybe, how should we continue. This should be fixed before 1.7 comes out. If this

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Peter Lieven
On 19.11.2013 15:14, Paolo Bonzini wrote: if ((*eax 31) cs-nr_cores 1) at which position exactly do you want to put this condition and take which action? Peter

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Paolo Bonzini
Il 19/11/2013 15:17, Peter Lieven ha scritto: if ((*eax 31) cs-nr_cores 1) at which position exactly do you want to put this condition and take which action? Just replace if (cs-nr_cores 1) in the patch I posted, i.e. after the switch. Paolo -- 8 - From

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Peter Lieven
On 19.11.2013 15:19, Paolo Bonzini wrote: Il 19/11/2013 15:17, Peter Lieven ha scritto: if ((*eax 31) cs-nr_cores 1) at which position exactly do you want to put this condition and take which action? Just replace if (cs-nr_cores 1) in the patch I posted, i.e. after the switch. This

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Paolo Bonzini
Il 19/11/2013 15:46, Peter Lieven ha scritto: Just replace if (cs-nr_cores 1) in the patch I posted, i.e. after the switch. This seems to work. What is in bits 0..5 of eax? It's the kind of cache. 0 means that there is no cache and the returned data is not valid. In theory, Intel says you

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Peter Lieven
On 19.11.2013 15:57, Paolo Bonzini wrote: Il 19/11/2013 15:46, Peter Lieven ha scritto: Just replace if (cs-nr_cores 1) in the patch I posted, i.e. after the switch. This seems to work. What is in bits 0..5 of eax? It's the kind of cache. 0 means that there is no cache and the returned data

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-19 Thread Paolo Bonzini
Il 19/11/2013 16:05, Peter Lieven ha scritto: What about the number of threads in count == 2? That's a property of the L2 cache. It's not related to APIC IDs. okay, but the contents could be wrong if the physical system has threads while the emulated vserver has not. does this matter? If

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-18 Thread Peter Lieven
I do not know, but this patch might introduce a regression. If I specify: -smp 2,sockets=1,cores=2,threads=1 to a Windows 2012 R2 Server it crashes at boot time. -smp 2 works. git bisect start # good: [62ecc3a0e3c77a4944c92a02dd7fae2ab1f2290d] Update VERSION for 1.6.1 release git bisect good

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-18 Thread Peter Lieven
On 18.11.2013 16:23, Peter Lieven wrote: I do not know, but this patch might introduce a regression. If I specify: -smp 2,sockets=1,cores=2,threads=1 to a Windows 2012 R2 Server it crashes at boot time. -smp 2 works. for Linux /proc/cpuinfo reveals no cpu layout information (sibliings, cores,

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-18 Thread Paolo Bonzini
Il 18/11/2013 16:37, Peter Lieven ha scritto: If I specify: -smp 2,sockets=1,cores=2,threads=1 to a Windows 2012 R2 Server it crashes at boot time. -smp 2 works. for Linux /proc/cpuinfo reveals no cpu layout information (sibliings, cores, threads etc.) with this patch applied and a manual

Re: [Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-11-18 Thread Peter Lieven
Am 18.11.2013 17:11, schrieb Paolo Bonzini: Il 18/11/2013 16:37, Peter Lieven ha scritto: If I specify: -smp 2,sockets=1,cores=2,threads=1 to a Windows 2012 R2 Server it crashes at boot time. -smp 2 works. for Linux /proc/cpuinfo reveals no cpu layout information (sibliings, cores, threads

[Qemu-devel] [PULL 11/13] target-i386: forward CPUID cache leaves when -cpu host is used

2013-09-20 Thread Paolo Bonzini
From: Benoît Canet ben...@irqsave.net Some users running cpu intensive tasks checking the cache CPUID leaves at startup and making decisions based on the result reported that the guest was not reflecting the host CPUID leaves when -cpu host is used. This patch fix this. Signed-off-by: Benoît