From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vadim Rozenfeld Subject: Re: [Qemu-devel] [Help] Windows2012 as Guest 64+cores on KVM Halts Date: Thu, 16 Feb 2017 17:26:32 +1100 Message-ID: <1487226392.17184.50.camel@redhat.com> References: <589C099A.9090605@huawei.com> <33183CC9F5247A488A2544077AF19020DA1B4379@DGGEMA505-MBX.china.huawei.com> <105e5774-38c3-0683-ca08-64f6ed53c643@redhat.com> <33183CC9F5247A488A2544077AF19020DA1B6988@DGGEMA505-MBX.china.huawei.com> <2127602137.20489688.1486827559449.JavaMail.zimbra@redhat.com> <1486980300.17184.28.camel@redhat.com> <33183CC9F5247A488A2544077AF19020DA1BD1CA@DGGEMA505-MBX.china.huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Cc: Hangaohuai , Yan Vugenfirer , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" , Radim Krcmar To: "Gonglei (Arei)" , Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51390 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751529AbdBPG0l (ORCPT ); Thu, 16 Feb 2017 01:26:41 -0500 In-Reply-To: <33183CC9F5247A488A2544077AF19020DA1BD1CA@DGGEMA505-MBX.china.huawei.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 2017-02-16 at 01:31 +0000, Gonglei (Arei) wrote: > Hi, > > > > > > > On Sat, 2017-02-11 at 10:39 -0500, Paolo Bonzini wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 10/02/2017 10:31, Gonglei (Arei) wrote: > > > > > > > > > > > > > > > > > > But We tested the same cases on Xen platform and VMware, > > > > > > and > > > > > > the guest booted successfully. > > > > > > > > > > Were these two also tested with enlightenments enabled?  TCG > > > > > surely isn't. > > > > > > > > About TCG, I just remove ' accel=kvm,' and 'hy_releaxed' from > > > > the > > > > below QEMU > > > > Command line, I thought the hyper-V enabled then. Sorry about > > > > that. > > > > > > > > But for Xen, we set 'viridian=1' which be thought the Hyper-V > > > > is > > > > enabled. > > > > > > > > For VMWare we also enabled the Hyper-V enlightenments. > > If I'm not mistaken, even Hyper-V server doesn't allow specify more > > than 64 vCPUs for Generation 1 VMs. > > Normally yes, but I found the explanation from Microsoft document > about it: > > Maximum Supported Virtual Processors > > On Windows operating systems versions through Windows Server 2008 > R2,  > reporting the HV#1 hypervisor interface limits the Windows virtual > machine  > to a maximum of 64 VPs, regardless of what is reported via > CPUID.40000005.EAX. > Starting with Windows Server 2012 and Windows 8, if > CPUID.40000005.EAX  > contains a value of -1, Windows assumes that the hypervisor imposes > no specific > limit to the number of VPs. In this case, Windows Server 2012 guest > VMs may > use more than 64 VPs, up to the maximum supported number of > processors  > applicable to the specific Windows version being used. > > Link: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-wind > ows/reference/tlfs > > "Requirements for Implementing the Microsoft Hypervisor Interface" > > And the below patch works for me, I can support max 255 vcpus for > WS2012 > with hyper-v enlightenments. > > diff --git a/target/i386/kvm.c b/target/i386/kvm.c > index 27fd050..efe3cbc 100644 > --- a/target/i386/kvm.c > +++ b/target/i386/kvm.c > @@ -772,7 +772,7 @@ int kvm_arch_init_vcpu(CPUState *cs) > >          c = &cpuid_data.entries[cpuid_i++]; >          c->function = HYPERV_CPUID_IMPLEMENT_LIMITS; > -        c->eax = 0x40; > +        c->eax = -1; >          c->ebx = 0x40; > >          kvm_base = KVM_CPUID_SIGNATURE_NEXT; > Nice. I tried the following patch some time ago. Unfortunately it didn't work for me for some reason: @@ -772,8 +773,9 @@ int kvm_arch_init_vcpu(CPUState *cs)            c = &cpuid_data.entries[cpuid_i++];          c->function = HYPERV_CPUID_IMPLEMENT_LIMITS; -        c->eax = 0x40; -        c->ebx = 0x40; +        c->eax = 0x000000f0;//0x40; +        c->ebx = 0x00000200;//0x40; +        c->ecx = 0x00000648; I used the same numbers as provided by WS2016 for both Gen1 and Gen2 VMs. > > > > > > > > In any case, if you are only interested in hv_relaxed, you can drop > > it > > off for WS2012 as long as you have cpu hypervisor flag > > (CPUID.1:ECX [bit 31]=1) turned on. > > > hy_relaxed is just a example of enabling hyperv-v enlightenments. > > Thanks, > -Gonglei