From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b32MR-0006YD-V4 for qemu-devel@nongnu.org; Wed, 18 May 2016 10:22:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b32ML-00019x-JD for qemu-devel@nongnu.org; Wed, 18 May 2016 10:22:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b32ML-00019r-DI for qemu-devel@nongnu.org; Wed, 18 May 2016 10:22:01 -0400 Message-ID: <1463581318.30045.66.camel@redhat.com> From: Gerd Hoffmann Date: Wed, 18 May 2016 16:21:58 +0200 In-Reply-To: <20160517201955.6175.97671.stgit@gimli.home> References: <20160517201613.6175.45578.stgit@gimli.home> <20160517201955.6175.97671.stgit@gimli.home> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v6 6/8] vfio/pci: Intel graphics legacy mode assignment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: qemu-devel@nongnu.org, allen.m.kay@intel.com, kvm@vger.kernel.org, "Zhao, Xinda" , Kevin Tian On Di, 2016-05-17 at 14:19 -0600, Alex Williamson wrote: > +static int igd_gen(VFIOPCIDevice *vdev) > +{ > + if ((vdev->device_id & 0xfff) =3D=3D 0xa84) { > + return 8; /* Broxton */ > + } > + > + switch (vdev->device_id & 0xff00) { > + /* Old, untested, unavailable, unknown */ > + case 0x0000: > + case 0x2500: > + case 0x2700: > + case 0x2900: > + case 0x2a00: > + case 0x2e00: > + case 0x3500: > + case 0xa000: > + return -1; > + /* SandyBridge, IvyBridge, ValleyView, Haswell */ > + case 0x0100: > + case 0x0400: > + case 0x0a00: > + case 0x0c00: > + case 0x0d00: > + case 0x0f00: > + return 6; > + /* BroadWell, CherryView, SkyLake, KabyLake */ > + case 0x1600: > + case 0x1900: > + case 0x2200: > + case 0x5900: > + return 8; > + } > + > + return 8; /* Assume newer is compatible */ > +} > + This link: https://github.com/01org/Igvtg-qemu/commit/ea32e6769004d6eb98d2dbd859d81bf1= 885c6ad2#diff-9d4d99332b83a7de33cbeed489d60448R920 happened to land in my inbox these days. It provides a bunch of functions called is_$codename() and intel_gen_version(). Looks more complete to me. Maybe we should pick up them and find a place in the qemu source tree where both vfio and intel-vgpu (and maybe xen device assignment too) can share those functions? cheers, Gerd