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

[Xen-devel] RE: [PATCH][RFC] Support S3 for MSI interrupt in latest kern

To: Jan Beulich <jbeulich@xxxxxxxxxx>
Subject: [Xen-devel] RE: [PATCH][RFC] Support S3 for MSI interrupt in latest kernel dom0
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Fri, 19 Dec 2008 18:10:18 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Fri, 19 Dec 2008 02:11:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <494A0ACB.76E4.0078.0@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4949294A.76E4.0078.0@xxxxxxxxxx> <C56ED104.2057C%keir.fraser@xxxxxxxxxxxxx> <E2263E4A5B2284449EEBD0AAB751098401C4BBA925@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <494A0ACB.76E4.0078.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aclg4uBDkQYlZf4+TUuhYbKWJ1YZ6gA3nTLg
Thread-topic: [PATCH][RFC] Support S3 for MSI interrupt in latest kernel dom0
Attached is the patch with a new hypercall added. Jan/Keir, can you please have 
a look on it? I didn't change the dom0 since it has already implemented 
save/restore logic with dom0's internal data structure. But latest kernel will 
need this.

Because this patch is based in current xen, the pcidevs_lock is still used as 
rw_lock, the below small patch will change that to spin_lock if needed.

Thanks
Yunhong Jiang

diff -r a020395f3ea3 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c        Fri Dec 19 18:01:38 2008 +0800
+++ b/xen/arch/x86/msi.c        Fri Dec 19 18:02:31 2008 +0800
@@ -748,7 +748,7 @@ int pci_restore_msi_state(struct pci_dev
     struct msi_desc *entry, *tmp;
     irq_desc_t *desc;
 
-    ASSERT(rw_is_locked(&pcidevs_lock));
+    ASSERT(spin_is_locked(&pcidevs_lock));
 
     if (!pdev)
         return -EINVAL;
diff -r a020395f3ea3 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c    Fri Dec 19 18:01:38 2008 +0800
+++ b/xen/arch/x86/physdev.c    Fri Dec 19 18:02:57 2008 +0800
@@ -429,17 +429,17 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
 
         ret = -ENODEV;
 
-        read_lock(&pcidevs_lock);
+        spin_lock(&pcidevs_lock);
         pdev = pci_get_pdev(restore_msi.bus, restore_msi.devfn);
         if (!pdev)
         {
-            read_unlock(&pcidevs_lock);
+            spin_unlock(&pcidevs_lock);
             break;
         }
 
         ret = pci_restore_msi_state(pdev);
 
-        read_unlock(&pcidevs_lock);
+        spin_unlock(&pcidevs_lock);
         break;
     }
     default:


Thanks
Yunhong Jiang


Jan Beulich <mailto:jbeulich@xxxxxxxxxx> wrote:
>>>> "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx> 18.12.08 03:24 >>>
>> As for guest side, I assume it will be not complex (Jan may have more
>> estimate), 
> 
> No, it wouldn't be difficult (mostly replacing the map-pirq hypercall with
> whatever the new name would be.
> 
>> but we are not sure if the new hypercall is acceptable for Suse.
> 
> I don't see a problem with this.
> 
> Jan

Attachment: msi_s3_restore.patch
Description: msi_s3_restore.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel