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][VT] Clear the pending interrupt on shared page when

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][VT] Clear the pending interrupt on shared page when PIC initialized
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Mon, 12 Sep 2005 18:10:06 +0800
Delivery-date: Mon, 12 Sep 2005 10:07:56 +0000
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcW3giY4Pz37Sj5wQp2rI7oIutSosg==
Thread-topic: [PATCH][VT] Clear the pending interrupt on shared page when PIC initialized
When PIC is initialized and the irq base changed, the pending interrupt
on shared page should be cleared.

Thanks
Yunhong Jiang

Signed-off-by: Yunhong Jiang <yunhong.jiang@xxxxxxxxx>
Signed-off-by: Asit Mallick <asit.k.mallick@xxxxxxxxx>

diff -r b187d5555866 -r 94a3235acaab tools/ioemu/hw/i8259.c
--- a/tools/ioemu/hw/i8259.c    Mon Sep 12 05:09:23 2005
+++ b/tools/ioemu/hw/i8259.c    Mon Sep 12 05:33:10 2005
@@ -127,6 +127,13 @@
 
 /* pic[1] is connected to pin2 of pic[0] */
 #define CASCADE_IRQ 2
+static void clear_shared_page()
+{
+    extern shared_iopage_t *shared_page;
+    unsigned long *intr;
+    intr = (unsigned long *) &(shared_page->sp_global.pic_intr[0]);
+    memset(intr, 0, INTR_LEN);
+}
 
 static void shared_page_update()
 {
@@ -299,6 +306,7 @@
         if (val & 0x10) {
             /* init */
             pic_reset(s);
+            clear_shared_page();
             /* deassert a pending interrupt */
             cpu_reset_interrupt(cpu_single_env, CPU_INTERRUPT_HARD);
 
diff -r b187d5555866 -r 94a3235acaab xen/arch/x86/vmx_intercept.c
--- a/xen/arch/x86/vmx_intercept.c      Mon Sep 12 05:09:23 2005
+++ b/xen/arch/x86/vmx_intercept.c      Mon Sep 12 05:33:10 2005
@@ -227,6 +227,7 @@
     u64 *intr = &(sp->sp_global.pic_intr[0]);
     struct vmx_virpit_t *vpit =
&(d->domain->arch.vmx_platform.vmx_pit);
     int rw_mode, reinit = 0;
+    int oldvec = 0;
 
     /* load init count*/
     if (p->state == STATE_IORESP_HOOK) { 
@@ -235,6 +236,7 @@
             VMX_DBG_LOG(DBG_LEVEL_1, "VMX_PIT: guest reset PIT with
channel %lx!\n", (unsigned long) ((p->u.data >> 24) & 0x3) );
             rem_ac_timer(&(vpit->pit_timer));
             reinit = 1;
+            oldvec = vpit->vector;
         }
         else
             init_ac_timer(&vpit->pit_timer, pit_timer_fn, vpit,
d->processor);
@@ -250,6 +252,12 @@
             vpit->period = 1000000;
         }
         vpit->vector = ((p->u.data >> 16) & 0xFF);
+
+        if( reinit && oldvec != vpit->vector){
+            clear_bit(oldvec, intr);
+            vpit->pending_intr_nr = 0;
+        }
+
         vpit->channel = ((p->u.data >> 24) & 0x3);
         vpit->first_injected = 0;
 

Attachment: irqbase.diff
Description: irqbase.diff

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>