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]x86: fix unmaskable msi assignment issue

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH]x86: fix unmaskable msi assignment issue
From: "Zhang, Xiantao" <xiantao.zhang@xxxxxxxxx>
Date: Tue, 12 Jan 2010 23:08:47 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Tue, 12 Jan 2010 07:09:11 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcqTmSPuE1G62Sr7T1GpoYuoNd+tBA==
Thread-topic: [PATCH]x86: fix unmaskable msi assignment issue
x86: fix unmaskable msi assignment issue.
 
Currently, unmasked msi irq's EOI write is deferred untile guest writes EOI, so
needs to keep eoi_vector unchanged before guest writes EOI. However, irq 
migration
breaks the assumption and changs eoi_vector when interrupts are generated 
through
new vector. 
 
The patch removes the dependency for eoi_vector and directly recoreds the irq 
info
in the EOI stack, and when guest writes EOI, just do the physical EOI for the 
specific irq(recorded in EOI stack)on the cpus according to the cpu_eoi_map.
 
Signed-off-by: Xiantao Zhang <xiantao.zhang@xxxxxxxxx>
 

diff -r 596f7893b5ac xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c Sat Jan 09 08:14:44 2010 +0000
+++ b/xen/arch/x86/irq.c Tue Jan 12 22:04:00 2010 +0800
@@ -740,7 +740,6 @@ typedef struct {
 #define ACKTYPE_UNMASK 1     /* Unmask PIC hardware (from any CPU)   */
 #define ACKTYPE_EOI    2     /* EOI on the CPU that was interrupted  */
     cpumask_t cpu_eoi_map;   /* CPUs that need to EOI this interrupt */
-    u8 eoi_vector;           /* vector awaiting the EOI*/
     struct domain *guest[IRQ_MAX_GUESTS];
 } irq_guest_action_t;
 
@@ -749,8 +748,9 @@ typedef struct {
  * order, as only the current highest-priority pending irq can be EOIed.
  */
 struct pending_eoi {
-    u8 vector; /* vector awaiting EOI */
-    u8 ready;  /* Ready for EOI now?  */
+    u32 ready:1;  /* Ready for EOI now?  */
+    u32 irq:23;   /* irq of the vector */
+    u32 vector:8; /* vector awaiting EOI */
 };
 
 static DEFINE_PER_CPU(struct pending_eoi, pending_eoi[NR_VECTORS]);
@@ -817,11 +817,11 @@ static void __do_IRQ_guest(int irq)
         sp = pending_eoi_sp(peoi);
         ASSERT((sp == 0) || (peoi[sp-1].vector < vector));
         ASSERT(sp < (NR_VECTORS-1));
+        peoi[sp].irq = irq;
         peoi[sp].vector = vector;
         peoi[sp].ready = 0;
         pending_eoi_sp(peoi) = sp+1;
         cpu_set(smp_processor_id(), action->cpu_eoi_map);
-        action->eoi_vector = vector;
     }
 
     for ( i = 0; i < action->nr_guests; i++ )
@@ -913,7 +913,7 @@ static void flush_ready_eoi(void)
 
     while ( (--sp >= 0) && peoi[sp].ready )
     {
-        irq = __get_cpu_var(vector_irq[peoi[sp].vector]);
+        irq = peoi[sp].irq;
         ASSERT(irq > 0);
         desc = irq_to_desc(irq);
         spin_lock(&desc->lock);
@@ -941,7 +941,7 @@ static void __set_eoi_ready(struct irq_d
 
     do {
         ASSERT(sp > 0);
-    } while ( peoi[--sp].vector != action->eoi_vector );
+    } while ( peoi[--sp].irq != irq );
     ASSERT(!peoi[sp].ready);
     peoi[sp].ready = 1;
 }

Attachment: fix-unmask-msi-assignment-issue.patch
Description: fix-unmask-msi-assignment-issue.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH]x86: fix unmaskable msi assignment issue, Zhang, Xiantao <=