From owner-freebsd-virtualization@freebsd.org Tue Jan 10 09:39:49 2017 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3264CCA6CF1 for ; Tue, 10 Jan 2017 09:39:49 +0000 (UTC) (envelope-from misc-freebsd@talk2dom.com) Received: from mail.shmtech.biz (mail.shmtech.biz [IPv6:2001:41c9:1:37::e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B30EF1584 for ; Tue, 10 Jan 2017 09:39:48 +0000 (UTC) (envelope-from misc-freebsd@talk2dom.com) Received: from [10.0.1.100] (originc9729.pndsl.co.uk [84.92.225.78]) (authenticated bits=0) by mail.shmtech.biz (8.15.2/8.15.2) with ESMTPSA id v0A9diGV089583 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 10 Jan 2017 09:39:44 GMT (envelope-from misc-freebsd@talk2dom.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=talk2dom.com; s=shmtech4; t=1484041184; x=1484645984; bh=uo1NIAFWHbhLaFpyMURCeev6rC7n4WR4lSaAhRvagOg=; h=Subject:To:References:From:Date:In-Reply-To; b=Twa3HT1WAL25IBgzG9CjnF3zlue/uhpWG/reOLTnRGPopfEFpiEzN5cf4ssIb5IL6 0mvDn+YVDGCqmt8iOjWN5C2rjsnnsKGXb5DEKzI3H7iZR+/vQ90cJ1djDCchrY0iAp 6GKT2+6P78xGiIx925rxa46CyH/GHeEKQJreb6HU= X-Authentication-Warning: sendmail: Host originc9729.pndsl.co.uk [84.92.225.78] claimed to be [10.0.1.100] Subject: Re: Issues with GTX960 on CentOS7 using bhyve PCI passthru (FreeBSD 11-RC2) To: soralx@cydem.org, freebsd-virtualization@freebsd.org References: <20170110003332.7cf8ba15@mscad14> <0de7e0fe-5680-b1be-bd57-6bf446c2fd38@talk2dom.com> From: Dom Message-ID: <0c927784-3e3f-7946-fba9-c25001f4156c@talk2dom.com> Date: Tue, 10 Jan 2017 09:39:43 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <0de7e0fe-5680-b1be-bd57-6bf446c2fd38@talk2dom.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 09:39:49 -0000 Found my original attempt by modifying /usr/src/sys/amd64/vmm/x86.c Unified diff follows, but this didn't work for me. ("bhyve_id[]" commented out to prevent compiler complaints) There doesn't seem to be support for CPUID 0x40000001 in bhyve either. --- x86.c.orig 2016-09-11 14:40:22.410462000 +0100 +++ x86.c 2016-09-11 15:53:14.182186000 +0100 @@ -52,7 +52,7 @@ #define CPUID_VM_HIGH 0x40000000 -static const char bhyve_id[12] = "bhyve bhyve "; +/* static const char bhyve_id[12] = "bhyve bhyve "; */ static uint64_t bhyve_xcpuids; SYSCTL_ULONG(_hw_vmm, OID_AUTO, bhyve_xcpuids, CTLFLAG_RW, &bhyve_xcpuids, 0, @@ -236,7 +236,7 @@ regs[2] &= ~(CPUID2_VMX | CPUID2_EST | CPUID2_TM2); regs[2] &= ~(CPUID2_SMX); - regs[2] |= CPUID2_HV; + /* regs[2] |= CPUID2_HV; */ if (x2apic_state != X2APIC_DISABLED) regs[2] |= CPUID2_X2APIC; @@ -463,12 +463,15 @@ } break; + /* + * Don't expose KVM to guest case 0x40000000: regs[0] = CPUID_VM_HIGH; bcopy(bhyve_id, ®s[1], 4); bcopy(bhyve_id + 4, ®s[2], 4); bcopy(bhyve_id + 8, ®s[3], 4); break; + */ default: /*