Mailing List Archive

[PATCH 13 of 14 V3] libxl: bind virtual bdf to physical bdf after device assignment
# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326213620 -3600
# Node ID 9e89b6485b6c91a8d563c46c47a8d768eee7d1f2
# Parent 2dc60e3398dd602a34ebdf92103a3957b97c02c5
libxl: bind virtual bdf to physical bdf after device assignment

Signed-off-by: Wei Wang <wei.wang2@amd.com>

diff -r 2dc60e3398dd -r 9e89b6485b6c tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c Tue Jan 10 17:40:17 2012 +0100
+++ b/tools/libxl/libxl_pci.c Tue Jan 10 17:40:20 2012 +0100
@@ -735,6 +735,13 @@ out:
LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc, "xc_assign_device failed");
return ERROR_FAIL;
}
+ if (LIBXL__DOMAIN_IS_TYPE(gc, domid, HVM)) {
+ rc = xc_domain_bind_pt_bdf(ctx->xch, domid, 0, pcidev->vdevfn, pcidev->domain, pcidev_encode_bdf(pcidev));
+ if ( rc ) {
+ LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc, "xc_domain_bind_pt_bdf failed");
+ return ERROR_FAIL;
+ }
+ }
}

if (!starting)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: [PATCH 13 of 14 V3] libxl: bind virtual bdf to physical bdf after device assignment [ In reply to ]
Wei Wang writes ("[PATCH 13 of 14 V3] libxl: bind virtual bdf to physical bdf after device assignment"):
> libxl: bind virtual bdf to physical bdf after device assignment

I confess I don't understand at all why this is needed.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: [PATCH 13 of 14 V3] libxl: bind virtual bdf to physical bdf after device assignment [ In reply to ]
On Tuesday 10 January 2012 18:13:35 Ian Jackson wrote:
> Wei Wang writes ("[PATCH 13 of 14 V3] libxl: bind virtual bdf to physical
bdf after device assignment"):
> > libxl: bind virtual bdf to physical bdf after device assignment
>
> I confess I don't understand at all why this is needed.
>
> Ian.

Oh, the idea of this hypercall is used to allow hypervisor to trace the
virtual bdf of a physical bdf. IOMMU emulator reads iommu ppr log from host
buffer and dispatch them into guest log buffer. In the host log entry,
physical bdf is written by iommu and needs to be changed to virtual bdf when
write back to a guest. It might also be done if we could extend the interface
of xc_assign_device?

Thanks,
Wei




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel