ia64/xen-unstable

changeset 3890:afd4d93e8891

bitkeeper revision 1.1230.2.6 (421b018aJlWpumpfgzBVkwUkc9P8Hg)

Remove unnecessary irq enable/disable and flag test from do_upcall().
Signed-off-by: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
author kaf24@scramble.cl.cam.ac.uk
date Tue Feb 22 09:55:22 2005 +0000 (2005-02-22)
parents 6184c07ee434
children ff8c9a2be5f7
files linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c
line diff
     1.1 --- a/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c	Tue Feb 22 09:40:06 2005 +0000
     1.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c	Tue Feb 22 09:55:22 2005 +0000
     1.3 @@ -63,7 +63,7 @@ static int irq_to_evtchn[NR_IRQS];
     1.4  DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]);
     1.5  
     1.6  /* evtchn <-> IPI mapping. */
     1.7 -#ifndef NR_IPIS    // XXX SMH: temp fix for 2.4 
     1.8 +#ifndef NR_IPIS
     1.9  #define NR_IPIS 1 
    1.10  #endif
    1.11  DEFINE_PER_CPU(int, ipi_to_evtchn[NR_IPIS]);
    1.12 @@ -99,46 +99,36 @@ void force_evtchn_callback(void)
    1.13      (void)HYPERVISOR_xen_version(0);
    1.14  }
    1.15  
    1.16 +/* NB. Interrupts are disabled on entry. */
    1.17  asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
    1.18  {
    1.19      unsigned long  l1, l2;
    1.20      unsigned int   l1i, l2i, port;
    1.21      int            irq;
    1.22 -    unsigned long  flags;
    1.23      shared_info_t *s = HYPERVISOR_shared_info;
    1.24      vcpu_info_t   *vcpu_info = &s->vcpu_data[smp_processor_id()];
    1.25  
    1.26 -    local_irq_save(flags);
    1.27 +    vcpu_info->evtchn_upcall_pending = 0;
    1.28      
    1.29 -    while ( vcpu_info->evtchn_upcall_pending )
    1.30 +    /* NB. No need for a barrier here -- XCHG is a barrier on x86. */
    1.31 +    l1 = xchg(&vcpu_info->evtchn_pending_sel, 0);
    1.32 +    while ( l1 != 0 )
    1.33      {
    1.34 -        vcpu_info->evtchn_upcall_pending = 0;
    1.35 -        /* NB. No need for a barrier here -- XCHG is a barrier on x86. */
    1.36 -        l1 = xchg(&vcpu_info->evtchn_pending_sel, 0);
    1.37 -        while ( (l1i = ffs(l1)) != 0 )
    1.38 -        {
    1.39 -            l1i--;
    1.40 -            l1 &= ~(1 << l1i);
    1.41 +        l1i = __ffs(l1);
    1.42 +        l1 &= ~(1 << l1i);
    1.43          
    1.44 -            for ( ;; )
    1.45 -            {
    1.46 -                l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i];
    1.47 -                l2i = ffs(l2);
    1.48 -                if ( l2i == 0 )
    1.49 -                    break;
    1.50 -                l2i--;
    1.51 -                l2 &= ~(1 << l2i);
    1.52 +        while ( (l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i]) != 0 )
    1.53 +        {
    1.54 +            l2i = __ffs(l2);
    1.55 +            l2 &= ~(1 << l2i);
    1.56              
    1.57 -                port = (l1i << 5) + l2i;
    1.58 -                if ( (irq = evtchn_to_irq[port]) != -1 )
    1.59 -                    do_IRQ(irq, regs);
    1.60 -                else
    1.61 -                    evtchn_device_upcall(port);
    1.62 -            }
    1.63 +            port = (l1i << 5) + l2i;
    1.64 +            if ( (irq = evtchn_to_irq[port]) != -1 )
    1.65 +                do_IRQ(irq, regs);
    1.66 +            else
    1.67 +                evtchn_device_upcall(port);
    1.68          }
    1.69      }
    1.70 -
    1.71 -    local_irq_restore(flags);
    1.72  }
    1.73  
    1.74  static int find_unbound_irq(void)