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] [xen-3.0-testing] Extended PHYSDEVOP_irq_status_query to

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0-testing] Extended PHYSDEVOP_irq_status_query to obtain sharing status
From: Xen patchbot-3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 07 Jun 2006 19:15:24 +0000
Delivery-date: Wed, 07 Jun 2006 12:17:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 694a37bf37068610e6167564096e99984815a7be
# Parent  05f07acd3be2fac0c66ef6e9a94b129f7f7e37b5
Extended PHYSDEVOP_irq_status_query to obtain sharing status
(bound to multiple guests?).
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset:   10295:1a500cc4fcd5648ce52d782be30948ed9a3e28d9
xen-unstable date:        Wed Jun  7 15:46:05 2006 +0100
---
 xen/arch/x86/irq.c           |   22 ++++++++++++++++++++++
 xen/arch/x86/physdev.c       |    9 ++++-----
 xen/include/asm-x86/irq.h    |    3 +++
 xen/include/public/physdev.h |    2 ++
 4 files changed, 31 insertions(+), 5 deletions(-)

diff -r 05f07acd3be2 -r 694a37bf3706 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Wed Jun 07 14:24:14 2006 +0100
+++ b/xen/arch/x86/irq.c        Wed Jun 07 15:51:19 2006 +0100
@@ -376,6 +376,28 @@ int pirq_acktype(int irq)
 
     BUG();
     return 0;
+}
+
+int pirq_shared(int irq)
+{
+    unsigned int        vector;
+    irq_desc_t         *desc;
+    irq_guest_action_t *action;
+    unsigned long       flags;
+    int                 shared;
+
+    vector = irq_to_vector(irq);
+    if ( vector == 0 )
+        return 0;
+
+    desc = &irq_desc[vector];
+
+    spin_lock_irqsave(&desc->lock, flags);
+    action = (irq_guest_action_t *)desc->action;
+    shared = ((desc->status & IRQ_GUEST) && (action->nr_guests > 1));
+    spin_unlock_irqrestore(&desc->lock, flags);
+
+    return shared;
 }
 
 int pirq_guest_bind(struct vcpu *v, int irq, int will_share)
diff -r 05f07acd3be2 -r 694a37bf3706 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c    Wed Jun 07 14:24:14 2006 +0100
+++ b/xen/arch/x86/physdev.c    Wed Jun 07 15:51:19 2006 +0100
@@ -12,15 +12,12 @@
 #include <public/xen.h>
 #include <public/physdev.h>
 
-extern int
+int
 ioapic_guest_read(
     unsigned long physbase, unsigned int reg, u32 *pval);
-extern int
+int
 ioapic_guest_write(
     unsigned long physbase, unsigned int reg, u32 pval);
-extern int
-pirq_acktype(
-    int irq);
 
 /*
  * Demuxing hypercall.
@@ -48,6 +45,8 @@ long do_physdev_op(GUEST_HANDLE(physdev_
         op.u.irq_status_query.flags = 0;
         if ( pirq_acktype(irq) != 0 )
             op.u.irq_status_query.flags |= PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY;
+        if ( pirq_shared(irq) )
+            op.u.irq_status_query.flags |= PHYSDEVOP_IRQ_SHARED;
         ret = 0;
         break;
 
diff -r 05f07acd3be2 -r 694a37bf3706 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h Wed Jun 07 14:24:14 2006 +0100
+++ b/xen/include/asm-x86/irq.h Wed Jun 07 15:51:19 2006 +0100
@@ -47,4 +47,7 @@ extern atomic_t irq_err_count;
 extern atomic_t irq_err_count;
 extern atomic_t irq_mis_count;
 
+int pirq_acktype(int irq);
+int pirq_shared(int irq);
+
 #endif /* _ASM_HW_IRQ_H */
diff -r 05f07acd3be2 -r 694a37bf3706 xen/include/public/physdev.h
--- a/xen/include/public/physdev.h      Wed Jun 07 14:24:14 2006 +0100
+++ b/xen/include/public/physdev.h      Wed Jun 07 15:51:19 2006 +0100
@@ -17,6 +17,8 @@ typedef struct physdevop_irq_status_quer
     /* OUT */
 /* Need to call PHYSDEVOP_IRQ_UNMASK_NOTIFY when the IRQ has been serviced? */
 #define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY (1<<0)
+/* IRQ shared by multiple guests? */
+#define PHYSDEVOP_IRQ_SHARED              (1<<1)
     uint32_t flags;
 } physdevop_irq_status_query_t;
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.0-testing] Extended PHYSDEVOP_irq_status_query to obtain sharing status, Xen patchbot-3 . 0-testing <=