# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1244460204 -3600
# Node ID ca12928cdafe3fcb024520c4fe2479448f2c5f46
# Parent 329ea0ccb344c636e918cc3cd2677c24b03af5bd
pci: fix pcie-aer recovery mechanism defects.
When aer error happening, if the device is not hided or assigned,
exit. If the device is assigned yet not connected by PV guest or is
owned by HVM guest, kill the guest. [sh_info is NULL]
Signed-Off-By: Liping Ke <liping.ke@xxxxxxxxx>
Signed-Off-By: Yunhong Jiang <yunhong.jiang@xxxxxxxxx>
---
drivers/xen/pciback/pci_stub.c | 55 +++++++++++++++++++++++++++++++++++------
1 files changed, 47 insertions(+), 8 deletions(-)
diff -r 329ea0ccb344 -r ca12928cdafe drivers/xen/pciback/pci_stub.c
--- a/drivers/xen/pciback/pci_stub.c Fri Jun 05 14:01:20 2009 +0100
+++ b/drivers/xen/pciback/pci_stub.c Mon Jun 08 12:23:24 2009 +0100
@@ -629,12 +629,22 @@ static pci_ers_result_t pciback_slot_res
dev->bus->number,
PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn));
- if ( !psdev || !psdev->pdev || !psdev->pdev->sh_info )
+
+ if ( !psdev || !psdev->pdev )
{
dev_err(&dev->dev,
- "pciback device is not found/in use/connected!\n");
+ "pciback device is not found/assigned\n");
goto end;
}
+
+ if ( !psdev->pdev->sh_info )
+ {
+ dev_err(&dev->dev, "pciback device is not connected or owned"
+ " by HVM, kill it\n");
+ kill_domain_by_device(psdev);
+ goto release;
+ }
+
if ( !test_bit(_XEN_PCIB_AERHANDLER,
(unsigned long *)&psdev->pdev->sh_info->flags) ) {
dev_err(&dev->dev,
@@ -679,12 +689,22 @@ static pci_ers_result_t pciback_mmio_ena
dev->bus->number,
PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn));
- if ( !psdev || !psdev->pdev || !psdev->pdev->sh_info)
+
+ if ( !psdev || !psdev->pdev )
{
dev_err(&dev->dev,
- "pciback device is not found/in use/connected!\n");
+ "pciback device is not found/assigned\n");
goto end;
}
+
+ if ( !psdev->pdev->sh_info )
+ {
+ dev_err(&dev->dev, "pciback device is not connected or owned"
+ " by HVM, kill it\n");
+ kill_domain_by_device(psdev);
+ goto release;
+ }
+
if ( !test_bit(_XEN_PCIB_AERHANDLER,
(unsigned long *)&psdev->pdev->sh_info->flags) ) {
dev_err(&dev->dev,
@@ -729,12 +749,22 @@ static pci_ers_result_t pciback_error_de
dev->bus->number,
PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn));
- if ( !psdev || !psdev->pdev || !psdev->pdev->sh_info)
+
+ if ( !psdev || !psdev->pdev )
{
dev_err(&dev->dev,
- "pciback device is not found/in use/connected!\n");
+ "pciback device is not found/assigned\n");
goto end;
}
+
+ if ( !psdev->pdev->sh_info )
+ {
+ dev_err(&dev->dev, "pciback device is not connected or owned"
+ " by HVM, kill it\n");
+ kill_domain_by_device(psdev);
+ goto release;
+ }
+
/*Guest owns the device yet no aer handler regiested, kill guest*/
if ( !test_bit(_XEN_PCIB_AERHANDLER,
(unsigned long *)&psdev->pdev->sh_info->flags) ) {
@@ -775,11 +805,20 @@ static void pciback_error_resume(struct
dev->bus->number,
PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn));
- if ( !psdev || !psdev->pdev || !psdev->pdev->sh_info)
+
+ if ( !psdev || !psdev->pdev )
{
dev_err(&dev->dev,
- "pciback device is not found/in use/connected!\n");
+ "pciback device is not found/assigned\n");
goto end;
+ }
+
+ if ( !psdev->pdev->sh_info )
+ {
+ dev_err(&dev->dev, "pciback device is not connected or owned"
+ " by HVM, kill it\n");
+ kill_domain_by_device(psdev);
+ goto release;
}
if ( !test_bit(_XEN_PCIB_AERHANDLER,
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|