From patchwork Thu Feb 16 01:31:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gonglei (Arei)" X-Patchwork-Id: 9576185 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8240260244 for ; Thu, 16 Feb 2017 01:33:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 746341FF26 for ; Thu, 16 Feb 2017 01:33:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 688FD28591; Thu, 16 Feb 2017 01:33:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B30302857E for ; Thu, 16 Feb 2017 01:33:35 +0000 (UTC) Received: from localhost ([::1]:43829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceAww-0000Is-T0 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 15 Feb 2017 20:33:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceAwh-0000In-9D for qemu-devel@nongnu.org; Wed, 15 Feb 2017 20:33:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ceAwd-0003ej-5b for qemu-devel@nongnu.org; Wed, 15 Feb 2017 20:33:19 -0500 Received: from [45.249.212.189] (port=2394 helo=dggrg03-dlp.huawei.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1ceAwb-0003cU-R6 for qemu-devel@nongnu.org; Wed, 15 Feb 2017 20:33:15 -0500 Received: from 172.30.72.57 (EHLO DGGEMA403-HUB.china.huawei.com) ([172.30.72.57]) by dggrg03-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AIO50832; Thu, 16 Feb 2017 09:32:32 +0800 (CST) Received: from DGGEMA505-MBX.china.huawei.com ([169.254.1.109]) by DGGEMA403-HUB.china.huawei.com ([10.3.20.44]) with mapi id 14.03.0301.000; Thu, 16 Feb 2017 09:31:40 +0800 From: "Gonglei (Arei)" To: Vadim Rozenfeld , Paolo Bonzini Thread-Topic: [Qemu-devel] [Help] Windows2012 as Guest 64+cores on KVM Halts Thread-Index: AQHSgs7ffG6y5eQiZU6k+XRBxZYINaFh85ww//+rdACAAfiQoNgiJXSDp+B4dwCABKlk4A== Date: Thu, 16 Feb 2017 01:31:40 +0000 Message-ID: <33183CC9F5247A488A2544077AF19020DA1BD1CA@DGGEMA505-MBX.china.huawei.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> In-Reply-To: <1486980300.17184.28.camel@redhat.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.177.18.62] MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.58A50130.0242, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=169.254.1.109, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 28ac4de32d81911adb87e30f92180cbc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 45.249.212.189 Subject: Re: [Qemu-devel] [Help] Windows2012 as Guest 64+cores on KVM Halts X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hangaohuai , Yan Vugenfirer , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" , Radim Krcmar Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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-windows/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. > 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 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;