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] [PATCH 29/31] xen_destroy_irq + xen_allocate_pirq in PV non-

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 29/31] xen_destroy_irq + xen_allocate_pirq in PV non-priv mode should not make certain Xen-HYPERCALLs.
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Thu, 5 Nov 2009 16:33:37 -0500
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Thu, 05 Nov 2009 13:58:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1257456819-782-29-git-send-email-konrad.wilk@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: <1257456819-782-1-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-2-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-3-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-4-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-5-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-6-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-7-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-8-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-9-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-10-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-11-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-12-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-13-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-14-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-15-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-16-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-17-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-18-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-19-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-20-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-21-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-22-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-23-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-24-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-25-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-26-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-27-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-28-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-29-git-send-email-konrad.wilk@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The privileged domain should make these calls for the guest.
The non-privileged domain should make these calls via the pcifront
interface (patches that augment these two functions to do so
will follow).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 drivers/xen/events.c |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 40bcbde..fd55b5b 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -606,14 +606,15 @@ int xen_destroy_irq(int irq)
        if (!desc)
                goto out;
 
-       unmap_irq.pirq = info->u.pirq.nr;
-       unmap_irq.domid = info->u.pirq.domid;
-       rc = HYPERVISOR_physdev_op(PHYSDEVOP_unmap_pirq, &unmap_irq);
-       if (rc) {
-               printk(KERN_WARNING "unmap irq failed %d\n", rc);
-               goto out;
+       if (xen_initial_domain()) {
+               unmap_irq.pirq = info->u.pirq.nr;
+               unmap_irq.domid = info->u.pirq.domid;
+               rc = HYPERVISOR_physdev_op(PHYSDEVOP_unmap_pirq, &unmap_irq);
+               if (rc) {
+                       printk(KERN_WARNING "unmap irq failed %d\n", rc);
+                       goto out;
+               }
        }
-
        irq_info[irq] = mk_unbound_info();
 
        dynamic_irq_cleanup(irq);
@@ -701,17 +702,18 @@ int xen_create_msi_irq(struct pci_dev *dev, struct 
msi_desc *msidesc, int type)
        if (irq == -1)
                goto out;
 
-       rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq);
-       if (rc) {
+       if (xen_initial_domain()) {
+               rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq);
+               if (rc) {
 
-               printk(KERN_WARNING "xen map irq failed %d\n", rc);
+                       printk(KERN_WARNING "xen map irq failed %d\n", rc);
 
-               dynamic_irq_cleanup(irq);
+                       dynamic_irq_cleanup(irq);
 
-               irq = -1;
-               goto out;
+                       irq = -1;
+                       goto out;
+               }
        }
-
        irq_info[irq] = mk_pirq_info(0, map_irq.pirq, map_irq.index);
        if (domid)
                irq_info[irq].u.pirq.domid = domid;
-- 
1.6.2.5


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

<Prev in Thread] Current Thread [Next in Thread>