ia64/xen-unstable

changeset 3291:37cb59b9ddfd

bitkeeper revision 1.1159.1.484 (41c1a3e20WEWxhNQDQK6avGv36pVEA)

Remove per vcpu misdirect virq support.
author cl349@arcadians.cl.cam.ac.uk
date Thu Dec 16 15:04:02 2004 +0000 (2004-12-16)
parents b9ab4345fd1b
children 89eb81aebc69
files linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c xen/common/domain.c xen/common/event_channel.c xen/include/xen/event.h
line diff
     1.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c	Wed Dec 15 23:09:11 2004 +0000
     1.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c	Thu Dec 16 15:04:02 2004 +0000
     1.3 @@ -458,7 +458,6 @@ void local_setup_debug(void)
     1.4  }
     1.5  
     1.6  
     1.7 -extern void setup_misdirect_virq(void);
     1.8  extern void local_setup_timer(void);
     1.9  
    1.10  /*
    1.11 @@ -475,7 +474,6 @@ int __init start_secondary(void *unused)
    1.12  	smp_callin();
    1.13  	while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
    1.14  		rep_nop();
    1.15 -	setup_misdirect_virq();
    1.16  	local_setup_timer();
    1.17  	local_setup_debug();	/* XXX */
    1.18  	smp_intr_init();
     2.1 --- a/xen/common/domain.c	Wed Dec 15 23:09:11 2004 +0000
     2.2 +++ b/xen/common/domain.c	Thu Dec 16 15:04:02 2004 +0000
     2.3 @@ -328,9 +328,6 @@ long do_boot_vcpu(unsigned long vcpu, fu
     2.4      atomic_set(&ed->pausecnt, 0);
     2.5      shadow_lock_init(ed);
     2.6  
     2.7 -    if ( (rc = init_exec_domain_event_channels(ed)) != 0 )
     2.8 -        goto out;
     2.9 -
    2.10      memcpy(&ed->thread, &idle0_exec_domain.thread, sizeof(ed->thread));
    2.11  
    2.12      /* arch_do_createdomain */
     3.1 --- a/xen/common/event_channel.c	Wed Dec 15 23:09:11 2004 +0000
     3.2 +++ b/xen/common/event_channel.c	Thu Dec 16 15:04:02 2004 +0000
     3.3 @@ -259,8 +259,7 @@ static long evtchn_bind_virq(evtchn_bind
     3.4       * bound yet. The exception is the 'misdirect VIRQ', which is permanently 
     3.5       * bound to port 0.
     3.6       */
     3.7 -    if ( ((port = ed->virq_to_evtchn[virq]) !=
     3.8 -          (ed->eid * EVENT_CHANNELS_SPREAD)) ||
     3.9 +    if ( ((port = ed->virq_to_evtchn[virq]) != 0) ||
    3.10           (virq == VIRQ_MISDIRECT) ||
    3.11           ((port = get_free_port(ed)) < 0) )
    3.12          goto out;
    3.13 @@ -355,8 +354,7 @@ static long __evtchn_close(struct domain
    3.14      chn1 = d1->event_channel;
    3.15  
    3.16      /* NB. Port 0 is special (VIRQ_MISDIRECT). Never let it be closed. */
    3.17 -    if ( (port1 <= 0) || (port1 >= d1->max_event_channel) ||
    3.18 -         ((port1 & (EVENT_CHANNELS_SPREAD - 1)) == 0) )
    3.19 +    if ( (port1 <= 0) || (port1 >= d1->max_event_channel) )
    3.20      {
    3.21          rc = -EINVAL;
    3.22          goto out;
    3.23 @@ -641,31 +639,15 @@ long do_event_channel_op(evtchn_op_t *uo
    3.24  }
    3.25  
    3.26  
    3.27 -int init_exec_domain_event_channels(struct exec_domain *ed)
    3.28 -{
    3.29 -    struct domain *d = ed->domain;
    3.30 -    int port, ret = -EINVAL, virq;
    3.31 -
    3.32 -    spin_lock(&d->event_channel_lock);
    3.33 -    port = ed->eid * EVENT_CHANNELS_SPREAD;
    3.34 -    if ( ((port < d->max_event_channel &&
    3.35 -           d->event_channel[port].state != ECS_FREE)) ||
    3.36 -         (get_free_port(ed) != port) )
    3.37 -        goto out;
    3.38 -    d->event_channel[port].state  = ECS_VIRQ;
    3.39 -    d->event_channel[port].u.virq = VIRQ_MISDIRECT;
    3.40 -    for ( virq = 0; virq < NR_VIRQS; virq++ )
    3.41 -        ed->virq_to_evtchn[virq] = port;
    3.42 -    ret = 0;
    3.43 - out:
    3.44 -    spin_unlock(&d->event_channel_lock);
    3.45 -    return ret;
    3.46 -}
    3.47 -
    3.48  int init_event_channels(struct domain *d)
    3.49  {
    3.50      spin_lock_init(&d->event_channel_lock);
    3.51 -    return init_exec_domain_event_channels(d->exec_domain[0]);
    3.52 +    /* Call get_free_port to initialize d->event_channel */
    3.53 +    if ( get_free_port(d->exec_domain[0]) != 0 )
    3.54 +        return -EINVAL;
    3.55 +    d->event_channel[0].state  = ECS_VIRQ;
    3.56 +    d->event_channel[0].u.virq = VIRQ_MISDIRECT;
    3.57 +    return 0;
    3.58  }
    3.59  
    3.60  
     4.1 --- a/xen/include/xen/event.h	Wed Dec 15 23:09:11 2004 +0000
     4.2 +++ b/xen/include/xen/event.h	Thu Dec 16 15:04:02 2004 +0000
     4.3 @@ -57,7 +57,12 @@ static inline void evtchn_set_pending(st
     4.4   */
     4.5  static inline void send_guest_virq(struct exec_domain *ed, int virq)
     4.6  {
     4.7 -    evtchn_set_pending(ed, ed->virq_to_evtchn[virq]);
     4.8 +    int port = ed->virq_to_evtchn[virq];
     4.9 +
    4.10 +    /* Always deliver misdirect virq's to exec domain 0. */
    4.11 +    if ( unlikely(port == 0) )
    4.12 +        ed = ed->domain->exec_domain[0];
    4.13 +    evtchn_set_pending(ed, port);
    4.14  }
    4.15  
    4.16  /*