[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Issues with PCI-Passtrough (VT-d) in HVM with Xen 4.6



Issues with PCI-Passtrough (VT-d) in HVM with Xen 4.6
=====================================================

Background
----------

I am trying to passthrough an Industrial Ethernet Interface
(Hilscher GmbH CIFX 50E-DP(M/S)) on a HVM DomU running the
Xen 4.6 Hypervisor. The card is being pass-trough to the HVM
using the PCI permissive mode and VT-d is active on this platform.

The Linux driver of the card (available only with NDA) at first
sight seems to work properly (e.g. no system stability problems,
no call traces in dmesg).

Hilscher provides the libcifx, which is an user-level library
for accessing the card. libcfix uses the generic UIO interface
and some card-specific interfaces to communicate.

Issue
-----

Whenever libcifx tries perform a reset sequence initializing
the card peripherals, we get an empty / invalid result.

I digged deeper into this by adding some debug hooks into the
xen-pciback kernel module.

The card performs writes to offset 0x10 and 0x30 at card
initialization (mostly writing dwords and words).

To verify if the writes were performed successfully, I read
back the values after writing and can see that the read data
differs from the written one.

Temporary Fix
-------------

After checking the source[1] of the PCI configuration space
handling in xen-pciback, I found out that changing line 258
to read

    if (handled && !err) {

instead of:

    if (!handled && !err) {

solves the issue and I can successfully write to the interface.

I am unsure why this works and if it's the right way to do it
or possibly a Xen bug, so I would like to ask for feedback
for this.


Please let me know whenever I can supply additional logfiles or
info. I'd be happy if we can resolve whenever this is a hardware-
specific, driver-specific or Xen issue.

Thank you,
Sylwester

PS: I tried to CC Ryan Wilson and Konrad Rzeszutek Wilk, but the
E-Mail seems to be no longer active. This is where the changes
originated.

Refereces
---------
1.
https://github.com/google/kasan/blob/master/drivers/xen/xen-pciback/conf_space.c

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.