[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Add support for sending event channel interrupts to HVM guests.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 4ee64035c0a3def8034ac3ed89b954eb985246a4
# Parent  9d4fa3cf4481af4fe850170e1c09d55ad7e1a8b7
Add support for sending event channel interrupts to HVM guests.
Signed-off-by: Steven Smith <ssmith@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/svm/intr.c |   15 +++++++++++++--
 xen/arch/x86/hvm/vmx/io.c   |   10 ++++++++++
 2 files changed, 23 insertions(+), 2 deletions(-)

diff -r 9d4fa3cf4481 -r 4ee64035c0a3 xen/arch/x86/hvm/svm/intr.c
--- a/xen/arch/x86/hvm/svm/intr.c       Thu Aug 10 10:55:54 2006 +0100
+++ b/xen/arch/x86/hvm/svm/intr.c       Thu Aug 10 11:36:27 2006 +0100
@@ -112,6 +112,7 @@ asmlinkage void svm_intr_assist(void)
     struct hvm_domain *plat=&v->domain->arch.hvm_domain; 
     struct periodic_time *pt = &plat->pl_time.periodic_tm;
     struct hvm_virpic *pic= &plat->vpic;
+    int callback_irq;
     int intr_type = APIC_DM_EXTINT;
     int intr_vector = -1;
     int re_injecting = 0;
@@ -156,11 +157,21 @@ asmlinkage void svm_intr_assist(void)
       if ( v->vcpu_id == 0 )
          hvm_pic_assist(v);
 
-      /* Before we deal with PIT interrupts, let's check
-         for interrupts set by the device model.
+      callback_irq = v->domain->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
+
+      /* Before we deal with PIT interrupts, let's check for
+         interrupts set by the device model or paravirtualised event
+         channel interrupts.
       */
       if ( cpu_has_pending_irq(v) ) {
            intr_vector = cpu_get_interrupt(v, &intr_type);
+      }
+      else  if ( callback_irq != 0 && local_events_need_delivery() ) {
+          /*inject para-device call back irq*/
+          v->vcpu_info->evtchn_upcall_mask = 1;
+          pic_set_irq(pic, callback_irq, 0);
+          pic_set_irq(pic, callback_irq, 1);
+          intr_vector = callback_irq;
       }
       else  if ( (v->vcpu_id == 0) && pt->enabled && pt->pending_intr_nr ) {
           pic_set_irq(pic, pt->irq, 0);
diff -r 9d4fa3cf4481 -r 4ee64035c0a3 xen/arch/x86/hvm/vmx/io.c
--- a/xen/arch/x86/hvm/vmx/io.c Thu Aug 10 10:55:54 2006 +0100
+++ b/xen/arch/x86/hvm/vmx/io.c Thu Aug 10 11:36:27 2006 +0100
@@ -142,6 +142,7 @@ asmlinkage void vmx_intr_assist(void)
     struct hvm_domain *plat=&v->domain->arch.hvm_domain;
     struct periodic_time *pt = &plat->pl_time.periodic_tm;
     struct hvm_virpic *pic= &plat->vpic;
+    int callback_irq;
     unsigned int idtv_info_field;
     unsigned long inst_len;
     int    has_ext_irq;
@@ -152,6 +153,15 @@ asmlinkage void vmx_intr_assist(void)
     if ( (v->vcpu_id == 0) && pt->enabled && pt->pending_intr_nr ) {
         pic_set_irq(pic, pt->irq, 0);
         pic_set_irq(pic, pt->irq, 1);
+    }
+
+    callback_irq = v->domain->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
+    if ( callback_irq != 0 &&
+         local_events_need_delivery() ) {
+        /*inject para-device call back irq*/
+        v->vcpu_info->evtchn_upcall_mask = 1;
+        pic_set_irq(pic, callback_irq, 0);
+        pic_set_irq(pic, callback_irq, 1);
     }
 
     has_ext_irq = cpu_has_pending_irq(v);

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.