All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] Xen PCI back - do slot and bus reset (v0).
@ 2013-12-13 16:09 Konrad Rzeszutek Wilk
  2013-12-13 16:09 ` [RFC PATCH 1/5] xen-pciback: Cleanup up pcistub_put_pci_dev Konrad Rzeszutek Wilk
                   ` (12 more replies)
  0 siblings, 13 replies; 40+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-12-13 16:09 UTC (permalink / raw)
  To: xen-devel, linux-kernel, gordan

Hey,

While I was trying to narrow down the state of GPU passthrough
(still not finished) and figuring what needs to be done I realized
that Xen PCIback did not reset my GPU properly (when I crashed the
Windows guest by mistake). It does an FLR reset or Power one - if
the device supports it. But it seems that some of these GPUs
are liars and actually don't do the power part properly.

One way to fix this is by doing a slot (aka device) and bus reset.
Of course to do that - you need to make sure that all of the
functions of a device are under the ownership of xen-pciback.
Otherwise you might accidently reset your sound card while it is
being used.

These RFC patches cleanup pci back a bit and also make it possible
for Xen pciback to do the whole gamma of 'reset' for PCI devices:
FLR, power management, AER, slot and bus reset if neccessary.

Thanks go to Gordan Bobic for educating me on how to "reprogram"
and GFX460 in a Quardro 4000M and also reporting oddities when
a PCI device was reset but it looked like it was not reset.


 drivers/xen/xen-pciback/pci_stub.c | 142 +++++++++++++++++++++++++++++++------
 drivers/xen/xen-pciback/xenbus.c   |   5 +-
 2 files changed, 124 insertions(+), 23 deletions(-)


Konrad Rzeszutek Wilk (5):
      xen-pciback: Cleanup up pcistub_put_pci_dev
      xen-pciback: First reset, then free.
      xen-pciback: Document when we FLR an PCI device.
      xen/pciback: Move the FLR code to a function.
      xen/pciback: PCI reset slot or bus


^ permalink raw reply	[flat|nested] 40+ messages in thread
* Re: [RFC PATCH] Xen PCI back - do slot and bus reset (v0).
@ 2014-06-04 22:15 Ruediger Otte
  0 siblings, 0 replies; 40+ messages in thread
From: Ruediger Otte @ 2014-06-04 22:15 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk, xen-devel

Hi,

this patch actually solves the problem I experienced when trying to
passthrough a Radeon 7750 to a windows guest with a custom build of
Xen 4.4.0 on Debian Wheezy.

While I was always getting dom0 lockups at the first reboot of the
guest, I'm now able to do several reboots without sending the host to
standby in between. I haven't done extensive testing yet, but gpu
passthrough seems to just work now.

However I'm now seeing a different issue at dom0 boot when the
devices are assigned to xen-pciback (in kernel, no module). After the
message "xen_pciback: backend is passthrough" the host hangs for 2-3
seconds, then reboots. Strangely sometimes the host just boots ok,
but then again I get three or more failed boots in a row before it
finally works.

Before I applied your patch I have already followed every hint and
tried every available workaround with no success so far, so I would
be glad if this code could be further improved. If there's the need I
can of course provide debug output and configuration details from my
setup.

Kind regards,
Ruediger Otte

> Hey,
> 
> While I was trying to narrow down the state of GPU passthrough
> (still not finished) and figuring what needs to be done I realized
> that Xen PCIback did not reset my GPU properly (when I crashed the
> Windows guest by mistake). It does an FLR reset or Power one - if
> the device supports it. But it seems that some of these GPUs
> are liars and actually don't do the power part properly.
> 
> One way to fix this is by doing a slot (aka device) and bus reset.
> Of course to do that - you need to make sure that all of the
> functions of a device are under the ownership of xen-pciback.
> Otherwise you might accidently reset your sound card while it is
> being used.
> 
> These RFC patches cleanup pci back a bit and also make it possible
> for Xen pciback to do the whole gamma of 'reset' for PCI devices:
> FLR, power management, AER, slot and bus reset if neccessary.
> 
> Thanks go to Gordan Bobic for educating me on how to "reprogram"
> and GFX460 in a Quardro 4000M and also reporting oddities when
> a PCI device was reset but it looked like it was not reset.
> 
> 
>  drivers/xen/xen-pciback/pci_stub.c | 142
> +++++++++++++++++++++++++++++++------
> drivers/xen/xen-pciback/xenbus.c   |   5 +- 2 files changed, 124
> insertions(+), 23 deletions(-)
> 
> 
> Konrad Rzeszutek Wilk (5):
>       xen-pciback: Cleanup up pcistub_put_pci_dev
>       xen-pciback: First reset, then free.
>       xen-pciback: Document when we FLR an PCI device.
>       xen/pciback: Move the FLR code to a function.
>       xen/pciback: PCI reset slot or bus

^ permalink raw reply	[flat|nested] 40+ messages in thread
* [RFC PATCH] Xen PCI back - do slot and bus reset (v0).
@ 2013-12-13 16:09 Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 40+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-12-13 16:09 UTC (permalink / raw)
  To: xen-devel, linux-kernel, gordan

Hey,

While I was trying to narrow down the state of GPU passthrough
(still not finished) and figuring what needs to be done I realized
that Xen PCIback did not reset my GPU properly (when I crashed the
Windows guest by mistake). It does an FLR reset or Power one - if
the device supports it. But it seems that some of these GPUs
are liars and actually don't do the power part properly.

One way to fix this is by doing a slot (aka device) and bus reset.
Of course to do that - you need to make sure that all of the
functions of a device are under the ownership of xen-pciback.
Otherwise you might accidently reset your sound card while it is
being used.

These RFC patches cleanup pci back a bit and also make it possible
for Xen pciback to do the whole gamma of 'reset' for PCI devices:
FLR, power management, AER, slot and bus reset if neccessary.

Thanks go to Gordan Bobic for educating me on how to "reprogram"
and GFX460 in a Quardro 4000M and also reporting oddities when
a PCI device was reset but it looked like it was not reset.


 drivers/xen/xen-pciback/pci_stub.c | 142 +++++++++++++++++++++++++++++++------
 drivers/xen/xen-pciback/xenbus.c   |   5 +-
 2 files changed, 124 insertions(+), 23 deletions(-)


Konrad Rzeszutek Wilk (5):
      xen-pciback: Cleanup up pcistub_put_pci_dev
      xen-pciback: First reset, then free.
      xen-pciback: Document when we FLR an PCI device.
      xen/pciback: Move the FLR code to a function.
      xen/pciback: PCI reset slot or bus

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

end of thread, other threads:[~2014-06-04 22:15 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-13 16:09 [RFC PATCH] Xen PCI back - do slot and bus reset (v0) Konrad Rzeszutek Wilk
2013-12-13 16:09 ` [RFC PATCH 1/5] xen-pciback: Cleanup up pcistub_put_pci_dev Konrad Rzeszutek Wilk
2013-12-16  9:19   ` [Xen-devel] " Jan Beulich
2013-12-16  9:19   ` Jan Beulich
2013-12-13 16:09 ` Konrad Rzeszutek Wilk
2013-12-13 16:09 ` [RFC PATCH 2/5] xen-pciback: First reset, then free Konrad Rzeszutek Wilk
2013-12-13 16:09 ` Konrad Rzeszutek Wilk
2013-12-16  9:23   ` Jan Beulich
2013-12-16  9:23   ` [Xen-devel] " Jan Beulich
2013-12-13 16:09 ` [RFC PATCH 3/5] xen-pciback: Document when we FLR an PCI device Konrad Rzeszutek Wilk
2013-12-16  9:27   ` [Xen-devel] " Jan Beulich
2013-12-16  9:27   ` Jan Beulich
2013-12-13 16:09 ` Konrad Rzeszutek Wilk
2013-12-13 16:09 ` [RFC PATCH 4/5] xen/pciback: Move the FLR code to a function Konrad Rzeszutek Wilk
2013-12-16  9:28   ` Jan Beulich
2013-12-16  9:28   ` [Xen-devel] " Jan Beulich
2013-12-13 16:09 ` Konrad Rzeszutek Wilk
2013-12-13 16:09 ` [RFC PATCH 5/5] xen/pciback: PCI reset slot or bus Konrad Rzeszutek Wilk
2013-12-13 16:18   ` Konrad Rzeszutek Wilk
2013-12-13 16:18   ` Konrad Rzeszutek Wilk
2013-12-16 11:34   ` [Xen-devel] " David Vrabel
2013-12-16 14:39     ` Konrad Rzeszutek Wilk
2013-12-16 14:39     ` Konrad Rzeszutek Wilk
2013-12-16 11:34   ` David Vrabel
2013-12-13 16:09 ` Konrad Rzeszutek Wilk
2013-12-13 16:52 ` [RFC PATCH] Xen PCI back - do slot and bus reset (v0) Gordan Bobic
2013-12-16 10:59 ` David Vrabel
2013-12-16 10:59 ` [Xen-devel] " David Vrabel
2013-12-16 14:35   ` Konrad Rzeszutek Wilk
2013-12-16 14:35   ` [Xen-devel] " Konrad Rzeszutek Wilk
2013-12-16 15:23     ` Sander Eikelenboom
2013-12-16 15:23     ` [Xen-devel] " Sander Eikelenboom
2013-12-16 15:36       ` Konrad Rzeszutek Wilk
2013-12-16 15:45         ` Sander Eikelenboom
2013-12-16 15:45         ` [Xen-devel] " Sander Eikelenboom
2013-12-16 22:51         ` Sander Eikelenboom
2013-12-16 22:51         ` [Xen-devel] " Sander Eikelenboom
2013-12-16 15:36       ` Konrad Rzeszutek Wilk
  -- strict thread matches above, loose matches on Subject: below --
2014-06-04 22:15 Ruediger Otte
2013-12-13 16:09 Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.