direct-io.hg

changeset 15495:50fab2124ef0

[POWERPC][XEN] Stop sharing the MPIC between dom0 and Xen.
Xen is now the sole owner of the MPIC. Requires Xen Linux 2.6.18.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Fri Jul 06 16:25:10 2007 -0500 (2007-07-06)
parents abc2bd44e1dc
children 15fe623c3421
files xen/arch/powerpc/external.c xen/arch/powerpc/mpic_init.c xen/arch/powerpc/mpic_init.h
line diff
     1.1 --- a/xen/arch/powerpc/external.c	Fri Jul 06 16:21:39 2007 -0500
     1.2 +++ b/xen/arch/powerpc/external.c	Fri Jul 06 16:25:10 2007 -0500
     1.3 @@ -43,8 +43,6 @@ int vector_irq[NR_VECTORS] __read_mostly
     1.4  unsigned long io_apic_irqs;
     1.5  int ioapic_ack_new = 1;
     1.6  
     1.7 -static struct hw_interrupt_type *hc_irq;
     1.8 -
     1.9  /* deliver_ee: called with interrupts off when resuming every vcpu */
    1.10  void deliver_ee(struct cpu_user_regs *regs)
    1.11  {
    1.12 @@ -81,6 +79,7 @@ void do_external(struct cpu_user_regs *r
    1.13      BUG_ON(mfmsr() & MSR_EE);
    1.14  
    1.15      vec = xen_mpic_get_irq(regs);
    1.16 +    DBG(">HV: vec=%d, pc=0x%lx, msr=0x%lx\n", vec, regs->pc, regs->msr);
    1.17  
    1.18      if (irq_desc[vec].status & IRQ_PER_CPU) {
    1.19          /* x86 do_IRQ does not respect the per cpu flag.  */
    1.20 @@ -90,7 +89,6 @@ void do_external(struct cpu_user_regs *r
    1.21          desc->action->handler(vector_to_irq(vec), desc->action->dev_id, regs);
    1.22          desc->handler->end(vec);
    1.23      } else if (vec != -1) {
    1.24 -        DBG("EE:0x%lx isrc: %d\n", regs->msr, vec);
    1.25          regs->entry_vector = vec;
    1.26          do_IRQ(regs);
    1.27  
    1.28 @@ -106,87 +104,9 @@ void do_external(struct cpu_user_regs *r
    1.29      }
    1.30  }
    1.31  
    1.32 -static int xen_local_irq(unsigned int irq)
    1.33 -{
    1.34 -    irq_desc_t *desc;
    1.35 -    unsigned int vector;
    1.36 -
    1.37 -    vector = irq_to_vector(irq);
    1.38 -    desc = &irq_desc[vector];
    1.39 -
    1.40 -    return !(desc->status & IRQ_GUEST);
    1.41 -}
    1.42 -
    1.43 -static unsigned int xen_startup_irq(unsigned int irq)
    1.44 -{
    1.45 -    DBG("%s(%d)\n", __func__, irq);
    1.46 -    if (xen_local_irq(irq)) {
    1.47 -        return hc_irq->startup(irq);
    1.48 -    }
    1.49 -    return 0;
    1.50 -}
    1.51 -
    1.52 -static void xen_shutdown_irq(unsigned int irq)
    1.53 -{
    1.54 -    DBG("%s(%d)\n", __func__, irq);
    1.55 -    if (xen_local_irq(irq)) {
    1.56 -        hc_irq->shutdown(irq);
    1.57 -    }
    1.58 -}
    1.59 -
    1.60 -static void xen_enable_irq(unsigned int irq)
    1.61 -{
    1.62 -    DBG("%s(%d)\n", __func__, irq);
    1.63 -    if (xen_local_irq(irq)) {
    1.64 -        hc_irq->enable(irq);
    1.65 -    }
    1.66 -}
    1.67 -
    1.68 -static void xen_disable_irq(unsigned int irq)
    1.69 -{
    1.70 -    DBG("%s(%d)\n", __func__, irq);
    1.71 -    if (xen_local_irq(irq)) {
    1.72 -        hc_irq->disable(irq);
    1.73 -    }
    1.74 -}
    1.75 -    
    1.76 -static void xen_ack_irq(unsigned int irq)
    1.77 -{
    1.78 -    DBG("%s(%d)\n", __func__, irq);
    1.79 -    if (xen_local_irq(irq)) {
    1.80 -        if (hc_irq->ack) hc_irq->ack(irq);
    1.81 -    }
    1.82 -}
    1.83 -
    1.84 -static void xen_end_irq(unsigned int irq)
    1.85 -{
    1.86 -    DBG("%s(%d)\n", __func__, irq);
    1.87 -    if (xen_local_irq(irq)) {
    1.88 -        hc_irq->end(irq);
    1.89 -    }
    1.90 -}
    1.91 -
    1.92 -static void xen_set_affinity(unsigned int irq, cpumask_t mask)
    1.93 -{
    1.94 -    DBG("%s(%d)\n", __func__, irq);
    1.95 -    if (xen_local_irq(irq)) {
    1.96 -        if (hc_irq->set_affinity) hc_irq->set_affinity(irq, mask);
    1.97 -    }
    1.98 -}
    1.99 -
   1.100 -static struct hw_interrupt_type xen_irq = {
   1.101 -    .startup = xen_startup_irq,
   1.102 -    .enable = xen_enable_irq,
   1.103 -    .disable = xen_disable_irq,
   1.104 -    .shutdown = xen_shutdown_irq,
   1.105 -    .ack = xen_ack_irq,
   1.106 -    .end = xen_end_irq,
   1.107 -    .set_affinity = xen_set_affinity,
   1.108 -};
   1.109 -
   1.110  void init_IRQ(void)
   1.111  {
   1.112 -    hc_irq = xen_mpic_init(&xen_irq);
   1.113 +    xen_mpic_init();
   1.114  }
   1.115  
   1.116  void ack_APIC_irq(void)
   1.117 @@ -251,7 +171,6 @@ next:
   1.118  int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
   1.119  {
   1.120      BUG_ON(pval != pval);
   1.121 -
   1.122      return 0;
   1.123  }
   1.124  
     2.1 --- a/xen/arch/powerpc/mpic_init.c	Fri Jul 06 16:21:39 2007 -0500
     2.2 +++ b/xen/arch/powerpc/mpic_init.c	Fri Jul 06 16:25:10 2007 -0500
     2.3 @@ -322,43 +322,6 @@ static int find_mpic(void)
     2.4      return rc;
     2.5  }
     2.6  
     2.7 -#ifdef CONFIG_SHARE_MPIC
     2.8 -static struct hw_interrupt_type hc_irq;
     2.9 -
    2.10 -static struct hw_interrupt_type *share_mpic(
    2.11 -    struct hw_interrupt_type *mpic_irq,
    2.12 -    struct hw_interrupt_type *xen_irq)
    2.13 -{
    2.14 -    hc_irq.startup = mpic_irq->startup;
    2.15 -    mpic_irq->startup = xen_irq->startup;
    2.16 -
    2.17 -    hc_irq.enable = mpic_irq->enable;
    2.18 -    mpic_irq->enable = xen_irq->enable;
    2.19 -
    2.20 -    hc_irq.disable = mpic_irq->disable;
    2.21 -    mpic_irq->disable = xen_irq->disable;
    2.22 -
    2.23 -    hc_irq.shutdown = mpic_irq->shutdown;
    2.24 -    mpic_irq->shutdown = xen_irq->shutdown;
    2.25 -
    2.26 -    hc_irq.ack = mpic_irq->ack;
    2.27 -    mpic_irq->ack = xen_irq->ack;
    2.28 -
    2.29 -    hc_irq.end = mpic_irq->end;
    2.30 -    mpic_irq->end = xen_irq->end;
    2.31 -
    2.32 -    hc_irq.set_affinity = mpic_irq->set_affinity;
    2.33 -    mpic_irq->set_affinity = xen_irq->set_affinity;
    2.34 -
    2.35 -    return &hc_irq;
    2.36 -}
    2.37 -
    2.38 -#else  /* CONFIG_SHARE_MPIC */
    2.39 -
    2.40 -#define share_mpic(M,X) (M)
    2.41 -
    2.42 -#endif
    2.43 -
    2.44  static unsigned int mpic_startup_ipi(unsigned int irq)
    2.45  {
    2.46      mpic->hc_ipi.enable(irq);
    2.47 @@ -395,7 +358,11 @@ int request_irq(unsigned int irq,
    2.48      return retval;
    2.49  }
    2.50  
    2.51 -struct hw_interrupt_type *xen_mpic_init(struct hw_interrupt_type *xen_irq)
    2.52 +static void dummy_ack(unsigned int irq)
    2.53 +{
    2.54 +}
    2.55 +
    2.56 +void xen_mpic_init(void)
    2.57  {
    2.58      unsigned int isu_size;
    2.59      unsigned int irq_offset;
    2.60 @@ -403,7 +370,6 @@ struct hw_interrupt_type *xen_mpic_init(
    2.61      unsigned int ipi_offset;
    2.62      unsigned char *senses;
    2.63      unsigned int senses_count;
    2.64 -    struct hw_interrupt_type *hit;
    2.65  
    2.66      printk("%s: start\n", __func__);
    2.67  
    2.68 @@ -420,7 +386,7 @@ struct hw_interrupt_type *xen_mpic_init(
    2.69  
    2.70      if (find_mpic()) {
    2.71          printk("%s: ERROR: Could not find open pic.\n", __func__);
    2.72 -        return NULL;
    2.73 +        return;
    2.74      }
    2.75  
    2.76      mpic = mpic_alloc(opic_addr,
    2.77 @@ -431,17 +397,15 @@ struct hw_interrupt_type *xen_mpic_init(
    2.78      BUG_ON(mpic == NULL);
    2.79      mpic_init(mpic);
    2.80  
    2.81 -    hit = share_mpic(&mpic->hc_irq, xen_irq);
    2.82 -
    2.83      printk("%s: success\n", __func__);
    2.84  
    2.85 -    mpic->hc_ipi.ack = xen_irq->ack;
    2.86 +    mpic->hc_irq.ack = dummy_ack;
    2.87 +    mpic->hc_ipi.ack = dummy_ack;
    2.88      mpic->hc_ipi.startup = mpic_startup_ipi;
    2.89      mpic_request_ipis();
    2.90 -
    2.91 -    return hit;
    2.92  }
    2.93  
    2.94 +/* Note: reading the vector implicitly ACKs it in hardware. */
    2.95  int xen_mpic_get_irq(struct cpu_user_regs *regs)
    2.96  {
    2.97      BUG_ON(mpic == NULL);
     3.1 --- a/xen/arch/powerpc/mpic_init.h	Fri Jul 06 16:21:39 2007 -0500
     3.2 +++ b/xen/arch/powerpc/mpic_init.h	Fri Jul 06 16:25:10 2007 -0500
     3.3 @@ -21,9 +21,7 @@
     3.4  #ifndef _MPIC_INIT_H
     3.5  #define _MPIC_INIT_H
     3.6  
     3.7 -extern struct hw_interrupt_type *xen_mpic_init(
     3.8 -    struct hw_interrupt_type *xen_irq);
     3.9 -
    3.10 +extern void xen_mpic_init(void);
    3.11  extern int xen_mpic_get_irq(struct cpu_user_regs *regs);
    3.12  
    3.13  #endif  /* #ifndef _MPIC_INIT_H */