ia64/xen-unstable

changeset 11078:4ee64035c0a3

Add support for sending event channel interrupts to HVM guests.
Signed-off-by: Steven Smith <ssmith@xensource.com>
author kfraser@localhost.localdomain
date Thu Aug 10 11:36:27 2006 +0100 (2006-08-10)
parents 9d4fa3cf4481
children 247fc1245b21
files xen/arch/x86/hvm/svm/intr.c xen/arch/x86/hvm/vmx/io.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/intr.c	Thu Aug 10 10:55:54 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/intr.c	Thu Aug 10 11:36:27 2006 +0100
     1.3 @@ -112,6 +112,7 @@ asmlinkage void svm_intr_assist(void)
     1.4      struct hvm_domain *plat=&v->domain->arch.hvm_domain; 
     1.5      struct periodic_time *pt = &plat->pl_time.periodic_tm;
     1.6      struct hvm_virpic *pic= &plat->vpic;
     1.7 +    int callback_irq;
     1.8      int intr_type = APIC_DM_EXTINT;
     1.9      int intr_vector = -1;
    1.10      int re_injecting = 0;
    1.11 @@ -156,12 +157,22 @@ asmlinkage void svm_intr_assist(void)
    1.12        if ( v->vcpu_id == 0 )
    1.13           hvm_pic_assist(v);
    1.14  
    1.15 -      /* Before we deal with PIT interrupts, let's check
    1.16 -         for interrupts set by the device model.
    1.17 +      callback_irq = v->domain->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
    1.18 +
    1.19 +      /* Before we deal with PIT interrupts, let's check for
    1.20 +         interrupts set by the device model or paravirtualised event
    1.21 +         channel interrupts.
    1.22        */
    1.23        if ( cpu_has_pending_irq(v) ) {
    1.24             intr_vector = cpu_get_interrupt(v, &intr_type);
    1.25        }
    1.26 +      else  if ( callback_irq != 0 && local_events_need_delivery() ) {
    1.27 +          /*inject para-device call back irq*/
    1.28 +          v->vcpu_info->evtchn_upcall_mask = 1;
    1.29 +          pic_set_irq(pic, callback_irq, 0);
    1.30 +          pic_set_irq(pic, callback_irq, 1);
    1.31 +          intr_vector = callback_irq;
    1.32 +      }
    1.33        else  if ( (v->vcpu_id == 0) && pt->enabled && pt->pending_intr_nr ) {
    1.34            pic_set_irq(pic, pt->irq, 0);
    1.35            pic_set_irq(pic, pt->irq, 1);
     2.1 --- a/xen/arch/x86/hvm/vmx/io.c	Thu Aug 10 10:55:54 2006 +0100
     2.2 +++ b/xen/arch/x86/hvm/vmx/io.c	Thu Aug 10 11:36:27 2006 +0100
     2.3 @@ -142,6 +142,7 @@ asmlinkage void vmx_intr_assist(void)
     2.4      struct hvm_domain *plat=&v->domain->arch.hvm_domain;
     2.5      struct periodic_time *pt = &plat->pl_time.periodic_tm;
     2.6      struct hvm_virpic *pic= &plat->vpic;
     2.7 +    int callback_irq;
     2.8      unsigned int idtv_info_field;
     2.9      unsigned long inst_len;
    2.10      int    has_ext_irq;
    2.11 @@ -154,6 +155,15 @@ asmlinkage void vmx_intr_assist(void)
    2.12          pic_set_irq(pic, pt->irq, 1);
    2.13      }
    2.14  
    2.15 +    callback_irq = v->domain->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
    2.16 +    if ( callback_irq != 0 &&
    2.17 +         local_events_need_delivery() ) {
    2.18 +        /*inject para-device call back irq*/
    2.19 +        v->vcpu_info->evtchn_upcall_mask = 1;
    2.20 +        pic_set_irq(pic, callback_irq, 0);
    2.21 +        pic_set_irq(pic, callback_irq, 1);
    2.22 +    }
    2.23 +
    2.24      has_ext_irq = cpu_has_pending_irq(v);
    2.25  
    2.26      if (unlikely(v->arch.hvm_vmx.vector_injected)) {