WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] pci: fix pcie-aer recovery mechanism

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] pci: fix pcie-aer recovery mechanism defects.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 08 Jun 2009 08:00:06 -0700
Delivery-date: Mon, 08 Jun 2009 08:00:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] pci: fix pcie-aer recovery mechanism defects., Xen patchbot-linux-2.6.18-xen <=