ia64/xen-unstable

changeset 12662:251630d85510

[IA64] Update PV-on-HVM to follow status of interrupt controller

Follow-on to xen-unstable cangeset:
http://xenbits.xensource.com/xen-unstable.hg?cs=fe5ed694b0c2

- Follow to change a method of interrupt handling in latest
changeset.
- Modify to change the spec of callback IRQ in hypervisor side.
- Modify to follow status of interrupt mask register of virtual
interupt controller.
- Modify to deliver interupts to a CPU specified with virtual
interrupt controller.

http://lists.xensource.com/archives/html/xen-ia64-devel/2006-11/msg00159.html

Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
Signed-off-by: Kouya SHIMURA <kouya@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Thu Nov 30 15:57:20 2006 -0700 (2006-11-30)
parents 52e6bf6dc744
children 4fae646d60da
files xen/arch/ia64/vmx/vlsapic.c xen/arch/ia64/vmx/vmx_process.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vlsapic.c	Thu Nov 30 15:57:15 2006 -0700
     1.2 +++ b/xen/arch/ia64/vmx/vlsapic.c	Thu Nov 30 15:57:20 2006 -0700
     1.3 @@ -103,8 +103,10 @@ static int vmx_vcpu_unpend_interrupt(VCP
     1.4      ret = test_and_clear_bit(vector, &VCPU(vcpu, irr[0]));
     1.5      local_irq_restore(spsr);
     1.6  
     1.7 -    if (ret)
     1.8 +    if (ret) {
     1.9          vcpu->arch.irq_new_pending = 1;
    1.10 +        wmb();
    1.11 +    }
    1.12  
    1.13      return ret;
    1.14  }
    1.15 @@ -488,8 +490,10 @@ int vmx_vcpu_pend_interrupt(VCPU *vcpu, 
    1.16      ret = test_and_set_bit(vector, &VCPU(vcpu, irr[0]));
    1.17      local_irq_restore(spsr);
    1.18  
    1.19 -    if (!ret)
    1.20 +    if (!ret) {
    1.21          vcpu->arch.irq_new_pending = 1;
    1.22 +        wmb();
    1.23 +    }
    1.24  
    1.25      return ret;
    1.26  }
    1.27 @@ -511,6 +515,7 @@ void vmx_vcpu_pend_batch_interrupt(VCPU 
    1.28      }
    1.29      local_irq_restore(spsr);
    1.30      vcpu->arch.irq_new_pending = 1;
    1.31 +    wmb();
    1.32  }
    1.33  
    1.34  /*
    1.35 @@ -572,6 +577,7 @@ void guest_write_eoi(VCPU *vcpu)
    1.36      VLSAPIC_INSVC(vcpu,vec>>6) &= ~(1UL <<(vec&63));
    1.37      VCPU(vcpu, eoi)=0;    // overwrite the data
    1.38      vcpu->arch.irq_new_pending=1;
    1.39 +    wmb();
    1.40  }
    1.41  
    1.42  int is_unmasked_irq(VCPU *vcpu)
     2.1 --- a/xen/arch/ia64/vmx/vmx_process.c	Thu Nov 30 15:57:15 2006 -0700
     2.2 +++ b/xen/arch/ia64/vmx/vmx_process.c	Thu Nov 30 15:57:20 2006 -0700
     2.3 @@ -225,15 +225,15 @@ void leave_hypervisor_tail(struct pt_reg
     2.4          if (v->vcpu_id == 0) {
     2.5              int callback_irq =
     2.6                  d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
     2.7 -            if (callback_irq != 0 && local_events_need_delivery()) {
     2.8 -                /*inject para-device call back irq*/
     2.9 -                v->vcpu_info->evtchn_upcall_mask = 1;
    2.10 -                vmx_vcpu_pend_interrupt(v, callback_irq);
    2.11 +            if (callback_irq != 0) {
    2.12 +                /* change level for para-device callback irq */
    2.13 +                vmx_vioapic_set_irq(d, callback_irq,
    2.14 +                                    local_events_need_delivery());
    2.15              }
    2.16          }
    2.17  
    2.18 -        if ( v->arch.irq_new_pending ) {
    2.19 -            v->arch.irq_new_pending = 0;
    2.20 +        rmb();
    2.21 +        if (xchg(&v->arch.irq_new_pending, 0)) {
    2.22              v->arch.irq_new_condition = 0;
    2.23              vmx_check_pending_irq(v);
    2.24              return;