ia64/xen-unstable

changeset 5707:05b63285047c

Merge.
author sos22@douglas.cl.cam.ac.uk
date Fri Jul 08 17:38:38 2005 +0000 (2005-07-08)
parents 04d15727e6e8 9b73afea874e
children 215d8b2f3d94
files linux-2.6.11-xen-sparse/arch/xen/i386/kernel/smpboot.c linux-2.6.11-xen-sparse/arch/xen/kernel/ctrl_if.c linux-2.6.11-xen-sparse/arch/xen/kernel/evtchn.c xen/common/event_channel.c
line diff
     2.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/ctrl_if.c	Fri Jul 08 17:37:33 2005 +0000
     2.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/ctrl_if.c	Fri Jul 08 17:38:38 2005 +0000
     2.3 @@ -491,6 +491,8 @@ void ctrl_if_resume(void)
     2.4           * pick up its end of the event channel from 
     2.5           */
     2.6          evtchn_op_t op;
     2.7 +	extern void bind_evtchn_to_cpu(unsigned port, unsigned cpu);
     2.8 +
     2.9          op.cmd = EVTCHNOP_bind_interdomain;
    2.10          op.u.bind_interdomain.dom1 = DOMID_SELF;
    2.11          op.u.bind_interdomain.dom2 = DOMID_SELF;
    2.12 @@ -500,6 +502,7 @@ void ctrl_if_resume(void)
    2.13              BUG();
    2.14          xen_start_info.domain_controller_evtchn = op.u.bind_interdomain.port1;
    2.15          initdom_ctrlif_domcontroller_port   = op.u.bind_interdomain.port2;
    2.16 +	bind_evtchn_to_cpu(op.u.bind_interdomain.port1, 0);
    2.17      }
    2.18  
    2.19      /* Sync up with shared indexes. */
     3.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/evtchn.c	Fri Jul 08 17:37:33 2005 +0000
     3.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/evtchn.c	Fri Jul 08 17:38:38 2005 +0000
     3.3 @@ -86,7 +86,7 @@ static u32 cpu_evtchn_mask[NR_CPUS][NR_E
     3.4       cpu_evtchn_mask[cpu][idx] &                \
     3.5       ~(sh)->evtchn_mask[idx])
     3.6  
     3.7 -static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
     3.8 +void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
     3.9  {
    3.10      clear_bit(chn, (unsigned long *)cpu_evtchn_mask[cpu_evtchn[chn]]);
    3.11      set_bit(chn, (unsigned long *)cpu_evtchn_mask[cpu]);
    3.12 @@ -99,8 +99,9 @@ static void bind_evtchn_to_cpu(unsigned 
    3.13      ((sh)->evtchn_pending[idx] &                \
    3.14       ~(sh)->evtchn_mask[idx])
    3.15  
    3.16 -#define bind_evtchn_to_cpu(chn,cpu) ((void)0)
    3.17 -
    3.18 +void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
    3.19 +{
    3.20 +}
    3.21  #endif
    3.22  
    3.23  /* Upcall to generic IRQ layer. */
    3.24 @@ -228,6 +229,13 @@ void unbind_virq_from_irq(int virq)
    3.25          if ( HYPERVISOR_event_channel_op(&op) != 0 )
    3.26              panic("Failed to unbind virtual IRQ %d\n", virq);
    3.27  
    3.28 +	/* This is a slight hack.  Interdomain ports can be allocated
    3.29 +	   directly by userspace, and at that point they get bound by
    3.30 +	   Xen to vcpu 0.  We therefore need to make sure that if we
    3.31 +	   get an event on an event channel we don't know about vcpu 0
    3.32 +	   handles it.  Binding channels to vcpu 0 when closing them
    3.33 +	   achieves this. */
    3.34 +	bind_evtchn_to_cpu(evtchn, 0);
    3.35          evtchn_to_irq[evtchn] = -1;
    3.36          irq_to_evtchn[irq]    = -1;
    3.37          per_cpu(virq_to_irq, cpu)[virq]     = -1;
    3.38 @@ -288,6 +296,8 @@ void unbind_ipi_from_irq(int ipi)
    3.39  	if ( HYPERVISOR_event_channel_op(&op) != 0 )
    3.40  	    panic("Failed to unbind virtual IPI %d on cpu %d\n", ipi, cpu);
    3.41  
    3.42 +	/* See comments in unbind_virq_from_irq */
    3.43 +	bind_evtchn_to_cpu(evtchn, 0);
    3.44          evtchn_to_irq[evtchn] = -1;
    3.45          irq_to_evtchn[irq]    = -1;
    3.46  	per_cpu(ipi_to_evtchn, cpu)[ipi] = 0;
    3.47 @@ -495,6 +505,7 @@ static unsigned int startup_pirq(unsigne
    3.48  
    3.49      pirq_query_unmask(irq_to_pirq(irq));
    3.50  
    3.51 +    bind_evtchn_to_cpu(evtchn, 0);
    3.52      evtchn_to_irq[evtchn] = irq;
    3.53      irq_to_evtchn[irq]    = evtchn;
    3.54  
    3.55 @@ -520,6 +531,7 @@ static void shutdown_pirq(unsigned int i
    3.56      if ( HYPERVISOR_event_channel_op(&op) != 0 )
    3.57          panic("Failed to unbind physical IRQ %d\n", irq);
    3.58  
    3.59 +    bind_evtchn_to_cpu(evtchn, 0);
    3.60      evtchn_to_irq[evtchn] = -1;
    3.61      irq_to_evtchn[irq]    = -1;
    3.62  }
    3.63 @@ -619,6 +631,7 @@ void irq_resume(void)
    3.64          evtchn = op.u.bind_virq.port;
    3.65          
    3.66          /* Record the new mapping. */
    3.67 +	bind_evtchn_to_cpu(evtchn, 0);
    3.68          evtchn_to_irq[evtchn] = irq;
    3.69          irq_to_evtchn[irq]    = evtchn;
    3.70