xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Q77 IGD instantly crashes on xen-pciback bind.
@ 2014-11-21 20:57 Dr. Greg Wettstein
  2014-11-23 14:26 ` Pasi Kärkkäinen
  0 siblings, 1 reply; 15+ messages in thread
From: Dr. Greg Wettstein @ 2014-11-21 20:57 UTC (permalink / raw)
  To: xen-devel

Hi, hope the week is ending well for everyone.

As readers of the list may remember we've kept the ATI primary adapter
passthrough patches current for qemu-traditional on Xen for a number
of years.  Our 'run-passthrough' utility for binding/unbind devices
and running a Windows guest with passthrough have enjoyed a tidy
number of downloads through the years as well.

We are taking on a passthrough project and in the process upgrading
our infrastructure to 4.4.x.  We also need to take on the issue of
passing Intel IGD adapters through to a windows guest.  We are
currently working on an Intel Q77 (DQ77KB) board in preparation for
moving to Q87 boards.

The Intel display adapter is showing up as the standard 00:02.0 PCI
device and things go south pretty quickly.  We create a slot for the
device on the pciback driver and as soon as we bind the device the
machine goes out like a light, no logs or diagnostics, just instantly
stone dead.

This issue is invariant over pciback in vpci or passthrough modes.  It
also occurs instantly when the pciback assignment is made with 'xl
pci-assignable-add'.

We will throw a '#define DEBUG 1' in the top of all the xen-pciback
driver code and see if we can get more information out of it.  I just
wanted to get this in front of the list in case this is a well known
issue or we are headed into other problems we should know about.

I'm assuming that qemu-traditional will handle an IGD primary
passthrough.  If any of the Intel guys are reading this give me a
shout with some directions/advice if we need to roll up our sleeves
and modify the device emulator.

At least it is an "Outlaw Josey Whales bug', not hard to track, leaves
dead machines wherever it goes... :-)

Best wishes for a pleasant weekend to everyone.

Greg

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: greg@enjellic.com
------------------------------------------------------------------------------
"The cynics are right nine times out of ten."
                                -- H. L. Mencken

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Q77 IGD instantly crashes on xen-pciback bind.
@ 2014-11-24  9:59 Dr. Greg Wettstein
  2014-11-24 11:28 ` Pasi Kärkkäinen
  0 siblings, 1 reply; 15+ messages in thread
From: Dr. Greg Wettstein @ 2014-11-24  9:59 UTC (permalink / raw)
  To: Pasi Kärkkäinen; +Cc: xen-devel

On Nov 23,  4:26pm, Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= wrote:
} Subject: Re: [Xen-devel] Q77 IGD instantly crashes on xen-pciback bind.

Hi Pasi, hope your week is starting out well, hi to Konrad from Oracle
as well as I see you included him.

> On Fri, Nov 21, 2014 at 02:57:14PM -0600, Dr. Greg Wettstein wrote:
> > Hi, hope the week is ending well for everyone.
> > 
> > As readers of the list may remember we've kept the ATI primary adapter
> > passthrough patches current for qemu-traditional on Xen for a number
> > of years.  Our 'run-passthrough' utility for binding/unbind devices
> > and running a Windows guest with passthrough have enjoyed a tidy
> > number of downloads through the years as well.
> > 
> > We are taking on a passthrough project and in the process upgrading
> > our infrastructure to 4.4.x.  We also need to take on the issue of
> > passing Intel IGD adapters through to a windows guest.  We are
> > currently working on an Intel Q77 (DQ77KB) board in preparation for
> > moving to Q87 boards.
> > 
> > The Intel display adapter is showing up as the standard 00:02.0 PCI
> > device and things go south pretty quickly.  We create a slot for the
> > device on the pciback driver and as soon as we bind the device the
> > machine goes out like a light, no logs or diagnostics, just instantly
> > stone dead.

I'm consolidating your comment from your other response as well so we
keep this on the same thread.

>> 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.

> 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.

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.c
since 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.

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.

I will turn up debugging in pci_stub and see if I can pinpoint where
things blow up, somewhere in pcistub_init_device() I would imagine.

> Thanks,
> 
> -- Pasi

Have a good day.

}-- 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: greg@enjellic.com
------------------------------------------------------------------------------
"Snow removal teaches all the important elements of succesful corporate
 politics:  1.) Be the first one to work.  2.) Always signal your
 intentions before moving.  3.) Be damn sure you're driving something
 big enough to deal with anything that decides not to get out of your way."
                                -- Dr. G.W. Wettstein
                                   Guerrilla Tactics for Corporate Survival

^ permalink raw reply	[flat|nested] 15+ messages in thread
[parent not found: <pasik@iki.fi>]
* Re: Q77 IGD instantly crashes on xen-pciback bind.
@ 2014-11-29  2:00 Dr. Greg Wettstein
  2014-11-29 11:09 ` Pasi Kärkkäinen
  2014-12-01 21:35 ` Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 15+ messages in thread
From: Dr. Greg Wettstein @ 2014-11-29  2:00 UTC (permalink / raw)
  To: Sander Eikelenboom; +Cc: greg, xen-devel

On Nov 27, 12:11pm, Sander Eikelenboom wrote:
} Subject: Re: [Xen-devel] Q77 IGD instantly crashes on xen-pciback bind.

Hi, hope the week has gone well for everyone.

> > 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).

Thanks for taking the time for respond and forward along the patch.

I back ported the do_flr patch into the 3.14.x kernel and spent some
time working with it.  I thought it might be useful to others to
document what we ran into.

First of all the issue with the unsuccessful boot of Windows after the
first invocation doesn't appear to have anything to do with resetting
the card.  This was fixed by installing the most recent version of the
Intel HD drivers in the Windows guest.

If IGD passthrough is done without the HD drivers Windows 7 appears to
use its standard VGA driver which seems to be able to initialize and
run the IGD device but does not appear to shutdown the device in a
manner in which it can be re-started.  After the first invocation of
the guest is shutdown the screen goes to a solid color.  Subsequent
invocations result in the flashing multi-color screens which others
have documented.

With the HD drivers installed IGD passthrough works fine through
multiple invocations of a guest with the stock xen-pciback in 3.14.x.
We ran 40-50 repetitive Windows guest invocations and every one was
completely deterministic.

That being said we ran into an issue which we wanted to bounce off the
list in the context of this thread.

One of the things we were not able to do was to successfuly re-start
the IGD display for dom0.  After spending a lot of time going through
Konrad's reset code it appears the IGD devices in the Q77 and Q87
chipset implementations we are looking at are not advertising reset
functions which can be used.

It appears that the IGD devices are advertising that they need a
Device Specific Initialization (DSI) sequence in order to be enabled
or powered up, if we interpret the output of lscpi properly, ie:

---------------------------------------------------------------------------
00:02.0 VGA compatible controller: Intel Corporation Device 0152 (rev 09) (prog-if 00 [VGA controller])
        Subsystem: Intel Corporation Device 2036
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 11
        Region 0: Memory at f7800000 (64-bit, non-prefetchable) [size=4M]
        Region 2: Memory at e0000000 (64-bit, prefetchable) [size=256M]
        Region 4: I/O ports at f000 [size=64]
        Expansion ROM at <unassigned> [disabled]
        Capabilities: [90] MSI: Mask- 64bit- Count=1/1 Enable-
                Address: 00000000  Data: 0000
        Capabilities: [d0] Power Management version 2
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [a4] PCIe advanced features <?>
---------------------------------------------------------------------------

The ATI adapters which we have a lot of passthrough experience with
are FLR capable and can be re-enabled after passthrough by writing a
'1' to the enable pseudo-file in the /sys/bus/pci/devices/BDF
directory.  The IGD adapters seem to fail to respond to a request to
be re-enabled.

We would certainly be interested in any suggestions the collective may
have with respect to how to get the adapter turned back on and/or
implement a reset.

> Sander

Have a good weekend.

Greg

}-- End of excerpt from Sander Eikelenboom

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: greg@enjellic.com
------------------------------------------------------------------------------
"Laugh now but you won't be laughing when we find you laying on the
 side of the road dead."
                                -- Betty Wettstein
                                   At the Lake

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Q77 IGD instantly crashes on xen-pciback bind.
@ 2014-12-02  7:54 Dr. Greg Wettstein
  0 siblings, 0 replies; 15+ messages in thread
From: Dr. Greg Wettstein @ 2014-12-02  7:54 UTC (permalink / raw)
  To: Pasi Kärkkäinen; +Cc: Sander Eikelenboom, xen-devel

On Nov 29,  1:09pm, Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= wrote:
} Subject: Re: [Xen-devel] Q77 IGD instantly crashes on xen-pciback bind.

Good morning Pasi, thanks for taking the time to follow up.

> > > > 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).
> > 
> > Thanks for taking the time for respond and forward along the patch.
> > 
> > I back ported the do_flr patch into the 3.14.x kernel and spent some
> > time working with it.  I thought it might be useful to others to
> > document what we ran into.
> > 
> > First of all the issue with the unsuccessful boot of Windows after the
> > first invocation doesn't appear to have anything to do with resetting
> > the card.  This was fixed by installing the most recent version of the
> > Intel HD drivers in the Windows guest.
> > 
> > If IGD passthrough is done without the HD drivers Windows 7 appears to
> > use its standard VGA driver which seems to be able to initialize and
> > run the IGD device but does not appear to shutdown the device in a
> > manner in which it can be re-started.  After the first invocation of
> > the guest is shutdown the screen goes to a solid color.  Subsequent
> > invocations result in the flashing multi-color screens which others
> > have documented.
> > 
> > With the HD drivers installed IGD passthrough works fine through
> > multiple invocations of a guest with the stock xen-pciback in 3.14.x.
> > We ran 40-50 repetitive Windows guest invocations and every one was
> > completely deterministic.

> It would be nice if you could let us know the exact Intel IGD
> Windows driver version that worked well for you? It might be a good
> reference for others aswell.

I just fired up a pass-through session to check on this.  The driver
version and date are as follows:

	Driver Date:		09/26/2014
	Driver Version:		10.18.10.29458

They were the most current version of the driver available on Intel's
website as of a week ago.

As soon as we sort out the details on whether or not we can get the
IGD device re-started we will put a patch up on our FTP server with
the changes needed to implement both ATI and IGD passthrough on 4.4.1
as a resource to the community.

> Thanks,
>  
> -- Pasi

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: greg@enjellic.com
------------------------------------------------------------------------------
"In the future, company names will be a 32-character hex string."
                                -- Bruce Schneier

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-12-02  7:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <greg@wind.enjellic.com>
2012-11-17 15:17 ` Does xen-4.2.0 support VGA passthrough with the virtual machine created by xl command? Dr. Greg Wettstein
2012-11-28 21:04   ` Konrad Rzeszutek Wilk
2014-11-21 21:02 ` Q77 IGD instantly crashes on xen-pciback bind Dr. Greg Wettstein
2014-11-23 14:05   ` Pasi Kärkkäinen
2014-11-23 14:23     ` Pasi Kärkkäinen
2014-11-21 20:57 Dr. Greg Wettstein
2014-11-23 14:26 ` Pasi Kärkkäinen
  -- strict thread matches above, loose matches on Subject: below --
2014-11-24  9:59 Dr. Greg Wettstein
2014-11-24 11:28 ` Pasi Kärkkäinen
     [not found] <pasik@iki.fi>
2014-11-27 10:23 ` Dr. Greg Wettstein
2014-11-27 11:11   ` Sander Eikelenboom
2014-11-29  2:00 Dr. Greg Wettstein
2014-11-29 11:09 ` Pasi Kärkkäinen
2014-12-01 21:35 ` Konrad Rzeszutek Wilk
2014-12-02  7:54 Dr. Greg Wettstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).