Q77 IGD instantly crashes on xen-pciback bind.
Quoted 1 line · On Nov 24, 1:28pm, Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= wrote:
Hello,
Hi, hope the week is going well for everyone.
Quoted 23 lines
Quoted 15 lines
Quoted 8 lines
Quoted 3 lines
As I was walking out the door I remembered I had been delinquent with information. The dom0 kernel is 32-bit 3.14.22 straight from kernel.org under a 64-bit hypervisor compiled from 4.4.1 sources.
Wow, quite an old thread :)
So you're still seeing the same problem with recent Xen/Linux versions..
Yes, the perils of platforming for 7 year field deployments... :-)
I can certainly build up a toolchain against the HEAD of XEN git and the most recent release of the kernel if everyone feels that would be beneficial.
Quoted 7 lines
Quoted 3 lines
This might be a stupid question, but here goes anyway: Do you have serial console set up? And all the debug/verbose options specified for Xen and Linux?
The platform in question doesn't have any serial ports, at least not surfaced. We will need to do a bit of wiring if we need to go in that direction.
Quoted 6 lines
You mentioned it's Intel Q77 chipset based motherboard.. which means it should have Intel AMT functionality, which provides SOL (Serial-over-LAN), which you can use as a serial console for Xen.
There are tools (at least amtterm) that you can use on another box to connect to the AMT SOL remotely..
So we wired up serial console connectivity to the test box and repeated the VGA device binding with loglvl=all. We lost the box immediately without anything being written to the logs.
So we went hunting.
Interestingly the problem appears to be secondary to a BIOS configuration option. This may be specific to this platform but we wanted to get it documented in the thread in case anyone else runs into this.
The DQ77KB BIOS we are using has an option for 'IGD flat panel display'. The default option is LVDS, setting this to 'disabled' clears the problem.
I haven't run down where things go wrong in pci_stub but I assume it does something to the hardware which causes a problem when the video controller is reset and then shutdown.
Quoted 16 lines
Quoted 9 lines
Now that I have the machine in a harness in the lab I will stick a '#define DEBUG 1' in the top of
drivers/xen/xen-pciback/pci_stub.csince that is where the action seems to be going on.The platform is headed for a measured computing environment so I thought there may be some type of conflict with tboot holding a reference to the VGA driver but I verified the issue in a straight hypervisor boot.
Quoted 6 lines
I see that Tiejun Chen from Intel is sorting out issues with respect to the need to export the ISA bridge into the device emulator in order to support passthrough on these IGD devices. I bound the 00:1f.0 ISA bridge device to pciback and that worked but it did not change the behavior of the regression. When the 00:02.0 device is bound to pciback the display is cleared and the machine dies in its tracks.
Quoted 6 lines
Yeah, Tiejun is working on upstreaming the IGD passthru patches to Qemu-upstream.
Qemu-dm-traditional already has (most of) the IGD passthru patches.
Hope that helps,
So we are obviously working with qemu-dm-traditional and with the IGD/LVDS BIOS configuration issue fixed the adapater passthrough is working and Windows7 is coming up and detecting the IGD as a standard VGA display adapter. Additional invocations of the VM after the first one result in failed passthrough with a garbled display.
I spent an afternoon wandering through the mailing lists and found what I think are the two patches which are needed to map the 00:1f.0 ISA bridge device into the guest. From the discussions surrounding those patches it appears as if the Windows HD driver needs addresses managed by that bridge to recognize the IGD device.
I will get those patches wired into qemu-dm-traditional and tested in between whisky, wine, turkey and napping today.... :-)
I'm hoping that this positively impacts the ability to execute multiple sessions. I will report back the results so we have all of this in the mailing list record.
Quoted 1 line
-- Pasi
Thanks for offering the pointers, have a good day.
Greg
}-- End of excerpt from Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?=
As always,
Dr. G.W. Wettstein, Ph.D. Enjellic Systems Development, LLC. 4206 N. 19th Ave. Specializing in information infra-structure Fargo, ND 58102 development.
PH: 701-281-1686
FAX: 701-281-3949 EMAIL: [email protected]
------------------------------------------------------------------------------
"Immortality is an adequate definition of high availability for me."
-- Gregory F. Pfister
Quoted 76 lines · you
Quoted 1 line · On Nov 24, 1:28pm, Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= wrote:
Hello,
Hi, hope the week is going well for everyone.
Quoted 23 lines
Quoted 15 lines
Quoted 8 lines
Quoted 3 lines
As I was walking out the door I remembered I had been delinquent with information. The dom0 kernel is 32-bit 3.14.22 straight from kernel.org under a 64-bit hypervisor compiled from 4.4.1 sources.
Wow, quite an old thread :)
So you're still seeing the same problem with recent Xen/Linux versions..
Yes, the perils of platforming for 7 year field deployments... :-)
I can certainly build up a toolchain against the HEAD of XEN git and the most recent release of the kernel if everyone feels that would be beneficial.
Quoted 7 lines
Quoted 3 lines
This might be a stupid question, but here goes anyway: Do you have serial console set up? And all the debug/verbose options specified for Xen and Linux?
The platform in question doesn't have any serial ports, at least not surfaced. We will need to do a bit of wiring if we need to go in that direction.
Quoted 6 lines
You mentioned it's Intel Q77 chipset based motherboard.. which means it should have Intel AMT functionality, which provides SOL (Serial-over-LAN), which you can use as a serial console for Xen.
There are tools (at least amtterm) that you can use on another box to connect to the AMT SOL remotely..
So we wired up serial console connectivity to the test box and repeated the VGA device binding with loglvl=all. We lost the box immediately without anything being written to the logs.
So we went hunting.
Interestingly the problem appears to be secondary to a BIOS configuration option. This may be specific to this platform but we wanted to get it documented in the thread in case anyone else runs into this.
The DQ77KB BIOS we are using has an option for 'IGD flat panel display'. The default option is LVDS, setting this to 'disabled' clears the problem.
I haven't run down where things go wrong in
pci_stubbut I assume it does something to the hardware which causes a problem when the video controller is reset and then shutdown.Quoted 21 lines
Quoted 9 lines
Now that I have the machine in a harness in the lab I will stick a '#define DEBUG 1' in the top of
drivers/xen/xen-pciback/pci_stub.csince that is where the action seems to be going on.The platform is headed for a measured computing environment so I thought there may be some type of conflict with tboot holding a reference to the VGA driver but I verified the issue in a straight hypervisor boot.
Quoted 6 lines
I see that Tiejun Chen from Intel is sorting out issues with respect to the need to export the ISA bridge into the device emulator in order to support passthrough on these IGD devices. I bound the 00:1f.0 ISA bridge device to pciback and that worked but it did not change the behavior of the regression. When the 00:02.0 device is bound to pciback the display is cleared and the machine dies in its tracks.
Yeah, Tiejun is working on upstreaming the IGD passthru patches to Qemu-upstream.
Qemu-dm-traditional already has (most of) the IGD passthru patches.
Quoted 7 lines
Quoted 1 line
Hope that helps,
So we are obviously working with qemu-dm-traditional and with the IGD/LVDS BIOS configuration issue fixed the adapater passthrough is working and Windows7 is coming up and detecting the IGD as a standard VGA display adapter. Additional invocations of the VM after the first one result in failed passthrough with a garbled display.
This is probably due to the current lack of slot/bus reset in xen-pciback, Konrad has a preliminary kernel patch for xen-pciback that does this. I have attached the patch, though it has some rough edges in the design :-)
I'm currently running with his 3.19 xen-pciback patches series + the preliminary patch for slot/bus reset and rebooting a guest with vga/pci passthrough now works. (i'm running with a radeon card, passed through as a secondary card to the emulated qemu one, in a linux guest using qemu-xen, so i can't help you with your other questions and problems).
--
Sander
Quoted 22 lines
I spent an afternoon wandering through the mailing lists and found what I think are the two patches which are needed to map the 00:1f.0 ISA bridge device into the guest. From the discussions surrounding those patches it appears as if the Windows HD driver needs addresses managed by that bridge to recognize the IGD device.
I will get those patches wired into qemu-dm-traditional and tested in between whisky, wine, turkey and napping today.... :-)
I'm hoping that this positively impacts the ability to execute multiple sessions. I will report back the results so we have all of this in the mailing list record.
Quoted 1 line
-- Pasi
Thanks for offering the pointers, have a good day.
Greg
}-- End of excerpt from Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?=
As always,
Quoted 8 lines
Dr. G.W. Wettstein, Ph.D. Enjellic Systems Development, LLC. 4206 N. 19th Ave. Specializing in information infra-structure Fargo, ND 58102 development.PH: 701-281-1686
FAX: 701-281-3949 EMAIL: [email protected]
------------------------------------------------------------------------------
"Immortality is an adequate definition of high availability for me."
-- Gregory F. Pfister
From fa262362d924da9f63b0739c470bd1a67c36bfae Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <[email protected]>
Date: Tue, 8 Jul 2014 11:22:45 -0400
Subject: [PATCH] xen/pciback: Implement PCI reset slot or bus with 'do_flr'
SysFS attribute
The life-cycle of a PCI device in Xen pciback is complex and is constrained by the PCI generic locking mechanism.
It starts with the device being binded to us - for which we do a device function reset (and done via SysFS so the PCI lock is held)
If the device is unbinded from us - we also do a function reset (also done via SysFS so the PCI lock is held).
If the device is un-assigned from a guest - we do a function reset (no PCI lock).
All on the individual PCI function level (so bus:device:function).
Unfortunatly a function reset is not adequate for certain PCIe devices. The reset for an individual PCI function "means device must support FLR (PCIe or AF), PM reset on D3hot->D0 device specific reset, or be a singleton device on a bus a secondary bus reset. FLR does not have widespread support, reset is not very reliable, and bus topology is dictated by the and device design. We need to provide a means for a user to a bus reset in cases where the existing mechanisms are not
or not reliable. " (Adam Williamson, 'vfio-pci: PCI hot reset
interface' commit 8b27ee60bfd6bbb84d2df28fa706c5c5081066ca).
As such to do a slot or a bus reset is we need another mechanism. This is not exposed SysFS as there is no good way of exposing a bus topology there.
This is due to the complexity - we MUST know that the different functions off a PCIe device are not in use by other drivers, or if they are in use (say one of them is assigned to a guest and the other is idle) - it is still OK to reset the slot (assuming both of them are owned by Xen pciback).
This patch does that by doing an slot or bus reset (if slot not supported) if all of the functions of a PCIe device belong to Xen PCIback. We do not care if the device is in-use as we depend on the toolstack to be aware of this - however if it is we will WARN the user.
Due to the complexity with the PCI lock we cannot do
the reset when a device is binded ('echo $BDF > bind') or when unbinded ('echo $BDF > unbind') as the pci_[slot|bus]_reset also take the same lock resulting in a dead-lock.
Putting the reset function in a workqueue or thread won't work either - as we have to do the reset function outside the 'unbind' context (it holds the PCI lock). But once you 'unbind' a device the device is no longer under the ownership of Xen pciback and the pci_set_drvdata has been reset so we cannot use a thread for this.
Instead of doing all this complex dance, we depend on the toolstack doing the right thing. As such implement the 'do_flr' SysFS attribute which 'xl' uses when a device is detached or attached from/to a guest. It bypasses the need to worry about the PCI lock.
To not inadvertly do a bus reset that would affect devices that are in use by other drivers (other than Xen pciback) prior to the reset we check that all of the devices under the bridge are owned by Xen pciback. If they are not we do not do the bus (or slot) reset.
We also warn the user if the device is in use - but still continue with the reset. This should not happen as the toolstack also does the check.
--- Documentation/ABI/testing/sysfs-driver-pciback | 12 +++ drivers/xen/xen-pciback/pci_stub.c | 139 ++++++++++++++++++++----- 2 files changed, 124 insertions(+), 27 deletions(-)
Documentation/ABI/testing/sysfs-driver-pciback +12 -0
@@ -11,3 +11,15 @@ Description: #echo 00:19.0-E0:2:FF > /sys/bus/pci/drivers/pciback/quirks will allow the guest to read and write to the configuration register 0x0E. + + +What: /sys/bus/pci/drivers/pciback/do_flr +Date: December 2014 +KernelVersion: 3.19 +Contact: [email protected] +Description: + An option to slot or bus reset an PCI device owned by + Xen PCI backend. Writing a string of DDDD:BB:DD.F will cause + the driver to perform an slot or bus reset if the device + supports. It also checks to make sure that all of the devices + under the bridge are owned by Xen PCI backend.
drivers/xen/xen-pciback/pci_stub.c +112 -27
184 lines not on this page · raw message
Signature · 1 line
1.9.3
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel