|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
When we do an FLR, or D0->D3_hot we may lose the BARs as the
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
device has turned itself off (and on). This means the device cannot
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
function unless the pci_restore_state is called - which it is
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
when the PCI device is unbound from the Xen PCI backend driver.
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
For PV guests it ends up calling pci_enable_device / pci_enable_msi[x]
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
which does the proper steps
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
That however is not happening if a HVM guest is run as QEMU
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
deals with PCI configuration space. QEMU also requires that the
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
device be "parked" under the ownership of a pci-stub driver to
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
guarantee that the PCI device is not being used. Hence we
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
follow the same incantation as pci_reset_function does - by
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
doing an FLR, then restoring the PCI configuration space.
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
The result of this patch is that when you run lspci, you get
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
now this:
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
- Region 0: [virtual] Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
- Region 1: [virtual] Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
+ Region 0: Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
+ Region 1: Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
Region 2: I/O ports at c000 [size=32]
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
- Region 3: [virtual] Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
+ Region 3: Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
The [virtual] means that lspci read those entries from SysFS but when
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
it read them from the device it got a different value (0xfffffff).
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
CC: stable@vger.kernel.org # only for v3.4 and v3.5
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
---
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
drivers/xen/xen-pciback/pci_stub.c | 1 +
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
1 files changed, 1 insertions(+), 0 deletions(-)
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
index acec6fa..e5a0c13 100644
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
--- a/drivers/xen/xen-pciback/pci_stub.c
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
+++ b/drivers/xen/xen-pciback/pci_stub.c
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
@@ -362,6 +362,7 @@ static int __devinit pcistub_init_device(struct pci_dev *dev)
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
else {
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n");
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
__pci_reset_function_locked(dev);
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
+ pci_restore_state(dev);
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
}
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
/* Now disable the device (this also ensures some private device
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
* data is setup before we export)
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
--
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
1.7.7.6
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
--
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
the body of a message to majordomo@vger.kernel.org
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
More majordomo info at http://vger.kernel.org/majordomo-info.html
|
|
![](https://seccdn.libravatar.org/avatar/70cc2f818f82d9376966cb929baa882ad4848e1a2dcae81bc5eaf64ed1894721?s=16&d=retro) |
e108932 |
Please read the FAQ at http://www.tux.org/lkml/
|