From: David TECHER Subject: Xen VGA PassThrough NVIDIA: include pci-stub case for changeset 25240 Date: Sat, 28 Apr 2012 13:07:06 +0100 (BST) Message-ID: <1335614826.76812.YahooMailNeo@web29805.mail.ird.yahoo.com> Reply-To: David TECHER Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6223901398864008297==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "xen-devel@lists.xen.org" , "xen-users@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============6223901398864008297== Content-Type: multipart/alternative; boundary="62747910-54864027-1335614826=:76812" --62747910-54864027-1335614826=:76812 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi,=0A=0AFor concerned persons like me that compil Xen with PassThrough NVI= DIA, modifications introduced for changeset 25240 are limited (for the mome= nt) for pciback.=0A=0AI am used to biding device using pci-stub (device : V= ideo Card).=0A=0ACommenting out modifications introduced for this changeset= is not a good choice (I approve!). This is the only fix I found - since I = am not a Xen expert - to be able to use NVIDIA patches for revision >=3D 25= 240=0A=0AMay it be possible to include case for devices with pci-stub usage= ?=0A=0A-=0A667 /* 668 static int libxl_pcidev_assignable(libxl_ctx *ctx, li= bxl_device_pci *pcidev) 669 { 670 libxl_device_pci *pcidevs; 671 in= t num, i; 672 673 pcidevs =3D libxl_device_pci_list_assignable(ctx, &n= um); 674 for (i =3D 0; i < num; i++) { 675 if (pcidevs[i].domai= n =3D=3D pcidev->domain && 676 pcidevs[i].bus =3D=3D pcidev->bu= s && 677 pcidevs[i].dev =3D=3D pcidev->dev && 678 p= cidevs[i].func =3D=3D pcidev->func) 679 { 680 return 1;= 681 } 682 } 683 return 0; 684 } 685 */ 686 int libxl__devi= ce_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, int sta= rting) 687 { 688 libxl_ctx *ctx =3D libxl__gc_owner(gc); 689 unsign= ed int orig_vdev, pfunc_mask; 690 libxl_device_pci *assigned; 691 i= nt num_assigned, i, rc; 692 int stubdomid =3D 0; 693 694 rc =3D li= bxl__device_pci_setdefault(gc, pcidev); 695 if (rc) goto out; 696 697 = /* if (!libxl_pcidev_assignable(ctx, pcidev)) { 698 LIBXL__LOG(ctx, LIBX= L__LOG_ERROR, "PCI device %x:%x:%x.%x is not assignable", 699 = pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func); 700 = rc =3D ERROR_FAIL; 701 goto out; 702 } 703 */=0A--Kind regards= =0A --62747910-54864027-1335614826=:76812 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hi,
For concerned persons like me that compil Xen with PassThrough= NVIDIA, modifications introduced for changeset 25240 are limited (for the = moment) for pciback.

I am used to biding device us= ing pci-stub (device : Video Card).

=0A
Commenting = out modifications introduced for this changeset is not a good choice (I app= rove!). This is the only fix I found - since I am not a Xen expert - to be = able to use NVIDIA patches for revision >=3D 25240

May it b= e possible to include case for devices with pci-stub usage?

<= div>-
 667 /*=0A 668 static int libxl_pcidev_assignable(libxl_ctx=
 *ctx, libxl_device_pci *pcidev)=0A 669 {=0A 670     libxl_device_pci *pcid=
evs;=0A 671     int num, i;=0A 672 =0A 673     pcidevs =3D libxl_device_pci=
_list_assignable(ctx, &num);=0A 674     for (i =3D 0; i < num; i++) =
{=0A 675         if (pcidevs[i].domain =3D=3D pcidev->domain &&=
=0A 676             pcidevs[i].bus =3D=3D pcidev->bus &&=0A 677 =
            pcidevs[i].dev =3D=3D pcidev->dev &&=0A 678         =
    pcidevs[i].func =3D=3D pcidev->func)=0A 679         {=0A 680        =
     return 1;=0A 681         }=0A 682     }=0A 683     return 0;=0A 684 }=
=0A 685 */=0A 686 int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, =
libxl_device_pci *pcidev, int starting)=0A 687 {=0A 688     libxl_ctx *ctx =
=3D libxl__gc_owner(gc);=0A 689     unsigned int orig_vdev, pfunc_mask;=0A =
690     libxl_device_pci *assigned;=0A 691     int num_assigned, i, rc;=0A =
692     int stubdomid =3D 0;=0A 693 =0A 694     rc =3D libxl__device_pci_se=
tdefault(gc, pcidev);=0A 695     if (rc) goto out;=0A 696 =0A 697 /*    if =
(!libxl_pcidev_assignable(ctx, pcidev)) {=0A 698         LIBXL__LOG(ctx, LI=
BXL__LOG_ERROR, "PCI device %x:%x:%x.%x is not assignable",=0A 699         =
           pcidev->domain, pcidev->bus, pcidev->dev, pcidev->fu=
nc);=0A 700         rc =3D ERROR_FAIL;=0A 701         goto out;=0A 702     =
}=0A 703 */
--Kind regards
--62747910-54864027-1335614826=:76812-- --===============6223901398864008297== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============6223901398864008297==--